myMainLayout->addWidget(JunctionPointsSel, rowNewPosVal, colNewPosVal, rowspanNewPosVal, colspanNewPosVal);
/***************************************************************/
- setHelpFileName("create__pipetshape__page.html");
+ setHelpFileName("create_pipetshape_page.html");
Init();
}
// SetErrorCode("Junctions points P2 and P3 are identical");
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 newL2 = sqrt(pow(d13,2)-pow(newL1,2));
JunctionPointsSel->LineEdit4->setText(QString::number(newL1,'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 ((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);
MainTubeGroupParams->SpinBox_DZ->setValue(newL1);
connect(MainTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
JunctionPointsSel->PushButton4->setStyleSheet(CssNormal);
}
-// std::cerr << "fabs(newL2 - theL2) = " << fabs(newL2 - theL2) << std::endl;
if (fabs(newL2 - theL2) > Precision::Approximation()) {
if ((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);
IncidentTubeGroupParams->SpinBox_DZ->setValue(newL2);
connect(IncidentTubeGroupParams->SpinBox_DZ, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
ObjectList::iterator it = pipeTShapeGroupObjects.begin();
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);
}
// extremVertices = aShapesOperations->GetShapesOnCylinder(theShape, TopAbs_VERTEX, Vector_Z, theVertCylinderRadius, GEOMAlgo_ST_ONIN);
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)
SetErrorCode("Vertices on chamfer not found");
else
//=============================================================================
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1,
double theL1, double theR2, double theW2, double theL2, bool theHexMesh) {
- std::cerr << "GEOMImpl_IAdvancedOperations::MakePipeTShape" << std::endl;
+ MESSAGE("GEOMImpl_IAdvancedOperations::MakePipeTShape");
SetErrorCode(KO);
//Add a new object
// std::cerr << "Add a new object" << std::endl;
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
-// SetErrorCode("TShape driver failed");
- std::cerr << "TShape driver failed" << std::endl;
+ SetErrorCode("TShape driver failed");
+// MESSAGE("TShape driver failed");
return NULL;
}
// std::cerr << "aShape->GetName(): " << aShape->GetName() << std::endl;
theOperations.push_back(aTransformOperations);
if (theHexMesh) {
- std::cerr << "Creating partition" << std::endl;
+// std::cerr << "Creating partition" << std::endl;
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
return NULL;
- std::cerr << "Done" << std::endl;
- std::cerr << "Creating mirrors and glue" << std::endl;
+// std::cerr << "Done" << std::endl;
+// std::cerr << "Creating mirrors and glue" << std::endl;
if (!MakePipeTShapeMirrorAndGlue(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2))
return NULL;
- std::cerr << "Done" << std::endl;
+// std::cerr << "Done" << std::endl;
}
TopoDS_Shape Te = aShape->GetValue();
box_e->GetLastFunction()->SetDescription("");
if (edges_e.IsNull() || edges_e->Length() == 0) {
-// std::cerr << "Internal edges not found" << std::endl;
SetErrorCode("External edges not found");
return false;
}
-// std::cerr << "External edges found" << std::endl;
int nbEdgesInChamfer = 0;
std::list<int> theEdges;
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);
-// std::cerr << "Edge #" << edgeID << std::endl;
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
int iv=0;
while (Ex.More()) {
iv ++;
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()) {
nbEdgesInChamfer ++;
theEdges.push_back(edgeID);
-// std::cerr << "Edge #" << edgeID << " added" << std::endl;
}
Ex.Next();
}
aFunction->SetValue(aChamferShape);
// END of chamfer
- bool doMesh = false;
+ // bool doMesh = false;
if (theHexMesh) {
- doMesh = true;
- std::cerr << "Creating partition" << std::endl;
+// doMesh = true;
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false)) {
- std::cerr << "PipeTShape partition failed" << std::endl;
- doMesh = false;
-// return NULL;
+ MESSAGE("PipeTShape partition failed");
+// doMesh = false;
+ 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)) {
- std::cerr << "PipeTShape mirrors and glue failed" << std::endl;
- doMesh = false;
-// return NULL;
+ MESSAGE("PipeTShape mirrors and glue failed");
+// doMesh = false;
+ return NULL;
}
- std::cerr << "Done" << std::endl;
}
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
aSeq->Append(aShape);
- if (doMesh) {
+// if (doMesh) {
+ if (theHexMesh) {
//
// Get the groups: BEGIN
//
- if (!MakeGroups(/*theOperations, */aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) {
- //Make a Python command
- GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1
- << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW
- << ", " << theHexMesh << ")";
-// return NULL;
- }
- else {
- 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 + ", ";
- }
-
- aListRes.Trunc(aListRes.Length() - 2);
-
- //Make a Python command
- GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString()
- << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2
- << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ")";
- }
+// if (!MakeGroups(/*theOperations, */aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) {
+// //Make a Python command
+// GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1
+// << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW
+// << ", " << theHexMesh << ")";
+// }
+// else {
+ if (!MakeGroups(/*theOperations, */aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf()))
+ return NULL;
+
+ 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 + ", ";
+ }
+
+ aListRes.Trunc(aListRes.Length() - 2);
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString()
+ << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2
+ << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ")";
+ // }
}
//
// Get the groups: END
box_e->GetLastFunction()->SetDescription("");
if (edges_e.IsNull() || edges_e->Length() == 0) {
-// std::cerr << "Internal edges not found" << std::endl;
SetErrorCode("External edges not found");
return false;
}
-// std::cerr << "External edges found" << std::endl;
int nbEdgesInChamfer = 0;
std::list<int> theEdges;
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);
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
// END of chamfer
if (theHexMesh) {
- std::cerr << "Creating partition" << std::endl;
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false))
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))
return NULL;
- std::cerr << "Done" << std::endl;
}
TopoDS_Shape Te = aShape->GetValue();
box_e->GetLastFunction()->SetDescription("");
if (edges_e.IsNull() || edges_e->Length() == 0) {
-// std::cerr << "Internal edges not found" << std::endl;
SetErrorCode("External edges not found");
return false;
}
-// std::cerr << "External edges found" << std::endl;
int nbEdgesInFillet = 0;
std::list<int> theEdges;
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);
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
// END of fillet
if (theHexMesh) {
- std::cerr << "Creating partition" << std::endl;
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false))
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))
return NULL;
- std::cerr << "Done" << std::endl;
}
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
box_e->GetLastFunction()->SetDescription("");
if (edges_e.IsNull() || edges_e->Length() == 0) {
-// std::cerr << "Internal edges not found" << std::endl;
SetErrorCode("External edges not found");
return false;
}
-// std::cerr << "External edges found" << std::endl;
int nbEdgesInFillet = 0;
std::list<int> theEdges;
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);
TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
// END of fillet
if (theHexMesh) {
- std::cerr << "Creating partition" << std::endl;
if (!MakePipeTShapePartition(/*theOperations, */aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false))
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))
return NULL;
- std::cerr << "Done" << std::endl;
}
TopoDS_Shape Te = aShape->GetValue();
TopTools_ListIteratorOfListOfShape itSub (listSS);
for (int index = 1; itSub.More(); itSub.Next(), ++index) {
int id = anIndices.FindIndex(itSub.Value());
- std::cerr << "Shape with ID " << id << " found" << std::endl;
-// TopoDS_Shape s = anIndices.FindKey(id);
+// std::cerr << "Shape with ID " << id << " found" << std::endl;
aSeqOfIDs->Append(id);
-// aSeqOfIDs->Append(itSub.Value());
}
return aSeqOfIDs;
// # Search in theShape for common shape of type theShapeType on the intersection of 2 pipes
found = false;
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++) {
- 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)) {
myID = aSeqExt1->Value(j);
commonShapes->Append(aMapOfShapes.FindKey(myID));
double aR2Ext = aData.GetR2() + aData.GetW2();
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");
}
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 with fillet cannot be computed if R2+W2 = R1+W1");
// internal radius are different => not possible
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");
}
}
if (aType == TSHAPE_CHAMFER) {
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");
}
if (hexMesh) {
// 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(),
aData.GetR2(), aData.GetW2(), aData.GetL2());
}
else {
// 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(),
aData.GetR2(), aData.GetW2(), aData.GetL2());
}