Tue, 08/03/2004 - 23:57
Forums:
Hi everybody,
I wonder if there is any solution to attach a simple attribute to any TopoDS_Shape, without using OCAF? Let's suppose that we have a simple, viewer type application, which doesn't support OCAF and I want to attach some simple type of attributes like: string, integer, double etc.
Thank's in advance,
Andras Kiss
Wed, 08/04/2004 - 00:18
Hi Andras,
I'm not 100% sure but :
you can attach attributes to a shape inside an application (as long as your shape is in memory) using for example a std::map or its OCC equivalent.
The problem is if you want to save this information. I think, whithout OCAF, you have no way to associate something to a shape in the .brep file.
The only way is to modify the code used for reading/writing shapes.
BTW, I'm planning to do that in exoTKAD.
HTH,
Stephane
http://www.exotk.org
Wed, 08/04/2004 - 03:34
Thanks. This should be a "good" solution, but what if my attribute is a more complex one. Let's say it's a struct.
Andras.
Wed, 08/04/2004 - 03:48
about the struct 2 solutions :
1/ you decompose your struct into basic types (int, double, char* ) and you save them all in the file.
2/ you serialize your struct into a string with a separator like :
struct mystruct
{
bool b;
int i;
double d;
strng s;
};
give "true@!@2@!@3.141592654@!@this is a string" with "@!@" as separator.
when you read it, you tokenize your string according to the separator and get all what you need.
HTH,
Stephane
Wed, 08/04/2004 - 03:38
Another question. This time very "off topic". Do you know how can I subscribe myself to this list? I changed my mail address and I want to receive the mailing list to my new address, but I dont find any info on how should I subscribe.
Andras.
Sun, 10/24/2004 - 12:48
Hello Andras,
Szeretném veled felvenni a kapcsolatot munka ügyben. Megtudnád adni az e-mail cimmed. Magyarországon laksz?
Légy szives küld el az e-mail cimmed a dragazsolt@chello.hu cimre.
Üdv: Zsolt Drága