NTRT Simulator
v1.1
|
#include <tgStructure.h>
Public Member Functions | |
tgStructure (const tgTags &tags) | |
tgStructure (const std::string &space_separated_tags) | |
void | addNode (double x, double y, double z, std::string tags="") |
void | addNode (tgNode &newNode) |
void | addPair (int fromNodeIdx, int toNodeIdx, std::string tags="") |
void | addPair (const btVector3 &from, const btVector3 &to, std::string tags="") |
void | move (const btVector3 &offset) |
void | addRotation (const btVector3 &fixedPoint, const btVector3 &axis, double angle) |
void | addRotation (const btVector3 &fixedPoint, const btVector3 &fromOrientation, const btVector3 &toOrientation) |
void | addRotation (const btVector3 &fixedPoint, const btQuaternion &rotation) |
void | addChild (tgStructure *child) |
const tgNodes & | getNodes () const |
const tgPairs & | getPairs () const |
const std::vector< tgStructure * > & | getChildren () const |
void | addTags (const std::string &space_separated_tags) |
void | addTags (const tgTags &tags) |
bool | hasTag (const std::string tag) const |
bool | hasAllTags (std::string tags) |
bool | hasAnyTags (const std::string tags) |
bool | hasNoTags () |
tgTags & | getTags () |
const tgTags & | getTags () const |
void | setTags (tgTags tags) |
std::string | getTagStr (std::string delim=" ") const |
Representation of a geometric structure containing nodes (points), pairs of nodes, and child structures. Note that nodes, pairs, and structures are all taggable and searchable by tags. Further tools in the chain are used to create physical representations of the structures with rods, muscles, etc. Note that tags can be anything you want – you'll specify the tags that you want to use to build things like rods or muscles during the build phase.
Definition at line 53 of file tgStructure.h.
void tgStructure::addChild | ( | tgStructure * | child | ) |
Add a child structure. Note that this will be copied rather than being a reference or a pointer.
Definition at line 130 of file tgStructure.cpp.
void tgStructure::addNode | ( | double | x, |
double | y, | ||
double | z, | ||
std::string | tags = "" |
||
) |
Add a node using x, y, and z (just for convenience)
Definition at line 56 of file tgStructure.cpp.
void tgStructure::addNode | ( | tgNode & | newNode | ) |
Add a node using a node - since keeping track of nodes seems more useful than pairs for string attachments
Definition at line 61 of file tgStructure.cpp.
void tgStructure::addPair | ( | int | fromNodeIdx, |
int | toNodeIdx, | ||
std::string | tags = "" |
||
) |
Add a pair that connects two of our nodes together
Definition at line 66 of file tgStructure.cpp.
void tgStructure::addPair | ( | const btVector3 & | from, |
const btVector3 & | to, | ||
std::string | tags = "" |
||
) |
Add a pair that connects any two vector3s
Definition at line 71 of file tgStructure.cpp.
void tgStructure::addRotation | ( | const btVector3 & | fixedPoint, |
const btVector3 & | axis, | ||
double | angle | ||
) |
Definition at line 99 of file tgStructure.cpp.
|
inline |
Return our child structures
Definition at line 131 of file tgStructure.h.
|
inline |
Get all of our nodes Note: This only includes nodes owned by this structure. use 'findNodes' to search child nodes as well.
Definition at line 113 of file tgStructure.h.
|
inline |
Get all of our pairs Note: This only includes nodes owned by this structure. Use 'findPairs' to search child nodes as well.
Definition at line 123 of file tgStructure.h.