FEM: remove trailing whitespaces
This commit is contained in:
parent
14eb6869a9
commit
b58e37b950
|
@ -50,7 +50,7 @@
|
||||||
#include "FemConstraintPressure.h"
|
#include "FemConstraintPressure.h"
|
||||||
#include "FemConstraintGear.h"
|
#include "FemConstraintGear.h"
|
||||||
#include "FemConstraintPulley.h"
|
#include "FemConstraintPulley.h"
|
||||||
#include "FemConstraintDisplacement.h"
|
#include "FemConstraintDisplacement.h"
|
||||||
|
|
||||||
#include "FemResultObject.h"
|
#include "FemResultObject.h"
|
||||||
#include "FemSolverObject.h"
|
#include "FemSolverObject.h"
|
||||||
|
@ -115,7 +115,7 @@ PyMODINIT_FUNC initFem()
|
||||||
// NOTE: To finish the initialization of our own type objects we must
|
// NOTE: To finish the initialization of our own type objects we must
|
||||||
// call PyType_Ready, otherwise we run into a segmentation fault, later on.
|
// call PyType_Ready, otherwise we run into a segmentation fault, later on.
|
||||||
// This function is responsible for adding inherited slots from a type's base class.
|
// This function is responsible for adding inherited slots from a type's base class.
|
||||||
|
|
||||||
Fem::FemAnalysis ::init();
|
Fem::FemAnalysis ::init();
|
||||||
Fem::FemAnalysisPython ::init();
|
Fem::FemAnalysisPython ::init();
|
||||||
Fem::DocumentObject ::init();
|
Fem::DocumentObject ::init();
|
||||||
|
|
|
@ -220,7 +220,7 @@ private:
|
||||||
if (!PyArg_ParseTuple(args.ptr(), "O!", &(FemMeshPy::Type), &pcObj))
|
if (!PyArg_ParseTuple(args.ptr(), "O!", &(FemMeshPy::Type), &pcObj))
|
||||||
throw Py::Exception();
|
throw Py::Exception();
|
||||||
|
|
||||||
App::Document *pcDoc = App::GetApplication().getActiveDocument();
|
App::Document *pcDoc = App::GetApplication().getActiveDocument();
|
||||||
if (!pcDoc)
|
if (!pcDoc)
|
||||||
pcDoc = App::GetApplication().newDocument();
|
pcDoc = App::GetApplication().newDocument();
|
||||||
|
|
||||||
|
|
|
@ -154,8 +154,8 @@ SET(FemBase_SRCS
|
||||||
FemMeshProperty.h
|
FemMeshProperty.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP("Base types" FILES ${FemBase_SRCS})
|
SOURCE_GROUP("Base types" FILES ${FemBase_SRCS})
|
||||||
|
|
||||||
|
|
||||||
SET(FemSet_SRCS
|
SET(FemSet_SRCS
|
||||||
FemSetObject.cpp
|
FemSetObject.cpp
|
||||||
FemSetObject.h
|
FemSetObject.h
|
||||||
|
@ -169,7 +169,7 @@ SET(FemSet_SRCS
|
||||||
FemSetGeometryObject.h
|
FemSetGeometryObject.h
|
||||||
)
|
)
|
||||||
SOURCE_GROUP("Set objects" FILES ${FemSet_SRCS})
|
SOURCE_GROUP("Set objects" FILES ${FemSet_SRCS})
|
||||||
|
|
||||||
SET(FemConstraints_SRCS
|
SET(FemConstraints_SRCS
|
||||||
FemConstraintBearing.h
|
FemConstraintBearing.h
|
||||||
FemConstraintBearing.cpp
|
FemConstraintBearing.cpp
|
||||||
|
@ -205,10 +205,10 @@ add_library(Fem SHARED ${Fem_SRCS})
|
||||||
target_link_libraries(Fem ${Fem_LIBS})
|
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}
|
||||||
)
|
)
|
||||||
|
|
|
@ -60,7 +60,7 @@ PyObject *FemAnalysis::getPyObject()
|
||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FemAnalysis::onChanged(const Property* prop)
|
void FemAnalysis::onChanged(const Property* prop)
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
|
|
||||||
/// Member objects of the Analysis
|
/// Member objects of the Analysis
|
||||||
App::PropertyLinkList Member;
|
App::PropertyLinkList Member;
|
||||||
/// unique identifier of the Analysis
|
/// unique identifier of the Analysis
|
||||||
App::PropertyUUID Uid;
|
App::PropertyUUID Uid;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
App::PropertyLinkSubList References;
|
App::PropertyLinkSubList References;
|
||||||
// Read-only (calculated values). These trigger changes in the ViewProvider
|
// Read-only (calculated values). These trigger changes in the ViewProvider
|
||||||
App::PropertyVector NormalDirection;
|
App::PropertyVector NormalDirection;
|
||||||
|
|
||||||
//OvG: Scale
|
//OvG: Scale
|
||||||
App::PropertyInteger Scale;
|
App::PropertyInteger Scale;
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public:
|
||||||
virtual const char* getViewProviderName(void) const {
|
virtual const char* getViewProviderName(void) const {
|
||||||
return "FemGui::ViewProviderFemConstraint";
|
return "FemGui::ViewProviderFemConstraint";
|
||||||
}
|
}
|
||||||
|
|
||||||
//OvG: Allow automatic determination of scaling of constraint drawings, e.g. arrow length and size
|
//OvG: Allow automatic determination of scaling of constraint drawings, e.g. arrow length and size
|
||||||
int calcDrawScaleFactor(double lparam) const;
|
int calcDrawScaleFactor(double lparam) const;
|
||||||
int calcDrawScaleFactor(double lvparam, double luparam) const;
|
int calcDrawScaleFactor(double lvparam, double luparam) const;
|
||||||
|
|
|
@ -44,25 +44,25 @@ PROPERTY_SOURCE(Fem::ConstraintDisplacement, Fem::Constraint);
|
||||||
|
|
||||||
ConstraintDisplacement::ConstraintDisplacement()
|
ConstraintDisplacement::ConstraintDisplacement()
|
||||||
{
|
{
|
||||||
ADD_PROPERTY(xDisplacement,(0.0));
|
ADD_PROPERTY(xDisplacement,(0.0));
|
||||||
ADD_PROPERTY(yDisplacement,(0.0));
|
ADD_PROPERTY(yDisplacement,(0.0));
|
||||||
ADD_PROPERTY(zDisplacement,(0.0));
|
ADD_PROPERTY(zDisplacement,(0.0));
|
||||||
ADD_PROPERTY(xRotation,(0.0));
|
ADD_PROPERTY(xRotation,(0.0));
|
||||||
ADD_PROPERTY(yRotation,(0.0));
|
ADD_PROPERTY(yRotation,(0.0));
|
||||||
ADD_PROPERTY(zRotation,(0.0));
|
ADD_PROPERTY(zRotation,(0.0));
|
||||||
ADD_PROPERTY(xFree,(1));
|
ADD_PROPERTY(xFree,(1));
|
||||||
ADD_PROPERTY(yFree,(1));
|
ADD_PROPERTY(yFree,(1));
|
||||||
ADD_PROPERTY(zFree,(1));
|
ADD_PROPERTY(zFree,(1));
|
||||||
ADD_PROPERTY(xFix,(0));
|
ADD_PROPERTY(xFix,(0));
|
||||||
ADD_PROPERTY(yFix,(0));
|
ADD_PROPERTY(yFix,(0));
|
||||||
ADD_PROPERTY(zFix,(0));
|
ADD_PROPERTY(zFix,(0));
|
||||||
ADD_PROPERTY(rotxFree,(1));
|
ADD_PROPERTY(rotxFree,(1));
|
||||||
ADD_PROPERTY(rotyFree,(1));
|
ADD_PROPERTY(rotyFree,(1));
|
||||||
ADD_PROPERTY(rotzFree,(1));
|
ADD_PROPERTY(rotzFree,(1));
|
||||||
ADD_PROPERTY(rotxFix,(0));
|
ADD_PROPERTY(rotxFix,(0));
|
||||||
ADD_PROPERTY(rotyFix,(0));
|
ADD_PROPERTY(rotyFix,(0));
|
||||||
ADD_PROPERTY(rotzFix,(0));
|
ADD_PROPERTY(rotzFix,(0));
|
||||||
|
|
||||||
ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintFixed",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintFixed",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
||||||
"Points where symbols are drawn");
|
"Points where symbols are drawn");
|
||||||
ADD_PROPERTY_TYPE(Normals,(Base::Vector3d()),"ConstraintFixed",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
ADD_PROPERTY_TYPE(Normals,(Base::Vector3d()),"ConstraintFixed",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
||||||
|
|
|
@ -39,18 +39,18 @@ class AppFemExport ConstraintDisplacement : public Fem::Constraint
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
ConstraintDisplacement(void);
|
ConstraintDisplacement(void);
|
||||||
|
|
||||||
// Read-only (calculated values). These trigger changes in the ViewProvider
|
// Read-only (calculated values). These trigger changes in the ViewProvider
|
||||||
App::PropertyVectorList Points;
|
App::PropertyVectorList Points;
|
||||||
App::PropertyVectorList Normals;
|
App::PropertyVectorList Normals;
|
||||||
|
|
||||||
//Displacement parameters
|
//Displacement parameters
|
||||||
App::PropertyFloat xDisplacement;
|
App::PropertyFloat xDisplacement;
|
||||||
App::PropertyFloat yDisplacement;
|
App::PropertyFloat yDisplacement;
|
||||||
App::PropertyFloat zDisplacement;
|
App::PropertyFloat zDisplacement;
|
||||||
App::PropertyFloat xRotation;
|
App::PropertyFloat xRotation;
|
||||||
App::PropertyFloat yRotation;
|
App::PropertyFloat yRotation;
|
||||||
App::PropertyFloat zRotation;
|
App::PropertyFloat zRotation;
|
||||||
App::PropertyBool xFree;
|
App::PropertyBool xFree;
|
||||||
App::PropertyBool yFree;
|
App::PropertyBool yFree;
|
||||||
App::PropertyBool zFree;
|
App::PropertyBool zFree;
|
||||||
|
|
|
@ -726,7 +726,7 @@ void FemMesh::readNastran(const std::string &Filename)
|
||||||
{
|
{
|
||||||
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);
|
||||||
|
@ -739,7 +739,7 @@ void FemMesh::readNastran(const std::string &Filename)
|
||||||
offset = 1;
|
offset = 1;
|
||||||
else if (id < 100000000)
|
else if (id < 100000000)
|
||||||
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()));
|
||||||
|
@ -764,7 +764,7 @@ void FemMesh::readNastran(const std::string &Filename)
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
@ -772,7 +772,7 @@ void FemMesh::readNastran(const std::string &Filename)
|
||||||
{
|
{
|
||||||
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);
|
||||||
|
@ -815,7 +815,7 @@ void FemMesh::readNastran(const std::string &Filename)
|
||||||
|
|
||||||
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
|
||||||
//(
|
//(
|
||||||
|
@ -855,11 +855,11 @@ void FemMesh::read(const char *FileName)
|
||||||
{
|
{
|
||||||
Base::FileInfo File(FileName);
|
Base::FileInfo File(FileName);
|
||||||
_Mtrx = Base::Matrix4D();
|
_Mtrx = Base::Matrix4D();
|
||||||
|
|
||||||
// checking on the file
|
// checking on the file
|
||||||
if (!File.isReadable())
|
if (!File.isReadable())
|
||||||
throw Base::Exception("File to load not existing or not readable");
|
throw Base::Exception("File to load not existing or not readable");
|
||||||
|
|
||||||
if (File.hasExtension("unv") ) {
|
if (File.hasExtension("unv") ) {
|
||||||
// read UNV file
|
// read UNV file
|
||||||
myMesh->UNVToMesh(File.filePath().c_str());
|
myMesh->UNVToMesh(File.filePath().c_str());
|
||||||
|
@ -1179,10 +1179,10 @@ void FemMesh::SaveDocFile (Base::Writer &writer) const
|
||||||
Base::FileInfo fi(App::Application::getTempFileName().c_str());
|
Base::FileInfo fi(App::Application::getTempFileName().c_str());
|
||||||
|
|
||||||
myMesh->ExportUNV(fi.filePath().c_str());
|
myMesh->ExportUNV(fi.filePath().c_str());
|
||||||
|
|
||||||
Base::ifstream file(fi, std::ios::in | std::ios::binary);
|
Base::ifstream file(fi, std::ios::in | std::ios::binary);
|
||||||
if (file){
|
if (file){
|
||||||
unsigned long ulSize = 0;
|
unsigned long ulSize = 0;
|
||||||
std::streambuf* buf = file.rdbuf();
|
std::streambuf* buf = file.rdbuf();
|
||||||
if (buf) {
|
if (buf) {
|
||||||
unsigned long ulCurr;
|
unsigned long ulCurr;
|
||||||
|
@ -1255,7 +1255,7 @@ Base::BoundBox3d FemMesh::getBoundBox(void) const
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
@ -1281,7 +1281,7 @@ unsigned long FemMesh::countSubElements(const char* Type) const
|
||||||
|
|
||||||
Data::Segment* FemMesh::getSubElement(const char* Type, unsigned long n) const
|
Data::Segment* FemMesh::getSubElement(const char* Type, unsigned long n) const
|
||||||
{
|
{
|
||||||
// FIXME implement subelement interface
|
// FIXME implement subelement interface
|
||||||
//std::stringstream str;
|
//std::stringstream str;
|
||||||
//str << Type << n;
|
//str << Type << n;
|
||||||
//std::string temp = str.str();
|
//std::string temp = str.str();
|
||||||
|
@ -1312,7 +1312,7 @@ struct Fem::FemMesh::FemMeshInfo FemMesh::getInfo(void) const{
|
||||||
}
|
}
|
||||||
// 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]),
|
||||||
|
@ -1339,10 +1339,10 @@ Base::Quantity FemMesh::getVolume(void)const
|
||||||
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;
|
||||||
|
|
||||||
Base::Vector3d v1(aVol->GetNode(1)->X(),aVol->GetNode(1)->Y(),aVol->GetNode(1)->Z());
|
Base::Vector3d v1(aVol->GetNode(1)->X(),aVol->GetNode(1)->Y(),aVol->GetNode(1)->Z());
|
||||||
|
@ -1405,7 +1405,7 @@ Base::Quantity FemMesh::getVolume(void)const
|
||||||
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);
|
||||||
|
|
|
@ -106,9 +106,9 @@ public:
|
||||||
|
|
||||||
/** @name Placement control */
|
/** @name Placement control */
|
||||||
//@{
|
//@{
|
||||||
/// set the transformation
|
/// set the transformation
|
||||||
void setTransform(const Base::Matrix4D& rclTrf);
|
void setTransform(const Base::Matrix4D& rclTrf);
|
||||||
/// get the transformation
|
/// get the transformation
|
||||||
Base::Matrix4D getTransform(void) const;
|
Base::Matrix4D getTransform(void) const;
|
||||||
/// Bound box from the shape
|
/// Bound box from the shape
|
||||||
Base::BoundBox3d getBoundBox(void)const;
|
Base::BoundBox3d getBoundBox(void)const;
|
||||||
|
@ -123,7 +123,7 @@ public:
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
struct FemMeshInfo {
|
struct FemMeshInfo {
|
||||||
int numFaces;
|
int numFaces;
|
||||||
int numNode;
|
int numNode;
|
||||||
int numTria;
|
int numTria;
|
||||||
int numQuad;
|
int numQuad;
|
||||||
|
|
|
@ -57,7 +57,7 @@ PyObject *FemMeshObject::getPyObject()
|
||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FemMeshObject::onChanged(const Property* prop)
|
void FemMeshObject::onChanged(const Property* prop)
|
||||||
|
@ -66,7 +66,7 @@ void FemMeshObject::onChanged(const Property* prop)
|
||||||
|
|
||||||
// if the placement has changed apply the change to the mesh data as well
|
// if the placement has changed apply the change to the mesh data as well
|
||||||
if (prop == &this->Placement) {
|
if (prop == &this->Placement) {
|
||||||
const_cast<Fem::FemMesh&>(this->FemMesh.getValue()).setTransform(this->Placement.getValue().toMatrix());
|
const_cast<Fem::FemMesh&>(this->FemMesh.getValue()).setTransform(this->Placement.getValue().toMatrix());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ void PropertyFemMesh::setValue(const FemMesh& sh)
|
||||||
hasSetValue();
|
hasSetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
const FemMesh &PropertyFemMesh::getValue(void)const
|
const FemMesh &PropertyFemMesh::getValue(void)const
|
||||||
{
|
{
|
||||||
return *_FemMesh;
|
return *_FemMesh;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,13 +49,13 @@ public:
|
||||||
/// set the FemMesh shape
|
/// set the FemMesh shape
|
||||||
void setValue(const FemMesh&);
|
void setValue(const FemMesh&);
|
||||||
/// does nothing, for add property macro
|
/// does nothing, for add property macro
|
||||||
void setValue(void){};
|
void setValue(void){};
|
||||||
/// get the FemMesh shape
|
/// get the FemMesh shape
|
||||||
const FemMesh &getValue(void) const;
|
const FemMesh &getValue(void) const;
|
||||||
const Data::ComplexGeoData* getComplexData() const;
|
const Data::ComplexGeoData* getComplexData() const;
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
||||||
/** @name Getting basic geometric entities */
|
/** @name Getting basic geometric entities */
|
||||||
//@{
|
//@{
|
||||||
/** Returns the bounding box around the underlying mesh kernel */
|
/** Returns the bounding box around the underlying mesh kernel */
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<?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>
|
||||||
|
|
|
@ -63,7 +63,7 @@ std::string FemMeshPy::representation(void) const
|
||||||
|
|
||||||
PyObject *FemMeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
|
PyObject *FemMeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
|
||||||
{
|
{
|
||||||
// create a new instance of FemMeshPy and the Twin object
|
// create a new instance of FemMeshPy and the Twin object
|
||||||
return new FemMeshPy(new FemMesh);
|
return new FemMeshPy(new FemMesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ PyObject *FemMeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py
|
||||||
int FemMeshPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
int FemMeshPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||||
{
|
{
|
||||||
PyObject *pcObj=0;
|
PyObject *pcObj=0;
|
||||||
if (!PyArg_ParseTuple(args, "|O", &pcObj)) // convert args: Python->C
|
if (!PyArg_ParseTuple(args, "|O", &pcObj)) // convert args: Python->C
|
||||||
return -1; // NULL triggers exception
|
return -1; // NULL triggers exception
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -287,7 +287,7 @@ PyObject* FemMeshPy::addFace(PyObject *args)
|
||||||
throw std::runtime_error("Failed to get node of the given indices");
|
throw std::runtime_error("Failed to get node of the given indices");
|
||||||
Nodes.push_back(node);
|
Nodes.push_back(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
SMDS_MeshFace* face=0;
|
SMDS_MeshFace* face=0;
|
||||||
switch(Nodes.size()){
|
switch(Nodes.size()){
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -390,7 +390,7 @@ PyObject* FemMeshPy::addVolume(PyObject *args)
|
||||||
throw std::runtime_error("Failed to get node of the given indices");
|
throw std::runtime_error("Failed to get node of the given indices");
|
||||||
Nodes.push_back(node);
|
Nodes.push_back(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
SMDS_MeshVolume* vol=0;
|
SMDS_MeshVolume* vol=0;
|
||||||
if(ElementId != -1) {
|
if(ElementId != -1) {
|
||||||
switch(Nodes.size()){
|
switch(Nodes.size()){
|
||||||
|
@ -810,7 +810,7 @@ Py::Dict FemMeshPy::getNodes(void) const
|
||||||
for (int i=0;aNodeIter->more();i++) {
|
for (int i=0;aNodeIter->more();i++) {
|
||||||
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;
|
||||||
int id = aNode->GetID();
|
int id = aNode->GetID();
|
||||||
|
|
||||||
|
@ -947,7 +947,7 @@ Py::Int FemMeshPy::getGroupCount(void) const
|
||||||
Py::Object FemMeshPy::getVolume(void) const
|
Py::Object FemMeshPy::getVolume(void) const
|
||||||
{
|
{
|
||||||
return Py::Object(new Base::QuantityPy(new Base::Quantity(getFemMeshPtr()->getVolume())));
|
return Py::Object(new Base::QuantityPy(new Base::Quantity(getFemMeshPtr()->getVolume())));
|
||||||
|
|
||||||
}
|
}
|
||||||
// ===== custom attributes ============================================================
|
// ===== custom attributes ============================================================
|
||||||
|
|
||||||
|
@ -958,5 +958,5 @@ PyObject *FemMeshPy::getCustomAttributes(const char* /*attr*/) const
|
||||||
|
|
||||||
int FemMeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
int FemMeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ FemMeshShapeObject::~FemMeshShapeObject()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
|
App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
|
||||||
{
|
{
|
||||||
Fem::FemMesh newMesh;
|
Fem::FemMesh newMesh;
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
|
||||||
#else
|
#else
|
||||||
TopoDS_Shape shape = feat->Shape.getValue();
|
TopoDS_Shape shape = feat->Shape.getValue();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
newMesh.getSMesh()->ShapeToMesh(shape);
|
newMesh.getSMesh()->ShapeToMesh(shape);
|
||||||
SMESH_Gen *myGen = newMesh.getGenerator();
|
SMESH_Gen *myGen = newMesh.getGenerator();
|
||||||
|
|
||||||
|
@ -188,21 +188,21 @@ App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
|
||||||
NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true);
|
NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true);
|
||||||
|
|
||||||
//NETGENPlugin_SimpleHypothesis_2D * tet2 = new NETGENPlugin_SimpleHypothesis_2D(hyp++,1,myGen);
|
//NETGENPlugin_SimpleHypothesis_2D * tet2 = new NETGENPlugin_SimpleHypothesis_2D(hyp++,1,myGen);
|
||||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetNumberOfSegments(5);
|
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetNumberOfSegments(5);
|
||||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetLocalLength(0.1);
|
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetLocalLength(0.1);
|
||||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->LengthFromEdges();
|
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->LengthFromEdges();
|
||||||
//myNetGenMesher.SetParameters(tet2);
|
//myNetGenMesher.SetParameters(tet2);
|
||||||
|
|
||||||
//NETGENPlugin_SimpleHypothesis_3D* tet= new NETGENPlugin_SimpleHypothesis_3D(hyp++,1,myGen);
|
//NETGENPlugin_SimpleHypothesis_3D* tet= new NETGENPlugin_SimpleHypothesis_3D(hyp++,1,myGen);
|
||||||
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->LengthFromFaces();
|
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->LengthFromFaces();
|
||||||
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->SetMaxElementVolume(0.1);
|
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->SetMaxElementVolume(0.1);
|
||||||
//myNetGenMesher.SetParameters( tet);
|
//myNetGenMesher.SetParameters( tet);
|
||||||
|
|
||||||
myNetGenMesher.Compute();
|
myNetGenMesher.Compute();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(newMesh.getSMesh())->GetMeshDS();
|
//SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(newMesh.getSMesh())->GetMeshDS();
|
||||||
//const SMDS_MeshInfo& info = data->GetMeshInfo();
|
//const SMDS_MeshInfo& info = data->GetMeshInfo();
|
||||||
//int numNode = info.NbNodes();
|
//int numNode = info.NbNodes();
|
||||||
|
@ -219,7 +219,7 @@ App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
|
||||||
// set the value to the object
|
// set the value to the object
|
||||||
FemMesh.setValue(newMesh);
|
FemMesh.setValue(newMesh);
|
||||||
|
|
||||||
|
|
||||||
return App::DocumentObject::StdReturn;
|
return App::DocumentObject::StdReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
|
||||||
// // ref counter is set to 1
|
// // ref counter is set to 1
|
||||||
// PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
// PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
// }
|
// }
|
||||||
// return Py::new_reference_to(PythonObject);
|
// return Py::new_reference_to(PythonObject);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//void FemMeshShapeObject::onChanged(const Property* prop)
|
//void FemMeshShapeObject::onChanged(const Property* prop)
|
||||||
|
|
|
@ -71,7 +71,7 @@ PyObject *FemResultObject::getPyObject()
|
||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Python feature ---------------------------------------------------------
|
// Python feature ---------------------------------------------------------
|
||||||
|
|
|
@ -54,6 +54,6 @@ PyObject *FemSetElementsObject::getPyObject()
|
||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,6 @@ PyObject *FemSetFacesObject::getPyObject()
|
||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,6 @@ PyObject *FemSetGeometryObject::getPyObject()
|
||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,6 @@ PyObject *FemSetNodesObject::getPyObject()
|
||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,6 @@ PyObject *FemSetObject::getPyObject()
|
||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ PyObject *FemSolverObject::getPyObject()
|
||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Python feature ---------------------------------------------------------
|
// Python feature ---------------------------------------------------------
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
App::PropertyString ExternalCaseEditor;
|
App::PropertyString ExternalCaseEditor;
|
||||||
/// Path to External Result Viewer like Paraview, empty string means using FreeCAD
|
/// Path to External Result Viewer like Paraview, empty string means using FreeCAD
|
||||||
App::PropertyString ExternalResultViewer;
|
App::PropertyString ExternalResultViewer;
|
||||||
|
|
||||||
/// for FEM: Static, Frequency, etc
|
/// for FEM: Static, Frequency, etc
|
||||||
App::PropertyString AnalysisType;
|
App::PropertyString AnalysisType;
|
||||||
/// Path of working dir for the solver
|
/// Path of working dir for the solver
|
||||||
|
|
|
@ -55,13 +55,13 @@ public:
|
||||||
*/
|
*/
|
||||||
static bool isPlanar(const TopoDS_Face&);
|
static bool isPlanar(const TopoDS_Face&);
|
||||||
/*!
|
/*!
|
||||||
It is assumed that the edge is 'linear'.
|
It is assumed that the edge is 'linear'.
|
||||||
The direction vector of the line is returned.
|
The direction vector of the line is returned.
|
||||||
@see isLinear
|
@see isLinear
|
||||||
*/
|
*/
|
||||||
static gp_XYZ getDirection(const TopoDS_Edge&);
|
static gp_XYZ getDirection(const TopoDS_Edge&);
|
||||||
/*!
|
/*!
|
||||||
It is assumed that the face is 'planar'.
|
It is assumed that the face is 'planar'.
|
||||||
The normal vector of the plane is returned.
|
The normal vector of the plane is returned.
|
||||||
@see isPlanar
|
@see isPlanar
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -21,4 +21,4 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include "PreCompiled.h"
|
#include "PreCompiled.h"
|
||||||
|
|
|
@ -48,10 +48,10 @@ set(FemGui_MOC_HDRS
|
||||||
TaskDlgCreateNodeSet.h
|
TaskDlgCreateNodeSet.h
|
||||||
TaskFemConstraint.h
|
TaskFemConstraint.h
|
||||||
TaskFemConstraintBearing.h
|
TaskFemConstraintBearing.h
|
||||||
TaskFemConstraintFixed.h
|
TaskFemConstraintFixed.h
|
||||||
TaskFemConstraintForce.h
|
TaskFemConstraintForce.h
|
||||||
TaskFemConstraintPressure.h
|
TaskFemConstraintPressure.h
|
||||||
TaskFemConstraintGear.h
|
TaskFemConstraintGear.h
|
||||||
TaskFemConstraintPulley.h
|
TaskFemConstraintPulley.h
|
||||||
TaskFemConstraintDisplacement.h
|
TaskFemConstraintDisplacement.h
|
||||||
TaskTetParameter.h
|
TaskTetParameter.h
|
||||||
|
@ -217,7 +217,7 @@ add_library(FemGui SHARED ${FemGui_SRCS})
|
||||||
target_link_libraries(FemGui ${FemGui_LIBS})
|
target_link_libraries(FemGui ${FemGui_LIBS})
|
||||||
|
|
||||||
|
|
||||||
fc_target_copy_resource(FemGui
|
fc_target_copy_resource(FemGui
|
||||||
${CMAKE_SOURCE_DIR}/src/Mod/Fem
|
${CMAKE_SOURCE_DIR}/src/Mod/Fem
|
||||||
${CMAKE_BINARY_DIR}/Mod/Fem
|
${CMAKE_BINARY_DIR}/Mod/Fem
|
||||||
InitGui.py
|
InitGui.py
|
||||||
|
|
|
@ -115,7 +115,7 @@ void CmdFemCreateAnalysis::activated(int iMsg)
|
||||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
|
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
|
||||||
QObject::tr("Your FreeCAD is build without NETGEN support. Meshing will not work...."));
|
QObject::tr("Your FreeCAD is build without NETGEN support. Meshing will not work...."));
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
|
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ void CmdFemAddPart::activated(int iMsg)
|
||||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
|
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
|
||||||
QObject::tr("Your FreeCAD is build without NETGEN support. Meshing will not work...."));
|
QObject::tr("Your FreeCAD is build without NETGEN support. Meshing will not work...."));
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
|
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ void CmdFemCreateSolver::activated(int iMsg)
|
||||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
|
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
|
||||||
QObject::tr("Your FreeCAD is build without NETGEN support. Meshing will not work...."));
|
QObject::tr("Your FreeCAD is build without NETGEN support. Meshing will not work...."));
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Fem::FemAnalysis *Analysis;
|
Fem::FemAnalysis *Analysis;
|
||||||
|
|
||||||
|
@ -615,7 +615,7 @@ void DefineNodesCallback(void * ud, SoEventCallback * n)
|
||||||
const SMDS_MeshNode* aNode = aNodeIter->next();
|
const SMDS_MeshNode* aNode = aNodeIter->next();
|
||||||
Base::Vector3f vec(aNode->X(),aNode->Y(),aNode->Z());
|
Base::Vector3f vec(aNode->X(),aNode->Y(),aNode->Z());
|
||||||
pt2d = proj(vec);
|
pt2d = proj(vec);
|
||||||
if (polygon.Contains(Base::Vector2D(pt2d.x, pt2d.y)) == true)
|
if (polygon.Contains(Base::Vector2D(pt2d.x, pt2d.y)) == true)
|
||||||
IntSet.insert(aNode->GetID());
|
IntSet.insert(aNode->GetID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,7 +629,7 @@ void DefineNodesCallback(void * ud, SoEventCallback * n)
|
||||||
set << "," << *it ;
|
set << "," << *it ;
|
||||||
set << "]";
|
set << "]";
|
||||||
|
|
||||||
|
|
||||||
Gui::Command::openCommand("Place robot");
|
Gui::Command::openCommand("Place robot");
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.addObject('Fem::FemSetNodesObject','NodeSet')");
|
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.addObject('Fem::FemSetNodesObject','NodeSet')");
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.ActiveObject.Nodes = %s",set.str().c_str());
|
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.ActiveObject.Nodes = %s",set.str().c_str());
|
||||||
|
|
|
@ -30,15 +30,15 @@ namespace FemGui {
|
||||||
class FemSelectionGate : public Gui::SelectionFilterGate
|
class FemSelectionGate : public Gui::SelectionFilterGate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum ElemType {
|
enum ElemType {
|
||||||
Nothing ,
|
Nothing ,
|
||||||
Node ,
|
Node ,
|
||||||
Element ,
|
Element ,
|
||||||
NodeElement
|
NodeElement
|
||||||
};
|
};
|
||||||
|
|
||||||
FemSelectionGate(ElemType type)
|
FemSelectionGate(ElemType type)
|
||||||
: Gui::SelectionFilterGate((Gui::SelectionFilter*)0),Type(type)
|
: Gui::SelectionFilterGate((Gui::SelectionFilter*)0),Type(type)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,4 +21,4 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include "PreCompiled.h"
|
#include "PreCompiled.h"
|
||||||
|
|
|
@ -43,7 +43,7 @@ using namespace Gui;
|
||||||
TaskAnalysisInfo::TaskAnalysisInfo(Fem::FemAnalysis *pcObject,QWidget *parent)
|
TaskAnalysisInfo::TaskAnalysisInfo(Fem::FemAnalysis *pcObject,QWidget *parent)
|
||||||
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
||||||
tr("Nodes set"),
|
tr("Nodes set"),
|
||||||
true,
|
true,
|
||||||
parent),
|
parent),
|
||||||
pcObject(pcObject)
|
pcObject(pcObject)
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace Fem{
|
||||||
class FemAnalysis;
|
class FemAnalysis;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace FemGui {
|
namespace FemGui {
|
||||||
|
|
||||||
class ViewProviderFemMesh;
|
class ViewProviderFemMesh;
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ using namespace Gui;
|
||||||
TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *parent)
|
TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *parent)
|
||||||
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
||||||
tr("Nodes set"),
|
tr("Nodes set"),
|
||||||
true,
|
true,
|
||||||
parent),
|
parent),
|
||||||
pcObject(pcObject)
|
pcObject(pcObject)
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,7 @@ TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *p
|
||||||
QObject::connect(ui->toolButton_Pick,SIGNAL(clicked()),this,SLOT(Pick()));
|
QObject::connect(ui->toolButton_Pick,SIGNAL(clicked()),this,SLOT(Pick()));
|
||||||
QObject::connect(ui->comboBox,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int)));
|
QObject::connect(ui->comboBox,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int)));
|
||||||
|
|
||||||
// check if the Link to the FemMesh is defined
|
// check if the Link to the FemMesh is defined
|
||||||
assert(pcObject->FemMesh.getValue<Fem::FemMeshObject*>());
|
assert(pcObject->FemMesh.getValue<Fem::FemMeshObject*>());
|
||||||
MeshViewProvider = dynamic_cast<ViewProviderFemMesh*>(Gui::Application::Instance->getViewProvider( pcObject->FemMesh.getValue<Fem::FemMeshObject*>()));
|
MeshViewProvider = dynamic_cast<ViewProviderFemMesh*>(Gui::Application::Instance->getViewProvider( pcObject->FemMesh.getValue<Fem::FemMeshObject*>()));
|
||||||
assert(MeshViewProvider);
|
assert(MeshViewProvider);
|
||||||
|
@ -172,7 +172,7 @@ void TaskCreateNodeSet::DefineNodes(const Base::Polygon2D &polygon,const Gui::Vi
|
||||||
const SMDS_MeshNode* aNode = aNodeIter->next();
|
const SMDS_MeshNode* aNode = aNodeIter->next();
|
||||||
Base::Vector3f vec(aNode->X(),aNode->Y(),aNode->Z());
|
Base::Vector3f vec(aNode->X(),aNode->Y(),aNode->Z());
|
||||||
pt2d = proj(vec);
|
pt2d = proj(vec);
|
||||||
if (polygon.Contains(Base::Vector2D(pt2d.x, pt2d.y)) == inner)
|
if (polygon.Contains(Base::Vector2D(pt2d.x, pt2d.y)) == inner)
|
||||||
tempSet.insert(aNode->GetID());
|
tempSet.insert(aNode->GetID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class ViewProvider;
|
||||||
class ViewVolumeProjection;
|
class ViewVolumeProjection;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace FemGui {
|
namespace FemGui {
|
||||||
|
|
||||||
class ViewProviderFemMesh;
|
class ViewProviderFemMesh;
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ bool TaskDlgAnalysis::accept()
|
||||||
// FemSetNodesObject->Nodes.setValues(param->tempSet);
|
// FemSetNodesObject->Nodes.setValues(param->tempSet);
|
||||||
// FemSetNodesObject->recompute();
|
// FemSetNodesObject->recompute();
|
||||||
// //Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
// //Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||||
// //if(doc)
|
// //if(doc)
|
||||||
// // doc->resetEdit();
|
// // doc->resetEdit();
|
||||||
// param->MeshViewProvider->resetHighlightNodes();
|
// param->MeshViewProvider->resetHighlightNodes();
|
||||||
// FemSetNodesObject->Label.setValue(name->name);
|
// FemSetNodesObject->Label.setValue(name->name);
|
||||||
|
@ -100,7 +100,7 @@ bool TaskDlgAnalysis::reject()
|
||||||
{
|
{
|
||||||
//FemSetNodesObject->execute();
|
//FemSetNodesObject->execute();
|
||||||
// //Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
// //Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||||
// //if(doc)
|
// //if(doc)
|
||||||
// // doc->resetEdit();
|
// // doc->resetEdit();
|
||||||
//param->MeshViewProvider->resetHighlightNodes();
|
//param->MeshViewProvider->resetHighlightNodes();
|
||||||
//Gui::Command::abortCommand();
|
//Gui::Command::abortCommand();
|
||||||
|
|
|
@ -51,16 +51,16 @@ public:
|
||||||
virtual bool accept();
|
virtual bool accept();
|
||||||
/// is called by the framework if the dialog is rejected (Cancel)
|
/// is called by the framework if the dialog is rejected (Cancel)
|
||||||
virtual bool reject();
|
virtual bool reject();
|
||||||
/// is called by the framework if the user press the help button
|
/// is called by the framework if the user press the help button
|
||||||
virtual void helpRequested();
|
virtual void helpRequested();
|
||||||
|
|
||||||
/// returns for Close and Help button
|
/// returns for Close and Help button
|
||||||
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
|
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
|
||||||
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply; }
|
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TaskAnalysisInfo *info;
|
TaskAnalysisInfo *info;
|
||||||
TaskDriver *driver;
|
TaskDriver *driver;
|
||||||
|
|
||||||
Fem::FemAnalysis *FemAnalysis;
|
Fem::FemAnalysis *FemAnalysis;
|
||||||
};
|
};
|
||||||
|
|
|
@ -77,7 +77,7 @@ bool TaskDlgCreateNodeSet::accept()
|
||||||
FemSetNodesObject->Nodes.setValues(param->tempSet);
|
FemSetNodesObject->Nodes.setValues(param->tempSet);
|
||||||
FemSetNodesObject->recompute();
|
FemSetNodesObject->recompute();
|
||||||
//Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
//Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||||
//if(doc)
|
//if(doc)
|
||||||
// doc->resetEdit();
|
// doc->resetEdit();
|
||||||
param->MeshViewProvider->resetHighlightNodes();
|
param->MeshViewProvider->resetHighlightNodes();
|
||||||
FemSetNodesObject->Label.setValue(name->name);
|
FemSetNodesObject->Label.setValue(name->name);
|
||||||
|
@ -96,7 +96,7 @@ bool TaskDlgCreateNodeSet::reject()
|
||||||
{
|
{
|
||||||
FemSetNodesObject->execute();
|
FemSetNodesObject->execute();
|
||||||
//Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
//Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||||
//if(doc)
|
//if(doc)
|
||||||
// doc->resetEdit();
|
// doc->resetEdit();
|
||||||
param->MeshViewProvider->resetHighlightNodes();
|
param->MeshViewProvider->resetHighlightNodes();
|
||||||
Gui::Command::abortCommand();
|
Gui::Command::abortCommand();
|
||||||
|
|
|
@ -53,16 +53,16 @@ public:
|
||||||
virtual bool accept();
|
virtual bool accept();
|
||||||
/// is called by the framework if the dialog is rejected (Cancel)
|
/// is called by the framework if the dialog is rejected (Cancel)
|
||||||
virtual bool reject();
|
virtual bool reject();
|
||||||
/// is called by the framework if the user press the help button
|
/// is called by the framework if the user press the help button
|
||||||
virtual void helpRequested();
|
virtual void helpRequested();
|
||||||
|
|
||||||
/// returns for Close and Help button
|
/// returns for Close and Help button
|
||||||
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
|
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
|
||||||
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel; }
|
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TaskCreateNodeSet *param;
|
TaskCreateNodeSet *param;
|
||||||
TaskObjectName *name;
|
TaskObjectName *name;
|
||||||
|
|
||||||
Fem::FemSetNodesObject *FemSetNodesObject;
|
Fem::FemSetNodesObject *FemSetNodesObject;
|
||||||
};
|
};
|
||||||
|
|
|
@ -132,7 +132,7 @@ bool TaskDlgMeshShapeNetgen::reject()
|
||||||
{
|
{
|
||||||
//FemSetNodesObject->execute();
|
//FemSetNodesObject->execute();
|
||||||
// //Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
// //Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||||
// //if(doc)
|
// //if(doc)
|
||||||
// // doc->resetEdit();
|
// // doc->resetEdit();
|
||||||
//param->MeshViewProvider->resetHighlightNodes();
|
//param->MeshViewProvider->resetHighlightNodes();
|
||||||
Gui::Command::abortCommand();
|
Gui::Command::abortCommand();
|
||||||
|
|
|
@ -54,15 +54,15 @@ public:
|
||||||
virtual bool accept();
|
virtual bool accept();
|
||||||
/// is called by the framework if the dialog is rejected (Cancel)
|
/// is called by the framework if the dialog is rejected (Cancel)
|
||||||
virtual bool reject();
|
virtual bool reject();
|
||||||
/// is called by the framework if the user press the help button
|
/// is called by the framework if the user press the help button
|
||||||
virtual void helpRequested();
|
virtual void helpRequested();
|
||||||
|
|
||||||
/// returns for Close and Help button
|
/// returns for Close and Help button
|
||||||
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
|
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
|
||||||
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply; }
|
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TaskTetParameter *param;
|
TaskTetParameter *param;
|
||||||
|
|
||||||
Fem::FemMeshShapeNetgenObject *FemMeshShapeNetgenObject;
|
Fem::FemMeshShapeNetgenObject *FemMeshShapeNetgenObject;
|
||||||
FemGui::ViewProviderFemMeshShapeNetgen *ViewProviderFemMeshShapeNetgen;
|
FemGui::ViewProviderFemMeshShapeNetgen *ViewProviderFemMeshShapeNetgen;
|
||||||
|
|
|
@ -49,7 +49,7 @@ using namespace Gui;
|
||||||
TaskDriver::TaskDriver(Fem::FemAnalysis *pcObject,QWidget *parent)
|
TaskDriver::TaskDriver(Fem::FemAnalysis *pcObject,QWidget *parent)
|
||||||
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
||||||
tr("Nodes set"),
|
tr("Nodes set"),
|
||||||
true,
|
true,
|
||||||
parent),
|
parent),
|
||||||
pcObject(pcObject)
|
pcObject(pcObject)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace Fem{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace FemGui {
|
namespace FemGui {
|
||||||
|
|
||||||
|
|
||||||
class TaskDriver : public Gui::TaskView::TaskBox
|
class TaskDriver : public Gui::TaskView::TaskBox
|
||||||
|
|
|
@ -116,7 +116,7 @@ const std::string TaskFemConstraint::getReferences(const std::vector<std::string
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string TaskFemConstraint::getScale() const //OvG: Return pre-calculated scale for constraint display
|
const std::string TaskFemConstraint::getScale() const //OvG: Return pre-calculated scale for constraint display
|
||||||
{
|
{
|
||||||
std::string result;
|
std::string result;
|
||||||
Fem::Constraint* pcConstraint = static_cast<Fem::Constraint*>(ConstraintView->getObject());
|
Fem::Constraint* pcConstraint = static_cast<Fem::Constraint*>(ConstraintView->getObject());
|
||||||
result = boost::lexical_cast<std::string>(pcConstraint->Scale.getValue());
|
result = boost::lexical_cast<std::string>(pcConstraint->Scale.getValue());
|
||||||
|
|
|
@ -77,7 +77,7 @@ class TaskDlgFemConstraint : public Gui::TaskView::TaskDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// is called the TaskView when the dialog is opened
|
/// is called the TaskView when the dialog is opened
|
||||||
void open();
|
void open();
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -73,7 +73,7 @@ public:
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void onReferenceDeleted(void);
|
void onReferenceDeleted(void);
|
||||||
void x_changed(double);
|
void x_changed(double);
|
||||||
void y_changed(double);
|
void y_changed(double);
|
||||||
void z_changed(double);
|
void z_changed(double);
|
||||||
void x_rot(double);
|
void x_rot(double);
|
||||||
void y_rot(double);
|
void y_rot(double);
|
||||||
|
@ -90,7 +90,7 @@ private Q_SLOTS:
|
||||||
void rotfreey(int);
|
void rotfreey(int);
|
||||||
void rotfixz(int);
|
void rotfixz(int);
|
||||||
void rotfreez(int);
|
void rotfreez(int);
|
||||||
|
|
||||||
void addToSelection();
|
void addToSelection();
|
||||||
void removeFromSelection();
|
void removeFromSelection();
|
||||||
void setSelection(QListWidgetItem* item);
|
void setSelection(QListWidgetItem* item);
|
||||||
|
@ -102,7 +102,7 @@ private:
|
||||||
//void onSelectionChanged(const Gui::SelectionChanges& msg);
|
//void onSelectionChanged(const Gui::SelectionChanges& msg);
|
||||||
void updateUI();
|
void updateUI();
|
||||||
Ui_TaskFemConstraintDisplacement* ui;
|
Ui_TaskFemConstraintDisplacement* ui;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class TaskDlgFemConstraintDisplacement : public TaskDlgFemConstraint
|
class TaskDlgFemConstraintDisplacement : public TaskDlgFemConstraint
|
||||||
|
|
|
@ -357,7 +357,7 @@ bool TaskDlgFemConstraintForce::accept()
|
||||||
|
|
||||||
if (parameterForce->getForce()<=0)
|
if (parameterForce->getForce()<=0)
|
||||||
{
|
{
|
||||||
QMessageBox::warning(parameter, tr("Input error"), tr("Please specify a force greater than 0"));
|
QMessageBox::warning(parameter, tr("Input error"), tr("Please specify a force greater than 0"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -378,7 +378,7 @@ bool TaskDlgFemConstraintForce::accept()
|
||||||
}
|
}
|
||||||
|
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %s", name.c_str(), parameterForce->getReverse() ? "True" : "False");
|
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %s", name.c_str(), parameterForce->getReverse() ? "True" : "False");
|
||||||
|
|
||||||
scale = parameterForce->getScale(); //OvG: determine modified scale
|
scale = parameterForce->getScale(); //OvG: determine modified scale
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Scale = %s", name.c_str(), scale.c_str()); //OvG: implement modified scale
|
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Scale = %s", name.c_str(), scale.c_str()); //OvG: implement modified scale
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ TaskFemConstraintGear::TaskFemConstraintGear(ViewProviderFemConstraint *Constrai
|
||||||
ui->checkReversed->blockSignals(true);
|
ui->checkReversed->blockSignals(true);
|
||||||
|
|
||||||
// Get the feature data
|
// Get the feature data
|
||||||
Fem::ConstraintGear* pcConstraint = static_cast<Fem::ConstraintGear*>(ConstraintView->getObject());
|
Fem::ConstraintGear* pcConstraint = static_cast<Fem::ConstraintGear*>(ConstraintView->getObject());
|
||||||
double dia = pcConstraint->Diameter.getValue();
|
double dia = pcConstraint->Diameter.getValue();
|
||||||
double force = pcConstraint->Force.getValue();
|
double force = pcConstraint->Force.getValue();
|
||||||
double angle = pcConstraint->ForceAngle.getValue();
|
double angle = pcConstraint->ForceAngle.getValue();
|
||||||
|
|
|
@ -256,13 +256,13 @@ bool TaskDlgFemConstraintPressure::accept()
|
||||||
try {
|
try {
|
||||||
if (parameterPressure->getPressure()<=0)
|
if (parameterPressure->getPressure()<=0)
|
||||||
{
|
{
|
||||||
QMessageBox::warning(parameter, tr("Input error"), tr("Please specify a pressure greater than 0"));
|
QMessageBox::warning(parameter, tr("Input error"), tr("Please specify a pressure greater than 0"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Pressure = %f",
|
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Pressure = %f",
|
||||||
name.c_str(), parameterPressure->getPressure());
|
name.c_str(), parameterPressure->getPressure());
|
||||||
}
|
}
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %s",
|
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %s",
|
||||||
name.c_str(), parameterPressure->getReverse() ? "True" : "False");
|
name.c_str(), parameterPressure->getReverse() ? "True" : "False");
|
||||||
|
|
|
@ -46,7 +46,7 @@ using namespace Gui;
|
||||||
TaskObjectName::TaskObjectName(App::DocumentObject *pcObject,QWidget *parent)
|
TaskObjectName::TaskObjectName(App::DocumentObject *pcObject,QWidget *parent)
|
||||||
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
||||||
tr("TaskObjectName"),
|
tr("TaskObjectName"),
|
||||||
true,
|
true,
|
||||||
parent),
|
parent),
|
||||||
pcObject(pcObject)
|
pcObject(pcObject)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace Gui {
|
||||||
class ViewProvider;
|
class ViewProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace FemGui {
|
namespace FemGui {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public:
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void TextChanged ( const QString &);
|
void TextChanged ( const QString &);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
App::DocumentObject *pcObject;
|
App::DocumentObject *pcObject;
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace Fem{
|
||||||
class FemMeshShapeNetgenObject;
|
class FemMeshShapeNetgenObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace FemGui {
|
namespace FemGui {
|
||||||
|
|
||||||
class ViewProviderFemMeshShapeNetgen;
|
class ViewProviderFemMeshShapeNetgen;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public:
|
||||||
ViewProviderFemMeshShapeNetgen * MeshViewProvider;
|
ViewProviderFemMeshShapeNetgen * MeshViewProvider;
|
||||||
void setInfo(void);
|
void setInfo(void);
|
||||||
|
|
||||||
bool touched;
|
bool touched;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void SwitchMethod(int Value);
|
void SwitchMethod(int Value);
|
||||||
|
|
|
@ -112,7 +112,7 @@ bool ViewProviderFemAnalysis::setEdit(int ModNum)
|
||||||
// if (padDlg)
|
// if (padDlg)
|
||||||
// Gui::Control().showDialog(padDlg);
|
// Gui::Control().showDialog(padDlg);
|
||||||
// else
|
// else
|
||||||
|
|
||||||
//Fem::FemAnalysis* pcAna = static_cast<Fem::FemAnalysis*>(this->getObject());
|
//Fem::FemAnalysis* pcAna = static_cast<Fem::FemAnalysis*>(this->getObject());
|
||||||
//Gui::Control().showDialog(new TaskDlgAnalysis(pcAna));
|
//Gui::Control().showDialog(new TaskDlgAnalysis(pcAna));
|
||||||
//return true;
|
//return true;
|
||||||
|
@ -137,11 +137,11 @@ void ViewProviderFemAnalysis::unsetEdit(int ModNum)
|
||||||
bool ViewProviderFemAnalysis::onDelete(const std::vector<std::string> &)
|
bool ViewProviderFemAnalysis::onDelete(const std::vector<std::string> &)
|
||||||
{
|
{
|
||||||
//// get the support and Sketch
|
//// get the support and Sketch
|
||||||
//PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(getObject());
|
//PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(getObject());
|
||||||
//Sketcher::SketchObject *pcSketch = 0;
|
//Sketcher::SketchObject *pcSketch = 0;
|
||||||
//App::DocumentObject *pcSupport = 0;
|
//App::DocumentObject *pcSupport = 0;
|
||||||
//if (pcPad->Sketch.getValue()){
|
//if (pcPad->Sketch.getValue()){
|
||||||
// pcSketch = static_cast<Sketcher::SketchObject*>(pcPad->Sketch.getValue());
|
// pcSketch = static_cast<Sketcher::SketchObject*>(pcPad->Sketch.getValue());
|
||||||
// pcSupport = pcSketch->Support.getValue();
|
// pcSupport = pcSketch->Support.getValue();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ std::string ViewProviderFemConstraint::gethideMeshShowPartStr()
|
||||||
|
|
||||||
bool ViewProviderFemConstraint::setEdit(int ModNum)
|
bool ViewProviderFemConstraint::setEdit(int ModNum)
|
||||||
{
|
{
|
||||||
Gui::Command::doCommand(Gui::Command::Doc,"%s",ViewProviderFemConstraint::gethideMeshShowPartStr().c_str());
|
Gui::Command::doCommand(Gui::Command::Doc,"%s",ViewProviderFemConstraint::gethideMeshShowPartStr().c_str());
|
||||||
return Gui::ViewProviderGeometryObject::setEdit(ModNum);
|
return Gui::ViewProviderGeometryObject::setEdit(ModNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
|
|
||||||
std::vector<App::DocumentObject*> claimChildren(void)const;
|
std::vector<App::DocumentObject*> claimChildren(void)const;
|
||||||
void setupContextMenu(QMenu*, QObject*, const char*);
|
void setupContextMenu(QMenu*, QObject*, const char*);
|
||||||
|
|
||||||
static std::string gethideMeshShowPartStr();
|
static std::string gethideMeshShowPartStr();
|
||||||
static std::string gethideMeshShowPartStr(const std::string showConstr);
|
static std::string gethideMeshShowPartStr(const std::string showConstr);
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ void ViewProviderFemConstraintBearing::updateData(const App::Property* prop)
|
||||||
pShapeSep->removeAllChildren();
|
pShapeSep->removeAllChildren();
|
||||||
|
|
||||||
// This should always point outside of the cylinder
|
// This should always point outside of the cylinder
|
||||||
Base::Vector3d normal = pcConstraint->NormalDirection.getValue();
|
Base::Vector3d normal = pcConstraint->NormalDirection.getValue();
|
||||||
Base::Vector3d base = pcConstraint->BasePoint.getValue();
|
Base::Vector3d base = pcConstraint->BasePoint.getValue();
|
||||||
double radius = pcConstraint->Radius.getValue();
|
double radius = pcConstraint->Radius.getValue();
|
||||||
base = base + radius * normal;
|
base = base + radius * normal;
|
||||||
|
|
|
@ -120,22 +120,22 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||||
// Set up the nodes
|
// Set up the nodes
|
||||||
cpx->matrix.setNum(0);
|
cpx->matrix.setNum(0);
|
||||||
cpx->addChild((SoNode*)createDisplacement(scaledheight, scaledwidth)); //OvG: Scaling
|
cpx->addChild((SoNode*)createDisplacement(scaledheight, scaledwidth)); //OvG: Scaling
|
||||||
|
|
||||||
cpy->matrix.setNum(0);
|
cpy->matrix.setNum(0);
|
||||||
cpy->addChild((SoNode*)createDisplacement(scaledheight, scaledwidth)); //OvG: Scaling
|
cpy->addChild((SoNode*)createDisplacement(scaledheight, scaledwidth)); //OvG: Scaling
|
||||||
|
|
||||||
cpz->matrix.setNum(0);
|
cpz->matrix.setNum(0);
|
||||||
cpz->addChild((SoNode*)createDisplacement(scaledheight, scaledwidth)); //OvG: Scaling
|
cpz->addChild((SoNode*)createDisplacement(scaledheight, scaledwidth)); //OvG: Scaling
|
||||||
|
|
||||||
cprotx->matrix.setNum(0);
|
cprotx->matrix.setNum(0);
|
||||||
cprotx->addChild((SoNode*)createRotation(scaledheight, scaledwidth)); //OvG: Scaling
|
cprotx->addChild((SoNode*)createRotation(scaledheight, scaledwidth)); //OvG: Scaling
|
||||||
|
|
||||||
cproty->matrix.setNum(0);
|
cproty->matrix.setNum(0);
|
||||||
cproty->addChild((SoNode*)createRotation(scaledheight, scaledwidth)); //OvG: Scaling
|
cproty->addChild((SoNode*)createRotation(scaledheight, scaledwidth)); //OvG: Scaling
|
||||||
|
|
||||||
cprotz->matrix.setNum(0);
|
cprotz->matrix.setNum(0);
|
||||||
cprotz->addChild((SoNode*)createRotation(scaledheight, scaledwidth)); //OvG: Scaling
|
cprotz->addChild((SoNode*)createRotation(scaledheight, scaledwidth)); //OvG: Scaling
|
||||||
|
|
||||||
pShapeSep->addChild(cpx);
|
pShapeSep->addChild(cpx);
|
||||||
pShapeSep->addChild(cpy);
|
pShapeSep->addChild(cpy);
|
||||||
pShapeSep->addChild(cpz);
|
pShapeSep->addChild(cpz);
|
||||||
|
@ -156,27 +156,27 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||||
cpx = static_cast<SoMultipleCopy*>(pShapeSep->getChild(0));
|
cpx = static_cast<SoMultipleCopy*>(pShapeSep->getChild(0));
|
||||||
cpx->matrix.setNum(points.size());
|
cpx->matrix.setNum(points.size());
|
||||||
SbMatrix* matricesx = cpx->matrix.startEditing();
|
SbMatrix* matricesx = cpx->matrix.startEditing();
|
||||||
|
|
||||||
cpy = static_cast<SoMultipleCopy*>(pShapeSep->getChild(1));
|
cpy = static_cast<SoMultipleCopy*>(pShapeSep->getChild(1));
|
||||||
cpy->matrix.setNum(points.size());
|
cpy->matrix.setNum(points.size());
|
||||||
SbMatrix* matricesy = cpy->matrix.startEditing();
|
SbMatrix* matricesy = cpy->matrix.startEditing();
|
||||||
|
|
||||||
cpz = static_cast<SoMultipleCopy*>(pShapeSep->getChild(2));
|
cpz = static_cast<SoMultipleCopy*>(pShapeSep->getChild(2));
|
||||||
cpz->matrix.setNum(points.size());
|
cpz->matrix.setNum(points.size());
|
||||||
SbMatrix* matricesz = cpz->matrix.startEditing();
|
SbMatrix* matricesz = cpz->matrix.startEditing();
|
||||||
|
|
||||||
cprotx = static_cast<SoMultipleCopy*>(pShapeSep->getChild(3));
|
cprotx = static_cast<SoMultipleCopy*>(pShapeSep->getChild(3));
|
||||||
cprotx->matrix.setNum(points.size());
|
cprotx->matrix.setNum(points.size());
|
||||||
SbMatrix* matricesrotx = cprotx->matrix.startEditing();
|
SbMatrix* matricesrotx = cprotx->matrix.startEditing();
|
||||||
|
|
||||||
cproty = static_cast<SoMultipleCopy*>(pShapeSep->getChild(4));
|
cproty = static_cast<SoMultipleCopy*>(pShapeSep->getChild(4));
|
||||||
cproty->matrix.setNum(points.size());
|
cproty->matrix.setNum(points.size());
|
||||||
SbMatrix* matricesroty = cproty->matrix.startEditing();
|
SbMatrix* matricesroty = cproty->matrix.startEditing();
|
||||||
|
|
||||||
cprotz = static_cast<SoMultipleCopy*>(pShapeSep->getChild(5));
|
cprotz = static_cast<SoMultipleCopy*>(pShapeSep->getChild(5));
|
||||||
cprotz->matrix.setNum(points.size());
|
cprotz->matrix.setNum(points.size());
|
||||||
SbMatrix* matricesrotz = cprotz->matrix.startEditing();
|
SbMatrix* matricesrotz = cprotz->matrix.startEditing();
|
||||||
|
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
int idy = 0;
|
int idy = 0;
|
||||||
int idz = 0;
|
int idz = 0;
|
||||||
|
@ -222,7 +222,7 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||||
matricesz[idz] = mz;
|
matricesz[idz] = mz;
|
||||||
idz++;
|
idz++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//OvG: Rotation indication
|
//OvG: Rotation indication
|
||||||
if(!rotxFree)
|
if(!rotxFree)
|
||||||
{
|
{
|
||||||
|
@ -268,7 +268,7 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
@ -303,7 +303,7 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||||
cprotz->matrix.finishEditing();
|
cprotz->matrix.finishEditing();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets called whenever a property of the attached object changes
|
// Gets called whenever a property of the attached object changes
|
||||||
ViewProviderFemConstraint::updateData(prop);
|
ViewProviderFemConstraint::updateData(prop);
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ bool ViewProviderFemConstraintPressure::setEdit(int ModNum)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ARROWLENGTH (4)
|
#define ARROWLENGTH (4)
|
||||||
#define ARROWHEADRADIUS (ARROWLENGTH/3)
|
#define ARROWHEADRADIUS (ARROWLENGTH/3)
|
||||||
//#define USE_MULTIPLE_COPY //OvG: MULTICOPY fails to update scaled arrows on initial drawing - so disable
|
//#define USE_MULTIPLE_COPY //OvG: MULTICOPY fails to update scaled arrows on initial drawing - so disable
|
||||||
|
|
||||||
void ViewProviderFemConstraintPressure::updateData(const App::Property* prop)
|
void ViewProviderFemConstraintPressure::updateData(const App::Property* prop)
|
||||||
|
@ -119,7 +119,7 @@ void ViewProviderFemConstraintPressure::updateData(const App::Property* prop)
|
||||||
}
|
}
|
||||||
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
|
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
|
||||||
|
|
||||||
#ifdef USE_MULTIPLE_COPY
|
#ifdef USE_MULTIPLE_COPY
|
||||||
cp = static_cast<SoMultipleCopy*>(pShapeSep->getChild(0)); //OvG: Use top cp
|
cp = static_cast<SoMultipleCopy*>(pShapeSep->getChild(0)); //OvG: Use top cp
|
||||||
cp->matrix.setNum(points.size());
|
cp->matrix.setNum(points.size());
|
||||||
SbMatrix* matrices = cp->matrix.startEditing();
|
SbMatrix* matrices = cp->matrix.startEditing();
|
||||||
|
|
|
@ -73,7 +73,7 @@ using namespace FemGui;
|
||||||
struct FemFace
|
struct FemFace
|
||||||
{
|
{
|
||||||
const SMDS_MeshNode *Nodes[8];
|
const SMDS_MeshNode *Nodes[8];
|
||||||
unsigned long ElementNumber;
|
unsigned long ElementNumber;
|
||||||
const SMDS_MeshElement* Element;
|
const SMDS_MeshElement* Element;
|
||||||
unsigned short Size;
|
unsigned short Size;
|
||||||
unsigned short FaceNo;
|
unsigned short FaceNo;
|
||||||
|
@ -103,7 +103,7 @@ Base::Vector3d FemFace::set(short size,const SMDS_MeshElement* element,unsigned
|
||||||
Nodes[7] = n8;
|
Nodes[7] = n8;
|
||||||
|
|
||||||
Element = element;
|
Element = element;
|
||||||
ElementNumber = id;
|
ElementNumber = id;
|
||||||
Size = size;
|
Size = size;
|
||||||
FaceNo = faceNo;
|
FaceNo = faceNo;
|
||||||
hide = false;
|
hide = false;
|
||||||
|
@ -135,7 +135,7 @@ public:
|
||||||
//FemFaceGridItem(void){reserve(200);}
|
//FemFaceGridItem(void){reserve(200);}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool FemFace::isSameFace (FemFace &face)
|
bool FemFace::isSameFace (FemFace &face)
|
||||||
{
|
{
|
||||||
// the same element can not have the same face
|
// the same element can not have the same face
|
||||||
if(face.ElementNumber == ElementNumber)
|
if(face.ElementNumber == ElementNumber)
|
||||||
|
@ -266,7 +266,7 @@ void ViewProviderFemMesh::attach(App::DocumentObject *pcObj)
|
||||||
SoMaterial *pcAnoMaterial = new SoMaterial;
|
SoMaterial *pcAnoMaterial = new SoMaterial;
|
||||||
pcAnoMaterial->diffuseColor.setValue(0,1,0);
|
pcAnoMaterial->diffuseColor.setValue(0,1,0);
|
||||||
pcAnoMaterial->emissiveColor.setValue(0,1,0);
|
pcAnoMaterial->emissiveColor.setValue(0,1,0);
|
||||||
pcAnotRoot->addChild(pcAnoMaterial);
|
pcAnotRoot->addChild(pcAnoMaterial);
|
||||||
pcAnotRoot->addChild(pcAnoStyle);
|
pcAnotRoot->addChild(pcAnoStyle);
|
||||||
pcAnotRoot->addChild(pcAnoCoords);
|
pcAnotRoot->addChild(pcAnoCoords);
|
||||||
SoPointSet *pointset = new SoPointSet;
|
SoPointSet *pointset = new SoPointSet;
|
||||||
|
@ -299,7 +299,7 @@ void ViewProviderFemMesh::attach(App::DocumentObject *pcObj)
|
||||||
|
|
||||||
// Points
|
// Points
|
||||||
SoGroup* pcPointsRoot = new SoSeparator();
|
SoGroup* pcPointsRoot = new SoSeparator();
|
||||||
pcPointsRoot->addChild(pcPointMaterial);
|
pcPointsRoot->addChild(pcPointMaterial);
|
||||||
pcPointsRoot->addChild(pcPointStyle);
|
pcPointsRoot->addChild(pcPointStyle);
|
||||||
pcPointsRoot->addChild(pcCoords);
|
pcPointsRoot->addChild(pcCoords);
|
||||||
pointset = new SoPointSet;
|
pointset = new SoPointSet;
|
||||||
|
@ -501,7 +501,7 @@ PyObject * ViewProviderFemMesh::getPyObject()
|
||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new ViewProviderFemMeshPy(this),true);
|
PythonObject = Py::Object(new ViewProviderFemMeshPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewProviderFemMesh::setColorByNodeId(const std::map<long,App::Color> &NodeColorMap)
|
void ViewProviderFemMesh::setColorByNodeId(const std::map<long,App::Color> &NodeColorMap)
|
||||||
|
@ -519,7 +519,7 @@ void ViewProviderFemMesh::setColorByNodeId(const std::map<long,App::Color> &Node
|
||||||
void ViewProviderFemMesh::setColorByNodeId(const std::vector<long> &NodeIds,const std::vector<App::Color> &NodeColors)
|
void ViewProviderFemMesh::setColorByNodeId(const std::vector<long> &NodeIds,const std::vector<App::Color> &NodeColors)
|
||||||
{
|
{
|
||||||
|
|
||||||
long startId = *(std::min_element(NodeIds.begin(), NodeIds.end()));
|
long startId = *(std::min_element(NodeIds.begin(), NodeIds.end()));
|
||||||
long endId = *(std::max_element(NodeIds.begin(), NodeIds.end()));
|
long endId = *(std::max_element(NodeIds.begin(), NodeIds.end()));
|
||||||
|
|
||||||
std::vector<App::Color> colorVec(endId-startId+2,App::Color(0,1,0));
|
std::vector<App::Color> colorVec(endId-startId+2,App::Color(0,1,0));
|
||||||
|
@ -574,7 +574,7 @@ void ViewProviderFemMesh::setDisplacementByNodeId(const std::map<long,Base::Vect
|
||||||
|
|
||||||
void ViewProviderFemMesh::setDisplacementByNodeId(const std::vector<long> &NodeIds,const std::vector<Base::Vector3d> &NodeDisps)
|
void ViewProviderFemMesh::setDisplacementByNodeId(const std::vector<long> &NodeIds,const std::vector<Base::Vector3d> &NodeDisps)
|
||||||
{
|
{
|
||||||
long startId = *(std::min_element(NodeIds.begin(), NodeIds.end()));
|
long startId = *(std::min_element(NodeIds.begin(), NodeIds.end()));
|
||||||
long endId = *(std::max_element(NodeIds.begin(), NodeIds.end()));
|
long endId = *(std::max_element(NodeIds.begin(), NodeIds.end()));
|
||||||
|
|
||||||
std::vector<Base::Vector3d> vecVec(endId-startId+2,Base::Vector3d());
|
std::vector<Base::Vector3d> vecVec(endId-startId+2,Base::Vector3d());
|
||||||
|
@ -709,12 +709,12 @@ inline unsigned long ElemFold(unsigned long Element,unsigned long FaceNbr)
|
||||||
return t2;
|
return t2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||||
SoCoordinate3* coords,
|
SoCoordinate3* coords,
|
||||||
SoIndexedFaceSet* faces,
|
SoIndexedFaceSet* faces,
|
||||||
SoIndexedLineSet* lines,
|
SoIndexedLineSet* lines,
|
||||||
std::vector<unsigned long> &vFaceElementIdx,
|
std::vector<unsigned long> &vFaceElementIdx,
|
||||||
std::vector<unsigned long> &vNodeElementIdx,
|
std::vector<unsigned long> &vNodeElementIdx,
|
||||||
bool &onlyEdges,
|
bool &onlyEdges,
|
||||||
bool ShowInner) const
|
bool ShowInner) const
|
||||||
{
|
{
|
||||||
|
@ -726,7 +726,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||||
int numFaces = data->NbFaces();
|
int numFaces = data->NbFaces();
|
||||||
int numNodes = data->NbNodes();
|
int numNodes = data->NbNodes();
|
||||||
int numEdges = data->NbEdges();
|
int numEdges = data->NbEdges();
|
||||||
|
|
||||||
if(numFaces+numNodes+numEdges == 0) return;
|
if(numFaces+numNodes+numEdges == 0) return;
|
||||||
Base::TimeInfo Start;
|
Base::TimeInfo Start;
|
||||||
Base::Console().Log("Start: ViewProviderFEMMeshBuilder::createMesh() =================================\n");
|
Base::Console().Log("Start: ViewProviderFEMMeshBuilder::createMesh() =================================\n");
|
||||||
|
@ -734,7 +734,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||||
const SMDS_MeshInfo& info = data->GetMeshInfo();
|
const SMDS_MeshInfo& info = data->GetMeshInfo();
|
||||||
int numTria = info.NbTriangles();
|
int numTria = info.NbTriangles();
|
||||||
int numQuad = info.NbQuadrangles();
|
int numQuad = info.NbQuadrangles();
|
||||||
|
|
||||||
int numVolu = info.NbVolumes();
|
int numVolu = info.NbVolumes();
|
||||||
int numTetr = info.NbTetras();
|
int numTetr = info.NbTetras();
|
||||||
int numHexa = info.NbHexas();
|
int numHexa = info.NbHexas();
|
||||||
|
@ -757,7 +757,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||||
if (numFaces <= 0 && numVolu <= 0 && numEdges > 0){
|
if (numFaces <= 0 && numVolu <= 0 && numEdges > 0){
|
||||||
onlyEdges = true;
|
onlyEdges = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<FemFace> facesHelper(numTries);
|
std::vector<FemFace> facesHelper(numTries);
|
||||||
|
|
||||||
Base::Console().Log(" %f: Start build up %i face helper\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()),facesHelper.size());
|
Base::Console().Log(" %f: Start build up %i face helper\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()),facesHelper.size());
|
||||||
|
@ -841,7 +841,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||||
BndBox.Add(facesHelper[i++].set(4, aVol, aVol->GetID(), 4, aVol->GetNode(1), aVol->GetNode(4), aVol->GetNode(5), aVol->GetNode(2)));
|
BndBox.Add(facesHelper[i++].set(4, aVol, aVol->GetID(), 4, aVol->GetNode(1), aVol->GetNode(4), aVol->GetNode(5), aVol->GetNode(2)));
|
||||||
BndBox.Add(facesHelper[i++].set(4, aVol, aVol->GetID(), 5, aVol->GetNode(2), aVol->GetNode(5), aVol->GetNode(3), aVol->GetNode(0)));
|
BndBox.Add(facesHelper[i++].set(4, aVol, aVol->GetID(), 5, aVol->GetNode(2), aVol->GetNode(5), aVol->GetNode(3), aVol->GetNode(0)));
|
||||||
break;
|
break;
|
||||||
//hexa8 volume
|
//hexa8 volume
|
||||||
case 8:
|
case 8:
|
||||||
// face 1 = N1, N2, N3, N4
|
// face 1 = N1, N2, N3, N4
|
||||||
// face 2 = N5, N8, N7, N6
|
// face 2 = N5, N8, N7, N6
|
||||||
|
@ -919,7 +919,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||||
|
|
||||||
if( FaceSize < 5000){
|
if( FaceSize < 5000){
|
||||||
Base::Console().Log(" %f: Start eliminate internal faces SIMPLE\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
|
Base::Console().Log(" %f: Start eliminate internal faces SIMPLE\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
|
||||||
|
|
||||||
// search for double (inside) faces and hide them
|
// search for double (inside) faces and hide them
|
||||||
if(!ShowInner){
|
if(!ShowInner){
|
||||||
for(int l=0; l< FaceSize;l++){
|
for(int l=0; l< FaceSize;l++){
|
||||||
|
@ -972,7 +972,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||||
|
|
||||||
if(iX >= NbrX || iY >= NbrY || iZ >= NbrZ)
|
if(iX >= NbrX || iY >= NbrY || iZ >= NbrZ)
|
||||||
Base::Console().Log(" Outof range!\n");
|
Base::Console().Log(" Outof range!\n");
|
||||||
|
|
||||||
Grid[iX + iY*NbrX + iZ*NbrX*NbrY].push_back(&facesHelper[l]);
|
Grid[iX + iY*NbrX + iZ*NbrX*NbrY].push_back(&facesHelper[l]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -991,7 +991,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||||
avg += it->size();
|
avg += it->size();
|
||||||
}
|
}
|
||||||
avg = avg/Grid.size();
|
avg = avg/Grid.size();
|
||||||
|
|
||||||
Base::Console().Log(" VoxelSize: Max:%i ,Average:%i\n",max,avg);
|
Base::Console().Log(" VoxelSize: Max:%i ,Average:%i\n",max,avg);
|
||||||
|
|
||||||
} //if( FaceSize < 1000)
|
} //if( FaceSize < 1000)
|
||||||
|
@ -1058,7 +1058,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Base::Console().Log(" NumTriangles:%i\n",triangleCount);
|
Base::Console().Log(" NumTriangles:%i\n",triangleCount);
|
||||||
// edge map collect and sort edges of the faces to be shown.
|
// edge map collect and sort edges of the faces to be shown.
|
||||||
std::map<int,std::set<int> > EdgeMap;
|
std::map<int,std::set<int> > EdgeMap;
|
||||||
|
|
||||||
// handling the corner case beams only, means no faces/triangles only nodes and edges
|
// handling the corner case beams only, means no faces/triangles only nodes and edges
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
#include <CXX/Objects.hxx>
|
#include <CXX/Objects.hxx>
|
||||||
|
|
||||||
class SoCoordinate3;
|
class SoCoordinate3;
|
||||||
class SoDrawStyle;
|
class SoDrawStyle;
|
||||||
class SoIndexedFaceSet;
|
class SoIndexedFaceSet;
|
||||||
class SoIndexedLineSet;
|
class SoIndexedLineSet;
|
||||||
class SoShapeHints;
|
class SoShapeHints;
|
||||||
class SoMaterialBinding;
|
class SoMaterialBinding;
|
||||||
|
|
||||||
|
@ -45,8 +45,8 @@ public:
|
||||||
ViewProviderFEMMeshBuilder(){}
|
ViewProviderFEMMeshBuilder(){}
|
||||||
virtual ~ViewProviderFEMMeshBuilder(){}
|
virtual ~ViewProviderFEMMeshBuilder(){}
|
||||||
virtual void buildNodes(const App::Property*, std::vector<SoNode*>&) const;
|
virtual void buildNodes(const App::Property*, std::vector<SoNode*>&) const;
|
||||||
void createMesh(const App::Property*,
|
void createMesh(const App::Property*,
|
||||||
SoCoordinate3*,
|
SoCoordinate3*,
|
||||||
SoIndexedFaceSet*,
|
SoIndexedFaceSet*,
|
||||||
SoIndexedLineSet*,
|
SoIndexedLineSet*,
|
||||||
std::vector<unsigned long>&,
|
std::vector<unsigned long>&,
|
||||||
|
@ -82,7 +82,7 @@ public:
|
||||||
/** @name Selection handling
|
/** @name Selection handling
|
||||||
* This group of methodes do the selection handling.
|
* This group of methodes do the selection handling.
|
||||||
* Here you can define how the selection for your ViewProvider
|
* Here you can define how the selection for your ViewProvider
|
||||||
* works.
|
* works.
|
||||||
*/
|
*/
|
||||||
//@{
|
//@{
|
||||||
/// indicates if the ViewProvider use the new Selection model
|
/// indicates if the ViewProvider use the new Selection model
|
||||||
|
@ -94,10 +94,10 @@ public:
|
||||||
virtual std::vector<Base::Vector3d> getSelectionShape(const char* Element) const;
|
virtual std::vector<Base::Vector3d> getSelectionShape(const char* Element) const;
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
// interface methodes
|
// interface methodes
|
||||||
void setHighlightNodes(const std::set<long>&);
|
void setHighlightNodes(const std::set<long>&);
|
||||||
void resetHighlightNodes(void);
|
void resetHighlightNodes(void);
|
||||||
|
|
||||||
/** @name Postprocessing
|
/** @name Postprocessing
|
||||||
* this interfaces apply post processing stuff to the View-
|
* this interfaces apply post processing stuff to the View-
|
||||||
* Provider. They can override the positioning and the color
|
* Provider. They can override the positioning and the color
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<?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">
|
||||||
|
|
|
@ -44,8 +44,8 @@ App::Color calcColor(double value,double min, double max)
|
||||||
if (max < 0) max = 0;
|
if (max < 0) max = 0;
|
||||||
if (min > 0) min = 0;
|
if (min > 0) min = 0;
|
||||||
|
|
||||||
if (value < min)
|
if (value < min)
|
||||||
return App::Color (0.0,0.0,1.0);
|
return App::Color (0.0,0.0,1.0);
|
||||||
if (value > max)
|
if (value > max)
|
||||||
return App::Color (1.0,0.0,0.0);
|
return App::Color (1.0,0.0,0.0);
|
||||||
if (value == 0.0)
|
if (value == 0.0)
|
||||||
|
@ -281,7 +281,7 @@ PyObject *ViewProviderFemMeshPy::getCustomAttributes(const char* /*attr*/) const
|
||||||
|
|
||||||
int ViewProviderFemMeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
int ViewProviderFemMeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,5 +43,5 @@ ViewProviderFemMeshShape::ViewProviderFemMeshShape()
|
||||||
|
|
||||||
ViewProviderFemMeshShape::~ViewProviderFemMeshShape()
|
ViewProviderFemMeshShape::~ViewProviderFemMeshShape()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
#include <Gui/ViewProviderPythonFeature.h>
|
#include <Gui/ViewProviderPythonFeature.h>
|
||||||
|
|
||||||
class SoCoordinate3;
|
class SoCoordinate3;
|
||||||
class SoDrawStyle;
|
class SoDrawStyle;
|
||||||
class SoIndexedFaceSet;
|
class SoIndexedFaceSet;
|
||||||
class SoIndexedLineSet;
|
class SoIndexedLineSet;
|
||||||
class SoShapeHints;
|
class SoShapeHints;
|
||||||
class SoMaterialBinding;
|
class SoMaterialBinding;
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
||||||
<< "Fem_ConstraintForce"
|
<< "Fem_ConstraintForce"
|
||||||
<< "Fem_ConstraintPressure"
|
<< "Fem_ConstraintPressure"
|
||||||
<< "Fem_ConstraintBearing"
|
<< "Fem_ConstraintBearing"
|
||||||
<< "Fem_ConstraintGear"
|
<< "Fem_ConstraintGear"
|
||||||
<< "Fem_ConstraintPulley"
|
<< "Fem_ConstraintPulley"
|
||||||
<< "Separator"
|
<< "Separator"
|
||||||
<< "Fem_SolverJobControl"
|
<< "Fem_SolverJobControl"
|
||||||
|
@ -102,7 +102,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
|
||||||
<< "Fem_ConstraintForce"
|
<< "Fem_ConstraintForce"
|
||||||
<< "Fem_ConstraintPressure"
|
<< "Fem_ConstraintPressure"
|
||||||
<< "Fem_ConstraintBearing"
|
<< "Fem_ConstraintBearing"
|
||||||
<< "Fem_ConstraintGear"
|
<< "Fem_ConstraintGear"
|
||||||
<< "Fem_ConstraintPulley"
|
<< "Fem_ConstraintPulley"
|
||||||
<< "Separator"
|
<< "Separator"
|
||||||
<< "Fem_SolverJobControl"
|
<< "Fem_SolverJobControl"
|
||||||
|
|
|
@ -47,4 +47,4 @@ protected:
|
||||||
} // namespace FemGui
|
} // namespace FemGui
|
||||||
|
|
||||||
|
|
||||||
#endif // IMAGE_WORKBENCH_H
|
#endif // IMAGE_WORKBENCH_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user