mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-30 19:30:36 +05:00
Correct help page name
Remove std::cerr lines
This commit is contained in:
parent
75ac0c55d8
commit
597d9e3d7f
@ -159,7 +159,7 @@ AdvancedGUI_PipeTShapeDlg::AdvancedGUI_PipeTShapeDlg(GeometryGUI* theGeometryGUI
|
|||||||
myMainLayout->addWidget(JunctionPointsSel, rowNewPosVal, colNewPosVal, rowspanNewPosVal, colspanNewPosVal);
|
myMainLayout->addWidget(JunctionPointsSel, rowNewPosVal, colNewPosVal, rowspanNewPosVal, colspanNewPosVal);
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("create__pipetshape__page.html");
|
setHelpFileName("create_pipetshape_page.html");
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
@ -784,24 +784,16 @@ bool AdvancedGUI_PipeTShapeDlg::CheckCompatiblePosition(GEOM::GEOM_Object_var th
|
|||||||
// SetErrorCode("Junctions points P2 and P3 are identical");
|
// SetErrorCode("Junctions points P2 and P3 are identical");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// std::cerr << "theL1: " << theL1 << std::endl;
|
|
||||||
// std::cerr << "theL2: " << theL2 << std::endl;
|
|
||||||
// std::cerr << "d12: " << d12 << std::endl;
|
|
||||||
// std::cerr << "d13: " << d13 << std::endl;
|
|
||||||
// std::cerr << "d23: " << d23 << std::endl;
|
|
||||||
|
|
||||||
long double newL1 = 0.5 * d12;
|
long double newL1 = 0.5 * d12;
|
||||||
long double newL2 = sqrt(pow(d13,2)-pow(newL1,2));
|
long double newL2 = sqrt(pow(d13,2)-pow(newL1,2));
|
||||||
|
|
||||||
JunctionPointsSel->LineEdit4->setText(QString::number(newL1,'f',7));
|
JunctionPointsSel->LineEdit4->setText(QString::number(newL1,'f',7));
|
||||||
JunctionPointsSel->LineEdit5->setText(QString::number(newL2,'f',7));
|
JunctionPointsSel->LineEdit5->setText(QString::number(newL2,'f',7));
|
||||||
// std::cerr << "newL1: " << newL1 << std::endl;
|
|
||||||
// std::cerr << "newL2: " << newL2 << std::endl;
|
|
||||||
|
|
||||||
if (fabs(newL1 - theL1) > Precision::Approximation()) {
|
if (fabs(newL1 - theL1) > Precision::Approximation()) {
|
||||||
if ((newL1 * (1 - theTolerance) - theL1 <= Precision::Approximation()) &&
|
if ((newL1 * (1 - theTolerance) - theL1 <= Precision::Approximation()) &&
|
||||||
(newL1 * (1 + theTolerance) - theL1 >= Precision::Approximation())) {
|
(newL1 * (1 + theTolerance) - theL1 >= Precision::Approximation())) {
|
||||||
// std::cerr << "theL1 = newL1" << std::endl;
|
|
||||||
disconnect(MainTubeGroupParams->SpinBox_DZ, 0, this, 0);
|
disconnect(MainTubeGroupParams->SpinBox_DZ, 0, this, 0);
|
||||||
MainTubeGroupParams->SpinBox_DZ->setValue(newL1);
|
MainTubeGroupParams->SpinBox_DZ->setValue(newL1);
|
||||||
connect(MainTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
|
connect(MainTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
@ -820,11 +812,9 @@ bool AdvancedGUI_PipeTShapeDlg::CheckCompatiblePosition(GEOM::GEOM_Object_var th
|
|||||||
JunctionPointsSel->PushButton4->setStyleSheet(CssNormal);
|
JunctionPointsSel->PushButton4->setStyleSheet(CssNormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// std::cerr << "fabs(newL2 - theL2) = " << fabs(newL2 - theL2) << std::endl;
|
|
||||||
if (fabs(newL2 - theL2) > Precision::Approximation()) {
|
if (fabs(newL2 - theL2) > Precision::Approximation()) {
|
||||||
if ((newL2 * (1 - theTolerance) - theL2 <= Precision::Approximation()) &&
|
if ((newL2 * (1 - theTolerance) - theL2 <= Precision::Approximation()) &&
|
||||||
(newL2 * (1 + theTolerance) - theL2 >= Precision::Approximation())) {
|
(newL2 * (1 + theTolerance) - theL2 >= Precision::Approximation())) {
|
||||||
// std::cerr << "theL2 = newL2" << std::endl;
|
|
||||||
disconnect(IncidentTubeGroupParams->SpinBox_DZ, 0, this, 0);
|
disconnect(IncidentTubeGroupParams->SpinBox_DZ, 0, this, 0);
|
||||||
IncidentTubeGroupParams->SpinBox_DZ->setValue(newL2);
|
IncidentTubeGroupParams->SpinBox_DZ->setValue(newL2);
|
||||||
connect(IncidentTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
|
connect(IncidentTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
@ -961,7 +951,6 @@ void AdvancedGUI_PipeTShapeDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy, S
|
|||||||
ObjectList::iterator it = pipeTShapeGroupObjects.begin();
|
ObjectList::iterator it = pipeTShapeGroupObjects.begin();
|
||||||
|
|
||||||
for (int i = 0; it != pipeTShapeGroupObjects.end(); it++, i++) {
|
for (int i = 0; it != pipeTShapeGroupObjects.end(); it++, i++) {
|
||||||
// std::cerr << "Add group " << (*it)->GetName() << std::endl;
|
|
||||||
getGeomEngine()->AddInStudy(theStudy, (*it), tr((*it)->GetName()).toStdString().c_str(), theFather);
|
getGeomEngine()->AddInStudy(theStudy, (*it), tr((*it)->GetName()).toStdString().c_str(), theFather);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -812,7 +812,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(/*std::vector<GEOM_IO
|
|||||||
|
|
||||||
// extremVertices = aShapesOperations->GetShapesOnCylinder(theShape, TopAbs_VERTEX, Vector_Z, theVertCylinderRadius, GEOMAlgo_ST_ONIN);
|
// extremVertices = aShapesOperations->GetShapesOnCylinder(theShape, TopAbs_VERTEX, Vector_Z, theVertCylinderRadius, GEOMAlgo_ST_ONIN);
|
||||||
if (extremVertices.IsNull() || extremVertices->Length() == 0) {
|
if (extremVertices.IsNull() || extremVertices->Length() == 0) {
|
||||||
std::cerr << "extremVertices.IsNull() || extremVertices->Length() == 0" << std::endl;
|
// std::cerr << "extremVertices.IsNull() || extremVertices->Length() == 0" << std::endl;
|
||||||
if (theRF == 0)
|
if (theRF == 0)
|
||||||
SetErrorCode("Vertices on chamfer not found");
|
SetErrorCode("Vertices on chamfer not found");
|
||||||
else
|
else
|
||||||
@ -1248,7 +1248,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(/*std::vector<GEO
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1,
|
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1,
|
||||||
double theL1, double theR2, double theW2, double theL2, bool theHexMesh) {
|
double theL1, double theR2, double theW2, double theL2, bool theHexMesh) {
|
||||||
std::cerr << "GEOMImpl_IAdvancedOperations::MakePipeTShape" << std::endl;
|
MESSAGE("GEOMImpl_IAdvancedOperations::MakePipeTShape");
|
||||||
SetErrorCode(KO);
|
SetErrorCode(KO);
|
||||||
//Add a new object
|
//Add a new object
|
||||||
// std::cerr << "Add a new object" << std::endl;
|
// std::cerr << "Add a new object" << std::endl;
|
||||||
@ -1280,8 +1280,8 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
|
|||||||
OCC_CATCH_SIGNALS;
|
OCC_CATCH_SIGNALS;
|
||||||
#endif
|
#endif
|
||||||
if (!GetSolver()->ComputeFunction(aFunction)) {
|
if (!GetSolver()->ComputeFunction(aFunction)) {
|
||||||
// SetErrorCode("TShape driver failed");
|
SetErrorCode("TShape driver failed");
|
||||||
std::cerr << "TShape driver failed" << std::endl;
|
// MESSAGE("TShape driver failed");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
// std::cerr << "aShape->GetName(): " << aShape->GetName() << std::endl;
|
// std::cerr << "aShape->GetName(): " << aShape->GetName() << std::endl;
|
||||||
@ -1445,14 +1445,14 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
|
|||||||
theOperations.push_back(aTransformOperations);
|
theOperations.push_back(aTransformOperations);
|
||||||
|
|
||||||
if (theHexMesh) {
|
if (theHexMesh) {
|
||||||
std::cerr << "Creating partition" << std::endl;
|
// std::cerr << "Creating partition" << std::endl;
|
||||||
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
||||||
return NULL;
|
return NULL;
|
||||||
std::cerr << "Done" << std::endl;
|
// std::cerr << "Done" << std::endl;
|
||||||
std::cerr << "Creating mirrors and glue" << std::endl;
|
// std::cerr << "Creating mirrors and glue" << std::endl;
|
||||||
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
||||||
return NULL;
|
return NULL;
|
||||||
std::cerr << "Done" << std::endl;
|
// std::cerr << "Done" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
TopoDS_Shape Te = aShape->GetValue();
|
TopoDS_Shape Te = aShape->GetValue();
|
||||||
@ -1604,29 +1604,22 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
|
|||||||
box_e->GetLastFunction()->SetDescription("");
|
box_e->GetLastFunction()->SetDescription("");
|
||||||
|
|
||||||
if (edges_e.IsNull() || edges_e->Length() == 0) {
|
if (edges_e.IsNull() || edges_e->Length() == 0) {
|
||||||
// std::cerr << "Internal edges not found" << std::endl;
|
|
||||||
SetErrorCode("External edges not found");
|
SetErrorCode("External edges not found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// std::cerr << "External edges found" << std::endl;
|
|
||||||
int nbEdgesInChamfer = 0;
|
int nbEdgesInChamfer = 0;
|
||||||
std::list<int> theEdges;
|
std::list<int> theEdges;
|
||||||
for (int i=1; i<=edges_e->Length();i++) {
|
for (int i=1; i<=edges_e->Length();i++) {
|
||||||
// Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(edges_e->Value(i));
|
|
||||||
// anObj->GetLastFunction()->SetDescription("");
|
|
||||||
int edgeID = edges_e->Value(i);
|
int edgeID = edges_e->Value(i);
|
||||||
// std::cerr << "Edge #" << edgeID << std::endl;
|
|
||||||
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
|
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
|
||||||
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
|
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
|
||||||
int iv=0;
|
int iv=0;
|
||||||
while (Ex.More()) {
|
while (Ex.More()) {
|
||||||
iv ++;
|
iv ++;
|
||||||
gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
|
gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
|
||||||
// std::cerr << "Vertex #" << iv << ": aPt.Z() - (theR1+theW1) = " << aPt.Z() - (theR1+theW1) << std::endl;
|
|
||||||
if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) {
|
if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) {
|
||||||
nbEdgesInChamfer ++;
|
nbEdgesInChamfer ++;
|
||||||
theEdges.push_back(edgeID);
|
theEdges.push_back(edgeID);
|
||||||
// std::cerr << "Edge #" << edgeID << " added" << std::endl;
|
|
||||||
}
|
}
|
||||||
Ex.Next();
|
Ex.Next();
|
||||||
}
|
}
|
||||||
@ -1652,61 +1645,60 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
|
|||||||
aFunction->SetValue(aChamferShape);
|
aFunction->SetValue(aChamferShape);
|
||||||
// END of chamfer
|
// END of chamfer
|
||||||
|
|
||||||
bool doMesh = false;
|
// bool doMesh = false;
|
||||||
if (theHexMesh) {
|
if (theHexMesh) {
|
||||||
doMesh = true;
|
// doMesh = true;
|
||||||
std::cerr << "Creating partition" << std::endl;
|
|
||||||
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false)) {
|
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false)) {
|
||||||
std::cerr << "PipeTShape partition failed" << std::endl;
|
MESSAGE("PipeTShape partition failed");
|
||||||
doMesh = false;
|
// doMesh = false;
|
||||||
// return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
std::cerr << "Done" << std::endl;
|
|
||||||
std::cerr << "Creating mirrors and glue" << std::endl;
|
|
||||||
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2)) {
|
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2)) {
|
||||||
std::cerr << "PipeTShape mirrors and glue failed" << std::endl;
|
MESSAGE("PipeTShape mirrors and glue failed");
|
||||||
doMesh = false;
|
// doMesh = false;
|
||||||
// return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
std::cerr << "Done" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
|
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
|
||||||
aSeq->Append(aShape);
|
aSeq->Append(aShape);
|
||||||
|
|
||||||
if (doMesh) {
|
// if (doMesh) {
|
||||||
|
if (theHexMesh) {
|
||||||
//
|
//
|
||||||
// Get the groups: BEGIN
|
// Get the groups: BEGIN
|
||||||
//
|
//
|
||||||
if (!MakeGroups(/*theOperations, */aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) {
|
// if (!MakeGroups(/*theOperations, */aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) {
|
||||||
//Make a Python command
|
// //Make a Python command
|
||||||
GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1
|
// GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1
|
||||||
<< ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW
|
// << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW
|
||||||
<< ", " << theHexMesh << ")";
|
// << ", " << theHexMesh << ")";
|
||||||
// return NULL;
|
// }
|
||||||
}
|
// else {
|
||||||
else {
|
if (!MakeGroups(/*theOperations, */aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf()))
|
||||||
TCollection_AsciiString aListRes, anEntry;
|
return NULL;
|
||||||
// Iterate over the sequence aSeq
|
|
||||||
Standard_Integer aNbGroups = aSeq->Length();
|
|
||||||
Standard_Integer i = 2;
|
|
||||||
for (; i <= aNbGroups; i++) {
|
|
||||||
Handle(Standard_Transient) anItem = aSeq->Value(i);
|
|
||||||
if (anItem.IsNull()) continue;
|
|
||||||
Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
|
|
||||||
if (aGroup.IsNull()) continue;
|
|
||||||
//Make a Python command
|
|
||||||
TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
|
|
||||||
aListRes += anEntry + ", ";
|
|
||||||
}
|
|
||||||
|
|
||||||
aListRes.Trunc(aListRes.Length() - 2);
|
TCollection_AsciiString aListRes, anEntry;
|
||||||
|
// Iterate over the sequence aSeq
|
||||||
|
Standard_Integer aNbGroups = aSeq->Length();
|
||||||
|
Standard_Integer i = 2;
|
||||||
|
for (; i <= aNbGroups; i++) {
|
||||||
|
Handle(Standard_Transient) anItem = aSeq->Value(i);
|
||||||
|
if (anItem.IsNull()) continue;
|
||||||
|
Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
|
||||||
|
if (aGroup.IsNull()) continue;
|
||||||
|
//Make a Python command
|
||||||
|
TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
|
||||||
|
aListRes += anEntry + ", ";
|
||||||
|
}
|
||||||
|
|
||||||
//Make a Python command
|
aListRes.Trunc(aListRes.Length() - 2);
|
||||||
GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString()
|
|
||||||
<< "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2
|
//Make a Python command
|
||||||
<< ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ")";
|
GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString()
|
||||||
}
|
<< "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2
|
||||||
|
<< ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ")";
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Get the groups: END
|
// Get the groups: END
|
||||||
@ -1826,16 +1818,12 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
|
|||||||
box_e->GetLastFunction()->SetDescription("");
|
box_e->GetLastFunction()->SetDescription("");
|
||||||
|
|
||||||
if (edges_e.IsNull() || edges_e->Length() == 0) {
|
if (edges_e.IsNull() || edges_e->Length() == 0) {
|
||||||
// std::cerr << "Internal edges not found" << std::endl;
|
|
||||||
SetErrorCode("External edges not found");
|
SetErrorCode("External edges not found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// std::cerr << "External edges found" << std::endl;
|
|
||||||
int nbEdgesInChamfer = 0;
|
int nbEdgesInChamfer = 0;
|
||||||
std::list<int> theEdges;
|
std::list<int> theEdges;
|
||||||
for (int i=1; i<=edges_e->Length();i++) {
|
for (int i=1; i<=edges_e->Length();i++) {
|
||||||
// Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(edges_e->Value(i));
|
|
||||||
// anObj->GetLastFunction()->SetDescription("");
|
|
||||||
int edgeID = edges_e->Value(i);
|
int edgeID = edges_e->Value(i);
|
||||||
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
|
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
|
||||||
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
|
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
|
||||||
@ -1870,14 +1858,10 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
|
|||||||
// END of chamfer
|
// END of chamfer
|
||||||
|
|
||||||
if (theHexMesh) {
|
if (theHexMesh) {
|
||||||
std::cerr << "Creating partition" << std::endl;
|
|
||||||
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false))
|
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false))
|
||||||
return NULL;
|
return NULL;
|
||||||
std::cerr << "Done" << std::endl;
|
|
||||||
std::cerr << "Creating mirrors and glue" << std::endl;
|
|
||||||
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
||||||
return NULL;
|
return NULL;
|
||||||
std::cerr << "Done" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TopoDS_Shape Te = aShape->GetValue();
|
TopoDS_Shape Te = aShape->GetValue();
|
||||||
@ -2024,16 +2008,12 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
|
|||||||
box_e->GetLastFunction()->SetDescription("");
|
box_e->GetLastFunction()->SetDescription("");
|
||||||
|
|
||||||
if (edges_e.IsNull() || edges_e->Length() == 0) {
|
if (edges_e.IsNull() || edges_e->Length() == 0) {
|
||||||
// std::cerr << "Internal edges not found" << std::endl;
|
|
||||||
SetErrorCode("External edges not found");
|
SetErrorCode("External edges not found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// std::cerr << "External edges found" << std::endl;
|
|
||||||
int nbEdgesInFillet = 0;
|
int nbEdgesInFillet = 0;
|
||||||
std::list<int> theEdges;
|
std::list<int> theEdges;
|
||||||
for (int i=1; i<=edges_e->Length();i++) {
|
for (int i=1; i<=edges_e->Length();i++) {
|
||||||
// Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(edges_e->Value(i));
|
|
||||||
// anObj->GetLastFunction()->SetDescription("");
|
|
||||||
int edgeID = edges_e->Value(i);
|
int edgeID = edges_e->Value(i);
|
||||||
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
|
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
|
||||||
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
|
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
|
||||||
@ -2069,14 +2049,10 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
|
|||||||
// END of fillet
|
// END of fillet
|
||||||
|
|
||||||
if (theHexMesh) {
|
if (theHexMesh) {
|
||||||
std::cerr << "Creating partition" << std::endl;
|
|
||||||
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false))
|
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false))
|
||||||
return NULL;
|
return NULL;
|
||||||
std::cerr << "Done" << std::endl;
|
|
||||||
std::cerr << "Creating mirrors and glue" << std::endl;
|
|
||||||
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
||||||
return NULL;
|
return NULL;
|
||||||
std::cerr << "Done" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
|
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
|
||||||
@ -2227,16 +2203,12 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
|
|||||||
box_e->GetLastFunction()->SetDescription("");
|
box_e->GetLastFunction()->SetDescription("");
|
||||||
|
|
||||||
if (edges_e.IsNull() || edges_e->Length() == 0) {
|
if (edges_e.IsNull() || edges_e->Length() == 0) {
|
||||||
// std::cerr << "Internal edges not found" << std::endl;
|
|
||||||
SetErrorCode("External edges not found");
|
SetErrorCode("External edges not found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// std::cerr << "External edges found" << std::endl;
|
|
||||||
int nbEdgesInFillet = 0;
|
int nbEdgesInFillet = 0;
|
||||||
std::list<int> theEdges;
|
std::list<int> theEdges;
|
||||||
for (int i=1; i<=edges_e->Length();i++) {
|
for (int i=1; i<=edges_e->Length();i++) {
|
||||||
// Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(edges_e->Value(i));
|
|
||||||
// anObj->GetLastFunction()->SetDescription("");
|
|
||||||
int edgeID = edges_e->Value(i);
|
int edgeID = edges_e->Value(i);
|
||||||
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
|
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
|
||||||
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
|
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
|
||||||
@ -2272,14 +2244,10 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
|
|||||||
// END of fillet
|
// END of fillet
|
||||||
|
|
||||||
if (theHexMesh) {
|
if (theHexMesh) {
|
||||||
std::cerr << "Creating partition" << std::endl;
|
|
||||||
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false))
|
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false))
|
||||||
return NULL;
|
return NULL;
|
||||||
std::cerr << "Done" << std::endl;
|
|
||||||
std::cerr << "Creating mirrors and glue" << std::endl;
|
|
||||||
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
||||||
return NULL;
|
return NULL;
|
||||||
std::cerr << "Done" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TopoDS_Shape Te = aShape->GetValue();
|
TopoDS_Shape Te = aShape->GetValue();
|
||||||
|
@ -153,10 +153,8 @@ GEOMImpl_PipeTShapeDriver::GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
|
|||||||
TopTools_ListIteratorOfListOfShape itSub (listSS);
|
TopTools_ListIteratorOfListOfShape itSub (listSS);
|
||||||
for (int index = 1; itSub.More(); itSub.Next(), ++index) {
|
for (int index = 1; itSub.More(); itSub.Next(), ++index) {
|
||||||
int id = anIndices.FindIndex(itSub.Value());
|
int id = anIndices.FindIndex(itSub.Value());
|
||||||
std::cerr << "Shape with ID " << id << " found" << std::endl;
|
// std::cerr << "Shape with ID " << id << " found" << std::endl;
|
||||||
// TopoDS_Shape s = anIndices.FindKey(id);
|
|
||||||
aSeqOfIDs->Append(id);
|
aSeqOfIDs->Append(id);
|
||||||
// aSeqOfIDs->Append(itSub.Value());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return aSeqOfIDs;
|
return aSeqOfIDs;
|
||||||
@ -288,9 +286,9 @@ void GEOMImpl_PipeTShapeDriver::GetCommonShapesOnCylinders(const TopoDS_Shape& t
|
|||||||
// # Search in theShape for common shape of type theShapeType on the intersection of 2 pipes
|
// # Search in theShape for common shape of type theShapeType on the intersection of 2 pipes
|
||||||
found = false;
|
found = false;
|
||||||
for (int i=1; i<=aSeqExt2->Length();i++) {
|
for (int i=1; i<=aSeqExt2->Length();i++) {
|
||||||
std::cerr << "aSeqExt2->Value(i): " << aSeqExt2->Value(i) << std::endl;
|
// std::cerr << "aSeqExt2->Value(i): " << aSeqExt2->Value(i) << std::endl;
|
||||||
for (int j=1; j<=aSeqExt1->Length();j++) {
|
for (int j=1; j<=aSeqExt1->Length();j++) {
|
||||||
std::cerr << "aSeqExt1->Value(j): " << aSeqExt1->Value(j) << std::endl;
|
// std::cerr << "aSeqExt1->Value(j): " << aSeqExt1->Value(j) << std::endl;
|
||||||
if (aSeqExt1->Value(j) == aSeqExt2->Value(i)) {
|
if (aSeqExt1->Value(j) == aSeqExt2->Value(i)) {
|
||||||
myID = aSeqExt1->Value(j);
|
myID = aSeqExt1->Value(j);
|
||||||
commonShapes->Append(aMapOfShapes.FindKey(myID));
|
commonShapes->Append(aMapOfShapes.FindKey(myID));
|
||||||
@ -412,14 +410,10 @@ Standard_Integer GEOMImpl_PipeTShapeDriver::Execute(TFunction_Logbook& log) cons
|
|||||||
double aR2Ext = aData.GetR2() + aData.GetW2();
|
double aR2Ext = aData.GetR2() + aData.GetW2();
|
||||||
|
|
||||||
if (aData.GetR2() > aData.GetR1() + epsilon) {
|
if (aData.GetR2() > aData.GetR1() + epsilon) {
|
||||||
std::cerr << "aData.GetR1(): " << aData.GetR1() << std::endl;
|
|
||||||
std::cerr << "aData.GetR2(): " << aData.GetR2() << std::endl;
|
|
||||||
StdFail_NotDone::Raise("TShape cannot be computed if R2 > R1");
|
StdFail_NotDone::Raise("TShape cannot be computed if R2 > R1");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aR2Ext > aR1Ext + epsilon) {
|
if (aR2Ext > aR1Ext + epsilon) {
|
||||||
std::cerr << "aR1Ext: " << aR1Ext << std::endl;
|
|
||||||
std::cerr << "aR2Ext: " << aR2Ext << std::endl;
|
|
||||||
StdFail_NotDone::Raise("TShape cannot be computed if R2+W2 > R1+W1");
|
StdFail_NotDone::Raise("TShape cannot be computed if R2+W2 > R1+W1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,10 +425,6 @@ Standard_Integer GEOMImpl_PipeTShapeDriver::Execute(TFunction_Logbook& log) cons
|
|||||||
StdFail_NotDone::Raise("TShape with fillet cannot be computed if R2+W2 = R1+W1");
|
StdFail_NotDone::Raise("TShape with fillet cannot be computed if R2+W2 = R1+W1");
|
||||||
// internal radius are different => not possible
|
// internal radius are different => not possible
|
||||||
if (fabs(aData.GetR2() - aData.GetR1()) > epsilon) {
|
if (fabs(aData.GetR2() - aData.GetR1()) > epsilon) {
|
||||||
std::cerr << "R1Ext: " << aR1Ext << std::endl;
|
|
||||||
std::cerr << "R2Ext: " << aR2Ext << std::endl;
|
|
||||||
std::cerr << "R1: " << aData.GetR1() << std::endl;
|
|
||||||
std::cerr << "R2: " << aData.GetR2() << std::endl;
|
|
||||||
StdFail_NotDone::Raise("TShape cannot be computed if R2+W2 = R1+W1 and R2 != R1");
|
StdFail_NotDone::Raise("TShape cannot be computed if R2+W2 = R1+W1 and R2 != R1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -449,10 +439,6 @@ Standard_Integer GEOMImpl_PipeTShapeDriver::Execute(TFunction_Logbook& log) cons
|
|||||||
|
|
||||||
if (aType == TSHAPE_CHAMFER) {
|
if (aType == TSHAPE_CHAMFER) {
|
||||||
if (aData.GetH() >= (aData.GetL2() - aR1Ext + epsilon)) {
|
if (aData.GetH() >= (aData.GetL2() - aR1Ext + epsilon)) {
|
||||||
std::cerr << "H: " << aData.GetH() << std::endl;
|
|
||||||
std::cerr << "L2: " << aData.GetL2() << std::endl;
|
|
||||||
std::cerr << "R1Ext: " << aR1Ext << std::endl;
|
|
||||||
std::cerr << "aData.GetL2() - aR1Ext: " << aData.GetL2() - aR1Ext << std::endl;
|
|
||||||
StdFail_NotDone::Raise("TShape cannot be computed: height of chamfer is too high");
|
StdFail_NotDone::Raise("TShape cannot be computed: height of chamfer is too high");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,13 +454,13 @@ Standard_Integer GEOMImpl_PipeTShapeDriver::Execute(TFunction_Logbook& log) cons
|
|||||||
|
|
||||||
if (hexMesh) {
|
if (hexMesh) {
|
||||||
// Create a quarter of a basic T-Shape pipe
|
// Create a quarter of a basic T-Shape pipe
|
||||||
std::cerr << "Create a quarter of a basic T-Shape pipe" << std::endl;
|
// std::cerr << "Create a quarter of a basic T-Shape pipe" << std::endl;
|
||||||
Te4 = MakeQuarterPipeTShape(aData.GetR1(), aData.GetW1(), aData.GetL1(),
|
Te4 = MakeQuarterPipeTShape(aData.GetR1(), aData.GetW1(), aData.GetL1(),
|
||||||
aData.GetR2(), aData.GetW2(), aData.GetL2());
|
aData.GetR2(), aData.GetW2(), aData.GetL2());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// No need to cut pipe t-shape
|
// No need to cut pipe t-shape
|
||||||
std::cerr << "Create a basic T-Shape pipe" << std::endl;
|
// std::cerr << "Create a basic T-Shape pipe" << std::endl;
|
||||||
Te4 = MakePipeTShape(aData.GetR1(), aData.GetW1(), aData.GetL1(),
|
Te4 = MakePipeTShape(aData.GetR1(), aData.GetW1(), aData.GetL1(),
|
||||||
aData.GetR2(), aData.GetW2(), aData.GetL2());
|
aData.GetR2(), aData.GetW2(), aData.GetL2());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user