本文整理汇总了C++中tgStructure::getChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ tgStructure::getChildren方法的具体用法?C++ tgStructure::getChildren怎么用?C++ tgStructure::getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tgStructure
的用法示例。
在下文中一共展示了tgStructure::getChildren方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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");
}
}
示例2: 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));
}
}
示例3: addMuscles
void ScarrArmModel::addMuscles(tgStructure& s) {
const std::vector<tgStructure*> children = s.getChildren();
s.addPair(0, 3, "olecranon muscle"); //NB actually fascial tissue
s.addPair(0, 4, "olecranon muscle"); //NB actually fascial tissue
s.addPair(1, 3, "olecranon muscle"); //NB actually fascial tissue
s.addPair(1, 4, "olecranon muscle"); //NB actually fascial tissue
s.addPair(2, 3, "olecranon muscle"); //NB actually fascial tissue
s.addPair(2, 4, "olecranon muscle"); //NB actually fascial tissue
s.addPair(0, 13, "olecranon muscle"); //NB actually fascial tissue
s.addPair(1, 13, "olecranon muscle"); //NB actually fascial tissue
s.addPair(11, 13, "olecranon muscle"); //NB actually fascial tissue
s.addPair(0, 14, "olecranon muscle"); //NB actually fascial tissue
s.addPair(1, 14, "olecranon muscle"); //NB actually fascial tissue
s.addPair(11, 14, "olecranon muscle"); //NB actually fascial tissue
s.addPair(0, 12, "olecranon muscle"); //NB actually fascial tissue
s.addPair(11, 12, "olecranon muscle"); //NB actually fascial tissue
s.addPair(0, 5, "brachioradialis muscle");
s.addPair(2, 5, "olecranon muscle"); //NB actually fascial tissue
s.addPair(3, 13, "right anconeus muscle");
s.addPair(4, 14, "left anconeus muscle");
}
示例4: addMuscles
void BigDoxieNoFeet::addMuscles(tgStructure& puppy){
//Time to add the muscles to the structure. Todo: try to clean this up some more.
std::vector<tgStructure*> children = puppy.getChildren();
for(std::size_t i = 2; i < (children.size() - (m_hips + m_legs)); i++) {
tgNodes n0 = children[i-2]->getNodes();
tgNodes n1 = children[i-1]->getNodes();
tgNodes n2 = children[i]->getNodes();
if(i==2){
//Extra muscles, to keep front vertebra from swinging.
puppy.addPair(n0[3], n1[3], tgString("spine front upper right muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[3], n1[4], tgString("spine front upper left muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[4], n1[3], tgString("spine front lower right muscleAct2 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[4], n1[4], tgString("spine front lower left muscleAct2 seg", i-2) + tgString(" seg", i-1));
}
//Add muscles to the puppy
if(i < 3){
if(i % 2 == 0){ //front
puppy.addPair(n0[1], n1[3], tgString("spine front lower right muscleAct2 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[1], n1[4], tgString("spine front lower left muscleAct2 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n1[3], tgString("spine front upper right muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n1[4], tgString("spine front upper left muscleAct1 seg", i-2) + tgString(" seg", i-1));
}
else{ //rear
puppy.addPair(n0[1], n1[3], tgString("spine rear upper left muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[1], n1[4], tgString("spine rear lower left muscleAct2 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n1[3], tgString("spine rear upper right muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n1[4], tgString("spine rear lower right muscleAct2 seg", i-2) + tgString(" seg", i-1));
}
}
if(i < m_segments){//Was 6
if(i % 2 == 0){
puppy.addPair(n0[1], n2[4], tgString("spine2 bottom muscleAct2 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n2[3], tgString("spine2 top muscleAct1 seg", i-2) + tgString(" seg", i-1));
}
else{
puppy.addPair(n0[1], n2[4], tgString("spine2 lateral left muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n2[3], tgString("spine2 lateral right muscleAct1 seg", i-2) + tgString(" seg", i-1));
}
}
if(i > 0 && i < m_segments){
if(i % 2 == 0){//rear
puppy.addPair(n1[1], n2[3], tgString("spine rear upper left muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[1], n2[4], tgString("spine rear lower left muscleAct2 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[3], tgString("spine rear upper right muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[4], tgString("spine rear lower right muscleAct2 seg", i-1) + tgString(" seg", i));
}
else{//front
puppy.addPair(n1[1], n2[3], tgString("spine front lower right muscleAct2 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[1], n2[4], tgString("spine front lower left muscleAct2 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[3], tgString("spine front upper right muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[4], tgString("spine front upper left muscleAct1 seg", i-1) + tgString(" seg", i));
}
}
if (i >= 2 && i < m_segments){
puppy.addPair(n1[3], n2[3], tgString("spine all spiral muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[4], n2[3], tgString("spine all spiral muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[3], n2[4], tgString("spine all spiral muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[4], n2[4], tgString("spine all spiral muscleAct1 seg", i-1) + tgString(" seg", i));
}
if(i == m_segments - 1){
//rear
puppy.addPair(n1[1], n2[2], tgString("spine rear lower left muscleAct2 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[2], tgString("spine rear lower right muscleAct2 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[1], n2[1], tgString("spine rear upper left muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[1], tgString("spine rear upper right muscleAct1 seg", i-1) + tgString(" seg", i));
}
}
//Now add muscles to hips....
tgNodes n0 = children[0]->getNodes();
tgNodes n1 = children[1]->getNodes();
tgNodes n2 = children[2]->getNodes();
tgNodes n3 = children[3]->getNodes();
tgNodes n4 = children[4]->getNodes();
tgNodes n5 = children[5]->getNodes();
tgNodes n6 = children[6]->getNodes();
tgNodes n7 = children[7]->getNodes();
tgNodes n8 = children[8]->getNodes();
tgNodes n9 = children[9]->getNodes();
tgNodes n10 = children[10]->getNodes();
tgNodes n11 = children[11]->getNodes();
tgNodes n12 = children[12]->getNodes();
tgNodes n13 = children[13]->getNodes();
tgNodes n14 = children[14]->getNodes();
tgNodes n15 = children[15]->getNodes();
tgNodes n16 = children[16]->getNodes();
//Left shoulder muscles
puppy.addPair(n9[1], n1[1], tgString("left shoulder rear upper muscleAct1 seg", 6) + tgString(" seg", 1));
//.........这里部分代码省略.........
示例5: addMuscles
void BigPuppySymmetricSpiralSegments::addMuscles(tgStructure& puppy){
//Time to add the muscles to the structure. Todo: try to clean this up some more.
std::vector<tgStructure*> children = puppy.getChildren();
for(std::size_t i = 2; i < (children.size() - (m_hips + m_legs)); i++) {
tgNodes n0 = children[i-2]->getNodes();
tgNodes n1 = children[i-1]->getNodes();
tgNodes n2 = children[i]->getNodes();
if(i==2){
//Extra muscles, to keep front vertebra from swinging.
puppy.addPair(n0[3], n1[3], tgString("spine all main front upper right muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[3], n1[4], tgString("spine all main front upper left muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[4], n1[3], tgString("spine all main front lower right muscleAct2 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[4], n1[4], tgString("spine all main front lower left muscleAct2 seg", i-2) + tgString(" seg", i-1));
}
//Add muscles to the puppy
if(i < 3){
if(i % 2 == 0){ //front
puppy.addPair(n0[1], n1[3], tgString("spine all main front lower right muscleAct2 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[1], n1[4], tgString("spine all main front lower left muscleAct2 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n1[3], tgString("spine all main front upper right muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n1[4], tgString("spine main front upper left muscleAct1 seg", i-2) + tgString(" seg", i-1));
}
else{ //rear
puppy.addPair(n0[1], n1[3], tgString("spine all main rear upper left muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[1], n1[4], tgString("spine all main rear lower left muscleAct2 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n1[3], tgString("spine all main rear upper right muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n1[4], tgString("spine all main rear lower right muscleAct2 seg", i-2) + tgString(" seg", i-1));
}
}
if(i < 7){//Was 6
if(i % 2 == 0){
puppy.addPair(n0[1], n2[4], tgString("spine2 bottom muscleAct2 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n2[3], tgString("spine2 top muscleAct1 seg", i-2) + tgString(" seg", i-1));
}
else{
puppy.addPair(n0[1], n2[4], tgString("spine2 lateral left muscleAct1 seg", i-2) + tgString(" seg", i-1));
puppy.addPair(n0[2], n2[3], tgString("spine2 lateral right muscleAct1 seg", i-2) + tgString(" seg", i-1));
}
}
if(i > 0 && i < 7){
if(i % 2 == 0){//rear
puppy.addPair(n1[1], n2[3], tgString("spine all main rear upper left muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[1], n2[4], tgString("spine all main rear lower left muscleAct2 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[3], tgString("spine all main rear upper right muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[4], tgString("spine main rear lower right muscleAct2 seg", i-1) + tgString(" seg", i));
}
else{//front
puppy.addPair(n1[1], n2[3], tgString("spine all main front lower right muscleAct2 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[1], n2[4], tgString("spine all main front lower left muscleAct2 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[3], tgString("spine all main front upper right muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[4], tgString("spine all main front upper left muscleAct1 seg", i-1) + tgString(" seg", i));
}
}
if (i >= 2 && i < 7){
puppy.addPair(n1[3], n2[3], tgString("spine all spiral muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[4], n2[3], tgString("spine all spiral muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[3], n2[4], tgString("spine all spiral muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[4], n2[4], tgString("spine spiral muscleAct1 seg", i-1) + tgString(" seg", i));
}
if(i == 6){
//rear
puppy.addPair(n1[1], n2[2], tgString("spine all rear lower left muscleAct2 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[2], tgString("spine all rear lower right muscleAct2 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[1], n2[1], tgString("spine all rear upper left muscleAct1 seg", i-1) + tgString(" seg", i));
puppy.addPair(n1[2], n2[1], tgString("spine all rear upper right muscleAct1 seg", i-1) + tgString(" seg", i));
}
}
//Now add muscles to hips....
tgNodes n0 = children[0]->getNodes();
tgNodes n1 = children[1]->getNodes();
tgNodes n2 = children[2]->getNodes();
tgNodes n3 = children[3]->getNodes();
tgNodes n4 = children[4]->getNodes();
tgNodes n5 = children[5]->getNodes();
tgNodes n6 = children[6]->getNodes();
tgNodes n7 = children[7]->getNodes();
tgNodes n8 = children[8]->getNodes();
tgNodes n9 = children[9]->getNodes();
tgNodes n10 = children[10]->getNodes();
tgNodes n11 = children[11]->getNodes();
tgNodes n12 = children[12]->getNodes();
tgNodes n13 = children[13]->getNodes();
tgNodes n14 = children[14]->getNodes();
//Adding long muscles to spine, for bending/arching:
//puppy.addPair(n0[2], n6[3], tgString("spine secondary top arching muscleAct seg", 0) + tgString(" seg", 6)); //Change these to something other than "spine " or "spine2" when it's time to implement new code for them!
//puppy.addPair(n0[1], n6[4], tgString("spine bottom arching muscleAct seg", 0) + tgString(" seg", 6));
//puppy.addPair(n1[4], n5[1], tgString("spine right lateral arching muscleAct seg", 1) + tgString(" seg", 5));
//.........这里部分代码省略.........