本文整理汇总了C++中tgStructure::addPair方法的典型用法代码示例。如果您正苦于以下问题:C++ tgStructure::addPair方法的具体用法?C++ tgStructure::addPair怎么用?C++ tgStructure::addPair使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tgStructure
的用法示例。
在下文中一共展示了tgStructure::addPair方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addRodsLeg
void BigPuppySymmetricSpiralSegments::addRodsLeg(tgStructure& s){
s.addPair(0,1,"rod");
s.addPair(1,2,"rod");
s.addPair(1,3,"rod");
s.addPair(1,4,"rod");
s.addPair(0,5,"rod");
}
示例2: addRodsLeg
void BigDoxieNoFeet::addRodsLeg(tgStructure& s){
s.addPair(0,1,"rod");
s.addPair(1,2,"rod");
s.addPair(1,3,"rod");
s.addPair(1,4,"rod");
s.addPair(0,5,"rod");
}
示例3: addRodsLeg
void BigPuppySymmetricArching::addRodsLeg(tgStructure& s) {
s.addPair(0,1,"rod");
s.addPair(1,2,"rod");
s.addPair(1,3,"rod");
s.addPair(1,4,"rod");
s.addPair(0,5,"rod");
}
示例4: addPairsB
void VerticalSpineModel::addPairsB(tgStructure& tetra)
{
tetra.addPair(0, 4, "rodB");
tetra.addPair(1, 4, "rodB");
tetra.addPair(2, 4, "rodB");
tetra.addPair(3, 4, "rodB");
}
示例5:
void T6Model::addRods(tgStructure& s)
{
s.addPair( 0, 1, "rod");
s.addPair( 2, 3, "rod");
s.addPair( 4, 5, "rod");
s.addPair( 6, 7, "rod");
s.addPair( 8, 9, "rod");
s.addPair(10, 11, "rod");
}
示例6:
void T12SuperBallPayload::addRods(tgStructure& s)
{
s.addPair( 0, 6, "r1 rod");
s.addPair( 1, 7, "r2 rod");
s.addPair( 2, 8, "r3 rod");
s.addPair( 3, 4, "r4 rod");
s.addPair( 5, 11, "r5 rod");
s.addPair( 9, 10, "r6 rod");
}
示例7: addRodsFoot
void BigPuppySymmetricArching::addRodsFoot(tgStructure& s) {
s.addPair(0,6,"rod");
s.addPair(1,7,"rod");
s.addPair(2,4,"rod");
s.addPair(3,5,"rod");
s.addPair(0,1,"rod");
s.addPair(0,3,"rod");
s.addPair(1,2,"rod");
s.addPair(2,3,"rod");
}
示例8: addNodeEdgePairs
void TensegrityModel::addNodeEdgePairs(tgStructure& structure, const std::string& tags, const Yam& pairs,
const std::string* childStructure1Name, const std::string* childStructure2Name, tgBuildSpec& spec) {
if (pairs.size() < 3) {
throw std::invalid_argument("Error: node_edge bonds must specify at least 3 node_edge pairs");
}
tgStructure& childStructure1 = structure.findChild(*childStructure1Name);
tgStructure& childStructure2 = structure.findChild(*childStructure2Name);
// these are used for transformations
std::vector<btVector3> structure1RefNodes;
std::vector<btVector3> structure2RefNodes;
// these are nodes
std::vector<tgNode*> ligands;
// these are edges
std::vector< std::pair<tgNode*, tgNode*> > receptors;
// populate refNodes arrays, ligands and receptors
parseNodeEdgePairs(childStructure1, childStructure2, structure1RefNodes, structure2RefNodes, ligands, receptors, pairs);
rotateAndTranslate(childStructure2, structure1RefNodes, structure2RefNodes);
std::vector<tgBuildSpec::RigidAgent*> rigidAgents = spec.getRigidAgents();
for (unsigned int i = 0; i < ligands.size(); i++) {
// remove old edge connections
// try removing from both children since we are not sure which child the pair belongs to
// (could add more information to receptors array so we don't have to do this)
removePair(childStructure1, receptors[i].first, receptors[i].second, true, rigidAgents, spec);
removePair(childStructure2, receptors[i].first, receptors[i].second, true, rigidAgents, spec);
for (unsigned int j = 0; j < ligands.size(); j++) {
// remove old string connections between nodes/ligands
// try removing from both children since we are not sure which child the node belongs to
removePair(childStructure1, ligands[i], ligands[j], false, rigidAgents, spec);
removePair(childStructure2, ligands[i], ligands[j], false, rigidAgents, spec);
}
// make new connection from edge -> node -> edge
structure.addPair(*(receptors[i].first), *ligands[i], tags);
structure.addPair(*ligands[i], *(receptors[i].second), tags);
}
}
示例9: addMuscles
// Add muscles that connect the segments
void VerticalSpineModel::addMuscles(tgStructure& snake)
{
const std::vector<tgStructure*> children = snake.getChildren();
for (size_t i = 1; i < children.size(); ++i)
{
tgNodes n0 = children[i-1]->getNodes();
tgNodes n1 = children[i ]->getNodes();
// vertical muscles
snake.addPair(n0[0], n1[0], "vertical muscle a");
snake.addPair(n0[1], n1[1], "vertical muscle b");
snake.addPair(n0[2], n1[2], "vertical muscle c");
snake.addPair(n0[3], n1[3], "vertical muscle d");
// saddle muscles
snake.addPair(n0[2], n1[1], tgString("saddle muscle seg", i-1));
snake.addPair(n0[3], n1[1], tgString("saddle muscle seg", i-1));
snake.addPair(n0[2], n1[0], tgString("saddle muscle seg", i-1));
snake.addPair(n0[3], n1[0], tgString("saddle muscle seg", i-1));
}
}
示例10: addPairs
//add param for top or bottom prismatic actuator
void DuCTTTestModel::addPairs(tgStructure& tetra)
{
tetra.addPair(3, 0, "back right rod");
tetra.addPair(3, 1, "back left rod");
tetra.addPair(2, 0, "front right rod");
tetra.addPair(2, 1, "front left rod");
tetra.addPair(0, 1, "top rod");
tetra.addPair(2, 3, "bottom rod");
// tetra.addPair(0, 1, "top prismatic");
// tetra.addPair(2, 3, "bottom prismatic");
}
示例11: addMuscles
// Add muscles that connect the segments
void DuCTTTestModel::addMuscles(tgStructure& snake)
{
const std::vector<tgStructure*> children = snake.getChildren();
for (size_t i = 1; i < children.size(); ++i)
{
tgNodes n0 = children[i-1]->getNodes();
tgNodes n1 = children[i ]->getNodes();
snake.addPair(n0[0], n1[0], "top right muscle");
snake.addPair(n0[1], n1[1], "top left muscle");
snake.addPair(n0[2], n1[0], "front right muscle");
snake.addPair(n0[2], n1[1], "front left muscle");
snake.addPair(n0[3], n1[0], "back right muscle");
snake.addPair(n0[3], n1[1], "back left muscle");
snake.addPair(n0[2], n1[2], "bottom front muscle");
snake.addPair(n0[3], n1[3], "bottom back muscle");
}
}
示例12: addNodeNodePairs
void TensegrityModel::addNodeNodePairs(tgStructure& structure, const std::string& tags, const Yam& pairs,
const std::string* childStructure1Name, const std::string* childStructure2Name) {
for (YAML::const_iterator pairPtr = pairs.begin(); pairPtr != pairs.end(); ++pairPtr) {
Yam pair = *pairPtr;
std::string node1Path = pair[0].as<std::string>();
std::string node2Path = pair[1].as<std::string>();
tgNode* node1;
tgNode* node2;
if (childStructure1Name && childStructure2Name) {
node1 = &getNode(structure.findChild(*childStructure1Name), node1Path);
node2 = &getNode(structure.findChild(*childStructure2Name), node2Path);
}
else {
node1 = &getNode(structure, node1Path);
node2 = &getNode(structure, node2Path);
}
structure.addPair(*node1, *node2, tags);
}
}
示例13: addNodes
// Nodes: center points of opposing faces of rectangles
void CraterDeep::addNodes(tgStructure& s) {
const int nBoxes = 4;
// Accumulating rotation on boxes
btVector3 rotationPoint = origin;
btVector3 rotationAxis = btVector3(0, 1, 0); // y-axis
double rotationAngle = M_PI/2;
addBoxNodes();
addBoxNodes();
addBoxNodes();
addBoxNodes();
for(int i=0;i<nodes.size();i+=2) {
s.addNode(nodes[i]);
s.addNode(nodes[i+1]);
s.addRotation(rotationPoint, rotationAxis, rotationAngle);
s.addPair(i, i+1, "box");
}
s.move(btVector3(0, -5, 0)); // Sink boxes into the ground
}
示例14: addRods
void ScarrArmModel::addRods(tgStructure& s) {
// ulna and radius
s.addPair(8, 12, "rod");
s.addPair(12, 14, "rod");
s.addPair(12, 13, "rod");
//olecranon
s.addPair(0, 1, "rod");
s.addPair(1, 2, "rod");
s.addPair(1, 11, "rod");
// humerus
s.addPair(3, 5, "humerus massless");
s.addPair(4, 5, "humerus massless");
s.addPair(5, 6, "humerus massless");
}
示例15: addNodes
// Nodes: center points of opposing faces of rectangles
void tgCraterDeep::addNodes(tgStructure& s) {
#if (0)
const int nBoxes = 4;
#endif // Suppress compiler warning unused variable
// Accumulating rotation on boxes
btVector3 rotationPoint = origin;
btVector3 rotationAxis = btVector3(0, 1, 0); // y-axis
double rotationAngle = M_PI/2;
addBoxNodes();
addBoxNodes();
addBoxNodes();
addBoxNodes();
for(std::size_t i=0;i<nodes.size();i+=2) {
s.addNode(nodes[i]);
s.addNode(nodes[i+1]);
s.addRotation(rotationPoint, rotationAxis, rotationAngle);
s.addPair(i, i+1, "box");
}
s.move(btVector3(0, -5, 0)); // Sink boxes into the ground
}