SilverScreen Solid Modeler

Entity and Primitive Paths

Entity and Primitive Paths

Previous topic Next topic  

Entity and Primitive Paths

Previous topic Next topic JavaScript is required for the print function  



Entity and Primitive Paths


Every primitive and entity may be referenced by means of a path.  The path convention used for entities is nearly identical to the convention that is used in Windows.


Entity Paths

Suppose that the object “door” is contained within a block “wall” which is contained within the block “room”.  Further suppose that “room” is contained within the root block.  Then path to this object is




and the path to the block that contains “door” is




Given a path to an entity, the function get_bos will return a pointer to the entity.


C / C++ Code


 BOS_NODE  *bos;
 char      *path;


 bos = get_bos ( path );




Primitive Paths

Each primitive within an object has a unique identifying number.  This id number, which appears in the PRIM_NODE structure, is automatically assigned when the primitive is created.  A primitive within an object may be referenced by appending the id number to the object path.  The path to the primitive with id 4 within the object “door” is




Each line node contains a reference to an edge.  The edge, as noted earlier, contains a reference to two vertices.  Suppose that the above primitive is a line.  The first and second vertices of this line can be referenced by appending vertex number to the line path:




Given a path to a primitive, the pointer to the primitive can be obtained with the get_prim function.  This function returns a pointer to the primitive while retrieving a pointer to the object that is the parent of the primitive. Note that the OBJECT_NODE pointer passed to get_prim is updated to point to the object node containing the primitive.


C / C++ Code


 PRIM_NODE    *prim;
 char         *path;


 prim = get_prim ( path,&obj );