FEM: replace tabs at line start by spaces

This commit is contained in:
Bernd Hahnebach 2016-04-14 20:49:43 +02:00 committed by wmayer
parent b58e37b950
commit bdbefdc52a
6 changed files with 621 additions and 621 deletions

View File

@ -152,7 +152,7 @@ SET(FemBase_SRCS
FemConstraint.h FemConstraint.h
FemMeshProperty.cpp FemMeshProperty.cpp
FemMeshProperty.h FemMeshProperty.h
) )
SOURCE_GROUP("Base types" FILES ${FemBase_SRCS}) SOURCE_GROUP("Base types" FILES ${FemBase_SRCS})
@ -167,7 +167,7 @@ SET(FemSet_SRCS
FemSetFacesObject.h FemSetFacesObject.h
FemSetGeometryObject.cpp FemSetGeometryObject.cpp
FemSetGeometryObject.h FemSetGeometryObject.h
) )
SOURCE_GROUP("Set objects" FILES ${FemSet_SRCS}) SOURCE_GROUP("Set objects" FILES ${FemSet_SRCS})
SET(FemConstraints_SRCS SET(FemConstraints_SRCS
@ -185,18 +185,18 @@ SET(FemConstraints_SRCS
FemConstraintPulley.h FemConstraintPulley.h
FemConstraintDisplacement.h FemConstraintDisplacement.h
FemConstraintDisplacement.cpp FemConstraintDisplacement.cpp
) )
SOURCE_GROUP("Constraints" FILES ${FemConstraints_SRCS}) SOURCE_GROUP("Constraints" FILES ${FemConstraints_SRCS})
SET(FemResult_SRCS SET(FemResult_SRCS
) )
SOURCE_GROUP("ResultObjects" FILES ${FemResult_SRCS}) SOURCE_GROUP("ResultObjects" FILES ${FemResult_SRCS})
SET(Fem_SRCS SET(Fem_SRCS
${FemBase_SRCS} ${FemBase_SRCS}
${FemSet_SRCS} ${FemSet_SRCS}
${FemConstraints_SRCS} ${FemConstraints_SRCS}
${FemResult_SRCS} ${FemResult_SRCS}
${Mod_SRCS} ${Mod_SRCS}
${Python_SRCS} ${Python_SRCS}
) )
@ -208,7 +208,7 @@ target_link_libraries(Fem ${Fem_LIBS})
fc_target_copy_resource(Fem fc_target_copy_resource(Fem
${CMAKE_SOURCE_DIR}/src/Mod/Fem ${CMAKE_SOURCE_DIR}/src/Mod/Fem
${CMAKE_BINARY_DIR}/Mod/Fem ${CMAKE_BINARY_DIR}/Mod/Fem
Init.py Init.py
${FemScripts_SRCS} ${FemScripts_SRCS}
${FemTests_SRCS} ${FemTests_SRCS}
) )

View File

@ -78,7 +78,7 @@ App::DocumentObjectExecReturn *ConstraintDisplacement::execute(void)
const char* ConstraintDisplacement::getViewProviderName(void) const const char* ConstraintDisplacement::getViewProviderName(void) const
{ {
return "FemGui::ViewProviderFemConstraintDisplacement"; return "FemGui::ViewProviderFemConstraintDisplacement";
} }
void ConstraintDisplacement::onChanged(const App::Property* prop) void ConstraintDisplacement::onChanged(const App::Property* prop)

View File

@ -683,53 +683,53 @@ void FemMesh::readNastran(const std::string &Filename)
_Mtrx = Base::Matrix4D(); _Mtrx = Base::Matrix4D();
std::ifstream inputfile; std::ifstream inputfile;
inputfile.open(Filename.c_str()); inputfile.open(Filename.c_str());
inputfile.seekg(std::ifstream::beg); inputfile.seekg(std::ifstream::beg);
std::string line1,line2,temp; std::string line1,line2,temp;
std::vector<string> token_results; std::vector<string> token_results;
token_results.clear(); token_results.clear();
Base::Vector3d current_node; Base::Vector3d current_node;
std::vector<Base::Vector3d> vertices; std::vector<Base::Vector3d> vertices;
vertices.clear(); vertices.clear();
std::vector<unsigned int> nodal_id; std::vector<unsigned int> nodal_id;
nodal_id.clear(); nodal_id.clear();
std::vector<unsigned int> tetra_element; std::vector<unsigned int> tetra_element;
std::vector<std::vector<unsigned int> > all_elements; std::vector<std::vector<unsigned int> > all_elements;
std::vector<unsigned int> element_id; std::vector<unsigned int> element_id;
element_id.clear(); element_id.clear();
bool nastran_free_format = false; bool nastran_free_format = false;
do do
{ {
std::getline(inputfile,line1); std::getline(inputfile,line1);
if (line1.size() == 0) continue; if (line1.size() == 0) continue;
if (!nastran_free_format && line1.find(",")!= std::string::npos) if (!nastran_free_format && line1.find(",")!= std::string::npos)
nastran_free_format = true; nastran_free_format = true;
if (!nastran_free_format && line1.find("GRID*")!= std::string::npos ) //We found a Grid line if (!nastran_free_format && line1.find("GRID*")!= std::string::npos ) //We found a Grid line
{ {
//Now lets extract the GRID Points = Nodes //Now lets extract the GRID Points = Nodes
//As each GRID Line consists of two subsequent lines we have to //As each GRID Line consists of two subsequent lines we have to
//take care of that as well //take care of that as well
std::getline(inputfile,line2); std::getline(inputfile,line2);
//Get the Nodal ID //Get the Nodal ID
nodal_id.push_back(atoi(line1.substr(8,24).c_str())); nodal_id.push_back(atoi(line1.substr(8,24).c_str()));
//Extract X Value //Extract X Value
current_node.x = atof(line1.substr(40,56).c_str()); current_node.x = atof(line1.substr(40,56).c_str());
//Extract Y Value //Extract Y Value
current_node.y = atof(line1.substr(56,72).c_str()); current_node.y = atof(line1.substr(56,72).c_str());
//Extract Z Value //Extract Z Value
current_node.z = atof(line2.substr(8,24).c_str()); current_node.z = atof(line2.substr(8,24).c_str());
vertices.push_back(current_node); vertices.push_back(current_node);
} }
else if (!nastran_free_format && line1.find("CTETRA")!= std::string::npos) else if (!nastran_free_format && line1.find("CTETRA")!= std::string::npos)
{ {
tetra_element.clear(); tetra_element.clear();
//Lets extract the elements //Lets extract the elements
//As each Element Line consists of two subsequent lines as well //As each Element Line consists of two subsequent lines as well
//we have to take care of that //we have to take care of that
//At a first step we only extract Quadratic Tetrahedral Elements //At a first step we only extract Quadratic Tetrahedral Elements
std::getline(inputfile,line2); std::getline(inputfile,line2);
unsigned int id = atoi(line1.substr(8,16).c_str()); unsigned int id = atoi(line1.substr(8,16).c_str());
int offset = 0; int offset = 0;
@ -741,111 +741,111 @@ void FemMesh::readNastran(const std::string &Filename)
offset = 2; offset = 2;
element_id.push_back(id); element_id.push_back(id);
tetra_element.push_back(atoi(line1.substr(24,32).c_str())); tetra_element.push_back(atoi(line1.substr(24,32).c_str()));
tetra_element.push_back(atoi(line1.substr(32,40).c_str())); tetra_element.push_back(atoi(line1.substr(32,40).c_str()));
tetra_element.push_back(atoi(line1.substr(40,48).c_str())); tetra_element.push_back(atoi(line1.substr(40,48).c_str()));
tetra_element.push_back(atoi(line1.substr(48,56).c_str())); tetra_element.push_back(atoi(line1.substr(48,56).c_str()));
tetra_element.push_back(atoi(line1.substr(56,64).c_str())); tetra_element.push_back(atoi(line1.substr(56,64).c_str()));
tetra_element.push_back(atoi(line1.substr(64,72).c_str())); tetra_element.push_back(atoi(line1.substr(64,72).c_str()));
tetra_element.push_back(atoi(line2.substr(8+offset,16+offset).c_str())); tetra_element.push_back(atoi(line2.substr(8+offset,16+offset).c_str()));
tetra_element.push_back(atoi(line2.substr(16+offset,24+offset).c_str())); tetra_element.push_back(atoi(line2.substr(16+offset,24+offset).c_str()));
tetra_element.push_back(atoi(line2.substr(24+offset,32+offset).c_str())); tetra_element.push_back(atoi(line2.substr(24+offset,32+offset).c_str()));
tetra_element.push_back(atoi(line2.substr(32+offset,40+offset).c_str())); tetra_element.push_back(atoi(line2.substr(32+offset,40+offset).c_str()));
all_elements.push_back(tetra_element); all_elements.push_back(tetra_element);
} }
else if (nastran_free_format && line1.find("GRID")!= std::string::npos ) //We found a Grid line else if (nastran_free_format && line1.find("GRID")!= std::string::npos ) //We found a Grid line
{ {
char_separator<char> sep(","); char_separator<char> sep(",");
tokenizer<char_separator<char> > tokens(line1, sep); tokenizer<char_separator<char> > tokens(line1, sep);
token_results.assign(tokens.begin(),tokens.end()); token_results.assign(tokens.begin(),tokens.end());
if (token_results.size() < 3) if (token_results.size() < 3)
continue;//Line does not include Nodal coordinates continue;//Line does not include Nodal coordinates
nodal_id.push_back(atoi(token_results[1].c_str())); nodal_id.push_back(atoi(token_results[1].c_str()));
current_node.x = atof(token_results[3].c_str()); current_node.x = atof(token_results[3].c_str());
current_node.y = atof(token_results[4].c_str()); current_node.y = atof(token_results[4].c_str());
current_node.z = atof(token_results[5].c_str()); current_node.z = atof(token_results[5].c_str());
vertices.push_back(current_node); vertices.push_back(current_node);
} }
else if (nastran_free_format && line1.find("CTETRA")!= std::string::npos) else if (nastran_free_format && line1.find("CTETRA")!= std::string::npos)
{ {
tetra_element.clear(); tetra_element.clear();
//Lets extract the elements //Lets extract the elements
//As each Element Line consists of two subsequent lines as well //As each Element Line consists of two subsequent lines as well
//we have to take care of that //we have to take care of that
//At a first step we only extract Quadratic Tetrahedral Elements //At a first step we only extract Quadratic Tetrahedral Elements
std::getline(inputfile,line2); std::getline(inputfile,line2);
char_separator<char> sep(","); char_separator<char> sep(",");
tokenizer<char_separator<char> > tokens(line1.append(line2), sep); tokenizer<char_separator<char> > tokens(line1.append(line2), sep);
token_results.assign(tokens.begin(),tokens.end()); token_results.assign(tokens.begin(),tokens.end());
if (token_results.size() < 11) if (token_results.size() < 11)
continue;//Line does not include enough nodal IDs continue;//Line does not include enough nodal IDs
element_id.push_back(atoi(token_results[1].c_str())); element_id.push_back(atoi(token_results[1].c_str()));
tetra_element.push_back(atoi(token_results[3].c_str())); tetra_element.push_back(atoi(token_results[3].c_str()));
tetra_element.push_back(atoi(token_results[4].c_str())); tetra_element.push_back(atoi(token_results[4].c_str()));
tetra_element.push_back(atoi(token_results[5].c_str())); tetra_element.push_back(atoi(token_results[5].c_str()));
tetra_element.push_back(atoi(token_results[6].c_str())); tetra_element.push_back(atoi(token_results[6].c_str()));
tetra_element.push_back(atoi(token_results[7].c_str())); tetra_element.push_back(atoi(token_results[7].c_str()));
tetra_element.push_back(atoi(token_results[8].c_str())); tetra_element.push_back(atoi(token_results[8].c_str()));
tetra_element.push_back(atoi(token_results[10].c_str())); tetra_element.push_back(atoi(token_results[10].c_str()));
tetra_element.push_back(atoi(token_results[11].c_str())); tetra_element.push_back(atoi(token_results[11].c_str()));
tetra_element.push_back(atoi(token_results[12].c_str())); tetra_element.push_back(atoi(token_results[12].c_str()));
tetra_element.push_back(atoi(token_results[13].c_str())); tetra_element.push_back(atoi(token_results[13].c_str()));
all_elements.push_back(tetra_element); all_elements.push_back(tetra_element);
} }
} }
while (inputfile.good()); while (inputfile.good());
inputfile.close(); inputfile.close();
Base::Console().Log(" %f: File read, start building mesh\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo())); Base::Console().Log(" %f: File read, start building mesh\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
//Now fill the SMESH datastructure //Now fill the SMESH datastructure
std::vector<Base::Vector3d>::const_iterator anodeiterator; std::vector<Base::Vector3d>::const_iterator anodeiterator;
SMESHDS_Mesh* meshds = this->myMesh->GetMeshDS(); SMESHDS_Mesh* meshds = this->myMesh->GetMeshDS();
meshds->ClearMesh(); meshds->ClearMesh();
unsigned int j=0; unsigned int j=0;
for(anodeiterator=vertices.begin(); anodeiterator!=vertices.end(); anodeiterator++) for(anodeiterator=vertices.begin(); anodeiterator!=vertices.end(); anodeiterator++)
{ {
meshds->AddNodeWithID((*anodeiterator).x,(*anodeiterator).y,(*anodeiterator).z,nodal_id[j]); meshds->AddNodeWithID((*anodeiterator).x,(*anodeiterator).y,(*anodeiterator).z,nodal_id[j]);
j++; j++;
} }
for(unsigned int i=0;i<all_elements.size();i++) for(unsigned int i=0;i<all_elements.size();i++)
{ {
//Die Reihenfolge wie hier die Elemente hinzugefügt werden ist sehr wichtig. //Die Reihenfolge wie hier die Elemente hinzugefügt werden ist sehr wichtig.
//Ansonsten ist eine konsistente Datenstruktur nicht möglich //Ansonsten ist eine konsistente Datenstruktur nicht möglich
//meshds->AddVolumeWithID //meshds->AddVolumeWithID
//( //(
// meshds->FindNode(all_elements[i][0]), // meshds->FindNode(all_elements[i][0]),
// meshds->FindNode(all_elements[i][2]), // meshds->FindNode(all_elements[i][2]),
// meshds->FindNode(all_elements[i][1]), // meshds->FindNode(all_elements[i][1]),
// meshds->FindNode(all_elements[i][3]), // meshds->FindNode(all_elements[i][3]),
// meshds->FindNode(all_elements[i][6]), // meshds->FindNode(all_elements[i][6]),
// meshds->FindNode(all_elements[i][5]), // meshds->FindNode(all_elements[i][5]),
// meshds->FindNode(all_elements[i][4]), // meshds->FindNode(all_elements[i][4]),
// meshds->FindNode(all_elements[i][9]), // meshds->FindNode(all_elements[i][9]),
// meshds->FindNode(all_elements[i][7]), // meshds->FindNode(all_elements[i][7]),
// meshds->FindNode(all_elements[i][8]), // meshds->FindNode(all_elements[i][8]),
// element_id[i] // element_id[i]
//); //);
meshds->AddVolumeWithID meshds->AddVolumeWithID
( (
meshds->FindNode(all_elements[i][1]), meshds->FindNode(all_elements[i][1]),
meshds->FindNode(all_elements[i][0]), meshds->FindNode(all_elements[i][0]),
meshds->FindNode(all_elements[i][2]), meshds->FindNode(all_elements[i][2]),
meshds->FindNode(all_elements[i][3]), meshds->FindNode(all_elements[i][3]),
meshds->FindNode(all_elements[i][4]), meshds->FindNode(all_elements[i][4]),
meshds->FindNode(all_elements[i][6]), meshds->FindNode(all_elements[i][6]),
meshds->FindNode(all_elements[i][5]), meshds->FindNode(all_elements[i][5]),
meshds->FindNode(all_elements[i][8]), meshds->FindNode(all_elements[i][8]),
meshds->FindNode(all_elements[i][7]), meshds->FindNode(all_elements[i][7]),
meshds->FindNode(all_elements[i][9]), meshds->FindNode(all_elements[i][9]),
element_id[i] element_id[i]
); );
} }
Base::Console().Log(" %f: Done \n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo())); Base::Console().Log(" %f: Done \n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
} }
@ -922,8 +922,8 @@ void FemMesh::writeABAQUS(const std::string &Filename) const
// dimension 3 // dimension 3
// //
//std::vector<int> c3d4 = boost::assign::list_of(0)(3)(1)(2); //std::vector<int> c3d4 = boost::assign::list_of(0)(3)(1)(2);
//std::vector<int> c3d10 = boost::assign::list_of(0)(2)(1)(3)(6)(5)(4)(7)(9)(8); //std::vector<int> c3d10 = boost::assign::list_of(0)(2)(1)(3)(6)(5)(4)(7)(9)(8);
std::vector<int> c3d4 = boost::assign::list_of(1)(0)(2)(3); std::vector<int> c3d4 = boost::assign::list_of(1)(0)(2)(3);
std::vector<int> c3d10 = boost::assign::list_of(1)(0)(2)(3)(4)(6)(5)(8)(7)(9); std::vector<int> c3d10 = boost::assign::list_of(1)(0)(2)(3)(4)(6)(5)(8)(7)(9);
// FIXME: get the right order // FIXME: get the right order
@ -1222,16 +1222,16 @@ void FemMesh::RestoreDocFile(Base::Reader &reader)
void FemMesh::transformGeometry(const Base::Matrix4D& rclTrf) void FemMesh::transformGeometry(const Base::Matrix4D& rclTrf)
{ {
//We perform a translation and rotation of the current active Mesh object //We perform a translation and rotation of the current active Mesh object
Base::Matrix4D clMatrix(rclTrf); Base::Matrix4D clMatrix(rclTrf);
SMDS_NodeIteratorPtr aNodeIter = myMesh->GetMeshDS()->nodesIterator(); SMDS_NodeIteratorPtr aNodeIter = myMesh->GetMeshDS()->nodesIterator();
Base::Vector3d current_node; Base::Vector3d current_node;
for (;aNodeIter->more();) { for (;aNodeIter->more();) {
const SMDS_MeshNode* aNode = aNodeIter->next(); const SMDS_MeshNode* aNode = aNodeIter->next();
current_node.Set(aNode->X(),aNode->Y(),aNode->Z()); current_node.Set(aNode->X(),aNode->Y(),aNode->Z());
current_node = clMatrix * current_node; current_node = clMatrix * current_node;
myMesh->GetMeshDS()->MoveNode(aNode,current_node.x,current_node.y,current_node.z); myMesh->GetMeshDS()->MoveNode(aNode,current_node.x,current_node.y,current_node.z);
} }
} }
void FemMesh::setTransform(const Base::Matrix4D& rclTrf) void FemMesh::setTransform(const Base::Matrix4D& rclTrf)
@ -1251,14 +1251,14 @@ Base::BoundBox3d FemMesh::getBoundBox(void) const
SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(getSMesh())->GetMeshDS(); SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(getSMesh())->GetMeshDS();
SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator(); SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator();
for (;aNodeIter->more();) { for (;aNodeIter->more();) {
const SMDS_MeshNode* aNode = aNodeIter->next(); const SMDS_MeshNode* aNode = aNodeIter->next();
Base::Vector3d vec(aNode->X(),aNode->Y(),aNode->Z()); Base::Vector3d vec(aNode->X(),aNode->Y(),aNode->Z());
// Apply the matrix to hold the BoundBox in absolute space. // Apply the matrix to hold the BoundBox in absolute space.
vec = _Mtrx * vec; vec = _Mtrx * vec;
box.Add(vec); box.Add(vec);
} }
return box; return box;
} }
@ -1294,8 +1294,8 @@ struct Fem::FemMesh::FemMeshInfo FemMesh::getInfo(void) const{
struct FemMeshInfo rtrn; struct FemMeshInfo rtrn;
SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(getSMesh())->GetMeshDS(); SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(getSMesh())->GetMeshDS();
const SMDS_MeshInfo& info = data->GetMeshInfo(); const SMDS_MeshInfo& info = data->GetMeshInfo();
rtrn.numFaces = data->NbFaces(); rtrn.numFaces = data->NbFaces();
rtrn.numNode = info.NbNodes(); rtrn.numNode = info.NbNodes();
rtrn.numTria = info.NbTriangles(); rtrn.numTria = info.NbTriangles();
rtrn.numQuad = info.NbQuadrangles(); rtrn.numQuad = info.NbQuadrangles();
@ -1310,37 +1310,37 @@ struct Fem::FemMesh::FemMeshInfo FemMesh::getInfo(void) const{
return rtrn; return rtrn;
} }
// for(unsigned int i=0;i<all_elements.size();i++) // for(unsigned int i=0;i<all_elements.size();i++)
// { // {
// //Die Reihenfolge wie hier die Elemente hinzugefügt werden ist sehr wichtig. // //Die Reihenfolge wie hier die Elemente hinzugefügt werden ist sehr wichtig.
// //Ansonsten ist eine konsistente Datenstruktur nicht möglich // //Ansonsten ist eine konsistente Datenstruktur nicht möglich
// meshds->AddVolumeWithID( // meshds->AddVolumeWithID(
// meshds->FindNode(all_elements[i][0]), // meshds->FindNode(all_elements[i][0]),
// meshds->FindNode(all_elements[i][2]), // meshds->FindNode(all_elements[i][2]),
// meshds->FindNode(all_elements[i][1]), // meshds->FindNode(all_elements[i][1]),
// meshds->FindNode(all_elements[i][3]), // meshds->FindNode(all_elements[i][3]),
// meshds->FindNode(all_elements[i][6]), // meshds->FindNode(all_elements[i][6]),
// meshds->FindNode(all_elements[i][5]), // meshds->FindNode(all_elements[i][5]),
// meshds->FindNode(all_elements[i][4]), // meshds->FindNode(all_elements[i][4]),
// meshds->FindNode(all_elements[i][9]), // meshds->FindNode(all_elements[i][9]),
// meshds->FindNode(all_elements[i][7]), // meshds->FindNode(all_elements[i][7]),
// meshds->FindNode(all_elements[i][8]), // meshds->FindNode(all_elements[i][8]),
// element_id[i] // element_id[i]
// ); // );
// } // }
Base::Quantity FemMesh::getVolume(void)const Base::Quantity FemMesh::getVolume(void)const
{ {
SMDS_VolumeIteratorPtr aVolIter = myMesh->GetMeshDS()->volumesIterator(); SMDS_VolumeIteratorPtr aVolIter = myMesh->GetMeshDS()->volumesIterator();
//Calculate Mesh Volume //Calculate Mesh Volume
//For an accurate Volume Calculation of a quadratic Tetrahedron //For an accurate Volume Calculation of a quadratic Tetrahedron
//we have to calculate the Volume of 8 Sub-Tetrahedrons //we have to calculate the Volume of 8 Sub-Tetrahedrons
Base::Vector3d a,b,c,a_b_product; Base::Vector3d a,b,c,a_b_product;
double volume = 0.0; double volume = 0.0;
for (;aVolIter->more();) for (;aVolIter->more();)
{ {
const SMDS_MeshVolume* aVol = aVolIter->next(); const SMDS_MeshVolume* aVol = aVolIter->next();
if ( aVol->NbNodes() != 10 ) continue; if ( aVol->NbNodes() != 10 ) continue;
@ -1357,56 +1357,56 @@ Base::Quantity FemMesh::getVolume(void)const
Base::Vector3d v9(aVol->GetNode(9)->X(),aVol->GetNode(9)->Y(),aVol->GetNode(9)->Z()); Base::Vector3d v9(aVol->GetNode(9)->X(),aVol->GetNode(9)->Y(),aVol->GetNode(9)->Z());
//1,5,8,7 //1,5,8,7
a = v4 -v0 ; a = v4 -v0 ;
b = v7 -v0 ; b = v7 -v0 ;
c = v6 -v0 ; c = v6 -v0 ;
a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y; a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y;
volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z)); volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z));
//5,9,8,7 //5,9,8,7
a = v8 -v4 ; a = v8 -v4 ;
b = v7 -v4 ; b = v7 -v4 ;
c = v6 -v4 ; c = v6 -v4 ;
a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y; a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y;
volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z)); volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z));
//5,2,9,7 //5,2,9,7
a = v1 -v4 ; a = v1 -v4 ;
b = v8 -v4 ; b = v8 -v4 ;
c = v6 -v4 ; c = v6 -v4 ;
a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y; a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y;
volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z)); volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z));
//2,6,9,7 //2,6,9,7
a = v5 -v1 ; a = v5 -v1 ;
b = v8 -v1 ; b = v8 -v1 ;
c = v6 -v1 ; c = v6 -v1 ;
a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y; a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y;
volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z)); volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z));
//9,6,10,7 //9,6,10,7
a = v5 -v8 ; a = v5 -v8 ;
b = v9 -v8 ; b = v9 -v8 ;
c = v6 -v8 ; c = v6 -v8 ;
a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y; a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y;
volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z)); volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z));
//6,3,10,7 //6,3,10,7
a = v2 -v5 ; a = v2 -v5 ;
b = v9 -v5 ; b = v9 -v5 ;
c = v6 -v5 ; c = v6 -v5 ;
a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y; a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y;
volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z)); volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z));
//8,9,10,7 //8,9,10,7
a = v8 -v7 ; a = v8 -v7 ;
b = v9 -v7 ; b = v9 -v7 ;
c = v6 -v7 ; c = v6 -v7 ;
a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y; a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y;
volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z)); volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z));
//8,9,10,4 //8,9,10,4
a = v8 -v7 ; a = v8 -v7 ;
b = v9 -v7 ; b = v9 -v7 ;
c = v3 -v7 ; c = v3 -v7 ;
a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y; a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y;
volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z)); volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z));
} }
return Base::Quantity(volume,Unit::Volume); return Base::Quantity(volume,Unit::Volume);

View File

@ -1,242 +1,242 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd"> <GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
<PythonExport <PythonExport
Father="ComplexGeoDataPy" Father="ComplexGeoDataPy"
Name="FemMeshPy" Name="FemMeshPy"
Twin="FemMesh" Twin="FemMesh"
TwinPointer="FemMesh" TwinPointer="FemMesh"
Include="Mod/Fem/App/FemMesh.h" Include="Mod/Fem/App/FemMesh.h"
Namespace="Fem" Namespace="Fem"
FatherInclude="App/ComplexGeoDataPy.h" FatherInclude="App/ComplexGeoDataPy.h"
FatherNamespace="Data" FatherNamespace="Data"
Constructor="true"> Constructor="true">
<Documentation> <Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="Juergen.Riegel@web.de" /> <Author Licence="LGPL" Name="Juergen Riegel" EMail="Juergen.Riegel@web.de" />
<UserDocu>FemMesh class</UserDocu> <UserDocu>FemMesh class</UserDocu>
</Documentation> </Documentation>
<Methode Name="setShape"> <Methode Name="setShape">
<Documentation> <Documentation>
<UserDocu>set the Part shape to mesh</UserDocu> <UserDocu>set the Part shape to mesh</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="compute"> <Methode Name="compute">
<Documentation> <Documentation>
<UserDocu>Update the internal mesh structure</UserDocu> <UserDocu>Update the internal mesh structure</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="addHypothesis"> <Methode Name="addHypothesis">
<Documentation> <Documentation>
<UserDocu>Add hypothesis</UserDocu> <UserDocu>Add hypothesis</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="setStanardHypotheses"> <Methode Name="setStanardHypotheses">
<Documentation> <Documentation>
<UserDocu>Set some standard hypotheses for the whole shape</UserDocu> <UserDocu>Set some standard hypotheses for the whole shape</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="addNode"> <Methode Name="addNode">
<Documentation> <Documentation>
<UserDocu>Add a node by setting (x,y,z).</UserDocu> <UserDocu>Add a node by setting (x,y,z).</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="addEdge"> <Methode Name="addEdge">
<Documentation> <Documentation>
<UserDocu>Add an edge by setting two node indices.</UserDocu> <UserDocu>Add an edge by setting two node indices.</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="addFace"> <Methode Name="addFace">
<Documentation> <Documentation>
<UserDocu>Add a face by setting three node indices.</UserDocu> <UserDocu>Add a face by setting three node indices.</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="addQuad"> <Methode Name="addQuad">
<Documentation> <Documentation>
<UserDocu>Add a quad by setting four node indices.</UserDocu> <UserDocu>Add a quad by setting four node indices.</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="addVolume"> <Methode Name="addVolume">
<Documentation> <Documentation>
<UserDocu>Add a volume by setting an arbitrary number of node indices.</UserDocu> <UserDocu>Add a volume by setting an arbitrary number of node indices.</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="read"> <Methode Name="read">
<Documentation> <Documentation>
<UserDocu>Read in an DAT, UNV, MED or STL file.</UserDocu> <UserDocu>Read in an DAT, UNV, MED or STL file.</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="write" Const="true"> <Methode Name="write" Const="true">
<Documentation> <Documentation>
<UserDocu>write out an DAT, UNV, MED or STL file.</UserDocu> <UserDocu>write out an DAT, UNV, MED or STL file.</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="writeABAQUS" Const="true"> <Methode Name="writeABAQUS" Const="true">
<Documentation> <Documentation>
<UserDocu>write out as ABAQUS.</UserDocu> <UserDocu>write out as ABAQUS.</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="setTransform"> <Methode Name="setTransform">
<Documentation> <Documentation>
<UserDocu>Use a Placement object to perform a translation or rotation</UserDocu> <UserDocu>Use a Placement object to perform a translation or rotation</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="copy" Const="true"> <Methode Name="copy" Const="true">
<Documentation> <Documentation>
<UserDocu>Make a copy of this FEM mesh.</UserDocu> <UserDocu>Make a copy of this FEM mesh.</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="getVolumesByFace" Const="true"> <Methode Name="getVolumesByFace" Const="true">
<Documentation> <Documentation>
<UserDocu>Return a dict of volume IDs and face IDs which belong to a TopoFace</UserDocu> <UserDocu>Return a dict of volume IDs and face IDs which belong to a TopoFace</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="getccxVolumesByFace" Const="true"> <Methode Name="getccxVolumesByFace" Const="true">
<Documentation> <Documentation>
<UserDocu>Return a dict of volume IDs and ccx face numbers which belong to a TopoFace</UserDocu> <UserDocu>Return a dict of volume IDs and ccx face numbers which belong to a TopoFace</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="getNodeById" Const="true"> <Methode Name="getNodeById" Const="true">
<Documentation> <Documentation>
<UserDocu>Get the node position vector by an Node-ID</UserDocu> <UserDocu>Get the node position vector by an Node-ID</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="getNodesBySolid" Const="true"> <Methode Name="getNodesBySolid" Const="true">
<Documentation> <Documentation>
<UserDocu>Return a list of node IDs which belong to a TopoSolid</UserDocu> <UserDocu>Return a list of node IDs which belong to a TopoSolid</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="getNodesByFace" Const="true"> <Methode Name="getNodesByFace" Const="true">
<Documentation> <Documentation>
<UserDocu>Return a list of node IDs which belong to a TopoFace</UserDocu> <UserDocu>Return a list of node IDs which belong to a TopoFace</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="getNodesByEdge" Const="true"> <Methode Name="getNodesByEdge" Const="true">
<Documentation> <Documentation>
<UserDocu>Return a list of node IDs which belong to a TopoEdge</UserDocu> <UserDocu>Return a list of node IDs which belong to a TopoEdge</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="getNodesByVertex" Const="true"> <Methode Name="getNodesByVertex" Const="true">
<Documentation> <Documentation>
<UserDocu>Return a list of node IDs which belong to a TopoVertex</UserDocu> <UserDocu>Return a list of node IDs which belong to a TopoVertex</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="getElementNodes" Const="true"> <Methode Name="getElementNodes" Const="true">
<Documentation> <Documentation>
<UserDocu>Return a tuple of node IDs to a given element ID</UserDocu> <UserDocu>Return a tuple of node IDs to a given element ID</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Attribute Name="Nodes" ReadOnly="true"> <Attribute Name="Nodes" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Dictionary of Nodes by ID (int ID:Vector())</UserDocu> <UserDocu>Dictionary of Nodes by ID (int ID:Vector())</UserDocu>
</Documentation> </Documentation>
<Parameter Name="Nodes" Type="Dict"/> <Parameter Name="Nodes" Type="Dict"/>
</Attribute> </Attribute>
<Attribute Name="NodeCount" ReadOnly="true"> <Attribute Name="NodeCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of nodes in the Mesh.</UserDocu> <UserDocu>Number of nodes in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="NodeCount" Type="Int"/> <Parameter Name="NodeCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="Edges" ReadOnly="true"> <Attribute Name="Edges" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Tuple of edge IDs</UserDocu> <UserDocu>Tuple of edge IDs</UserDocu>
</Documentation> </Documentation>
<Parameter Name="Edges" Type="Tuple"/> <Parameter Name="Edges" Type="Tuple"/>
</Attribute> </Attribute>
<Attribute Name="EdgeCount" ReadOnly="true"> <Attribute Name="EdgeCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of edges in the Mesh.</UserDocu> <UserDocu>Number of edges in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="EdgeCount" Type="Int"/> <Parameter Name="EdgeCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="Faces" ReadOnly="true"> <Attribute Name="Faces" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Tuple of face IDs</UserDocu> <UserDocu>Tuple of face IDs</UserDocu>
</Documentation> </Documentation>
<Parameter Name="Faces" Type="Tuple"/> <Parameter Name="Faces" Type="Tuple"/>
</Attribute> </Attribute>
<Attribute Name="FaceCount" ReadOnly="true"> <Attribute Name="FaceCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Faces in the Mesh.</UserDocu> <UserDocu>Number of Faces in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="FaceCount" Type="Int"/> <Parameter Name="FaceCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="TriangleCount" ReadOnly="true"> <Attribute Name="TriangleCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Triangles in the Mesh.</UserDocu> <UserDocu>Number of Triangles in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="TriangleCount" Type="Int"/> <Parameter Name="TriangleCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="QuadrangleCount" ReadOnly="true"> <Attribute Name="QuadrangleCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Quadrangles in the Mesh.</UserDocu> <UserDocu>Number of Quadrangles in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="QuadrangleCount" Type="Int"/> <Parameter Name="QuadrangleCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="PolygonCount" ReadOnly="true"> <Attribute Name="PolygonCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Quadrangles in the Mesh.</UserDocu> <UserDocu>Number of Quadrangles in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="PolygonCount" Type="Int"/> <Parameter Name="PolygonCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="Volumes" ReadOnly="true"> <Attribute Name="Volumes" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Tuple of volume IDs</UserDocu> <UserDocu>Tuple of volume IDs</UserDocu>
</Documentation> </Documentation>
<Parameter Name="Volumes" Type="Tuple"/> <Parameter Name="Volumes" Type="Tuple"/>
</Attribute> </Attribute>
<Attribute Name="VolumeCount" ReadOnly="true"> <Attribute Name="VolumeCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Volumes in the Mesh.</UserDocu> <UserDocu>Number of Volumes in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="VolumeCount" Type="Int"/> <Parameter Name="VolumeCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="TetraCount" ReadOnly="true"> <Attribute Name="TetraCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Tetras in the Mesh.</UserDocu> <UserDocu>Number of Tetras in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="TetraCount" Type="Int"/> <Parameter Name="TetraCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="HexaCount" ReadOnly="true"> <Attribute Name="HexaCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Hexas in the Mesh.</UserDocu> <UserDocu>Number of Hexas in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="HexaCount" Type="Int"/> <Parameter Name="HexaCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="PyramidCount" ReadOnly="true"> <Attribute Name="PyramidCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Pyramids in the Mesh.</UserDocu> <UserDocu>Number of Pyramids in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="PyramidCount" Type="Int"/> <Parameter Name="PyramidCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="PrismCount" ReadOnly="true"> <Attribute Name="PrismCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Prisms in the Mesh.</UserDocu> <UserDocu>Number of Prisms in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="PrismCount" Type="Int"/> <Parameter Name="PrismCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="PolyhedronCount" ReadOnly="true"> <Attribute Name="PolyhedronCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Polyhedrons in the Mesh.</UserDocu> <UserDocu>Number of Polyhedrons in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="PolyhedronCount" Type="Int"/> <Parameter Name="PolyhedronCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="SubMeshCount" ReadOnly="true"> <Attribute Name="SubMeshCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of SubMeshs in the Mesh.</UserDocu> <UserDocu>Number of SubMeshs in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="SubMeshCount" Type="Int"/> <Parameter Name="SubMeshCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="GroupCount" ReadOnly="true"> <Attribute Name="GroupCount" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Number of Groups in the Mesh.</UserDocu> <UserDocu>Number of Groups in the Mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="GroupCount" Type="Int"/> <Parameter Name="GroupCount" Type="Int"/>
</Attribute> </Attribute>
<Attribute Name="Volume" ReadOnly="true"> <Attribute Name="Volume" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>Volume of the mesh.</UserDocu> <UserDocu>Volume of the mesh.</UserDocu>
</Documentation> </Documentation>
<Parameter Name="Volume" Type="Object"/> <Parameter Name="Volume" Type="Object"/>
</Attribute> </Attribute>
</PythonExport> </PythonExport>
</GenerateModel> </GenerateModel>

View File

@ -203,94 +203,94 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
//OvG: Translation indication //OvG: Translation indication
if(!xFree) if(!xFree)
{ {
SbMatrix mx; SbMatrix mx;
mx.setTransform(base, rotx, SbVec3f(1,1,1)); mx.setTransform(base, rotx, SbVec3f(1,1,1));
matricesx[idx] = mx; matricesx[idx] = mx;
idx++; idx++;
} }
if(!yFree) if(!yFree)
{ {
SbMatrix my; SbMatrix my;
my.setTransform(base, roty, SbVec3f(1,1,1)); my.setTransform(base, roty, SbVec3f(1,1,1));
matricesy[idy] = my; matricesy[idy] = my;
idy++; idy++;
} }
if(!zFree) if(!zFree)
{ {
SbMatrix mz; SbMatrix mz;
mz.setTransform(base, rotz, SbVec3f(1,1,1)); mz.setTransform(base, rotz, SbVec3f(1,1,1));
matricesz[idz] = mz; matricesz[idz] = mz;
idz++; idz++;
} }
//OvG: Rotation indication //OvG: Rotation indication
if(!rotxFree) if(!rotxFree)
{ {
SbMatrix mrotx; SbMatrix mrotx;
mrotx.setTransform(base, rotx, SbVec3f(1,1,1)); mrotx.setTransform(base, rotx, SbVec3f(1,1,1));
matricesrotx[idrotx] = mrotx; matricesrotx[idrotx] = mrotx;
idrotx++; idrotx++;
} }
if(!rotyFree) if(!rotyFree)
{ {
SbMatrix mroty; SbMatrix mroty;
mroty.setTransform(base, roty, SbVec3f(1,1,1)); mroty.setTransform(base, roty, SbVec3f(1,1,1));
matricesroty[idroty] = mroty; matricesroty[idroty] = mroty;
idroty++; idroty++;
} }
if(!rotzFree) if(!rotzFree)
{ {
SbMatrix mrotz; SbMatrix mrotz;
mrotz.setTransform(base, rotz, SbVec3f(1,1,1)); mrotz.setTransform(base, rotz, SbVec3f(1,1,1));
matricesrotz[idrotz] = mrotz; matricesrotz[idrotz] = mrotz;
idrotz++; idrotz++;
} }
#else #else
//OvG: Translation indication //OvG: Translation indication
if(!xFree) if(!xFree)
{ {
SoSeparator* sepx = new SoSeparator(); SoSeparator* sepx = new SoSeparator();
createPlacement(sepx, base, rotx); createPlacement(sepx, base, rotx);
createDisplacement(sepx, scaledheight, scaledwidth); //OvG: Scaling createDisplacement(sepx, scaledheight, scaledwidth); //OvG: Scaling
pShapeSep->addChild(sepx); pShapeSep->addChild(sepx);
} }
if(!yFree) if(!yFree)
{ {
SoSeparator* sepy = new SoSeparator(); SoSeparator* sepy = new SoSeparator();
createPlacement(sepy, base, roty); createPlacement(sepy, base, roty);
createDisplacement(sepy, scaledheight, scaledwidth); //OvG: Scaling createDisplacement(sepy, scaledheight, scaledwidth); //OvG: Scaling
pShapeSep->addChild(sepy); pShapeSep->addChild(sepy);
} }
if(!zFree) if(!zFree)
{ {
SoSeparator* sepz = new SoSeparator(); SoSeparator* sepz = new SoSeparator();
createPlacement(sepz, base, rotz); createPlacement(sepz, base, rotz);
createDisplacement(sepz, scaledheight, scaledwidth); //OvG: Scaling createDisplacement(sepz, scaledheight, scaledwidth); //OvG: Scaling
pShapeSep->addChild(sepz); pShapeSep->addChild(sepz);
} }
//OvG: Rotation indication //OvG: Rotation indication
if(!rotxFree) if(!rotxFree)
{ {
SoSeparator* sepx = new SoSeparator(); SoSeparator* sepx = new SoSeparator();
createPlacement(sepx, base, rotx); createPlacement(sepx, base, rotx);
createRotation(sepx, scaledheight, scaledwidth); //OvG: Scaling createRotation(sepx, scaledheight, scaledwidth); //OvG: Scaling
pShapeSep->addChild(sepx); pShapeSep->addChild(sepx);
} }
if(!rotyFree) if(!rotyFree)
{ {
SoSeparator* sepy = new SoSeparator(); SoSeparator* sepy = new SoSeparator();
createPlacement(sepy, base, roty); createPlacement(sepy, base, roty);
createRotation(sepy, scaledheight, scaledwidth); //OvG: Scaling createRotation(sepy, scaledheight, scaledwidth); //OvG: Scaling
pShapeSep->addChild(sepy); pShapeSep->addChild(sepy);
} }
if(!rotzFree) if(!rotzFree)
{ {
SoSeparator* sepz = new SoSeparator(); SoSeparator* sepz = new SoSeparator();
createPlacement(sepz, base, rotz); createPlacement(sepz, base, rotz);
createRotation(sepz, scaledheight, scaledwidth); //OvG: Scaling createRotation(sepz, scaledheight, scaledwidth); //OvG: Scaling
pShapeSep->addChild(sepz); pShapeSep->addChild(sepz);
} }
#endif #endif
n++; n++;
} }

View File

@ -1,64 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd"> <GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
<PythonExport <PythonExport
Father="ViewProviderPy" Father="ViewProviderPy"
Name="ViewProviderFemMeshPy" Name="ViewProviderFemMeshPy"
Twin="ViewProviderFemMesh" Twin="ViewProviderFemMesh"
TwinPointer="ViewProviderFemMesh" TwinPointer="ViewProviderFemMesh"
Include="Mod/Fem/Gui/ViewProviderFemMesh.h" Include="Mod/Fem/Gui/ViewProviderFemMesh.h"
Namespace="FemGui" Namespace="FemGui"
FatherInclude="Gui/ViewProviderPy.h" FatherInclude="Gui/ViewProviderPy.h"
FatherNamespace="Gui" FatherNamespace="Gui"
Constructor="false" Constructor="false"
Delete="false"> Delete="false">
<Documentation> <Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="Juergen.Riegel@web.de" /> <Author Licence="LGPL" Name="Juergen Riegel" EMail="Juergen.Riegel@web.de" />
<UserDocu>ViewProviderFemMesh class</UserDocu> <UserDocu>ViewProviderFemMesh class</UserDocu>
</Documentation> </Documentation>
<Methode Name="applyDisplacement"> <Methode Name="applyDisplacement">
<Documentation> <Documentation>
<UserDocu></UserDocu> <UserDocu></UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="setNodeColorByScalars"> <Methode Name="setNodeColorByScalars">
<Documentation> <Documentation>
<UserDocu>Sets mesh node colors using element list and value list.</UserDocu> <UserDocu>Sets mesh node colors using element list and value list.</UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Methode Name="setNodeDisplacementByVectors"> <Methode Name="setNodeDisplacementByVectors">
<Documentation> <Documentation>
<UserDocu></UserDocu> <UserDocu></UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Attribute Name="NodeColor" ReadOnly="false"> <Attribute Name="NodeColor" ReadOnly="false">
<Documentation> <Documentation>
<UserDocu>Postprocessing color of the nodes. The faces between the nodes gets interpolated. </UserDocu> <UserDocu>Postprocessing color of the nodes. The faces between the nodes gets interpolated. </UserDocu>
</Documentation> </Documentation>
<Parameter Name="NodeColor" Type="Dict"/> <Parameter Name="NodeColor" Type="Dict"/>
</Attribute> </Attribute>
<Attribute Name="ElementColor" ReadOnly="false"> <Attribute Name="ElementColor" ReadOnly="false">
<Documentation> <Documentation>
<UserDocu>Postprocessing color of the elements. All faces of the element get the same color. </UserDocu> <UserDocu>Postprocessing color of the elements. All faces of the element get the same color. </UserDocu>
</Documentation> </Documentation>
<Parameter Name="ElementColor" Type="Dict"/> <Parameter Name="ElementColor" Type="Dict"/>
</Attribute> </Attribute>
<Attribute Name="NodeDisplacement" ReadOnly="false"> <Attribute Name="NodeDisplacement" ReadOnly="false">
<Documentation> <Documentation>
<UserDocu>Postprocessing color of the the nodes. The faces between the nodes gets interpolated. </UserDocu> <UserDocu>Postprocessing color of the the nodes. The faces between the nodes gets interpolated. </UserDocu>
</Documentation> </Documentation>
<Parameter Name="NodeDisplacement" Type="Dict"/> <Parameter Name="NodeDisplacement" Type="Dict"/>
</Attribute> </Attribute>
<Attribute Name="HighlightedNodes" ReadOnly="false"> <Attribute Name="HighlightedNodes" ReadOnly="false">
<Documentation> <Documentation>
<UserDocu>List of nodes which gets highlighted</UserDocu> <UserDocu>List of nodes which gets highlighted</UserDocu>
</Documentation> </Documentation>
<Parameter Name="HighlightedNodes" Type="List"/> <Parameter Name="HighlightedNodes" Type="List"/>
</Attribute> </Attribute>
<Attribute Name="VisibleElementFaces" ReadOnly="true"> <Attribute Name="VisibleElementFaces" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu>A List of elements and faces which are actually shown. This are all surface faces of the mesh</UserDocu> <UserDocu>A List of elements and faces which are actually shown. This are all surface faces of the mesh</UserDocu>
</Documentation> </Documentation>
<Parameter Name="VisibleElementFaces" Type="List"/> <Parameter Name="VisibleElementFaces" Type="List"/>
</Attribute> </Attribute>
</PythonExport> </PythonExport>
</GenerateModel> </GenerateModel>