0020695: EDF 1076 GEOM: Add a new shape in GEOM: T-shape

Some improvement:
- code indentation
- remove unnecessary #includes from header
- replace NULL by 0 (C++ syntax)
- fix some memory leaks
- remove unnecessary #defines (Handle_...) from header
This commit is contained in:
vsr 2010-04-29 15:56:54 +00:00
parent 3ebb105540
commit 05f6ac13c1
2 changed files with 1748 additions and 1665 deletions

View File

@ -20,9 +20,19 @@
// File : GEOMImpl_IAdvancedOperations.cxx // File : GEOMImpl_IAdvancedOperations.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
// //
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
#include "GEOMImpl_Types.hxx" #include "GEOMImpl_Types.hxx"
#include <GEOMImpl_Gen.hxx> #include "GEOMImpl_IAdvancedOperations.hxx"
#include "GEOMImpl_IBasicOperations.hxx"
#include "GEOMImpl_IBooleanOperations.hxx"
#include "GEOMImpl_IShapesOperations.hxx"
#include "GEOMImpl_ITransformOperations.hxx"
#include "GEOMImpl_IBlocksOperations.hxx"
#include "GEOMImpl_I3DPrimOperations.hxx"
#include "GEOMImpl_ILocalOperations.hxx"
#include "GEOMImpl_Gen.hxx"
#include <utilities.h> #include <utilities.h>
#include <OpUtil.hxx> #include <OpUtil.hxx>
@ -31,8 +41,8 @@
#include "GEOM_Function.hxx" #include "GEOM_Function.hxx"
#include "GEOM_PythonDump.hxx" #include "GEOM_PythonDump.hxx"
#include <GEOMImpl_PipeTShapeDriver.hxx> #include "GEOMImpl_PipeTShapeDriver.hxx"
#include <GEOMImpl_IPipeTShape.hxx> #include "GEOMImpl_IPipeTShape.hxx"
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
@ -46,6 +56,7 @@
#include <BRepBuilderAPI_Transform.hxx> #include <BRepBuilderAPI_Transform.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <cmath> #include <cmath>
/*@@ insert new functions before this line @@*/ /*@@ insert new functions before this line @@*/
#include <TFunction_DriverTable.hxx> #include <TFunction_DriverTable.hxx>
@ -54,6 +65,7 @@
#include <TDF_Tool.hxx> #include <TDF_Tool.hxx>
#include <Standard_Failure.hxx> #include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
#define HALF_LENGTH_MAIN_PIPE "Main pipe half length" //"Tuyau principal - demi longueur" #define HALF_LENGTH_MAIN_PIPE "Main pipe half length" //"Tuyau principal - demi longueur"
#define HALF_LENGTH_INCIDENT_PIPE "Incident pipe half length" //"Tuyau incident - demi longueur" #define HALF_LENGTH_INCIDENT_PIPE "Incident pipe half length" //"Tuyau incident - demi longueur"
#define CIRCULAR_QUARTER_PIPE "Circular quarter of pipe" //"Circulaire - quart de tuyau" #define CIRCULAR_QUARTER_PIPE "Circular quarter of pipe" //"Circulaire - quart de tuyau"
@ -63,21 +75,23 @@
#define JUNCTION_FACE_1 "Junction 1" //"Face de jonction 1" #define JUNCTION_FACE_1 "Junction 1" //"Face de jonction 1"
#define JUNCTION_FACE_2 "Junction 2" //"Face de jonction 2" #define JUNCTION_FACE_2 "Junction 2" //"Face de jonction 2"
#define JUNCTION_FACE_3 "Junction 3" //"Face de jonction 3" #define JUNCTION_FACE_3 "Junction 3" //"Face de jonction 3"
//============================================================================= //=============================================================================
/*! /*!
* Constructor * Constructor
*/ */
//============================================================================= //=============================================================================
GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID) : GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID) :
GEOM_IOperations(theEngine, theDocID) { GEOM_IOperations(theEngine, theDocID)
{
MESSAGE("GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations"); MESSAGE("GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations");
aBasicOperations = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID()); myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID());
aBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine(), GetDocID()); myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine(), GetDocID());
aShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID()); myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
aTransformOperations = new GEOMImpl_ITransformOperations(GetEngine(), GetDocID()); myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine(), GetDocID());
aBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine(), GetDocID()); myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine(), GetDocID());
a3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine(), GetDocID()); my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine(), GetDocID());
aLocalOperations = new GEOMImpl_ILocalOperations(GetEngine(), GetDocID()); myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine(), GetDocID());
} }
//============================================================================= //=============================================================================
@ -85,8 +99,16 @@ GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngin
* Destructor * Destructor
*/ */
//============================================================================= //=============================================================================
GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations() { GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations()
{
MESSAGE("GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations"); MESSAGE("GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations");
delete myBasicOperations;
delete myBooleanOperations;
delete myShapesOperations;
delete myTransformOperations;
delete myBlocksOperations;
delete my3DPrimOperations;
delete myLocalOperations;
} }
//============================================================================= //=============================================================================
@ -94,8 +116,11 @@ GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations() {
* SetPosition * SetPosition
*/ */
//============================================================================= //=============================================================================
gp_Trsf GEOMImpl_IAdvancedOperations::GetPositionTrsf(double theL1, double theL2, Handle(GEOM_Object) theP1, gp_Trsf GEOMImpl_IAdvancedOperations::GetPositionTrsf(double theL1, double theL2,
Handle(GEOM_Object) theP2, Handle(GEOM_Object) theP3) { Handle(GEOM_Object) theP1,
Handle(GEOM_Object) theP2,
Handle(GEOM_Object) theP3)
{
// Old Local Coordinates System oldLCS // Old Local Coordinates System oldLCS
gp_Pnt P0(0, 0, 0); gp_Pnt P0(0, 0, 0);
gp_Pnt P1(-theL1, 0, 0); gp_Pnt P1(-theL1, 0, 0);
@ -132,8 +157,12 @@ gp_Trsf GEOMImpl_IAdvancedOperations::GetPositionTrsf(double theL1, double theL2
* *
*/ */
//============================================================================= //=============================================================================
bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double& theL2, Handle(GEOM_Object) theP1, bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double& theL2,
Handle(GEOM_Object) theP2, Handle(GEOM_Object) theP3, double theTolerance) { Handle(GEOM_Object) theP1,
Handle(GEOM_Object) theP2,
Handle(GEOM_Object) theP3,
double theTolerance)
{
SetErrorCode(KO); SetErrorCode(KO);
gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(theP1->GetValue())); gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(theP1->GetValue()));
gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(theP2->GetValue())); gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(theP2->GetValue()));
@ -199,9 +228,12 @@ bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double
* Generate the propagation groups of a Pipe T-Shape used for hexa mesh * Generate the propagation groups of a Pipe T-Shape used for hexa mesh
*/ */
//============================================================================= //=============================================================================
bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int shapeType,
int shapeType, double theR1, double theW1, double theL1, double theR2, double theW2, double theL2, double theR1, double theW1, double theL1,
Handle(TColStd_HSequenceOfTransient) theSeq, gp_Trsf aTrsf) { double theR2, double theW2, double theL2,
Handle(TColStd_HSequenceOfTransient) theSeq,
gp_Trsf aTrsf)
{
SetErrorCode(KO); SetErrorCode(KO);
if (theShape.IsNull()) return false; if (theShape.IsNull()) return false;
@ -235,9 +267,9 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape,
// == BEGIN // == BEGIN
// Workaround of GetInPlace bug // Workaround of GetInPlace bug
// Create a bounding box that fits the shape // Create a bounding box that fits the shape
Handle(GEOM_Object) aBox = a3DPrimOperations->MakeBoxDXDYDZ(2*theL1, 2*aR1Ext, aR1Ext+theL2); Handle(GEOM_Object) aBox = my3DPrimOperations->MakeBoxDXDYDZ(2*theL1, 2*aR1Ext, aR1Ext+theL2);
aBox->GetLastFunction()->SetDescription(""); aBox->GetLastFunction()->SetDescription("");
aTransformOperations->TranslateDXDYDZ(aBox, -theL1, -aR1Ext, -aR1Ext); myTransformOperations->TranslateDXDYDZ(aBox, -theL1, -aR1Ext, -aR1Ext);
aBox->GetLastFunction()->SetDescription(""); aBox->GetLastFunction()->SetDescription("");
// Apply transformation to box // Apply transformation to box
BRepBuilderAPI_Transform aTransformationBox(aBox->GetValue(), aTrsf, Standard_False); BRepBuilderAPI_Transform aTransformationBox(aBox->GetValue(), aTrsf, Standard_False);
@ -245,14 +277,14 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape,
aBox->GetLastFunction()->SetValue(aBoxShapeTrsf); aBox->GetLastFunction()->SetValue(aBoxShapeTrsf);
// Get the shell of the box // Get the shell of the box
Handle(GEOM_Object) aShell = Handle(GEOM_Object)::DownCast(aShapesOperations->MakeExplode(aBox, TopAbs_SHELL, true)->Value(1)); Handle(GEOM_Object) aShell = Handle(GEOM_Object)::DownCast(myShapesOperations->MakeExplode(aBox, TopAbs_SHELL, true)->Value(1));
aBox->GetLastFunction()->SetDescription(""); aBox->GetLastFunction()->SetDescription("");
aShell->GetLastFunction()->SetDescription(""); aShell->GetLastFunction()->SetDescription("");
// Get the common shapes between shell and shape // Get the common shapes between shell and shape
Handle(GEOM_Object) aCommonCompound = aBooleanOperations->MakeBoolean (theShape, aShell, 1); // MakeCommon Handle(GEOM_Object) aCommonCompound = myBooleanOperations->MakeBoolean (theShape, aShell, 1); // MakeCommon
aCommonCompound->GetLastFunction()->SetDescription(""); aCommonCompound->GetLastFunction()->SetDescription("");
// Explode the faces of common shapes => 3 faces // Explode the faces of common shapes => 3 faces
Handle(TColStd_HSequenceOfTransient) aCommonFaces = aShapesOperations->MakeExplode(aCommonCompound, TopAbs_FACE, true); Handle(TColStd_HSequenceOfTransient) aCommonFaces = myShapesOperations->MakeExplode(aCommonCompound, TopAbs_FACE, true);
aCommonCompound->GetLastFunction()->SetDescription(""); aCommonCompound->GetLastFunction()->SetDescription("");
std::list<Handle(GEOM_Object)> aCompoundOfFacesList; std::list<Handle(GEOM_Object)> aCompoundOfFacesList;
@ -265,7 +297,7 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape,
aFacesList.push_back(aFace); aFacesList.push_back(aFace);
} }
} }
Handle(GEOM_Object) aCompoundOfFaces = aShapesOperations->MakeCompound(aFacesList); Handle(GEOM_Object) aCompoundOfFaces = myShapesOperations->MakeCompound(aFacesList);
if (!aCompoundOfFaces.IsNull()) { if (!aCompoundOfFaces.IsNull()) {
aCompoundOfFaces->GetLastFunction()->SetDescription(""); aCompoundOfFaces->GetLastFunction()->SetDescription("");
aCompoundOfFacesList.push_back(aCompoundOfFaces); aCompoundOfFacesList.push_back(aCompoundOfFaces);
@ -285,21 +317,21 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape,
// Uncomment the following lines when GetInPlace bug is solved // Uncomment the following lines when GetInPlace bug is solved
// == BEGIN // == BEGIN
// Handle(GEOM_Object) aP1 = aBasicOperations->MakePointXYZ(-theL1, 0, 0); // Handle(GEOM_Object) aP1 = myBasicOperations->MakePointXYZ(-theL1, 0, 0);
// Handle(GEOM_Object) aP2 = aBasicOperations->MakePointXYZ(-0, 0, theL2); // Handle(GEOM_Object) aP2 = myBasicOperations->MakePointXYZ(-0, 0, theL2);
// Handle(GEOM_Object) aP3 = aBasicOperations->MakePointXYZ(theL1, 0, 0); // Handle(GEOM_Object) aP3 = myBasicOperations->MakePointXYZ(theL1, 0, 0);
// aP1->GetLastFunction()->SetDescription(""); // aP1->GetLastFunction()->SetDescription("");
// aP2->GetLastFunction()->SetDescription(""); // aP2->GetLastFunction()->SetDescription("");
// aP3->GetLastFunction()->SetDescription(""); // aP3->GetLastFunction()->SetDescription("");
// Handle(GEOM_Object) aV1 = aBasicOperations->MakeVectorDXDYDZ(-1, 0, 0); // Handle(GEOM_Object) aV1 = myBasicOperations->MakeVectorDXDYDZ(-1, 0, 0);
// Handle(GEOM_Object) aV2 = aBasicOperations->MakeVectorDXDYDZ(0, 0, 1); // Handle(GEOM_Object) aV2 = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
// Handle(GEOM_Object) aV3 = aBasicOperations->MakeVectorDXDYDZ(1, 0, 0); // Handle(GEOM_Object) aV3 = myBasicOperations->MakeVectorDXDYDZ(1, 0, 0);
// aV1->GetLastFunction()->SetDescription(""); // aV1->GetLastFunction()->SetDescription("");
// aV2->GetLastFunction()->SetDescription(""); // aV2->GetLastFunction()->SetDescription("");
// aV3->GetLastFunction()->SetDescription(""); // aV3->GetLastFunction()->SetDescription("");
// Handle(GEOM_Object) aPln1 = aBasicOperations->MakePlanePntVec(aP1, aV1, 2*(theR1+theW1+theL2)); // Handle(GEOM_Object) aPln1 = myBasicOperations->MakePlanePntVec(aP1, aV1, 2*(theR1+theW1+theL2));
// Handle(GEOM_Object) aPln2 = aBasicOperations->MakePlanePntVec(aP2, aV2, 2*(theR2+theW2)); // Handle(GEOM_Object) aPln2 = myBasicOperations->MakePlanePntVec(aP2, aV2, 2*(theR2+theW2));
// Handle(GEOM_Object) aPln3 = aBasicOperations->MakePlanePntVec(aP3, aV3, 2*(theR1+theW1+theL2)); // Handle(GEOM_Object) aPln3 = myBasicOperations->MakePlanePntVec(aP3, aV3, 2*(theR1+theW1+theL2));
// aPln1->GetLastFunction()->SetDescription(""); // aPln1->GetLastFunction()->SetDescription("");
// aPln2->GetLastFunction()->SetDescription(""); // aPln2->GetLastFunction()->SetDescription("");
// aPln3->GetLastFunction()->SetDescription(""); // aPln3->GetLastFunction()->SetDescription("");
@ -316,9 +348,9 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape,
// == END // == END
// //
Handle(GEOM_Object) junctionFaces1 = aShapesOperations->GetInPlace(theShape, aPln1); Handle(GEOM_Object) junctionFaces1 = myShapesOperations->GetInPlace(theShape, aPln1);
if (junctionFaces1.IsNull()) if (junctionFaces1.IsNull())
junctionFaces1 = aShapesOperations->GetShapesOnShapeAsCompound(aPln1, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); junctionFaces1 = myShapesOperations->GetShapesOnShapeAsCompound(aPln1, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN);
if (!junctionFaces1.IsNull()) { if (!junctionFaces1.IsNull()) {
junctionFaces1->GetLastFunction()->SetDescription(""); junctionFaces1->GetLastFunction()->SetDescription("");
junctionFaces1->SetName("JUNCTION_FACE_1"); junctionFaces1->SetName("JUNCTION_FACE_1");
@ -329,9 +361,9 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape,
// theSeq->Append(aPln1); // theSeq->Append(aPln1);
// return false; // return false;
} }
Handle(GEOM_Object) junctionFaces2 = aShapesOperations->GetInPlace(theShape, aPln2); Handle(GEOM_Object) junctionFaces2 = myShapesOperations->GetInPlace(theShape, aPln2);
if (junctionFaces2.IsNull()) if (junctionFaces2.IsNull())
junctionFaces2 = aShapesOperations->GetShapesOnShapeAsCompound(aPln2, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); junctionFaces2 = myShapesOperations->GetShapesOnShapeAsCompound(aPln2, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN);
if (!junctionFaces2.IsNull()) { if (!junctionFaces2.IsNull()) {
junctionFaces2->GetLastFunction()->SetDescription(""); junctionFaces2->GetLastFunction()->SetDescription("");
junctionFaces2->SetName("JUNCTION_FACE_2"); junctionFaces2->SetName("JUNCTION_FACE_2");
@ -342,9 +374,9 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape,
// theSeq->Append(aPln2); // theSeq->Append(aPln2);
// return false; // return false;
} }
Handle(GEOM_Object) junctionFaces3 = aShapesOperations->GetInPlace(theShape, aPln3); Handle(GEOM_Object) junctionFaces3 = myShapesOperations->GetInPlace(theShape, aPln3);
if (junctionFaces3.IsNull()) if (junctionFaces3.IsNull())
junctionFaces3 = aShapesOperations->GetShapesOnShapeAsCompound(aPln3, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); junctionFaces3 = myShapesOperations->GetShapesOnShapeAsCompound(aPln3, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN);
if (!junctionFaces3.IsNull()) { if (!junctionFaces3.IsNull()) {
junctionFaces3->GetLastFunction()->SetDescription(""); junctionFaces3->GetLastFunction()->SetDescription("");
junctionFaces3->SetName("JUNCTION_FACE_3"); junctionFaces3->SetName("JUNCTION_FACE_3");
@ -364,7 +396,7 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape,
Handle(GEOM_Function) aFunction = theShape->GetLastFunction(); Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
TCollection_AsciiString theDesc = aFunction->GetDescription(); TCollection_AsciiString theDesc = aFunction->GetDescription();
Handle(TColStd_HSequenceOfTransient) aSeqPropagate = aBlocksOperations->Propagate(theShape); Handle(TColStd_HSequenceOfTransient) aSeqPropagate = myBlocksOperations->Propagate(theShape);
if (aSeqPropagate.IsNull() || aSeqPropagate->Length() == 0) { if (aSeqPropagate.IsNull() || aSeqPropagate->Length() == 0) {
SetErrorCode("Propagation groups not found"); SetErrorCode("Propagation groups not found");
return false; return false;
@ -548,10 +580,12 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape,
return true; return true;
} }
bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) theShape, bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) theShape,
double theR1, double theW1, double theL1, double theR2, double theW2, double theL2, double theH, double theW, double theRF, bool isNormal) { double theR1, double theW1, double theL1,
double theR2, double theW2, double theL2,
double theH, double theW,
double theRF, bool isNormal)
{
SetErrorCode(KO); SetErrorCode(KO);
// Build tools for partition operation: // Build tools for partition operation:
@ -562,7 +596,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
Handle(GEOM_Object) chan_racc; Handle(GEOM_Object) chan_racc;
Handle(GEOM_Object) vi1, vi2; Handle(GEOM_Object) vi1, vi2;
Handle(GEOM_Object) Vector_Z = aBasicOperations->MakeVectorDXDYDZ(0, 0, 1); Handle(GEOM_Object) Vector_Z = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
Vector_Z->GetLastFunction()->SetDescription(""); Vector_Z->GetLastFunction()->SetDescription("");
// Useful values // Useful values
@ -573,14 +607,14 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
double theHoriCylinderRadius = aR1Ext + theH + theRF; double theHoriCylinderRadius = aR1Ext + theH + theRF;
// Common edges on internal cylinder // Common edges on internal cylinder
Handle(GEOM_Object) box_i = a3DPrimOperations->MakeBoxDXDYDZ(theR2, theR2, theR1); Handle(GEOM_Object) box_i = my3DPrimOperations->MakeBoxDXDYDZ(theR2, theR2, theR1);
box_i->GetLastFunction()->SetDescription(""); box_i->GetLastFunction()->SetDescription("");
box_i = aTransformOperations->TranslateDXDYDZ(box_i, -theR2, -theR2, 0); box_i = myTransformOperations->TranslateDXDYDZ(box_i, -theR2, -theR2, 0);
box_i->GetLastFunction()->SetDescription(""); box_i->GetLastFunction()->SetDescription("");
Handle(GEOM_Function) aFunction = theShape->GetLastFunction(); Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
TCollection_AsciiString theDesc = aFunction->GetDescription(); TCollection_AsciiString theDesc = aFunction->GetDescription();
Handle(TColStd_HSequenceOfTransient) edges_i = aShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN); Handle(TColStd_HSequenceOfTransient) edges_i = myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
// Recover previous description to get rid of Propagate dump // Recover previous description to get rid of Propagate dump
aFunction->SetDescription(theDesc); aFunction->SetDescription(theDesc);
if (edges_i.IsNull() || edges_i->Length() == 0) { if (edges_i.IsNull() || edges_i->Length() == 0) {
@ -596,7 +630,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
// search for vertices located on both internal pipes // search for vertices located on both internal pipes
aFunction = theShape->GetLastFunction(); aFunction = theShape->GetLastFunction();
theDesc = aFunction->GetDescription(); theDesc = aFunction->GetDescription();
Handle(TColStd_HSequenceOfTransient) vertices_i = aShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); Handle(TColStd_HSequenceOfTransient) vertices_i = myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN);
// Recover previous description to get rid of Propagate dump // Recover previous description to get rid of Propagate dump
aFunction->SetDescription(theDesc); aFunction->SetDescription(theDesc);
if (vertices_i.IsNull() || vertices_i->Length() == 0) { if (vertices_i.IsNull() || vertices_i->Length() == 0) {
@ -623,14 +657,14 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
if (isNormal) { if (isNormal) {
Handle(GEOM_Object) ve1, ve2; Handle(GEOM_Object) ve1, ve2;
Handle(GEOM_Object) box_e = a3DPrimOperations->MakeBoxDXDYDZ(aR2Ext, aR2Ext, aR1Ext); Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ(aR2Ext, aR2Ext, aR1Ext);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
box_e = aTransformOperations->TranslateDXDYDZ(box_e, -aR2Ext, -aR2Ext, 0); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -aR2Ext, -aR2Ext, 0);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
// Common edges on external cylinder // Common edges on external cylinder
aFunction = theShape->GetLastFunction(); aFunction = theShape->GetLastFunction();
theDesc = aFunction->GetDescription(); theDesc = aFunction->GetDescription();
Handle(TColStd_HSequenceOfTransient) edges_e = aShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN); Handle(TColStd_HSequenceOfTransient) edges_e = myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
// Recover previous description to get rid of Propagate dump // Recover previous description to get rid of Propagate dump
aFunction->SetDescription(theDesc); aFunction->SetDescription(theDesc);
if (edges_e.IsNull() || edges_e->Length() == 0) { if (edges_e.IsNull() || edges_e->Length() == 0) {
@ -645,7 +679,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
// search for vertices located on both external pipes // search for vertices located on both external pipes
aFunction = theShape->GetLastFunction(); aFunction = theShape->GetLastFunction();
theDesc = aFunction->GetDescription(); theDesc = aFunction->GetDescription();
Handle(TColStd_HSequenceOfTransient) vertices_e = aShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); Handle(TColStd_HSequenceOfTransient) vertices_e = myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN);
// Recover previous description to get rid of Propagate dump // Recover previous description to get rid of Propagate dump
aFunction->SetDescription(theDesc); aFunction->SetDescription(theDesc);
if (vertices_e.IsNull() || vertices_e->Length() == 0) { if (vertices_e.IsNull() || vertices_e->Length() == 0) {
@ -671,7 +705,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#endif #endif
edge_e1 = aBasicOperations->MakeLineTwoPnt(ve1, vi1); edge_e1 = myBasicOperations->MakeLineTwoPnt(ve1, vi1);
if (edge_e1.IsNull()) { if (edge_e1.IsNull()) {
SetErrorCode("Edge 1 could not be built"); SetErrorCode("Edge 1 could not be built");
return false; return false;
@ -686,7 +720,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#endif #endif
edge_e2 = aBasicOperations->MakeLineTwoPnt(ve2, vi2); edge_e2 = myBasicOperations->MakeLineTwoPnt(ve2, vi2);
if (edge_e2.IsNull()) { if (edge_e2.IsNull()) {
SetErrorCode("Edge 2 could not be built"); SetErrorCode("Edge 2 could not be built");
return false; return false;
@ -705,13 +739,13 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
edge_e_elist.push_back(edge_e1); edge_e_elist.push_back(edge_e1);
edge_e_elist.push_back(Handle(GEOM_Object)::DownCast(edges_e->Value(1))); edge_e_elist.push_back(Handle(GEOM_Object)::DownCast(edges_e->Value(1)));
edge_e_elist.push_back(edge_e2); edge_e_elist.push_back(edge_e2);
wire_t = aShapesOperations->MakeWire(edge_e_elist, 1e-7); wire_t = myShapesOperations->MakeWire(edge_e_elist, 1e-7);
if (wire_t.IsNull()) { if (wire_t.IsNull()) {
SetErrorCode("Impossible to build wire"); SetErrorCode("Impossible to build wire");
return false; return false;
} }
wire_t->GetLastFunction()->SetDescription(""); wire_t->GetLastFunction()->SetDescription("");
face_t = aShapesOperations->MakeFace(wire_t, false); face_t = myShapesOperations->MakeFace(wire_t, false);
if (face_t.IsNull()) { if (face_t.IsNull()) {
SetErrorCode("Impossible to build face"); SetErrorCode("Impossible to build face");
return false; return false;
@ -725,14 +759,14 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
double ZX=0, ZY=0; double ZX=0, ZY=0;
std::vector<int> LX; std::vector<int> LX;
std::vector<int> LY; std::vector<int> LY;
Handle(GEOM_Object) box_e = a3DPrimOperations->MakeBoxDXDYDZ(theVertCylinderRadius, theVertCylinderRadius, theHoriCylinderRadius); Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ(theVertCylinderRadius, theVertCylinderRadius, theHoriCylinderRadius);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
box_e = aTransformOperations->TranslateDXDYDZ(box_e, -theVertCylinderRadius, -theVertCylinderRadius, 0); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -theVertCylinderRadius, -theVertCylinderRadius, 0);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
aFunction = theShape->GetLastFunction(); aFunction = theShape->GetLastFunction();
theDesc = aFunction->GetDescription(); theDesc = aFunction->GetDescription();
Handle(TColStd_HSequenceOfTransient) extremVertices = aShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); Handle(TColStd_HSequenceOfTransient) extremVertices = myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN);
// Recover previous description to get rid of Propagate dump // Recover previous description to get rid of Propagate dump
aFunction->SetDescription(theDesc); aFunction->SetDescription(theDesc);
@ -750,7 +784,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
// for (int i=1; i<=extremVertices->Length(); i++){ // for (int i=1; i<=extremVertices->Length(); i++){
// theShapes.push_back(Handle(GEOM_Object)::DownCast(extremVertices->Value(i))); // theShapes.push_back(Handle(GEOM_Object)::DownCast(extremVertices->Value(i)));
// } // }
// Handle(GEOM_Object) aCompound = aShapesOperations->MakeCompound(theShapes); // Handle(GEOM_Object) aCompound = myShapesOperations->MakeCompound(theShapes);
// TopoDS_Shape aCompoundShape = aCompound->GetValue(); // TopoDS_Shape aCompoundShape = aCompound->GetValue();
// theShape->GetLastFunction()->SetValue(aCompoundShape); // theShape->GetLastFunction()->SetValue(aCompoundShape);
SetErrorCode("Bad number of vertices on chamfer found"); SetErrorCode("Bad number of vertices on chamfer found");
@ -796,14 +830,14 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
P3 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP3)); P3 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP3));
P4 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP4)); P4 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP4));
Handle(GEOM_Object) Cote_1 = aBasicOperations->MakeLineTwoPnt(P1, vi1); Handle(GEOM_Object) Cote_1 = myBasicOperations->MakeLineTwoPnt(P1, vi1);
if (Cote_1.IsNull()) { if (Cote_1.IsNull()) {
SetErrorCode("Impossible to build edge in thickness"); SetErrorCode("Impossible to build edge in thickness");
return false; return false;
} }
Cote_1->GetLastFunction()->SetDescription(""); Cote_1->GetLastFunction()->SetDescription("");
Handle(GEOM_Object) Cote_2 = aBasicOperations->MakeLineTwoPnt(vi2, P3); Handle(GEOM_Object) Cote_2 = myBasicOperations->MakeLineTwoPnt(vi2, P3);
if (Cote_2.IsNull()) { if (Cote_2.IsNull()) {
SetErrorCode("Impossible to build edge in thickness"); SetErrorCode("Impossible to build edge in thickness");
return false; return false;
@ -813,14 +847,14 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
// edge_chan_princ = arete du chanfrein (ou raccord) sur le tuyau principal // edge_chan_princ = arete du chanfrein (ou raccord) sur le tuyau principal
// edge_chan_inc = arete du chanfrein (ou raccord) sur le tuyau incident // edge_chan_inc = arete du chanfrein (ou raccord) sur le tuyau incident
// std::cerr << "Getting chamfer edge on main pipe" << std::endl; // std::cerr << "Getting chamfer edge on main pipe" << std::endl;
Handle(GEOM_Object) edge_chan_princ = aBlocksOperations->GetEdge(theShape, P1, P3); Handle(GEOM_Object) edge_chan_princ = myBlocksOperations->GetEdge(theShape, P1, P3);
if (edge_chan_princ.IsNull()) { if (edge_chan_princ.IsNull()) {
SetErrorCode("Impossible to find edge on main pipe"); SetErrorCode("Impossible to find edge on main pipe");
return false; return false;
} }
edge_chan_princ->GetLastFunction()->SetDescription(""); edge_chan_princ->GetLastFunction()->SetDescription("");
Handle(GEOM_Object) edge_chan_inc = aBlocksOperations->GetEdge(theShape, P2, P4); Handle(GEOM_Object) edge_chan_inc = myBlocksOperations->GetEdge(theShape, P2, P4);
if (edge_chan_inc.IsNull()) { if (edge_chan_inc.IsNull()) {
SetErrorCode("Impossible to find edge on incident pipe"); SetErrorCode("Impossible to find edge on incident pipe");
return false; return false;
@ -834,7 +868,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
edgeList1.push_back(Cote_2); edgeList1.push_back(Cote_2);
// std::cerr << "Creating wire 1" << std::endl; // std::cerr << "Creating wire 1" << std::endl;
wire_t = aShapesOperations->MakeWire(edgeList1, 1e-7); wire_t = myShapesOperations->MakeWire(edgeList1, 1e-7);
if (wire_t.IsNull()) { if (wire_t.IsNull()) {
SetErrorCode("Impossible to build wire"); SetErrorCode("Impossible to build wire");
return false; return false;
@ -842,7 +876,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
wire_t->GetLastFunction()->SetDescription(""); wire_t->GetLastFunction()->SetDescription("");
// std::cerr << "Creating face 1" << std::endl; // std::cerr << "Creating face 1" << std::endl;
face_t = aShapesOperations->MakeFace(wire_t, false); face_t = myShapesOperations->MakeFace(wire_t, false);
if (face_t.IsNull()) { if (face_t.IsNull()) {
SetErrorCode("Impossible to build face"); SetErrorCode("Impossible to build face");
return false; return false;
@ -854,7 +888,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
gp_Pnt aP5 = BRep_Tool::Pnt(TopoDS::Vertex(vi1->GetValue())); gp_Pnt aP5 = BRep_Tool::Pnt(TopoDS::Vertex(vi1->GetValue()));
double deltaZ = aP2.Z() - aP5.Z(); double deltaZ = aP2.Z() - aP5.Z();
// std::cerr << "Creating new point from vi1 with deltaZ = " << deltaZ << std::endl; // std::cerr << "Creating new point from vi1 with deltaZ = " << deltaZ << std::endl;
Handle(GEOM_Object) P5bis = aTransformOperations->TranslateDXDYDZCopy(vi1, 0, 0, deltaZ); Handle(GEOM_Object) P5bis = myTransformOperations->TranslateDXDYDZCopy(vi1, 0, 0, deltaZ);
if (P5bis.IsNull()) { if (P5bis.IsNull()) {
SetErrorCode("Impossible to translate vertex"); SetErrorCode("Impossible to translate vertex");
return false; return false;
@ -865,7 +899,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
gp_Pnt aP6 = BRep_Tool::Pnt(TopoDS::Vertex(vi2->GetValue())); gp_Pnt aP6 = BRep_Tool::Pnt(TopoDS::Vertex(vi2->GetValue()));
deltaZ = aP4.Z() - aP6.Z(); deltaZ = aP4.Z() - aP6.Z();
// std::cerr << "Creating new point from vi2 with deltaZ = " << deltaZ << std::endl; // std::cerr << "Creating new point from vi2 with deltaZ = " << deltaZ << std::endl;
Handle(GEOM_Object) P6bis = aTransformOperations->TranslateDXDYDZCopy(vi2, 0, 0, deltaZ); Handle(GEOM_Object) P6bis = myTransformOperations->TranslateDXDYDZCopy(vi2, 0, 0, deltaZ);
if (P6bis.IsNull()) { if (P6bis.IsNull()) {
SetErrorCode("Impossible to translate vertex"); SetErrorCode("Impossible to translate vertex");
return false; return false;
@ -873,7 +907,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
P6bis->GetLastFunction()->SetDescription(""); P6bis->GetLastFunction()->SetDescription("");
// std::cerr << "Creating new line 1 from 2 previous points" << std::endl; // std::cerr << "Creating new line 1 from 2 previous points" << std::endl;
Handle(GEOM_Object) Cote_3 = aBasicOperations->MakeLineTwoPnt(P5bis, P2); Handle(GEOM_Object) Cote_3 = myBasicOperations->MakeLineTwoPnt(P5bis, P2);
if (Cote_3.IsNull()) { if (Cote_3.IsNull()) {
SetErrorCode("Impossible to build edge in thickness"); SetErrorCode("Impossible to build edge in thickness");
return false; return false;
@ -881,7 +915,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
Cote_3->GetLastFunction()->SetDescription(""); Cote_3->GetLastFunction()->SetDescription("");
// std::cerr << "Creating new line 2 from 2 previous points" << std::endl; // std::cerr << "Creating new line 2 from 2 previous points" << std::endl;
Handle(GEOM_Object) Cote_4 = aBasicOperations->MakeLineTwoPnt(P6bis, P4); Handle(GEOM_Object) Cote_4 = myBasicOperations->MakeLineTwoPnt(P6bis, P4);
if (Cote_4.IsNull()) { if (Cote_4.IsNull()) {
SetErrorCode("Impossible to build edge in thickness"); SetErrorCode("Impossible to build edge in thickness");
return false; return false;
@ -889,7 +923,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
Cote_4->GetLastFunction()->SetDescription(""); Cote_4->GetLastFunction()->SetDescription("");
// std::cerr << "Creating new line 3 from 2 previous points" << std::endl; // std::cerr << "Creating new line 3 from 2 previous points" << std::endl;
Handle(GEOM_Object) Cote_5 = aBasicOperations->MakeLineTwoPnt(P5bis, P6bis); Handle(GEOM_Object) Cote_5 = myBasicOperations->MakeLineTwoPnt(P5bis, P6bis);
if (Cote_4.IsNull()) { if (Cote_4.IsNull()) {
SetErrorCode("Impossible to build edge in thickness"); SetErrorCode("Impossible to build edge in thickness");
return false; return false;
@ -902,14 +936,14 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
edgeList2.push_back(Cote_5); edgeList2.push_back(Cote_5);
edgeList2.push_back(Cote_4); edgeList2.push_back(Cote_4);
// std::cerr << "Creating wire 2" << std::endl; // std::cerr << "Creating wire 2" << std::endl;
wire_t2 = aShapesOperations->MakeWire(edgeList2, 1e-7); wire_t2 = myShapesOperations->MakeWire(edgeList2, 1e-7);
if (wire_t2.IsNull()) { if (wire_t2.IsNull()) {
SetErrorCode("Impossible to build wire"); SetErrorCode("Impossible to build wire");
return false; return false;
} }
wire_t2->GetLastFunction()->SetDescription(""); wire_t2->GetLastFunction()->SetDescription("");
// std::cerr << "Creating face 2" << std::endl; // std::cerr << "Creating face 2" << std::endl;
face_t2 = aShapesOperations->MakeFace(wire_t2, false); face_t2 = myShapesOperations->MakeFace(wire_t2, false);
if (face_t2.IsNull()) { if (face_t2.IsNull()) {
SetErrorCode("Impossible to build face"); SetErrorCode("Impossible to build face");
return false; return false;
@ -919,11 +953,11 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
} }
// Planes // Planes
Handle(GEOM_Object) aP0 = aBasicOperations->MakePointXYZ(0, 0, 0); Handle(GEOM_Object) aP0 = myBasicOperations->MakePointXYZ(0, 0, 0);
Handle(GEOM_Object) aVZ = aBasicOperations->MakeVectorDXDYDZ(0, 0, 1); Handle(GEOM_Object) aVZ = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
Handle(GEOM_Object) aVXZ = aBasicOperations->MakeVectorDXDYDZ(aR1Ext, 0, 0.5*(theL1+theVertCylinderRadius)); Handle(GEOM_Object) aVXZ = myBasicOperations->MakeVectorDXDYDZ(aR1Ext, 0, 0.5*(theL1+theVertCylinderRadius));
Handle(GEOM_Object) aPlnOZ = aBasicOperations->MakePlanePntVec(aP0, aVZ, aSize); Handle(GEOM_Object) aPlnOZ = myBasicOperations->MakePlanePntVec(aP0, aVZ, aSize);
Handle(GEOM_Object) aPlnOXZ = aBasicOperations->MakePlanePntVec(aP0, aVXZ, aSize); Handle(GEOM_Object) aPlnOXZ = myBasicOperations->MakePlanePntVec(aP0, aVXZ, aSize);
aP0->GetLastFunction()->SetDescription(""); aP0->GetLastFunction()->SetDescription("");
aVZ->GetLastFunction()->SetDescription(""); aVZ->GetLastFunction()->SetDescription("");
aVXZ->GetLastFunction()->SetDescription(""); aVXZ->GetLastFunction()->SetDescription("");
@ -946,10 +980,10 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
if (!isNormal) if (!isNormal)
theTools->Append(face_t2); theTools->Append(face_t2);
Handle(GEOM_Object) Te3 = aBooleanOperations->MakePartition(partitionShapes, theTools, theKeepInside, theRemoveInside, TopAbs_SOLID, false, theMaterials, 0, false); Handle(GEOM_Object) Te3 = myBooleanOperations->MakePartition(partitionShapes, theTools, theKeepInside, theRemoveInside, TopAbs_SOLID, false, theMaterials, 0, false);
if (Te3.IsNull()) { if (Te3.IsNull()) {
SetErrorCode("Impossible to build partition of TShape"); SetErrorCode("Impossible to build partition of TShape");
// Handle(GEOM_Object) aCompound = aShapesOperations->MakeCompound(theShapes); // Handle(GEOM_Object) aCompound = myShapesOperations->MakeCompound(theShapes);
// TopoDS_Shape aCompoundShape = aCompound->GetValue(); // TopoDS_Shape aCompoundShape = aCompound->GetValue();
// theShape->GetLastFunction()->SetValue(aCompoundShape); // theShape->GetLastFunction()->SetValue(aCompoundShape);
return false; return false;
@ -966,7 +1000,9 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
// Mirror and glue faces // Mirror and glue faces
bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape, bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape,
double theR1, double theW1, double theL1, double theR2, double theW2, double theL2) { double theR1, double theW1, double theL1,
double theR2, double theW2, double theL2)
{
SetErrorCode(KO); SetErrorCode(KO);
// Useful values // Useful values
@ -974,30 +1010,30 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Objec
double aR1Ext = theR1 + theW1; double aR1Ext = theR1 + theW1;
// Planes // Planes
Handle(GEOM_Object) aP0 = aBasicOperations->MakePointXYZ(0, 0, 0); Handle(GEOM_Object) aP0 = myBasicOperations->MakePointXYZ(0, 0, 0);
aP0->GetLastFunction()->SetDescription(""); aP0->GetLastFunction()->SetDescription("");
Handle(GEOM_Object) aVX = aBasicOperations->MakeVectorDXDYDZ(1, 0, 0); Handle(GEOM_Object) aVX = myBasicOperations->MakeVectorDXDYDZ(1, 0, 0);
Handle(GEOM_Object) aVY = aBasicOperations->MakeVectorDXDYDZ(0, 1, 0); Handle(GEOM_Object) aVY = myBasicOperations->MakeVectorDXDYDZ(0, 1, 0);
aVX->GetLastFunction()->SetDescription(""); aVX->GetLastFunction()->SetDescription("");
aVY->GetLastFunction()->SetDescription(""); aVY->GetLastFunction()->SetDescription("");
Handle(GEOM_Object) aPlane_OX = aBasicOperations->MakePlanePntVec(aP0, aVX, 2*(aR1Ext + theL2)); Handle(GEOM_Object) aPlane_OX = myBasicOperations->MakePlanePntVec(aP0, aVX, 2*(aR1Ext + theL2));
Handle(GEOM_Object) aPlane_OY = aBasicOperations->MakePlanePntVec(aP0, aVY, aSize); Handle(GEOM_Object) aPlane_OY = myBasicOperations->MakePlanePntVec(aP0, aVY, aSize);
aPlane_OX->GetLastFunction()->SetDescription(""); aPlane_OX->GetLastFunction()->SetDescription("");
aPlane_OY->GetLastFunction()->SetDescription(""); aPlane_OY->GetLastFunction()->SetDescription("");
Handle(GEOM_Object) Te4 = aTransformOperations->MirrorPlaneCopy(theShape, aPlane_OX); Handle(GEOM_Object) Te4 = myTransformOperations->MirrorPlaneCopy(theShape, aPlane_OX);
if (Te4.IsNull()) { if (Te4.IsNull()) {
SetErrorCode("Impossible to build mirror of quarter TShape"); SetErrorCode("Impossible to build mirror of quarter TShape");
return false; return false;
} }
Handle(GEOM_Object) Te5 = aTransformOperations->MirrorPlaneCopy(theShape, aPlane_OY); Handle(GEOM_Object) Te5 = myTransformOperations->MirrorPlaneCopy(theShape, aPlane_OY);
if (Te5.IsNull()) { if (Te5.IsNull()) {
SetErrorCode("Impossible to build mirror of half TShape"); SetErrorCode("Impossible to build mirror of half TShape");
return false; return false;
} }
Handle(GEOM_Object) Te6 = aTransformOperations->MirrorPlaneCopy(Te4, aPlane_OY); Handle(GEOM_Object) Te6 = myTransformOperations->MirrorPlaneCopy(Te4, aPlane_OY);
if (Te6.IsNull()) { if (Te6.IsNull()) {
SetErrorCode("Impossible to build mirror of half TShape"); SetErrorCode("Impossible to build mirror of half TShape");
return false; return false;
@ -1008,13 +1044,13 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Objec
aShapesList.push_back(Te4); aShapesList.push_back(Te4);
aShapesList.push_back(Te5); aShapesList.push_back(Te5);
aShapesList.push_back(Te6); aShapesList.push_back(Te6);
Handle(GEOM_Object) Te7 = aShapesOperations->MakeCompound(aShapesList); Handle(GEOM_Object) Te7 = myShapesOperations->MakeCompound(aShapesList);
if (Te7.IsNull()) { if (Te7.IsNull()) {
SetErrorCode("Impossible to build compound"); SetErrorCode("Impossible to build compound");
return false; return false;
} }
Handle(GEOM_Object) Te8 = aShapesOperations->MakeGlueFaces(Te7, 1e-7, true); Handle(GEOM_Object) Te8 = myShapesOperations->MakeGlueFaces(Te7, 1e-7, true);
if (Te8.IsNull()) { if (Te8.IsNull()) {
SetErrorCode("Impossible to glue faces of TShape"); SetErrorCode("Impossible to glue faces of TShape");
return false; return false;
@ -1050,8 +1086,11 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Objec
* \return List of GEOM_Objects, containing the created shape and propagation groups. * \return List of GEOM_Objects, containing the created shape and propagation groups.
*/ */
//============================================================================= //=============================================================================
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, Handle(TColStd_HSequenceOfTransient)
double theL1, double theR2, double theW2, double theL2, bool theHexMesh) { GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double theL1,
double theR2, double theW2, double theL2,
bool theHexMesh)
{
MESSAGE("GEOMImpl_IAdvancedOperations::MakePipeTShape"); MESSAGE("GEOMImpl_IAdvancedOperations::MakePipeTShape");
SetErrorCode(KO); SetErrorCode(KO);
//Add a new object //Add a new object
@ -1161,9 +1200,14 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
* \return List of GEOM_Objects, containing the created shape and propagation groups.. * \return List of GEOM_Objects, containing the created shape and propagation groups..
*/ */
//============================================================================= //=============================================================================
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, Handle(TColStd_HSequenceOfTransient)
double theW1, double theL1, double theR2, double theW2, double theL2, bool theHexMesh, GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double theW1, double theL1,
Handle(GEOM_Object) theP1, Handle(GEOM_Object) theP2, Handle(GEOM_Object) theP3) { double theR2, double theW2, double theL2,
bool theHexMesh,
Handle(GEOM_Object) theP1,
Handle(GEOM_Object) theP2,
Handle(GEOM_Object) theP3)
{
SetErrorCode(KO); SetErrorCode(KO);
//Add a new object //Add a new object
Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
@ -1288,8 +1332,12 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
* \return List of GEOM_Objects, containing the created shape and propagation groups. * \return List of GEOM_Objects, containing the created shape and propagation groups.
*/ */
//============================================================================= //=============================================================================
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, Handle(TColStd_HSequenceOfTransient)
double theL1, double theR2, double theW2, double theL2, double theH, double theW, bool theHexMesh) { GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, double theL1,
double theR2, double theW2, double theL2,
double theH, double theW,
bool theHexMesh)
{
SetErrorCode(KO); SetErrorCode(KO);
//Add a new object //Add a new object
Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
@ -1334,16 +1382,16 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
// Common edges on external cylinders // Common edges on external cylinders
Handle(GEOM_Object) box_e; Handle(GEOM_Object) box_e;
if (theHexMesh) { if (theHexMesh) {
box_e = a3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1); box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
} }
else { else {
box_e = a3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1); box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
} }
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
box_e = aTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
Handle(TColStd_HSequenceOfInteger) edges_e = aShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
if (edges_e.IsNull() || edges_e->Length() == 0) { if (edges_e.IsNull() || edges_e->Length() == 0) {
@ -1371,7 +1419,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
} }
Handle(GEOM_Object) aChamfer; Handle(GEOM_Object) aChamfer;
try { try {
aChamfer = aLocalOperations->MakeChamferEdges(aShape, theW, theH, theEdges); aChamfer = myLocalOperations->MakeChamferEdges(aShape, theW, theH, theEdges);
} }
catch (Standard_Failure) { catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
@ -1481,9 +1529,15 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
* \return List of GEOM_Objects, containing the created shape and propagation groups. * \return List of GEOM_Objects, containing the created shape and propagation groups.
*/ */
//============================================================================= //=============================================================================
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, Handle(TColStd_HSequenceOfTransient)
double theW1, double theL1, double theR2, double theW2, double theL2, double theH, double theW, GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, double theW1, double theL1,
bool theHexMesh, Handle(GEOM_Object) theP1, Handle(GEOM_Object) theP2, Handle(GEOM_Object) theP3) { double theR2, double theW2, double theL2,
double theH, double theW,
bool theHexMesh,
Handle(GEOM_Object) theP1,
Handle(GEOM_Object) theP2,
Handle(GEOM_Object) theP3)
{
SetErrorCode(KO); SetErrorCode(KO);
//Add a new object //Add a new object
Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
@ -1533,16 +1587,16 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
// Common edges on external cylinders // Common edges on external cylinders
Handle(GEOM_Object) box_e; Handle(GEOM_Object) box_e;
if (theHexMesh) { if (theHexMesh) {
box_e = a3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1); box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
} }
else { else {
box_e = a3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1); box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
} }
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
box_e = aTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
Handle(TColStd_HSequenceOfInteger) edges_e = aShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
if (edges_e.IsNull() || edges_e->Length() == 0) { if (edges_e.IsNull() || edges_e->Length() == 0) {
@ -1568,7 +1622,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
} }
Handle(GEOM_Object) aChamfer; Handle(GEOM_Object) aChamfer;
try { try {
aChamfer = aLocalOperations->MakeChamferEdges(aShape, theW, theH, theEdges); aChamfer = myLocalOperations->MakeChamferEdges(aShape, theW, theH, theEdges);
} }
catch (Standard_Failure) { catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
@ -1663,8 +1717,11 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
* \return List of GEOM_Objects, containing the created shape and propagation groups. * \return List of GEOM_Objects, containing the created shape and propagation groups.
*/ */
//============================================================================= //=============================================================================
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, Handle(TColStd_HSequenceOfTransient)
double theL1, double theR2, double theW2, double theL2, double theRF, bool theHexMesh) { GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, double theL1,
double theR2, double theW2, double theL2,
double theRF, bool theHexMesh)
{
SetErrorCode(KO); SetErrorCode(KO);
//Add a new object //Add a new object
Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
@ -1708,16 +1765,16 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
// Common edges on external cylinders // Common edges on external cylinders
Handle(GEOM_Object) box_e; Handle(GEOM_Object) box_e;
if (theHexMesh) { if (theHexMesh) {
box_e = a3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1); box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
} }
else { else {
box_e = a3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1); box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
} }
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
box_e = aTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
Handle(TColStd_HSequenceOfInteger) edges_e = aShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
if (edges_e.IsNull() || edges_e->Length() == 0) { if (edges_e.IsNull() || edges_e->Length() == 0) {
@ -1744,7 +1801,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
Handle(GEOM_Object) aFillet; Handle(GEOM_Object) aFillet;
try { try {
aFillet = aLocalOperations->MakeFilletEdges(aShape, theRF, theEdges); aFillet = myLocalOperations->MakeFilletEdges(aShape, theRF, theEdges);
} }
catch (Standard_Failure) { catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
@ -1837,9 +1894,14 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
* \return List of GEOM_Objects, containing the created shape and propagation groups. * \return List of GEOM_Objects, containing the created shape and propagation groups.
*/ */
//============================================================================= //=============================================================================
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, Handle(TColStd_HSequenceOfTransient)
double theW1, double theL1, double theR2, double theW2, double theL2, double theRF, bool theHexMesh, GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, double theW1, double theL1,
Handle(GEOM_Object) theP1, Handle(GEOM_Object) theP2, Handle(GEOM_Object) theP3) { double theR2, double theW2, double theL2,
double theRF, bool theHexMesh,
Handle(GEOM_Object) theP1,
Handle(GEOM_Object) theP2,
Handle(GEOM_Object) theP3)
{
SetErrorCode(KO); SetErrorCode(KO);
//Add a new object //Add a new object
Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
@ -1888,16 +1950,16 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
// Common edges on external cylinders // Common edges on external cylinders
Handle(GEOM_Object) box_e; Handle(GEOM_Object) box_e;
if (theHexMesh) { if (theHexMesh) {
box_e = a3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1); box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
} }
else { else {
box_e = a3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1); box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
} }
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
box_e = aTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
Handle(TColStd_HSequenceOfInteger) edges_e = aShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
box_e->GetLastFunction()->SetDescription(""); box_e->GetLastFunction()->SetDescription("");
if (edges_e.IsNull() || edges_e->Length() == 0) { if (edges_e.IsNull() || edges_e->Length() == 0) {
@ -1924,7 +1986,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShap
Handle(GEOM_Object) aFillet; Handle(GEOM_Object) aFillet;
try { try {
aFillet = aLocalOperations->MakeFilletEdges(aShape, theRF, theEdges); aFillet = myLocalOperations->MakeFilletEdges(aShape, theRF, theEdges);
} }
catch (Standard_Failure) { catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();

View File

@ -27,66 +27,87 @@
#include "GEOM_IOperations.hxx" #include "GEOM_IOperations.hxx"
#include "GEOM_Engine.hxx" #include "GEOM_Engine.hxx"
#include "GEOM_Object.hxx" #include "GEOM_Object.hxx"
#include "GEOMImpl_IBasicOperations.hxx"
#include "GEOMImpl_IShapesOperations.hxx"
#include "GEOMImpl_IBlocksOperations.hxx"
#include "GEOMImpl_IAdvancedOperations.hxx"
#include "GEOMImpl_ILocalOperations.hxx"
#define Handle_GEOM_Object Handle(GEOM_Object) class GEOMImpl_IBasicOperations;
#define Handle_TColStd_HSequenceOfTransient Handle(TColStd_HSequenceOfTransient) class GEOMImpl_IBooleanOperations;
#define Handle_TColStd_HSequenceOfInteger Handle(TColStd_HSequenceOfInteger) class GEOMImpl_IShapesOperations;
class GEOMImpl_ITransformOperations;
class GEOMImpl_IBlocksOperations;
class GEOMImpl_I3DPrimOperations;
class GEOMImpl_ILocalOperations;
class GEOMImpl_IAdvancedOperations: public GEOM_IOperations { class GEOMImpl_IAdvancedOperations: public GEOM_IOperations {
private: private:
bool MakePipeTShapePartition(Handle_GEOM_Object theShape, double theR1, double theW1, double theL1, double theR2, bool MakePipeTShapePartition(Handle(GEOM_Object) theShape,
double theW2, double theL2, double theH = 0, double theW = 0, double theRF = 0, bool isNormal = true); double theR1, double theW1, double theL1,
bool MakePipeTShapeMirrorAndGlue(Handle_GEOM_Object theShape, double theR1, double theW1, double theL1, double theR2, double theR2, double theW2, double theL2,
double theW2, double theL2); double theH = 0, double theW = 0,
bool MakeGroups(Handle_GEOM_Object theShape, int shapType, double theR1, double theW1, double theL1, double theR2, double theRF = 0, bool isNormal = true);
double theW2, double theL2, Handle_TColStd_HSequenceOfTransient theSeq, gp_Trsf aTrsf); bool MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape,
gp_Trsf GetPositionTrsf(double theL1, double theL2, Handle_GEOM_Object P1 = NULL, Handle_GEOM_Object P2 = NULL, double theR1, double theW1, double theL1,
Handle_GEOM_Object P3 = NULL); double theR2, double theW2, double theL2);
bool CheckCompatiblePosition(double& theL1, double& theL2, Handle_GEOM_Object theP1, Handle_GEOM_Object theP2, bool MakeGroups(Handle(GEOM_Object) theShape, int shapType,
Handle_GEOM_Object theP3, double theTolerance); double theR1, double theW1, double theL1,
double theR2, double theW2, double theL2,
Handle(TColStd_HSequenceOfTransient) theSeq,
gp_Trsf aTrsf);
gp_Trsf GetPositionTrsf(double theL1, double theL2,
Handle(GEOM_Object) P1 = 0,
Handle(GEOM_Object) P2 = 0,
Handle(GEOM_Object) P3 = 0);
bool CheckCompatiblePosition(double& theL1, double& theL2,
Handle(GEOM_Object) theP1,
Handle(GEOM_Object) theP2,
Handle(GEOM_Object) theP3,
double theTolerance);
private: private:
GEOMImpl_IBasicOperations* aBasicOperations; GEOMImpl_IBasicOperations* myBasicOperations;
GEOMImpl_IBooleanOperations* aBooleanOperations; GEOMImpl_IBooleanOperations* myBooleanOperations;
GEOMImpl_IShapesOperations* aShapesOperations; GEOMImpl_IShapesOperations* myShapesOperations;
GEOMImpl_ITransformOperations* aTransformOperations; GEOMImpl_ITransformOperations* myTransformOperations;
GEOMImpl_IBlocksOperations* aBlocksOperations; GEOMImpl_IBlocksOperations* myBlocksOperations;
GEOMImpl_I3DPrimOperations* a3DPrimOperations; GEOMImpl_I3DPrimOperations* my3DPrimOperations;
GEOMImpl_ILocalOperations* aLocalOperations; GEOMImpl_ILocalOperations* myLocalOperations;
public: public:
Standard_EXPORT Standard_EXPORT GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID);
GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID);Standard_EXPORT Standard_EXPORT ~GEOMImpl_IAdvancedOperations();
~GEOMImpl_IAdvancedOperations();
Standard_EXPORT Handle_TColStd_HSequenceOfTransient MakePipeTShape(double theR1, double theW1, double theL1, Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
double theR2, double theW2, double theL2, bool theHexMesh = true); MakePipeTShape(double theR1, double theW1, double theL1,
Standard_EXPORT Handle_TColStd_HSequenceOfTransient double theR2, double theW2, double theL2,
MakePipeTShapeWithPosition(double theR1, double theW1, double theL1, double theR2, double theW2, double theL2, bool theHexMesh = true);
bool theHexMesh = true, Handle_GEOM_Object P1 = NULL, Handle_GEOM_Object P2 = NULL, Handle_GEOM_Object P3 = Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
NULL); MakePipeTShapeWithPosition(double theR1, double theW1, double theL1,
Standard_EXPORT Handle_TColStd_HSequenceOfTransient MakePipeTShapeChamfer(double theR1, double theW1, double theL1, double theR2, double theW2, double theL2,
double theR2, double theW2, double theL2, double theH, double theW, bool theHexMesh = true); bool theHexMesh = true,
Standard_EXPORT Handle_TColStd_HSequenceOfTransient Handle(GEOM_Object) P1 = 0,
MakePipeTShapeChamferWithPosition(double theR1, double theW1, double theL1, double theR2, double theW2, Handle(GEOM_Object) P2 = 0,
double theL2, double theH, double theW, bool theHexMesh = true, Handle_GEOM_Object P1 = NULL, Handle(GEOM_Object) P3 = 0);
Handle_GEOM_Object P2 = NULL, Handle_GEOM_Object P3 = NULL); Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
Standard_EXPORT Handle_TColStd_HSequenceOfTransient MakePipeTShapeFillet(double theR1, double theW1, double theL1, MakePipeTShapeChamfer(double theR1, double theW1, double theL1,
double theR2, double theW2, double theL2, double theRF, bool theHexMesh = true); double theR2, double theW2, double theL2,
Standard_EXPORT Handle_TColStd_HSequenceOfTransient double theH, double theW,
MakePipeTShapeFilletWithPosition(double theR1, double theW1, double theL1, double theR2, double theW2, bool theHexMesh = true);
double theL2, double theRF, bool theHexMesh = true, Handle_GEOM_Object P1 = NULL, Handle_GEOM_Object P2 = Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
NULL, Handle_GEOM_Object P3 = NULL); MakePipeTShapeChamferWithPosition(double theR1, double theW1, double theL1,
double theR2, double theW2, double theL2,
double theH, double theW,
bool theHexMesh = true,
Handle(GEOM_Object) P1 = 0,
Handle(GEOM_Object) P2 = 0,
Handle(GEOM_Object) P3 = 0);
Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
MakePipeTShapeFillet(double theR1, double theW1, double theL1,
double theR2, double theW2, double theL2,
double theRF, bool theHexMesh = true);
Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
MakePipeTShapeFilletWithPosition(double theR1, double theW1, double theL1,
double theR2, double theW2, double theL2,
double theRF, bool theHexMesh = true,
Handle(GEOM_Object) P1 = 0,
Handle(GEOM_Object) P2 = 0,
Handle(GEOM_Object) P3 = 0);
/*@@ insert new functions before this line @@*/ /*@@ insert new functions before this line @@*/
}; };
#undef Handle_GEOM_Object
#undef Handle_TColStd_HSequenceOfTransient
#undef Handle_TColStd_HSequenceOfInteger
#endif #endif