NTRT Simulator
Version: Master
|
#include <tgStructure.h>
Public Member Functions | |
tgStructure (const tgStructure &orig) | |
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 | removePair (const tgPair &pair) |
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 | scale (double scaleFactor) |
void | scale (const btVector3 &referencePoint, double scaleFactor) |
void | addChild (tgStructure *child) |
void | addChild (const tgStructure &child) |
const tgNodes & | getNodes () const |
tgNode & | findNode (const std::string &name) |
btVector3 | getCentroid () const |
const tgPairs & | getPairs () const |
tgPair & | findPair (const btVector3 &from, const btVector3 &to) |
const std::vector< tgStructure * > & | getChildren () const |
tgStructure & | findChild (const std::string &name) |
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 54 of file tgStructure.h.
tgStructure::tgStructure | ( | const tgStructure & | orig | ) |
Copy constructor
Definition at line 44 of file tgStructure.cpp.
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 167 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 70 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 75 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 80 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 85 of file tgStructure.cpp.
void tgStructure::addRotation | ( | const btVector3 & | fixedPoint, |
const btVector3 & | axis, | ||
double | angle | ||
) |
Definition at line 120 of file tgStructure.cpp.
tgStructure & tgStructure::findChild | ( | const std::string & | name | ) |
Looks through children we own and those that belong to our children (using BFS) and returns the first child with a matching name. Throws an error if a child is not a found with a matching name. (added to accommodate structures encoded in YAML)
[in] | name | the name of the structure to find and return |
Definition at line 249 of file tgStructure.cpp.
tgNode & tgStructure::findNode | ( | const std::string & | name | ) |
Looks through nodes that we own and those that belong to child nodes (using BFS) and returns the first node with a matching name. Throws an error if a node is not a found with a matching name. (added to accommodate structures encoded in YAML)
[in] | name | the name of the node to find and return |
Definition at line 206 of file tgStructure.cpp.
tgPair & tgStructure::findPair | ( | const btVector3 & | from, |
const btVector3 & | to | ||
) |
Looks through pairs that we own and those that belong to child nodes (using BFS) and returns the first pair with matching endpoint coordinates. Throws an error if a pair is not a found. (added to accommodate structures encoded in YAML)
[in] | from | the vector on one end of the pair to find and return |
[in] | to | the vector on the other end of the pair to find and return |
Definition at line 226 of file tgStructure.cpp.
btVector3 tgStructure::getCentroid | ( | ) | const |
Returns the mean position of the nodes in the structure (including children) (added to accommodate structures encoded in YAML)
Definition at line 185 of file tgStructure.cpp.
|
inline |
Return our child structures
Definition at line 184 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 138 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 165 of file tgStructure.h.