本文整理汇总了C++中tgStructure::addNode方法的典型用法代码示例。如果您正苦于以下问题:C++ tgStructure::addNode方法的具体用法?C++ tgStructure::addNode怎么用?C++ tgStructure::addNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tgStructure
的用法示例。
在下文中一共展示了tgStructure::addNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addNodesVertebra
void BigPuppySymmetricArching::addNodesVertebra(tgStructure& s, double r) {
s.addNode(0,0,0); //Node 0
s.addNode(r,0,r); //Node 1
s.addNode(r,0,-r); //Node 2
s.addNode(-r,0,-r); //Node 3
s.addNode(-r,0,r); //Node 4
}
示例2: addNodesVertebra
void BigDoxieNoFeet::addNodesVertebra(tgStructure& s, double r){
s.addNode(0,0,0); //Node 0
s.addNode(r,0,r); //Node 1
s.addNode(r,0,-r); //Node 2
s.addNode(-r,0,-r); //Node 3
s.addNode(-r,0,r); //Node 4
}
示例3: addNodesLeg
void BigDoxieNoFeet::addNodesLeg(tgStructure& s, double r){
s.addNode(0,0,0); //0: Bottom Center of lower leg segment
s.addNode(0,r,0); //1: Center of lower leg segment
s.addNode(r,r,0); //2: Right of lower leg segment
s.addNode(-r,r,0); //3: Left of lower leg segment
s.addNode(0,2*r,0); //4: Top of lower leg segment
s.addNode(0,-r/2,0); //5: Leg segment extension for connections to foot.
}
示例4: addNodes
void DuCTTTestModel::addNodes(tgStructure& tetra, double edge, double height)
{
// right
tetra.addNode(-edge / 2.0, 0, tgUtil::round(std::sqrt(3.0) / 2.0 * height));
// left
tetra.addNode( edge / 2.0, 0, tgUtil::round(std::sqrt(3.0) / 2.0 * height));
// front
tetra.addNode(0, edge/2.0, 0);
// back
tetra.addNode(0, -edge/2.0, 0);
}
示例5: addNodes
void VerticalSpineModel::addNodes(tgStructure& tetra, double edge, double height)
{
// right
tetra.addNode( c.edge / 2.0, 0, 0); // node 0
// left
tetra.addNode( -c.edge / 2.0, 0, 0); // node 1
// top
tetra.addNode(0, c.height, -edge / 2.0); // node 2
// front
tetra.addNode(0, c.height, edge / 2.0); // node 3
// middle
tetra.addNode(0, c.height/2, 0); // node 4
}
示例6: addNodes
void TensegrityModel::addNodes(tgStructure& structure, const Yam& nodes) {
if (!nodes) return;
for (YAML::const_iterator node = nodes.begin(); node != nodes.end(); ++node) {
std::string name = node->first.as<std::string>();
Yam xyz = node->second;
double x = xyz[0].as<double>();
double y = xyz[1].as<double>();
double z = xyz[2].as<double>();
structure.addNode(x, y, z, name);
}
}
示例7: addNodesFoot
void BigDoxieNoFeet::addNodesFoot(tgStructure& s, double r1, double r2){
s.addNode(r2,0,r2);//0
s.addNode(r2,0,-r2);//1
s.addNode(-r2,0,-r2);//2
s.addNode(-r2,0,r2);//3
s.addNode(r2/2,r1/2,0);//4
s.addNode(0,r1/2,-r2/2);//5
s.addNode(-r2/2,r1/2,0);//6
s.addNode(0,r1/2,r2/2);//7
}
示例8: addNodesFoot
void BigPuppySymmetricArching::addNodesFoot(tgStructure& s, double r1, double r2) {
s.addNode(r2,0,r2);//0
s.addNode(r2,0,-r2);//1
s.addNode(-r2,0,-r2);//2
s.addNode(-r2,0,r2);//3
s.addNode(r2/2,r1/2,0);//4
s.addNode(0,r1/2,-r2/2);//5
s.addNode(-r2/2,r1/2,0);//6
s.addNode(0,r1/2,r2/2);//7
}
示例9: 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
}
示例10: 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
}
示例11: addNodes
void ScarrArmModel::addNodes(tgStructure& s) {
const double scale = 0.5;
const double bone_scale = 0.3;
const size_t nNodes = 15 + 2; //2 for massless rod
// Average Adult Male Measurements with scale
// Lengths are in mm
const double a = 22 * scale; //ulnta distal width
const double b = 334 * scale * bone_scale; //ulna length
const double c = 265 * scale * bone_scale; //humerus length //NB: in model, c==b
//const double d = 66 * scale; // humerus epicondylar width
//const double e = 246 * scale * bone_scale; //radius length
const double f = 25 * scale; // humerus head radius
const double g = 17 * scale; //ulna proximal width
const double x = a/2;
const double z = c/2;
//Format: (x, z, y)
nodePositions.push_back(btVector3(g, 0, 0));
nodePositions.push_back(btVector3(0, -g, 0));
nodePositions.push_back(btVector3(-a/2, 0, 0));
nodePositions.push_back(btVector3(0, 0, g));
nodePositions.push_back(btVector3(0, 0, -g));
nodePositions.push_back(btVector3(0, g, 0));
nodePositions.push_back(btVector3(0, c, 0));
nodePositions.push_back(btVector3(x, z, 0));
nodePositions.push_back(btVector3(b+a/2, -g, 0));
nodePositions.push_back(btVector3(0, c+2, f));
nodePositions.push_back(btVector3(0, c+2, -f));
//Added 6/17/15
nodePositions.push_back(btVector3(a/2, -2*g, 0));
//ulna and radius
nodePositions.push_back(btVector3(3*a/2, -g, 0));
nodePositions.push_back(btVector3(3*a/4, -g, g));
nodePositions.push_back(btVector3(3*a/4, -g, -g));
nodePositions.push_back(btVector3(f, c+2, 0));
nodePositions.push_back(btVector3(-f, c+2, 0));
for(size_t i=0;i<nNodes;i++) {
s.addNode(nodePositions[i][0],nodePositions[i][1],nodePositions[i][2]);
}
}
示例12:
void T12SuperBallPayload::addNodes(tgStructure& s)
{
const double half_length = c.rod_length / 2;
nodePositions.push_back(btVector3(-half_length, c.rod_space, 0)); // 0
nodePositions.push_back(btVector3( half_length, c.rod_space, 0)); // 1
nodePositions.push_back(btVector3(0, half_length, -c.rod_space)); // 2
nodePositions.push_back(btVector3(-c.rod_space, 0, -half_length)); // 3
nodePositions.push_back(btVector3( c.rod_space, 0, -half_length)); // 4
nodePositions.push_back(btVector3(0, -half_length, -c.rod_space)); // 5
nodePositions.push_back(btVector3(-half_length, -c.rod_space, 0)); // 6
nodePositions.push_back(btVector3( half_length, -c.rod_space, 0)); // 7
nodePositions.push_back(btVector3(0, half_length, c.rod_space)); // 8
nodePositions.push_back(btVector3(-c.rod_space, 0, half_length)); // 9
nodePositions.push_back(btVector3( c.rod_space, 0, half_length)); // 10
nodePositions.push_back(btVector3(0, -half_length, c.rod_space)); // 11
for(int i=0;i<12;i++)
{
s.addNode(nodePositions[i][0],nodePositions[i][1],nodePositions[i][2]);
}
}
示例13:
void T6Model::addNodes(tgStructure& s)
{
const double half_length = c.rod_length / 2;
s.addNode(-c.rod_space, -half_length, 0); // 0
s.addNode(-c.rod_space, half_length, 0); // 1
s.addNode( c.rod_space, -half_length, 0); // 2
s.addNode( c.rod_space, half_length, 0); // 3
s.addNode(0, -c.rod_space, -half_length); // 4
s.addNode(0, -c.rod_space, half_length); // 5
s.addNode(0, c.rod_space, -half_length); // 6
s.addNode(0, c.rod_space, half_length); // 7
s.addNode(-half_length, 0, c.rod_space); // 8
s.addNode( half_length, 0, c.rod_space); // 9
s.addNode(-half_length, 0, -c.rod_space); // 10
s.addNode( half_length, 0, -c.rod_space); // 11
}
示例14: addNodesHip
void BigDoxieNoFeet::addNodesHip(tgStructure& s, double r){
s.addNode(0,0,0); //Node 0
s.addNode(0,r,r); //Node 1
s.addNode(0,-r,-r); //Node 2
s.addNode(0,-r,r); //Node 3
}
示例15: addNodesHip
void BigPuppySymmetricArching::addNodesHip(tgStructure& s, double r) {
s.addNode(0,0,0); //Node 0
s.addNode(0,r,r); //Node 1
s.addNode(0,-r,-r); //Node 2
s.addNode(0,-r,r); //Node 3
}