NTRT Simulator  v1.1
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgStructure Class Reference

#include <tgStructure.h>

Inheritance diagram for tgStructure:
Collaboration diagram for tgStructure:

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 tgNodesgetNodes () const
 
const tgPairsgetPairs () 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 ()
 
tgTagsgetTags ()
 
const tgTagsgetTags () const
 
void setTags (tgTags tags)
 
std::string getTagStr (std::string delim=" ") const
 

Detailed Description

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.

Member Function Documentation

void tgStructure::addChild ( tgStructure child)

Add a child structure. Note that this will be copied rather than being a reference or a pointer.

Todo:
: check to make sure we don't already have one of these structures (what does that mean?)
Note
: We only want to check that pairs are the same at build time, since one structure may build the pairs, while another may not depending on its tags.

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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 
)
Todo:
add rotate functionality

Definition at line 99 of file tgStructure.cpp.

const std::vector<tgStructure*>& tgStructure::getChildren ( ) const
inline

Return our child structures

Definition at line 131 of file tgStructure.h.

const tgNodes& tgStructure::getNodes ( ) const
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.

const tgPairs& tgStructure::getPairs ( ) const
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.


The documentation for this class was generated from the following files: