TopoDS_Face F = TopoDS::Face(ex.Current());
Handle(Poly_Triangulation) Tr = BRep_Tool::Triangulation(F, L);
if(Tr.IsNull())
- MESSAGE("Error, null layer" )
+ MESSAGE("Error, null layer" )
nbNodes = Tr->NbNodes();
const TColgp_Array1OfPnt& Nodes = Tr->Nodes();
// Calcul des dimensions de la boite englobante du solide
for(i=1;i<=nbNodes;i++)
- {
- InitPoint = Nodes(i).Transformed(L.Transformation());
- if(InitPoint.X() < Xmin)
- Xmin = InitPoint.X();
- if(InitPoint.X() > Xmax)
- Xmax = InitPoint.X();
- if(InitPoint.Y() < Ymin)
- Ymin = InitPoint.Y();
- if(InitPoint.Y() > Ymax)
- Ymax = InitPoint.Y();
- if(InitPoint.Z() < Zmin)
- Zmin = InitPoint.Z();
- if(InitPoint.Z() > Zmax)
- Zmax = InitPoint.Z();
-
- }
+ {
+ InitPoint = Nodes(i).Transformed(L.Transformation());
+ if(InitPoint.X() < Xmin)
+ Xmin = InitPoint.X();
+ if(InitPoint.X() > Xmax)
+ Xmax = InitPoint.X();
+ if(InitPoint.Y() < Ymin)
+ Ymin = InitPoint.Y();
+ if(InitPoint.Y() > Ymax)
+ Ymax = InitPoint.Y();
+ if(InitPoint.Z() < Zmin)
+ Zmin = InitPoint.Z();
+ if(InitPoint.Z() > Zmax)
+ Zmax = InitPoint.Z();
+
+ }
}
// Creation du point d'initialisation, c'est \80 dire le centre de gravit\89
TopoDS_Face F = TopoDS::Face(ex.Current());
Handle(Poly_Triangulation) Tr = BRep_Tool::Triangulation(F, L);
if(Tr.IsNull())
- MESSAGE("Error, null layer" )
+ MESSAGE("Error, null layer" )
const Poly_Array1OfTriangle& triangles = Tr->Triangles();
Standard_Integer nbTriangles = Tr->NbTriangles();
nbNodes = Tr->NbNodes();
//en tenant compte des triangles coup\89s par le plan de section
for (i=1;i<=nbTriangles;i++)
- {
- Determinant=0;
- //Gardons la meme orientation des noeuds
- if (F.Orientation() == TopAbs_REVERSED)
- triangles(i).Get(noeud[0], noeud[2], noeud[1]);
- else
- triangles(i).Get(noeud[0], noeud[1], noeud[2]);
-
+ {
+ Determinant=0;
+ //Gardons la meme orientation des noeuds
+ if (F.Orientation() == TopAbs_REVERSED)
+ triangles(i).Get(noeud[0], noeud[2], noeud[1]);
+ else
+ triangles(i).Get(noeud[0], noeud[1], noeud[2]);
+
P[0] = Nodes(noeud[0]).Transformed(L.Transformation());
- z[0] = P[0].Z();
- P[1] = Nodes(noeud[1]).Transformed(L.Transformation());
- z[1] = P[1].Z();
+ z[0] = P[0].Z();
+ P[1] = Nodes(noeud[1]).Transformed(L.Transformation());
+ z[1] = P[1].Z();
P[2] = Nodes(noeud[2]).Transformed(L.Transformation());
z[2] = P[2].Z();
- // Determination des cas aux limites pour les triangles
- Standard_Integer i,compteur=0;
+ // Determination des cas aux limites pour les triangles
+ Standard_Integer i,compteur=0;
- for (i=0;i<=2;i++)
- {
+ for (i=0;i<=2;i++)
+ {
flag[i]=Standard_False;
- if(z[i]>=Elevation)
- {
- flag[i]=Standard_True;
- compteur++;
- }
- }
-
- switch(compteur)
- {
- case 0:
- Determinant = ElementaryVolume(P[0],P[1],P[2]);
- break;
-
- case 1:
- for (i=0;i<=2;i++)
- {
- if (flag[i]==Standard_True)
- {
- gp_Pnt Result1 = Intersection(P[i],P[(i+1)%3],Elevation);
- gp_Pnt Result2 = Intersection(P[i],P[(i+2)%3],Elevation);
- Determinant = ElementaryVolume(Result1,P[(i+1)%3],P[(i+2)%3])
- + ElementaryVolume(Result1,P[(i+2)%3],Result2);
- }
- }
- break;
-
- case 2:
- for (i=0;i<=2;i++)
- {
- if (flag[i]==Standard_False)
- {
- gp_Pnt Result1 = Intersection(P[i],P[(i+1)%3],Elevation);
- gp_Pnt Result2 = Intersection(P[i],P[(i+2)%3],Elevation);
- Determinant = ElementaryVolume(P[i],Result1,Result2);
- }
- }
- break;
-
- case 3:
- break;
- }
- Volume += Determinant;
- }
+ if(z[i]>=Elevation)
+ {
+ flag[i]=Standard_True;
+ compteur++;
+ }
+ }
+
+ switch(compteur)
+ {
+ case 0:
+ Determinant = ElementaryVolume(P[0],P[1],P[2]);
+ break;
+
+ case 1:
+ for (i=0;i<=2;i++)
+ {
+ if (flag[i]==Standard_True)
+ {
+ gp_Pnt Result1 = Intersection(P[i],P[(i+1)%3],Elevation);
+ gp_Pnt Result2 = Intersection(P[i],P[(i+2)%3],Elevation);
+ Determinant = ElementaryVolume(Result1,P[(i+1)%3],P[(i+2)%3])
+ + ElementaryVolume(Result1,P[(i+2)%3],Result2);
+ }
+ }
+ break;
+
+ case 2:
+ for (i=0;i<=2;i++)
+ {
+ if (flag[i]==Standard_False)
+ {
+ gp_Pnt Result1 = Intersection(P[i],P[(i+1)%3],Elevation);
+ gp_Pnt Result2 = Intersection(P[i],P[(i+2)%3],Elevation);
+ Determinant = ElementaryVolume(P[i],Result1,Result2);
+ }
+ }
+ break;
+
+ case 3:
+ break;
+ }
+ Volume += Determinant;
+ }
}
return Volume;
else
{
while((Bsup-Binf)>Epsilon)
- {
- if((tempBinfVolume-Constante)*(tempCVolume-Constante)>0 && Abs(tempCVolume-Constante)>Epsilon)
- {
- Binf = c;
- tempBinfVolume=tempCVolume;
-
- c = ((Binf*(tempBsupVolume-Constante))-(Bsup*(tempBinfVolume-Constante)))
- /((tempBsupVolume-Constante)-(tempBinfVolume-Constante));
+ {
+ if((tempBinfVolume-Constante)*(tempCVolume-Constante)>0 && Abs(tempCVolume-Constante)>Epsilon)
+ {
+ Binf = c;
+ tempBinfVolume=tempCVolume;
+
+ c = ((Binf*(tempBsupVolume-Constante))-(Bsup*(tempBinfVolume-Constante)))
+ /((tempBsupVolume-Constante)-(tempBinfVolume-Constante));
tempCVolume=CalculateVolume(c);
- }
- else if((tempBinfVolume-Constante)*(tempCVolume-Constante)<0 && Abs(tempCVolume-Constante)>Epsilon)
- {
- Bsup = c;
- tempBsupVolume =tempCVolume;
+ }
+ else if((tempBinfVolume-Constante)*(tempCVolume-Constante)<0 && Abs(tempCVolume-Constante)>Epsilon)
+ {
+ Bsup = c;
+ tempBsupVolume =tempCVolume;
- c = ((Binf*(tempBsupVolume-Constante))-(Bsup*(tempBinfVolume-Constante)))
- /((tempBsupVolume-Constante)-(tempBinfVolume-Constante));
+ c = ((Binf*(tempBsupVolume-Constante))-(Bsup*(tempBinfVolume-Constante)))
+ /((tempBsupVolume-Constante)-(tempBinfVolume-Constante));
tempCVolume=CalculateVolume(c);
- }
- else
- {
- goto endMethod;
- }
- }
+ }
+ else
+ {
+ goto endMethod;
+ }
+ }
goto endMethod;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: BREPExport.cxx
-// Created: Wed May 19 13:10:05 2004
-// Author: Pavel TELKOV
-// <ptv@mutex.nnov.opencascade.com>
+// File: BREPExport.cxx
+// Created: Wed May 19 13:10:05 2004
+// Author: Pavel TELKOV
+// <ptv@mutex.nnov.opencascade.com>
//
#include "utilities.h"
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: BREPImport.cxx
-// Created: Wed May 19 14:29:52 2004
-// Author: Pavel TELKOV
-// <ptv@mutex.nnov.opencascade.com>
+// File: BREPImport.cxx
+// Created: Wed May 19 14:29:52 2004
+// Author: Pavel TELKOV
+// <ptv@mutex.nnov.opencascade.com>
//
#include "utilities.h"
TopoDS_Shape Import (const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& /*theFormatName*/,
TCollection_AsciiString& theError,
- const TDF_Label&)
+ const TDF_Label&)
{
MESSAGE("Import BREP from file " << theFileName);
TopoDS_Shape aShape;
// TRUE to construct a modal dialog.
//=================================================================================
BasicGUI_ArcDlg::BasicGUI_ArcDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
connect( Group3Pnts3->LineEdit3, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_ARC" ) );
int anIndex = aMap(1);
aName += QString(":vertex_%1").arg(anIndex);
- //Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
- if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
- aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- }
- else
- aSelectedObject = aFindedObject; // get Object from study
+ if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ }
+ else
+ aSelectedObject = aFindedObject; // get Object from study
}
else // Global Selection
{
switch ( getConstructorId() ) {
case 0:
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) {
- myPoint1 = aSelectedObject;
- if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
- Group3Pnts->PushButton2->click();
+ myPoint1 = aSelectedObject;
+ if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
+ Group3Pnts->PushButton2->click();
}
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) {
- myPoint2 = aSelectedObject;
- if ( !myPoint2->_is_nil() && myPoint3->_is_nil() )
- Group3Pnts->PushButton3->click();
+ myPoint2 = aSelectedObject;
+ if ( !myPoint2->_is_nil() && myPoint3->_is_nil() )
+ Group3Pnts->PushButton3->click();
}
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) {
- myPoint3 = aSelectedObject;
- if ( !myPoint3->_is_nil() && myPoint1->_is_nil() )
- Group3Pnts->PushButton1->click();
+ myPoint3 = aSelectedObject;
+ if ( !myPoint3->_is_nil() && myPoint1->_is_nil() )
+ Group3Pnts->PushButton1->click();
}
break;
case 1:
if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) {
- myPoint1 = aSelectedObject;
- if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
- Group3Pnts2->PushButton2->click();
+ myPoint1 = aSelectedObject;
+ if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
+ Group3Pnts2->PushButton2->click();
}
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) {
- myPoint2 = aSelectedObject;
- if ( !myPoint2->_is_nil() && myPoint3->_is_nil() )
- Group3Pnts2->PushButton3->click();
+ myPoint2 = aSelectedObject;
+ if ( !myPoint2->_is_nil() && myPoint3->_is_nil() )
+ Group3Pnts2->PushButton3->click();
}
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) {
- myPoint3 = aSelectedObject;
- if ( !myPoint3->_is_nil() && myPoint1->_is_nil() )
- Group3Pnts2->PushButton1->click();
+ myPoint3 = aSelectedObject;
+ if ( !myPoint3->_is_nil() && myPoint1->_is_nil() )
+ Group3Pnts2->PushButton1->click();
}
break;
case 2:
if ( myEditCurrentArgument == Group3Pnts3->LineEdit1 ) {
- myPoint1 = aSelectedObject;
- if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
- Group3Pnts3->PushButton2->click();
+ myPoint1 = aSelectedObject;
+ if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
+ Group3Pnts3->PushButton2->click();
}
else if ( myEditCurrentArgument == Group3Pnts3->LineEdit2 ) {
- myPoint2 = aSelectedObject;
- if ( !myPoint2->_is_nil() && myPoint3->_is_nil() )
- Group3Pnts3->PushButton3->click();
+ myPoint2 = aSelectedObject;
+ if ( !myPoint2->_is_nil() && myPoint3->_is_nil() )
+ Group3Pnts3->PushButton3->click();
}
else if ( myEditCurrentArgument == Group3Pnts3->LineEdit3 ) {
- myPoint3 = aSelectedObject;
- if ( !myPoint3->_is_nil() && myPoint1->_is_nil() )
- Group3Pnts3->PushButton1->click();
+ myPoint3 = aSelectedObject;
+ if ( !myPoint3->_is_nil() && myPoint1->_is_nil() )
+ Group3Pnts3->PushButton1->click();
}
break;
}
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ),
- this,
- SLOT(SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ),
+ this,
+ SLOT(SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
case 0:
{
if (Group3Pnts->LineEdit1->text().trimmed().isEmpty() ||
- Group3Pnts->LineEdit2->text().trimmed().isEmpty() ||
- Group3Pnts->LineEdit3->text().trimmed().isEmpty())
- return false;
+ Group3Pnts->LineEdit2->text().trimmed().isEmpty() ||
+ Group3Pnts->LineEdit3->text().trimmed().isEmpty())
+ return false;
break;
}
case 1:
{
if (Group3Pnts2->LineEdit1->text().trimmed().isEmpty() ||
- Group3Pnts2->LineEdit2->text().trimmed().isEmpty() ||
- Group3Pnts2->LineEdit3->text().trimmed().isEmpty())
- return false;
+ Group3Pnts2->LineEdit2->text().trimmed().isEmpty() ||
+ Group3Pnts2->LineEdit3->text().trimmed().isEmpty())
+ return false;
break;
}
case 2:
{
if (Group3Pnts3->LineEdit1->text().trimmed().isEmpty() ||
- Group3Pnts3->LineEdit2->text().trimmed().isEmpty() ||
- Group3Pnts3->LineEdit3->text().trimmed().isEmpty())
- return false;
+ Group3Pnts3->LineEdit2->text().trimmed().isEmpty() ||
+ Group3Pnts3->LineEdit3->text().trimmed().isEmpty())
+ return false;
break;
}
}
case 0:
{
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
- anObj = anOper->MakeArc( myPoint1, myPoint2, myPoint3 );
- res = true;
+ anObj = anOper->MakeArc( myPoint1, myPoint2, myPoint3 );
+ res = true;
}
break;
}
{
bool Sense = Group3Pnts2->CheckButton1->isChecked();
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
- anObj = anOper->MakeArcCenter( myPoint1, myPoint2, myPoint3, Sense );
- res = true;
+ anObj = anOper->MakeArcCenter( myPoint1, myPoint2, myPoint3, Sense );
+ res = true;
}
break;
}
case 2:
{
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
- anObj = anOper->MakeArcOfEllipse( myPoint1, myPoint2, myPoint3 );
- res = true;
+ anObj = anOper->MakeArcOfEllipse( myPoint1, myPoint2, myPoint3 );
+ res = true;
}
break;
}
myEditCurrentArgument->setFocus();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
if ( CORBA::is_nil( myPoint1 ) )
SelectionIntoArgument();
// TRUE to construct a modal dialog.
//=================================================================================
BasicGUI_CircleDlg::BasicGUI_CircleDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CIRCLE_PV" ) ) );
case 2:
{
GroupPntVecR->hide();
- Group3Pnts->hide();
+ Group3Pnts->hide();
GroupCenter2Pnts->show();
myEditCurrentArgument = GroupCenter2Pnts->LineEdit1;
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
displayPreview();
}
else
aName += QString( ":vertex_%1" ).arg( anIndex );
- //Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
- if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
- aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
- }
- else {
- aSelectedObject = aFindedObject; // get Object from study
- }
+ if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ }
+ else {
+ aSelectedObject = aFindedObject; // get Object from study
+ }
}
else { // Global Selection
if ( aShape.ShapeType() != aNeedType ) {
if ( myEditCurrentArgument == GroupPntVecR->LineEdit1 ) {
myPoint = aSelectedObject;
if ( !myPoint->_is_nil() && myDir->_is_nil() )
- GroupPntVecR->PushButton2->click();
+ GroupPntVecR->PushButton2->click();
}
else if ( myEditCurrentArgument == GroupPntVecR->LineEdit2 ) {
myDir = aSelectedObject;
if ( !myDir->_is_nil() && myPoint->_is_nil() )
- GroupPntVecR->PushButton1->click();
+ GroupPntVecR->PushButton1->click();
}
else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) {
myPoint1 = aSelectedObject;
if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
- Group3Pnts->PushButton2->click();
+ Group3Pnts->PushButton2->click();
}
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) {
myPoint2 = aSelectedObject;
if ( !myPoint2->_is_nil() && myPoint3->_is_nil() )
- Group3Pnts->PushButton3->click();
+ Group3Pnts->PushButton3->click();
}
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) {
myPoint3 = aSelectedObject;
if ( !myPoint3->_is_nil() && myPoint1->_is_nil() )
- Group3Pnts->PushButton1->click();
+ Group3Pnts->PushButton1->click();
}
else if ( myEditCurrentArgument == GroupCenter2Pnts->LineEdit1 ) {
myPoint4 = aSelectedObject;
if ( !myPoint4->_is_nil() && myPoint5->_is_nil() )
- GroupCenter2Pnts->PushButton2->click();
+ GroupCenter2Pnts->PushButton2->click();
}
else if ( myEditCurrentArgument == GroupCenter2Pnts->LineEdit2 ) {
myPoint5 = aSelectedObject;
if ( !myPoint5->_is_nil() && myPoint6->_is_nil() )
- GroupCenter2Pnts->PushButton3->click();
+ GroupCenter2Pnts->PushButton3->click();
}
else if ( myEditCurrentArgument == GroupCenter2Pnts->LineEdit3 ) {
myPoint6 = aSelectedObject;
if ( !myPoint6->_is_nil() && myPoint4->_is_nil() )
- GroupCenter2Pnts->PushButton1->click();
+ GroupCenter2Pnts->PushButton1->click();
}
}
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
// TRUE to construct a modal dialog.
//=================================================================================
BasicGUI_EllipseDlg::BasicGUI_EllipseDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_ELLIPSE_PV" ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_ELLIPSE" ) );
else
aName += QString(":vertex_%1").arg(anIndex);
- //Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
- if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
+ if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- }
- else {
- aSelectedObject = aFindedObject; // get Object from study
- }
+ }
+ else {
+ aSelectedObject = aFindedObject; // get Object from study
+ }
}
else { // Global Selection
if (aShape.ShapeType() != aNeedType) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
myPoint = aSelectedObject;
if ( !myPoint->_is_nil() && myDir->_is_nil() )
- GroupPoints->PushButton2->click();
+ GroupPoints->PushButton2->click();
}
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
myDir = aSelectedObject;
if ( !myDir->_is_nil() && myMajor->_is_nil() )
- GroupPoints->PushButton3->click();
+ GroupPoints->PushButton3->click();
}
else if ( myEditCurrentArgument == GroupPoints->LineEdit3 ) {
myMajor = aSelectedObject;
if ( !myMajor->_is_nil() && myPoint->_is_nil() )
- GroupPoints->PushButton1->click();
+ GroupPoints->PushButton1->click();
}
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
// TRUE to construct a modal dialog.
//=================================================================================
BasicGUI_LineDlg::BasicGUI_LineDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_LINE_2P" ) ) );
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupPoints->PushButton1->setDown(true);
-
+
/* signals and slots connections */
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect( GroupFaces->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_LINE" ) );
QString aName = GEOMBase::GetName( aSelectedObject );
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
if ( myEditCurrentArgument == GroupFaces->LineEdit1 ||
- myEditCurrentArgument == GroupFaces->LineEdit2 )
+ myEditCurrentArgument == GroupFaces->LineEdit2 )
aNeedType = TopAbs_FACE;
TopoDS_Shape aShape;
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) { // Local Selection
- int anIndex = aMap( 1 );
+ int anIndex = aMap( 1 );
if ( aNeedType == TopAbs_FACE )
aName += QString( ":face_%1" ).arg( anIndex );
else
aName += QString( ":vertex_%1" ).arg( anIndex );
- //Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
- if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
- aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
- }
- else {
- aSelectedObject = aFindedObject; // get Object from study
- }
+ if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ }
+ else {
+ aSelectedObject = aFindedObject; // get Object from study
+ }
}
else { // Global Selection
if ( aShape.ShapeType() != aNeedType ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
myPoint1 = aSelectedObject;
if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
- GroupPoints->PushButton2->click();
+ GroupPoints->PushButton2->click();
}
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
myPoint2 = aSelectedObject;
if ( !myPoint2->_is_nil() && myPoint1->_is_nil() )
- GroupPoints->PushButton1->click();
+ GroupPoints->PushButton1->click();
}
else if ( myEditCurrentArgument == GroupFaces->LineEdit1 ) {
myFace1 = aSelectedObject;
if ( !myFace1->_is_nil() && myFace2->_is_nil() )
- GroupFaces->PushButton2->click();
+ GroupFaces->PushButton2->click();
}
else if ( myEditCurrentArgument == GroupFaces->LineEdit2 ) {
myFace2 = aSelectedObject;
if ( !myFace2->_is_nil() && myFace1->_is_nil() )
- GroupFaces->PushButton1->click();
+ GroupFaces->PushButton1->click();
}
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
//=================================================================================
BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* theParent )
: GEOMBase_Skeleton( theGeometryGUI, theParent, false,
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
+ Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
{
QPixmap iconCS1 ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER" ) ) );
QPixmap iconCS2 ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER2" ) ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( onApply() ) );
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) );
initName( tr( "LCS_NAME" ) );
resize( minimumSizeHint() );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionDone() ) );
+ this, SLOT( onSelectionDone() ) );
onSelectionDone();
}
if ( aSelectedObj->GetType() == GEOM_MARKER && aShape.ShapeType() == TopAbs_FACE ) {
TopoDS_Face aFace = TopoDS::Face( aShape );
Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast( BRep_Tool::Surface( aFace ) );
-
+
if ( !aPlane.IsNull() ) {
gp_Ax3 anAx3 = aPlane->Pln().Position();
gp_Pnt aLoc = anAx3.Location();
gp_Dir aXDir = anAx3.XDirection();
gp_Dir aYDir = anAx3.YDirection();
-
+
myData[ X ]->setValue( aLoc.X() );
myData[ Y ]->setValue( aLoc.Y() );
myData[ Z ]->setValue( aLoc.Z() );
-
+
myData[ DX1 ]->setValue( aXDir.X() );
myData[ DY1 ]->setValue( aXDir.Y() );
myData[ DZ1 ]->setValue( aXDir.Z() );
-
+
myData[ DX2 ]->setValue( aYDir.X() );
myData[ DY2 ]->setValue( aYDir.Y() );
myData[ DZ2 ]->setValue( aYDir.Z() );
- aSelMgr->clearSelected();
+ aSelMgr->clearSelected();
}
}
else {
- TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( anIO, aMap );
- if ( aMap.Extent() == 1 ) { // Local Selection
- int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
- aSelMgr->clearSelected(); // ???
- }
+ TColStd_IndexedMapOfInteger aMap;
+ aSelMgr->GetIndexes( anIO, aMap );
+ if ( aMap.Extent() == 1 ) { // Local Selection
+ int anIndex = aMap( 1 );
+ TopTools_IndexedMapOfShape aShapes;
+ TopExp::MapShapes( aShape, aShapes );
+ aShape = aShapes.FindKey( anIndex );
+ aSelMgr->clearSelected(); // ???
+ }
if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) {
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
CORBA::Double Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz, Yx, Yy, Yz;
Ox = Oy = Oz = Zx = Zy = Xy = Xz = Yx = Yz = 0;
Zz = Xx = Yy = 1.;
-
+
GEOM::GEOM_IMeasureOperations_ptr aMeasureOp =
myGeomGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() );
aMeasureOp->GetPosition( aSelectedObj, Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz );
-
+
// Calculate Y direction
if ( aMeasureOp->IsDone() ) {
gp_Pnt aPnt ( Ox, Oy, Oz );
TopAbs_ShapeEnum aNeedType = TopAbs_EDGE;
if ( myEditCurrentArgument == Group2->LineEdit1 )
aNeedType = TopAbs_VERTEX;
-
+
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes( anIO, aMap );
}
if ( myEditCurrentArgument == Group2->LineEdit1 ) {
- if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) {
- gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
- myData[ X ]->setValue( aPnt.X() );
- myData[ Y ]->setValue( aPnt.Y() );
- myData[ Z ]->setValue( aPnt.Z() );
- myEditCurrentArgument->setText( aName );
- if (Group2->LineEdit2->text() == "")
- Group2->PushButton2->click();
- }
- else {
- myData[ X ]->setValue( 0 );
- myData[ Y ]->setValue( 0 );
- myData[ Z ]->setValue( 0 );
- }
- }
- else if (myEditCurrentArgument == Group2->LineEdit2) {
- if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_EDGE ) {
- gp_Pnt aP1 = BRep_Tool::Pnt( TopExp::FirstVertex( TopoDS::Edge( aShape ) ) );
- gp_Pnt aP2 = BRep_Tool::Pnt( TopExp::LastVertex( TopoDS::Edge( aShape ) ) );
- gp_Dir aDir( gp_Vec( aP1, aP2 ) );
-
- myData[ DX1 ]->setValue( aDir.X() );
- myData[ DY1 ]->setValue( aDir.Y() );
- myData[ DZ1 ]->setValue( aDir.Z() );
- myEditCurrentArgument->setText( aName );
- if (Group2->LineEdit3->text() == "")
- Group2->PushButton3->click();
- }
- else {
- myData[ DX1 ]->setValue( 0 );
- myData[ DY1 ]->setValue( 0 );
- myData[ DZ1 ]->setValue( 0 );
- }
- }
- else if ( myEditCurrentArgument == Group2->LineEdit3 ) {
- if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_EDGE ) {
- gp_Pnt aP1 = BRep_Tool::Pnt( TopExp::FirstVertex( TopoDS::Edge( aShape ) ) );
- gp_Pnt aP2 = BRep_Tool::Pnt( TopExp::LastVertex( TopoDS::Edge( aShape ) ) );
- gp_Dir aDir(gp_Vec( aP1, aP2 ));
-
- myData[ DX2 ]->setValue( aDir.X() );
- myData[ DY2 ]->setValue( aDir.Y() );
- myData[ DZ2 ]->setValue( aDir.Z() );
- myEditCurrentArgument->setText( aName );
- if (Group2->LineEdit1->text() == "")
- Group2->PushButton1->click();
- }
- else {
- myData[ DX2 ]->setValue( 0 );
- myData[ DY2 ]->setValue( 0 );
- myData[ DZ2 ]->setValue( 0 );
- }
- }
- }
+ if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) {
+ gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
+ myData[ X ]->setValue( aPnt.X() );
+ myData[ Y ]->setValue( aPnt.Y() );
+ myData[ Z ]->setValue( aPnt.Z() );
+ myEditCurrentArgument->setText( aName );
+ if (Group2->LineEdit2->text() == "")
+ Group2->PushButton2->click();
+ }
+ else {
+ myData[ X ]->setValue( 0 );
+ myData[ Y ]->setValue( 0 );
+ myData[ Z ]->setValue( 0 );
+ }
+ }
+ else if (myEditCurrentArgument == Group2->LineEdit2) {
+ if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_EDGE ) {
+ gp_Pnt aP1 = BRep_Tool::Pnt( TopExp::FirstVertex( TopoDS::Edge( aShape ) ) );
+ gp_Pnt aP2 = BRep_Tool::Pnt( TopExp::LastVertex( TopoDS::Edge( aShape ) ) );
+ gp_Dir aDir( gp_Vec( aP1, aP2 ) );
+
+ myData[ DX1 ]->setValue( aDir.X() );
+ myData[ DY1 ]->setValue( aDir.Y() );
+ myData[ DZ1 ]->setValue( aDir.Z() );
+ myEditCurrentArgument->setText( aName );
+ if (Group2->LineEdit3->text() == "")
+ Group2->PushButton3->click();
+ }
+ else {
+ myData[ DX1 ]->setValue( 0 );
+ myData[ DY1 ]->setValue( 0 );
+ myData[ DZ1 ]->setValue( 0 );
+ }
+ }
+ else if ( myEditCurrentArgument == Group2->LineEdit3 ) {
+ if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_EDGE ) {
+ gp_Pnt aP1 = BRep_Tool::Pnt( TopExp::FirstVertex( TopoDS::Edge( aShape ) ) );
+ gp_Pnt aP2 = BRep_Tool::Pnt( TopExp::LastVertex( TopoDS::Edge( aShape ) ) );
+ gp_Dir aDir(gp_Vec( aP1, aP2 ));
+
+ myData[ DX2 ]->setValue( aDir.X() );
+ myData[ DY2 ]->setValue( aDir.Y() );
+ myData[ DZ2 ]->setValue( aDir.Z() );
+ myEditCurrentArgument->setText( aName );
+ if (Group2->LineEdit1->text() == "")
+ Group2->PushButton1->click();
+ }
+ else {
+ myData[ DX2 ]->setValue( 0 );
+ myData[ DY2 ]->setValue( 0 );
+ myData[ DZ2 ]->setValue( 0 );
+ }
+ }
+ }
}
}
}
}
else if ( getConstructorId() == 2 ) {
if ( myEditCurrentArgument == Group2->LineEdit1 ) {
- myData[ X ]->setValue( 0 );
- myData[ Y ]->setValue( 0 );
- myData[ Z ]->setValue( 0 );
+ myData[ X ]->setValue( 0 );
+ myData[ Y ]->setValue( 0 );
+ myData[ Z ]->setValue( 0 );
}
else if ( myEditCurrentArgument == Group2->LineEdit2 ) {
- myData[ DX1 ]->setValue( 0 );
- myData[ DY1 ]->setValue( 0 );
- myData[ DZ1 ]->setValue( 0 );
+ myData[ DX1 ]->setValue( 0 );
+ myData[ DY1 ]->setValue( 0 );
+ myData[ DZ1 ]->setValue( 0 );
}
else if ( myEditCurrentArgument == Group2->LineEdit3 ) {
- myData[ DX2 ]->setValue( 0 );
- myData[ DY2 ]->setValue( 0 );
- myData[ DZ2 ]->setValue( 0 );
+ myData[ DX2 ]->setValue( 0 );
+ myData[ DY2 ]->setValue( 0 );
+ myData[ DZ2 ]->setValue( 0 );
}
}
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionDone() ) );
+ this, SLOT( onSelectionDone() ) );
ConstructorsClicked( getConstructorId() );
}
{
GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
GEOM::GEOM_Object_var anObj = anOper->MakeMarker( myData[ X ]->value(),
- myData[ Y ]->value(),
- myData[ Z ]->value(),
- myData[ DX1 ]->value(),
- myData[ DY1 ]->value(),
- myData[ DZ1 ]->value(),
- myData[ DX2 ]->value(),
- myData[ DY2 ]->value(),
- myData[ DZ2 ]->value() );
+ myData[ Y ]->value(),
+ myData[ Z ]->value(),
+ myData[ DX1 ]->value(),
+ myData[ DY1 ]->value(),
+ myData[ DZ1 ]->value(),
+ myData[ DX2 ]->value(),
+ myData[ DY2 ]->value(),
+ myData[ DZ2 ]->value() );
QStringList aParameters;
aParameters<<myData[X]->text();
aParameters<<myData[Y]->text();
// TRUE to construct a modal dialog.
//=================================================================================
BasicGUI_PlaneDlg::BasicGUI_PlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PLANE_PV" ) ) );
myEditCurrentArgument->setFocus();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
displayPreview();
}
else
aName += QString( ":vertex_%1" ).arg( anIndex );
- //Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
- if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
- aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
- }
- else {
- aSelectedObject = aFindedObject; // get Object from study
- }
+ if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ }
+ else {
+ aSelectedObject = aFindedObject; // get Object from study
+ }
}
else { // Global Selection
if ( aShape.ShapeType() != aNeedType ) {
/* if (!aSelectedObject->_is_nil()) { // clear selection if something selected
globalSelection();
if ( myEditCurrentArgument == GroupFace->LineEdit1 ) {
- TColStd_MapOfInteger aMap;
- aMap.Add( GEOM_PLANE );
- aMap.Add( GEOM_MARKER );
- globalSelection( aMap );
+ TColStd_MapOfInteger aMap;
+ aMap.Add( GEOM_PLANE );
+ aMap.Add( GEOM_MARKER );
+ globalSelection( aMap );
}
else
- localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
- }*/
+ localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+ }*/
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) {
myPoint = aSelectedObject;
if ( !myPoint->_is_nil() && myDir->_is_nil() )
- GroupPntDir->PushButton2->click();
+ GroupPntDir->PushButton2->click();
}
else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) {
myDir = aSelectedObject;
if ( !myDir->_is_nil() && myPoint->_is_nil() )
- GroupPntDir->PushButton1->click();
+ GroupPntDir->PushButton1->click();
}
else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) {
myPoint1 = aSelectedObject;
if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
- Group3Pnts->PushButton2->click();
+ Group3Pnts->PushButton2->click();
}
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) {
myPoint2 = aSelectedObject;
if ( !myPoint2->_is_nil() && myPoint3->_is_nil() )
- Group3Pnts->PushButton3->click();
+ Group3Pnts->PushButton3->click();
}
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) {
myPoint3 = aSelectedObject;
if ( !myPoint3->_is_nil() && myPoint1->_is_nil() )
- Group3Pnts->PushButton1->click();
+ Group3Pnts->PushButton1->click();
}
else if ( myEditCurrentArgument == GroupFace->LineEdit1 )
myFace = aSelectedObject;
else if ( myEditCurrentArgument == Group2Vec->LineEdit1 ) {
myVec1 = aSelectedObject;
if ( !myVec1->_is_nil() && myVec2->_is_nil() )
- Group2Vec->PushButton2->click();
+ Group2Vec->PushButton2->click();
} else if ( myEditCurrentArgument == Group2Vec->LineEdit2 ) {
myVec2 = aSelectedObject;
if ( !myVec2->_is_nil() && myVec1->_is_nil() )
- Group2Vec->PushButton1->click();
+ Group2Vec->PushButton1->click();
} else if ( myEditCurrentArgument == GroupLCS->LineEdit1 )
myLCS = aSelectedObject;
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
SelectionIntoArgument();
//=================================================================================
static bool isEqual( const GEOM::GEOM_Object_var& thePnt1, const GEOM::GEOM_Object_var& thePnt2 )
{
- return thePnt1->_is_equivalent( thePnt2 );
+ return thePnt1->_is_equivalent( thePnt2 );
}
//=================================================================================
// TRUE to construct a modal dialog.
//=================================================================================
BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT") ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
- this, SLOT(SelectionIntoArgument() ) );
+ this, SLOT(SelectionIntoArgument() ) );
initName( tr( "GEOM_VERTEX" ) );
else
aName += QString( ":vertex_%1" ).arg( anIndex );
- //Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
-
- if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp =
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
+
+ if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations(getStudyId());
- aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- }
- else {
- aSelectedObject = aFindedObject; // get Object from study
- }
- GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE );
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ }
+ else {
+ aSelectedObject = aFindedObject; // get Object from study
+ }
+ GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE );
}
else { // Global Selection
if ( aShape.ShapeType() != aNeedType ) {
}
if ( aShape.IsNull() || aShape.ShapeType() != aNeedType)
- return;
+ return;
if ( id == GEOM_POINT_XYZ ) {
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
GroupOnCurve->LineEdit1->setText( aName );
}
else if ( id == GEOM_POINT_INTINT ) {
- myEditCurrentArgument->setText( aName );
- globalSelection();
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+ myEditCurrentArgument->setText( aName );
+ globalSelection();
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
if ( myEditCurrentArgument == GroupLineIntersection->LineEdit1 ) {
myLine1 = aSelectedObject;
- if ( !myLine1->_is_nil() && myLine2->_is_nil() )
- GroupLineIntersection->PushButton2->click();
+ if ( !myLine1->_is_nil() && myLine2->_is_nil() )
+ GroupLineIntersection->PushButton2->click();
}
else if ( myEditCurrentArgument == GroupLineIntersection->LineEdit2 ) {
myLine2 = aSelectedObject;
- if ( !myLine2->_is_nil() && myLine1->_is_nil() )
- GroupLineIntersection->PushButton1->click();
+ if ( !myLine2->_is_nil() && myLine1->_is_nil() )
+ GroupLineIntersection->PushButton1->click();
}
}
else if ( id == GEOM_POINT_SURF )
{
- myFace = aSelectedObject;
- GroupOnSurface->LineEdit1->setText( aName );
+ myFace = aSelectedObject;
+ GroupOnSurface->LineEdit1->setText( aName );
}
}
}
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
const int id = getConstructorId();
if(!anObj->_is_nil() && !IsPreview() && (id == GEOM_POINT_XYZ ||
- id == GEOM_POINT_REF ||
- id == GEOM_POINT_EDGE ||
- id == GEOM_POINT_SURF) ) {
+ id == GEOM_POINT_REF ||
+ id == GEOM_POINT_EDGE ||
+ id == GEOM_POINT_SURF) ) {
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
// TRUE to construct a modal dialog.
//=================================================================================
BasicGUI_VectorDlg::BasicGUI_VectorDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_VECTOR_2P" ) ) );
connect( GroupDimensions->CheckButton1, SIGNAL( stateChanged( int ) ), this, SLOT( ReverseVector( int ) ) );
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr("GEOM_VECTOR") );
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
break;
}
case 1:
int anIndex = aMap(1);
aName += QString(":vertex_%1").arg(anIndex);
- //Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
-
- if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
- aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- }
- else {
- aSelectedObject = aFindedObject; // get Object from study
- }
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
+
+ if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ }
+ else {
+ aSelectedObject = aFindedObject; // get Object from study
+ }
}
else { // Global Selection
if (aShape.ShapeType() != TopAbs_VERTEX) {
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
myPoint1 = aSelectedObject;
if (!myPoint1->_is_nil() && myPoint2->_is_nil())
- GroupPoints->PushButton2->click();
+ GroupPoints->PushButton2->click();
}
else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
myPoint2 = aSelectedObject;
if (!myPoint2->_is_nil() && myPoint1->_is_nil())
- GroupPoints->PushButton1->click();
+ GroupPoints->PushButton1->click();
}
}
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
this, SLOT( SelectionIntoArgument() ) );
-
+
ConstructorsClicked( getConstructorId() );
}
// TRUE to construct a modal dialog.
//=================================================================================
BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
connect( myReverseCB, SIGNAL( clicked() ), this, SLOT( onReverse() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_WPLANE" ) );
if ( myEditCurrentArgument == Group1->LineEdit1 )
myFace = aSelectedObject;
else if ( myEditCurrentArgument == Group2->LineEdit1 ||
- myEditCurrentArgument == Group2->LineEdit2 ) {
+ myEditCurrentArgument == Group2->LineEdit2 ) {
if ( aRes && !aSelectedObject->_is_nil() ) {
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
int anIndex = aMap( 1 );
aName = aName + ":edge_" + QString::number( anIndex );
- GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations( getStudyId() );
- if ( myEditCurrentArgument == Group2->LineEdit1 )
- myVectX = aShapesOp->GetSubShape( aSelectedObject, anIndex );
- else
- myVectZ = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ GEOM::GEOM_IShapesOperations_var aShapesOp =
+ getGeomEngine()->GetIShapesOperations( getStudyId() );
+ if ( myEditCurrentArgument == Group2->LineEdit1 )
+ myVectX = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ else
+ myVectZ = aShapesOp->GetSubShape( aSelectedObject, anIndex );
}
else {
- if ( aShape.ShapeType() != TopAbs_EDGE ) {
- aSelectedObject = GEOM::GEOM_Object::_nil();
- aName = "";
- }
+ if ( aShape.ShapeType() != TopAbs_EDGE ) {
+ aSelectedObject = GEOM::GEOM_Object::_nil();
+ aName = "";
+ }
}
aSelMgr->clearSelected();
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( ) ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
if ( id == 0 ) { // by planar face selection
if ( CORBA::is_nil( myFace ) ) {
if ( !showPreview )
- showError( "Face has to be selected" );
+ showError( "Face has to be selected" );
return false;
}
}
else {
if ( !showPreview )
- showError( "Wrong shape selected (has to be a planar face)" );
+ showError( "Wrong shape selected (has to be a planar face)" );
return false;
}
}
else if ( id == 1 ) { // by two vectors (Ox & Oz)
if ( CORBA::is_nil( myVectX ) || CORBA::is_nil( myVectZ ) ) {
if ( !showPreview )
- showError( "Two vectors have to be selected" );
+ showError( "Two vectors have to be selected" );
return false;
}
gp_Vec aVX, aVZ;
if ( !GEOMBase::GetShape( myVectX, aVectX, TopAbs_EDGE ) ||
- !GEOMBase::GetShape( myVectZ, aVectZ, TopAbs_EDGE ) ) {
+ !GEOMBase::GetShape( myVectZ, aVectZ, TopAbs_EDGE ) ) {
if ( !showPreview )
- showError( "Wrong shape selected (two vectors(edges) have to be selected)" );
+ showError( "Wrong shape selected (two vectors(edges) have to be selected)" );
return false;
}
if ( VX1.IsNull() || VX2.IsNull() ) {
if ( !showPreview )
- showError( "Bad OX vector" );
+ showError( "Bad OX vector" );
return false;
}
if ( VZ1.IsNull() || VZ2.IsNull() ) {
if ( !showPreview )
- showError( "Bad OZ vector" );
+ showError( "Bad OZ vector" );
return false;
}
if ( aVX.Magnitude() < Precision::Confusion() ) {
if ( !showPreview )
- showError( "Bad OX vector" );
+ showError( "Bad OX vector" );
return false;
}
if ( aVZ.Magnitude() < Precision::Confusion() ) {
if ( !showPreview )
- showError( "Bad OZ vector" );
+ showError( "Bad OZ vector" );
return false;
}
if ( aDirX.IsParallel( aDirZ, Precision::Angular() ) ) {
if ( !showPreview )
- showError( "Parallel vectors selected" );
+ showError( "Parallel vectors selected" );
return false;
}
connect( myGrp1->CheckBox1, SIGNAL( stateChanged( int ) ), this, SLOT( SubShapeToggled() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
myConstructorId = -1;
ConstructorsClicked( 0 );
// More than 30 subshapes : ask confirmation
if ( myNbBlocks > 30 ) {
if ( SUIT_MessageBox::warning( this,
- tr( "GEOM_CONFIRM" ),
- tr( "GEOM_CONFIRM_INFO" ).arg( myNbBlocks ),
- tr( "GEOM_BUT_EXPLODE" ),
- tr( "GEOM_BUT_CANCEL" ) ) != 0 )
+ tr( "GEOM_CONFIRM" ),
+ tr( "GEOM_CONFIRM_INFO" ).arg( myNbBlocks ),
+ tr( "GEOM_BUT_EXPLODE" ),
+ tr( "GEOM_BUT_CANCEL" ) ) != 0 )
return false; /* aborted */
}
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
activateSelection();
}
if ( isAllSubShapes() ) { // Sub-shapes selection disabled
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection( GEOM_ALLSHAPES );
if ( myObject->_is_nil() ) {
SelectionIntoArgument();
}
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
}
else {
displayPreview( true, true, false );
else {
GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
bool isOnlyBlocks = anOper->IsCompoundOfBlocks( myObject,
- myGrp1->SpinBox1->value(),
- myGrp1->SpinBox2->value(),
- myNbBlocks );
+ myGrp1->SpinBox1->value(),
+ myGrp1->SpinBox2->value(),
+ myNbBlocks );
if ( isOnlyBlocks )
myGrp1->TextBrowser1->setText( tr( "GEOM_NB_BLOCKS_NO_OTHERS" ).arg( myNbBlocks ) );
else
switch ( getConstructorId() ) {
case 0:
aList = anOper->ExplodeCompoundOfBlocks( myObject,
- myGrp1->SpinBox1->value(),
- myGrp1->SpinBox2->value() );
+ myGrp1->SpinBox1->value(),
+ myGrp1->SpinBox2->value() );
break;
}
CORBA::String_var objStr = myGeomGUI->getApp()->orb()->object_to_string( *anIter );
if ( selected.contains( QString( objStr.in() ) ) )
{
- if ( !IsPreview() )
+ if ( !IsPreview() )
(*anIter)->SetParameters(aParameters.join(":").toLatin1().constData());
objects.push_back( *anIter );
}
SelectionIntoArgument();
}
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
}
//================================================================
switch (getConstructorId()) {
case 0:
anObj = anOper->MakeMultiTransformation1D(myShape,
- myFaces[Face1], myFaces[Face2],
- mySpinBox[SpinBox1]->value());
+ myFaces[Face1], myFaces[Face2],
+ mySpinBox[SpinBox1]->value());
if (!anObj->_is_nil() && !IsPreview())
{
QStringList aParameters;
break;
case 1:
anObj = anOper->MakeMultiTransformation2D (myShape,
- myFaces[Face1U], myFaces[Face2U],
- mySpinBox[SpinBox2U]->value(),
- myFaces[Face1V], myFaces[Face2V],
- mySpinBox[SpinBox2V]->value());
+ myFaces[Face1U], myFaces[Face2U],
+ mySpinBox[SpinBox2U]->value(),
+ myFaces[Face1V], myFaces[Face2V],
+ mySpinBox[SpinBox2V]->value());
if (!anObj->_is_nil() && !IsPreview())
{
QStringList aParameters;
{
getGeometryGUI()->EmitSignalDeactivateDialog();
- int anOperation = 0;
+ int anOperation = 0;
if ( theCommandID == 5011 )
anOperation = FUSE;
else if ( theCommandID == 5012 )
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
displayPreview();
}
public:
BooleanGUI_Dialog( const int, GeometryGUI*, QWidget* = 0,
- bool = false, Qt::WindowFlags = 0 );
+ bool = false, Qt::WindowFlags = 0 );
~BooleanGUI_Dialog();
protected:
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( GroupShapes->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( ( (SalomeApp_Application*)(SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL(currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL(currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection( GEOM_ALLSHAPES );
GEOMBase_Skeleton::ActivateThisDialog();
globalSelection( GEOM_ALLSHAPES );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
}
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
- /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame
- /*theInheritFirstArg=*/false );
+ /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame
+ /*theInheritFirstArg=*/false );
}
}
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
displayPreview();
}
connect( GroupWire->LineEdit1, SIGNAL( returnPressed()), this, SLOT( LineEditReturnPressed() ) );
connect( GroupWire->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_FACE" ) );
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_EDGE );
aMap.Add( GEOM_WIRE );
connect( GroupShell->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_SHELL" ) );
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_SHELL );
aMap.Add( GEOM_FACE );
connect( GroupSolid->CheckButton1, SIGNAL( toggled( bool ) ), this, SLOT( EnableNameField( bool ) ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_SOLID" ) );
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection( GEOM_SHELL );
}
private:
GEOM::ListOfGO myShells;
bool myOkShells; /* to check when arguments is defined and
- all shells are closed */
+ all shells are closed */
DlgRef_1Sel1Check* GroupSolid;
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( GroupArgs->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_WIRE" ) );
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_WIRE );
aMap.Add( GEOM_EDGE );
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
SUIT_ViewManager* vman = vw->getViewManager();
if ( vman->getType() == OCCViewer_Viewer::Type() ||
- vman->getType() == SVTK_Viewer::Type() ) {
- GEOM_Displayer( appStudy ).EraseAll();
+ vman->getType() == SVTK_Viewer::Type() ) {
+ GEOM_Displayer( appStudy ).EraseAll();
}
}
}
if ( anIObject->hasEntry() ) {
_PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
- _PTR(SComponent) SC ( SO->GetFatherComponent() );
- // if component is selected
- listIO.Clear();
- _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
- anIter->InitEx( true );
- while( anIter->More() ) {
- _PTR(SObject) valSO ( anIter->Value() );
- _PTR(SObject) refSO;
- if ( !valSO->ReferencedObject( refSO ) ) {
- listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
+ _PTR(SComponent) SC ( SO->GetFatherComponent() );
+ // if component is selected
+ listIO.Clear();
+ _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
+ anIter->InitEx( true );
+ while( anIter->More() ) {
+ _PTR(SObject) valSO ( anIter->Value() );
+ _PTR(SObject) refSO;
+ if ( !valSO->ReferencedObject( refSO ) ) {
+ listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
SC->ComponentDataType().c_str(),
valSO->GetName().c_str()) );
- }
- anIter->Next();
- }
- break;
+ }
+ anIter->Next();
+ }
+ break;
}
else {
- listIO.Append( anIObject );
+ listIO.Append( anIObject );
}
}
else {
if ( anIObject->hasEntry() ) {
_PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
- _PTR(SComponent) SC ( SO->GetFatherComponent() );
- // if component is selected
- listIO.Clear();
- _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
- anIter->InitEx( true );
- while( anIter->More() ) {
- _PTR(SObject) valSO ( anIter->Value() );
- _PTR(SObject) refSO;
- if ( !valSO->ReferencedObject( refSO ) ) {
- listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
+ _PTR(SComponent) SC ( SO->GetFatherComponent() );
+ // if component is selected
+ listIO.Clear();
+ _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
+ anIter->InitEx( true );
+ while( anIter->More() ) {
+ _PTR(SObject) valSO ( anIter->Value() );
+ _PTR(SObject) refSO;
+ if ( !valSO->ReferencedObject( refSO ) ) {
+ listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
SC->ComponentDataType().c_str(),
valSO->GetName().c_str()) );
- }
- anIter->Next();
- }
- break;
+ }
+ anIter->Next();
+ }
+ break;
}
else {
- listIO.Append( anIObject );
+ listIO.Append( anIObject );
}
}
else {
AIS_ListIteratorOfListOfInteractive ite( List );
while( ite.More() ) {
if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
- Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( ite.Value() );
- ic->SetDisplayMode( aSh, Standard_Integer( newmode ),true );
+ Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( ite.Value() );
+ ic->SetDisplayMode( aSh, Standard_Integer( newmode ),true );
}
ite.Next();
}
allActors->InitTraversal();
while (vtkActor* actor = allActors->GetNextActor()) {
if (actor->GetVisibility()) { // only for visible actors
- GEOM_Actor* aGeomActor = 0;
- if ( actor->IsA( "GEOM_Actor" ) ) {
- aGeomActor = GEOM_Actor::SafeDownCast( actor );
- if ( aGeomActor )
- aGeomActor->SetVectorMode( mode );
- }
+ GEOM_Actor* aGeomActor = 0;
+ if ( actor->IsA( "GEOM_Actor" ) ) {
+ aGeomActor = GEOM_Actor::SafeDownCast( actor );
+ if ( aGeomActor )
+ aGeomActor->SetVectorMode( mode );
+ }
}
}
}
AIS_ListIteratorOfListOfInteractive ite( List );
while( ite.More() ) {
if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
- Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( ite.Value() );
- aSh->SetDisplayVectors(mode);
- ic->RecomputePrsOnly(ite.Value());
+ Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( ite.Value() );
+ aSh->SetDisplayVectors(mode);
+ ic->RecomputePrsOnly(ite.Value());
}
ite.Next();
}
int row, col, rowspan, colspan;
gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
if ( w && row >= fromRow && row <= toRow )
- w->setVisible( toShow );
+ w->setVisible( toShow );
}
}
}
int row, col, rowspan, colspan;
gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
if ( w && row >= fromRow && row <= toRow )
- w->setVisible( toShow );
+ w->setVisible( toShow );
}
}
}
int row, col, rowspan, colspan;
gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
if ( w && row >= fromRow && row <= toRow )
- w->setVisible( toShow );
+ w->setVisible( toShow );
}
}
}
double v = aRes.toDouble();
double err = qAbs( theValue - v );
if ( err > 0 && err <= prec )
- break;
+ break;
}
}
#include "ui_DlgRef_1List1Spin1Btn_QTD.h"
class DLGREF_EXPORT DlgRef_1List1Spin1Btn : public QWidget,
- public Ui::DlgRef_1List1Spin1Btn_QTD
+ public Ui::DlgRef_1List1Spin1Btn_QTD
{
Q_OBJECT
#include "ui_DlgRef_1Sel1Check1List_QTD.h"
class DLGREF_EXPORT DlgRef_1Sel1Check1List : public QWidget,
- public Ui::DlgRef_1Sel1Check1List_QTD
+ public Ui::DlgRef_1Sel1Check1List_QTD
{
Q_OBJECT
#include "ui_DlgRef_1Sel1Check1Sel_QTD.h"
class DLGREF_EXPORT DlgRef_1Sel1Check1Sel : public QWidget,
- public Ui::DlgRef_1Sel1Check1Sel_QTD
+ public Ui::DlgRef_1Sel1Check1Sel_QTD
{
Q_OBJECT
#include "ui_DlgRef_1Sel1Check_QTD.h"
class DLGREF_EXPORT DlgRef_1Sel1Check : public QWidget,
- public Ui::DlgRef_1Sel1Check_QTD
+ public Ui::DlgRef_1Sel1Check_QTD
{
Q_OBJECT
#include "ui_DlgRef_1Sel1List1Check3Btn_QTD.h"
class DLGREF_EXPORT DlgRef_1Sel1List1Check3Btn : public QWidget,
- public Ui::DlgRef_1Sel1List1Check3Btn_QTD
+ public Ui::DlgRef_1Sel1List1Check3Btn_QTD
{
Q_OBJECT
#include "ui_DlgRef_1Sel1Spin1Check_QTD.h"
class DLGREF_EXPORT DlgRef_1Sel1Spin1Check : public QWidget,
- public Ui::DlgRef_1Sel1Spin1Check_QTD
+ public Ui::DlgRef_1Sel1Spin1Check_QTD
{
Q_OBJECT
#include "ui_DlgRef_1Sel1Spin_QTD.h"
class DLGREF_EXPORT DlgRef_1Sel1Spin : public QWidget,
- public Ui::DlgRef_1Sel1Spin_QTD
+ public Ui::DlgRef_1Sel1Spin_QTD
{
Q_OBJECT
if ( SO->FindAttribute( anAttr, "AttributeIOR" ) ) {
_PTR(AttributeIOR) anIOR ( anAttr );
if ( strcmp( anIOR->Value().c_str(), IOR ) == 0 )
- return true;
+ return true;
}
if ( SO->ReferencedObject( RefSO ) ) {
if ( RefSO->FindAttribute( anAttr, "AttributeIOR" ) ) {
_PTR(AttributeIOR) anIOR ( anAttr );
- if ( strcmp( anIOR->Value().c_str(), IOR ) == 0 )
- return true;
+ if ( strcmp( anIOR->Value().c_str(), IOR ) == 0 )
+ return true;
}
}
}
// TRUE to construct a modal dialog.
//=================================================================================
EntityGUI_3DSketcherDlg::EntityGUI_3DSketcherDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl,
- const double lineWidth )
+ bool modal, Qt::WindowFlags fl,
+ const double lineWidth )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl ),
myGeometryGUI( theGeometryGUI ),
myLineWidth( lineWidth )
if (!CORBA::is_nil(aSelectedObject) && aRes) {
TopoDS_Shape aShape;
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE)) { // Explore the shape if its a local selection
- TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes(aSelList.First(), aMap);
- if (aMap.Extent() == 1)
- {
- int anIndex = aMap(1);
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
- aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- }
+ TColStd_IndexedMapOfInteger aMap;
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
+ if (aMap.Extent() == 1)
+ {
+ int anIndex = aMap(1);
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ }
}
bool isOk = true;
if ( aShape.ShapeType() != TopAbs_VERTEX )
- isOk = GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_VERTEX);
+ isOk = GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_VERTEX);
if (isOk) {
- gp_Pnt aPnt;
- if ( GEOMBase::VertexToPoint( aShape, aPnt ) ) {
- // set coordinates to the Spin Boxes
- double aX, aY, aZ;
- aX = aPnt.X();
- aY = aPnt.Y();
- aZ = aPnt.Z();
- bool blocked = Group3Spin->SpinBox_DX->signalsBlocked();
- Group3Spin->SpinBox_DX->blockSignals(true);
- Group3Spin->SpinBox_DY->blockSignals(true);
- Group3Spin->SpinBox_DZ->blockSignals(true);
- if ( GroupType->RadioButton1->isChecked() ) {
- Group3Spin->SpinBox_DX->setValue( aX );
- Group3Spin->SpinBox_DY->setValue( aY );
- Group3Spin->SpinBox_DZ->setValue( aZ );
- } else if ( GroupType->RadioButton2->isChecked() ) {
- double x, y, z;
- GetLastPoints(x, y, z);
- Group3Spin->SpinBox_DX->setValue( aX - x );
- Group3Spin->SpinBox_DY->setValue( aY - y );
- Group3Spin->SpinBox_DZ->setValue( aZ - z );
- }
- Group3Spin->SpinBox_DX->blockSignals(blocked);
- Group3Spin->SpinBox_DY->blockSignals(blocked);
- Group3Spin->SpinBox_DZ->blockSignals(blocked);
- }
+ gp_Pnt aPnt;
+ if ( GEOMBase::VertexToPoint( aShape, aPnt ) ) {
+ // set coordinates to the Spin Boxes
+ double aX, aY, aZ;
+ aX = aPnt.X();
+ aY = aPnt.Y();
+ aZ = aPnt.Z();
+ bool blocked = Group3Spin->SpinBox_DX->signalsBlocked();
+ Group3Spin->SpinBox_DX->blockSignals(true);
+ Group3Spin->SpinBox_DY->blockSignals(true);
+ Group3Spin->SpinBox_DZ->blockSignals(true);
+ if ( GroupType->RadioButton1->isChecked() ) {
+ Group3Spin->SpinBox_DX->setValue( aX );
+ Group3Spin->SpinBox_DY->setValue( aY );
+ Group3Spin->SpinBox_DZ->setValue( aZ );
+ } else if ( GroupType->RadioButton2->isChecked() ) {
+ double x, y, z;
+ GetLastPoints(x, y, z);
+ Group3Spin->SpinBox_DX->setValue( aX - x );
+ Group3Spin->SpinBox_DY->setValue( aY - y );
+ Group3Spin->SpinBox_DZ->setValue( aZ - z );
+ }
+ Group3Spin->SpinBox_DX->blockSignals(blocked);
+ Group3Spin->SpinBox_DY->blockSignals(blocked);
+ Group3Spin->SpinBox_DZ->blockSignals(blocked);
+ }
}
}
}
myGeomGUI->SetActiveDialogBox( this );
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GEOMBase_Helper::displayPreview( false, true, true, myLineWidth );
//=================================================================================
void EntityGUI_3DSketcherDlg::initSpinBox( QDoubleSpinBox* spinBox,
- double min, double max,
- double step, int decimals )
+ double min, double max,
+ double step, int decimals )
{
spinBox->setDecimals( decimals );
spinBox->setRange( min, max );
// Redefined from GEOMBase_Helper.
//================================================================
void EntityGUI_3DSketcherDlg::displayPreview( GEOM::GEOM_Object_ptr object,
- const bool append,
- const bool activate,
- const bool update,
- const double lineWidth,
- const int displayMode,
- const int color )
+ const bool append,
+ const bool activate,
+ const bool update,
+ const double lineWidth,
+ const int displayMode,
+ const int color )
{
// Set color for preview shape
getDisplayer()->SetColor( Quantity_NOC_RED );
// Purpose : Create applyed wire, and last segment from entry object
//================================================================
bool EntityGUI_3DSketcherDlg::createShapes( GEOM::GEOM_Object_ptr theObject,
- TopoDS_Shape& theApplyedWire,
- TopoDS_Shape& theLastSegment )
+ TopoDS_Shape& theApplyedWire,
+ TopoDS_Shape& theLastSegment )
{
TopoDS_Shape aShape;
if ( !GEOMBase::GetShape( theObject, aShape ) ||
protected:
void initSpinBox( QDoubleSpinBox*,
- double, double, double = 0.1,
- int = 3 );
+ double, double, double = 0.1,
+ int = 3 );
// redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation();
void enterEvent( QEvent* );
virtual void displayPreview( GEOM::GEOM_Object_ptr,
- const bool = false,
- const bool = false,
- const bool = true,
- const double = -1,
- const int = -1,
- const int = -1);
+ const bool = false,
+ const bool = false,
+ const bool = true,
+ const double = -1,
+ const int = -1,
+ const int = -1);
bool createShapes( GEOM::GEOM_Object_ptr,
- TopoDS_Shape&,
- TopoDS_Shape& );
+ TopoDS_Shape&,
+ TopoDS_Shape& );
private:
QList<double> myPointsList;
// TRUE to construct a modal dialog.
//=================================================================================
EntityGUI_SketcherDlg::EntityGUI_SketcherDlg( GeometryGUI* GUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl,
- const double lineWidth )
+ bool modal, Qt::WindowFlags fl,
+ const double lineWidth )
: QDialog( parent, fl ),
myIsAllAdded( false ),
myIsApply( false ),
mySketchType = PT_SEL;
myEditCurrentArgument = Group1Sel->LineEdit1;
connect( myGeometryGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
Group1Sel->show();
Group1Sel->buttonApply->setFocus();
SelectionIntoArgument();
Group2Spin->show();
if ( constructorId == 2 ) { // Length
- mySketchType = DIR_ANGLE_LENGTH;
- Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_LENGTH2" ) );
- Group2Spin->SpinBox_DY->setValue( myLength );
+ mySketchType = DIR_ANGLE_LENGTH;
+ Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_LENGTH2" ) );
+ Group2Spin->SpinBox_DY->setValue( myLength );
}
else if ( constructorId == 0 ) { // X
- mySketchType = DIR_ANGLE_X;
- Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_X3" ) );
- Group2Spin->SpinBox_DY->setValue( myX );
+ mySketchType = DIR_ANGLE_X;
+ Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_X3" ) );
+ Group2Spin->SpinBox_DY->setValue( myX );
}
else if ( constructorId == 1 ) { // Y
- mySketchType = DIR_ANGLE_Y;
- Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_Y3" ) );
- Group2Spin->SpinBox_DY->setValue( myY );
+ mySketchType = DIR_ANGLE_Y;
+ Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_Y3" ) );
+ Group2Spin->SpinBox_DY->setValue( myY );
}
}
else if ( myConstructorDirId == 0 ) { // Perpendicular
Group1Spin->buttonApply->setFocus();
if ( constructorId == 2 ) { // Length
- mySketchType = DIR_PER_LENGTH;
- Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_LENGTH2" ) );
- Group1Spin->SpinBox_DX->setValue( myLength );
+ mySketchType = DIR_PER_LENGTH;
+ Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_LENGTH2" ) );
+ Group1Spin->SpinBox_DX->setValue( myLength );
}
else if ( constructorId == 0 ) { // X
- mySketchType = DIR_PER_X;
- Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_X3" ) );
- Group1Spin->SpinBox_DX->setValue( myX );
+ mySketchType = DIR_PER_X;
+ Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_X3" ) );
+ Group1Spin->SpinBox_DX->setValue( myX );
}
else if ( constructorId == 1 ) { // Y
- mySketchType = DIR_PER_Y;
- Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_Y3" ) );
- Group1Spin->SpinBox_DX->setValue( myY );
+ mySketchType = DIR_PER_Y;
+ Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_Y3" ) );
+ Group1Spin->SpinBox_DX->setValue( myY );
}
}
else if ( myConstructorDirId == 1 ) { // Tangent
Group1Spin->buttonApply->setFocus();
if ( constructorId == 2 ) { // Length
- mySketchType = DIR_TAN_LENGTH;
- Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_LENGTH2" ) );
- Group1Spin->SpinBox_DX->setValue( myLength );
+ mySketchType = DIR_TAN_LENGTH;
+ Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_LENGTH2" ) );
+ Group1Spin->SpinBox_DX->setValue( myLength );
}
else if ( constructorId == 0 ) { // X
- mySketchType = DIR_TAN_X;
- Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_X3" ) );
- Group1Spin->SpinBox_DX->setValue( myX );
+ mySketchType = DIR_TAN_X;
+ Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_X3" ) );
+ Group1Spin->SpinBox_DX->setValue( myX );
}
else if ( constructorId == 1 ) { // Y
- mySketchType = DIR_TAN_Y;
- Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_Y3" ) );
- Group1Spin->SpinBox_DX->setValue( myY );
+ mySketchType = DIR_TAN_Y;
+ Group1Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_Y3" ) );
+ Group1Spin->SpinBox_DX->setValue( myY );
}
}
else if ( myConstructorDirId == 3 ) { // DXDY
Group3Spin->buttonApply->setFocus();
if ( constructorId == 2 ) { // Length
- mySketchType = DIR_DXDY_LENGTH;
- Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_LENGTH2" ) );
- Group3Spin->SpinBox_DZ->setValue( myLength );
+ mySketchType = DIR_DXDY_LENGTH;
+ Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_LENGTH2" ) );
+ Group3Spin->SpinBox_DZ->setValue( myLength );
}
else if ( constructorId == 0 ) { // X
- mySketchType = DIR_DXDY_X;
- Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_X3" ) );
- Group3Spin->SpinBox_DZ->setValue( myX );
+ mySketchType = DIR_DXDY_X;
+ Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_X3" ) );
+ Group3Spin->SpinBox_DZ->setValue( myX );
}
else if ( constructorId == 1 ) { // Y
- mySketchType = DIR_DXDY_Y;
- Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_Y3" ) );
- Group3Spin->SpinBox_DZ->setValue( myY );
+ mySketchType = DIR_DXDY_Y;
+ Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_Y3" ) );
+ Group3Spin->SpinBox_DZ->setValue( myY );
}
}
}
else if ( myConstructorId == 1 ) { // ARC
if ( myConstructorDirId == 2 ) { // Angle
if ( constructorId == 2 ) { // Length
- mySketchType = DIR_ANGLE_LENGTH;
- initSpinBox( Group3Spin->SpinBox_DX, COORD_MIN, COORD_MAX, 5., 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- initSpinBox( Group3Spin->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- initSpinBox( Group3Spin->SpinBox_DZ, COORD_MIN, COORD_MAX, 5., 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- Group3Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_ANGLE2" ) );
- Group3Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_RADIUS2" ) );
- Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_ANGLE2" ));
- Group3Spin->SpinBox_DX->setValue( myAngle );
- myRadius = 100.0;
- Group3Spin->SpinBox_DY->setValue( myRadius );
- myLength = 30.0;
- Group3Spin->SpinBox_DZ->setValue( myLength );
- Group3Spin->show();
- Group3Spin->buttonApply->setFocus();
+ mySketchType = DIR_ANGLE_LENGTH;
+ initSpinBox( Group3Spin->SpinBox_DX, COORD_MIN, COORD_MAX, 5., 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+ initSpinBox( Group3Spin->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+ initSpinBox( Group3Spin->SpinBox_DZ, COORD_MIN, COORD_MAX, 5., 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+ Group3Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_ANGLE2" ) );
+ Group3Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_RADIUS2" ) );
+ Group3Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_ANGLE2" ));
+ Group3Spin->SpinBox_DX->setValue( myAngle );
+ myRadius = 100.0;
+ Group3Spin->SpinBox_DY->setValue( myRadius );
+ myLength = 30.0;
+ Group3Spin->SpinBox_DZ->setValue( myLength );
+ Group3Spin->show();
+ Group3Spin->buttonApply->setFocus();
}
}
else if ( myConstructorDirId == 0 ) { // Perpendicular
if ( constructorId == 2 ) { // Length
- mySketchType = DIR_PER_LENGTH;
- initSpinBox( Group2Spin->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- initSpinBox( Group2Spin->SpinBox_DY, COORD_MIN, COORD_MAX, 5., 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- Group2Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_RADIUS2" ) );
- Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_ANGLE2" ) );
- myRadius = 100.0;
- Group2Spin->SpinBox_DX->setValue( myRadius );
- myLength = 30.0;
- Group2Spin->SpinBox_DY->setValue( myLength );
- Group2Spin->show();
- Group2Spin->buttonApply->setFocus();
+ mySketchType = DIR_PER_LENGTH;
+ initSpinBox( Group2Spin->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+ initSpinBox( Group2Spin->SpinBox_DY, COORD_MIN, COORD_MAX, 5., 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+ Group2Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_RADIUS2" ) );
+ Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_ANGLE2" ) );
+ myRadius = 100.0;
+ Group2Spin->SpinBox_DX->setValue( myRadius );
+ myLength = 30.0;
+ Group2Spin->SpinBox_DY->setValue( myLength );
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
}
}
else if ( myConstructorDirId == 1 ) { // Tangent
if ( constructorId == 2 ) { // Length
- mySketchType = DIR_TAN_LENGTH;
- initSpinBox( Group2Spin->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- initSpinBox( Group2Spin->SpinBox_DY, COORD_MIN, COORD_MAX, 5., 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
- Group2Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_RADIUS2" ) );
- Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_ANGLE2" ) );
- myRadius = 100.0;
- Group2Spin->SpinBox_DX->setValue( myRadius );
- myLength = 30.0;
- Group2Spin->SpinBox_DY->setValue( myLength );
- Group2Spin->show();
- Group2Spin->buttonApply->setFocus();
+ mySketchType = DIR_TAN_LENGTH;
+ initSpinBox( Group2Spin->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+ initSpinBox( Group2Spin->SpinBox_DY, COORD_MIN, COORD_MAX, 5., 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+ Group2Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_RADIUS2" ) );
+ Group2Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_ANGLE2" ) );
+ myRadius = 100.0;
+ Group2Spin->SpinBox_DX->setValue( myRadius );
+ myLength = 30.0;
+ Group2Spin->SpinBox_DY->setValue( myLength );
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
}
}
else if ( myConstructorDirId == 3 ) { // DXDY
if ( constructorId == 2 ) { // Length
- mySketchType = DIR_DXDY_LENGTH;
- Group4Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_VX2" ) );
- Group4Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_VY2" ) );
- Group4Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_RADIUS2" ) );
- Group4Spin->TextLabel4->setText( tr( "GEOM_SKETCHER_ANGLE2" ) );
- myDX = 0.0;
- Group4Spin->SpinBox_DX->setValue( myDX );
- myDY = 0.0;
- Group4Spin->SpinBox_DY->setValue( myDY );
- myRadius = 100.0;
- Group4Spin->SpinBox_DZ->setValue( myRadius );
- myLength = 30.0;
- Group4Spin->SpinBox_DS->setValue( myLength );
- Group4Spin->show();
- Group4Spin->buttonApply->setFocus();
+ mySketchType = DIR_DXDY_LENGTH;
+ Group4Spin->TextLabel1->setText( tr( "GEOM_SKETCHER_VX2" ) );
+ Group4Spin->TextLabel2->setText( tr( "GEOM_SKETCHER_VY2" ) );
+ Group4Spin->TextLabel3->setText( tr( "GEOM_SKETCHER_RADIUS2" ) );
+ Group4Spin->TextLabel4->setText( tr( "GEOM_SKETCHER_ANGLE2" ) );
+ myDX = 0.0;
+ Group4Spin->SpinBox_DX->setValue( myDX );
+ myDY = 0.0;
+ Group4Spin->SpinBox_DY->setValue( myDY );
+ myRadius = 100.0;
+ Group4Spin->SpinBox_DZ->setValue( myRadius );
+ myLength = 30.0;
+ Group4Spin->SpinBox_DS->setValue( myLength );
+ Group4Spin->show();
+ Group4Spin->buttonApply->setFocus();
}
}
}
// Verify validity of commands
if ( myCommand.count() <= 2 ) {
SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
- tr( "GEOM_ERROR_STATUS" ), tr( "CANNOT_CLOSE" ), tr( "BUT_OK" ) );
+ tr( "GEOM_ERROR_STATUS" ), tr( "CANNOT_CLOSE" ), tr( "BUT_OK" ) );
return;
}
else {
// PAL16008 (Sketcher Validation should be equal to Apply&Close)
if ( Group1Spin->buttonApply->isEnabled() && Group1Spin->isVisible() ||
- Group2Spin->buttonApply->isEnabled() && Group2Spin->isVisible() ||
- Group3Spin->buttonApply->isEnabled() && Group3Spin->isVisible() ||
- Group4Spin->buttonApply->isEnabled() && Group4Spin->isVisible() ||
- Group1Sel ->buttonApply->isEnabled() && Group1Sel->isVisible() ) {
+ Group2Spin->buttonApply->isEnabled() && Group2Spin->isVisible() ||
+ Group3Spin->buttonApply->isEnabled() && Group3Spin->isVisible() ||
+ Group4Spin->buttonApply->isEnabled() && Group4Spin->isVisible() ||
+ Group1Sel ->buttonApply->isEnabled() && Group1Sel->isVisible() ) {
ClickOnApply();
}
myIsAllAdded = true;
#endif
SUIT_MessageBox::warning( 0, QObject::tr( "WRN_WARNING" ),
- QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( myHelpFileName ),
- QObject::tr( "BUT_OK" ) );
+ QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( myHelpFileName ),
+ QObject::tr( "BUT_OK" ) );
}
}
if (!CORBA::is_nil(aSelectedObject) && aRes) {
TopoDS_Shape aShape;
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_VERTEX)) {
- gp_Trsf aTrans;
- gp_Ax3 aWPlane = GetActiveLocalCS();
+ gp_Trsf aTrans;
+ gp_Ax3 aWPlane = GetActiveLocalCS();
- aTrans.SetTransformation(aWPlane);
- BRepBuilderAPI_Transform aTransformation (aShape, aTrans, Standard_False);
- aShape = aTransformation.Shape();
+ aTrans.SetTransformation(aWPlane);
+ BRepBuilderAPI_Transform aTransformation (aShape, aTrans, Standard_False);
+ aShape = aTransformation.Shape();
- gp_Pnt aPnt;
+ gp_Pnt aPnt;
if ( GEOMBase::VertexToPoint( aShape, aPnt ) ) {
- myX = aPnt.X();
- myY = aPnt.Y();
- Group1Sel->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
- }
+ myX = aPnt.X();
+ myY = aPnt.Y();
+ Group1Sel->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
+ }
}
}
}
myGeometryGUI->SetActiveDialogBox( this );
connect( myGeometryGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
//myGeometryGUI->SetState( 0 );
globalSelection( GEOM_POINT );
TopoDS_Vertex V1, V2;
gp_Pnt pt;
if ( myShape1.ShapeType() == TopAbs_VERTEX ) {
- //the last shape is the first point
- pt = BRep_Tool::Pnt( TopoDS::Vertex( myShape1 ) );
- myLastX1 = pt.X();
- myLastY1 = pt.Y();
+ //the last shape is the first point
+ pt = BRep_Tool::Pnt( TopoDS::Vertex( myShape1 ) );
+ myLastX1 = pt.X();
+ myLastY1 = pt.Y();
}
else {
- TopExp::Vertices( TopoDS::Wire( myShape1 ), V1, V2 );
- pt = BRep_Tool::Pnt( V2 );
- myLastX1 = pt.X();
- myLastY1 = pt.Y();
+ TopExp::Vertices( TopoDS::Wire( myShape1 ), V1, V2 );
+ pt = BRep_Tool::Pnt( V2 );
+ myLastX1 = pt.X();
+ myLastY1 = pt.Y();
}
TopExp::Vertices( TopoDS::Wire( myShape2 ), V1, V2 );
pt = BRep_Tool::Pnt( V2 );
QString cmd;
if ( ( mySketchState != FIRST_POINT &&
- myLastX1 == myLastX2 && myLastY1 == myLastY2 ) || myIsAllAdded ) {
+ myLastX1 == myLastX2 && myLastY1 == myLastY2 ) || myIsAllAdded ) {
cmd = myCommand.join( "" );
if ( Group1Sel->isVisible() ) {
}
void EntityGUI_SketcherDlg::initSpinBox( SalomeApp_DoubleSpinBox* spinBox,
- double min, double max,
- double step, int decimals )
+ double min, double max,
+ double step, int decimals )
{
spinBox->setDecimals( decimals );
spinBox->setRange( min, max );
gp_Ax3 aLCS;
aLCS.Transform(aShape.Location().Transformation());
if (aShape.ShapeType() == TopAbs_FACE) {
- Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(aShape));
- if (!aGS.IsNull() && aGS->IsKind(STANDARD_TYPE(Geom_Plane))) {
- Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast(aGS);
- gp_Pln aPln = aGPlane->Pln();
- aLCS = aPln.Position();
- }
+ Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(aShape));
+ if (!aGS.IsNull() && aGS->IsKind(STANDARD_TYPE(Geom_Plane))) {
+ Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast(aGS);
+ gp_Pln aPln = aGPlane->Pln();
+ aLCS = aPln.Position();
+ }
}
myLCSList.push_back(aLCS);
}
public:
EntityGUI_SketcherDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0,
- const double = 2. );
+ const double = 2. );
~EntityGUI_SketcherDlg();
bool eventFilter (QObject* object, QEvent* event);
protected:
void initSpinBox( SalomeApp_DoubleSpinBox*,
- double, double, double = 0.1,
- int = 3 );
+ double, double, double = 0.1,
+ int = 3 );
// redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation();
QString GetNewCommand( QString& );
virtual void displayPreview( GEOM::GEOM_Object_ptr,
- const bool = false,
- const bool = false,
- const bool = true,
- const double = -1,
- const int = -1,
- const int = -1);
+ const bool = false,
+ const bool = false,
+ const bool = true,
+ const double = -1,
+ const int = -1,
+ const int = -1);
bool createShapes( GEOM::GEOM_Object_ptr,
- TopoDS_Shape&,
- TopoDS_Shape& );
+ TopoDS_Shape&,
+ TopoDS_Shape& );
private:
int myConstructorId;
enum SketchState { FIRST_POINT, NEXT_POINT };
enum SketchType { PT_ABS, PT_RELATIVE, PT_SEL,
- DIR_ANGLE_LENGTH, DIR_ANGLE_X, DIR_ANGLE_Y,
- DIR_PER_LENGTH, DIR_PER_X, DIR_PER_Y,
- DIR_TAN_LENGTH, DIR_TAN_X, DIR_TAN_Y,
- DIR_DXDY_LENGTH, DIR_DXDY_X, DIR_DXDY_Y };
+ DIR_ANGLE_LENGTH, DIR_ANGLE_X, DIR_ANGLE_Y,
+ DIR_PER_LENGTH, DIR_PER_X, DIR_PER_Y,
+ DIR_TAN_LENGTH, DIR_TAN_X, DIR_TAN_Y,
+ DIR_DXDY_LENGTH, DIR_DXDY_X, DIR_DXDY_Y };
private slots:
void ClickOnEnd();
// TRUE to construct a modal dialog.
//=================================================================================
EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SUBSHAPE" ) ) );
connect( GroupPoints->CheckButton1, SIGNAL( stateChanged( int ) ), this, SLOT( SubShapeToggled() ) );
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged( )), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged( )), this, SLOT( SelectionIntoArgument() ) );
updateButtonState();
resize(100,100);
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
SubShapeToggled();
updateButtonState();
}
// purpose :
//=================================================================================
unsigned int EntityGUI_SubShapeDlg::NumberOfSubShapes( const TopoDS_Shape& S,
- const int shapeType ) const
+ const int shapeType ) const
{
if ( S.IsNull() )
return 0;
if ( S.ShapeType() == TopAbs_COMPOUND &&
( TopAbs_ShapeEnum(shapeType) == TopAbs_SHAPE ||
- TopAbs_ShapeEnum(shapeType) == TopAbs_COMPSOLID ||
- TopAbs_ShapeEnum(shapeType) == TopAbs_COMPOUND ) ) {
+ TopAbs_ShapeEnum(shapeType) == TopAbs_COMPSOLID ||
+ TopAbs_ShapeEnum(shapeType) == TopAbs_COMPOUND ) ) {
TopoDS_Iterator It( S, Standard_True, Standard_True );
for ( ; It.More(); It.Next() ) {
if ( M.Add( It.Value() ) ) {
if ( TopAbs_ShapeEnum( shapeType ) == TopAbs_SHAPE ||
- TopAbs_ShapeEnum( shapeType ) == It.Value().ShapeType() ) {
+ TopAbs_ShapeEnum( shapeType ) == It.Value().ShapeType() ) {
index++;
}
}
if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
if (aResult && !anObj->_is_nil()) {
- TColStd_IndexedMapOfInteger aMapIndex;
- aSelMgr->GetIndexes(aSelList.First(), aMapIndex);
+ TColStd_IndexedMapOfInteger aMapIndex;
+ aSelMgr->GetIndexes(aSelList.First(), aMapIndex);
- GEOM::GEOM_ILocalOperations_var aLocOp =
- getGeomEngine()->GetILocalOperations(getStudyId());
+ GEOM::GEOM_ILocalOperations_var aLocOp =
+ getGeomEngine()->GetILocalOperations(getStudyId());
- for (int i = 0, n = aList->length(); i < n; i++)
- if (aMapIndex.Contains(aLocOp->GetSubShapeIndex(myObject, aList[i])))
- objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
+ for (int i = 0, n = aList->length(); i < n; i++)
+ if (aMapIndex.Contains(aLocOp->GetSubShapeIndex(myObject, aList[i])))
+ objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
}
}
}
void ResetStateOfDialog();
unsigned int NumberOfSubShapes( const TopoDS_Shape&,
- const int ) const;
+ const int ) const;
void updateButtonState();
bool isAllSubShapes() const;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: BlockFix.cxx
-// Created: Tue Dec 7 11:59:05 2004
-// Author: Pavel DURANDIN
+// File: BlockFix.cxx
+// Created: Tue Dec 7 11:59:05 2004
+// Author: Pavel DURANDIN
//
#include <BlockFix.hxx>
#include <TopoDS_Shape.hxx>
//
Standard_EXPORT friend Handle_Standard_Type& BlockFix_BlockFixAPI_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
private:
// Fields PRIVATE
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
static Handle_Standard_Type _aType = new Standard_Type("BlockFix_BlockFixAPI",
- sizeof(BlockFix_BlockFixAPI),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(BlockFix_BlockFixAPI),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
Standard_EXPORT friend Handle_Standard_Type& BlockFix_PeriodicSurfaceModifier_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("BlockFix_PeriodicSurfaceModifier",
- sizeof(BlockFix_PeriodicSurfaceModifier),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(BlockFix_PeriodicSurfaceModifier),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: BlockFix.cxx
-// Created: Tue Dec 7 11:59:05 2004
-// Author: Pavel DURANDIN
+// File: BlockFix.cxx
+// Created: Tue Dec 7 11:59:05 2004
+// Author: Pavel DURANDIN
//
#include <BlockFix_SphereSpaceModifier.ixx>
//
Standard_EXPORT friend Handle_Standard_Type& BlockFix_SphereSpaceModifier_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("BlockFix_SphereSpaceModifier",
- sizeof(BlockFix_SphereSpaceModifier),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(BlockFix_SphereSpaceModifier),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Algo.cxx
-// Created: Sat Dec 04 12:39:47 2004
-// Author: Peter KURNEV
-// <peter@PREFEX>
+// File: GEOMAlgo_Algo.cxx
+// Created: Sat Dec 04 12:39:47 2004
+// Author: Peter KURNEV
+// <peter@PREFEX>
//
#include <GEOMAlgo_Algo.ixx>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Builder.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_Builder.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_Builder.ixx>
aType=aS.ShapeType();
if (aType==theType) {
if (myImages.HasImage(aS)){
- const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
- aItIm.Initialize(aLSIm);
- for (; aItIm.More(); aItIm.Next()) {
- const TopoDS_Shape& aSIm=aItIm.Value();
- if (aM.Add(aSIm)) {
- aBB.Add(myShape, aSIm);
- }
- }
+ const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
+ aItIm.Initialize(aLSIm);
+ for (; aItIm.More(); aItIm.Next()) {
+ const TopoDS_Shape& aSIm=aItIm.Value();
+ if (aM.Add(aSIm)) {
+ aBB.Add(myShape, aSIm);
+ }
+ }
}
else {
- if (aM.Add(aS)) {
- aBB.Add(myShape, aS);
- }
+ if (aM.Add(aS)) {
+ aBB.Add(myShape, aS);
+ }
}
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_BuilderArea.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_BuilderArea.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_BuilderArea.ixx>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_BuilderFace.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_BuilderFace.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_BuilderFace.ixx>
static
Standard_Boolean IsGrowthWire(const TopoDS_Shape& ,
- const TopTools_IndexedMapOfShape& );
+ const TopTools_IndexedMapOfShape& );
static
Standard_Boolean IsInside(const TopoDS_Shape& ,
- const TopoDS_Shape& ,
- IntTools_PContext& );
+ const TopoDS_Shape& ,
+ IntTools_PContext& );
static
void MakeInternalWires(const TopTools_MapOfShape& ,
- TopTools_ListOfShape& );
+ TopTools_ListOfShape& );
//=======================================================================
//function :
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
if (!myShapesToAvoid.Contains(aE)) {
- TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
+ TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
}
else {
- int a=0;
+ int a=0;
}
}
aNbV=aMVE.Extent();
TopTools_ListOfShape& aLE=aMVE.ChangeFromKey(aV);
aNbE=aLE.Extent();
if (!aNbE) {
- continue;
+ continue;
}
//
const TopoDS_Edge& aE1=TopoDS::Edge(aLE.First());
if (aNbE==1) {
- if (BRep_Tool::Degenerated(aE1)) {
- continue;
- }
- if (aV.Orientation()==TopAbs_INTERNAL) {
- continue;
- }
- bFound=Standard_True;
- myShapesToAvoid.Add(aE1);
+ if (BRep_Tool::Degenerated(aE1)) {
+ continue;
+ }
+ if (aV.Orientation()==TopAbs_INTERNAL) {
+ continue;
+ }
+ bFound=Standard_True;
+ myShapesToAvoid.Add(aE1);
}
else if (aNbE==2) {
- const TopoDS_Edge& aE2=TopoDS::Edge(aLE.Last());
- if (aE2.IsSame(aE1)) {
- TopoDS_Vertex aV1x, aV2x;
- //
- TopExp::Vertices(aE1, aV1x, aV2x);
- if (aV1x.IsSame(aV2x)) {
- continue;
- }
- bFound=Standard_True;
- myShapesToAvoid.Add(aE1);
- myShapesToAvoid.Add(aE2);
- }
+ const TopoDS_Edge& aE2=TopoDS::Edge(aLE.Last());
+ if (aE2.IsSame(aE1)) {
+ TopoDS_Vertex aV1x, aV2x;
+ //
+ TopExp::Vertices(aE1, aV1x, aV2x);
+ if (aV1x.IsSame(aV2x)) {
+ continue;
+ }
+ bFound=Standard_True;
+ myShapesToAvoid.Add(aE1);
+ myShapesToAvoid.Add(aE2);
+ }
}
}// for (i=1; i<=aNbE; ++i) {
//
//
TopoDS_Iterator aItE(aE);
for (; aItE.More()&&bFlag; aItE.Next()) {
- const TopoDS_Vertex& aV = TopoDS::Vertex(aItE.Value());
- const TopTools_ListOfShape& aLE=aVEMap.FindFromKey(aV);
- aIt.Initialize(aLE);
- for (; aIt.More()&&bFlag; aIt.Next()) {
- const TopoDS_Shape& aEx=aIt.Value();
- if (aMAdded.Add(aEx)) {
- aBB.Add(aW, aEx);
- if(aMAdded.Extent()==aNbEA) {
- bFlag=!bFlag;
- }
- }
- }//for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Vertex& aV = TopoDS::Vertex(aItE.Value());
+ const TopTools_ListOfShape& aLE=aVEMap.FindFromKey(aV);
+ aIt.Initialize(aLE);
+ for (; aIt.More()&&bFlag; aIt.Next()) {
+ const TopoDS_Shape& aEx=aIt.Value();
+ if (aMAdded.Add(aEx)) {
+ aBB.Add(aW, aEx);
+ if(aMAdded.Extent()==aNbEA) {
+ bFlag=!bFlag;
+ }
+ }
+ }//for (; aIt.More(); aIt.Next()) {
}//for (; aItE.More(); aItE.Next()) {
}//for (; aItW.More(); aItW.Next()) {
myLoopsInternal.Append(aW);
bIsHole=GEOMAlgo_BuilderTools::IsHole(aWire, myFace);
//XX
if (bIsHole) {
- aHoleWires.Append(aWire);
- TopExp::MapShapes(aWire, TopAbs_EDGE, aMHE);
+ aHoleWires.Append(aWire);
+ TopExp::MapShapes(aWire, TopAbs_EDGE, aMHE);
}
else {
- // make a growth face from a wire
- TopoDS_Face aFace;
- aBB.MakeFace(aFace, aS, aLoc, aTol);
- aBB.Add (aFace, aWire);
- //
- aNewFaces.Append (aFace);
+ // make a growth face from a wire
+ TopoDS_Face aFace;
+ aBB.MakeFace(aFace, aS, aLoc, aTol);
+ aBB.Add (aFace, aWire);
+ //
+ aNewFaces.Append (aFace);
}
}
}
if (aInOutMap.IsBound(aHole)){
const TopoDS_Shape& aF=aInOutMap(aHole);
if (aMSH.IsBound(aF)) {
- TopTools_ListOfShape& aLH=aMSH.ChangeFind(aF);
- aLH.Append(aHole);
+ TopTools_ListOfShape& aLH=aMSH.ChangeFind(aF);
+ aLH.Append(aHole);
}
else {
- TopTools_ListOfShape aLH;
- aLH.Append(aHole);
- aMSH.Bind(aF, aLH);
+ TopTools_ListOfShape aLH;
+ aLH.Append(aHole);
+ aMSH.Bind(aF, aLH);
}
}
}// for (; aIt2.More(); aIt2.Next())
for (; aItME.More(); aItME.Next()) {
const TopoDS_Edge& aE=TopoDS::Edge(aItME.Key());
if (IsInside(aE, aF, myContext)) {
- aMEP.Add(aE);
+ aMEP.Add(aE);
}
}
//
//purpose :
//=======================================================================
void MakeInternalWires(const TopTools_MapOfShape& theME,
- TopTools_ListOfShape& theWires)
+ TopTools_ListOfShape& theWires)
{
TopTools_MapIteratorOfMapOfShape aItM;
TopTools_MapOfShape aAddedMap;
TopExp_Explorer aExp(aE, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aV =aExp.Current();
- const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aV);
- aItE.Initialize(aLE);
- for (; aItE.More(); aItE.Next()) {
- TopoDS_Shape aEL=aItE.Value();
- if (aAddedMap.Add(aEL)){
- aEL.Orientation(TopAbs_INTERNAL);
- aBB.Add(aW, aEL);
- }
- }
+ const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aV);
+ aItE.Initialize(aLE);
+ for (; aItE.More(); aItE.Next()) {
+ TopoDS_Shape aEL=aItE.Value();
+ if (aAddedMap.Add(aEL)){
+ aEL.Orientation(TopAbs_INTERNAL);
+ aBB.Add(aW, aEL);
+ }
+ }
}
}
theWires.Append(aW);
//purpose :
//=======================================================================
Standard_Boolean IsInside(const TopoDS_Shape& theHole,
- const TopoDS_Shape& theF2,
- IntTools_PContext& theContext)
+ const TopoDS_Shape& theF2,
+ IntTools_PContext& theContext)
{
Standard_Boolean bRet;
Standard_Real aT, aU, aV;
//purpose :
//=======================================================================
Standard_Boolean IsGrowthWire(const TopoDS_Shape& theWire,
- const TopTools_IndexedMapOfShape& theMHE)
+ const TopTools_IndexedMapOfShape& theMHE)
{
Standard_Boolean bRet;
TopoDS_Iterator aIt;
for(; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
if (theMHE.Contains(aE)) {
- return !bRet;
+ return !bRet;
}
}
}
//purpose :
//=======================================================================
Standard_Boolean IsInside(const TopoDS_Shape& theHole,
- const TopoDS_Shape& theF2,
- IntTools_PContext& theContext)
+ const TopoDS_Shape& theF2,
+ IntTools_PContext& theContext)
{
Standard_Real aT, aU, aV;
TopExp_Explorer aExp;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_BuilderShape.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_BuilderShape.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_BuilderShape.ixx>
//=======================================================================
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_BuilderSolid.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_BuilderSolid.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_BuilderSolid.ixx>
//
static
Standard_Boolean IsGrowthShell(const TopoDS_Shape& ,
- const TopTools_IndexedMapOfShape& );
+ const TopTools_IndexedMapOfShape& );
static
Standard_Boolean IsHole(const TopoDS_Shape& ,
- IntTools_PContext& );
+ IntTools_PContext& );
static
Standard_Boolean IsInside(const TopoDS_Shape& ,
- const TopoDS_Shape& ,
- IntTools_PContext& );
+ const TopoDS_Shape& ,
+ IntTools_PContext& );
static
void MakeInternalShells(const TopTools_MapOfShape& ,
- TopTools_ListOfShape& );
+ TopTools_ListOfShape& );
//modified by NIZNHY-PKV Tue Aug 5 15:06:50 2008f
static
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
if (!myShapesToAvoid.Contains(aF)) {
- TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
+ TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
}
else {
- int a=0;
+ int a=0;
}
}
aNbE=aMEF.Extent();
for (i=1; i<=aNbE; ++i) {
const TopoDS_Edge& aE=TopoDS::Edge(aMEF.FindKey(i));
if (BRep_Tool::Degenerated(aE)) {
- continue;
+ continue;
}
//
TopTools_ListOfShape& aLF=aMEF.ChangeFromKey(aE);
//
aNbF=aLF.Extent();
if (!aNbF) {
- continue;
+ continue;
}
//
aOrE=aE.Orientation();
//
const TopoDS_Face& aF1=TopoDS::Face(aLF.First());
if (aNbF==1) {
- if (aOrE==TopAbs_INTERNAL) {
- continue;
- }
- bFound=Standard_True;
- myShapesToAvoid.Add(aF1);
+ if (aOrE==TopAbs_INTERNAL) {
+ continue;
+ }
+ bFound=Standard_True;
+ myShapesToAvoid.Add(aF1);
}
else if (aNbF==2) {
- const TopoDS_Face& aF2=TopoDS::Face(aLF.Last());
- if (aF2.IsSame(aF1)) {
- if (BRep_Tool::IsClosed(aE, aF1)) {
- continue;
- }
- //
- if (aOrE==TopAbs_INTERNAL) {
- continue;
- }
- //
- bFound=Standard_True;
- myShapesToAvoid.Add(aF1);
- myShapesToAvoid.Add(aF2);
- }
+ const TopoDS_Face& aF2=TopoDS::Face(aLF.Last());
+ if (aF2.IsSame(aF1)) {
+ if (BRep_Tool::IsClosed(aE, aF1)) {
+ continue;
+ }
+ //
+ if (aOrE==TopAbs_INTERNAL) {
+ continue;
+ }
+ //
+ bFound=Standard_True;
+ myShapesToAvoid.Add(aF1);
+ myShapesToAvoid.Add(aF2);
+ }
}
//DEB
else {
- TopTools_ListIteratorOfListOfShape aItLF;
- //
- aItLF.Initialize (aLF);
- for (; aItLF.More(); aItLF.Next()) {
- const TopoDS_Shape& aFx=aItLF.Value();
- int a=0;
- }
+ TopTools_ListIteratorOfListOfShape aItLF;
+ //
+ aItLF.Initialize (aLF);
+ for (; aItLF.More(); aItLF.Next()) {
+ const TopoDS_Shape& aFx=aItLF.Value();
+ int a=0;
+ }
}
//DEB
}// for (i=1; i<=aNbE; ++i) {
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
for (; aEdgeExp.More(); aEdgeExp.Next()) {
const TopoDS_Edge& aE = TopoDS::Edge(aEdgeExp.Current());
- //
- //1
- if (aMEFP.Contains(aE)) {
- const TopTools_ListOfShape& aLFP=aMEFP.FindFromKey(aE);
- aNbFP=aLFP.Extent();
- if (aNbFP>1) {
- continue;
- }
- }
- //2
- anOr=aE.Orientation();
- if (anOr==TopAbs_INTERNAL) {
- continue;
- }
- //3
- if (BRep_Tool::Degenerated(aE)) {
- continue;
- }
- //
- // candidate faces list
+ //
+ //1
+ if (aMEFP.Contains(aE)) {
+ const TopTools_ListOfShape& aLFP=aMEFP.FindFromKey(aE);
+ aNbFP=aLFP.Extent();
+ if (aNbFP>1) {
+ continue;
+ }
+ }
+ //2
+ anOr=aE.Orientation();
+ if (anOr==TopAbs_INTERNAL) {
+ continue;
+ }
+ //3
+ if (BRep_Tool::Degenerated(aE)) {
+ continue;
+ }
+ //
+ // candidate faces list
const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE);
- aNbLF=aLF.Extent();
+ aNbLF=aLF.Extent();
if (!aNbLF) {
continue;
- }
- //
- // try to select one of neighbors
- // check if a face already added to Shell shares E
- Standard_Boolean bFound;
- TopTools_ListIteratorOfListOfShape aItLF;
- NMTTools_ListOfCoupleOfShape aLCSOff;
- //
- aItLF.Initialize(aLF);
- for (; aItLF.More(); aItLF.Next()) {
- const TopoDS_Face& aFL=TopoDS::Face(aItLF.Value());
- if (myShapesToAvoid.Contains(aFL)) {
- continue;
- }
- if (aF.IsSame(aFL)) {
- continue;
- }
- if (AddedFacesMap.Contains(aFL)){
- continue;
- }
- //
- bFound=GEOMAlgo_Tools3D::GetEdgeOff(aE, aFL, aEL);
- if (!bFound) {
- continue;
- }
- //
- aCSOff.SetShape1(aEL);
- aCSOff.SetShape2(aFL);
- aLCSOff.Append(aCSOff);
- }//for (; aItLF.More(); aItLF.Next()) {
- //
- aNbOff=aLCSOff.Extent();
- if (!aNbOff){
- continue;
- }
- //
- TopoDS_Face aSelF;
- if (aNbOff==1) {
- aSelF=TopoDS::Face(aLCSOff.First().Shape2());
- }
- else if (aNbOff>1){
- GEOMAlgo_Tools3D::GetFaceOff(aE, aF, aLCSOff, aSelF);
- }
- //
+ }
+ //
+ // try to select one of neighbors
+ // check if a face already added to Shell shares E
+ Standard_Boolean bFound;
+ TopTools_ListIteratorOfListOfShape aItLF;
+ NMTTools_ListOfCoupleOfShape aLCSOff;
+ //
+ aItLF.Initialize(aLF);
+ for (; aItLF.More(); aItLF.Next()) {
+ const TopoDS_Face& aFL=TopoDS::Face(aItLF.Value());
+ if (myShapesToAvoid.Contains(aFL)) {
+ continue;
+ }
+ if (aF.IsSame(aFL)) {
+ continue;
+ }
+ if (AddedFacesMap.Contains(aFL)){
+ continue;
+ }
+ //
+ bFound=GEOMAlgo_Tools3D::GetEdgeOff(aE, aFL, aEL);
+ if (!bFound) {
+ continue;
+ }
+ //
+ aCSOff.SetShape1(aEL);
+ aCSOff.SetShape2(aFL);
+ aLCSOff.Append(aCSOff);
+ }//for (; aItLF.More(); aItLF.Next()) {
+ //
+ aNbOff=aLCSOff.Extent();
+ if (!aNbOff){
+ continue;
+ }
+ //
+ TopoDS_Face aSelF;
+ if (aNbOff==1) {
+ aSelF=TopoDS::Face(aLCSOff.First().Shape2());
+ }
+ else if (aNbOff>1){
+ GEOMAlgo_Tools3D::GetFaceOff(aE, aF, aLCSOff, aSelF);
+ }
+ //
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
aBB.Add(aShell, aSelF);
- TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
- }
+ TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
+ }
} // for (; aEdgeExp.More(); aEdgeExp.Next()) {
} //for (; aItAddedF.More(); aItAddedF.Next()) {
//modified by NIZNHY-PKV Tue Aug 5 15:07:08 2008f
TopoDS_Iterator aItS;
aItS.Initialize(aShell);
for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aFs=aItS.Value();
- aMFP.Add(aFs);
+ const TopoDS_Shape& aFs=aItS.Value();
+ aMFP.Add(aFs);
}
}
*/
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
for (; aEdgeExp.More(); aEdgeExp.Next()) {
const TopoDS_Edge& aE = TopoDS::Edge(aEdgeExp.Current());
- const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE);
- aItF.Initialize(aLF);
- for (; aItF.More(); aItF.Next()) {
- const TopoDS_Face& aFL=TopoDS::Face(aItF.Value());
- if (AddedFacesMap.Add(aFL)){
- aBB.Add(aShell, aFL);
- }
- }
+ const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE);
+ aItF.Initialize(aLF);
+ for (; aItF.More(); aItF.Next()) {
+ const TopoDS_Face& aFL=TopoDS::Face(aItF.Value());
+ if (AddedFacesMap.Add(aFL)){
+ aBB.Add(aShell, aFL);
+ }
+ }
}
}
myLoopsInternal.Append(aShell);
//bIsHole=GEOMAlgo_BuilderTools::IsHole(aShell);
//XX
if (bIsHole) {
- aHoleShells.Append(aShell);
- TopExp::MapShapes(aShell, TopAbs_FACE, aMHF);
+ aHoleShells.Append(aShell);
+ TopExp::MapShapes(aShell, TopAbs_FACE, aMHF);
}
else {
- // make a growth solid from a shell
- TopoDS_Solid Solid;
- aBB.MakeSolid(Solid);
- aBB.Add (Solid, aShell);
- //
- aNewSolids.Append (Solid);
+ // make a growth solid from a shell
+ TopoDS_Solid Solid;
+ aBB.MakeSolid(Solid);
+ aBB.Add (Solid, aShell);
+ //
+ aNewSolids.Append (Solid);
}
}
}
if (aInOutMap.IsBound(aHole)){
const TopoDS_Shape& aSolid=aInOutMap(aHole);
if (aMSH.IsBound(aSolid)) {
- TopTools_ListOfShape& aLH=aMSH.ChangeFind(aSolid);
- aLH.Append(aHole);
+ TopTools_ListOfShape& aLH=aMSH.ChangeFind(aSolid);
+ aLH.Append(aHole);
}
else {
- TopTools_ListOfShape aLH;
- aLH.Append(aHole);
- aMSH.Bind(aSolid, aLH);
+ TopTools_ListOfShape aLH;
+ aLH.Append(aHole);
+ aMSH.Bind(aSolid, aLH);
}
//aBB.Add (aSolid, aHole);
}
for (; aItMF.More(); aItMF.Next()) {
const TopoDS_Face& aF=TopoDS::Face(aItMF.Key());
if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, *myContext)) {
- aMFP.Add(aF);
+ aMFP.Add(aF);
}
}
//
//purpose :
//=======================================================================
void MakeInternalShells(const TopTools_MapOfShape& theMF,
- TopTools_ListOfShape& theShells)
+ TopTools_ListOfShape& theShells)
{
TopTools_MapIteratorOfMapOfShape aItM;
TopTools_MapOfShape aAddedFacesMap;
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
for (; aEdgeExp.More(); aEdgeExp.Next()) {
const TopoDS_Shape& aE =aEdgeExp.Current();
- const TopTools_ListOfShape& aLF=aMEF.FindFromKey(aE);
- aItF.Initialize(aLF);
- for (; aItF.More(); aItF.Next()) {
- TopoDS_Shape aFL=aItF.Value();
- if (aAddedFacesMap.Add(aFL)){
- aFL.Orientation(TopAbs_INTERNAL);
- aBB.Add(aShell, aFL);
- }
- }
+ const TopTools_ListOfShape& aLF=aMEF.FindFromKey(aE);
+ aItF.Initialize(aLF);
+ for (; aItF.More(); aItF.Next()) {
+ TopoDS_Shape aFL=aItF.Value();
+ if (aAddedFacesMap.Add(aFL)){
+ aFL.Orientation(TopAbs_INTERNAL);
+ aBB.Add(aShell, aFL);
+ }
+ }
}
}
theShells.Append(aShell);
//purpose :
//=======================================================================
Standard_Boolean IsHole(const TopoDS_Shape& theS2,
- IntTools_PContext& theContext)
+ IntTools_PContext& theContext)
{
TopoDS_Solid *pS2=(TopoDS_Solid *)&theS2;
BRepClass3d_SolidClassifier& aClsf=theContext->SolidClassifier(*pS2);
//purpose :
//=======================================================================
Standard_Boolean IsInside(const TopoDS_Shape& theS1,
- const TopoDS_Shape& theS2,
- IntTools_PContext& theContext)
+ const TopoDS_Shape& theS2,
+ IntTools_PContext& theContext)
{
TopExp_Explorer aExp;
TopAbs_State aState;
//purpose :
//=======================================================================
Standard_Boolean IsGrowthShell(const TopoDS_Shape& theShell,
- const TopTools_IndexedMapOfShape& theMHF)
+ const TopTools_IndexedMapOfShape& theMHF)
{
Standard_Boolean bRet;
TopoDS_Iterator aIt;
for(; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
if (theMHF.Contains(aF)) {
- return !bRet;
+ return !bRet;
}
}
}
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE=TopoDS::Edge(aExp.Current());
if (BRep_Tool::Degenerated(aE)) {
- continue;
+ continue;
}
/*
if (BRep_Tool::IsClosed(aE, aF)) {
- continue;
+ continue;
}
*/
if (aE.Orientation()==TopAbs_INTERNAL) {
- continue;
+ continue;
}
if (!aM.Add(aE)) {
- aM.Remove(aE);
+ aM.Remove(aE);
}
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_BuilderTools.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_BuilderTools.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_BuilderTools.ixx>
static
Standard_Integer ComputeProps(const TopoDS_Face& aF,
- Standard_Real& aA,
- Standard_Real& aV);
+ Standard_Real& aA,
+ Standard_Real& aV);
static
void BuildTriangulation(const TopoDS_Face& aF);
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_BuilderTools::IsHole(const TopoDS_Shape& aW,
- const TopoDS_Shape& aFace)
+ const TopoDS_Shape& aFace)
{
Standard_Boolean bIsHole;
Standard_Integer i, aNbS;
const TopoDS_Edge& aE=TopoDS::Edge(aItW.Value());
aOr=aE.Orientation();
if (!(aOr==TopAbs_FORWARD ||
- aOr==TopAbs_REVERSED)) {
+ aOr==TopAbs_REVERSED)) {
continue;
}
//
//purpose :
//=======================================================================
Standard_Integer ComputeProps(const TopoDS_Face& aF,
- Standard_Real& aA,
- Standard_Real& aV)
+ Standard_Real& aA,
+ Standard_Real& aV)
{
Standard_Integer j, i, i1, i2, aNbNodes, aNbTrigs, n[3];
Standard_Real aAi, aVi;
Standard_Real aSx, aZx;
gp_Dir aDN(aVN);
if (aOr==TopAbs_REVERSED) {
- aDN.Reverse();
+ aDN.Reverse();
}
//
aSx=aAi*aDN.Z();
aDiscret=aCoeff*dMax;
//
BRepMesh_FastDiscret aMesher(aDiscret,
- aAngle,
- aBox,
- bWithShare,
- Standard_True,
- Standard_False,
- Standard_True);
+ aAngle,
+ aBox,
+ bWithShare,
+ Standard_True,
+ Standard_False,
+ Standard_True);
aMesher.Add(aF);
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Builder_1.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_Builder_1.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_Builder.hxx>
//
static
void FillImagesCompounds(const TopTools_MapOfShape& ,
- BRepAlgo_Image& );
+ BRepAlgo_Image& );
static
void FillImagesCompound(const TopoDS_Shape& ,
- BRepAlgo_Image& ,
- TopTools_MapOfShape& );
+ BRepAlgo_Image& ,
+ TopTools_MapOfShape& );
//=======================================================================
//function : FillImagesVertices
if (aV.ShapeType()==TopAbs_VERTEX) {
iV=pPF->FindSDVertex(i);
if (iV) {
- const TopoDS_Shape& aVSD=aDS.Shape(iV);
- if (!myImages.HasImage(aV)) {
- myImages.Bind(aV, aVSD);
- //
- mySameDomainShapes.Add(aV, aVSD);
- }
+ const TopoDS_Shape& aVSD=aDS.Shape(iV);
+ if (!myImages.HasImage(aV)) {
+ myImages.Bind(aV, aVSD);
+ //
+ mySameDomainShapes.Add(aV, aVSD);
+ }
}
}
}
//modified by NIZNHY-PKV Fri Nov 30 10:41:39 2007f
//if (aSpR.IsSame(aSp) && aSpR.IsSame(aE)) {
if (aSpR.IsSame(aSp) && aSpR.IsSame(aE) && !aIsCB) {
- //modified by NIZNHY-PKV Fri Nov 30 10:41:46 2007t
- continue;
+ //modified by NIZNHY-PKV Fri Nov 30 10:41:46 2007t
+ continue;
}
//
aESpR=TopoDS::Edge(aSpR);
bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aESpR, aEE, aCtx);
if (bToReverse) {
- aESpR.Reverse();
+ aESpR.Reverse();
}
aLSp.Append(aESpR);
//
aItLB.Initialize(aLB);
for (; aItLB.More(); aItLB.Next()) {
- nSpx=aItLB.Value();
- const TopoDS_Shape& aSpx=aDS.Shape(nSpx);
- mySameDomainShapes.Add(aSpx ,aSpR);
+ nSpx=aItLB.Value();
+ const TopoDS_Shape& aSpx=aDS.Shape(nSpx);
+ mySameDomainShapes.Add(aSpx ,aSpR);
}
//
//
else {
aIt.Initialize(aLPB);
for (; aIt.More(); aIt.Next()) {
- const BOPTools_PaveBlock& aPB=aIt.Value();
- //modified by NIZNHY-PKV Fri Nov 30 10:42:15 2007f
- //const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB);
- const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB, aIsCB);
- //modified by NIZNHY-PKV Fri Nov 30 10:42:20 2007t
- nSpR=aPBR.Edge();
- const TopoDS_Shape& aSpR=aDS.Shape(nSpR);
- //
- aESpR=TopoDS::Edge(aSpR);
- bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aESpR, aEE, aCtx);
- if (bToReverse) {
- aESpR.Reverse();
- }
- aLSp.Append(aESpR);
- //
- aItLB.Initialize(aLB);
- for (; aItLB.More(); aItLB.Next()) {
- nSpx=aItLB.Value();
- const TopoDS_Shape& aSpx=aDS.Shape(nSpx);
- mySameDomainShapes.Add(aSpx ,aSpR);
- }
- //
+ const BOPTools_PaveBlock& aPB=aIt.Value();
+ //modified by NIZNHY-PKV Fri Nov 30 10:42:15 2007f
+ //const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB);
+ const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB, aIsCB);
+ //modified by NIZNHY-PKV Fri Nov 30 10:42:20 2007t
+ nSpR=aPBR.Edge();
+ const TopoDS_Shape& aSpR=aDS.Shape(nSpR);
+ //
+ aESpR=TopoDS::Edge(aSpR);
+ bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aESpR, aEE, aCtx);
+ if (bToReverse) {
+ aESpR.Reverse();
+ }
+ aLSp.Append(aESpR);
+ //
+ aItLB.Initialize(aLB);
+ for (; aItLB.More(); aItLB.Next()) {
+ nSpx=aItLB.Value();
+ const TopoDS_Shape& aSpx=aDS.Shape(nSpx);
+ mySameDomainShapes.Add(aSpx ,aSpR);
+ }
+ //
}
}
//
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
if (myImages.HasImage(aF)) {
- bInterferred=!bInterferred;
- break;
+ bInterferred=!bInterferred;
+ break;
}
}
if (!bInterferred){
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
if (myImages.HasImage(aF)) {
- const TopTools_ListOfShape& aLFIm=myImages.Image(aF);
- aItIm.Initialize(aLFIm);
- for (; aItIm.More(); aItIm.Next()) {
- TopoDS_Shape aFIm=aItIm.Value();
- //
- bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFIm, aF, aCtx);
- if (bToReverse) {
- aFIm.Reverse();
- }
- aBB.Add(aCIm, aFIm);
- }
+ const TopTools_ListOfShape& aLFIm=myImages.Image(aF);
+ aItIm.Initialize(aLFIm);
+ for (; aItIm.More(); aItIm.Next()) {
+ TopoDS_Shape aFIm=aItIm.Value();
+ //
+ bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFIm, aF, aCtx);
+ if (bToReverse) {
+ aFIm.Reverse();
+ }
+ aBB.Add(aCIm, aFIm);
+ }
}
else {
- aBB.Add(aCIm, aF);
+ aBB.Add(aCIm, aF);
}
}
myImages.Bind(aC, aCIm);
// purpose:
//=======================================================================
void FillImagesCompounds(const TopTools_MapOfShape& theMS,
- BRepAlgo_Image& theImages)
+ BRepAlgo_Image& theImages)
{
TopTools_MapOfShape aMFP;
TopTools_MapIteratorOfMapOfShape aItS;
//purpose :
//=======================================================================
void FillImagesCompound(const TopoDS_Shape& theS,
- BRepAlgo_Image& theImages,
- TopTools_MapOfShape& theMFP)
+ BRepAlgo_Image& theImages,
+ TopTools_MapOfShape& theMFP)
{
Standard_Boolean bInterferred;
TopAbs_ShapeEnum aTypeX;
const TopTools_ListOfShape& aLFIm=theImages.Image(aSX);
aItIm.Initialize(aLFIm);
for (; aItIm.More(); aItIm.Next()) {
- TopoDS_Shape aSXIm=aItIm.Value();
- aSXIm.Orientation(aOrX);
- aBB.Add(aCIm, aSXIm);
+ TopoDS_Shape aSXIm=aItIm.Value();
+ aSXIm.Orientation(aOrX);
+ aBB.Add(aCIm, aSXIm);
}
}
else {
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Builder_2.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_Builder_2.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_Builder.hxx>
static
void UpdateCandidates(const Standard_Integer ,
- const Standard_Integer ,
- NMTTools_IndexedDataMapOfIndexedMapOfInteger& );
+ const Standard_Integer ,
+ NMTTools_IndexedDataMapOfIndexedMapOfInteger& );
//=======================================================================
//function : FillImagesFaces
NMTTools_ListOfCommonBlock& aLCB=aCBP(j);
aItCB.Initialize(aLCB);
for (; aItCB.More(); aItCB.Next()) {
- NMTTools_CommonBlock& aCB=aItCB.Value();
- if (aCB.IsPaveBlockOnFace(nF)) {
- const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1();
- nSpIn=aPB1.Edge();
- const TopoDS_Shape& aSpIn=aDS.Shape(nSpIn);
- if (aMFence.Add(aSpIn)){
- aLSpIn.Append(aSpIn);
- }
- }
+ NMTTools_CommonBlock& aCB=aItCB.Value();
+ if (aCB.IsPaveBlockOnFace(nF)) {
+ const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1();
+ nSpIn=aPB1.Edge();
+ const TopoDS_Shape& aSpIn=aDS.Shape(nSpIn);
+ if (aMFence.Add(aSpIn)){
+ aLSpIn.Append(aSpIn);
+ }
+ }
}
}
//
BOPTools_SSInterference& aFF=aFFs(j);
aFF.Indices(n1, n2);
if (!(n1==nF || n2==nF)) {
- continue;
+ continue;
}
BOPTools_SequenceOfCurves& aSC=aFF.Curves();
aNbCurves=aSC.Length();
if (!aNbCurves) {
- continue;
+ continue;
}
//
const BOPTools_Curve& aBC=aSC(1);
const BOPTools_ListOfPaveBlock& aLPB=aBC.NewPaveBlocks();
aItPB.Initialize(aLPB);
for (; aItPB.More(); aItPB.Next()) {
- const BOPTools_PaveBlock& aPBSc=aItPB.Value();
- nSpSc=aPBSc.Edge();
- const TopoDS_Shape& aSpSc=aDS.Shape(nSpSc);
- if (aMFence.Add(aSpSc)){
- aLSpIn.Append(aSpSc);
- }
+ const BOPTools_PaveBlock& aPBSc=aItPB.Value();
+ nSpSc=aPBSc.Edge();
+ const TopoDS_Shape& aSpSc=aDS.Shape(nSpSc);
+ if (aMFence.Add(aSpSc)){
+ aLSpIn.Append(aSpSc);
+ }
}
}
aNbSpIn=aLSpIn.Extent();
for (; anExp.More(); anExp.Next()) {
const TopoDS_Shape& aE=anExp.Current();
if (myImages.HasImage(aE)) {
- aMFP.Add(i);
- break;
+ aMFP.Add(i);
+ break;
}
}
//
//
aNbFFs=aFFs.Extent();
for (j=1; j<=aNbFFs; ++j) {
- BOPTools_SSInterference& aFFj=aFFs(j);
- aFFj.Indices(n1, n2);
- if (!(n1==i || n2==i)) {
- continue;
- }
- //
- const TColStd_ListOfInteger& aLSE=aFFj.SharedEdges();
- aNbSE=aLSE.Extent();
- if (aNbSE) {
- aMFP.Add(i);
- }
+ BOPTools_SSInterference& aFFj=aFFs(j);
+ aFFj.Indices(n1, n2);
+ if (!(n1==i || n2==i)) {
+ continue;
+ }
+ //
+ const TColStd_ListOfInteger& aLSE=aFFj.SharedEdges();
+ aNbSE=aLSE.Extent();
+ if (aNbSE) {
+ aMFP.Add(i);
+ }
}
}
//===
anOriE=aE.Orientation();
//
if (!myImages.HasImage(aE)) {
- if (anOriE==TopAbs_INTERNAL) {
- aEE=aE;
- aEE.Orientation(TopAbs_FORWARD);
- aWES.AddStartElement(aEE);
- aEE.Orientation(TopAbs_REVERSED);
- aWES.AddStartElement(aEE);
- }
- else {
- aWES.AddStartElement(aE);
- }
- continue;
+ if (anOriE==TopAbs_INTERNAL) {
+ aEE=aE;
+ aEE.Orientation(TopAbs_FORWARD);
+ aWES.AddStartElement(aEE);
+ aEE.Orientation(TopAbs_REVERSED);
+ aWES.AddStartElement(aEE);
+ }
+ else {
+ aWES.AddStartElement(aE);
+ }
+ continue;
}
//
bIsDegenerated=BRep_Tool::Degenerated(aE);
const TopTools_ListOfShape& aLIE=myImages.Image(aE);
aIt.Initialize(aLIE);
for (; aIt.More(); aIt.Next()) {
- aSp=TopoDS::Edge(aIt.Value());
- //
- if (bIsDegenerated) {
- aSp.Orientation(anOriE);
- aWES.AddStartElement(aSp);
- continue;
- }
- //
- if (anOriE==TopAbs_INTERNAL) {
- aSp.Orientation(TopAbs_FORWARD);
- aWES.AddStartElement(aSp);
- aSp.Orientation(TopAbs_REVERSED);
- aWES.AddStartElement(aSp);
- continue;
- }
- //
- if (bIsClosed){
- if (aMFence.Add(aSp)) {
- //
- if (!BRep_Tool::IsClosed(aSp, aF)){
- BOPTools_Tools3D::DoSplitSEAMOnFace(aSp, aF);
- }
- //
- aSp.Orientation(TopAbs_FORWARD);
- aWES.AddStartElement(aSp);
- aSp.Orientation(TopAbs_REVERSED);
- aWES.AddStartElement(aSp);
- }
- continue;
- }// if (aMFence.Add(aSp))
- //
- aSp.Orientation(anOriE);
- bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, aCtx);
- if (bToReverse) {
- aSp.Reverse();
- }
- aWES.AddStartElement(aSp);
+ aSp=TopoDS::Edge(aIt.Value());
+ //
+ if (bIsDegenerated) {
+ aSp.Orientation(anOriE);
+ aWES.AddStartElement(aSp);
+ continue;
+ }
+ //
+ if (anOriE==TopAbs_INTERNAL) {
+ aSp.Orientation(TopAbs_FORWARD);
+ aWES.AddStartElement(aSp);
+ aSp.Orientation(TopAbs_REVERSED);
+ aWES.AddStartElement(aSp);
+ continue;
+ }
+ //
+ if (bIsClosed){
+ if (aMFence.Add(aSp)) {
+ //
+ if (!BRep_Tool::IsClosed(aSp, aF)){
+ BOPTools_Tools3D::DoSplitSEAMOnFace(aSp, aF);
+ }
+ //
+ aSp.Orientation(TopAbs_FORWARD);
+ aWES.AddStartElement(aSp);
+ aSp.Orientation(TopAbs_REVERSED);
+ aWES.AddStartElement(aSp);
+ }
+ continue;
+ }// if (aMFence.Add(aSp))
+ //
+ aSp.Orientation(anOriE);
+ bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, aCtx);
+ if (bToReverse) {
+ aSp.Reverse();
+ }
+ aWES.AddStartElement(aSp);
}// for (; aIt.More(); aIt.Next()) {
}// for (; anExp.More(); anExp.Next()) {
//
const TopTools_ListOfShape& aLE=myInParts.FindFromKey(aF);
aIt.Initialize(aLE);
for (; aIt.More(); aIt.Next()) {
- aSp=TopoDS::Edge(aIt.Value());
- //
- aSp.Orientation(TopAbs_FORWARD);
- aWES.AddStartElement(aSp);
- //
- aSp.Orientation(TopAbs_REVERSED);
- aWES.AddStartElement(aSp);
+ aSp=TopoDS::Edge(aIt.Value());
+ //
+ aSp.Orientation(TopAbs_FORWARD);
+ aWES.AddStartElement(aSp);
+ //
+ aSp.Orientation(TopAbs_REVERSED);
+ aWES.AddStartElement(aSp);
}
}
//
aBBx.Add(aCx, aFF);
aItx.Initialize(aSE);
for (; aItx.More(); aItx.Next()) {
- TopoDS_Shape& aEx=aItx.Value();
- aBBx.Add(aCx, aEx);
+ TopoDS_Shape& aEx=aItx.Value();
+ aBBx.Add(aCx, aEx);
}
int a=0;
}
for (; aIt.More(); aIt.Next()) {
TopoDS_Shape& aFR=aIt.Value();
if (anOriF==TopAbs_REVERSED) {
- aFR.Orientation(TopAbs_REVERSED);
+ aFR.Orientation(TopAbs_REVERSED);
}
aLFR.Append(aFR);
}
//
aItF2.Initialize(aLF2);
for (; aItF2.More(); aItF2.Next()) {
- const TopoDS_Face& aF2y=TopoDS::Face(aItF2.Value());
- bIsSDF=NMTTools_Tools::AreFacesSameDomain(aF1x, aF2y, aCtx);
- if (bIsSDF) {
- if (aMFence.Contains(aF1x) ||
- aMFence.Contains(aF2y)) {
- continue;
- }
- aMFence.Add(aF1x);
- aMFence.Add(aF2y);
- //
- NMTTools_CoupleOfShape aCS;
- //
- aCS.SetShape1(aF1x);
- aCS.SetShape2(aF2y);
- aLCS.Append(aCS);
- //
- if (aF1x==aF1) {
- if (!mySplitFaces.HasImage(aF1)) {
- mySplitFaces.Bind(aF1, aF1);
- }
- }
- if (aF2y==aF2) {
- if (!mySplitFaces.HasImage(aF2)) {
- mySplitFaces.Bind(aF2, aF2);
- }
- }
- //
-
- }
+ const TopoDS_Face& aF2y=TopoDS::Face(aItF2.Value());
+ bIsSDF=NMTTools_Tools::AreFacesSameDomain(aF1x, aF2y, aCtx);
+ if (bIsSDF) {
+ if (aMFence.Contains(aF1x) ||
+ aMFence.Contains(aF2y)) {
+ continue;
+ }
+ aMFence.Add(aF1x);
+ aMFence.Add(aF2y);
+ //
+ NMTTools_CoupleOfShape aCS;
+ //
+ aCS.SetShape1(aF1x);
+ aCS.SetShape2(aF2y);
+ aLCS.Append(aCS);
+ //
+ if (aF1x==aF1) {
+ if (!mySplitFaces.HasImage(aF1)) {
+ mySplitFaces.Bind(aF1, aF1);
+ }
+ }
+ if (aF2y==aF2) {
+ if (!mySplitFaces.HasImage(aF2)) {
+ mySplitFaces.Bind(aF2, aF2);
+ }
+ }
+ //
+
+ }
}
}
}//for (i=1; i<=aNbFF; ++i)
for (; aIt.More(); aIt.Next()) {
aFSp=TopoDS::Face(aIt.Value());
if (!mySameDomainShapes.Contains(aFSp)) {
- aLFx.Append(aFSp);
+ aLFx.Append(aFSp);
}
else {
- const TopoDS_Shape& aSx=mySameDomainShapes.FindFromKey(aFSp);
- aFSD=TopoDS::Face(aSx);
- iSense=GEOMAlgo_Tools3D::Sense(aFSp, aFSD);
- if (iSense<0) {
- aFSD.Reverse();
- }
- aLFx.Append(aFSD);
+ const TopoDS_Shape& aSx=mySameDomainShapes.FindFromKey(aFSp);
+ aFSD=TopoDS::Face(aSx);
+ iSense=GEOMAlgo_Tools3D::Sense(aFSp, aFSD);
+ if (iSense<0) {
+ aFSD.Reverse();
+ }
+ aLFx.Append(aFSD);
}
}
if (!myImages.HasImage(aF)) {//XX
const TColStd_IndexedMapOfInteger& aMAVF=aMAV.FindFromKey(nF);
aNbAVF=aMAVF.Extent();
for (j=1; j<=aNbAVF; ++j) {
- nV=aMAVF(j);
- nVSD=pPF->FindSDVertex(nV);
- if (nVSD) {
- nV=nVSD;
- }
- //
- UpdateCandidates(nF, nV, aMFMV);
+ nV=aMAVF(j);
+ nVSD=pPF->FindSDVertex(nV);
+ if (nVSD) {
+ nV=nVSD;
+ }
+ //
+ UpdateCandidates(nF, nV, aMFMV);
}
}
//
nV=aExp.Current();
const TopoDS_Shape& aV=aDS.Shape(nV);
if (aV.Orientation()==TopAbs_INTERNAL) {
- nVSD=pPF->FindSDVertex(nV);
- if (nVSD) {
- nV=nVSD;
- }
- //
- UpdateCandidates(nF, nV, aMFMV);
+ nVSD=pPF->FindSDVertex(nV);
+ if (nVSD) {
+ nV=nVSD;
+ }
+ //
+ UpdateCandidates(nF, nV, aMFMV);
}
}
//
const TopTools_ListOfShape& aLFx=myImages.Image(aF);
aIt.Initialize(aLFx);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aFx=aIt.Value();
- TopExp::MapShapesAndAncestors(aFx, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
+ const TopoDS_Shape& aFx=aIt.Value();
+ TopExp::MapShapesAndAncestors(aFx, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
}
}
- else {
+ else {
Standard_Boolean bFaceToProcess;
//
TopExp::MapShapesAndAncestors(aF, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
bFaceToProcess=Standard_False;
for (j=1; j<=aNbVC; ++j) {
- nV=aMVC(j);
- const TopoDS_Shape& aV=aDS.Shape(nV);
- if (!aMVE.Contains(aV)) {
- bFaceToProcess=!bFaceToProcess;
- break;
- }
+ nV=aMVC(j);
+ const TopoDS_Shape& aV=aDS.Shape(nV);
+ if (!aMVE.Contains(aV)) {
+ bFaceToProcess=!bFaceToProcess;
+ break;
+ }
}
if (!bFaceToProcess) {
- continue;
+ continue;
}
}// else
//
nV=aMVC(j);
const TopoDS_Shape& aV=aDS.Shape(nV);
if (aMVE.Contains(aV)) {
- const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aV);
- aNbE=aLE.Extent();
- if (aNbE) {
- continue;
- }
+ const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aV);
+ aNbE=aLE.Extent();
+ if (aNbE) {
+ continue;
+ }
}
aLV.Append(aV);
}
// 3. Try to put vertices into the face(s)
aItV.Initialize(aLV);
for (; aItV.More(); aItV.Next()) {
- TopoDS_Vertex aV=TopoDS::Vertex(aItV.Value());
- aV.Orientation(TopAbs_INTERNAL);
- //
- bHasImage=myImages.HasImage(aF);
- if (bHasImage) {
- const TopTools_ListOfShape& aLFx=myImages.Image(aF);
- aIt.Initialize(aLFx);
- for (; aIt.More(); aIt.Next()) {
- TopoDS_Face aFx=TopoDS::Face(aIt.Value());
- // update classifier
- IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
- aClsf.Init(aFx, aTol);
- //
- iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
- if (!iFlag) {
- aBB.Add(aFx, aV);
- break;
- }
- }
- }
- else {
- const TopoDS_Face& aFx=TopoDS::Face(aF);
- // update classifier
- IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
- aClsf.Init(aFx, aTol);
- //
- iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
- if (!iFlag) {
- TopoDS_Face aFz;
- //
- GEOMAlgo_Tools3D::CopyFace(aFx, aFz);
- aBB.Add(aFz, aV);
- myImages.Bind(aF, aFz);
- }
- }
+ TopoDS_Vertex aV=TopoDS::Vertex(aItV.Value());
+ aV.Orientation(TopAbs_INTERNAL);
+ //
+ bHasImage=myImages.HasImage(aF);
+ if (bHasImage) {
+ const TopTools_ListOfShape& aLFx=myImages.Image(aF);
+ aIt.Initialize(aLFx);
+ for (; aIt.More(); aIt.Next()) {
+ TopoDS_Face aFx=TopoDS::Face(aIt.Value());
+ // update classifier
+ IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
+ aClsf.Init(aFx, aTol);
+ //
+ iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
+ if (!iFlag) {
+ aBB.Add(aFx, aV);
+ break;
+ }
+ }
+ }
+ else {
+ const TopoDS_Face& aFx=TopoDS::Face(aF);
+ // update classifier
+ IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
+ aClsf.Init(aFx, aTol);
+ //
+ iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
+ if (!iFlag) {
+ TopoDS_Face aFz;
+ //
+ GEOMAlgo_Tools3D::CopyFace(aFx, aFz);
+ aBB.Add(aFz, aV);
+ myImages.Bind(aF, aFz);
+ }
+ }
}// for (; aItV.More(); aItV.Next()) {
}// if (aNbV) {
}// for (nF=1; nF<=aNb; ++nF) {
// purpose:
//=======================================================================
void UpdateCandidates(const Standard_Integer theNF,
- const Standard_Integer theNV,
- NMTTools_IndexedDataMapOfIndexedMapOfInteger& theMFMV)
+ const Standard_Integer theNV,
+ NMTTools_IndexedDataMapOfIndexedMapOfInteger& theMFMV)
{
if (theMFMV.Contains(theNF)) {
TColStd_IndexedMapOfInteger& aMV=theMFMV.ChangeFromKey(theNF);
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Builder_3.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_Builder_3.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_Builder.hxx>
static
void OwnInternalShapes(const TopoDS_Shape& ,
- TopTools_IndexedMapOfShape& );
+ TopTools_IndexedMapOfShape& );
//=======================================================================
//function : FillImagesSolids
//purpose :
//=======================================================================
void GEOMAlgo_Builder::BuildDraftSolid(const TopoDS_Shape& theSolid,
- TopoDS_Shape& theDraftSolid,
- TopTools_ListOfShape& theLIF)
+ TopoDS_Shape& theDraftSolid,
+ TopTools_ListOfShape& theLIF)
{
myErrorStatus=0;
//
Standard_Integer iFlag;
TopAbs_Orientation aOrF, aOrSh, aOrSd;
TopoDS_Iterator aIt1, aIt2;
- TopTools_ListIteratorOfListOfShape aItS;
+ TopTools_ListIteratorOfListOfShape aItS;
BRep_Builder aBB;
TopoDS_Shell aShD;
TopoDS_Shape aFSDx, aFx;
aOrF=aF.Orientation();
//
if (myImages.HasImage(aF)) {
- const TopTools_ListOfShape& aLSp=myImages.Image(aF);
- aItS.Initialize(aLSp);
- for (; aItS.More(); aItS.Next()) {
- aFx=aItS.Value();
- //
- if (mySameDomainShapes.Contains(aFx)) {
- aFSDx=mySameDomainShapes.FindFromKey(aFx);
- //
- if (aOrF==TopAbs_INTERNAL) {
- aFSDx.Orientation(aOrF);
- theLIF.Append(aFSDx);
- }
- else {
- bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFSDx, aF, aCtx);
- if (bToReverse) {
- aFSDx.Reverse();
- }
- //
- iFlag=1;
- aBB.Add(aShD, aFSDx);
- }
- }// if (mySameDomainShapes.Contains(aFx)) {
- else {
- aFx.Orientation(aOrF);
- if (aOrF==TopAbs_INTERNAL) {
- theLIF.Append(aFx);
- }
- else{
- iFlag=1;
- aBB.Add(aShD, aFx);
- }
- }
- }
+ const TopTools_ListOfShape& aLSp=myImages.Image(aF);
+ aItS.Initialize(aLSp);
+ for (; aItS.More(); aItS.Next()) {
+ aFx=aItS.Value();
+ //
+ if (mySameDomainShapes.Contains(aFx)) {
+ aFSDx=mySameDomainShapes.FindFromKey(aFx);
+ //
+ if (aOrF==TopAbs_INTERNAL) {
+ aFSDx.Orientation(aOrF);
+ theLIF.Append(aFSDx);
+ }
+ else {
+ bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFSDx, aF, aCtx);
+ if (bToReverse) {
+ aFSDx.Reverse();
+ }
+ //
+ iFlag=1;
+ aBB.Add(aShD, aFSDx);
+ }
+ }// if (mySameDomainShapes.Contains(aFx)) {
+ else {
+ aFx.Orientation(aOrF);
+ if (aOrF==TopAbs_INTERNAL) {
+ theLIF.Append(aFx);
+ }
+ else{
+ iFlag=1;
+ aBB.Add(aShD, aFx);
+ }
+ }
+ }
} //if (myImages.HasImage(aF)) {
//
else {
- if (aOrF==TopAbs_INTERNAL) {
- theLIF.Append(aF);
- }
- else{
- iFlag=1;
- aBB.Add(aShD, aF);
- }
+ if (aOrF==TopAbs_INTERNAL) {
+ theLIF.Append(aF);
+ }
+ else{
+ iFlag=1;
+ aBB.Add(aShD, aF);
+ }
}
} //for (; aIt2.More(); aIt2.Next()) {
//
TopTools_IndexedMapOfShape aMSolids, aMS, aMFaces, aMFIN;
TopTools_MapOfShape aMFDone;
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
- TopTools_ListIteratorOfListOfShape aItS;
+ TopTools_ListIteratorOfListOfShape aItS;
TopoDS_Iterator aIt, aItF;
BRep_Builder aBB;
TopoDS_Solid aSolidSp;
else if (aType==TopAbs_FACE) {
// all faces (originals from DS or theirs images)
if (myImages.HasImage(aS)) {
- const TopTools_ListOfShape& aLS=myImages.Image(aS);
- aItS.Initialize(aLS);
- for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aFx=aItS.Value();
- //
- if (mySameDomainShapes.Contains(aFx)) {
- const TopoDS_Shape& aFSDx=mySameDomainShapes.FindFromKey(aFx);
- aMFaces.Add(aFSDx);
- }
- else {
- aMFaces.Add(aFx);
- }
- }
+ const TopTools_ListOfShape& aLS=myImages.Image(aS);
+ aItS.Initialize(aLS);
+ for (; aItS.More(); aItS.Next()) {
+ const TopoDS_Shape& aFx=aItS.Value();
+ //
+ if (mySameDomainShapes.Contains(aFx)) {
+ const TopoDS_Shape& aFSDx=mySameDomainShapes.FindFromKey(aFx);
+ aMFaces.Add(aFSDx);
+ }
+ else {
+ aMFaces.Add(aFx);
+ }
+ }
}
else {
- if (mySameDomainShapes.Contains(aS)) {
- const TopoDS_Shape& aFSDx=mySameDomainShapes.FindFromKey(aS);
- aMFaces.Add(aFSDx);
- }
- else {
- aMFaces.Add(aS);
- }
+ if (mySameDomainShapes.Contains(aS)) {
+ const TopoDS_Shape& aFSDx=mySameDomainShapes.FindFromKey(aS);
+ aMFaces.Add(aFSDx);
+ }
+ else {
+ aMFaces.Add(aS);
+ }
}
}
}
const TopoDS_Shape& aShell=aIt.Value();
//
if (myImages.HasImage(aShell)) {
- bHasImage=Standard_True;
- //
- const TopTools_ListOfShape& aLS=myImages.Image(aShell);
- aItS.Initialize(aLS);
- for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aSx=aItS.Value();
- aMS.Add(aSx);
- TopExp::MapShapes(aSx, TopAbs_FACE, aMS);
- TopExp::MapShapes(aSx, TopAbs_EDGE, aMS);
- TopExp::MapShapesAndAncestors(aSx, TopAbs_EDGE, TopAbs_FACE, aMEF);
- }
+ bHasImage=Standard_True;
+ //
+ const TopTools_ListOfShape& aLS=myImages.Image(aShell);
+ aItS.Initialize(aLS);
+ for (; aItS.More(); aItS.Next()) {
+ const TopoDS_Shape& aSx=aItS.Value();
+ aMS.Add(aSx);
+ TopExp::MapShapes(aSx, TopAbs_FACE, aMS);
+ TopExp::MapShapes(aSx, TopAbs_EDGE, aMS);
+ TopExp::MapShapesAndAncestors(aSx, TopAbs_EDGE, TopAbs_FACE, aMEF);
+ }
}
else {
- //aMS.Add(aShell);
- TopExp::MapShapes(aShell, TopAbs_FACE, aMS);
- TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF);
+ //aMS.Add(aShell);
+ TopExp::MapShapes(aShell, TopAbs_FACE, aMS);
+ TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF);
}
}
//
for (j=1; j<=aNbFaces; ++j) {
const TopoDS_Shape& aFace=aMFaces(j);
if (!aMS.Contains(aFace)) {
- TopExp::MapShapesAndAncestors(aFace, TopAbs_EDGE, TopAbs_FACE, aMEFP);
+ TopExp::MapShapesAndAncestors(aFace, TopAbs_EDGE, TopAbs_FACE, aMEFP);
}
}
//
const TopoDS_Shape& aE=aMEFP.FindKey(j);
//
if (aMEF.Contains(aE)) { // !!
- const TopTools_ListOfShape& aLF=aMEFP(j);
- aItFP.Initialize(aLF);
- for (; aItFP.More(); aItFP.Next()) {
- const TopoDS_Shape& aF=aItFP.Value();
- if (aMFence.Add(aF)) {
- aLFP1.Append(aF);
- }
- }
+ const TopTools_ListOfShape& aLF=aMEFP(j);
+ aItFP.Initialize(aLF);
+ for (; aItFP.More(); aItFP.Next()) {
+ const TopoDS_Shape& aF=aItFP.Value();
+ if (aMFence.Add(aF)) {
+ aLFP1.Append(aF);
+ }
+ }
}
else {
- aLEx.Append(aE);
+ aLEx.Append(aE);
}
}
//
const TopTools_ListOfShape& aLF=aMEFP.FindFromKey(aE);
aItFP.Initialize(aLF);
for (; aItFP.More(); aItFP.Next()) {
- const TopoDS_Shape& aF=aItFP.Value();
- if (aMFence.Add(aF)) {
- aLFP2.Append(aF);
- }
+ const TopoDS_Shape& aF=aItFP.Value();
+ if (aMFence.Add(aF)) {
+ aLFP2.Append(aF);
+ }
}
}
aLFP1.Append(aLFP2);
for (; aItFP.More(); aItFP.Next()) {
const TopoDS_Shape& aSP=aItFP.Value();
if (!aMFDone.Add(aSP)) {
- continue;
+ continue;
}
//
aLFP.Append(aFP);
aItS.Initialize(aLFP1);
for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aSk=aItS.Value();
- if (!aMFDone.Contains(aSk)) {
- aLFP.Append(aSk);
- }
+ const TopoDS_Shape& aSk=aItS.Value();
+ if (!aMFDone.Contains(aSk)) {
+ aLFP.Append(aSk);
+ }
}
//
// Connexity Block that spreads from aFP the Bound
// fill states for the Connexity Block
aItS.Initialize(aLCBF);
for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aSx=aItS.Value();
- aMFDone.Add(aSx);
- if (aState==TopAbs_IN) {
- aMFIN.Add(aSx);
- }
+ const TopoDS_Shape& aSx=aItS.Value();
+ aMFDone.Add(aSx);
+ if (aState==TopAbs_IN) {
+ aMFIN.Add(aSx);
+ }
}
//
aNbFPx=aMFDone.Extent();
if (aNbFPx==aNbFP) {
- break;
+ break;
}
}//for (; aItFP.More(); aItFP.Next())
//
aNbFIN=aMFIN.Extent();
if (aNbFIN || aNbLIF) {
for (j=1; j<=aNbFIN; ++j) {
- const TopoDS_Shape& aFIN=aMFIN(j);
- aLFIN.Append(aFIN);
+ const TopoDS_Shape& aFIN=aMFIN(j);
+ aLFIN.Append(aFIN);
}
//
aItS.Initialize(aLIF);
for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aFIN=aItS.Value();
- aLFIN.Append(aFIN);
+ const TopoDS_Shape& aFIN=aItS.Value();
+ aLFIN.Append(aFIN);
}
//
myInParts.Add(aSolid, aLFIN);
const TopoDS_Shape& aSR=aItSS.Key();
const GEOMAlgo_ShapeSet& aSSR=aItSS.Value();
if (aSSi.Contains(aSSR)) {
- // the aSR is SD solid for aS
- aSSi.Subtract(aSSR);
- // update images
- if(myImages.HasImage(aS)) {
- myImages.Add(aS, aSR);
- }
- else {
- myImages.Bind(aS, aSR);
- }
- //
- // update SD Shapes
- mySameDomainShapes.Add(aSR, aSR);
+ // the aSR is SD solid for aS
+ aSSi.Subtract(aSSR);
+ // update images
+ if(myImages.HasImage(aS)) {
+ myImages.Add(aS, aSR);
+ }
+ else {
+ myImages.Bind(aS, aSR);
+ }
+ //
+ // update SD Shapes
+ mySameDomainShapes.Add(aSR, aSR);
}
}
const TopTools_ListOfShape& aSFS1=aSSi.GetSet();
aSSi.Clear();
aExp.Init(aSR, TopAbs_FACE);
for (; aExp.More(); aExp.Next()) {
- const TopoDS_Shape& aF=aExp.Current();
- aSSi.Add(aF);
+ const TopoDS_Shape& aF=aExp.Current();
+ aSSi.Add(aF);
}
aMSS.Bind(aSR, aSSi);
}
const TopoDS_Shape& aSR=aItSS.Key();
const GEOMAlgo_ShapeSet& aSSR=aItSS.Value();
if (aSSi.Contains(aSSR)) {
- myImages.Bind(aS, aSR);
- break;
+ myImages.Bind(aS, aSR);
+ break;
}
}
} //for (i=1; i<=aNbS; ++i)
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Value();
if (aMFence.Add(aS)) {
- aLSI.Append(aS);
+ aLSI.Append(aS);
}
}
}
const TopoDS_Shape& aW=aIt.Value();
aItS.Initialize(aW);
for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aE=aItS.Value();
- if (aMFence.Add(aE)) {
- aLSI.Append(aE);
- }
+ const TopoDS_Shape& aE=aItS.Value();
+ if (aMFence.Add(aE)) {
+ aLSI.Append(aE);
+ }
}
}
}
const TopTools_ListOfShape &aLSp=myImages.Image(aS);
aIt.Initialize(aLSp);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aSI=aIt.Value();
- aMSI.Add(aSI);
+ const TopoDS_Shape& aSI=aIt.Value();
+ aMSI.Add(aSI);
}
}
else {
//
aNbSx=aMx.Extent();
for (j=1; j<=aNbSx; ++j) {
- const TopoDS_Shape& aSI=aMx(j);
- if (myImages.HasImage(aSI)) {
- const TopTools_ListOfShape &aLSp=myImages.Image(aSI);
- aIt.Initialize(aLSp);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aSp=aIt.Value();
- aMSI.Add(aSp);
- }
- }
- else {
- aMSI.Add(aSI);
- }
+ const TopoDS_Shape& aSI=aMx(j);
+ if (myImages.HasImage(aSI)) {
+ const TopTools_ListOfShape &aLSp=myImages.Image(aSI);
+ aIt.Initialize(aLSp);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aSp=aIt.Value();
+ aMSI.Add(aSp);
+ }
+ }
+ else {
+ aMSI.Add(aSI);
+ }
}
//
// build aux map from splits of solids
if (myImages.HasImage(aS)) {
- const TopTools_ListOfShape &aLSp=myImages.Image(aS);
- aIt.Initialize(aLSp);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aSp=aIt.Value();
- if (aMFence.Add(aSp)) {
- TopExp::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
- TopExp::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_FACE, aMSx);
- TopExp::MapShapesAndAncestors(aSp, TopAbs_EDGE , TopAbs_FACE, aMSx);
- aLSd.Append(aSp);
- }
- }
+ const TopTools_ListOfShape &aLSp=myImages.Image(aS);
+ aIt.Initialize(aLSp);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aSp=aIt.Value();
+ if (aMFence.Add(aSp)) {
+ TopExp::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
+ TopExp::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_FACE, aMSx);
+ TopExp::MapShapesAndAncestors(aSp, TopAbs_EDGE , TopAbs_FACE, aMSx);
+ aLSd.Append(aSp);
+ }
+ }
}
else {
- if (aMFence.Add(aS)) {
- TopExp::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
- TopExp::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aMSx);
- TopExp::MapShapesAndAncestors(aS, TopAbs_EDGE , TopAbs_FACE, aMSx);
- aLSd.Append(aS);
- aMSOr.Add(aS);
- }
+ if (aMFence.Add(aS)) {
+ TopExp::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
+ TopExp::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aMSx);
+ TopExp::MapShapesAndAncestors(aS, TopAbs_EDGE , TopAbs_FACE, aMSx);
+ aLSd.Append(aS);
+ aMSOr.Add(aS);
+ }
}
}//if (aType==TopAbs_SOLID)
}
const TopTools_ListOfShape &aLSx=aMSx.FindFromKey(aSI);
aNbSx=aLSx.Extent();
if (aNbSx) {
- aMSI.Remove(aSI);
+ aMSI.Remove(aSI);
}
}
}
//
aState=GEOMAlgo_Tools3D::ComputeStateByOnePoint(aSI, aSd, 1.e-11, aCtx);
if (aState==TopAbs_IN) {
- //
- if(aMSOr.Contains(aSd)) {
- //
- TopoDS_Solid aSdx;
- //
- aBB.MakeSolid(aSdx);
- aItS.Initialize(aSd);
- for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aSh=aItS.Value();
- aBB.Add(aSdx, aSh);
- }
- //
- aBB.Add(aSdx, aSI);
- //
- myImages.Bind(aSd, aSdx);
- aMSOr.Remove(aSd);
- aSd=aSdx;
- }
- else {
- aBB.Add(aSd, aSI);
- }
- //
- aMSI.Remove(aSI);
+ //
+ if(aMSOr.Contains(aSd)) {
+ //
+ TopoDS_Solid aSdx;
+ //
+ aBB.MakeSolid(aSdx);
+ aItS.Initialize(aSd);
+ for (; aItS.More(); aItS.Next()) {
+ const TopoDS_Shape& aSh=aItS.Value();
+ aBB.Add(aSdx, aSh);
+ }
+ //
+ aBB.Add(aSdx, aSI);
+ //
+ myImages.Bind(aSd, aSdx);
+ aMSOr.Remove(aSd);
+ aSd=aSdx;
+ }
+ else {
+ aBB.Add(aSd, aSI);
+ }
+ //
+ aMSI.Remove(aSI);
} //if (aState==TopAbs_IN) {
}// for (; aItM.More(); aItM.Next()) {
}//for (; aIt1.More(); aIt1.Next()) {
//purpose :
//=======================================================================
void OwnInternalShapes(const TopoDS_Shape& theS,
- TopTools_IndexedMapOfShape& theMx)
+ TopTools_IndexedMapOfShape& theMx)
{
TopoDS_Iterator aIt;
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Builder_4.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_Builder_4.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_Builder.hxx>
static
void MapShapes(const TopoDS_Shape& aS,
- TopTools_MapOfShape& aM);
+ TopTools_MapOfShape& aM);
//=======================================================================
//function : Generated
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aSp=aIt.Value();
if (mySameDomainShapes.Contains(aSp)) {
- if (myMapShape.Contains(aSp)) {
- TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
- //
- if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
- aSpR.Orientation(theS.Orientation());
- }
- else {
- bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSpR, theS, aCtx);
- if (bToReverse) {
- aSpR.Reverse();
- }
- }
- //
- myHistShapes.Append(aSpR);
- }
+ if (myMapShape.Contains(aSp)) {
+ TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
+ //
+ if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
+ aSpR.Orientation(theS.Orientation());
+ }
+ else {
+ bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSpR, theS, aCtx);
+ if (bToReverse) {
+ aSpR.Reverse();
+ }
+ }
+ //
+ myHistShapes.Append(aSpR);
+ }
}
}
}
for (; aIt.More(); aIt.Next()) {
TopoDS_Shape aSp=aIt.Value();
if (!mySameDomainShapes.Contains(aSp)) {
- if (myMapShape.Contains(aSp)) {
- //
- if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
- aSp.Orientation(theS.Orientation());
- }
- else {
- bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSp, theS, aCtx);
- if (bToReverse) {
- aSp.Reverse();
- }
- }
- //
- myHistShapes.Append(aSp);
- }
+ if (myMapShape.Contains(aSp)) {
+ //
+ if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
+ aSp.Orientation(theS.Orientation());
+ }
+ else {
+ bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSp, theS, aCtx);
+ if (bToReverse) {
+ aSp.Reverse();
+ }
+ }
+ //
+ myHistShapes.Append(aSp);
+ }
}
}
}
TopoDS_Shape aSp=aIt.Value();
//
if (!mySameDomainShapes.Contains(aSp)) {
- if (myMapShape.Contains(aSp)) {
- return bRet; //false
- }
+ if (myMapShape.Contains(aSp)) {
+ return bRet; //false
+ }
}
else {
- TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
- if (myMapShape.Contains(aSpR)) {
- return bRet; //false
- }
+ TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
+ if (myMapShape.Contains(aSpR)) {
+ return bRet; //false
+ }
}
}
}
bHasImage=myImages.HasImage(aSx);
if (!bHasImage) {
if (myMapShape.Contains(aSx)) {
- aLSx.Append(aSx);
- myImagesResult.Add(aSx, aLSx);
+ aLSx.Append(aSx);
+ myImagesResult.Add(aSx, aLSx);
}
}
else {
const TopTools_ListOfShape& aLSp=myImages.Image(aSx);
aIt.Initialize(aLSp);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aSp=aIt.Value();
- if (myMapShape.Contains(aSp)) {
- aLSx.Append(aSp);
- }
+ const TopoDS_Shape& aSp=aIt.Value();
+ if (myMapShape.Contains(aSp)) {
+ aLSx.Append(aSp);
+ }
}
myImagesResult.Add(aSx, aLSx);
}
//
if (!myHasGenerated || !myHasModified) {
if (aType==TopAbs_EDGE || aType==TopAbs_FACE ||
- aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
- //modified by NIZNHY-PKV Thu Dec 7 11:53:01 2006f
- //bHasImage=myImages.HasImage(aSx);
- //modified by NIZNHY-PKV Thu Dec 7 11:53:04 2006t
- if (bHasImage) {
- const TopTools_ListOfShape& aLSp=myImages.Image(aSx);
- aIt.Initialize(aLSp);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aSp=aIt.Value();
- //
- if (myMapShape.Contains(aSp)) {
- bContainsSD=mySameDomainShapes.Contains(aSp);
- //
- if (!myHasGenerated) {
- if (bContainsSD) {
- myHasGenerated=Standard_True;
- }
- }
- if (!myHasModified) {
- if (!bContainsSD) {
- myHasModified=Standard_True;
- }
- }
- } // if (myMapShape.Contains(aSp))
- }
- }
+ aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
+ //modified by NIZNHY-PKV Thu Dec 7 11:53:01 2006f
+ //bHasImage=myImages.HasImage(aSx);
+ //modified by NIZNHY-PKV Thu Dec 7 11:53:04 2006t
+ if (bHasImage) {
+ const TopTools_ListOfShape& aLSp=myImages.Image(aSx);
+ aIt.Initialize(aLSp);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aSp=aIt.Value();
+ //
+ if (myMapShape.Contains(aSp)) {
+ bContainsSD=mySameDomainShapes.Contains(aSp);
+ //
+ if (!myHasGenerated) {
+ if (bContainsSD) {
+ myHasGenerated=Standard_True;
+ }
+ }
+ if (!myHasModified) {
+ if (!bContainsSD) {
+ myHasModified=Standard_True;
+ }
+ }
+ } // if (myMapShape.Contains(aSp))
+ }
+ }
}
}
}
//purpose :
//=======================================================================
void MapShapes(const TopoDS_Shape& theS,
- TopTools_MapOfShape& theM)
+ TopTools_MapOfShape& theM)
{
theM.Add(theS);
TopoDS_Iterator anIt;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Classifier.cxx
-// Created: Wed Nov 22 10:23:04 2006
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_Classifier.cxx
+// Created: Wed Nov 22 10:23:04 2006
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_Clsf.ixx>
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_Clsf",
- sizeof(GEOMAlgo_Clsf),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_Clsf),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_ClsfSurf.cxx
-// Created: Wed Nov 22 10:41:47 2006
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_ClsfSurf.cxx
+// Created: Wed Nov 22 10:41:47 2006
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_ClsfBox.ixx>
#include <GeomAbs_SurfaceType.hxx>
switch (aSt) {
case TopAbs_OUT:
myState=aSt;
- iNext=0;
- break;
+ iNext=0;
+ break;
case TopAbs_ON:
- ++aNbON;
- break;
+ ++aNbON;
+ break;
case TopAbs_IN:
- ++aNbIN;
- break;
+ ++aNbIN;
+ break;
default:
- myState=TopAbs_UNKNOWN;
- iNext=0;
- break;
+ myState=TopAbs_UNKNOWN;
+ iNext=0;
+ break;
}
}
//
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_ClsfBox",
- sizeof(GEOMAlgo_ClsfBox),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_ClsfBox),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_ClsfSolid.cxx
-// Created: Mon Jan 29 10:35:46 2007
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_ClsfSolid.cxx
+// Created: Mon Jan 29 10:35:46 2007
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_ClsfSolid.ixx>
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_ClsfSolid",
- sizeof(GEOMAlgo_ClsfSolid),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_ClsfSolid),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_ClsfSurf.cxx
-// Created: Wed Nov 22 10:41:47 2006
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_ClsfSurf.cxx
+// Created: Wed Nov 22 10:41:47 2006
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_ClsfSurf.ixx>
#include <GeomAbs_SurfaceType.hxx>
myGAS.Load(myS);
aType=myGAS.GetType();
if (!(aType==GeomAbs_Plane ||
- aType==GeomAbs_Cylinder ||
- aType==GeomAbs_Sphere)) {
+ aType==GeomAbs_Cylinder ||
+ aType==GeomAbs_Sphere)) {
myErrorStatus=11; // unallowed surface type
}
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_ClsfSurf",
- sizeof(GEOMAlgo_ClsfSurf),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_ClsfSurf),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_CoupleOfShapes.cxx
-// Created: Wed Dec 15 13:03:52 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_CoupleOfShapes.cxx
+// Created: Wed Dec 15 13:03:52 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_CoupleOfShapes.ixx>
//=======================================================================
//purpose :
//=======================================================================
void GEOMAlgo_CoupleOfShapes::SetShapes(const TopoDS_Shape& aS1,
- const TopoDS_Shape& aS2)
+ const TopoDS_Shape& aS2)
{
myShape1=aS1;
myShape2=aS2;
//purpose :
//=======================================================================
void GEOMAlgo_CoupleOfShapes::Shapes(TopoDS_Shape& aS1,
- TopoDS_Shape& aS2)const
+ TopoDS_Shape& aS2)const
{
aS1=myShape1;
aS2=myShape2;
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger",
- sizeof(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape",
- sizeof(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape",
- sizeof(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfShapeReal",
- sizeof(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet",
- sizeof(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_FinderShapeOn.cxx
-// Created: Tue Jan 11 14:44:31 2005
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_FinderShapeOn.cxx
+// Created: Tue Jan 11 14:44:31 2005
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_FinderShapeOn.ixx>
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aSImage=aIt.Value();
if (myImages.IsBound(aSImage)) {
- const TopoDS_Shape& aSx=myImages.Find(aSImage);
- myMSS.Add(aSx, aSts[i]);
+ const TopoDS_Shape& aSx=myImages.Find(aSImage);
+ myMSS.Add(aSx, aSts[i]);
}
else {
- myErrorStatus=33;// can not find original shape
- return;
+ myErrorStatus=33;// can not find original shape
+ return;
}
}
}
switch (aType) {
case TopAbs_VERTEX: {
const TopoDS_Vertex& aVx=TopoDS::Vertex(aS);
- aBB.UpdateVertex(aVx, myTolerance);
+ aBB.UpdateVertex(aVx, myTolerance);
}
- break;
+ break;
case TopAbs_EDGE: {
const TopoDS_Edge& aEx=TopoDS::Edge(aS);
- aBB.UpdateEdge(aEx, myTolerance);
+ aBB.UpdateEdge(aEx, myTolerance);
}
- break;
+ break;
case TopAbs_FACE: {
const TopoDS_Face& aFx=TopoDS::Face(aS);
- aBB.UpdateFace(aFx, myTolerance);
+ aBB.UpdateFace(aFx, myTolerance);
}
- break;
+ break;
default:
- break;
+ break;
}
}
} //
}
//
if (!(myShapeType==TopAbs_VERTEX ||
- myShapeType==TopAbs_EDGE ||
- myShapeType==TopAbs_FACE ||
- myShapeType==TopAbs_SOLID)) {
+ myShapeType==TopAbs_EDGE ||
+ myShapeType==TopAbs_FACE ||
+ myShapeType==TopAbs_SOLID)) {
myErrorStatus=12; // unallowed subshape type
return;
}
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::CopySource(const TopoDS_Shape& aE,
- TopTools_DataMapOfShapeShape& aImages,
- TopTools_DataMapOfShapeShape& aOriginals,
- TopoDS_Shape& aEx)
+ TopTools_DataMapOfShapeShape& aImages,
+ TopTools_DataMapOfShapeShape& aOriginals,
+ TopoDS_Shape& aEx)
{
Standard_Boolean bFree;
TopAbs_ShapeEnum aType;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_FinderShapeOn1.cxx
-// Created: Fri Mar 4 10:31:06 2005
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_FinderShapeOn1.cxx
+// Created: Fri Mar 4 10:31:06 2005
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_FinderShapeOn1.ixx>
#include <math.h>
//
if (myShapeType==TopAbs_VERTEX){
if (bIsConformState) {
- myMSS.Add(aV, aSt);
+ myMSS.Add(aV, aSt);
}
}
else if (bIsConformState || aSt==TopAbs_ON) {
//
bIsConformState=myMSS.Contains(aV);
if (!bIsConformState) {
- break;// vertex has non-conformed state
+ break;// vertex has non-conformed state
}
else {
- aSt=myMSS.FindFromKey(aV);
- aSC.AppendState(aSt);
+ aSt=myMSS.FindFromKey(aV);
+ aSC.AppendState(aSt);
}
}
//
//
aType2=aGAC.GetType();
if (aType2==GeomAbs_Line) {
- continue;
+ continue;
}
}
//
aIt.Initialize(aLP);
for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
if (myNbPntsMax) {
- if (iCnt > myNbPntsMax) {
- break;
- }
+ if (iCnt > myNbPntsMax) {
+ break;
+ }
}
//
const gp_Pnt& aP=aIt.Value();
aSt = GetPointState( aP );
bIsToBreak=aSC.AppendState(aSt);
if (bIsToBreak) {
- break;
+ break;
}
}
//
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
if (myShapeType==TopAbs_EDGE) {
if (bIsConformState) {
- myMSS.Add(aE, aSt);
+ myMSS.Add(aE, aSt);
}
}
else if (bIsConformState || aSt==TopAbs_ON) {
aGAS.Load(aS);
aType2=aGAS.GetType();
if (aType2!=aType1) {
- continue;
+ continue;
}
}
//
const TopoDS_Shape& aE=aExp.Current();
bIsConformState=myMSS.Contains(aE);
if (!bIsConformState) {
- break;// edge has non-conformed state
+ break;// edge has non-conformed state
}
else {
- aSt=myMSS.FindFromKey(aE);
- aSC.AppendState(aSt);
+ aSt=myMSS.FindFromKey(aE);
+ aSC.AppendState(aSt);
}
}
//
aIt.Initialize(aLP);
for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
if (myNbPntsMax) {
- if (iCnt > myNbPntsMax) {
- break;
- }
+ if (iCnt > myNbPntsMax) {
+ break;
+ }
}
//
const gp_Pnt& aP=aIt.Value();
aSt = GetPointState( aP );
bIsToBreak=aSC.AppendState(aSt);
if (bIsToBreak) {
- break;
+ break;
}
}
//
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
if (myShapeType==TopAbs_FACE) {
if (bIsConformState) {
- myMSS.Add(aF, aSt);
+ myMSS.Add(aF, aSt);
}
}
else if (bIsConformState || aSt==TopAbs_ON) {
const TopoDS_Shape& aF=aMF(j);
bIsConformState=myMSS.Contains(aF);
if (!bIsConformState) {
- break;// face has non-conformed state
+ break;// face has non-conformed state
}
else {
- aSt=myMSS.FindFromKey(aF);
- aSC.AppendState(aSt);
+ aSt=myMSS.FindFromKey(aF);
+ aSC.AppendState(aSt);
}
}
//
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Face& aF,
- GEOMAlgo_ListOfPnt& aLP)
+ GEOMAlgo_ListOfPnt& aLP)
{
myErrorStatus=0;
//
//
aPK.SetIds(n[k], n[k+1]);
if (aMPKI.IsBound(aPK)) {
- Standard_Integer& iCntX=aMPKI.ChangeFind(aPK);
- ++iCntX;
+ Standard_Integer& iCntX=aMPKI.ChangeFind(aPK);
+ ++iCntX;
}
else {
- aMPKI.Bind(aPK, 1);
+ aMPKI.Bind(aPK, 1);
}
}
}
aNbMax=aPK.NbMax();
pIds=(Standard_Integer*)aPK.Key();
for (k=1; k<3; ++k) {
- aNx=*(pIds+aNbMax-k);
- aMBN.Add(aNx);
+ aNx=*(pIds+aNbMax-k);
+ aMBN.Add(aNx);
}
*/
aNx=(Standard_Integer)aPK.Id(1);
aNbLinks=aMPKI.Extent();
aIt.Initialize(aMPKI);
for (; aIt.More(); aIt.Next()) {
- iCnt=aIt.Value();
- if (iCnt>1) {
- // take the first having occured inner link
- // and discretize it
- const GEOMAlgo_PassKey& aPK=aIt.Key();
- //qf
- /*
- aNbMax=aPK.NbMax();
- pIds=(Standard_Integer*)aPK.Key();
- aN1=*(pIds+aNbMax-1);
- aN2=*(pIds+aNbMax-2);
- */
- //
- aN1=(Standard_Integer)aPK.Id(1);
- aN2=(Standard_Integer)aPK.Id(2);
- //qt
- aP1=aNodes(aN1).Transformed(aTrsf);
- aP2=aNodes(aN2).Transformed(aTrsf);
- //
- if (aType==GeomAbs_Cylinder) {
- Standard_Real aTolSM;
- gp_Cylinder aCyl;
- //
- aTolSM=1.523e-6;//~1.-cos(0.1 deg)
- aCyl=aGAS.Cylinder();
- if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, aTolSM)) {
- continue;
- }
- }
- //
- BRepLib_MakeEdge aBME(aP1, aP2);
- bIsDone=aBME.IsDone();
- if (!bIsDone) {
- myErrorStatus=30; //can not obtain the line fron the link
- return;
- }
- //
- const TopoDS_Shape& aSx=aBME.Shape();
- const TopoDS_Edge& aE=TopoDS::Edge(aSx);
- //
- InnerPoints(aE, myNbPntsMin, aLP);
- break;
- }// if (iCnt>1)
+ iCnt=aIt.Value();
+ if (iCnt>1) {
+ // take the first having occured inner link
+ // and discretize it
+ const GEOMAlgo_PassKey& aPK=aIt.Key();
+ //qf
+ /*
+ aNbMax=aPK.NbMax();
+ pIds=(Standard_Integer*)aPK.Key();
+ aN1=*(pIds+aNbMax-1);
+ aN2=*(pIds+aNbMax-2);
+ */
+ //
+ aN1=(Standard_Integer)aPK.Id(1);
+ aN2=(Standard_Integer)aPK.Id(2);
+ //qt
+ aP1=aNodes(aN1).Transformed(aTrsf);
+ aP2=aNodes(aN2).Transformed(aTrsf);
+ //
+ if (aType==GeomAbs_Cylinder) {
+ Standard_Real aTolSM;
+ gp_Cylinder aCyl;
+ //
+ aTolSM=1.523e-6;//~1.-cos(0.1 deg)
+ aCyl=aGAS.Cylinder();
+ if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, aTolSM)) {
+ continue;
+ }
+ }
+ //
+ BRepLib_MakeEdge aBME(aP1, aP2);
+ bIsDone=aBME.IsDone();
+ if (!bIsDone) {
+ myErrorStatus=30; //can not obtain the line fron the link
+ return;
+ }
+ //
+ const TopoDS_Shape& aSx=aBME.Shape();
+ const TopoDS_Edge& aE=TopoDS::Edge(aSx);
+ //
+ InnerPoints(aE, myNbPntsMin, aLP);
+ break;
+ }// if (iCnt>1)
}// for (; aIt.More(); aIt.Next())
}// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder)
}// if (!aNb && myNbPntsMin) {
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
- GEOMAlgo_ListOfPnt& aLP)
+ GEOMAlgo_ListOfPnt& aLP)
{
myErrorStatus=0;
//
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
- const Standard_Integer aNbPntsMin,
- GEOMAlgo_ListOfPnt& aLP)
+ const Standard_Integer aNbPntsMin,
+ GEOMAlgo_ListOfPnt& aLP)
{
// try to fill it yourself
Standard_Boolean bInf1, bInf2;
}
//
if (!(myShapeType==TopAbs_VERTEX ||
- myShapeType==TopAbs_EDGE ||
- myShapeType==TopAbs_FACE ||
- myShapeType==TopAbs_SOLID)) {
+ myShapeType==TopAbs_EDGE ||
+ myShapeType==TopAbs_FACE ||
+ myShapeType==TopAbs_SOLID)) {
myErrorStatus=12; // unallowed subshape type
return;
}
myGAS.Load(mySurface);
aType=myGAS.GetType();
if (!(aType==GeomAbs_Plane ||
- aType==GeomAbs_Cylinder ||
- aType==GeomAbs_Sphere)) {
+ aType==GeomAbs_Cylinder ||
+ aType==GeomAbs_Sphere)) {
myErrorStatus=14; // unallowed surface type
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_FinderShapeOn1.cxx
-// Created: Fri Mar 4 10:31:06 2005
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_FinderShapeOn1.cxx
+// Created: Fri Mar 4 10:31:06 2005
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_FinderShapeOn2.ixx>
#include <math.h>
}
//
if (!(myShapeType==TopAbs_VERTEX ||
- myShapeType==TopAbs_EDGE ||
- myShapeType==TopAbs_FACE ||
- myShapeType==TopAbs_SOLID)) {
+ myShapeType==TopAbs_EDGE ||
+ myShapeType==TopAbs_FACE ||
+ myShapeType==TopAbs_SOLID)) {
myErrorStatus=12; // unallowed subshape type
return;
}
//
if (myShapeType==TopAbs_VERTEX){
if (bIsConformState) {
- myMSS.Add(aV, aSt);
+ myMSS.Add(aV, aSt);
}
}
else if (bIsConformState || aSt==TopAbs_ON) {
//
bIsConformState=myMSS.Contains(aV);
if (!bIsConformState) {
- break;// vertex has non-conformed state
+ break;// vertex has non-conformed state
}
else {
- aSt=myMSS.FindFromKey(aV);
- aSC.AppendState(aSt);
+ aSt=myMSS.FindFromKey(aV);
+ aSC.AppendState(aSt);
}
}
//
aC=BRep_Tool::Curve(aE, aT1, aT2);
bCanBeON=myClsf->CanBeON(aC);
if(!bCanBeON) {
- continue;
+ continue;
}
}
//
aIt.Initialize(aLP);
for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
if (myNbPntsMax) {
- if (iCnt > myNbPntsMax) {
- break;
- }
+ if (iCnt > myNbPntsMax) {
+ break;
+ }
}
//
const gp_Pnt& aP=aIt.Value();
myClsf->Perform();
iErr=myClsf->ErrorStatus();
if (iErr) {
- myErrorStatus=40; // point can not be classified
- return;
+ myErrorStatus=40; // point can not be classified
+ return;
}
//
aSt=myClsf->State();
//
bIsToBreak=aSC.AppendState(aSt);
if (bIsToBreak) {
- break;
+ break;
}
}
//
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
if (myShapeType==TopAbs_EDGE) {
if (bIsConformState) {
- myMSS.Add(aE, aSt);
+ myMSS.Add(aE, aSt);
}
}
else if (bIsConformState || aSt==TopAbs_ON) {
aS=BRep_Tool::Surface(aF);
bCanBeON=myClsf->CanBeON(aS);
if(!bCanBeON) {
- continue;
+ continue;
}
}
//
const TopoDS_Shape& aE=aExp.Current();
bIsConformState=myMSS.Contains(aE);
if (!bIsConformState) {
- break;// edge has non-conformed state
+ break;// edge has non-conformed state
}
else {
- aSt=myMSS.FindFromKey(aE);
- aSC.AppendState(aSt);
+ aSt=myMSS.FindFromKey(aE);
+ aSC.AppendState(aSt);
}
}
//
aIt.Initialize(aLP);
for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
if (myNbPntsMax) {
- if (iCnt > myNbPntsMax) {
- break;
- }
+ if (iCnt > myNbPntsMax) {
+ break;
+ }
}
//
const gp_Pnt& aP=aIt.Value();
myClsf->Perform();
iErr=myClsf->ErrorStatus();
if (iErr) {
- myErrorStatus=40; // point can not be classified
- return;
+ myErrorStatus=40; // point can not be classified
+ return;
}
//
aSt=myClsf->State();
//
bIsToBreak=aSC.AppendState(aSt);
if (bIsToBreak) {
- break;
+ break;
}
}
//
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
if (myShapeType==TopAbs_FACE) {
if (bIsConformState) {
- myMSS.Add(aF, aSt);
+ myMSS.Add(aF, aSt);
}
}
else if (bIsConformState || aSt==TopAbs_ON) {
const TopoDS_Shape& aF=aMF(j);
bIsConformState=myMSS.Contains(aF);
if (!bIsConformState) {
- break;// face has non-conformed state
+ break;// face has non-conformed state
}
else {
- aSt=myMSS.FindFromKey(aF);
- aSC.AppendState(aSt);
+ aSt=myMSS.FindFromKey(aF);
+ aSC.AppendState(aSt);
}
}
//
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF,
- GEOMAlgo_ListOfPnt& aLP)
+ GEOMAlgo_ListOfPnt& aLP)
{
myErrorStatus=0;
//
//
aPK.SetIds(n[k], n[k+1]);
if (aMPKI.IsBound(aPK)) {
- Standard_Integer& iCntX=aMPKI.ChangeFind(aPK);
- ++iCntX;
+ Standard_Integer& iCntX=aMPKI.ChangeFind(aPK);
+ ++iCntX;
}
else {
- aMPKI.Bind(aPK, 1);
+ aMPKI.Bind(aPK, 1);
}
}
}
aNbMax=aPK.NbMax();
pIds=(Standard_Integer*)aPK.Key();
for (k=1; k<3; ++k) {
- aNx=*(pIds+aNbMax-k);
- aMBN.Add(aNx);
+ aNx=*(pIds+aNbMax-k);
+ aMBN.Add(aNx);
}
*/
aNx=(Standard_Integer)aPK.Id(1);
aNbLinks=aMPKI.Extent();
aIt.Initialize(aMPKI);
for (; aIt.More(); aIt.Next()) {
- iCnt=aIt.Value();
- if (iCnt>1) {
- // take the first having occured inner link
- // and discretize it
- const GEOMAlgo_PassKey& aPK=aIt.Key();
- //qf
- /*
- aNbMax=aPK.NbMax();
- pIds=(Standard_Integer*)aPK.Key();
- aN1=*(pIds+aNbMax-1);
- aN2=*(pIds+aNbMax-2);
- */
- //
- aN1=(Standard_Integer)aPK.Id(1);
- aN2=(Standard_Integer)aPK.Id(2);
- //qt
- aP1=aNodes(aN1).Transformed(aTrsf);
- aP2=aNodes(aN2).Transformed(aTrsf);
- //
- if (aType==GeomAbs_Cylinder) {
- Standard_Real aTolSM;
- gp_Cylinder aCyl;
- //
- aTolSM=1.523e-6;//~1.-cos(0.1 deg)
- aCyl=aGAS.Cylinder();
- if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, aTolSM)) {
- continue;
- }
- }
- //
- BRepLib_MakeEdge aBME(aP1, aP2);
- bIsDone=aBME.IsDone();
- if (!bIsDone) {
- myErrorStatus=30; //can not obtain the line fron the link
- return;
- }
- //
- const TopoDS_Shape& aSx=aBME.Shape();
- const TopoDS_Edge& aE=TopoDS::Edge(aSx);
- //
- InnerPoints(aE, myNbPntsMin, aLP);
- break;
- }// if (iCnt>1)
+ iCnt=aIt.Value();
+ if (iCnt>1) {
+ // take the first having occured inner link
+ // and discretize it
+ const GEOMAlgo_PassKey& aPK=aIt.Key();
+ //qf
+ /*
+ aNbMax=aPK.NbMax();
+ pIds=(Standard_Integer*)aPK.Key();
+ aN1=*(pIds+aNbMax-1);
+ aN2=*(pIds+aNbMax-2);
+ */
+ //
+ aN1=(Standard_Integer)aPK.Id(1);
+ aN2=(Standard_Integer)aPK.Id(2);
+ //qt
+ aP1=aNodes(aN1).Transformed(aTrsf);
+ aP2=aNodes(aN2).Transformed(aTrsf);
+ //
+ if (aType==GeomAbs_Cylinder) {
+ Standard_Real aTolSM;
+ gp_Cylinder aCyl;
+ //
+ aTolSM=1.523e-6;//~1.-cos(0.1 deg)
+ aCyl=aGAS.Cylinder();
+ if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, aTolSM)) {
+ continue;
+ }
+ }
+ //
+ BRepLib_MakeEdge aBME(aP1, aP2);
+ bIsDone=aBME.IsDone();
+ if (!bIsDone) {
+ myErrorStatus=30; //can not obtain the line fron the link
+ return;
+ }
+ //
+ const TopoDS_Shape& aSx=aBME.Shape();
+ const TopoDS_Edge& aE=TopoDS::Edge(aSx);
+ //
+ InnerPoints(aE, myNbPntsMin, aLP);
+ break;
+ }// if (iCnt>1)
}// for (; aIt.More(); aIt.Next())
}// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder)
}// if (!aNb && myNbPntsMin) {
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
- GEOMAlgo_ListOfPnt& aLP)
+ GEOMAlgo_ListOfPnt& aLP)
{
myErrorStatus=0;
//
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
- const Standard_Integer aNbPntsMin,
- GEOMAlgo_ListOfPnt& aLP)
+ const Standard_Integer aNbPntsMin,
+ GEOMAlgo_ListOfPnt& aLP)
{
// try to fill it yourself
Standard_Boolean bInf1, bInf2;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_GlueDetector.cxx
-// Created: Wed Dec 15 11:08:09 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_GlueDetector.cxx
+// Created: Wed Dec 15 11:08:09 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_GlueAnalyser.ixx>
aIndex=aIt.Value();
const TopoDS_Shape& aVx=aMIS.FindFromKey(aIndex);
if(!j) {
- aVF=aVx;
+ aVF=aVx;
}
aLVSD.Append(aVx);
aMVProcessed.Add(aVx);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aVSD=aItS.Value();
if (!myOrigins.IsBound(aVSD)) {
- myOrigins.Bind(aVSD, aV);
+ myOrigins.Bind(aVSD, aV);
}
}
}
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aFSD=aItS.Value();
if (!myOrigins.IsBound(aFSD)) {
- myOrigins.Bind(aFSD, aNewShape);
+ myOrigins.Bind(aFSD, aNewShape);
}
}
}
aFx[1]=aLF.Last();
for (i=0; i<2; ++i) {
if (!aMFS.Contains(aFx[i])) {
- continue;// it must not be so
+ continue;// it must not be so
}
//
const TopTools_ListOfShape& aLS=aMFS.FindFromKey(aFx[i]);
aNbS=aLS.Extent();
if (aNbS!=1) {
- continue;
+ continue;
}
aSx[i]=aLS.First();
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Gluer.cxx
-// Created: Sat Dec 04 12:45:53 2004
-// Author: Peter KURNEV
-// <peter@PREFEX>
+// File: GEOMAlgo_Gluer.cxx
+// Created: Sat Dec 04 12:45:53 2004
+// Author: Peter KURNEV
+// <peter@PREFEX>
//
#include <GEOMAlgo_Gluer.ixx>
static
void GetSubShapes(const TopoDS_Shape& aS,
- TopTools_IndexedMapOfShape& aMSS);
+ TopTools_IndexedMapOfShape& aMSS);
//=======================================================================
//function : GEOMAlgo_Gluer
aNbIP=aMIP.Extent();
aIt1.Initialize(aMIP);
for(; aIt1.More(); aIt1.Next()) {
- aIP=aIt1.Key();
- if (aMIPC.Contains(aIP)) {
- continue;
- }
- //
- const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
- const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
- //
- aSelector.Clear();
- aSelector.SetBox(aBoxVP);
- //
- aNbVSD=aBBTree.Select(aSelector);
- if (!aNbVSD) {
- continue; // it must not be
- }
- //
- const TColStd_ListOfInteger& aLI=aSelector.Indices();
- aIt.Initialize(aLI);
- for (; aIt.More(); aIt.Next()) {
- aIP1=aIt.Value();
- if (aMIP.Contains(aIP1)) {
- continue;
- }
- aMIP1.Add(aIP1);
- } //for (; aIt.More(); aIt.Next()) {
+ aIP=aIt1.Key();
+ if (aMIPC.Contains(aIP)) {
+ continue;
+ }
+ //
+ const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+ const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
+ //
+ aSelector.Clear();
+ aSelector.SetBox(aBoxVP);
+ //
+ aNbVSD=aBBTree.Select(aSelector);
+ if (!aNbVSD) {
+ continue; // it must not be
+ }
+ //
+ const TColStd_ListOfInteger& aLI=aSelector.Indices();
+ aIt.Initialize(aLI);
+ for (; aIt.More(); aIt.Next()) {
+ aIP1=aIt.Value();
+ if (aMIP.Contains(aIP1)) {
+ continue;
+ }
+ aMIP1.Add(aIP1);
+ } //for (; aIt.More(); aIt.Next()) {
}//for(; aIt1.More(); aIt1.Next()) {
//
aNbIP1=aMIP1.Extent();
if (!aNbIP1) {
- break;
+ break;
}
//
aIt1.Initialize(aMIP);
for(; aIt1.More(); aIt1.Next()) {
- aIP=aIt1.Key();
- aMIPC.Add(aIP);
+ aIP=aIt1.Key();
+ aMIPC.Add(aIP);
}
//
aMIP.Clear();
aIt1.Initialize(aMIP1);
for(; aIt1.More(); aIt1.Next()) {
- aIP=aIt1.Key();
- aMIP.Add(aIP);
+ aIP=aIt1.Key();
+ aMIP.Add(aIP);
}
aMIP1.Clear();
}// while(1)
else { // SD vertices founded [ aMIPC ]
aIt1.Initialize(aMIPC);
for(j=0; aIt1.More(); aIt1.Next(), ++j) {
- aIP=aIt1.Key();
- const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
- if (!j) {
- aVF=aVP;
- }
- aLVSD.Append(aVP);
- aMVProcessed.Add(aVP);
+ aIP=aIt1.Key();
+ const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+ if (!j) {
+ aVF=aVP;
+ }
+ aLVSD.Append(aVP);
+ aMVProcessed.Add(aVP);
}
}
myImages.Bind(aVF, aLVSD);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aVSD=aItS.Value();
if (!myOrigins.IsBound(aVSD)) {
- myOrigins.Bind(aVSD, aV);
+ myOrigins.Bind(aVSD, aV);
}
}
}
const TopoDS_Face& aF=TopoDS::Face(aExp.Current());
aFR=TopoDS::Face(myOrigins.Find(aF));
if (aFR.IsSame(aF)) {
- aBB.Add(aNewShell, aF);
- continue;
+ aBB.Add(aNewShell, aF);
+ continue;
}
bIsToReverse=IsToReverse(aFR, aF);
if (bIsToReverse) {
- aFR.Reverse();
+ aFR.Reverse();
}
aBB.Add(aNewShell, aFR);
}
if (aNbSDF==1) {
bHasNewSubShape=HasNewSubShape(aS1);
if (!bHasNewSubShape) {
- aNewShape=aS1;
- aNewShape.Orientation(TopAbs_FORWARD);
+ aNewShape=aS1;
+ aNewShape.Orientation(TopAbs_FORWARD);
}
}
//
if (bHasNewSubShape) {
if (aType==TopAbs_FACE) {
- TopoDS_Face aNewFace;
- //
- const TopoDS_Face& aF1=TopoDS::Face(aS1);
- MakeFace(aF1, aNewFace);
- aNewShape=aNewFace;
+ TopoDS_Face aNewFace;
+ //
+ const TopoDS_Face& aF1=TopoDS::Face(aS1);
+ MakeFace(aF1, aNewFace);
+ aNewShape=aNewFace;
}
else if (aType==TopAbs_EDGE) {
- TopoDS_Edge aNewEdge;
- //
- const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
- MakeEdge(aE1, aNewEdge);
- aNewShape=aNewEdge;
+ TopoDS_Edge aNewEdge;
+ //
+ const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
+ MakeEdge(aE1, aNewEdge);
+ aNewShape=aNewEdge;
}
}
//
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aFSD=aItS.Value();
if (!myOrigins.IsBound(aFSD)) {
- myOrigins.Bind(aFSD, aNewShape);
+ myOrigins.Bind(aFSD, aNewShape);
}
}
}
for (j=1; j<=aNbFS; ++j) {
const TopoDS_Shape& aFS=aMFS(j);
if (aMFR.Contains(aFS)) {
- const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
- aNbSx=aLSx.Extent();
- if (aNbSx==2) {
- bFound=!bFound;
- break;
- }
+ const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
+ aNbSx=aLSx.Extent();
+ if (aNbSx==2) {
+ bFound=!bFound;
+ break;
+ }
}
}
//
//purpose :
//=======================================================================
void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
- GEOMAlgo_PassKeyShape& aPK)
+ GEOMAlgo_PassKeyShape& aPK)
{
Standard_Integer i, aNbE;
TopTools_ListOfShape aLE;
//purpose :
//=======================================================================
void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
- GEOMAlgo_PassKeyShape& aPK)
+ GEOMAlgo_PassKeyShape& aPK)
{
TopoDS_Vertex aV1, aV2;
//
//purpose :
//=======================================================================
void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
- TopoDS_Vertex& aNewVertex)
+ TopoDS_Vertex& aNewVertex)
{
Standard_Integer aNbV;
Standard_Real aTolV, aD, aDmax;
//purpose :
//=======================================================================
void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
- TopoDS_Edge& aNewEdge)
+ TopoDS_Edge& aNewEdge)
{
myErrorStatus=0;
//
//purpose :
//=======================================================================
void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
- TopoDS_Face& aNewFace)
+ TopoDS_Face& aNewFace)
{
myErrorStatus=0;
//
//
aER.Orientation(TopAbs_FORWARD);
if (!BRep_Tool::Degenerated(aER)) {
- // build p-curve
- if (bIsUPeriodic) {
- GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
- }
- BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
-
- // orient image
- bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
- if (bIsToReverse) {
- aER.Reverse();
- }
+ // build p-curve
+ if (bIsUPeriodic) {
+ GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
+ }
+ BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
+
+ // orient image
+ bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
+ if (bIsToReverse) {
+ aER.Reverse();
+ }
}
else {
- aER.Orientation(aE.Orientation());
+ aER.Orientation(aE.Orientation());
}
//
aBB.Add(newWire, aER);
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
- const TopoDS_Face& aF)
+ const TopoDS_Face& aF)
{
Standard_Boolean bRet;
Standard_Real aT, aT1, aT2, aTR, aScPr;
//purpose :
//=======================================================================
void GetSubShapes(const TopoDS_Shape& aS,
- TopTools_IndexedMapOfShape& aMSS)
+ TopTools_IndexedMapOfShape& aMSS)
{
Standard_Integer aR;
TopAbs_ShapeEnum aType;
if(myOrigins.IsBound(aS)) {
const TopoDS_Shape& aSnew=myOrigins.Find(aS);
if (!aSnew.IsSame(aS)) {
- myGenerated.Append(aSnew);
+ myGenerated.Append(aSnew);
}
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Gluer1.cxx
-// Created: Wed Jan 24 11:52:27 2007
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_Gluer1.cxx
+// Created: Wed Jan 24 11:52:27 2007
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_Gluer1.ixx>
}
//
void SetValues(const Standard_Integer aI1,
- const Standard_Integer aI2) {
+ const Standard_Integer aI2) {
myInt1=aI1;
myInt2=aI2;
}
}
//
void Values(Standard_Integer& aI1,
- Standard_Integer& aI2) const {
+ Standard_Integer& aI2) const {
aI1=myInt1;
aI2=myInt2;
}
//
static
void SortShell(const Standard_Integer ,
- GEOMAlgo_CoupleOfInteger* );
+ GEOMAlgo_CoupleOfInteger* );
static
void RefineSolid(const TopoDS_Shape& ,
- const TopTools_DataMapOfShapeShape& ,
- TopTools_DataMapOfShapeShape& );
+ const TopTools_DataMapOfShapeShape& ,
+ TopTools_DataMapOfShapeShape& );
static
void MakeFaceToReplace(const TopoDS_Face& ,
- TopoDS_Face& );
+ TopoDS_Face& );
//
//=======================================================================
//function : GEOMAlgo_Gluer1
aPKS.Clear();
aPKS.SetShapes(aS1, aS2);
if (!myMapGN.IsBound(aPKS)) {
- //some faces, wanted to unglue, are not glued at all;
- myWarningStatus=2;
- myRejectedFaces.Append(aCS);
- continue;
+ //some faces, wanted to unglue, are not glued at all;
+ myWarningStatus=2;
+ myRejectedFaces.Append(aCS);
+ continue;
}
//
const TopoDS_Shape& aFN=myMapGN.Find(aPKS);
for (; aItLS.More(); aItLS.Next()) {
const TopoDS_Shape& aS=aItLS.Value();
if (aMSF.Contains(aS)) {
- TopTools_ListOfShape& aLF=aMSF.ChangeFromKey(aS);
- aLF.Append(aFN);
+ TopTools_ListOfShape& aLF=aMSF.ChangeFromKey(aS);
+ aLF.Append(aFN);
}
else {
- TopTools_ListOfShape aLF;
- aLF.Append(aFN);
- aMSF.Add(aS, aLF);
+ TopTools_ListOfShape aLF;
+ aLF.Append(aFN);
+ aMSF.Add(aS, aLF);
}
}
}
for (; aItLS.More(); aItLS.Next()) {
const TopoDS_Shape& aFN=aItLS.Value();
if (!aMFNP.Add(aFN)) {
- continue;
+ continue;
}
//
// original face from original solid -> FD
const TopTools_ListOfShape& aLFD=myImages.Find(aFN);
aItLS1.Initialize(aLFD);
for (; aItLS1.More(); aItLS1.Next()) {
- const TopoDS_Shape& aFDx=aItLS1.Value();
- if (aMFD.Contains(aFDx)) {
- aFD=aFDx;
- bFound=Standard_True;
- break;
- }
+ const TopoDS_Shape& aFDx=aItLS1.Value();
+ if (aMFD.Contains(aFDx)) {
+ aFD=aFDx;
+ bFound=Standard_True;
+ break;
+ }
}
//if (!bFound) {...}
aMFNFD.Bind(aFN, aFD);
TopTools_ListOfShape& aLFD=myImages.ChangeFind(aFN);
aItLS.Initialize(aLFD);
for (; aItLS.More(); aItLS.Next()) {
- const TopoDS_Shape& aFDx=aItLS.Value();
- if (!aFDx.IsSame(aFD)) {
- aLFDx.Append(aFDx);
- }
+ const TopoDS_Shape& aFDx=aItLS.Value();
+ if (!aFDx.IsSame(aFD)) {
+ aLFDx.Append(aFDx);
+ }
}
aLFD=aLFDx;
//
// purpose : replace faces (aMFN) of solid aSd by new ones
//=======================================================================
void RefineSolid(const TopoDS_Shape& aSd,
- const TopTools_DataMapOfShapeShape& aMFNFD,
- TopTools_DataMapOfShapeShape& aMFNFN2)
+ const TopTools_DataMapOfShapeShape& aMFNFD,
+ TopTools_DataMapOfShapeShape& aMFNFN2)
{
TopoDS_Shape *pSh;
TopoDS_Face aF2;
for (; aItSh.More(); aItSh.Next()) {
const TopoDS_Shape& aF=aItSh.Value();
if (aMFNFD.IsBound(aF)) {
- aLF.Append(aF);
+ aLF.Append(aF);
}
}
//
//purpose :
//=======================================================================
void MakeFaceToReplace(const TopoDS_Face& aF,
- TopoDS_Face& aFR)
+ TopoDS_Face& aFR)
{
Standard_Real aTol;
Handle(Geom_Surface) aS;
// purpose :
//=======================================================================
void SortShell(const Standard_Integer n,
- GEOMAlgo_CoupleOfInteger* a)
+ GEOMAlgo_CoupleOfInteger* a)
{
Standard_Integer nd, i, j, l, d=1;
GEOMAlgo_CoupleOfInteger x;
m30:;
l=j+d;
if (a[l].Value1() < a[j].Value1()) {
- x=a[j];
- a[j]=a[l];
- a[l]=x;
- j-=d;
- if (j > -1) {
- goto m30;
- }
+ x=a[j];
+ a[j]=a[l];
+ a[l]=x;
+ j-=d;
+ if (j > -1) {
+ goto m30;
+ }
}//if (a[l] < a[j]){
}//for (i=0; i<nd; ++i)
}//while (1)
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Algo.cxx
-// Created: Sat Dec 04 12:39:47 2004
-// Author: Peter KURNEV
-// <peter@PREFEX>
+// File: GEOMAlgo_Algo.cxx
+// Created: Sat Dec 04 12:39:47 2004
+// Author: Peter KURNEV
+// <peter@PREFEX>
//
#include <GEOMAlgo_HAlgo.ixx>
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_HAlgo",
- sizeof(GEOMAlgo_HAlgo),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_HAlgo),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape",
- sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
Standard_EXPORT friend Handle_Standard_Type& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape",
- sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape",
- sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeBox",
- sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeBox),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeBox),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo",
- sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState",
- sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_ListNodeOfListOfCoupleOfShapes",
- sizeof(GEOMAlgo_ListNodeOfListOfCoupleOfShapes),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_ListNodeOfListOfCoupleOfShapes),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_ListNodeOfListOfPnt",
- sizeof(GEOMAlgo_ListNodeOfListOfPnt),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMAlgo_ListNodeOfListOfPnt),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Algo.cxx
-// Created: Sat Dec 04 12:39:47 2004
-// Author: Peter KURNEV
-// <peter@PREFEX>
+// File: GEOMAlgo_Algo.cxx
+// Created: Sat Dec 04 12:39:47 2004
+// Author: Peter KURNEV
+// <peter@PREFEX>
//
#include <GEOMAlgo_PassKey.ixx>
static
Standard_Integer NormalizedId(const Standard_Integer aId,
- const Standard_Integer aDiv);
+ const Standard_Integer aDiv);
//=======================================================================
//function :
//purpose :
//=======================================================================
void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1)
-
+
{
Clear();
myNbIds=1;
//purpose :
//=======================================================================
void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1,
- const Standard_Integer aId2)
+ const Standard_Integer aId2)
{
TColStd_ListOfInteger aLI;
//
//purpose :
//=======================================================================
void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1,
- const Standard_Integer aId2,
- const Standard_Integer aId3)
+ const Standard_Integer aId2,
+ const Standard_Integer aId3)
{
TColStd_ListOfInteger aLI;
//
//purpose :
//=======================================================================
void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1,
- const Standard_Integer aId2,
- const Standard_Integer aId3,
- const Standard_Integer aId4)
+ const Standard_Integer aId2,
+ const Standard_Integer aId3,
+ const Standard_Integer aId4)
{
TColStd_ListOfInteger aLI;
//
// purpose :
//=======================================================================
Standard_Integer NormalizedId(const Standard_Integer aId,
- const Standard_Integer aDiv)
+ const Standard_Integer aDiv)
{
Standard_Integer aMax, aTresh, aIdRet;
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_PassKeyMapHasher.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_PassKeyMapHasher.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_PassKeyMapHasher.ixx>
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_PassKeyMapHasher::HashCode(const GEOMAlgo_PassKey& aPK,
- const Standard_Integer Upper)
+ const Standard_Integer Upper)
{
return aPK.HashCode(Upper);
}
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_PassKeyMapHasher::IsEqual(const GEOMAlgo_PassKey& aPK1,
- const GEOMAlgo_PassKey& aPK2)
+ const GEOMAlgo_PassKey& aPK2)
{
return aPK1.IsEqual(aPK2);
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_PassKeyShape.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_PassKeyShape.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_PassKeyShape.ixx>
static
Standard_Integer NormalizedId(const Standard_Integer aId,
- const Standard_Integer aDiv);
+ const Standard_Integer aDiv);
//=======================================================================
//function :
//purpose :
//purpose :
//=======================================================================
void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1)
-
+
{
Standard_Integer aHC;
//
//purpose :
//=======================================================================
void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
- const TopoDS_Shape& aS2)
+ const TopoDS_Shape& aS2)
{
TopTools_ListOfShape aLS;
//
//purpose :
//=======================================================================
void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
- const TopoDS_Shape& aS2,
- const TopoDS_Shape& aS3)
+ const TopoDS_Shape& aS2,
+ const TopoDS_Shape& aS3)
{
TopTools_ListOfShape aLS;
//
//purpose :
//=======================================================================
void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
- const TopoDS_Shape& aS2,
- const TopoDS_Shape& aS3,
- const TopoDS_Shape& aS4)
+ const TopoDS_Shape& aS2,
+ const TopoDS_Shape& aS3,
+ const TopoDS_Shape& aS4)
{
TopTools_ListOfShape aLS;
//
// purpose :
//=======================================================================
Standard_Integer NormalizedId(const Standard_Integer aId,
- const Standard_Integer aDiv)
+ const Standard_Integer aDiv)
{
Standard_Integer aMax, aTresh, aIdRet;
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_PassKeyMapHasher.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_PassKeyMapHasher.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_PassKeyShapeMapHasher.ixx>
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_PassKeyShapeMapHasher::HashCode(const GEOMAlgo_PassKeyShape& aPK,
- const Standard_Integer Upper)
+ const Standard_Integer Upper)
{
return aPK.HashCode(Upper);
}
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_PassKeyShapeMapHasher::IsEqual(const GEOMAlgo_PassKeyShape& aPK1,
- const GEOMAlgo_PassKeyShape& aPK2)
+ const GEOMAlgo_PassKeyShape& aPK2)
{
return aPK1.IsEqual(aPK2);
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_ShapeAlgo.cxx
-// Created: Tue Dec 7 12:06:54 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_ShapeAlgo.cxx
+// Created: Tue Dec 7 12:06:54 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_ShapeAlgo.ixx>
//purpose :
//=======================================================================
void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
- const Standard_Integer aNb)
+ const Standard_Integer aNb)
{
Standard_Integer iN;
printf(" Width : %.3lf\n", myWidth);
}
else if (aKN==GEOMAlgo_KN_TRIANGLE ||
- aKN==GEOMAlgo_KN_QUADRANGLE||
- aKN==GEOMAlgo_KN_POLYGON) {
+ aKN==GEOMAlgo_KN_QUADRANGLE||
+ aKN==GEOMAlgo_KN_POLYGON) {
DumpLocation (myLocation);
DumpPosition (myPosition);
}
//purpose :
//=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes(const TopoDS_Shape& aS,
- GEOMAlgo_ShapeInfo& aInfo)
+ GEOMAlgo_ShapeInfo& aInfo)
{
myErrorStatus=0;
//
GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
aKNF=aInfoF.KindOfName(); // mb: sphere, torus
if (aKNF==GEOMAlgo_KN_SPHERE ||
- aKNF==GEOMAlgo_KN_TORUS) {
+ aKNF==GEOMAlgo_KN_TORUS) {
aInfo.SetKindOfName(aKNF);
aInfo.SetLocation(aInfoF.Location());
aInfo.SetPosition(aInfoF.Position());
aInfo.SetRadius1(aInfoF.Radius1());
if(aKNF==GEOMAlgo_KN_TORUS) {
- aInfo.SetRadius2(aInfoF.Radius2());
+ aInfo.SetRadius2(aInfoF.Radius2());
}
return;
}
++aNbCrc;
}
else if (aKNF==GEOMAlgo_KN_POLYGON ||
- aKNF==GEOMAlgo_KN_TRIANGLE ||
- aKNF==GEOMAlgo_KN_QUADRANGLE) {
+ aKNF==GEOMAlgo_KN_TRIANGLE ||
+ aKNF==GEOMAlgo_KN_QUADRANGLE) {
++aNbPgn;
}
//
for (j=i+1; j<=aNbF; ++j) {
if (aMp.Contains(j)) {
- continue;
+ continue;
}
//
const TopoDS_Shape& aFj=aMF(j);
//
aDot=aDNi*aDNj;
if (fabs(1.-aDot)<0.0001) {
- aMp.Add(i);
- aMp.Add(j);
- aMFi.Add(aFi);
- break;
+ aMp.Add(i);
+ aMp.Add(j);
+ aMFi.Add(aFi);
+ break;
}
//
}
//purpose :
//=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
- const gp_Pln& aPln)
+ const gp_Pln& aPln)
{
Standard_Integer aNbV, aNbE, i, j;
Standard_Real aDot, aD0, aD1, aLength, aWidth;
const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
aKNE=aInfoE.KindOfName();
if (aKNE!=GEOMAlgo_KN_SEGMENT) {
- return;
+ return;
}
}
//
aXYZc.SetCoord(0.,0.,0.);
TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
for (i=1; i<=aNbV; ++i) {
- const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
- aP=BRep_Tool::Pnt(aV);
- const gp_XYZ& aXYZ=aP.XYZ();
- aXYZc=aXYZc+aXYZ;
- aPx[i-1]=aP;
+ const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
+ aP=BRep_Tool::Pnt(aV);
+ const gp_XYZ& aXYZ=aP.XYZ();
+ aXYZc=aXYZc+aXYZ;
+ aPx[i-1]=aP;
}
aXYZc.Divide(3.);
//
j=(i==3) ? 0 : i+1;
aDot=aDx[i]*aDx[j];
if (fabs (aDot) > myTolerance) {
- aInfo.SetKindOfName(GEOMAlgo_KN_QUADRANGLE);
- return;
+ aInfo.SetKindOfName(GEOMAlgo_KN_QUADRANGLE);
+ return;
}
}
//
//purpose :
//=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
- const gp_Sphere& )
+ const gp_Sphere& )
{
Standard_Integer aNbV, aNbE, aNbSE, aNbDE;
TopoDS_Edge aE;
aKSE=aInfoE.KindOfShape();
//
if (BRep_Tool::IsClosed(aE, aF)) {
- ++aNbSE;
+ ++aNbSE;
}
else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
- ++aNbDE;
+ ++aNbDE;
}
}
}
//purpose :
//=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
- const gp_Cone& )//aCone)
+ const gp_Cone& )//aCone)
{
Standard_Integer aNbV, aNbE, aNbCE, aNbSE, aNbDE, i;
Standard_Real aR[3], aHeight;
aKCE=aInfoE.KindOfClosed();
aKSE=aInfoE.KindOfShape();
if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
- aPC[i]=aInfoE.Location();
- aR[i]=aInfoE.Radius1();
- //
- aIt.Initialize(aE);
- for (; aIt.More(); aIt.Next()) {
- aVD=TopoDS::Vertex(aIt.Value());
- break;
- }
- aPX[i]=BRep_Tool::Pnt(aVD);
- //
- ++i;
- ++aNbCE;
+ aPC[i]=aInfoE.Location();
+ aR[i]=aInfoE.Radius1();
+ //
+ aIt.Initialize(aE);
+ for (; aIt.More(); aIt.Next()) {
+ aVD=TopoDS::Vertex(aIt.Value());
+ break;
+ }
+ aPX[i]=BRep_Tool::Pnt(aVD);
+ //
+ ++i;
+ ++aNbCE;
}
else if (aKNE==GEOMAlgo_KN_SEGMENT) {
- if (BRep_Tool::IsClosed(aE, aF)) {
- ++aNbSE;
- }
+ if (BRep_Tool::IsClosed(aE, aF)) {
+ ++aNbSE;
+ }
}
else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
- aIt.Initialize(aE);
- for (; aIt.More(); aIt.Next()) {
- aVD=TopoDS::Vertex(aIt.Value());
- break;
- }
- //
- aPD=BRep_Tool::Pnt(aVD);
- //
- ++aNbDE;
+ aIt.Initialize(aE);
+ for (; aIt.More(); aIt.Next()) {
+ aVD=TopoDS::Vertex(aIt.Value());
+ break;
+ }
+ //
+ aPD=BRep_Tool::Pnt(aVD);
+ //
+ ++aNbDE;
}
}
}
//purpose :
//=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
- const gp_Cylinder& aCyl)
+ const gp_Cylinder& aCyl)
{
Standard_Integer i, aNbV, aNbE, aNbCE, aNbSE;
Standard_Real aT0, aT1, aHeight;
aKNE=aInfoE.KindOfName();
aKCE=aInfoE.KindOfClosed();
if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
- aPC[aNbCE]=aInfoE.Location();
- ++aNbCE;
+ aPC[aNbCE]=aInfoE.Location();
+ ++aNbCE;
}
else if (aKNE==GEOMAlgo_KN_SEGMENT) {
- if (BRep_Tool::IsClosed(aE, aF)) {
- ++aNbSE;
- }
+ if (BRep_Tool::IsClosed(aE, aF)) {
+ ++aNbSE;
+ }
}
}
}
//purpose :
//=======================================================================
void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
- const gp_Torus& )
+ const gp_Torus& )
{
Standard_Integer aNbV, aNbE, aNbSE;
TopoDS_Edge aE;
if (aM.Add(aE)) {
//const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
if (BRep_Tool::IsClosed(aE, aF)) {
- ++aNbSE;
+ ++aNbSE;
}
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_ShapeSet.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_ShapeSet.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_ShapeSet.ixx>
//purpose :
//=======================================================================
void GEOMAlgo_ShapeSet::Add(const TopoDS_Shape& theShape,
- const TopAbs_ShapeEnum theType)
+ const TopAbs_ShapeEnum theType)
{
TopExp_Explorer aExp;
//
if (aOr==TopAbs_FORWARD || aOr==TopAbs_REVERSED) {
bRet=myMap.Contains(aF);
if (!bRet) {
- break;
+ break;
}
}
}
const TopoDS_Shape& aS=aIt.Value();
if (!theOther.myMap.Contains(aS)) {
if(myMap.Add(aS)){
- aLS.Append(aS);
+ aLS.Append(aS);
}
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_ShapeSolid.cxx
-// Created: Thu Jan 13 12:54:48 2005
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_ShapeSolid.cxx
+// Created: Thu Jan 13 12:54:48 2005
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_ShapeSolid.ixx>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_ShellSolid.cxx
-// Created: Wed Jan 12 12:49:45 2005
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_ShellSolid.cxx
+// Created: Wed Jan 12 12:49:45 2005
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_ShellSolid.ixx>
const BOPTools_ListOfPaveBlock& aSectEdges=aBC.NewPaveBlocks();
aNbS=aSectEdges.Extent();
if (aNbS) {
- break;
+ break;
}
}
//
for (; anExp.More(); anExp.Next()) {
const TopoDS_Edge& aE=TopoDS::Edge(anExp.Current());
if (BRep_Tool::Degenerated(aE)) {
- continue;
+ continue;
}
//
nE=aDS.ShapeIndex(aE, myRank);
aNbPB=aLPB.Extent();
//
if (aNbPB<2) {
- nSp=nE;
- if (aNbPB) {
- const BOPTools_PaveBlock& aPB=aLPB.First();
- nSp=aPB.Edge();
- }
- const TopoDS_Shape& aSp=aDS.Shape(nSp);
- //
- aState=aDS.GetState(nSp);
- if (aState==BooleanOperations_IN) {
- myLSIN.Append(aF1);
- }
- else if (aState==BooleanOperations_OUT) {
- myLSOUT.Append(aF1);
- }
- else if (aState==BooleanOperations_ON) {
- Standard_Real aTol;
- TopAbs_State aSt;
- //
- //const TopoDS_Face& aF2=TopoDS::Face(aDS.Shape((iRank1==myRank)? nF2 : nF1));
- //aTol=BRep_Tool::Tolerance(aF2);
- aTol=1.e-7;
- //
- BOPTools_Tools3D::PointNearEdge(aE, aF1, aP2D, aP3D);
- const TopoDS_Solid& aRefSolid=(myRank==1) ?
- TopoDS::Solid(aDS.Tool()) : TopoDS::Solid(aDS.Object());
- //
- BOPTools_PaveFiller* pPF=(BOPTools_PaveFiller*)& aPaveFiller;
- IntTools_Context& aCtx=pPF->ChangeContext();
- //
- BRepClass3d_SolidClassifier& aSC=aCtx.SolidClassifier(aRefSolid);
- aSC.Perform(aP3D, aTol);
- aSt=aSC.State();
- if (aSt==TopAbs_IN) {
- myLSIN.Append(aF1);
- }
- else if (aSt==TopAbs_OUT) {
- myLSOUT.Append(aF1);
- }
- }
- break;
+ nSp=nE;
+ if (aNbPB) {
+ const BOPTools_PaveBlock& aPB=aLPB.First();
+ nSp=aPB.Edge();
+ }
+ const TopoDS_Shape& aSp=aDS.Shape(nSp);
+ //
+ aState=aDS.GetState(nSp);
+ if (aState==BooleanOperations_IN) {
+ myLSIN.Append(aF1);
+ }
+ else if (aState==BooleanOperations_OUT) {
+ myLSOUT.Append(aF1);
+ }
+ else if (aState==BooleanOperations_ON) {
+ Standard_Real aTol;
+ TopAbs_State aSt;
+ //
+ //const TopoDS_Face& aF2=TopoDS::Face(aDS.Shape((iRank1==myRank)? nF2 : nF1));
+ //aTol=BRep_Tool::Tolerance(aF2);
+ aTol=1.e-7;
+ //
+ BOPTools_Tools3D::PointNearEdge(aE, aF1, aP2D, aP3D);
+ const TopoDS_Solid& aRefSolid=(myRank==1) ?
+ TopoDS::Solid(aDS.Tool()) : TopoDS::Solid(aDS.Object());
+ //
+ BOPTools_PaveFiller* pPF=(BOPTools_PaveFiller*)& aPaveFiller;
+ IntTools_Context& aCtx=pPF->ChangeContext();
+ //
+ BRepClass3d_SolidClassifier& aSC=aCtx.SolidClassifier(aRefSolid);
+ aSC.Perform(aP3D, aTol);
+ aSt=aSC.State();
+ if (aSt==TopAbs_IN) {
+ myLSIN.Append(aF1);
+ }
+ else if (aSt==TopAbs_OUT) {
+ myLSOUT.Append(aF1);
+ }
+ }
+ break;
} // if (aNbPB<2) {
} //for (; anExp.More(); anExp.Next())
}
iZone=0;
TopTools_ListIteratorOfListOfShape anIt(aLF);
for (; anIt.More(); anIt.Next()) {
- const TopoDS_Shape& aFR=anIt.Value();
+ const TopoDS_Shape& aFR=anIt.Value();
- if (aFR.ShapeType()==TopAbs_FACE) {
- const TopoDS_Face& aFaceResult=TopoDS::Face(aFR);
- //
- Standard_Boolean bIsValidIn2D, bNegativeFlag;
- bIsValidIn2D=BOPTools_Tools3D::IsValidArea (aFaceResult, bNegativeFlag);
- if (bIsValidIn2D) {
- //if(CheckSameDomainFaceInside(aFaceResult, aF2)) {
- iZone=1;
- break;
- //}
- }
- //
- }
+ if (aFR.ShapeType()==TopAbs_FACE) {
+ const TopoDS_Face& aFaceResult=TopoDS::Face(aFR);
+ //
+ Standard_Boolean bIsValidIn2D, bNegativeFlag;
+ bIsValidIn2D=BOPTools_Tools3D::IsValidArea (aFaceResult, bNegativeFlag);
+ if (bIsValidIn2D) {
+ //if(CheckSameDomainFaceInside(aFaceResult, aF2)) {
+ iZone=1;
+ break;
+ //}
+ }
+ //
+ }
}
if (iZone) {
- bFlag=Standard_True;
- aFF.SetStatesMap(aWESFiller.StatesMap());
+ bFlag=Standard_True;
+ aFF.SetStatesMap(aWESFiller.StatesMap());
}
}// if (iSenseFlag)
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_SolidSolid.cxx
-// Created: Wed Jan 26 12:06:26 2005
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_SolidSolid.cxx
+// Created: Wed Jan 26 12:06:26 2005
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_SolidSolid.ixx>
const TopoDS_Shape& aF=aMF(j);
//
if (!aMFS.Contains(aF)) {// the face is intesected
- ++aNbFINTR;
- break;
+ ++aNbFINTR;
+ break;
}
//
aState=aMFS.FindFromKey(aF);
switch (aState) {
case TopAbs_IN:
- ++aNbFIN;
- break;
- case TopAbs_OUT:
- ++aNbFOUT;
- break;
- case TopAbs_ON:
- ++aNbFON;
- break;
- default:
- break;
+ ++aNbFIN;
+ break;
+ case TopAbs_OUT:
+ ++aNbFOUT;
+ break;
+ case TopAbs_ON:
+ ++aNbFON;
+ break;
+ default:
+ break;
}
if (aNbFIN && aNbFOUT) {
- ++aNbFINTR;
- break;
+ ++aNbFINTR;
+ break;
}
}
//
if (!aNbFINTR) {
if (aNbFON==aNbF) {
- myLSON.Append(aSolid);
+ myLSON.Append(aSolid);
}
else if (aNbFIN) {
- myLSIN.Append(aSolid);
+ myLSIN.Append(aSolid);
}
else if (aNbFOUT) {
- myLSOUT.Append(aSolid);
+ myLSOUT.Append(aSolid);
}
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_StateCollector.cxx
-// Created: Thu Mar 10 09:42:11 2005
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_StateCollector.cxx
+// Created: Thu Mar 10 09:42:11 2005
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_StateCollector.ixx>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_SurfaceTools.cxx
-// Created: Thu Jan 27 11:05:16 2005
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_SurfaceTools.cxx
+// Created: Thu Jan 27 11:05:16 2005
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_SurfaceTools.ixx>
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
- const GeomAdaptor_Surface& aGAS,
- const Standard_Real aTol,
- TopAbs_State& aState)
+ const GeomAdaptor_Surface& aGAS,
+ const Standard_Real aTol,
+ TopAbs_State& aState)
{
Standard_Integer iErr;
Standard_Real aDp, aR;
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
- const Handle(Geom_Surface)& aSurf,
- const Standard_Real aTol,
- TopAbs_State& aState)
+ const Handle(Geom_Surface)& aSurf,
+ const Standard_Real aTol,
+ TopAbs_State& aState)
{
Standard_Integer iErr;
GeomAdaptor_Surface aGAS;
//purpose :
//=======================================================================
Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
- const gp_Sphere& aSph)
+ const gp_Sphere& aSph)
{
Standard_Real aD;
//
//purpose :
//=======================================================================
Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
- const gp_Cylinder& aCyl)
+ const gp_Cylinder& aCyl)
{
Standard_Real aD;
//
//purpose :
//=======================================================================
Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
- const gp_Pln& aPL)
+ const gp_Pln& aPL)
{
Standard_Real aD;
//
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
- const gp_Pnt& aP2,
- const gp_Cylinder& aCyl,
- const Standard_Real aTol)
+ const gp_Pnt& aP2,
+ const gp_Cylinder& aCyl,
+ const Standard_Real aTol)
{
Standard_Boolean bRet=Standard_False;
Standard_Real aSM;
aGAS.Load(aSurf);
aType=aGAS.GetType();
bRet=(aType==GeomAbs_Plane ||
- aType==GeomAbs_Cylinder ||
- aType==GeomAbs_Sphere);
+ aType==GeomAbs_Cylinder ||
+ aType==GeomAbs_Sphere);
return bRet;
}
//=======================================================================
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState(const TopAbs_State aST1,
- const GEOMAlgo_State aST2)
+ const GEOMAlgo_State aST2)
{
Standard_Boolean bRet=Standard_False;
//
switch (aST2) {
case GEOMAlgo_ST_IN:
if (aST1==TopAbs_IN) {
- bRet=!bRet;
+ bRet=!bRet;
}
break;
case GEOMAlgo_ST_OUT:
if (aST1==TopAbs_OUT) {
- bRet=!bRet;
+ bRet=!bRet;
}
break;
case GEOMAlgo_ST_ON:
if (aST1==TopAbs_ON) {
- bRet=!bRet;
+ bRet=!bRet;
}
break;
case GEOMAlgo_ST_ONIN:
if (aST1==TopAbs_ON || aST1==TopAbs_IN) {
- bRet=!bRet;
+ bRet=!bRet;
}
break;
case GEOMAlgo_ST_ONOUT:
if (aST1==TopAbs_ON || aST1==TopAbs_OUT) {
- bRet=!bRet;
+ bRet=!bRet;
}
break;
default:
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Tools.cxx
-// Created: Mon Dec 6 11:35:29 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_Tools.cxx
+// Created: Mon Dec 6 11:35:29 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_Tools.ixx>
static
void GetCount(const TopoDS_Shape& aS,
- Standard_Integer& iCnt);
+ Standard_Integer& iCnt);
//=======================================================================
//function : IsCompositeShape
//purpose :
//=======================================================================
void GetCount(const TopoDS_Shape& aS,
- Standard_Integer& iCnt)
+ Standard_Integer& iCnt)
{
TopoDS_Iterator aIt;
TopAbs_ShapeEnum aTS;
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_Tools::RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMPKLE,
- const Standard_Real aTol,
- IntTools_Context& aCtx)
+ const Standard_Real aTol,
+ IntTools_Context& aCtx)
{
Standard_Integer i, aNbE, iErr, j, aNbEE, aNbToAdd;
TopTools_IndexedDataMapOfShapeListOfShape aMEE, aMSDE, aMEToAdd;
TopTools_ListOfShape& aLEE=aMEE.ChangeFromIndex(j);
//
if (j==1) {
- aLSDE.Clear();
- aLSDE.Append(aLEE);
+ aLSDE.Clear();
+ aLSDE.Append(aLEE);
}
else {
- const TopoDS_Shape& aE1=aLEE.First();
- aMEToAdd.Add(aE1, aLEE);
+ const TopoDS_Shape& aE1=aLEE.First();
+ aMEToAdd.Add(aE1, aLEE);
}
}
}
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopTools_ListOfShape& aLE,
- const Standard_Real aTol,
- TopTools_IndexedDataMapOfShapeListOfShape& aMEE,
- IntTools_Context& aCtx)
+ const Standard_Real aTol,
+ TopTools_IndexedDataMapOfShapeListOfShape& aMEE,
+ IntTools_Context& aCtx)
{
Standard_Integer aNbE, aNbEProcessed, aNbESD, iErr;
TopTools_ListOfShape aLESD;
const TopoDS_Shape& aS=aIt.Value();
//
if (aMProcessed.Contains(aS)) {
- continue;
+ continue;
}
//
//modified by NIZNHY-PKV Thu Dec 30 10:57:01 2004 f
aType=aS.ShapeType();
if (aType==TopAbs_EDGE) {
- const TopoDS_Edge& aE=TopoDS::Edge(aS);
- if (BRep_Tool::Degenerated(aE)) {
- aMProcessed.Add(aE);
- continue;
- }
+ const TopoDS_Edge& aE=TopoDS::Edge(aS);
+ if (BRep_Tool::Degenerated(aE)) {
+ aMProcessed.Add(aE);
+ continue;
+ }
}
//modified by NIZNHY-PKV Thu Dec 30 10:57:03 2004 t
//
aLESD.Clear();
iErr=GEOMAlgo_Tools::FindSDShapes(aS, aLE, aTol, aLESD, aCtx);
if (iErr) {
- return 2; // Err
+ return 2; // Err
}
//
aNbESD=aLESD.Extent();
if (!aNbESD) {
- return 1; // Err
+ return 1; // Err
}
//
aMEE.Add(aS, aLESD);
//
aIt1.Initialize(aLESD);
for (; aIt1.More(); aIt1.Next()) {
- const TopoDS_Shape& aE1=aIt1.Value();
- aMProcessed.Add(aE1);
+ const TopoDS_Shape& aE1=aIt1.Value();
+ aMProcessed.Add(aE1);
}
}
}
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopoDS_Shape& aE1,
- const TopTools_ListOfShape& aLE,
- const Standard_Real aTol,
- TopTools_ListOfShape& aLESD,
- IntTools_Context& aCtx)
+ const TopTools_ListOfShape& aLE,
+ const Standard_Real aTol,
+ TopTools_ListOfShape& aLESD,
+ IntTools_Context& aCtx)
{
Standard_Boolean bIsDone;
Standard_Real aTol2, aD2;
else {
bIsDone=GEOMAlgo_Tools::ProjectPointOnShape(aP1, aE2, aP2, aCtx);
if (!bIsDone) {
- //return 1;
- continue; // jfa BUG 20361
+ //return 1;
+ continue; // jfa BUG 20361
}
aD2=aP1.SquareDistance(aP2);
if(aD2<aTol2) {
- aLESD.Append(aE2);
+ aLESD.Append(aE2);
}
}
}
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1,
- const TopoDS_Shape& aS,
- gp_Pnt& aP2,
- IntTools_Context& aCtx)
+ const TopoDS_Shape& aS,
+ gp_Pnt& aP2,
+ IntTools_Context& aCtx)
{
Standard_Boolean bIsDone = Standard_False;
Standard_Real aT2;
//purpose :
//=======================================================================
void GEOMAlgo_Tools::PointOnShape(const TopoDS_Shape& aS,
- gp_Pnt& aP3D)
+ gp_Pnt& aP3D)
{
TopAbs_ShapeEnum aType;
//
//purpose :
//=======================================================================
void GEOMAlgo_Tools::PointOnFace(const TopoDS_Face& aF,
- gp_Pnt& aP3D)
+ gp_Pnt& aP3D)
{
Standard_Real aU, aV, aUMin, aUMax, aVMin, aVMax;
//
//purpose :
//=======================================================================
void GEOMAlgo_Tools::PointOnFace(const TopoDS_Face& aF,
- const Standard_Real aU,
- const Standard_Real aV,
- gp_Pnt& aP3D)
+ const Standard_Real aU,
+ const Standard_Real aV,
+ gp_Pnt& aP3D)
{
Handle(Geom_Surface) aS;
//
//purpose :
//=======================================================================
void GEOMAlgo_Tools::PointOnEdge(const TopoDS_Edge& aE,
- gp_Pnt& aP3D)
+ gp_Pnt& aP3D)
{
Standard_Real aTx, aT1, aT2;
//
//purpose :
//=======================================================================
void GEOMAlgo_Tools::PointOnEdge(const TopoDS_Edge& aE,
- const Standard_Real aT,
- gp_Pnt& aP3D)
+ const Standard_Real aT,
+ gp_Pnt& aP3D)
{
Standard_Real aT1, aT2;
Handle(Geom_Curve) aC3D;
//purpose :
//=======================================================================
void GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- const Standard_Real aUMin,
- const Standard_Real aUMax)
+ const TopoDS_Face& aF,
+ const Standard_Real aUMin,
+ const Standard_Real aUMax)
{
Standard_Real aT1, aT2, aTx, aUx, aTol, aTwoPI;
gp_Pnt2d aP2D;
aGAS.Load(aS);
aType=aGAS.GetType();
bRet=(aType==GeomAbs_Cylinder||
- aType==GeomAbs_Cone ||
- aType==GeomAbs_Sphere);
+ aType==GeomAbs_Cone ||
+ aType==GeomAbs_Sphere);
//
return bRet;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Tools3D.cxx
-// Created:
-// Author: Peter KURNEV
+// File: GEOMAlgo_Tools3D.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_Tools3D.ixx>
//
static
Standard_Boolean FindFacePairs (const TopoDS_Edge& ,
- const TopTools_ListOfShape& ,
- NMTTools_ListOfCoupleOfShape& );
+ const TopTools_ListOfShape& ,
+ NMTTools_ListOfCoupleOfShape& );
static
Standard_Real AngleWithRef(const gp_Dir& ,
- const gp_Dir& ,
- const gp_Dir& );
+ const gp_Dir& ,
+ const gp_Dir& );
static
void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- Standard_Real aT,
- gp_Pnt& aPF,
- gp_Dir& aDNF,
- IntTools_Context& aCtx);
+ const TopoDS_Face& aF,
+ Standard_Real aT,
+ gp_Pnt& aPF,
+ gp_Dir& aDNF,
+ IntTools_Context& aCtx);
//=======================================================================
//function : IsInternalFace
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
- const TopoDS_Solid& theSolid,
- const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
- const Standard_Real theTol,
- IntTools_Context& theContext)
+ const TopoDS_Solid& theSolid,
+ const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
+ const Standard_Real theTol,
+ IntTools_Context& theContext)
{
Standard_Boolean bRet;
Standard_Integer aNbF;
const TopoDS_Face& aF2=TopoDS::Face(aLF.Last());
//
if (aF2.IsSame(aF1) && BRep_Tool::IsClosed(aE, aF1)) {
- // treat as it was for 1 face
- bRet=GEOMAlgo_Tools3D::IsInternalFace(theFace, aE, aF1, aF2, theContext);
- return bRet;
+ // treat as it was for 1 face
+ bRet=GEOMAlgo_Tools3D::IsInternalFace(theFace, aE, aF1, aF2, theContext);
+ return bRet;
}
}
if (aNbF%2) {
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
- const TopoDS_Edge& theEdge,
- const TopTools_ListOfShape& theLF,
- IntTools_Context& theContext)
+ const TopoDS_Edge& theEdge,
+ const TopTools_ListOfShape& theLF,
+ IntTools_Context& theContext)
{
Standard_Boolean bRet;
Standard_Boolean aNbF;
const TopoDS_Face& aF2=TopoDS::Face(aCSFF.Shape2());
bRet=GEOMAlgo_Tools3D::IsInternalFace(theFace, theEdge, aF1, aF2, theContext);
if (bRet) {
- return bRet;
+ return bRet;
}
}
}
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
- const TopoDS_Edge& theEdge,
- const TopoDS_Face& theFace1,
- const TopoDS_Face& theFace2,
- IntTools_Context& theContext)
+ const TopoDS_Edge& theEdge,
+ const TopoDS_Face& theFace1,
+ const TopoDS_Face& theFace2,
+ IntTools_Context& theContext)
{
Standard_Boolean bRet;
Standard_Real aT1, aT2, aT, aDt2D, aDt2Dx;
//purpose :
//=======================================================================
void GEOMAlgo_Tools3D::GetFaceOff(const TopoDS_Edge& theE1,
- const TopoDS_Face& theF1,
- const NMTTools_ListOfCoupleOfShape& theLCSOff,
- TopoDS_Face& theFOff)
+ const TopoDS_Face& theF1,
+ const NMTTools_ListOfCoupleOfShape& theLCSOff,
+ TopoDS_Face& theFOff)
{
Standard_Real aT, aT1, aT2, aAngle, aTwoPI, aAngleMin;
gp_Pnt aPn1, aPn2;
// Angle
aAngle=AngleWithRef(aDN1, aDN2, aDTtgt);
if(aAngle<0.) {
- aAngle=aTwoPI+aAngle;
+ aAngle=aTwoPI+aAngle;
}
}
//
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOnFace(const TopoDS_Edge& theE1,
- const TopoDS_Face& theF2,
- TopoDS_Edge& theE2)
+ const TopoDS_Face& theF2,
+ TopoDS_Edge& theE2)
{
Standard_Boolean bFound;
TopoDS_Iterator aItF, aItW;
for (; aItW.More(); aItW.Next()) {
const TopoDS_Shape& aE=aItW.Value();
if (aE.IsSame(theE1)) {
- theE2=TopoDS::Edge(aE);
- bFound=!bFound;
- return bFound;
+ theE2=TopoDS::Edge(aE);
+ bFound=!bFound;
+ return bFound;
}
}
}
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff(const TopoDS_Edge& theE1,
- const TopoDS_Face& theF2,
- TopoDS_Edge& theE2)
+ const TopoDS_Face& theF2,
+ TopoDS_Edge& theE2)
{
Standard_Boolean bFound;
if (aEF2.IsSame(theE1)) {
aOr2=aEF2.Orientation();
if (aOr2==aOr1C) {
- theE2=aEF2;
- bFound=!bFound;
- return bFound;
+ theE2=aEF2;
+ bFound=!bFound;
+ return bFound;
}
}
}
// purpose:
//=======================================================================
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Face& theF,
- const TopoDS_Solid& theRef,
- const Standard_Real theTol,
- const TopTools_IndexedMapOfShape& theBounds,
- IntTools_Context& theCtx)
+ const TopoDS_Solid& theRef,
+ const Standard_Real theTol,
+ const TopTools_IndexedMapOfShape& theBounds,
+ IntTools_Context& theCtx)
{
TopAbs_State aState;
TopExp_Explorer aExp;
// purpose:
//=======================================================================
TopAbs_State GEOMAlgo_Tools3D::ComputeStateByOnePoint(const TopoDS_Shape& theS,
- const TopoDS_Solid& theRef,
- const Standard_Real theTol,
- IntTools_Context& theCtx)
+ const TopoDS_Solid& theRef,
+ const Standard_Real theTol,
+ IntTools_Context& theCtx)
{
TopAbs_State aState;
TopAbs_ShapeEnum aType;
// purpose:
//=======================================================================
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Vertex& theV,
- const TopoDS_Solid& theRef,
- const Standard_Real theTol,
- IntTools_Context& theCtx)
+ const TopoDS_Solid& theRef,
+ const Standard_Real theTol,
+ IntTools_Context& theCtx)
{
TopAbs_State aState;
gp_Pnt aP3D;
// purpose:
//=======================================================================
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Edge& theE,
- const TopoDS_Solid& theRef,
- const Standard_Real theTol,
- IntTools_Context& theCtx)
+ const TopoDS_Solid& theRef,
+ const Standard_Real theTol,
+ IntTools_Context& theCtx)
{
Standard_Real aT1, aT2, aT = 0.;
TopAbs_State aState;
// purpose:
//=======================================================================
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const gp_Pnt& theP,
- const TopoDS_Solid& theRef,
- const Standard_Real theTol,
- IntTools_Context& theCtx)
+ const TopoDS_Solid& theRef,
+ const Standard_Real theTol,
+ IntTools_Context& theCtx)
{
TopAbs_State aState;
//
// purpose:
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Shape& theSp,
- const TopoDS_Shape& theSr,
- IntTools_Context& theCtx)
+ const TopoDS_Shape& theSr,
+ IntTools_Context& theCtx)
{
Standard_Boolean bRet;
TopAbs_ShapeEnum aType;
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Face& theFSp,
- const TopoDS_Face& theFSr,
- IntTools_Context& theContext)
+ const TopoDS_Face& theFSr,
+ IntTools_Context& theContext)
{
Standard_Boolean bRet, bFound, bInFace;
Standard_Real aT1, aT2, aT, aU, aV, aScPr;
aESp=TopoDS::Edge(anExp.Current());
if (!BRep_Tool::Degenerated(aESp)) {
if (!BRep_Tool::IsClosed(aESp, theFSp)) {
- bFound=!bFound;
- break;
+ bFound=!bFound;
+ break;
}
}
}
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Edge& theSplit,
- const TopoDS_Edge& theEdge,
- IntTools_Context& theContext)
+ const TopoDS_Edge& theEdge,
+ IntTools_Context& theContext)
{
Standard_Boolean bRet, aFlag, bIsDegenerated;
Standard_Real aTE, aTS, aScPr, aTa, aTb, aT1, aT2;
bRet=Standard_False;
//
bIsDegenerated=(BRep_Tool::Degenerated(theSplit) ||
- BRep_Tool::Degenerated(theEdge));
+ BRep_Tool::Degenerated(theEdge));
if (bIsDegenerated) {
return bRet;
}
// purpose:
//=======================================================================
Standard_Integer GEOMAlgo_Tools3D::Sense (const TopoDS_Face& theF1,
- const TopoDS_Face& theF2)
+ const TopoDS_Face& theF2)
{
Standard_Integer iSense=0;
gp_Dir aDNF1, aDNF2;
aE1=TopoDS::Edge(anExp.Current());
if (!BRep_Tool::Degenerated(aE1)) {
if (!BRep_Tool::IsClosed(aE1, theF1)) {
- break;
+ break;
}
}
}
aE2=TopoDS::Edge(anExp.Current());
if (!BRep_Tool::Degenerated(aE2)) {
if (!BRep_Tool::IsClosed(aE2, theF2)) {
- if (aE2.IsSame(aE1)) {
- iSense=1;
- break;
- }
+ if (aE2.IsSame(aE1)) {
+ iSense=1;
+ break;
+ }
}
}
}
// purpose:
//=======================================================================
void GEOMAlgo_Tools3D::CopyFace (const TopoDS_Face& theF1,
- TopoDS_Face& theF2)
+ TopoDS_Face& theF2)
{
Standard_Real aTol;
TopLoc_Location aLoc;
// purpose:
//=======================================================================
void GEOMAlgo_Tools3D::MakeContainer(const TopAbs_ShapeEnum theType,
- TopoDS_Shape& theC)
+ TopoDS_Shape& theC)
{
BRep_Builder aBB;
//
// purpose:
//=======================================================================
void GEOMAlgo_Tools3D::MakeConnexityBlock (const TopTools_ListOfShape& theLFIn,
- const TopTools_IndexedMapOfShape& theMEAvoid,
- TopTools_ListOfShape& theLCB)
+ const TopTools_IndexedMapOfShape& theMEAvoid,
+ TopTools_ListOfShape& theLCB)
{
Standard_Integer aNbF, aNbAdd1;
TopExp_Explorer aExp;
//aMAdd1.Clear();
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
- const TopoDS_Shape& aE=aExp.Current();
- if (theMEAvoid.Contains(aE)){
- continue;
- }
- //
- const TopTools_ListOfShape& aLF=aMEF.FindFromKey(aE);
- aIt.Initialize(aLF);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aFx=aIt.Value();
- if (aFx.IsSame(aF)) {
- continue;
- }
- if (aMCB.Contains(aFx)) {
- continue;
- }
- aMAdd1.Add(aFx);
- }
+ const TopoDS_Shape& aE=aExp.Current();
+ if (theMEAvoid.Contains(aE)){
+ continue;
+ }
+ //
+ const TopTools_ListOfShape& aLF=aMEF.FindFromKey(aE);
+ aIt.Initialize(aLF);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aFx=aIt.Value();
+ if (aFx.IsSame(aF)) {
+ continue;
+ }
+ if (aMCB.Contains(aFx)) {
+ continue;
+ }
+ aMAdd1.Add(aFx);
+ }
}//for (; aExp.More(); aExp.Next()){
aMCB.Add(aF);
}// for (; aItM.More(); aItM.Next()) {
//purpose :
//=======================================================================
Standard_Boolean FindFacePairs (const TopoDS_Edge& theE,
- const TopTools_ListOfShape& thLF,
- NMTTools_ListOfCoupleOfShape& theLCFF)
+ const TopTools_ListOfShape& thLF,
+ NMTTools_ListOfCoupleOfShape& theLCFF)
{
Standard_Boolean bFound;
Standard_Integer i, aNbCEF;
aOr=aEx.Orientation();
//
if (!i) {
- aOrC=TopAbs::Reverse(aOr);
- aE1=TopoDS::Edge(aEx);
- aF1=TopoDS::Face(aFx);
- aMFP.Add(aFx);
- continue;
+ aOrC=TopAbs::Reverse(aOr);
+ aE1=TopoDS::Edge(aEx);
+ aF1=TopoDS::Face(aFx);
+ aMFP.Add(aFx);
+ continue;
}
//
if (aOr==aOrC) {
- aLCEFx.Append(aCSx);
- aMFP.Add(aFx);
+ aLCEFx.Append(aCSx);
+ aMFP.Add(aFx);
}
}
//
const NMTTools_CoupleOfShape& aCSx=aIt.Value();
const TopoDS_Shape& aFx=aCSx.Shape2();
if (!aMFP.Contains(aFx)) {
- aLCEF.Append(aCSx);
+ aLCEF.Append(aCSx);
}
}
//
//purpose :
//=======================================================================
Standard_Real AngleWithRef(const gp_Dir& theD1,
- const gp_Dir& theD2,
- const gp_Dir& theDRef)
+ const gp_Dir& theD2,
+ const gp_Dir& theDRef)
{
Standard_Real aCosinus, aSinus, aBeta, aHalfPI, aScPr;
gp_XYZ aXYZ;
//purpose :
//=======================================================================
void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx,
- const TopoDS_Face& aFx,
- Standard_Real aT,
- gp_Pnt& aPF,
- gp_Dir& aDNF,
- IntTools_Context& aCtx)
+ const TopoDS_Face& aFx,
+ Standard_Real aT,
+ gp_Pnt& aPF,
+ gp_Dir& aDNF,
+ IntTools_Context& aCtx)
{
Standard_Boolean bReverse;
Standard_Real aT1, aT2, dT, aU, aV;
aGAS.Load(aS);
aTS=aGAS.GetType();
if (aTS==GeomAbs_BSplineSurface ||
- aTS==GeomAbs_BezierSurface ||
- aTS==GeomAbs_Plane) {//modified by NIZNHY-PKV Fri Dec 4 08:23:24 2009ft
+ aTS==GeomAbs_BezierSurface ||
+ aTS==GeomAbs_Plane) {//modified by NIZNHY-PKV Fri Dec 4 08:23:24 2009ft
Standard_Real aTolEx, aTolFx, aTol, dUR, dVR, dR;
//
aTolEx=BRep_Tool::Tolerance(aEx);
dVR=aGAS.VResolution(aTol);
dR=(dUR>dVR)? dUR : dVR;
if (dR>dT) {
- dT=dR;
+ dT=dR;
}
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_VertexSolid.cxx
-// Created: Wed Jan 12 16:36:40 2005
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_VertexSolid.cxx
+// Created: Wed Jan 12 16:36:40 2005
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_VertexSolid.ixx>
//
aState=aDS.GetState(i);
if (aState==BooleanOperations_ON ||
- aState==BooleanOperations_IN ||
- aState==BooleanOperations_OUT) {
+ aState==BooleanOperations_IN ||
+ aState==BooleanOperations_OUT) {
continue;
}
//
BOPTools_VVInterference& aVV=aVVs(j);
aVV.Indices(n1, n2);
if (n1==i || n2==i) {
- pDS->SetState (n1, BooleanOperations_ON);
- pDS->SetState (n2, BooleanOperations_ON);
- iFound=1;
- break;
+ pDS->SetState (n1, BooleanOperations_ON);
+ pDS->SetState (n2, BooleanOperations_ON);
+ iFound=1;
+ break;
}
}
if (iFound) {
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTAlgo_WESCorrector.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTAlgo_WESCorrector.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_WESCorrector.ixx>
static
void MakeWire(const TopTools_ListOfShape& aLE,
- TopoDS_Wire& newWire);
+ TopoDS_Wire& newWire);
//=======================================================================
// function:
while(1) {
aNbVP=aMVP.Extent();
for (j=1; j<=aNbVP; ++j) {
- const TopoDS_Shape& aVP=aMVP(j);
- const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aVP);
- aIt.Initialize(aLE);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aE=aIt.Value();
- if (aMEC.Contains(aE)) {
- continue;
- }
- aMEC.Add(aE);
- //
- aItE.Initialize(aE);
- for (; aItE.More(); aItE.Next()) {
- const TopoDS_Shape& aVE=aItE.Value();
- if (!aMVS.Contains(aVE)) {
- aMVS.Add(aVE);
- aMVAdd.Add(aVE);
- }
- }
- }
+ const TopoDS_Shape& aVP=aMVP(j);
+ const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aVP);
+ aIt.Initialize(aLE);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aE=aIt.Value();
+ if (aMEC.Contains(aE)) {
+ continue;
+ }
+ aMEC.Add(aE);
+ //
+ aItE.Initialize(aE);
+ for (; aItE.More(); aItE.Next()) {
+ const TopoDS_Shape& aVE=aItE.Value();
+ if (!aMVS.Contains(aVE)) {
+ aMVS.Add(aVE);
+ aMVAdd.Add(aVE);
+ }
+ }
+ }
}//for (j=1; j<=aNbVP; ++j)
//
aNbVP=aMVAdd.Extent();
if (!aNbVP) {
- break; // from while(1)
+ break; // from while(1)
}
//
aMVP.Clear();
for (j=1; j<=aNbVP; ++j) {
- const TopoDS_Shape& aVE=aMVAdd(j);
- aMVP.Add(aVE);
+ const TopoDS_Shape& aVE=aMVAdd(j);
+ aMVP.Add(aVE);
}
aMVAdd.Clear();
}// while(1) {
aER=aMEC(j);
//
if (aMER.Contains(aER)) {
- aER.Orientation(TopAbs_FORWARD);
- aLEC.Append(aER);
- aER.Orientation(TopAbs_REVERSED);
- aLEC.Append(aER);
- //
- //modified by NIZNHY-PKV Tue Nov 28 12:02:29 2006f
- //bClosed=BRep_Tool::IsClosed(TopoDS::Edge(aER), myWES->Face());
- //if (!bClosed) {
- bRegular=Standard_False;
- //}
- //modified by NIZNHY-PKV Tue Nov 28 12:02:33 2006t
+ aER.Orientation(TopAbs_FORWARD);
+ aLEC.Append(aER);
+ aER.Orientation(TopAbs_REVERSED);
+ aLEC.Append(aER);
+ //
+ //modified by NIZNHY-PKV Tue Nov 28 12:02:29 2006f
+ //bClosed=BRep_Tool::IsClosed(TopoDS::Edge(aER), myWES->Face());
+ //if (!bClosed) {
+ bRegular=Standard_False;
+ //}
+ //modified by NIZNHY-PKV Tue Nov 28 12:02:33 2006t
}
else {
- aLEC.Append(aER);
+ aLEC.Append(aER);
}
//
if (bRegular) {
- TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER);
+ TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER);
}
}//for (j=1; j<=aNbC; ++j) {
//
//
aNbVR=aMVER.Extent();
for (k=1; k<=aNbVR; ++k) {
- const TopTools_ListOfShape& aLER=aMVER(k);
- aNbER=aLER.Extent();
- if (aNbER==1) {
- const TopoDS_Edge& aEx=TopoDS::Edge(aER);
- bClosed=BRep_Tool::IsClosed(aEx, myWES->Face());
- if (!bClosed) {
- bRegular=!bRegular;
- break;
- }
- }
- if (aNbER>2) {
- bRegular=!bRegular;
- break;
- }
+ const TopTools_ListOfShape& aLER=aMVER(k);
+ aNbER=aLER.Extent();
+ if (aNbER==1) {
+ const TopoDS_Edge& aEx=TopoDS::Edge(aER);
+ bClosed=BRep_Tool::IsClosed(aEx, myWES->Face());
+ if (!bClosed) {
+ bRegular=!bRegular;
+ break;
+ }
+ }
+ if (aNbER>2) {
+ bRegular=!bRegular;
+ break;
+ }
}
}
//
// purpose:
//=======================================================================
void MakeWire(const TopTools_ListOfShape& aLE,
- TopoDS_Wire& newWire)
+ TopoDS_Wire& newWire)
{
BRep_Builder aBB;
aBB.MakeWire(newWire);
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_WireEdgeSet.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_WireEdgeSet.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_WireEdgeSet.ixx>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_WireSolid.cxx
-// Created: Wed Jan 12 10:19:31 2005
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_WireSolid.cxx
+// Created: Wed Jan 12 10:19:31 2005
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_WireSolid.ixx>
aNbPB=aLPB.Extent();
//
if (!aNbPB) {
- aState=aDS.GetState(i);
- //
- if (aState==BooleanOperations_IN) {
- myLSIN.Append(aE);
- }
- else if (aState==BooleanOperations_OUT) {
- myLSOUT.Append(aE);
- }
- else if (aState==BooleanOperations_ON) {
- myLSON.Append(aE);
- }
+ aState=aDS.GetState(i);
+ //
+ if (aState==BooleanOperations_IN) {
+ myLSIN.Append(aE);
+ }
+ else if (aState==BooleanOperations_OUT) {
+ myLSOUT.Append(aE);
+ }
+ else if (aState==BooleanOperations_ON) {
+ myLSON.Append(aE);
+ }
}
//
else if (aNbPB==1) {
- const BOPTools_PaveBlock& aPB=aLPB.First();
- nSp=aPB.Edge();
- const TopoDS_Shape& aSp=aDS.Shape(nSp);
- aState=aDS.GetState(nSp);
- //
- if (aState==BooleanOperations_IN) {
- myLSIN.Append(aE);
- }
- else if (aState==BooleanOperations_OUT) {
- myLSOUT.Append(aE);
- }
- else if (aState==BooleanOperations_ON) {
- myLSON.Append(aE);
- }
+ const BOPTools_PaveBlock& aPB=aLPB.First();
+ nSp=aPB.Edge();
+ const TopoDS_Shape& aSp=aDS.Shape(nSp);
+ aState=aDS.GetState(nSp);
+ //
+ if (aState==BooleanOperations_IN) {
+ myLSIN.Append(aE);
+ }
+ else if (aState==BooleanOperations_OUT) {
+ myLSOUT.Append(aE);
+ }
+ else if (aState==BooleanOperations_ON) {
+ myLSON.Append(aE);
+ }
}
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_WireSplitter.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_WireSplitter.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <GEOMAlgo_WireSplitter.ixx>
static
void Path (const GeomAdaptor_Surface& aGAS,
- const TopoDS_Face& myFace,
- const TopoDS_Vertex& aVa,
- const TopoDS_Edge& aEOuta,
- BOP_EdgeInfo& anEdgeInfo,
- TopTools_SequenceOfShape& aLS,
- TopTools_SequenceOfShape& aVertVa,
- TColgp_SequenceOfPnt2d& aCoordVa,
- BOPTColStd_ListOfListOfShape& myShapes,
- BOP_IndexedDataMapOfVertexListEdgeInfo& mySmartMap);
+ const TopoDS_Face& myFace,
+ const TopoDS_Vertex& aVa,
+ const TopoDS_Edge& aEOuta,
+ BOP_EdgeInfo& anEdgeInfo,
+ TopTools_SequenceOfShape& aLS,
+ TopTools_SequenceOfShape& aVertVa,
+ TColgp_SequenceOfPnt2d& aCoordVa,
+ BOPTColStd_ListOfListOfShape& myShapes,
+ BOP_IndexedDataMapOfVertexListEdgeInfo& mySmartMap);
static
static
void GetNextVertex(const TopoDS_Vertex& aV,
- const TopoDS_Edge& aE,
- TopoDS_Vertex& aV1);
+ const TopoDS_Edge& aE,
+ TopoDS_Vertex& aV1);
static
Standard_Real ClockWiseAngle(const Standard_Real aAngleIn,
- const Standard_Real aAngleOut);
+ const Standard_Real aAngleOut);
static
Standard_Real AngleIn(const TopoDS_Edge& aEIn,
- const BOP_ListOfEdgeInfo& aLEInfo);
+ const BOP_ListOfEdgeInfo& aLEInfo);
static
Standard_Real Angle2D (const TopoDS_Vertex& aV,
- const TopoDS_Edge& anEdge,
- const TopoDS_Face& myFace,
- const GeomAdaptor_Surface& aGAS,
- const Standard_Boolean aFlag);
+ const TopoDS_Edge& anEdge,
+ const TopoDS_Face& myFace,
+ const GeomAdaptor_Surface& aGAS,
+ const Standard_Boolean aFlag);
static
gp_Pnt2d Coord2d (const TopoDS_Vertex& aV1,
- const TopoDS_Edge& aE1,
- const TopoDS_Face& aF);
+ const TopoDS_Edge& aE1,
+ const TopoDS_Face& aF);
static
gp_Pnt2d Coord2dVf (const TopoDS_Edge& aE,
- const TopoDS_Face& aF);
+ const TopoDS_Face& aF);
static
Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
- const GeomAdaptor_Surface& aGAS);
+ const GeomAdaptor_Surface& aGAS);
static
Standard_Integer NbWaysOut(const BOP_ListOfEdgeInfo& );
index = mySmartMap.FindIndex(aVertex);
if (!index) {
- index=mySmartMap.Add(aVertex, emptyInfo);
+ index=mySmartMap.Add(aVertex, emptyInfo);
}
BOP_ListOfEdgeInfo& aListOfEInfo=mySmartMap(index);
TopAbs_Orientation anOr=aVertex.Orientation();
if (anOr==TopAbs_FORWARD) {
- aEInfo.SetInFlag(Standard_False);
+ aEInfo.SetInFlag(Standard_False);
}
else if (anOr==TopAbs_REVERSED) {
- aEInfo.SetInFlag(Standard_True);
+ aEInfo.SetInFlag(Standard_True);
}
aListOfEInfo.Append(aEInfo);
const BOP_EdgeInfo& anEdgeInfo=anIt.Value();
anIsIn=anEdgeInfo.IsIn();
if (anIsIn) {
- aCntIn++;
+ aCntIn++;
}
else {
- aCntOut++;
+ aCntOut++;
}
}
if (aCntIn!=1 || aCntOut!=1) {
const TopoDS_Shape& aE = anItList.Value();
if (!aMapEE.Contains(aE)) {
- TopTools_ListOfShape aLEx;
- aLEx.Append(aE);
- aMapEE.Add(aE, aLEx);
+ TopTools_ListOfShape aLEx;
+ aLEx.Append(aE);
+ aMapEE.Add(aE, aLEx);
}
else {
- TopTools_ListOfShape& aLEx=aMapEE.ChangeFromKey(aE);
- aLEx.Append(aE);
+ TopTools_ListOfShape& aLEx=aMapEE.ChangeFromKey(aE);
+ aLEx.Append(aE);
}
}
const TopTools_ListOfShape& aLEx=aMapEE(i);
aNbE=aLEx.Extent();
if (aNbE==1) {
- // usual case
- continue;
+ // usual case
+ continue;
}
else if (aNbE==2){
- const TopoDS_Shape& aE1=aLEx.First();
- const TopoDS_Shape& aE2=aLEx.Last();
- if (aE1.IsSame(aE2)) {
- bFlag=Standard_False;
- break;
- }
+ const TopoDS_Shape& aE1=aLEx.First();
+ const TopoDS_Shape& aE2=aLEx.Last();
+ if (aE1.IsSame(aE2)) {
+ bFlag=Standard_False;
+ break;
+ }
}
else {
- bFlag=Standard_False;
- break;
+ bFlag=Standard_False;
+ break;
}
}
myNothingToDo=myNothingToDo && bFlag;
//
anIsIn=anEdgeInfo.IsIn();
if (anIsIn) {
- //
- aVV.Orientation(TopAbs_REVERSED);
- anAngle=Angle2D (aVV, aE, myFace, aGAS, Standard_True);
+ //
+ aVV.Orientation(TopAbs_REVERSED);
+ anAngle=Angle2D (aVV, aE, myFace, aGAS, Standard_True);
}
//
else { // OUT
- //
- aVV.Orientation(TopAbs_FORWARD);
- anAngle=Angle2D (aVV, aE, myFace, aGAS, Standard_False);
+ //
+ aVV.Orientation(TopAbs_FORWARD);
+ anAngle=Angle2D (aVV, aE, myFace, aGAS, Standard_False);
}
anEdgeInfo.SetAngle(anAngle);
anIsNotPassed=!anEdgeInfo.Passed();
if (anIsOut && anIsNotPassed) {
- //
- aLS.Clear();
- aVertVa.Clear();
- aCoordVa.Clear();
- //
- Path(aGAS, myFace, aVa, aEOuta, anEdgeInfo, aLS,
- aVertVa, aCoordVa, myShapes, mySmartMap);
+ //
+ aLS.Clear();
+ aVertVa.Clear();
+ aCoordVa.Clear();
+ //
+ Path(aGAS, myFace, aVa, aEOuta, anEdgeInfo, aLS,
+ aVertVa, aCoordVa, myShapes, mySmartMap);
}
}
}
const TopTools_ListOfShape& aLE=anItW.Value();
TopTools_ListIteratorOfListOfShape anItE(aLE);
for (; anItE.More(); anItE.Next()) {
- const TopoDS_Edge& aE=TopoDS::Edge(anItE.Value());
- aME.Add(aE);
- TopExp::Vertices(aE, aV1, aV2);
- aMV.Add(aV1);
- aMV.Add(aV2);
+ const TopoDS_Edge& aE=TopoDS::Edge(anItE.Value());
+ aME.Add(aE);
+ TopExp::Vertices(aE, aV1, aV2);
+ aMV.Add(aV1);
+ aMV.Add(aV2);
}
aNbV=aMV.Extent();
aNbE=aME.Extent();
if (aNbV<=aNbE) {
- aShapes.Append(aLE);
+ aShapes.Append(aLE);
}
}
//
// purpose:
//=======================================================================
void Path (const GeomAdaptor_Surface& aGAS,
- const TopoDS_Face& myFace,
- const TopoDS_Vertex& aVa,
- const TopoDS_Edge& aEOuta,
- BOP_EdgeInfo& anEdgeInfo,
- TopTools_SequenceOfShape& aLS,
- TopTools_SequenceOfShape& aVertVa,
- TColgp_SequenceOfPnt2d& aCoordVa,
- BOPTColStd_ListOfListOfShape& myShapes,
- BOP_IndexedDataMapOfVertexListEdgeInfo& mySmartMap)
-
+ const TopoDS_Face& myFace,
+ const TopoDS_Vertex& aVa,
+ const TopoDS_Edge& aEOuta,
+ BOP_EdgeInfo& anEdgeInfo,
+ TopTools_SequenceOfShape& aLS,
+ TopTools_SequenceOfShape& aVertVa,
+ TColgp_SequenceOfPnt2d& aCoordVa,
+ BOPTColStd_ListOfListOfShape& myShapes,
+ BOP_IndexedDataMapOfVertexListEdgeInfo& mySmartMap)
+
{
Standard_Integer i,j, aNb, aNbj;
Standard_Real aTol, anAngleIn, anAngleOut, anAngle, aMinAngle;
anIsSameV2d=Standard_False;
if (anIsSameV) {
- anIsSameV2d = Standard_True;
- //
- aD2=aPaPrev.SquareDistance(aPb);
- anIsSameV2d =aD2<aTol2;
+ anIsSameV2d = Standard_True;
+ //
+ aD2=aPaPrev.SquareDistance(aPb);
+ anIsSameV2d =aD2<aTol2;
}//if (anIsSameV) {
//
if (anIsSameV && anIsSameV2d) {
- myShapes.Append(aBuf);
- //
- TopTools_SequenceOfShape aLSt, aVertVat;
- TColgp_SequenceOfPnt2d aCoordVat;
- //
- aNbj=i-1;
- if (aNbj<1) {
- //
- aLS.Clear();
- aVertVa.Clear();
- aCoordVa.Clear();
- //
- return;
- }
-
- aVb=TopoDS::Vertex(aVertVa(i));
-
- for (j=1; j<=aNbj; j++) {
- aLSt.Append(aLS(j));
- aVertVat.Append(aVertVa(j));
- aCoordVat.Append(aCoordVa(j));
- }
- //
- aLS.Clear();
- aVertVa.Clear();
- aCoordVa.Clear();
-
- aLS=aLSt;
- aVertVa=aVertVat;
- aCoordVa=aCoordVat;
- //
- break;
+ myShapes.Append(aBuf);
+ //
+ TopTools_SequenceOfShape aLSt, aVertVat;
+ TColgp_SequenceOfPnt2d aCoordVat;
+ //
+ aNbj=i-1;
+ if (aNbj<1) {
+ //
+ aLS.Clear();
+ aVertVa.Clear();
+ aCoordVa.Clear();
+ //
+ return;
+ }
+
+ aVb=TopoDS::Vertex(aVertVa(i));
+
+ for (j=1; j<=aNbj; j++) {
+ aLSt.Append(aLS(j));
+ aVertVat.Append(aVertVa(j));
+ aCoordVat.Append(aCoordVa(j));
+ }
+ //
+ aLS.Clear();
+ aVertVa.Clear();
+ aCoordVa.Clear();
+
+ aLS=aLSt;
+ aVertVa=aVertVat;
+ aCoordVa=aCoordVat;
+ //
+ break;
}
}
}
iCnt=NbWaysOut (aLEInfo);
//
if (!iCnt) {
- // no way to go . (Error)
- return ;
+ // no way to go . (Error)
+ return ;
}
//
if (iCnt==1) {
- // the one and only way to go out .
- pEdgeInfo=&anEI;
- anIsFound=Standard_True;
- break;
+ // the one and only way to go out .
+ pEdgeInfo=&anEI;
+ anIsFound=Standard_True;
+ break;
}
//
// Look for minimal angle and make the choice.
//
aD2=aP2Dx.SquareDistance(aPb);
if (aD2 > aTol2D2){
- continue;
+ continue;
}
//
//
//
anAngle=ClockWiseAngle(anAngleIn, anAngleOut);
if (anAngle < aMinAngle) {
- aMinAngle=anAngle;
- pEdgeInfo=&anEI;
- anIsFound=Standard_True;
+ aMinAngle=anAngle;
+ pEdgeInfo=&anEI;
+ anIsFound=Standard_True;
}
}
} // for (; anIt.More(); anIt.Next())
aEOutb=pEdgeInfo->Edge();
//
Path (aGAS, myFace, aVb, aEOutb, *pEdgeInfo, aLS,
- aVertVa, aCoordVa, myShapes, mySmartMap);
+ aVertVa, aCoordVa, myShapes, mySmartMap);
}
//=======================================================================
// function: Coord2dVf
// purpose:
//=======================================================================
gp_Pnt2d Coord2dVf (const TopoDS_Edge& aE,
- const TopoDS_Face& aF)
+ const TopoDS_Face& aF)
{
Standard_Real aCoord=99.;
gp_Pnt2d aP2D1(aCoord, aCoord);
// purpose:
//=======================================================================
Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
- const GeomAdaptor_Surface& aGAS)
+ const GeomAdaptor_Surface& aGAS)
{
Standard_Real aTol2D, anUr, aVr, aTolV3D;
GeomAbs_SurfaceType aType;
// purpose:
//=======================================================================
gp_Pnt2d Coord2d (const TopoDS_Vertex& aV1,
- const TopoDS_Edge& aE1,
- const TopoDS_Face& aF)
+ const TopoDS_Edge& aE1,
+ const TopoDS_Face& aF)
{
Standard_Real aT, aFirst, aLast;
Handle(Geom2d_Curve) aC2D;
// purpose:
//=======================================================================
Standard_Real AngleIn(const TopoDS_Edge& aEIn,
- const BOP_ListOfEdgeInfo& aLEInfo)
+ const BOP_ListOfEdgeInfo& aLEInfo)
{
Standard_Real anAngleIn;
Standard_Boolean anIsIn;
// purpose:
//=======================================================================
Standard_Real ClockWiseAngle(const Standard_Real aAngleIn,
- const Standard_Real aAngleOut)
+ const Standard_Real aAngleOut)
{
Standard_Real aTwoPi=Standard_PI+Standard_PI;
Standard_Real dA, A1, A2, AIn, AOut ;
// purpose:
//=======================================================================
void GetNextVertex(const TopoDS_Vertex& aV,
- const TopoDS_Edge& aE,
- TopoDS_Vertex& aV1)
+ const TopoDS_Edge& aE,
+ TopoDS_Vertex& aV1)
{
TopoDS_Iterator aIt;
//
// purpose:
//=======================================================================
Standard_Real Angle2D (const TopoDS_Vertex& aV,
- const TopoDS_Edge& anEdge,
- const TopoDS_Face& myFace,
- const GeomAdaptor_Surface& aGAS,
- const Standard_Boolean aFlag)
+ const TopoDS_Edge& anEdge,
+ const TopoDS_Face& myFace,
+ const GeomAdaptor_Surface& aGAS,
+ const Standard_Boolean aFlag)
{
Standard_Real aFirst, aLast, aToler, dt, aTV, aTV1, anAngle, aTX;
gp_Pnt2d aPV, aPV1;
}
//
BOPTools_Tools2D::CurveOnSurface (anEdge, myFace, aC2D,
- aFirst, aLast, aToler, Standard_True);
+ aFirst, aLast, aToler, Standard_True);
//dt=1.e-7;
//modified by NIZNHY-PKV Wed Sep 10 14:06:04 2008f
//dt=Tolerance2D(aV, aGAS);
static int GetIndex(const TopoDS_Shape& subshape, const TopoDS_Shape& shape, int ShapeType);
static TopoDS_Shape GetShapeFromIOR(QString IOR);
static bool GetShape(const GEOM::GEOM_Object_ptr&, TopoDS_Shape&,
- const TopAbs_ShapeEnum = TopAbs_SHAPE);
+ const TopAbs_ShapeEnum = TopAbs_SHAPE);
static bool GetTopoFromSelection(const SALOME_ListIO& aList, TopoDS_Shape& tds);
static int GetNameOfSelectedIObjects(const SALOME_ListIO& aList, QString& aName,
- const bool theShapesOnly = false);
+ const bool theShapesOnly = false);
static bool GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString& aTypeString);
/* Convertions */
static GEOM::GEOM_Object_ptr ConvertIOinGEOMShape(const Handle(SALOME_InteractiveObject)& IO,
- Standard_Boolean& testResult);
+ Standard_Boolean& testResult);
static Handle(GEOM_AISShape) ConvertIOinGEOMAISShape(const Handle(SALOME_InteractiveObject)& IO,
- Standard_Boolean& testResult,
- bool onlyInActiveView = false);
+ Standard_Boolean& testResult,
+ bool onlyInActiveView = false);
static Handle(AIS_InteractiveObject) GetAIS(const Handle(SALOME_InteractiveObject)& theIO,
- const bool isOnlyInActiveView = false);
+ const bool isOnlyInActiveView = false);
static void ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList,
- GEOM::string_array& listIOR);
+ GEOM::string_array& listIOR);
static Handle(GEOM_AISShape) ConvertIORinGEOMAISShape(const char * IOR,
- Standard_Boolean& testResult,
- bool onlyInActiveView = false);
+ Standard_Boolean& testResult,
+ bool onlyInActiveView = false);
static GEOM_Actor* ConvertIORinGEOMActor(const char * IOR, Standard_Boolean& testResult,
- bool onlyInActiveView = false);
+ bool onlyInActiveView = false);
static GEOM::GEOM_Object_ptr ConvertIOinGEOMObject(const Handle(SALOME_InteractiveObject)& IO,
- Standard_Boolean& testResult);
+ Standard_Boolean& testResult);
static void ConvertListOfIOInListOfGO(const SALOME_ListIO& aList,
- GEOM::ListOfGO& listGO,
- const bool theShapesOnly = false);
+ GEOM::ListOfGO& listGO,
+ const bool theShapesOnly = false);
static GEOM::GEOM_Object_ptr GetObjectFromIOR(const char* theIOR);
/* Generates default names */
static bool SelectionByNameInDialogs(QWidget* aWidget, const QString& userObjectName,
- const SALOME_ListIO& aList);
+ const SALOME_ListIO& aList);
/* Shows message box with error code */
static bool DefineDlgPosition(QWidget* aDlg, int& x, int& y);
// Purpose :
//================================================================
void GEOMBase_Helper::redisplay( const ObjectList& objList,
- const bool withChildren,
- const bool updateView )
+ const bool withChildren,
+ const bool updateView )
{
ObjectList::const_iterator it = objList.begin();
for ( ; it != objList.end(); it++ ) {
// Purpose :
//================================================================
void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object,
- const bool withChildren,
- const bool updateView )
+ const bool withChildren,
+ const bool updateView )
{
if ( !object->_is_nil() ) {
// Unset color of shape ( this color may be set during preview displaying )
CORBA::String_var objStr = SalomeApp_Application::orb()->object_to_string(object);
_PTR(SObject) aSObj (aStudy->FindObjectIOR(std::string(objStr.in())));
if ( aSObj ) {
- _PTR(ChildIterator) anIt ( aStudy->NewChildIterator( aSObj ) );
- for ( anIt->InitEx( true ); anIt->More(); anIt->Next() ) {
- GEOM::GEOM_Object_var aChild = GEOM::GEOM_Object::_narrow
+ _PTR(ChildIterator) anIt ( aStudy->NewChildIterator( aSObj ) );
+ for ( anIt->InitEx( true ); anIt->More(); anIt->Next() ) {
+ GEOM::GEOM_Object_var aChild = GEOM::GEOM_Object::_narrow
(GeometryGUI::ClientSObjectToObject(anIt->Value()));
- if ( !CORBA::is_nil( aChild ) ) {
- if ( !aChild->_is_nil() ) {
- std::string entry = getEntry( aChild );
- getDisplayer()->Redisplay( new SALOME_InteractiveObject(
+ if ( !CORBA::is_nil( aChild ) ) {
+ if ( !aChild->_is_nil() ) {
+ std::string entry = getEntry( aChild );
+ getDisplayer()->Redisplay( new SALOME_InteractiveObject(
entry.c_str(), "GEOM", strdup( GEOMBase::GetName( aChild ).toLatin1().constData() ) ), false );
- }
- }
- }
+ }
+ }
+ }
}
}
}
else {
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it )
{
- GEOM::GEOM_Object_var obj=*it;
+ GEOM::GEOM_Object_var obj=*it;
displayPreview( obj, true, activate, false, lineWidth, displayMode, color );
if ( toRemoveFromEngine )
- obj->Destroy();
+ obj->Destroy();
}
}
}
SUIT_ViewModel* aViewModel = aViewManager->getViewModel();
SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel);
if (aView)
- aView->Display( prs );
+ aView->Display( prs );
}
// Add prs to the preview list
for ( PrsList::iterator anIter = myPreview.begin(); anIter != myPreview.end(); ++anIter ) {
if ( vfOK )
{
- SUIT_ViewManager* aViewManager = myViewWindow->getViewManager();
- if ( aViewManager->getType() == OCCViewer_Viewer::Type() ||
- aViewManager->getType() == SVTK_Viewer::Type() )
- {
- SUIT_ViewModel* aViewModel = aViewManager->getViewModel();
- SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel);
- if (aView)
- aView->Erase( *anIter, true );
- }
+ SUIT_ViewManager* aViewManager = myViewWindow->getViewManager();
+ if ( aViewManager->getType() == OCCViewer_Viewer::Type() ||
+ aViewManager->getType() == SVTK_Viewer::Type() )
+ {
+ SUIT_ViewModel* aViewModel = aViewManager->getViewModel();
+ SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel);
+ if (aView)
+ aView->Erase( *anIter, true );
+ }
}
delete *anIter;
}
// in accordance with mode. theMode is from GEOMImpl_Types
//================================================================
void GEOMBase_Helper::globalSelection( const TColStd_MapOfInteger& theModes,
- const bool update )
+ const bool update )
{
getDisplayer()->GlobalSelection( theModes, update );
}
//================================================================
void GEOMBase_Helper::globalSelection( const TColStd_MapOfInteger& theModes,
const QList<int>& subShapes,
- const bool update )
+ const bool update )
{
getDisplayer()->GlobalSelection( theModes, update, &subShapes );
}
{
anApp = it.next();
if ( anApp && anApp->desktop() == aDesktop )
- break;
+ break;
}
return dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
if ( IOR != "" ) {
_PTR(SObject) SO ( study->studyDS()->FindObjectIOR( IOR ) );
if ( SO ) {
- return (char*) TCollection_AsciiString((char*)SO->GetID().c_str()).ToCString();
+ return (char*) TCollection_AsciiString((char*)SO->GetID().c_str()).ToCString();
}
}
}
QListIterator<SUIT_ViewWindow*> it( aViewWindowsList );
while ( it.hasNext() )
{
- if ( myViewWindow == it.next() )
- return true;
+ if ( myViewWindow == it.next() )
+ return true;
}
}
myViewWindow = 0;
if ( aLocked ) {
MESSAGE("GEOMBase_Helper::onAccept - ActiveStudy is locked");
SUIT_MessageBox::warning ( (QWidget*)SUIT_Session::session()->activeApplication()->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED"),
- QObject::tr("BUT_OK") );
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED"),
+ QObject::tr("BUT_OK") );
return false;
}
SUIT_Session::session()->activeApplication()->putInfo( "" );
ObjectList objects;
if ( !execute( objects ) || !getOperation()->IsDone() ) {
- wc.suspend();
- abortCommand();
- showError();
+ wc.suspend();
+ abortCommand();
+ showError();
}
else {
- addSubshapesToStudy(); // add Subshapes if local selection
- const int nbObjs = objects.size();
+ addSubshapesToStudy(); // add Subshapes if local selection
+ const int nbObjs = objects.size();
int aNumber = 1;
- for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) {
- GEOM::GEOM_Object_var obj=*it;
- if ( publish ) {
- QString aName = getNewObjectName();
- if ( nbObjs > 1 ) {
+ for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) {
+ GEOM::GEOM_Object_var obj=*it;
+ if ( publish ) {
+ QString aName = getNewObjectName();
+ if ( nbObjs > 1 ) {
if (aName.isEmpty())
aName = getPrefix(obj);
if (nbObjs <= 30) {
// Don't check name uniqueness in case of numerous objects
aName = aName + "_" + QString::number(aNumber++);
}
- } else {
- // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
- if ( aName.isEmpty() )
- aName = GEOMBase::GetDefaultName( getPrefix( obj ) );
- }
- addInStudy( obj, aName.toLatin1().constData() );
+ } else {
+ // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
+ if ( aName.isEmpty() )
+ aName = GEOMBase::GetDefaultName( getPrefix( obj ) );
+ }
+ addInStudy( obj, aName.toLatin1().constData() );
// updateView=false
- display( obj, false );
+ display( obj, false );
#ifdef WITHGENERICOBJ
- // obj has been published in study. Its refcount has been incremented.
- // It is safe to decrement its refcount
- // so that it will be destroyed when the entry in study will be removed
- obj->Destroy();
+ // obj has been published in study. Its refcount has been incremented.
+ // It is safe to decrement its refcount
+ // so that it will be destroyed when the entry in study will be removed
+ obj->Destroy();
#endif
- }
- else {
+ }
+ else {
// asv : fix of PAL6454. If publish==false, then the original shape
// was modified, and need to be re-cached in GEOM_Client before redisplay
- clearShapeBuffer( obj );
+ clearShapeBuffer( obj );
// withChildren=true, updateView=false
- redisplay( obj, true, false );
+ redisplay( obj, true, false );
}
- }
-
- if ( nbObjs ) {
- commitCommand();
- updateObjBrowser();
- SUIT_Session::session()->activeApplication()->putInfo( QObject::tr("GEOM_PRP_DONE") );
- }
- else
- abortCommand();
+ }
+
+ if ( nbObjs ) {
+ commitCommand();
+ updateObjBrowser();
+ SUIT_Session::session()->activeApplication()->putInfo( QObject::tr("GEOM_PRP_DONE") );
+ }
+ else
+ abortCommand();
}
}
}
msg = QObject::tr( "GEOM_PRP_ABORT" );
SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
- QObject::tr( "GEOM_ERROR_STATUS" ),
- msg,
- QObject::tr( "BUT_OK" ) );
+ QObject::tr( "GEOM_ERROR_STATUS" ),
+ msg,
+ QObject::tr( "BUT_OK" ) );
}
//================================================================
const int displayMode = -1,
const int color = -1 );
void displayPreview ( const SALOME_Prs* prs,
- const bool append = false,
- const bool = true );
+ const bool append = false,
+ const bool = true );
void erasePreview ( const bool = true );
void localSelection( const ObjectList&, const int );
// true to construct a modal dialog.
//=================================================================================
GEOMBase_Skeleton::GEOMBase_Skeleton( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: QDialog( parent, fl ),
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
myGeomGUI( theGeometryGUI ),
// purpose :
//=================================================================================
void GEOMBase_Skeleton::initSpinBox( QSpinBox* spinBox,
- int min, int max, int step )
+ int min, int max, int step )
{
spinBox->setRange( min, max );
spinBox->setSingleStep( step );
// purpose :
//=================================================================================
void GEOMBase_Skeleton::initSpinBox( SalomeApp_DoubleSpinBox* spinBox,
- double min, double max,
- double step, int decimals )
+ double min, double max,
+ double step, int decimals )
{
spinBox->setPrecision( decimals );
spinBox->setDecimals( decimals ); // it's necessary to set decimals before the range setting,
// In this case PublishInStudy isn't called, so we need to update object's attributes manually
//=================================================================================
void GEOMBase_Skeleton::updateAttributes( GEOM::GEOM_Object_ptr theObj,
- const QStringList& theParameters)
+ const QStringList& theParameters)
{
SALOMEDS::Study_var aStudy = GeometryGUI::ClientStudyToStudy(getStudy()->studyDS());
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
platform = "application";
#endif
SUIT_MessageBox::warning( 0, QObject::tr( "WRN_WARNING" ),
- QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( myHelpFileName ),
- QObject::tr( "BUT_OK" ) );
+ QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( myHelpFileName ),
+ QObject::tr( "BUT_OK" ) );
}
}
// purpose :
//=======================================================================
TDF_Label GEOMDS_Commands::Generated(const TopoDS_Shape& S,
- const TCollection_ExtendedString& Name)
+ const TCollection_ExtendedString& Name)
{
TDF_Label NewLab = myLab.NewChild();
TNaming_Builder B(NewLab);
// purpose :
//=======================================================================
TDF_Label GEOMDS_Commands::Generated(const TopoDS_Shape& S1,
- const TopoDS_Shape& S2,
- const TCollection_ExtendedString& Name)
+ const TopoDS_Shape& S2,
+ const TCollection_ExtendedString& Name)
{
TDF_Label NewLab = myLab.NewChild();
TNaming_Builder B(NewLab);
// purpose :
//=======================================================================
TDF_Label GEOMDS_Commands::AddShape(const TopoDS_Shape& S,
- const TCollection_ExtendedString& Name)
+ const TCollection_ExtendedString& Name)
{
TDF_Label NewLab = myLab.NewChild();
TNaming_Builder B(NewLab);
// purpose : SAME than AddShape() : will be renamed later
//=======================================================================
TDF_Label GEOMDS_Commands::AddIndependentShape(const TopoDS_Shape& S,
- const TCollection_AsciiString& nameIOR)
+ const TCollection_AsciiString& nameIOR)
{
TDF_Label NewLab = myLab.NewChild();
TNaming_Builder B(NewLab);
// purpose :
//=======================================================================
TDF_Label GEOMDS_Commands::AddDependentShape(const TopoDS_Shape& S,
- const TCollection_AsciiString& nameIOR,
- const TDF_Label& mainLab)
+ const TCollection_AsciiString& nameIOR,
+ const TDF_Label& mainLab)
{
TDF_Label NewLab = myLab.NewChild();
TNaming_Builder B(NewLab);
// purpose :
//=======================================================================
TDF_Label GEOMDS_Commands::AddConstructiveElement(const TopoDS_Shape& S,
- const TCollection_ExtendedString& nameIOR,
- const GEOMDS_ConstructiveType& aType)
+ const TCollection_ExtendedString& nameIOR,
+ const GEOMDS_ConstructiveType& aType)
{
TDF_Label NewLab = myLab.NewChild();
TNaming_Builder B(NewLab);
// : Return false if attribute exist before
//=======================================================================
Standard_Boolean GEOMDS_Commands::AddIORNameAttribute(const TDF_Label& aLabel,
- const TCollection_ExtendedString& nameIOR)
+ const TCollection_ExtendedString& nameIOR)
{
if( this->HasIOR(aLabel) )
return false ;
// : topology ' returnTopo' and type 'returnType'
//=======================================================================
Standard_Boolean GEOMDS_Commands::IsConstructiveElement(const TDF_Label& aLabel,
- TopoDS_Shape& returnTopo,
- GEOMDS_ConstructiveType& returnType)
+ TopoDS_Shape& returnTopo,
+ GEOMDS_ConstructiveType& returnType)
{
Handle(TDataStd_Integer) anAttType ;
Handle(TNaming_NamedShape) anAttTopo ;
// purpose : return true and 'returnTopo' if a topology is found on 'aLabel'
//=======================================================================
Standard_Boolean GEOMDS_Commands::GetShape(const TDF_Label& aLabel,
- TopoDS_Shape& returnTopo)
+ TopoDS_Shape& returnTopo)
{
Handle(TNaming_NamedShape) anAttTopo ;
if( aLabel.FindAttribute(TNaming_NamedShape::GetID(), anAttTopo)) {
// : a dependent object, otherwise return false.
//=======================================================================
Standard_Boolean GEOMDS_Commands::GetMainShapeLabel(const TDF_Label& aLabel,
- TDF_Label& returnMainLabel)
+ TDF_Label& returnMainLabel)
{
Handle(TDF_Reference) anAttRef ;
if( aLabel.FindAttribute(TDF_Reference::GetID(), anAttRef)) {
if( L.FindAttribute(TDataStd_Name::GetID(), anAttName) ) {
notTested = L.ForgetAttribute(TDataStd_Name::GetID()) ;
if(notTested)
- MESSAGE("in GEOMDS_Commands::ClearAllIOR : IOR CLEARED" )
+ MESSAGE("in GEOMDS_Commands::ClearAllIOR : IOR CLEARED" )
ClearAllIOR(L);
}
}
// : and define 'returnNameIOR'
//=======================================================================
Standard_Boolean GEOMDS_Commands::ReturnNameIOR(const TDF_Label& aLabel,
- TCollection_ExtendedString& returnNameIOR)
+ TCollection_ExtendedString& returnNameIOR)
{
Handle(TDataStd_Name) anAttName ;
if( !aLabel.FindAttribute(TDataStd_Name::GetID(), anAttName) )
{
BRepAdaptor_Curve aCurve( TopoDS::Edge( theShape ) );
GeomAbs_CurveType aType = aCurve.GetType();
-
+
switch ( myKind )
{
case StdSelect_AnyEdge: return Standard_True;
{
BRepAdaptor_Surface aSurf( TopoDS::Face( theShape ) );
GeomAbs_SurfaceType aType = aSurf.GetType();
-
+
switch ( myKind )
{
case StdSelect_AnyFace: return Standard_True;
case StdSelect_Sphere: return ( aType == GeomAbs_Sphere);
case StdSelect_Torus: return ( aType == GeomAbs_Torus);
case StdSelect_Revol: return ( aType == GeomAbs_Cylinder ||
- aType == GeomAbs_Cone ||
- aType == GeomAbs_Torus ||
- aType == GeomAbs_Sphere ||
- aType == GeomAbs_SurfaceOfRevolution );
+ aType == GeomAbs_Cone ||
+ aType == GeomAbs_Torus ||
+ aType == GeomAbs_Sphere ||
+ aType == GeomAbs_SurfaceOfRevolution );
case StdSelect_Cone: return ( aType == GeomAbs_Cone);
}
}
if ( !CORBA::is_nil( obj ) )
{
if (!myIsShapeType)
- return obj->GetType() == type();
+ return obj->GetType() == type();
else
- return obj->GetShapeType() == type();
+ return obj->GetShapeType() == type();
}
return false;
SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
if ( prs ) {
if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
- SOCC_Prs* occPrs = (SOCC_Prs*) prs;
- AIS_ListOfInteractive lst;
- occPrs->GetObjects( lst );
- if ( lst.Extent() ) {
- Handle(AIS_InteractiveObject) io = lst.First();
- if ( !io.IsNull() ) {
- int dm = io->DisplayMode();
+ SOCC_Prs* occPrs = (SOCC_Prs*) prs;
+ AIS_ListOfInteractive lst;
+ occPrs->GetObjects( lst );
+ if ( lst.Extent() ) {
+ Handle(AIS_InteractiveObject) io = lst.First();
+ if ( !io.IsNull() ) {
+ int dm = io->DisplayMode();
if ( dm == AIS_WireFrame )
- return "Wireframe";
- else if ( dm == AIS_Shaded )
- return "Shading";
- else { // return default display mode of AIS_InteractiveContext
- OCCViewer_Viewer* occViewer = (OCCViewer_Viewer*) SUIT_Session::session()->activeApplication()->desktop(
+ return "Wireframe";
+ else if ( dm == AIS_Shaded )
+ return "Shading";
+ else { // return default display mode of AIS_InteractiveContext
+ OCCViewer_Viewer* occViewer = (OCCViewer_Viewer*) SUIT_Session::session()->activeApplication()->desktop(
)->activeWindow()->getViewManager()->getViewModel();
- Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
- dm = ic->DisplayMode();
- if ( dm == AIS_WireFrame )
- return "Wireframe";
- else if ( dm == AIS_Shaded )
- return "Shading";
- }
- }
- }
+ Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
+ dm = ic->DisplayMode();
+ if ( dm == AIS_WireFrame )
+ return "Wireframe";
+ else if ( dm == AIS_Shaded )
+ return "Shading";
+ }
+ }
+ }
}
else if ( viewType == SVTK_Viewer::Type() ) { // assuming VTK
- SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( prs );
- vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0;
- if ( lst ) {
- lst->InitTraversal();
- vtkActor* actor = lst->GetNextActor();
- if ( actor ) {
- SALOME_Actor* salActor = dynamic_cast<SALOME_Actor*>( actor );
- if ( salActor ) {
- int dm = salActor->getDisplayMode();
- if ( dm == 0 )
- return "Wireframe";
- else if ( dm == 1 )
- return "Shading";
- } // if ( salome actor )
- } // if ( actor )
- } // if ( lst == vtkPrs->GetObjects() )
+ SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( prs );
+ vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0;
+ if ( lst ) {
+ lst->InitTraversal();
+ vtkActor* actor = lst->GetNextActor();
+ if ( actor ) {
+ SALOME_Actor* salActor = dynamic_cast<SALOME_Actor*>( actor );
+ if ( salActor ) {
+ int dm = salActor->getDisplayMode();
+ if ( dm == 0 )
+ return "Wireframe";
+ else if ( dm == 1 )
+ return "Shading";
+ } // if ( salome actor )
+ } // if ( actor )
+ } // if ( lst == vtkPrs->GetObjects() )
} // if VTK
}
}
for ( ; it->More() && !ok; it->Next() ) {
_PTR(SObject) child = it->Value();
if ( child ) {
- _PTR(SObject) refObj;
- if ( child->ReferencedObject( refObj ) ) continue; // omit references
- if ( child->GetName() != "" ) ok = true;
+ _PTR(SObject) refObj;
+ if ( child->ReferencedObject( refObj ) ) continue; // omit references
+ if ( child->GetName() != "" ) ok = true;
}
}
}
if ( study && !anEntry.isNull() ) {
_PTR(SObject) aSO( study->FindObjectID( anEntry.toStdString() ) );
if ( aSO && aSO->GetFatherComponent() )
- return aSO->GetFatherComponent()->GetIOR() == aSO->GetIOR();
+ return aSO->GetFatherComponent()->GetIOR() == aSO->GetIOR();
}
}
return false;
_PTR(SObject) aSO (study->FindObjectID(anEntry.toStdString()));
if (aSO) {
CORBA::Object_var anObj = GeometryGUI::ClientSObjectToObject(aSO);
- return GEOM::GEOM_Object::_narrow(anObj);
+ return GEOM::GEOM_Object::_narrow(anObj);
}
}
}
if (aGeomGUI) {
switch (aGeomGUI->getLocalSelectionMode())
{
- case GEOM_POINT : return "VERTEX";
- case GEOM_EDGE : return "EDGE";
- case GEOM_WIRE : return "WIRE";
- case GEOM_FACE : return "FACE";
- case GEOM_SHELL : return "SHELL";
- case GEOM_SOLID : return "SOLID";
- case GEOM_COMPOUND : return "COMPOUND";
- case GEOM_ALLOBJECTS : return "ALL";
- default: return "";
+ case GEOM_POINT : return "VERTEX";
+ case GEOM_EDGE : return "EDGE";
+ case GEOM_WIRE : return "WIRE";
+ case GEOM_FACE : return "FACE";
+ case GEOM_SHELL : return "SHELL";
+ case GEOM_SOLID : return "SOLID";
+ case GEOM_COMPOUND : return "COMPOUND";
+ case GEOM_ALLOBJECTS : return "ALL";
+ default: return "";
}
}
}
SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy();
_PTR(SObject) SO ( study->studyDS()->FindObjectIOR( string(IOR) ) );
if ( SO )
- return SO->GetID();
+ return SO->GetID();
}
}
return "";
*/
//=================================================================
void GEOM_Displayer::Display( const Handle(SALOME_InteractiveObject)& theIO,
- const bool updateViewer,
- SALOME_View* theViewFrame )
+ const bool updateViewer,
+ SALOME_View* theViewFrame )
{
SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
if ( vf )
void GEOM_Displayer::Erase( const Handle(SALOME_InteractiveObject)& theIO,
const bool forced,
const bool updateViewer,
- SALOME_View* theViewFrame )
+ SALOME_View* theViewFrame )
{
if ( theIO.IsNull() )
return;
if ( prs ) {
vf->Erase( prs, forced );
if ( updateViewer )
- vf->Repaint();
+ vf->Repaint();
delete prs; // delete presentation because displayer is its owner
}
}
SUIT_ViewManager* vman = wnd->getViewManager();
if ( vman )
{
- SUIT_ViewModel* vmodel = vman->getViewModel();
- if ( vmodel )
- {
- SALOME_View* view = dynamic_cast<SALOME_View*>(vmodel);
- if ( view )
- {
- if ( view->isVisible( theIO ) || view == GetActiveView() )
- {
- Erase( theIO, true, false, view );
- Display( theIO, updateViewer, view );
- }
- }
- }
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ if ( vmodel )
+ {
+ SALOME_View* view = dynamic_cast<SALOME_View*>(vmodel);
+ if ( view )
+ {
+ if ( view->isVisible( theIO ) || view == GetActiveView() )
+ {
+ Erase( theIO, true, false, view );
+ Display( theIO, updateViewer, view );
+ }
+ }
+ }
}
}
}
AISShape->SetInfiniteState( myShape.Infinite() || myShape.ShapeType() == TopAbs_VERTEX );
// Setup shape properties here ..., e.g. display mode, color, transparency, etc
- AISShape->SetDisplayMode( myDisplayMode );
+ AISShape->SetDisplayMode( myDisplayMode );
AISShape->SetShadingColor( myShadingColor );
- // Set color and number for iso lines
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- QColor col = aResMgr->colorValue( "Geometry", "isos_color",
+ // Set color and number for iso lines
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ QColor col = aResMgr->colorValue( "Geometry", "isos_color",
QColor(int(0.5*255), int(0.5*255), int(0.5*255)) );
- Quantity_Color aColor = SalomeApp_Tools::color( col );
- int anUIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_u", 1);
- int aVIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_v", 1);
+ Quantity_Color aColor = SalomeApp_Tools::color( col );
+ int anUIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_u", 1);
+ int aVIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_v", 1);
- Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
- anAspect->SetNumber( anUIsoNumber );
- anAspect->SetColor( aColor );
- AISShape->Attributes()->SetUIsoAspect( anAspect );
+ Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
+ anAspect->SetNumber( anUIsoNumber );
+ anAspect->SetColor( aColor );
+ AISShape->Attributes()->SetUIsoAspect( anAspect );
- anAspect = AISShape->Attributes()->VIsoAspect();
- anAspect->SetNumber( aVIsoNumber );
- anAspect->SetColor( aColor );
- AISShape->Attributes()->SetVIsoAspect( anAspect );
+ anAspect = AISShape->Attributes()->VIsoAspect();
+ anAspect->SetNumber( aVIsoNumber );
+ anAspect->SetColor( aColor );
+ AISShape->Attributes()->SetVIsoAspect( anAspect );
if ( HasColor() )
{
- AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
+ AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
if ( myShape.ShapeType() == TopAbs_VERTEX )
{
Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
AISShape->Attributes()->SetPointAspect( anAspect );
}
}
- else
- {
- if ( myShape.ShapeType() == TopAbs_VERTEX )
- {
- col = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) );
- aColor = SalomeApp_Tools::color( col );
-
- Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
- anAspect->SetColor( aColor );
- anAspect->SetScale( myScaleOfMarker );
- anAspect->SetTypeOfMarker( myTypeOfMarker );
- AISShape->Attributes()->SetPointAspect( anAspect );
- }
- else
- {
- // Set line aspect
- col = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) );
- aColor = SalomeApp_Tools::color( col );
-
- Handle(Prs3d_LineAspect) anAspect = AISShape->Attributes()->LineAspect();
- anAspect->SetColor( aColor );
- AISShape->Attributes()->SetLineAspect( anAspect );
-
- // Set unfree boundaries aspect
- anAspect = AISShape->Attributes()->UnFreeBoundaryAspect();
- anAspect->SetColor( aColor );
- AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect );
-
- // Set free boundaries aspect
- col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) );
- aColor = SalomeApp_Tools::color( col );
-
- anAspect = AISShape->Attributes()->FreeBoundaryAspect();
- anAspect->SetColor( aColor );
- AISShape->Attributes()->SetFreeBoundaryAspect( anAspect );
-
- // Set wire aspect
- col = aResMgr->colorValue( "Geometry", "line_color", QColor( 255, 0, 0 ) );
- aColor = SalomeApp_Tools::color( col );
-
- anAspect = AISShape->Attributes()->WireAspect();
- anAspect->SetColor( aColor );
- AISShape->Attributes()->SetWireAspect( anAspect );
-
- // bug [SALOME platform 0019868]
- // Set deviation angle. Default one is 12 degrees (Prs3d_Drawer.cxx:18)
- AISShape->SetOwnDeviationAngle( 10*PI/180 );
- }
- }
+ else
+ {
+ if ( myShape.ShapeType() == TopAbs_VERTEX )
+ {
+ col = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) );
+ aColor = SalomeApp_Tools::color( col );
+
+ Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
+ anAspect->SetColor( aColor );
+ anAspect->SetScale( myScaleOfMarker );
+ anAspect->SetTypeOfMarker( myTypeOfMarker );
+ AISShape->Attributes()->SetPointAspect( anAspect );
+ }
+ else
+ {
+ // Set line aspect
+ col = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) );
+ aColor = SalomeApp_Tools::color( col );
+
+ Handle(Prs3d_LineAspect) anAspect = AISShape->Attributes()->LineAspect();
+ anAspect->SetColor( aColor );
+ AISShape->Attributes()->SetLineAspect( anAspect );
+
+ // Set unfree boundaries aspect
+ anAspect = AISShape->Attributes()->UnFreeBoundaryAspect();
+ anAspect->SetColor( aColor );
+ AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect );
+
+ // Set free boundaries aspect
+ col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) );
+ aColor = SalomeApp_Tools::color( col );
+
+ anAspect = AISShape->Attributes()->FreeBoundaryAspect();
+ anAspect->SetColor( aColor );
+ AISShape->Attributes()->SetFreeBoundaryAspect( anAspect );
+
+ // Set wire aspect
+ col = aResMgr->colorValue( "Geometry", "line_color", QColor( 255, 0, 0 ) );
+ aColor = SalomeApp_Tools::color( col );
+
+ anAspect = AISShape->Attributes()->WireAspect();
+ anAspect->SetColor( aColor );
+ AISShape->Attributes()->SetWireAspect( anAspect );
+
+ // bug [SALOME platform 0019868]
+ // Set deviation angle. Default one is 12 degrees (Prs3d_Drawer.cxx:18)
+ AISShape->SetOwnDeviationAngle( 10*PI/180 );
+ }
+ }
if ( HasWidth() )
AISShape->SetWidth( GetWidth() );
AISShape->SetOwner( anObj );
}
- // Get color and other properties from GEOM_Object
- SUIT_Session* session = SUIT_Session::session();
- SUIT_Application* app = session->activeApplication();
- if ( app )
- {
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( study )
- {
- Handle( SALOME_InteractiveObject ) anIO = AISShape->getIO();
- if ( !anIO.IsNull() )
- {
- _PTR(SObject) SO ( study->studyDS()->FindObjectID( anIO->getEntry() ) );
- if ( SO )
- {
- // get CORBA reference to data object
- CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO);
- if ( !CORBA::is_nil( object ) )
- {
- // downcast to GEOM object
- GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( object );
- if ( !aGeomObject->_is_nil() )
- {
- SALOMEDS::Color aSColor = aGeomObject->GetColor();
- bool hasColor = aSColor.R >= 0 && aSColor.G >= 0 && aSColor.B >= 0;
- if( !hasColor && aGeomObject->GetType() == GEOM_GROUP ) // auto color for group
- {
- GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen();
- GEOM::GEOM_IGroupOperations_var anOperations = aGeomGen->GetIGroupOperations( study->id() );
- GEOM::GEOM_Object_var aMainObject = anOperations->GetMainShape( aGeomObject );
- if ( !aMainObject->_is_nil() && aMainObject->GetAutoColor() )
- {
- QList<SALOMEDS::Color> aReservedColors;
-
- SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( app );
- CORBA::String_var IOR = app->orb()->object_to_string( aMainObject );
- if ( strcmp(IOR.in(), "") != 0 )
- {
- _PTR(Study) aStudy = study->studyDS();
- _PTR(SObject) aMainSObject( aStudy->FindObjectIOR( string(IOR) ) );
- _PTR(ChildIterator) it( aStudy->NewChildIterator( aMainSObject ) );
- for( ; it->More(); it->Next() )
- {
- _PTR(SObject) aChildSObject( it->Value() );
- GEOM::GEOM_Object_var aChildObject =
- GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aChildSObject));
- if( CORBA::is_nil( aChildObject ) )
- continue;
-
- if( aChildObject->GetType() != GEOM_GROUP )
- continue;
-
- SALOMEDS::Color aReservedColor = aChildObject->GetColor();
- aReservedColors.append( aReservedColor );
- }
- }
-
- aSColor = getUniqueColor( aReservedColors );
- hasColor = true;
- }
- }
-
- if( hasColor )
- {
- Quantity_Color aQuanColor( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB );
- AISShape->SetColor( aQuanColor );
- AISShape->SetShadingColor( aQuanColor );
+ // Get color and other properties from GEOM_Object
+ SUIT_Session* session = SUIT_Session::session();
+ SUIT_Application* app = session->activeApplication();
+ if ( app )
+ {
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ if ( study )
+ {
+ Handle( SALOME_InteractiveObject ) anIO = AISShape->getIO();
+ if ( !anIO.IsNull() )
+ {
+ _PTR(SObject) SO ( study->studyDS()->FindObjectID( anIO->getEntry() ) );
+ if ( SO )
+ {
+ // get CORBA reference to data object
+ CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO);
+ if ( !CORBA::is_nil( object ) )
+ {
+ // downcast to GEOM object
+ GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( object );
+ if ( !aGeomObject->_is_nil() )
+ {
+ SALOMEDS::Color aSColor = aGeomObject->GetColor();
+ bool hasColor = aSColor.R >= 0 && aSColor.G >= 0 && aSColor.B >= 0;
+ if( !hasColor && aGeomObject->GetType() == GEOM_GROUP ) // auto color for group
+ {
+ GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen();
+ GEOM::GEOM_IGroupOperations_var anOperations = aGeomGen->GetIGroupOperations( study->id() );
+ GEOM::GEOM_Object_var aMainObject = anOperations->GetMainShape( aGeomObject );
+ if ( !aMainObject->_is_nil() && aMainObject->GetAutoColor() )
+ {
+ QList<SALOMEDS::Color> aReservedColors;
+
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( app );
+ CORBA::String_var IOR = app->orb()->object_to_string( aMainObject );
+ if ( strcmp(IOR.in(), "") != 0 )
+ {
+ _PTR(Study) aStudy = study->studyDS();
+ _PTR(SObject) aMainSObject( aStudy->FindObjectIOR( string(IOR) ) );
+ _PTR(ChildIterator) it( aStudy->NewChildIterator( aMainSObject ) );
+ for( ; it->More(); it->Next() )
+ {
+ _PTR(SObject) aChildSObject( it->Value() );
+ GEOM::GEOM_Object_var aChildObject =
+ GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aChildSObject));
+ if( CORBA::is_nil( aChildObject ) )
+ continue;
+
+ if( aChildObject->GetType() != GEOM_GROUP )
+ continue;
+
+ SALOMEDS::Color aReservedColor = aChildObject->GetColor();
+ aReservedColors.append( aReservedColor );
+ }
+ }
+
+ aSColor = getUniqueColor( aReservedColors );
+ hasColor = true;
+ }
+ }
+
+ if( hasColor )
+ {
+ Quantity_Color aQuanColor( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB );
+ AISShape->SetColor( aQuanColor );
+ AISShape->SetShadingColor( aQuanColor );
if ( myShape.ShapeType() == TopAbs_VERTEX ) {
Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
anAspect->SetColor( aQuanColor );
anAspect->SetTypeOfMarker( myTypeOfMarker );
AISShape->Attributes()->SetPointAspect( anAspect );
}
- }
- // ... marker type
- GEOM::marker_type aType = aGeomObject->GetMarkerType();
- GEOM::marker_size aSize = aGeomObject->GetMarkerSize();
- if ( aType > GEOM::MT_NONE && aType < GEOM::MT_USER && aSize > GEOM::MS_NONE && aSize <= GEOM::MS_70 ) {
- Aspect_TypeOfMarker aMType = (Aspect_TypeOfMarker)( (int)aType-1 );
- double aMSize = ((int)aSize+1)*0.5;
- Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
- anAspect->SetScale( aMSize );
- anAspect->SetTypeOfMarker( aMType );
- Quantity_Color aQuanColor = SalomeApp_Tools::color( aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ) );
- if ( hasColor )
- aQuanColor = Quantity_Color( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB );
- anAspect->SetColor( aQuanColor );
- AISShape->Attributes()->SetPointAspect( anAspect );
- }
- else if ( aType == GEOM::MT_USER ) {
- int aTextureId = aGeomObject->GetMarkerTexture();
- Quantity_Color aQuanColor = SalomeApp_Tools::color( aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ) );
- if ( hasColor ) aQuanColor = Quantity_Color( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB );
- Standard_Integer aWidth, aHeight;
- Handle(Graphic3d_HArray1OfBytes) aTexture = GeometryGUI::getTexture( getStudy(), aTextureId, aWidth, aHeight );
- if ( !aTexture.IsNull() ) {
- static int TextureId = 0;
- Handle(Prs3d_PointAspect) aTextureAspect = new Prs3d_PointAspect(aQuanColor,
- ++TextureId,
- aWidth, aHeight,
- aTexture );
- AISShape->Attributes()->SetPointAspect( aTextureAspect );
- }
- }
- }
- }
- }
- }
- }
- }
+ }
+ // ... marker type
+ GEOM::marker_type aType = aGeomObject->GetMarkerType();
+ GEOM::marker_size aSize = aGeomObject->GetMarkerSize();
+ if ( aType > GEOM::MT_NONE && aType < GEOM::MT_USER && aSize > GEOM::MS_NONE && aSize <= GEOM::MS_70 ) {
+ Aspect_TypeOfMarker aMType = (Aspect_TypeOfMarker)( (int)aType-1 );
+ double aMSize = ((int)aSize+1)*0.5;
+ Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
+ anAspect->SetScale( aMSize );
+ anAspect->SetTypeOfMarker( aMType );
+ Quantity_Color aQuanColor = SalomeApp_Tools::color( aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ) );
+ if ( hasColor )
+ aQuanColor = Quantity_Color( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB );
+ anAspect->SetColor( aQuanColor );
+ AISShape->Attributes()->SetPointAspect( anAspect );
+ }
+ else if ( aType == GEOM::MT_USER ) {
+ int aTextureId = aGeomObject->GetMarkerTexture();
+ Quantity_Color aQuanColor = SalomeApp_Tools::color( aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ) );
+ if ( hasColor ) aQuanColor = Quantity_Color( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB );
+ Standard_Integer aWidth, aHeight;
+ Handle(Graphic3d_HArray1OfBytes) aTexture = GeometryGUI::getTexture( getStudy(), aTextureId, aWidth, aHeight );
+ if ( !aTexture.IsNull() ) {
+ static int TextureId = 0;
+ Handle(Prs3d_PointAspect) aTextureAspect = new Prs3d_PointAspect(aQuanColor,
+ ++TextureId,
+ aWidth, aHeight,
+ aTexture );
+ AISShape->Attributes()->SetPointAspect( aTextureAspect );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
// AISShape->SetName(???); ??? necessary to set name ???
occPrs->AddObject( AISShape );
*/
//=================================================================
SALOME_Prs* GEOM_Displayer::buildPresentation( const QString& entry,
- SALOME_View* theViewFrame )
+ SALOME_View* theViewFrame )
{
SALOME_Prs* prs = 0;
internalReset();
theIO->setEntry( entry.toLatin1().constData() );
if ( !theIO.IsNull() )
{
- // set interactive object
- setIO( theIO );
- // Find SOBject (because shape should be published previously)
- SUIT_Session* session = SUIT_Session::session();
- SUIT_Application* app = session->activeApplication();
- if ( app )
- {
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( study )
- {
- _PTR(SObject) SO ( study->studyDS()->FindObjectID( theIO->getEntry() ) );
- if ( SO )
- {
- // get CORBA reference to data object
- CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO);
- if ( !CORBA::is_nil( object ) )
- {
- // downcast to GEOM object
- GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( object );
- if ( !GeomObject->_is_nil() )
- {
- // finally set shape
- setShape( GEOM_Client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) );
- myType = GeomObject->GetType();
- }
- }
- }
- }
- }
+ // set interactive object
+ setIO( theIO );
+ // Find SOBject (because shape should be published previously)
+ SUIT_Session* session = SUIT_Session::session();
+ SUIT_Application* app = session->activeApplication();
+ if ( app )
+ {
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ if ( study )
+ {
+ _PTR(SObject) SO ( study->studyDS()->FindObjectID( theIO->getEntry() ) );
+ if ( SO )
+ {
+ // get CORBA reference to data object
+ CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO);
+ if ( !CORBA::is_nil( object ) )
+ {
+ // downcast to GEOM object
+ GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( object );
+ if ( !GeomObject->_is_nil() )
+ {
+ // finally set shape
+ setShape( GEOM_Client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) );
+ myType = GeomObject->GetType();
+ }
+ }
+ }
+ }
+ }
}
UpdatePrs( prs ); // Update presentation by using of the double dispatch
}
theIO->setEntry(entry.toLatin1().constData());
if (!theIO.IsNull())
{
- // set interactive object
- setIO(theIO);
+ // set interactive object
+ setIO(theIO);
// finally set shape
setShape(aShape);
myType = GEOM_SUBSHAPE;
*/
//=================================================================
void GEOM_Displayer::GlobalSelection( const TColStd_MapOfInteger& theModes,
- const bool update, const QList<int>* theSubShapes )
+ const bool update, const QList<int>* theSubShapes )
{
SUIT_Session* session = SUIT_Session::session();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
{
ic = viewer->getAISContext();
if ( !ic.IsNull() )
- ic->RemoveFilters();
+ ic->RemoveFilters();
}
if ( theModes.Contains( GEOM_ALLOBJECTS ) )
TColStd_MapIteratorOfMapOfInteger anIter( theModes );
QList<SUIT_SelectionFilter*> aListOfFilters;
for ( ; anIter.More(); anIter.Next() )
- {
+ {
SUIT_SelectionFilter* aFilter;
int aMode = anIter.Key();
if ( aMode == GEOM_COMPOUNDFILTER )
else
aFilter = getFilter( aMode );
- if ( aFilter )
- aListOfFilters.append( aFilter );
- }
+ if ( aFilter )
+ aListOfFilters.append( aFilter );
+ }
aFilter = new GEOM_LogicalFilter( aListOfFilters, GEOM_LogicalFilter::LO_OR );
}
{
sm->installFilter( aFilter );
if ( !ic.IsNull() )
- {
- Handle(GEOM_OCCFilter) anOCCFilter = new GEOM_OCCFilter( sm );
- ic->AddFilter( anOCCFilter );
- }
+ {
+ Handle(GEOM_OCCFilter) anOCCFilter = new GEOM_OCCFilter( sm );
+ ic->AddFilter( anOCCFilter );
+ }
}
}
{
aTolerance /= 2;
if( aTolerance < 1 )
- break;
+ break;
}
//cout << "Iteration N" << anIterations << " (tolerance=" << aTolerance << ")"<< endl;
//cout << h << " ";
if( abs( h - aHue ) < aTolerance )
{
- ok = false;
- //cout << "break (diff = " << abs( h - aHue ) << ")";
- break;
+ ok = false;
+ //cout << "break (diff = " << abs( h - aHue ) << ")";
+ break;
}
}
//cout << endl;
/* Display/Erase object methods */
void Display ( const Handle(SALOME_InteractiveObject)& theIO,
const bool updateViewer = true,
- SALOME_View* theViewFrame = 0 );
+ SALOME_View* theViewFrame = 0 );
// This overloaded Display() method can be useful for operations
// not using dialog boxes.
void Display ( GEOM::GEOM_Object_ptr theObj,
- const bool updateViewer = true );
+ const bool updateViewer = true );
void Redisplay ( const Handle(SALOME_InteractiveObject)& theIO,
const bool updateViewer = true );
void Erase ( const Handle(SALOME_InteractiveObject)& theIO,
const bool forced = false,
const bool updateViewer = true,
- SALOME_View* theViewFrame = 0 );
+ SALOME_View* theViewFrame = 0 );
void Erase ( GEOM::GEOM_Object_ptr theObj,
const bool forced = false,
QStringList dirList = libs.split( ";", QString::SkipEmptyParts ); // skip empty entries
#endif
for( int i = dirList.count()-1; i >= 0; i-- ) {
- QString dir = dirList[ i ];
- QFileInfo fi( Qtx::addSlash( dirList[ i ] ) + libraryName );
- if( fi.exists() ) {
- OSD_SharedLibrary aSharedLibrary( fi.fileName().toLatin1().data() );
- bool res = aSharedLibrary.DlOpen( OSD_RTLD_LAZY );
- if( !res ) {
- MESSAGE( "Can't open library : " << aSharedLibrary.DlError() );
- continue; // continue search further
- }
- OSD_Function osdF = aSharedLibrary.DlSymb( "GetLibGUI" );
- if ( osdF != NULL ) {
- LibraryGUI func = (GEOMGUI* (*) (GeometryGUI*))osdF;
- GEOMGUI* libGUI = (*func)(this);
- if ( libGUI ) {
- myGUIMap[ libraryName ] = libGUI;
- break; // found and loaded!
- }
- }
- }
+ QString dir = dirList[ i ];
+ QFileInfo fi( Qtx::addSlash( dirList[ i ] ) + libraryName );
+ if( fi.exists() ) {
+ OSD_SharedLibrary aSharedLibrary( fi.fileName().toLatin1().data() );
+ bool res = aSharedLibrary.DlOpen( OSD_RTLD_LAZY );
+ if( !res ) {
+ MESSAGE( "Can't open library : " << aSharedLibrary.DlError() );
+ continue; // continue search further
+ }
+ OSD_Function osdF = aSharedLibrary.DlSymb( "GetLibGUI" );
+ if ( osdF != NULL ) {
+ LibraryGUI func = (GEOMGUI* (*) (GeometryGUI*))osdF;
+ GEOMGUI* libGUI = (*func)(this);
+ if ( libGUI ) {
+ myGUIMap[ libraryName ] = libGUI;
+ break; // found and loaded!
+ }
+ }
+ }
}
}
}
id == 9024 ) { // OBJECT BROWSER - OPEN
//cout << "id " << id << " received" << endl;
#ifndef WNT
- library = getLibrary( "libGEOMToolsGUI.so" );
+ library = getLibrary( "libGEOMToolsGUI.so" );
#else
- library = getLibrary( "GEOMToolsGUI.dll" );
+ library = getLibrary( "GEOMToolsGUI.dll" );
#endif
}
else if( id == 211 || // MENU VIEW - WIREFRAME/SHADING
- id == 212 || // MENU VIEW - DISPLAY ALL
- id == 213 || // MENU VIEW - DISPLAY ONLY
- id == 214 || // MENU VIEW - ERASE ALL
- id == 215 || // MENU VIEW - ERASE
- id == 216 || // MENU VIEW - DISPLAY
- id == 218 || // MENU VIEW - VECTOR MODE
- id == 80311 || // POPUP VIEWER - WIREFRAME
- id == 80312 || // POPUP VIEWER - SHADING
- id == 80313 ) { // POPUP VIEWER - VECTORS
+ id == 212 || // MENU VIEW - DISPLAY ALL
+ id == 213 || // MENU VIEW - DISPLAY ONLY
+ id == 214 || // MENU VIEW - ERASE ALL
+ id == 215 || // MENU VIEW - ERASE
+ id == 216 || // MENU VIEW - DISPLAY
+ id == 218 || // MENU VIEW - VECTOR MODE
+ id == 80311 || // POPUP VIEWER - WIREFRAME
+ id == 80312 || // POPUP VIEWER - SHADING
+ id == 80313 ) { // POPUP VIEWER - VECTORS
#ifndef WNT
- library = getLibrary( "libDisplayGUI.so" );
+ library = getLibrary( "libDisplayGUI.so" );
#else
- library = getLibrary( "DisplayGUI.dll" );
+ library = getLibrary( "DisplayGUI.dll" );
#endif
}
else if( id == 4011 || // MENU BASIC - POINT
- id == 4012 || // MENU BASIC - LINE
- id == 4013 || // MENU BASIC - CIRCLE
- id == 4014 || // MENU BASIC - ELLIPSE
- id == 4015 || // MENU BASIC - ARC
- id == 4016 || // MENU BASIC - VECTOR
- id == 4017 || // MENU BASIC - PLANE
-// id == 4018 || // MENU BASIC - WPLANE // DEPRECATED
- id == 4019 || // MENU BASIC - CURVE
- id == 4020 ) { // MENU BASIC - REPAIR
+ id == 4012 || // MENU BASIC - LINE
+ id == 4013 || // MENU BASIC - CIRCLE
+ id == 4014 || // MENU BASIC - ELLIPSE
+ id == 4015 || // MENU BASIC - ARC
+ id == 4016 || // MENU BASIC - VECTOR
+ id == 4017 || // MENU BASIC - PLANE
+// id == 4018 || // MENU BASIC - WPLANE // DEPRECATED
+ id == 4019 || // MENU BASIC - CURVE
+ id == 4020 ) { // MENU BASIC - REPAIR
#ifndef WNT
- library = getLibrary( "libBasicGUI.so" );
+ library = getLibrary( "libBasicGUI.so" );
#else
- library = getLibrary( "BasicGUI.dll" );
+ library = getLibrary( "BasicGUI.dll" );
#endif
}
else if( id == 4021 || // MENU PRIMITIVE - BOX
- id == 4022 || // MENU PRIMITIVE - CYLINDER
- id == 4023 || // MENU PRIMITIVE - SPHERE
- id == 4024 || // MENU PRIMITIVE - TORUS
- id == 4025 || // MENU PRIMITIVE - CONE
- id == 4026 || // MENU PRIMITIVE - FACE
- id == 4027 ) { // MENU PRIMITIVE - DISK
+ id == 4022 || // MENU PRIMITIVE - CYLINDER
+ id == 4023 || // MENU PRIMITIVE - SPHERE
+ id == 4024 || // MENU PRIMITIVE - TORUS
+ id == 4025 || // MENU PRIMITIVE - CONE
+ id == 4026 || // MENU PRIMITIVE - FACE
+ id == 4027 ) { // MENU PRIMITIVE - DISK
#ifndef WNT
- library = getLibrary( "libPrimitiveGUI.so" );
+ library = getLibrary( "libPrimitiveGUI.so" );
#else
- library = getLibrary( "PrimitiveGUI.dll" );
+ library = getLibrary( "PrimitiveGUI.dll" );
#endif
}
else if( id == 4031 || // MENU GENERATION - PRISM
- id == 4032 || // MENU GENERATION - REVOLUTION
- id == 4033 || // MENU GENERATION - FILLING
- id == 4034 ) { // MENU GENERATION - PIPE
+ id == 4032 || // MENU GENERATION - REVOLUTION
+ id == 4033 || // MENU GENERATION - FILLING
+ id == 4034 ) { // MENU GENERATION - PIPE
#ifndef WNT
- library = getLibrary( "libGenerationGUI.so" );
+ library = getLibrary( "libGenerationGUI.so" );
#else
- library = getLibrary( "GenerationGUI.dll" );
+ library = getLibrary( "GenerationGUI.dll" );
#endif
}
else if( id == 404 || // MENU ENTITY - SKETCHER
id == 405 || // MENU ENTITY - 3D SKETCHER
- id == 407 ) { // MENU ENTITY - EXPLODE
+ id == 407 ) { // MENU ENTITY - EXPLODE
#ifndef WNT
- library = getLibrary( "libEntityGUI.so" );
+ library = getLibrary( "libEntityGUI.so" );
#else
- library = getLibrary( "EntityGUI.dll" );
+ library = getLibrary( "EntityGUI.dll" );
#endif
}
else if( id == 4081 || // MENU BUILD - EDGE
- id == 4082 || // MENU BUILD - WIRE
- id == 4083 || // MENU BUILD - FACE
- id == 4084 || // MENU BUILD - SHELL
- id == 4085 || // MENU BUILD - SOLID
- id == 4086 ) { // MENU BUILD - COMPUND
+ id == 4082 || // MENU BUILD - WIRE
+ id == 4083 || // MENU BUILD - FACE
+ id == 4084 || // MENU BUILD - SHELL
+ id == 4085 || // MENU BUILD - SOLID
+ id == 4086 ) { // MENU BUILD - COMPUND
#ifndef WNT
- library = getLibrary( "libBuildGUI.so" );
+ library = getLibrary( "libBuildGUI.so" );
#else
- library = getLibrary( "BuildGUI.dll" );
+ library = getLibrary( "BuildGUI.dll" );
#endif
}
else if( id == 5011 || // MENU BOOLEAN - FUSE
- id == 5012 || // MENU BOOLEAN - COMMON
- id == 5013 || // MENU BOOLEAN - CUT
- id == 5014 ) { // MENU BOOLEAN - SECTION
+ id == 5012 || // MENU BOOLEAN - COMMON
+ id == 5013 || // MENU BOOLEAN - CUT
+ id == 5014 ) { // MENU BOOLEAN - SECTION
#ifndef WNT
- library = getLibrary( "libBooleanGUI.so" );
+ library = getLibrary( "libBooleanGUI.so" );
#else
- library = getLibrary( "BooleanGUI.dll" );
+ library = getLibrary( "BooleanGUI.dll" );
#endif
}
else if( id == 5021 || // MENU TRANSFORMATION - TRANSLATION
- id == 5022 || // MENU TRANSFORMATION - ROTATION
- id == 5023 || // MENU TRANSFORMATION - LOCATION
- id == 5024 || // MENU TRANSFORMATION - MIRROR
- id == 5025 || // MENU TRANSFORMATION - SCALE
- id == 5026 || // MENU TRANSFORMATION - OFFSET
- id == 5027 || // MENU TRANSFORMATION - MULTI-TRANSLATION
- id == 5028 || // MENU TRANSFORMATION - MULTI-ROTATION
+ id == 5022 || // MENU TRANSFORMATION - ROTATION
+ id == 5023 || // MENU TRANSFORMATION - LOCATION
+ id == 5024 || // MENU TRANSFORMATION - MIRROR
+ id == 5025 || // MENU TRANSFORMATION - SCALE
+ id == 5026 || // MENU TRANSFORMATION - OFFSET
+ id == 5027 || // MENU TRANSFORMATION - MULTI-TRANSLATION
+ id == 5028 || // MENU TRANSFORMATION - MULTI-ROTATION
id == 5029 ) { // CONTEXT(POPUP) MENU - RELOAD_IMPORTED
#ifndef WNT
- library = getLibrary( "libTransformationGUI.so" );
+ library = getLibrary( "libTransformationGUI.so" );
#else
- library = getLibrary( "TransformationGUI.dll" );
+ library = getLibrary( "TransformationGUI.dll" );
#endif
}
else if( id == 503 || // MENU OPERATION - PARTITION
- id == 504 || // MENU OPERATION - ARCHIMEDE
- id == 505 || // MENU OPERATION - FILLET
- id == 506 || // MENU OPERATION - CHAMFER
- id == 507 || // MENU OPERATION - CLIPPING RANGE
- id == 508 || // MENU OPERATION - GET SHAPES ON SHAPE
- id == 509 || // MENU OPERATION - FILLET 2D
- id == 510 ) { // MENU OPERATION - FILLET 1D
+ id == 504 || // MENU OPERATION - ARCHIMEDE
+ id == 505 || // MENU OPERATION - FILLET
+ id == 506 || // MENU OPERATION - CHAMFER
+ id == 507 || // MENU OPERATION - CLIPPING RANGE
+ id == 508 || // MENU OPERATION - GET SHAPES ON SHAPE
+ id == 509 || // MENU OPERATION - FILLET 2D
+ id == 510 ) { // MENU OPERATION - FILLET 1D
#ifndef WNT
- library = getLibrary( "libOperationGUI.so" );
+ library = getLibrary( "libOperationGUI.so" );
#else
- library = getLibrary( "OperationGUI.dll" );
+ library = getLibrary( "OperationGUI.dll" );
#endif
}
else if( id == 601 || // MENU REPAIR - SEWING
- id == 603 || // MENU REPAIR - SUPPRESS FACES
- id == 604 || // MENU REPAIR - SUPPRESS HOLE
+ id == 603 || // MENU REPAIR - SUPPRESS FACES
+ id == 604 || // MENU REPAIR - SUPPRESS HOLE
id == 605 || // MENU REPAIR - SHAPE PROCESSING
id == 606 || // MENU REPAIR - CLOSE CONTOUR
id == 607 || // MENU REPAIR - REMOVE INTERNAL WIRES
id == 609 || // MENU MEASURE - FREE BOUNDARIES
id == 610 || // MENU MEASURE - FREE FACES
id == 611 || // MENU REPAIR - CHANGE ORIENTATION
- id == 602 || // MENU REPAIR - GLUE FACES
- id == 612 ) { // MENU REPAIR - REMOVE EXTRA EDGES
+ id == 602 || // MENU REPAIR - GLUE FACES
+ id == 612 ) { // MENU REPAIR - REMOVE EXTRA EDGES
#ifndef WNT
- library = getLibrary( "libRepairGUI.so" );
+ library = getLibrary( "libRepairGUI.so" );
#else
- library = getLibrary( "RepairGUI.dll" );
+ library = getLibrary( "RepairGUI.dll" );
#endif
}
else if( id == 701 || // MENU MEASURE - PROPERTIES
- id == 702 || // MENU MEASURE - CDG
- id == 703 || // MENU MEASURE - INERTIA
- id == 704 || // MENU MEASURE - NORMALE
- id == 7041 || // MENU MEASURE - BOUNDING BOX
- id == 7042 || // MENU MEASURE - MIN DISTANCE
- id == 7043 || // MENU MEASURE - ANGLE
- id == 705 || // MENU MEASURE - TOLERANCE
- id == 706 || // MENU MEASURE - WHATIS
- id == 707 || // MENU MEASURE - CHECK
- id == 7072 || // MENU MEASURE - CHECK COMPOUND OF BLOCKS
- id == 708 ) { // MENU MEASURE - POINT COORDINATES
+ id == 702 || // MENU MEASURE - CDG
+ id == 703 || // MENU MEASURE - INERTIA
+ id == 704 || // MENU MEASURE - NORMALE
+ id == 7041 || // MENU MEASURE - BOUNDING BOX
+ id == 7042 || // MENU MEASURE - MIN DISTANCE
+ id == 7043 || // MENU MEASURE - ANGLE
+ id == 705 || // MENU MEASURE - TOLERANCE
+ id == 706 || // MENU MEASURE - WHATIS
+ id == 707 || // MENU MEASURE - CHECK
+ id == 7072 || // MENU MEASURE - CHECK COMPOUND OF BLOCKS
+ id == 708 ) { // MENU MEASURE - POINT COORDINATES
#ifndef WNT
- library = getLibrary( "libMeasureGUI.so" );
+ library = getLibrary( "libMeasureGUI.so" );
#else
- library = getLibrary( "MeasureGUI.dll" );
+ library = getLibrary( "MeasureGUI.dll" );
#endif
}
else if( id == 800 || // MENU GROUP - CREATE
- id == 8001 || // POPUP MENU - CREATE GROUP
- id == 801 ) { // MENU GROUP - EDIT
+ id == 8001 || // POPUP MENU - CREATE GROUP
+ id == 801 ) { // MENU GROUP - EDIT
#ifndef WNT
- library = getLibrary( "libGroupGUI.so" );
+ library = getLibrary( "libGroupGUI.so" );
#else
- library = getLibrary( "GroupGUI.dll" );
+ library = getLibrary( "GroupGUI.dll" );
#endif
}
else if( id == 9999 || // MENU BLOCKS - HEXAHEDRAL SOLID
id == 99991 || // MENU BLOCKS - PROPAGATE
id == 9995 ) { // MENU BLOCKS - EXPLODE ON BLOCKS
#ifndef WNT
- library = getLibrary( "libBlocksGUI.so" );
+ library = getLibrary( "libBlocksGUI.so" );
#else
- library = getLibrary( "BlocksGUI.dll" );
+ library = getLibrary( "BlocksGUI.dll" );
#endif
}
if ( win->getViewManager()->getTypeView() == VIEW_VTK ) {
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( window );
if ( vw ) {
- SVTK_RenderWindowInteractor* anInteractor = vw->getRWInteractor();
- anInteractor->SetSelectionProp();
- anInteractor->SetSelectionTolerance();
- SVTK_InteractorStyleSALOME* aStyle = anInteractor->GetInteractorStyleSALOME();
- if (aStyle) {
- aStyle->setPreselectionProp();
- }
+ SVTK_RenderWindowInteractor* anInteractor = vw->getRWInteractor();
+ anInteractor->SetSelectionProp();
+ anInteractor->SetSelectionTolerance();
+ SVTK_InteractorStyleSALOME* aStyle = anInteractor->GetInteractorStyleSALOME();
+ if (aStyle) {
+ aStyle->setPreselectionProp();
+ }
}
}
}
QString IsoU = QAD_CONFIG->getSetting("Geometry:SettingsIsoU");
QString IsoV = QAD_CONFIG->getSetting("Geometry:SettingsIsoV");
if(!IsoU.isEmpty())
- ic->DefaultDrawer()->UIsoAspect()->SetNumber(IsoU.toInt());
+ ic->DefaultDrawer()->UIsoAspect()->SetNumber(IsoU.toInt());
if(!IsoV.isEmpty())
- ic->DefaultDrawer()->VIsoAspect()->SetNumber(IsoV.toInt());
+ ic->DefaultDrawer()->VIsoAspect()->SetNumber(IsoV.toInt());
}
}
setToolShown( true );
connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
- this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
+ this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
// Reset actions accelerator keys
//action(111)->setAccel(QKeySequence(CTRL + Key_I)); // Import
setToolShown( false );
disconnect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
- this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
+ this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
EmitSignalCloseAllDialogs();
{
qDebug( "connect" );
connect( vm, SIGNAL( keyPress ( SUIT_ViewWindow*, QKeyEvent* ) ),
- this, SLOT( OnKeyPress( SUIT_ViewWindow*, QKeyEvent* ) ) );
+ this, SLOT( OnKeyPress( SUIT_ViewWindow*, QKeyEvent* ) ) );
connect( vm, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
- this, SLOT( OnMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
+ this, SLOT( OnMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
connect( vm, SIGNAL( mouseMove ( SUIT_ViewWindow*, QMouseEvent* ) ),
- this, SLOT( OnMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
+ this, SLOT( OnMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
LightApp_SelectionMgr* sm = getApp()->selectionMgr();
QListIterator<GEOMGUI_OCCSelector*> itOCCSel( myOCCSelectors );
while ( itOCCSel.hasNext() )
if ( GEOMGUI_OCCSelector* sr = itOCCSel.next() )
- sr->setEnabled(true);
+ sr->setEnabled(true);
}
else if ( vm->getType() == SVTK_Viewer::Type() )
{
QListIterator<LightApp_VTKSelector*> itVTKSel( myVTKSelectors );
while ( itVTKSel.hasNext() )
if ( LightApp_VTKSelector* sr = itVTKSel.next() )
- sr->setEnabled(true);
+ sr->setEnabled(true);
}
}
QListIterator<GEOMGUI_OCCSelector*> itOCCSel( myOCCSelectors );
while ( itOCCSel.hasNext() )
if ( GEOMGUI_OCCSelector* sr = itOCCSel.next() )
- if ( sr->viewer() == viewer )
- {
- delete myOCCSelectors.takeAt( myOCCSelectors.indexOf( sr ) );
- break;
- }
+ if ( sr->viewer() == viewer )
+ {
+ delete myOCCSelectors.takeAt( myOCCSelectors.indexOf( sr ) );
+ break;
+ }
}
if ( vm->getType() == SVTK_Viewer::Type() )
{
QListIterator<LightApp_VTKSelector*> itVTKSel( myVTKSelectors );
while ( itVTKSel.hasNext() )
if ( LightApp_VTKSelector* sr = itVTKSel.next() )
- if ( sr->viewer() == viewer )
- {
- delete myVTKSelectors.takeAt( myVTKSelectors.indexOf( sr ) );
- break;
- }
+ if ( sr->viewer() == viewer )
+ {
+ delete myVTKSelectors.takeAt( myVTKSelectors.indexOf( sr ) );
+ break;
+ }
}
}
if ( aTexture.IsNull() ) {
GEOM::GEOM_IInsertOperations_var aInsOp = GeometryGUI::GetGeomGen()->GetIInsertOperations( theStudy->studyDS()->StudyId() );
if ( !aInsOp->_is_nil() ) {
- CORBA::Long aWidth, aHeight;
- SALOMEDS::TMPFile_var aStream = aInsOp->GetTexture( theId, aWidth, aHeight );
- if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) {
- theWidth = aWidth;
- theHeight = aHeight;
- aTexture = new Graphic3d_HArray1OfBytes( 1, aStream->length() );
- for ( int i = 0; i < aStream->length(); i++ )
- aTexture->SetValue( i+1, (Standard_Byte)aStream[i] );
- aTextureMap[ theId ] = aTexture;
- }
+ CORBA::Long aWidth, aHeight;
+ SALOMEDS::TMPFile_var aStream = aInsOp->GetTexture( theId, aWidth, aHeight );
+ if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) {
+ theWidth = aWidth;
+ theHeight = aHeight;
+ aTexture = new Graphic3d_HArray1OfBytes( 1, aStream->length() );
+ for ( int i = 0; i < aStream->length(); i++ )
+ aTexture->SetValue( i+1, (Standard_Byte)aStream[i] );
+ aTextureMap[ theId ] = aTexture;
+ }
}
}
}
setPreferenceProperty( genGroup, "columns", 2 );
int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup,
- LightApp_Preferences::Selector,
- "Geometry", "display_mode" );
+ LightApp_Preferences::Selector,
+ "Geometry", "display_mode" );
addPreference( tr( "PREF_SHADING_COLOR" ), genGroup,
- LightApp_Preferences::Color, "Geometry", "shading_color" );
+ LightApp_Preferences::Color, "Geometry", "shading_color" );
addPreference( tr( "PREF_WIREFRAME_COLOR" ), genGroup,
- LightApp_Preferences::Color, "Geometry", "wireframe_color" );
+ LightApp_Preferences::Color, "Geometry", "wireframe_color" );
addPreference( tr( "PREF_FREE_BOUND_COLOR" ), genGroup,
- LightApp_Preferences::Color, "Geometry", "free_bound_color" );
+ LightApp_Preferences::Color, "Geometry", "free_bound_color" );
addPreference( tr( "PREF_LINE_COLOR"), genGroup,
- LightApp_Preferences::Color, "Geometry", "line_color" );
+ LightApp_Preferences::Color, "Geometry", "line_color" );
addPreference( tr( "PREF_POINT_COLOR"), genGroup,
- LightApp_Preferences::Color, "Geometry", "point_color" );
+ LightApp_Preferences::Color, "Geometry", "point_color" );
addPreference( tr( "PREF_ISOS_COLOR" ), genGroup,
- LightApp_Preferences::Color, "Geometry", "isos_color" );
+ LightApp_Preferences::Color, "Geometry", "isos_color" );
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
- LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
+ LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
int VertexGroup = addPreference( tr( "PREF_GROUP_VERTEX" ), tabId );
setPreferenceProperty( VertexGroup, "columns", 2 );
QVector<SUIT_ViewWindow*> views = vman->getViews();
for (int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++)
{
- if (SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>(views[i]))
+ if (SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>(views[i]))
{
- vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
- allActors->InitTraversal();
- while (vtkActor* actor = allActors->GetNextActor())
+ vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+ allActors->InitTraversal();
+ while (vtkActor* actor = allActors->GetNextActor())
{
- if (actor->GetVisibility()) // store only visible actors
+ if (actor->GetVisibility()) // store only visible actors
{
GEOM_Actor* aGeomActor = 0;
if (actor->IsA("GEOM_Actor"))
aGeomActor = GEOM_Actor::SafeDownCast(actor);
- if (aGeomActor && aGeomActor->hasIO())
+ if (aGeomActor && aGeomActor->hasIO())
{
Handle(SALOME_InteractiveObject) io = aGeomActor->getIO();
if (io->hasEntry())
param = occParam + "Isos";
ip->setParameter(entry, param, isosStr.toLatin1().data());
} // if (io->hasEntry())
- } // GEOM_Actor && hasIO
- } // isVisible
- } // while.. actors traversal
- } // if (vtkView)
+ } // GEOM_Actor && hasIO
+ } // isVisible
+ } // while.. actors traversal
+ } // if (vtkView)
} // for (views)
vtkViewers++;
} // if (SVTK view model)
QVector<SUIT_ViewWindow*> views = vman->getViews();
for (int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++)
{
- SOCC_ViewWindow* occView = dynamic_cast<SOCC_ViewWindow*>(views[i]);
- if (occView)
+ SOCC_ViewWindow* occView = dynamic_cast<SOCC_ViewWindow*>(views[i]);
+ if (occView)
{
//Handle(AIS_InteractiveContext) ic =
// ((OCCViewer_Viewer*)(occView->getViewManager()->getViewModel()))->getAISContext();
ip->setParameter(entry, param, isosStr.toLatin1().data());
} // if (io->hasEntry())
} // if (io)
- } // if (GEOM_AISShape)
- } // for (AIS_ListOfInteractive)
- } // if ( occView )
+ } // if (GEOM_AISShape)
+ } // for (AIS_ListOfInteractive)
+ } // if ( occView )
} // for ( views )
occViewers++;
} // if (SOCC view model)
bool ok;
int viewIndex = viewIndexStr.toUInt(&ok);
if (!ok) // bad conversion of view index to integer
- continue;
+ continue;
// viewers
if (viewerTypStr == SVTK_Viewer::Type())
}
}
} // if (paramNameStr == "Visibility")
- else
+ else
{
// the rest properties "work" with GEOM_Actor
- if (vActor)
+ if (vActor)
{
QString val ((*valuesIt).c_str());
}
}
}
- } // other parameters than Visibility
+ } // other parameters than Visibility
}
else if (viewerTypStr == SOCC_Viewer::Type())
{
if (paramNameStr == "Visibility")
{
- if (occActor.IsNull() && displayer())
+ if (occActor.IsNull() && displayer())
{
displayer()->Display(entry, true, occVModel);
}
}
} // if (paramNameStr == "Visibility")
- else
+ else
{
// the rest properties "work" with GEOM_AISShape
- if (!occActor.IsNull())
+ if (!occActor.IsNull())
{
QString val ((*valuesIt).c_str());
}
}
}
- } // other parameters than Visibility
+ } // other parameters than Visibility
}
else
{
// virtual void DefinePopup( QString & theContext, QString & theParent, QString & theObject);
// virtual bool CustomPopup( QAD_Desktop* parent, QMenu* popup, const QString& theContext,
-// const QString& theParent, const QString& theObject );
+// const QString& theParent, const QString& theObject );
// The Working Plane management
void SetWorkingPlane( gp_Ax3 wp ) { myWorkingPlane = wp; }
private:
GEOMGUI* getLibrary( const QString& libraryName );
void createGeomAction( const int id, const QString& po_id,
- const QString& icon_id = QString(""),
- const int key = 0, const bool toggle = false );
+ const QString& icon_id = QString(""),
+ const int key = 0, const bool toggle = false );
void createPopupItem( const int, const QString& clients, const QString& types,
- const bool isSingle = false, const int isVisible = -1,
- const bool isExpandAll = false, const bool isOCC = false,
- const int parentId = -1 );
+ const bool isSingle = false, const int isVisible = -1,
+ const bool isExpandAll = false, const bool isOCC = false,
+ const int parentId = -1 );
public:
static GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine!!!
if ( vw ) {
OCCViewer_ViewManager* vm = dynamic_cast<OCCViewer_ViewManager*>( vw->getViewManager() );
if ( vm )
- return vm->getOCCViewer();
+ return vm->getOCCViewer();
}
}
"GEOM",
const_cast<char*>( obj->GetID().c_str()));
- GEOM_Displayer(ActiveStudy).Display(anIO, myUpdateViewer);
- /*if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(app)) {
- SVTK_View* aView = aViewWindow->getView();
- int aMode = aView->GetDisplayMode();
+ GEOM_Displayer(ActiveStudy).Display(anIO, myUpdateViewer);
+ /*if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(app)) {
+ SVTK_View* aView = aViewWindow->getView();
+ int aMode = aView->GetDisplayMode();
- vtkActorCollection* theActors =
+ vtkActorCollection* theActors =
GEOM_AssemblyBuilder::BuildActors(Shape,0,aMode,true);
- theActors->InitTraversal();
- while (vtkActor* anActor = theActors->GetNextActor()) {
- GEOM_Actor* GActor = GEOM_Actor::SafeDownCast(anActor);
- GActor->setName(const_cast<char*>(aNameValue.c_str()));
- GActor->setIO(anIO);
- aView->Display(GActor);
- }
- aView->Repaint();
- } else if (OCCViewer_Viewer* occViewer = GetOCCViewer(app)) {
- Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
- Handle(GEOM_AISShape) aSh =
+ theActors->InitTraversal();
+ while (vtkActor* anActor = theActors->GetNextActor()) {
+ GEOM_Actor* GActor = GEOM_Actor::SafeDownCast(anActor);
+ GActor->setName(const_cast<char*>(aNameValue.c_str()));
+ GActor->setIO(anIO);
+ aView->Display(GActor);
+ }
+ aView->Repaint();
+ } else if (OCCViewer_Viewer* occViewer = GetOCCViewer(app)) {
+ Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
+ Handle(GEOM_AISShape) aSh =
new GEOM_AISShape (Shape,const_cast<char*>(aNameValue.c_str()));
- aSh->setName(const_cast<char*>(aNameValue.c_str()));
- aSh->setIO(anIO);
- ic->Display(aSh);
- ic->AddOrRemoveCurrentObject(aSh,true);
- }*/
- // update object browser
- SalomeApp_Application* app = NULL; //dynamic_cast<SalomeApp_Application*>(app);
- if (app) {
- CAM_Module* module = app->module("Geometry");
- SalomeApp_Module* appMod = dynamic_cast<SalomeApp_Module*>(module);
- if (appMod)
- appMod->updateObjBrowser(true);
- }
- }
+ aSh->setName(const_cast<char*>(aNameValue.c_str()));
+ aSh->setIO(anIO);
+ ic->Display(aSh);
+ ic->AddOrRemoveCurrentObject(aSh,true);
+ }*/
+ // update object browser
+ SalomeApp_Application* app = NULL; //dynamic_cast<SalomeApp_Application*>(app);
+ if (app) {
+ CAM_Module* module = app->module("Geometry");
+ SalomeApp_Module* appMod = dynamic_cast<SalomeApp_Module*>(module);
+ if (appMod)
+ appMod->updateObjBrowser(true);
+ }
+ }
}
}
};
class TEventUpdateBrowser: public SALOME_Event
{
public:
- TEventUpdateBrowser() {}
- virtual void Execute() {
+ TEventUpdateBrowser() {}
+ virtual void Execute() {
SalomeApp_Application* app =
dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
if (app) {
- CAM_Module* module = app->module("Geometry");
- SalomeApp_Module* appMod = dynamic_cast<SalomeApp_Module*>(module);
- if (appMod) appMod->updateObjBrowser(true);
- }
+ CAM_Module* module = app->module("Geometry");
+ SalomeApp_Module* appMod = dynamic_cast<SalomeApp_Module*>(module);
+ if (appMod) appMod->updateObjBrowser(true);
+ }
}
};
public:
TEventFitAll() {}
virtual void Execute() {
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if (!app) return;
-
- if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(app))
- {
- SVTK_View* aView = aViewWindow->getView();
- aView->GetRenderer()->OnFitAll();
- }
- else if (OCCViewer_Viewer* occViewer = GetOCCViewer(app))
- {
- Handle(V3d_Viewer) aViewer3d = occViewer->getViewer3d();
- aViewer3d->InitActiveViews();
-
- if (aViewer3d->MoreActiveViews())
- aViewer3d->ActiveView()->FitAll();
- }
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if (!app) return;
+
+ if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(app))
+ {
+ SVTK_View* aView = aViewWindow->getView();
+ aView->GetRenderer()->OnFitAll();
+ }
+ else if (OCCViewer_Viewer* occViewer = GetOCCViewer(app))
+ {
+ Handle(V3d_Viewer) aViewer3d = occViewer->getViewer3d();
+ aViewer3d->InitActiveViews();
+
+ if (aViewer3d->MoreActiveViews())
+ aViewer3d->ActiveView()->FitAll();
+ }
}
};
public:
TEventUpdateViewer() {}
virtual void Execute() {
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if (!app) return;
- SalomeApp_Study* ActiveStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
- if (!ActiveStudy) return;
-
- GEOM_Displayer(ActiveStudy).UpdateViewer();
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if (!app) return;
+ SalomeApp_Study* ActiveStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
+ if (!ActiveStudy) return;
+
+ GEOM_Displayer(ActiveStudy).UpdateViewer();
}
};
new SALOME_InteractiveObject(myEntry.c_str(), "GEOM", "");
if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)) {
- SVTK_View* aView = aViewWindow->getView();
- aView->SetDisplayMode(anIO, myMode);
- if (myUpdateViewer)
- aView->Repaint();
+ SVTK_View* aView = aViewWindow->getView();
+ aView->SetDisplayMode(anIO, myMode);
+ if (myUpdateViewer)
+ aView->Repaint();
}
else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
- SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer);
- if (soccViewer)
- soccViewer->switchRepresentation(anIO, myMode, myUpdateViewer);
+ SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer);
+ if (soccViewer)
+ soccViewer->switchRepresentation(anIO, myMode, myUpdateViewer);
}
}
};
new SALOME_InteractiveObject(myEntry.c_str(), "GEOM", "");
if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)) {
- SVTK_View* aView = aViewWindow->getView();
- SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(aViewWindow->getViewManager()->getViewModel());
- SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( myEntry.c_str() ) );
- vtkActorCollection* anActors = vtkPrs->GetObjects();
- anActors->InitTraversal();
- while (vtkActor* anAct = anActors->GetNextActor()) {
- GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(anAct);
- aGeomActor->SetVectorMode(!aGeomActor->GetVectorMode());
- }
- if (myUpdateViewer)
- aView->Repaint();
+ SVTK_View* aView = aViewWindow->getView();
+ SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(aViewWindow->getViewManager()->getViewModel());
+ SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( myEntry.c_str() ) );
+ vtkActorCollection* anActors = vtkPrs->GetObjects();
+ anActors->InitTraversal();
+ while (vtkActor* anAct = anActors->GetNextActor()) {
+ GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(anAct);
+ aGeomActor->SetVectorMode(!aGeomActor->GetVectorMode());
+ }
+ if (myUpdateViewer)
+ aView->Repaint();
}
else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
- Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
- SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer);
- if (soccViewer) {
- SOCC_Prs* occPrs = dynamic_cast<SOCC_Prs*>( soccViewer->CreatePrs( myEntry.c_str() ) );
- if ( occPrs && !occPrs->IsNull() ) {
- AIS_ListOfInteractive shapes; occPrs->GetObjects( shapes );
- AIS_ListIteratorOfListOfInteractive interIter( shapes );
- for ( ; interIter.More(); interIter.Next() ) {
- Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
- aSh->SetDisplayVectors(myOn);
- ic->RecomputePrsOnly(interIter.Value());
- }
- }
- }
+ Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
+ SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer);
+ if (soccViewer) {
+ SOCC_Prs* occPrs = dynamic_cast<SOCC_Prs*>( soccViewer->CreatePrs( myEntry.c_str() ) );
+ if ( occPrs && !occPrs->IsNull() ) {
+ AIS_ListOfInteractive shapes; occPrs->GetObjects( shapes );
+ AIS_ListIteratorOfListOfInteractive interIter( shapes );
+ for ( ; interIter.More(); interIter.Next() ) {
+ Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
+ aSh->SetDisplayVectors(myOn);
+ ic->RecomputePrsOnly(interIter.Value());
+ }
+ }
+ }
}
}
};
new SALOME_InteractiveObject(myEntry.c_str(), "GEOM", "");
if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)){
- SVTK_View* aView = aViewWindow->getView();
+ SVTK_View* aView = aViewWindow->getView();
QColor aColor (myRed, myGreen, myBlue);
aView->SetColor(anIO, aColor);
- if (myUpdateViewer)
- aView->Repaint();
+ if (myUpdateViewer)
+ aView->Repaint();
} else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
- Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
- AIS_ListOfInteractive List;
- ic->DisplayedObjects(List);
- AIS_ListIteratorOfListOfInteractive ite (List);
- for (; ite.More(); ite.Next()) {
- Handle(SALOME_InteractiveObject) anObj =
- Handle(SALOME_InteractiveObject)::DownCast(ite.Value()->GetOwner());
- if (!anObj.IsNull() && anObj->hasEntry() && anObj->isSame(anIO)) {
- Quantity_Color CSFColor =
+ Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
+ AIS_ListOfInteractive List;
+ ic->DisplayedObjects(List);
+ AIS_ListIteratorOfListOfInteractive ite (List);
+ for (; ite.More(); ite.Next()) {
+ Handle(SALOME_InteractiveObject) anObj =
+ Handle(SALOME_InteractiveObject)::DownCast(ite.Value()->GetOwner());
+ if (!anObj.IsNull() && anObj->hasEntry() && anObj->isSame(anIO)) {
+ Quantity_Color CSFColor =
Quantity_Color(myRed/255., myGreen/255., myBlue/255., Quantity_TOC_RGB);
- ite.Value()->SetColor(CSFColor);
- if (ite.Value()->IsKind(STANDARD_TYPE(GEOM_AISShape)))
- Handle(GEOM_AISShape)::DownCast(ite.Value())->SetShadingColor(CSFColor);
- ic->Redisplay(ite.Value(), true, true);
- if (myUpdateViewer)
- occViewer->update();
- break;
- }
- }
+ ite.Value()->SetColor(CSFColor);
+ if (ite.Value()->IsKind(STANDARD_TYPE(GEOM_AISShape)))
+ Handle(GEOM_AISShape)::DownCast(ite.Value())->SetShadingColor(CSFColor);
+ ic->Redisplay(ite.Value(), true, true);
+ if (myUpdateViewer)
+ occViewer->update();
+ break;
+ }
+ }
}
}
};
new SALOME_InteractiveObject(myEntry.c_str(), "GEOM", "");
if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)) {
- SVTK_View* aView = aViewWindow->getView();
- aView->SetTransparency(anIO, myParam);
- if (myUpdateViewer)
- aView->Repaint();
+ SVTK_View* aView = aViewWindow->getView();
+ aView->SetTransparency(anIO, myParam);
+ if (myUpdateViewer)
+ aView->Repaint();
} else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
- SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer);
- if (soccViewer)
- soccViewer->setTransparency(anIO, myParam, myUpdateViewer);
+ SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>(occViewer);
+ if (soccViewer)
+ soccViewer->setTransparency(anIO, myParam, myUpdateViewer);
}
}
};
GEOM_Displayer(ActiveStudy).Erase(aIO, true);
/* if (myFromAllWindows) {
- QPtrList<SUIT_ViewWindow> aWindows = app->desktop()->windows();
- SUIT_ViewWindow* aWin = 0;
- for (aWin = aWindows.first(); aWin; aWin = aWindows.next()) {
- EraseObject(aWin, aIO);
- }
+ QPtrList<SUIT_ViewWindow> aWindows = app->desktop()->windows();
+ SUIT_ViewWindow* aWin = 0;
+ for (aWin = aWindows.first(); aWin; aWin = aWindows.next()) {
+ EraseObject(aWin, aIO);
+ }
} else {
- SUIT_ViewWindow* aWin = app->desktop()->activeWindow();
- if (aWin)
- EraseObject(aWin, aIO);
- }*/
+ SUIT_ViewWindow* aWin = app->desktop()->activeWindow();
+ if (aWin)
+ EraseObject(aWin, aIO);
+ }*/
}
/* private:
void EraseObject(SUIT_ViewWindow* theWin, Handle (SALOME_InteractiveObject) theIO)
{
if (theWin->getViewManager()->getType() == OCCViewer_Viewer::Type()){
- OCCViewer_ViewWindow* vw = dynamic_cast<OCCViewer_ViewWindow*>( theWin );
- if ( vw ) {
- OCCViewer_ViewManager* vm = dynamic_cast<OCCViewer_ViewManager*>( vw->getViewManager() );
- if ( vm ) {
- SOCC_Viewer* aViewer = dynamic_cast<SOCC_Viewer*>(vm->getOCCViewer());
- if (aViewer) {
- SALOME_Prs* aPrs = aViewer->CreatePrs(myEntry.c_str());
- if (aPrs) {
- SALOME_OCCPrs* aOccPrs = dynamic_cast<SALOME_OCCPrs*>(aPrs);
- if (aOccPrs) {
- aViewer->Erase(aOccPrs);
- aViewer->Repaint();
- }
- }
- }
- }
- }
+ OCCViewer_ViewWindow* vw = dynamic_cast<OCCViewer_ViewWindow*>( theWin );
+ if ( vw ) {
+ OCCViewer_ViewManager* vm = dynamic_cast<OCCViewer_ViewManager*>( vw->getViewManager() );
+ if ( vm ) {
+ SOCC_Viewer* aViewer = dynamic_cast<SOCC_Viewer*>(vm->getOCCViewer());
+ if (aViewer) {
+ SALOME_Prs* aPrs = aViewer->CreatePrs(myEntry.c_str());
+ if (aPrs) {
+ SALOME_OCCPrs* aOccPrs = dynamic_cast<SALOME_OCCPrs*>(aPrs);
+ if (aOccPrs) {
+ aViewer->Erase(aOccPrs);
+ aViewer->Repaint();
+ }
+ }
+ }
+ }
+ }
} else if (theWin->getViewManager()->getType() == SVTK_Viewer::Type()){
- SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>( theWin );
- if (aViewWindow) {
- aViewWindow->Erase(theIO);
- }
+ SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>( theWin );
+ if (aViewWindow) {
+ aViewWindow->Erase(theIO);
+ }
}
}*/
new SALOME_InteractiveObject(myEntry.c_str(), "GEOM", "");
if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(anApp)) {
- vtkActorCollection* aActors = aViewWindow->getRenderer()->GetActors();
- aActors->InitTraversal();
- while (vtkActor* aAct = aActors->GetNextActor()) {
- if (GEOM_Actor* aGeomActor = dynamic_cast<GEOM_Actor*>(aAct)) {
- if (aGeomActor->hasIO()) {
- Handle(SALOME_InteractiveObject) aNextIO = aGeomActor->getIO();
- if (aNextIO->isSame(anIO)) {
- aGeomActor->setDeflection(myParam);
- aViewWindow->Repaint();
- return;
- }
- }
- }
- }
- // aView->SetTransparency(anIO, myParam);
- //aView->Repaint();
+ vtkActorCollection* aActors = aViewWindow->getRenderer()->GetActors();
+ aActors->InitTraversal();
+ while (vtkActor* aAct = aActors->GetNextActor()) {
+ if (GEOM_Actor* aGeomActor = dynamic_cast<GEOM_Actor*>(aAct)) {
+ if (aGeomActor->hasIO()) {
+ Handle(SALOME_InteractiveObject) aNextIO = aGeomActor->getIO();
+ if (aNextIO->isSame(anIO)) {
+ aGeomActor->setDeflection(myParam);
+ aViewWindow->Repaint();
+ return;
+ }
+ }
+ }
+ }
+ // aView->SetTransparency(anIO, myParam);
+ //aView->Repaint();
} else if (OCCViewer_Viewer* occViewer = GetOCCViewer(anApp)) {
- Handle(AIS_InteractiveContext) aContext = occViewer->getAISContext();
- AIS_ListOfInteractive aAISList;
- aContext->DisplayedObjects(aAISList);
- AIS_ListIteratorOfListOfInteractive it(aAISList);
- for (; it.More(); it.Next()) {
- Handle(SALOME_InteractiveObject) aObj =
- Handle(SALOME_InteractiveObject)::DownCast(it.Value()->GetOwner());
- if ((!aObj.IsNull()) && aObj->hasEntry() && aObj->isSame(anIO)) {
- Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(it.Value());
- if (!aShape.IsNull()) {
- TopoDS_Shape aSh = aShape->Shape();
- if (!aSh.IsNull())
- BRepTools::Clean(aSh);
-
- aShape->SetOwnDeviationCoefficient( myParam );
- aShape->SetOwnHLRDeviationAngle( 1.57 );
- aContext->Redisplay(aShape);
- return;
- }
- }
- }
+ Handle(AIS_InteractiveContext) aContext = occViewer->getAISContext();
+ AIS_ListOfInteractive aAISList;
+ aContext->DisplayedObjects(aAISList);
+ AIS_ListIteratorOfListOfInteractive it(aAISList);
+ for (; it.More(); it.Next()) {
+ Handle(SALOME_InteractiveObject) aObj =
+ Handle(SALOME_InteractiveObject)::DownCast(it.Value()->GetOwner());
+ if ((!aObj.IsNull()) && aObj->hasEntry() && aObj->isSame(anIO)) {
+ Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(it.Value());
+ if (!aShape.IsNull()) {
+ TopoDS_Shape aSh = aShape->Shape();
+ if (!aSh.IsNull())
+ BRepTools::Clean(aSh);
+
+ aShape->SetOwnDeviationCoefficient( myParam );
+ aShape->SetOwnHLRDeviationAngle( 1.57 );
+ aContext->Redisplay(aShape);
+ return;
+ }
+ }
+ }
}
}
};
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_3DSketcherDriver",
- sizeof(GEOMImpl_3DSketcherDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_3DSketcherDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
GC_MakeArcOfCircle arc (aGeomCirc->Circ(), aP2, aP3, Standard_True);
aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
} else if ( aType == ELLIPSE_ARC_CENTER_TWO_PNT ) { // ELLIPSE_ARC_CENTER_TWO_PNT
- if ( aP1.Distance(aP2) <= aP1.Distance(aP3) ) {
- // Standard_ConstructionError::Raise("Arc creation aborted: the distance from Center Point to Point 1 needs to be bigger than the distance from Center Point to Point 2");
- cout << "aP1.Distance(aP2) <= aP1.Distance(aP3)" << endl;
- gp_Pnt aTmpP = aP2;
- aP2 = aP3;
- aP3 = aTmpP;
- }
+ if ( aP1.Distance(aP2) <= aP1.Distance(aP3) ) {
+ // Standard_ConstructionError::Raise("Arc creation aborted: the distance from Center Point to Point 1 needs to be bigger than the distance from Center Point to Point 2");
+ cout << "aP1.Distance(aP2) <= aP1.Distance(aP3)" << endl;
+ gp_Pnt aTmpP = aP2;
+ aP2 = aP3;
+ aP3 = aTmpP;
+ }
- GC_MakeEllipse ellipse (aP2, aP3, aP1);
- Handle(Geom_Ellipse) aGeomEllipse = ellipse.Value();
+ GC_MakeEllipse ellipse (aP2, aP3, aP1);
+ Handle(Geom_Ellipse) aGeomEllipse = ellipse.Value();
gp_Vec aV1 (aP1, aP2);
gp_Vec aV2 (aP1, aP3);
- double alpha = fabs(aV1.Angle(aV2));
-
- GC_MakeArcOfEllipse arc (aGeomEllipse->Elips(), aP2, aP3, Standard_True);
- aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
+ double alpha = fabs(aV1.Angle(aV2));
+
+ GC_MakeArcOfEllipse arc (aGeomEllipse->Elips(), aP2, aP3, Standard_True);
+ aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
}
}
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ArcDriver",
- sizeof(GEOMImpl_ArcDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_ArcDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ArchimedeDriver",
- sizeof(GEOMImpl_ArchimedeDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_ArchimedeDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_BooleanDriver",
- sizeof(GEOMImpl_BooleanDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_BooleanDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
if (P1.X() == P2.X() || P1.Y() == P2.Y() || P1.Z() == P2.Z()) {
- StdFail_NotDone::Raise("Box can not be created, the points belong to the same plane");
- return 0;
+ StdFail_NotDone::Raise("Box can not be created, the points belong to the same plane");
+ return 0;
}
BRepPrimAPI_MakeBox MB (P1,P2);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_BoxDriver",
- sizeof(GEOMImpl_BoxDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_BoxDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_CircleDriver",
- sizeof(GEOMImpl_CircleDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_CircleDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ConeDriver",
- sizeof(GEOMImpl_ConeDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_ConeDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_CopyDriver",
- sizeof(GEOMImpl_CopyDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_CopyDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_CylinderDriver",
- sizeof(GEOMImpl_CylinderDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_CylinderDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
gp_Ax2 anAxes (aP, -aV);
gp_Circ aCirc (anAxes, aCI.GetRadius());
- TopoDS_Shape aCircle = BRepBuilderAPI_MakeEdge(aCirc).Edge();
- BRepBuilderAPI_MakeWire MW;
- MW.Add(TopoDS::Edge(aCircle));
- BRepBuilderAPI_MakeFace MF (MW, Standard_False);
- aShape = MF.Shape();
+ TopoDS_Shape aCircle = BRepBuilderAPI_MakeEdge(aCirc).Edge();
+ BRepBuilderAPI_MakeWire MW;
+ MW.Add(TopoDS::Edge(aCircle));
+ BRepBuilderAPI_MakeFace MF (MW, Standard_False);
+ aShape = MF.Shape();
}
}
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_DiskDriver",
- sizeof(GEOMImpl_DiskDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_DiskDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
TopoDS_Vertex V1, V2;
TopExp::Vertices(anE, V1, V2, Standard_True);
if (!V1.IsNull() && !V2.IsNull()) {
- gp_Vec aVM (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
+ gp_Vec aVM (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
if (aVM.Magnitude() < gp::Resolution()) {
Standard_ConstructionError::Raise
("Ellipse creation aborted: major axis vector of zero length is given");
}
- if (aV.IsParallel(aVM, Precision::Angular())) {
- Standard_ConstructionError::Raise
- ("Ellipse creation aborted: normal and major axis vectors are parallel");
- }
- // Axes defined with main axis vector
- anAxes = gp_Ax2 (aP, aV, aVM);
+ if (aV.IsParallel(aVM, Precision::Angular())) {
+ Standard_ConstructionError::Raise
+ ("Ellipse creation aborted: normal and major axis vectors are parallel");
+ }
+ // Axes defined with main axis vector
+ anAxes = gp_Ax2 (aP, aV, aVM);
}
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_EllipseDriver",
- sizeof(GEOMImpl_EllipseDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_EllipseDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ExportDriver",
- sizeof(GEOMImpl_ExportDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_ExportDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_FaceDriver",
- sizeof(GEOMImpl_FaceDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_FaceDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
for (int ind = 1; ind <= aLen; ind++) {
TopoDS_Shape aShapeVertex;
if (GEOMImpl_ILocalOperations::GetSubShape
- (aWire, aCI.GetVertex(ind), aShapeVertex))
+ (aWire, aCI.GetVertex(ind), aShapeVertex))
aVertexList.Append( aShapeVertex );
}
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_Fillet1dDriver",
- sizeof(GEOMImpl_Fillet1dDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_Fillet1dDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
for (; ind <= aLen; ind++) {
TopoDS_Shape aShapeVertex;
if (GEOMImpl_ILocalOperations::GetSubShape
- (aFaceShape, aCI.GetVertex(ind), aShapeVertex)) {
+ (aFaceShape, aCI.GetVertex(ind), aShapeVertex)) {
fillet2d.AddFillet(TopoDS::Vertex(aShapeVertex), rad);
}
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_Fillet2dDriver",
- sizeof(GEOMImpl_Fillet2dDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_Fillet2dDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
TopoDS_Shape aShapeEdge;
if (GEOMImpl_ILocalOperations::GetSubShape
(aShapeBase, aCI.GetEdge(ind), aShapeEdge)) {
- fill.Add(TopoDS::Edge(aShapeEdge));
+ fill.Add(TopoDS::Edge(aShapeEdge));
}
}
} else if (aType == FILLET_SHAPE_FACES || aType == FILLET_SHAPE_FACES_2R) {
fill.SetRadius(aCI.GetR(), i, 1);
else if (aType == FILLET_SHAPE_FACES_2R || aType == FILLET_SHAPE_EDGES_2R)
for (int i = 1; i <= fill.NbContours(); i++)
- {
- fill.SetRadius(aCI.GetR1(), aCI.GetR2(), i, 1);
- }
+ {
+ fill.SetRadius(aCI.GetR1(), aCI.GetR2(), i, 1);
+ }
fill.Build();
if (!fill.IsDone()) {
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_FilletDriver",
- sizeof(GEOMImpl_FilletDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_FilletDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_FillingDriver",
- sizeof(GEOMImpl_FillingDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_FillingDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//purpose :
//=======================================================================
TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesByList (const TopoDS_Shape& theShape,
- const Standard_Real theTolerance,
+ const Standard_Real theTolerance,
const Standard_Boolean doKeepNonSolids,
- const TopTools_MapOfShape& aFaces)
+ const TopTools_MapOfShape& aFaces)
{
TopoDS_Shape aRes;
for( ; i <= SF->Length(); i++) {
Handle(Standard_Transient) anItem = SF->Value(i);
if(anItem.IsNull())
- continue;
+ continue;
Handle(GEOM_Function) aRefSh = Handle(GEOM_Function)::DownCast(anItem);
if(aRefSh.IsNull())
- continue;
+ continue;
TopoDS_Shape aFace = aRefSh->GetValue();
if(aFace.IsNull())
- continue;
+ continue;
if(!aFaces.Contains(aFace))
- aFaces.Add(aFace);
+ aFaces.Add(aFace);
}
aShape = GlueFacesByList(aShapeBase, tol3d, aKeepNonSolids, aFaces);
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_GlueDriver",
- sizeof(GEOMImpl_GlueDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_GlueDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
TCollection_AsciiString& theWarning) const;
Standard_EXPORT static TopoDS_Shape GlueFacesByList (const TopoDS_Shape& theShape,
- const Standard_Real theTolerance,
+ const Standard_Real theTolerance,
const Standard_Boolean doKeepNonSolids,
- const TopTools_MapOfShape& aFaces);
+ const TopTools_MapOfShape& aFaces);
// Type management
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_HealingDriver",
- sizeof(GEOMImpl_HealingDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_HealingDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceObjHW (Handle(GEOM_Object) theObj,
- double theH, double theW)
+ double theH, double theW)
{
SetErrorCode(KO);
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskThreePnt (Handle(GEOM_Object) thePnt1,
- Handle(GEOM_Object) thePnt2,
- Handle(GEOM_Object) thePnt3)
+ Handle(GEOM_Object) thePnt2,
+ Handle(GEOM_Object) thePnt3)
{
SetErrorCode(KO);
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH2Ways (Handle(GEOM_Object) theBase,
- Handle(GEOM_Object) theVec,
- double theH)
+ Handle(GEOM_Object) theVec,
+ double theH)
{
SetErrorCode(KO);
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
- const Handle(TColStd_HSequenceOfTransient)& theSeqSections,
- bool theModeSolid,
- double thePreci,
- bool theRuled)
+ const Handle(TColStd_HSequenceOfTransient)& theSeqSections,
+ bool theModeSolid,
+ double thePreci,
+ bool theRuled)
{
Handle(GEOM_Object) anObj;
SetErrorCode(KO);
if(!aSectObj.IsNull()) {
pyDump<< aSectObj;
if(i < nbObj)
- pyDump<<", ";
+ pyDump<<", ";
}
}
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations,
- const Handle(GEOM_Object)& thePath,
- bool theWithContact,
- bool theWithCorrections)
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations,
+ const Handle(GEOM_Object)& thePath,
+ bool theWithContact,
+ bool theWithCorrections)
{
Handle(GEOM_Object) anObj;
SetErrorCode(KO);
{
Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
if(anItemLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
if(aLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
if(aRefLoc.IsNull())
- continue;
+ continue;
aSeqLocs->Append(aRefLoc);
}
aSeqBases->Append(aRefBase);
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
- pyDump<<", ";
+ pyDump<<", ";
}
}
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbLocs)
- pyDump<<", ";
+ pyDump<<", ";
}
}
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theSubBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations,
- const Handle(GEOM_Object)& thePath,
- bool theWithContact,
- bool theWithCorrections)
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theSubBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations,
+ const Handle(GEOM_Object)& thePath,
+ bool theWithContact,
+ bool theWithCorrections)
{
Handle(GEOM_Object) anObj;
SetErrorCode(KO);
if( nbSubBases >= nbBases ) {
Handle(Standard_Transient) aSubItem = theSubBases->Value(i);
if(aSubItem.IsNull())
- continue;
+ continue;
Handle(GEOM_Object) aSubBase = Handle(GEOM_Object)::DownCast(aSubItem);
if(aSubBase.IsNull())
- continue;
+ continue;
Handle(GEOM_Function) aRefSubBase = aSubBase->GetLastFunction();
if(aRefSubBase.IsNull())
- continue;
+ continue;
aSeqSubBases->Append(aRefSubBase);
}
if(nbLocs) {
Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
if(anItemLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
if(aLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
if(aRefLoc.IsNull())
- continue;
+ continue;
aSeqLocs->Append(aRefLoc);
}
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
- pyDump<<", ";
+ pyDump<<", ";
}
}
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
- pyDump<<", ";
+ pyDump<<", ";
}
}
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbLocs)
- pyDump<<", ";
+ pyDump<<", ";
}
}
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations)
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations)
{
Handle(GEOM_Object) anObj;
SetErrorCode(KO);
if(nbLocs) {
Handle(Standard_Transient) anItemLoc = theLocations->Value(i);
if(anItemLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Object) aLoc = Handle(GEOM_Object)::DownCast(anItemLoc);
if(aLoc.IsNull())
- continue;
+ continue;
Handle(GEOM_Function) aRefLoc = aLoc->GetLastFunction();
if(aRefLoc.IsNull())
- continue;
+ continue;
aSeqLocs->Append(aRefLoc);
}
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbBases)
- pyDump<<", ";
+ pyDump<<", ";
}
}
if(!anObj.IsNull()) {
pyDump<< anObj;
if(i < nbLocs)
- pyDump<<", ";
+ pyDump<<", ";
}
}
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase,
- Handle(GEOM_Object) thePath,
- Handle(GEOM_Object) theVec)
+ Handle(GEOM_Object) thePath,
+ Handle(GEOM_Object) theVec)
{
SetErrorCode(KO);
Standard_EXPORT Handle(GEOM_Object) MakeBoxDXDYDZ (double theDX, double theDY, double theDZ);
Standard_EXPORT Handle(GEOM_Object) MakeBoxTwoPnt (Handle(GEOM_Object) thePnt1,
- Handle(GEOM_Object) thePnt2);
+ Handle(GEOM_Object) thePnt2);
Standard_EXPORT Handle(GEOM_Object) MakeFaceHW (double theH, double theW, int theOrientation);
Standard_EXPORT Handle(GEOM_Object) MakeFaceObjHW (Handle(GEOM_Object) theObj,
- double theH, double theW);
+ double theH, double theW);
Standard_EXPORT Handle(GEOM_Object) MakeDiskThreePnt (Handle(GEOM_Object) thePnt1,
- Handle(GEOM_Object) thePnt2,
- Handle(GEOM_Object) thePnt3);
+ Handle(GEOM_Object) thePnt2,
+ Handle(GEOM_Object) thePnt3);
Standard_EXPORT Handle(GEOM_Object) MakeDiskPntVecR (Handle(GEOM_Object) thePnt1,
- Handle(GEOM_Object) theVec,
- double theR);
+ Handle(GEOM_Object) theVec,
+ double theR);
Standard_EXPORT Handle(GEOM_Object) MakeDiskR (double theR, int theOrientation);
Standard_EXPORT Handle(GEOM_Object) MakeCylinderRH (double theR, double theH);
Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRH (Handle(GEOM_Object) thePnt,
double theAngle);
Standard_EXPORT Handle(GEOM_Object) MakeRevolutionAxisAngle2Ways (Handle(GEOM_Object) theBase,
- Handle(GEOM_Object) theAxis,
- double theAngle);
+ Handle(GEOM_Object) theAxis,
+ double theAngle);
Standard_EXPORT Handle(GEOM_Object) MakeFilling (Handle(GEOM_Object) theShape,
int theMinDeg, int theMaxDeg,
bool theRuled);
Standard_EXPORT Handle(GEOM_Object) MakePipeWithDifferentSections(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations,
- const Handle(GEOM_Object)& thePath,
- bool theWithContact,
- bool theWithCorrections);
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations,
+ const Handle(GEOM_Object)& thePath,
+ bool theWithContact,
+ bool theWithCorrections);
Standard_EXPORT Handle(GEOM_Object) MakePipeWithShellSections(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theSubBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations,
- const Handle(GEOM_Object)& thePath,
- bool theWithContact,
- bool theWithCorrections);
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theSubBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations,
+ const Handle(GEOM_Object)& thePath,
+ bool theWithContact,
+ bool theWithCorrections);
Standard_EXPORT Handle(GEOM_Object) MakePipeShellsWithoutPath(
- const Handle(TColStd_HSequenceOfTransient)& theBases,
- const Handle(TColStd_HSequenceOfTransient)& theLocations);
+ const Handle(TColStd_HSequenceOfTransient)& theBases,
+ const Handle(TColStd_HSequenceOfTransient)& theLocations);
Standard_EXPORT Handle(GEOM_Object) MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase,
- Handle(GEOM_Object) thePath,
- Handle(GEOM_Object) theVec);
+ Handle(GEOM_Object) thePath,
+ Handle(GEOM_Object) theVec);
};
const Standard_Integer theLimit,
const Standard_Boolean theRemoveWebs,
const Handle(TColStd_HArray1OfInteger)& theMaterials,
- const Standard_Integer theKeepNonlimitShapes,
+ const Standard_Integer theKeepNonlimitShapes,
const Standard_Boolean thePerformSelfIntersections)
{
SetErrorCode(KO);
const Standard_Integer theLimit,
const Standard_Boolean theRemoveWebs,
const Handle(TColStd_HArray1OfInteger)& theMaterials,
- const Standard_Integer theKeepNonlimitShapes,
- const Standard_Boolean thePerformSelfIntersections);
+ const Standard_Integer theKeepNonlimitShapes,
+ const Standard_Boolean thePerformSelfIntersections);
Standard_EXPORT Handle(GEOM_Object) MakeHalfPartition (Handle(GEOM_Object) theShape,
Handle(GEOM_Object) thePlane);
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeEllipse
(Handle(GEOM_Object) thePnt, Handle(GEOM_Object) theVec,
double theRMajor, double theRMinor,
- Handle(GEOM_Object) theVecMaj)
+ Handle(GEOM_Object) theVecMaj)
{
SetErrorCode(KO);
//Make a Python command
if (!theVecMaj.IsNull()) {
GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeEllipse("
- << thePnt << ", " << theVec << ", " << theRMajor << ", " << theRMinor
- << ", " << theVecMaj << ")";
+ << thePnt << ", " << theVec << ", " << theRMajor << ", " << theRMinor
+ << ", " << theVecMaj << ")";
}
else {
GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeEllipse("
- << thePnt << ", " << theVec << ", " << theRMajor << ", " << theRMinor << ")";
+ << thePnt << ", " << theVec << ", " << theRMajor << ", " << theRMinor << ")";
}
SetErrorCode(OK);
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArcOfEllipse (Handle(GEOM_Object) thePnt1,
- Handle(GEOM_Object) thePnt2,
- Handle(GEOM_Object) thePnt3)
+ Handle(GEOM_Object) thePnt2,
+ Handle(GEOM_Object) thePnt3)
{
SetErrorCode(KO);
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcher (const char* theCommand,
- list<double> theWorkingPlane)
+ list<double> theWorkingPlane)
{
SetErrorCode(KO);
Standard_EXPORT Handle(GEOM_Object) MakeEllipse (Handle(GEOM_Object) thePnt,
Handle(GEOM_Object) theVec,
double theRMajor, double theRMinor,
- Handle(GEOM_Object) theVecMaj);
+ Handle(GEOM_Object) theVecMaj);
Standard_EXPORT Handle(GEOM_Object) MakeArc (Handle(GEOM_Object) thePnt1,
Handle(GEOM_Object) thePnt2,
bool theSense);
Standard_EXPORT Handle(GEOM_Object) MakeArcOfEllipse (Handle(GEOM_Object) thePnt1,
- Handle(GEOM_Object) thePnt2,
- Handle(GEOM_Object) thePnt3);
+ Handle(GEOM_Object) thePnt2,
+ Handle(GEOM_Object) thePnt3);
Standard_EXPORT Handle(GEOM_Object) MakeSplineBezier (list<Handle(GEOM_Object)> thePoints);
Standard_EXPORT Handle(GEOM_Object) MakeSplineInterpolation (list<Handle(GEOM_Object)> thePoints,
{
std::string anOperation = anOperators.Value( i ).ToCString();
if ( GetOperatorParameters( anOperation, theParams, theValues ) )
- theOperations.push_back( anOperation );
+ theOperations.push_back( anOperation );
else
nbOperatorErrors++;
}
*/
//=============================================================================
bool GEOMImpl_IHealingOperations::GetOperatorParameters( const std::string theOperation,
- std::list<std::string>& theParams,
- std::list<std::string>& theValues )
+ std::list<std::string>& theParams,
+ std::list<std::string>& theValues )
{
ShHealOper_ShapeProcess aHealer;
int nbParamValueErrors( 0 );
TCollection_AsciiString aParam( (Standard_CString)(*it).c_str() );
TCollection_AsciiString aValue;
if ( aHealer.GetParameter( aParam, aValue ) ) {
- theParams.push_back( aParam.ToCString() );
- theValues.push_back( aValue.ToCString() );
+ theParams.push_back( aParam.ToCString() );
+ theValues.push_back( aValue.ToCString() );
}
else
- nbParamValueErrors++;
+ nbParamValueErrors++;
}
}
else
}
catch (Standard_Failure)
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
}
catch (Standard_Failure)
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
}
catch (Standard_Failure)
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
}
catch (Standard_Failure)
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
}
catch (Standard_Failure)
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
*/
//=============================================================================
bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(GEOM_Object) theObject,
- Handle(TColStd_HSequenceOfTransient)& theClosed,
- Handle(TColStd_HSequenceOfTransient)& theOpen )
+ Handle(TColStd_HSequenceOfTransient)& theClosed,
+ Handle(TColStd_HSequenceOfTransient)& theOpen )
{
// set error code, check parameters
SetErrorCode(KO);
//=============================================================================
void GEOMImpl_IInsertOperations::Export
(const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName)
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName)
{
SetErrorCode(KO);
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IInsertOperations::Import
(const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName)
+ const TCollection_AsciiString& theFormatName)
{
SetErrorCode(KO);
//=============================================================================
Standard_Boolean GEOMImpl_IInsertOperations::ImportTranslators
(Handle(TColStd_HSequenceOfAsciiString)& theFormats,
- Handle(TColStd_HSequenceOfAsciiString)& thePatterns)
+ Handle(TColStd_HSequenceOfAsciiString)& thePatterns)
{
if (theFormats.IsNull())
theFormats = new TColStd_HSequenceOfAsciiString;
int aLenFormats = theFormats->Length();
bool isFound = false;
for(int aInd=1;aInd<=aLenFormats;aInd++){
- if( theFormats->Value(aInd) == aToken){
- isFound = true;
- break;
- }
+ if( theFormats->Value(aInd) == aToken){
+ isFound = true;
+ break;
+ }
}
if(!isFound)
- theFormats->Append(aToken);
+ theFormats->Append(aToken);
}
}
if (myResMgr->Find(aKey.ToCString()))
aPattern = myResMgr->Value(aKey.ToCString());
else if(myResMgrUser->Find(aKey.ToCString()))
- aPattern = myResMgrUser->Value(aKey.ToCString());
+ aPattern = myResMgrUser->Value(aKey.ToCString());
else {
aPattern = theFormats->Value(j);
aPattern += " Files ( *.* )";
//=============================================================================
Standard_Boolean GEOMImpl_IInsertOperations::ExportTranslators
(Handle(TColStd_HSequenceOfAsciiString)& theFormats,
- Handle(TColStd_HSequenceOfAsciiString)& thePatterns)
+ Handle(TColStd_HSequenceOfAsciiString)& thePatterns)
{
if (theFormats.IsNull())
theFormats = new TColStd_HSequenceOfAsciiString;
int aLenFormats = theFormats->Length();
bool isFound = false;
for(int aInd=1;aInd<=aLenFormats;aInd++){
- if( theFormats->Value(aInd) == aToken){
- isFound = true;
- break;
- }
+ if( theFormats->Value(aInd) == aToken){
+ isFound = true;
+ break;
+ }
}
if(!isFound)
- theFormats->Append(aToken);
+ theFormats->Append(aToken);
}
}
if (myResMgr->Find(aKey.ToCString()))
aPattern = myResMgr->Value(aKey.ToCString());
else if (myResMgrUser->Find(aKey.ToCString()))
- aPattern = myResMgrUser->Value(aKey.ToCString());
+ aPattern = myResMgrUser->Value(aKey.ToCString());
else {
aPattern = theFormats->Value(j);
aPattern += " Files ( *.* )";
}
return ( myResMgr->Find("Import") || myResMgr->Find("Export") ||
- myResMgrUser->Find("Import") || myResMgrUser->Find("Export"));
+ myResMgrUser->Find("Import") || myResMgrUser->Find("Export"));
}
int GEOMImpl_IInsertOperations::LoadTexture(const TCollection_AsciiString& theTextureFile)
for (int i = 0; i < lenline/8; i++) {
unsigned char byte = 0;
for (int j = 0; j < 8; j++)
- byte = (byte << 1) + ( i*8+j < line.size() && line[i*8+j] != '0' ? 1 : 0 );
+ byte = (byte << 1) + ( i*8+j < line.size() && line[i*8+j] != '0' ? 1 : 0 );
bytedata.push_back(byte);
}
for (int i = lenline/8; i < lenbytes; i++)
}
int GEOMImpl_IInsertOperations::AddTexture(int theWidth, int theHeight,
- const Handle(TDataStd_HArray1OfByte)& theTexture)
+ const Handle(TDataStd_HArray1OfByte)& theTexture)
{
SetErrorCode(KO);
int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture);
}
Handle(TDataStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theTextureId,
- int& theWidth, int& theHeight)
+ int& theWidth, int& theHeight)
{
SetErrorCode(KO);
Standard_EXPORT int LoadTexture(const TCollection_AsciiString& theTextureFile);
Standard_EXPORT int AddTexture(int theWidth, int theHeight,
- const Handle(TDataStd_HArray1OfByte)& theTexture);
+ const Handle(TDataStd_HArray1OfByte)& theTexture);
Standard_EXPORT Handle(TDataStd_HArray1OfByte) GetTexture(int theTextureId,
- int& theWidth, int& theHeight);
+ int& theWidth, int& theHeight);
Standard_EXPORT std::list<int> GetAllTextures();
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_ChamferDriver::GetID())
- { MESSAGE ( "Chamfer Driver is NULL!!!" ); return NULL; }
+ { MESSAGE ( "Chamfer Driver is NULL!!!" ); return NULL; }
GEOMImpl_IChamfer aCI (aFunction);
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_ChamferDriver::GetID())
- { MESSAGE("Chamfer Driver is NULL!!!"); return NULL;}
+ { MESSAGE("Chamfer Driver is NULL!!!"); return NULL;}
GEOMImpl_IChamfer aCI (aFunction);
theVolume = 0.0;
if (aShape.ShapeType() < TopAbs_SHELL) {
for (TopExp_Explorer Exp (aShape, TopAbs_SOLID); Exp.More(); Exp.Next()) {
- GProp_GProps VProps;
- BRepGProp::VolumeProperties(Exp.Current(), VProps);
- theVolume += VProps.Mass();
+ GProp_GProps VProps;
+ BRepGProp::VolumeProperties(Exp.Current(), VProps);
+ theVolume += VProps.Mass();
}
}
}
TopoDS_Face Face = TopoDS::Face(ExF.Current());
T = BRep_Tool::Tolerance(Face);
if (T > FaceMax)
- FaceMax = T;
+ FaceMax = T;
if (T < FaceMin)
- FaceMin = T;
+ FaceMin = T;
}
for (TopExp_Explorer ExE (aShape, TopAbs_EDGE); ExE.More(); ExE.Next()) {
TopoDS_Edge Edge = TopoDS::Edge(ExE.Current());
T = BRep_Tool::Tolerance(Edge);
if (T > EdgeMax)
- EdgeMax = T;
+ EdgeMax = T;
if (T < EdgeMin)
- EdgeMin = T;
+ EdgeMin = T;
}
for (TopExp_Explorer ExV (aShape, TopAbs_VERTEX); ExV.More(); ExV.Next()) {
TopoDS_Vertex Vertex = TopoDS::Vertex(ExV.Current());
T = BRep_Tool::Tolerance(Vertex);
if (T > VertMax)
- VertMax = T;
+ VertMax = T;
if (T < VertMin)
- VertMin = T;
+ VertMin = T;
}
}
catch (Standard_Failure) {
gp_Pnt PMin1, PMin2, P1, P2;
for (int i = 1; i <= dst.NbSolution(); i++) {
- P1 = dst.PointOnShape1(i);
- P2 = dst.PointOnShape2(i);
+ P1 = dst.PointOnShape1(i);
+ P2 = dst.PointOnShape2(i);
- Standard_Real Dist = P1.Distance(P2);
- if (MinDist > Dist) {
- MinDist = Dist;
+ Standard_Real Dist = P1.Distance(P2);
+ if (MinDist > Dist) {
+ MinDist = Dist;
PMin1 = P1;
PMin2 = P2;
}
Handle(Geom_Curve) C2 = BRep_Tool::Curve(E2,fp,lp);
if ( C1.IsNull() || C2.IsNull() ||
- !C1->IsKind(STANDARD_TYPE(Geom_Line)) ||
+ !C1->IsKind(STANDARD_TYPE(Geom_Line)) ||
!C2->IsKind(STANDARD_TYPE(Geom_Line)))
{
SetErrorCode("The edges must be linear");
const Handle(BRepCheck_Result)& res = theAna.Result(sub);
for (res->InitContextIterator();
- res->MoreShapeInContext();
- res->NextShapeInContext()) {
+ res->MoreShapeInContext();
+ res->NextShapeInContext()) {
if (res->ContextualShape().IsSame(theShape) && !Contains(theMap(sub), theShape)) {
- theMap(sub).Append(theShape);
- itl.Initialize(res->StatusOnShape());
+ theMap(sub).Append(theShape);
+ itl.Initialize(res->StatusOnShape());
- if (itl.Value() != BRepCheck_NoError) {
- Standard_Integer ii = 0;
+ if (itl.Value() != BRepCheck_NoError) {
+ Standard_Integer ii = 0;
for (ii = 1; ii <= sl->Length(); ii++)
if (sl->Value(ii).IsSame(sub)) break;
NbProblems->SetValue((Standard_Integer)stat,
NbProblems->Value((Standard_Integer)stat) + 1);
}
- }
- break;
+ }
+ break;
}
}
}
Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
(Handle(GEOM_Object) theShape,
const Standard_Real theTolerance,
- std::list<Handle(GEOM_Object)> theFaces,
+ std::list<Handle(GEOM_Object)> theFaces,
const Standard_Boolean doKeepNonSolids)
{
SetErrorCode(KO);
TopExp_Explorer exp (aShape, TopAbs_ShapeEnum(theShapeType));
for (; exp.More(); exp.Next())
if (mapShape.Add(exp.Current()))
- listShape.Append(exp.Current());
+ listShape.Append(exp.Current());
}
if (listShape.IsEmpty()) {
TopExp_Explorer exp (aShape, TopAbs_ShapeEnum(theShapeType));
for (; exp.More(); exp.Next())
if (mapShape.Add(exp.Current()))
- listShape.Append(exp.Current());
+ listShape.Append(exp.Current());
}
if (listShape.IsEmpty()) {
TopTools_ListIteratorOfListOfShape itC;
for (itC.Initialize(CL); itC.More(); itC.Next()) {
for (it.Initialize(itC.Value()); it.More(); it.Next()) {
- if (it.Value().ShapeType() == TopAbs_COMPOUND) {
- if (it.Value().IsSame(aSubShape))
- return index;
- else
- index++;
- CL.Append(it.Value());
- }
+ if (it.Value().ShapeType() == TopAbs_COMPOUND) {
+ if (it.Value().IsSame(aSubShape))
+ return index;
+ else
+ index++;
+ CL.Append(it.Value());
+ }
}
}
} else {
TopTools_MapOfShape M;
for (; anExp.More(); anExp.Next()) {
if (M.Add(anExp.Current())) {
- if (anExp.Current().IsSame(aSubShape))
- return index;
- index++;
+ if (anExp.Current().IsSame(aSubShape))
+ return index;
+ index++;
}
}
}
{
BRepAdaptor_Surface surf (TopoDS::Face(aShape));
if (surf.GetType() == GeomAbs_Plane)
- aTypeName = "Plane";
+ aTypeName = "Plane";
else if (surf.GetType() == GeomAbs_Cylinder)
- aTypeName = "Cylindrical Face";
+ aTypeName = "Cylindrical Face";
else if (surf.GetType() == GeomAbs_Sphere)
- aTypeName = "Spherical Face";
+ aTypeName = "Spherical Face";
else if (surf.GetType() == GeomAbs_Torus)
- aTypeName = "Toroidal Face";
+ aTypeName = "Toroidal Face";
else if (surf.GetType() == GeomAbs_Cone)
- aTypeName = "Conical Face";
+ aTypeName = "Conical Face";
else
- aTypeName = "GEOM::FACE";
+ aTypeName = "GEOM::FACE";
}
break;
case TopAbs_WIRE:
{
BRepAdaptor_Curve curv (TopoDS::Edge(aShape));
if (curv.GetType() == GeomAbs_Line) {
- if ((Abs(curv.FirstParameter()) >= 1E6) ||
+ if ((Abs(curv.FirstParameter()) >= 1E6) ||
(Abs(curv.LastParameter()) >= 1E6))
aTypeName = "Line";
- else
- aTypeName = "Edge";
+ else
+ aTypeName = "Edge";
} else if (curv.GetType() == GeomAbs_Circle) {
- if (curv.IsClosed())
+ if (curv.IsClosed())
aTypeName = "Circle";
- else
+ else
aTypeName = "Arc";
} else {
aTypeName = "Edge";
TopExp_Explorer exp (aShape, TopAbs_ShapeEnum(theShapeType));
for (; exp.More(); exp.Next())
if (mapShape.Add(exp.Current()))
- nbShapes++;
+ nbShapes++;
}
*/
//=======================================================================
Handle(TColStd_HSequenceOfInteger)
GEOMImpl_IShapesOperations::getShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
- const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- GEOMAlgo_State theState)
+ const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ GEOMAlgo_State theState)
{
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
//=======================================================================
Handle(TColStd_HSequenceOfInteger)
GEOMImpl_IShapesOperations::GetShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
- const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- GEOMAlgo_State theState)
+ const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ GEOMAlgo_State theState)
{
// Find subshapes ids
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs =
//=======================================================================
Handle(TColStd_HSequenceOfTransient)
GEOMImpl_IShapesOperations::GetShapesOnBox(const Handle(GEOM_Object)& theBox,
- const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- GEOMAlgo_State theState)
+ const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ GEOMAlgo_State theState)
{
// Find subshapes ids
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs =
(const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
const Handle(GEOM_Object)& theAx1,
- const Handle(GEOM_Object)& thePnt,
+ const Handle(GEOM_Object)& thePnt,
const GEOMAlgo_State theState)
{
SetErrorCode(KO);
(const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
const Handle(GEOM_Object)& theAx1,
- const Handle(GEOM_Object)& thePnt,
+ const Handle(GEOM_Object)& thePnt,
const GEOMAlgo_State theState)
{
SetErrorCode(KO);
Length.SetValue( Index, GPr.Mass() );
}
MidXYZ.SetValue(Index,
- GPoint.X()*999 + GPoint.Y()*99 + GPoint.Z()*0.9);
+ GPoint.X()*999 + GPoint.Y()*99 + GPoint.Z()*0.9);
//cout << Index << " L: " << Length(Index) << "CG: " << MidXYZ(Index) << endl;
}
if ( dMidXYZ >= tol ) {
// cout << "MidXYZ: " << MidXYZ(OrderInd(Index))<< " > " <<MidXYZ(OrderInd(Index+1))
// << " d: " << dMidXYZ << endl;
- exchange = Standard_True;
+ exchange = Standard_True;
}
else if ( Abs(dMidXYZ) < tol && dLength >= tol ) {
// cout << "Length: " << Length(OrderInd(Index))<< " > " <<Length(OrderInd(Index+1))
// << " d: " << dLength << endl;
- exchange = Standard_True;
+ exchange = Standard_True;
}
else if ( Abs(dMidXYZ) < tol && Abs(dLength) < tol &&
aShapes(OrderInd(Index)).ShapeType() <= TopAbs_FACE) {
//purpose :
//=======================================================================
Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetSame(const Handle(GEOM_Object)& theShapeWhere,
- const Handle(GEOM_Object)& theShapeWhat)
+ const Handle(GEOM_Object)& theShapeWhat)
{
SetErrorCode(KO);
if (theShapeWhere.IsNull() || theShapeWhat.IsNull()) return NULL;
Standard_EXPORT Handle(GEOM_Object) MakeCompound (std::list<Handle(GEOM_Object)> theShapes);
Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (Handle(GEOM_Object) theShape,
- const Standard_Real theTolerance,
+ const Standard_Real theTolerance,
const Standard_Boolean doKeepNonSolids);
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueFaces (Handle(GEOM_Object) theShape,
- const Standard_Real theTolerance);
+ const Standard_Real theTolerance);
Standard_EXPORT Handle(GEOM_Object) MakeGlueFacesByList (Handle(GEOM_Object) theShape,
- const Standard_Real theTolerance,
- std::list<Handle(GEOM_Object)> theFaces,
+ const Standard_Real theTolerance,
+ std::list<Handle(GEOM_Object)> theFaces,
const Standard_Boolean doKeepNonSolids);
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode (Handle(GEOM_Object) theShape,
//Make a Python command
if (theCopy) {
GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeTranslationVectorDistance("
- << theObject << ", " << theVector << ", " << theDistance << ")";
+ << theObject << ", " << theVector << ", " << theDistance << ")";
SetErrorCode(OK);
return aCopy;
}
GEOM::TPythonDump(aFunction) << "geompy.TranslateVectorDistance("
- << theObject << ", " << theVector << ", " << theDistance << ", " << theCopy << ")";
+ << theObject << ", " << theVector << ", " << theDistance << ", " << theCopy << ")";
SetErrorCode(OK);
return theObject;
}
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate2D (Handle(GEOM_Object) theObject,
- Handle(GEOM_Object) theVector,
- double theStep1,
- Standard_Integer theNbTimes1,
- Handle(GEOM_Object) theVector2,
- double theStep2,
- Standard_Integer theNbTimes2)
+ Handle(GEOM_Object) theVector,
+ double theStep1,
+ Standard_Integer theNbTimes1,
+ Handle(GEOM_Object) theVector2,
+ double theStep2,
+ Standard_Integer theNbTimes2)
{
SetErrorCode(KO);
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionAlongPath
(Handle(GEOM_Object) theObject, Handle(GEOM_Object) thePath,
- double theDistance, bool theCopy, bool theReverse)
+ double theDistance, bool theCopy, bool theReverse)
{
SetErrorCode(KO);
//Make a Python command
if (theCopy) {
GEOM::TPythonDump(aFunction) << aCopy << " = geompy.PositionAlongPath("
- << theObject << ", " << thePath << ", " << theDistance << ", " << theCopy << ", " << theReverse << ")";
+ << theObject << ", " << thePath << ", " << theDistance << ", " << theCopy << ", " << theReverse << ")";
SetErrorCode(OK);
return aCopy;
}
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate2D (Handle(GEOM_Object) theObject,
- Handle(GEOM_Object) theAxis,
- double theAngle,
- Standard_Integer theNbTimes1,
- double theStep,
- Standard_Integer theNbTimes2)
+ Handle(GEOM_Object) theAxis,
+ double theAngle,
+ Standard_Integer theNbTimes1,
+ double theStep,
+ Standard_Integer theNbTimes2)
{
SetErrorCode(KO);
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePoints (Handle(GEOM_Object) theObject,
- Handle(GEOM_Object) theCentPoint,
- Handle(GEOM_Object) thePoint1,
- Handle(GEOM_Object) thePoint2)
+ Handle(GEOM_Object) theCentPoint,
+ Handle(GEOM_Object) thePoint1,
+ Handle(GEOM_Object) thePoint2)
{
SetErrorCode(KO);
//Make a Python command
GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.RotateThreePoints(" << theObject
- << ", " << theCentPoint << ", "<<thePoint1 << ", " << thePoint2 << ")";
+ << ", " << theCentPoint << ", "<<thePoint1 << ", " << thePoint2 << ")";
SetErrorCode(OK);
return theObject;
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePointsCopy (Handle(GEOM_Object) theObject,
- Handle(GEOM_Object) theCentPoint,
- Handle(GEOM_Object) thePoint1,
- Handle(GEOM_Object) thePoint2)
+ Handle(GEOM_Object) theCentPoint,
+ Handle(GEOM_Object) thePoint1,
+ Handle(GEOM_Object) thePoint2)
{
SetErrorCode(KO);
//Make a Python command
GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeRotationThreePoints(" << theObject
- << ", " << theCentPoint << ", "<<thePoint1 << ", " << thePoint2 << ")";
+ << ", " << theCentPoint << ", "<<thePoint1 << ", " << thePoint2 << ")";
SetErrorCode(OK);
return aCopy;
Standard_EXPORT Handle(GEOM_Object) PositionAlongPath (Handle(GEOM_Object) theObject,
Handle(GEOM_Object) thePath,
double theDistance,
- bool theCopy,
- bool theReverse);
+ bool theCopy,
+ bool theReverse);
Standard_EXPORT Handle(GEOM_Object) Rotate (Handle(GEOM_Object) theObject,
Handle(GEOM_Object) theAxis,
typedef TopoDS_Shape (*funcPoint)(const TCollection_AsciiString&,
const TCollection_AsciiString&,
TCollection_AsciiString&,
- const TDF_Label&);
+ const TDF_Label&);
//=======================================================================
//function : GetID
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ImportDriver",
- sizeof(GEOMImpl_ImportDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_ImportDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
}
else
{
- TopExp_Explorer Exp (E, TopAbs_EDGE);
- if ( Exp.More() ){
- aShape = Exp.Current();
- Exp.Next();
- }
- else
- {
- Standard_ConstructionError::Raise("Faces not have intersection line");
- aShape = E.Shape();
- }
- if ( Exp.More() )
- aShape = E.Shape();
+ TopExp_Explorer Exp (E, TopAbs_EDGE);
+ if ( Exp.More() ){
+ aShape = Exp.Current();
+ Exp.Next();
+ }
+ else
+ {
+ Standard_ConstructionError::Raise("Faces not have intersection line");
+ aShape = E.Shape();
+ }
+ if ( Exp.More() )
+ aShape = E.Shape();
}
} else if (aType == LINE_PNT_DIR) {
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_LineDriver",
- sizeof(GEOMImpl_LineDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_LineDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_MarkerDriver",
- sizeof(GEOMImpl_MarkerDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_MarkerDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
Standard_Real radius1 = Abs(aProperties.MinCurvature());
Standard_Real radius2 = Abs(aProperties.MaxCurvature());
if (Abs(radius1) > Precision::Confusion()) {
- radius = 1.0 / radius1;
+ radius = 1.0 / radius1;
if (Abs(radius2) > Precision::Confusion()) {
radius = (radius + 1.0 / radius2) / 2.0;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_MeasureDriver",
- sizeof(GEOMImpl_MeasureDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_MeasureDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_MirrorDriver",
- sizeof(GEOMImpl_MirrorDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_MirrorDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_OffsetDriver",
- sizeof(GEOMImpl_OffsetDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_OffsetDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PartitionDriver",
- sizeof(GEOMImpl_PartitionDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_PartitionDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
{ return STANDARD_TYPE(GEOMImpl_PipeDriver) ; }
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const
{ return (STANDARD_TYPE(GEOMImpl_PipeDriver) == AType ||
- TFunction_Driver::IsKind(AType)); }
+ TFunction_Driver::IsKind(AType)); }
};
} else {
TopoDS_Shape aRefShape = aRef->GetValue();
if (aRefShape.ShapeType() != TopAbs_FACE)
- return 0;
+ return 0;
anAx3 = GEOMImpl_IMeasureOperations::GetPosition(aRefShape);
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PlaneDriver",
- sizeof(GEOMImpl_PlaneDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_PlaneDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
BRepExtrema_DistShapeShape dst (aRefShape1, aRefShape2);
if (dst.IsDone())
{
- gp_Pnt P1, P2;
- for (int i = 1; i <= dst.NbSolution(); i++) {
- P1 = dst.PointOnShape1(i);
- P2 = dst.PointOnShape2(i);
- Standard_Real Dist = P1.Distance(P2);
- if ( Dist <= Precision::Confusion() )
- aPnt = P1;
- else
- Standard_TypeMismatch::Raise ("Lines not have an Intersection Point");
- }
+ gp_Pnt P1, P2;
+ for (int i = 1; i <= dst.NbSolution(); i++) {
+ P1 = dst.PointOnShape1(i);
+ P2 = dst.PointOnShape2(i);
+ Standard_Real Dist = P1.Distance(P2);
+ if ( Dist <= Precision::Confusion() )
+ aPnt = P1;
+ else
+ Standard_TypeMismatch::Raise ("Lines not have an Intersection Point");
+ }
}
}
else {
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PointDriver",
- sizeof(GEOMImpl_PointDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_PointDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PolylineDriver",
- sizeof(GEOMImpl_PolylineDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_PolylineDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
TopoDS_Shape aShapeEndLCS = aRefEndLCS->GetValue();
if (aShapeBase.IsNull() || aShapeStartLCS.IsNull() ||
- aShapeEndLCS.IsNull() || aShapeEndLCS.ShapeType() != TopAbs_FACE)
+ aShapeEndLCS.IsNull() || aShapeEndLCS.ShapeType() != TopAbs_FACE)
return 0;
gp_Trsf aTrsf;
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PositionDriver",
- sizeof(GEOMImpl_PositionDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_PositionDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
}
if (aV.Magnitude() > Precision::Confusion()) {
aV.Normalize();
- if (aType == PRISM_BASE_VEC_H_2WAYS) {
- gp_Trsf aTrsf;
- aTrsf.SetTranslation( (-aV) * aCI.GetH() );
- BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
- aShapeBase = aTransformation.Shape();
- aCI.SetH( aCI.GetH()*2 );
- }
+ if (aType == PRISM_BASE_VEC_H_2WAYS) {
+ gp_Trsf aTrsf;
+ aTrsf.SetTranslation( (-aV) * aCI.GetH() );
+ BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
+ aShapeBase = aTransformation.Shape();
+ aCI.SetH( aCI.GetH()*2 );
+ }
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV * aCI.GetH(), Standard_False).Shape();
}
}
if (!V1.IsNull() && !V2.IsNull()) {
gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
if (aV.Magnitude() > gp::Resolution()) {
- if (aType == PRISM_BASE_TWO_PNT_2WAYS)
- {
- gp_Trsf aTrsf;
- aTrsf.SetTranslation(-aV);
- BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
- aShapeBase = aTransformation.Shape();
- aV = aV * 2;
- }
+ if (aType == PRISM_BASE_TWO_PNT_2WAYS)
+ {
+ gp_Trsf aTrsf;
+ aTrsf.SetTranslation(-aV);
+ BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
+ aShapeBase = aTransformation.Shape();
+ aV = aV * 2;
+ }
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
}
}
gp_Vec aV (aCI.GetDX(), aCI.GetDY(), aCI.GetDZ());
if (aV.Magnitude() > gp::Resolution()) {
if (aType == PRISM_BASE_DXDYDZ_2WAYS)
- {
- gp_Trsf aTrsf;
- aTrsf.SetTranslation(-aV);
- BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
- aShapeBase = aTransformation.Shape();
- aV = aV * 2;
- }
+ {
+ gp_Trsf aTrsf;
+ aTrsf.SetTranslation(-aV);
+ BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
+ aShapeBase = aTransformation.Shape();
+ aV = aV * 2;
+ }
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
}
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PrismDriver",
- sizeof(GEOMImpl_PrismDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_PrismDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
gp_Lin aL(BRep_Tool::Pnt(V1), gp_Dir(aV));
Standard_Real d = aL.Distance(BRep_Tool::Pnt(TopoDS::Vertex(aShapeBase)));
if (d < Precision::Confusion()) {
- Standard_ConstructionError::Raise("Vertex to be rotated is too close to Revolution Axis");
+ Standard_ConstructionError::Raise("Vertex to be rotated is too close to Revolution Axis");
}
}
double anAngle = aCI.GetAngle();
gp_Ax1 anAxis (BRep_Tool::Pnt(V1), aV);
if (aType == REVOLUTION_BASE_AXIS_ANGLE_2WAYS)
{
- gp_Trsf aTrsf;
- aTrsf.SetRotation(anAxis, ( -anAngle ));
- BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
- aShapeBase = aTransformation.Shape();
- anAngle = anAngle * 2;
+ gp_Trsf aTrsf;
+ aTrsf.SetRotation(anAxis, ( -anAngle ));
+ BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
+ aShapeBase = aTransformation.Shape();
+ anAngle = anAngle * 2;
}
BRepPrimAPI_MakeRevol MR (aShapeBase, anAxis, anAngle, Standard_False);
if (!MR.IsDone()) MR.Build();
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_RevolutionDriver",
- sizeof(GEOMImpl_RevolutionDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_RevolutionDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_RotateDriver",
- sizeof(GEOMImpl_RotateDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_RotateDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ScaleDriver",
- sizeof(GEOMImpl_ScaleDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_ScaleDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ShapeDriver",
- sizeof(GEOMImpl_ShapeDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_ShapeDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_SketcherDriver",
- sizeof(GEOMImpl_SketcherDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_SketcherDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_SphereDriver",
- sizeof(GEOMImpl_SphereDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_SphereDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
isSeveral = Standard_True;
}
}
- CurvePoints.SetValue(ind, aP);
+ CurvePoints.SetValue(ind, aP);
aPrevP = aP;
}
}
//aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt(1, aLen);
for (ind = 1; ind <= aLen; ind++) {
- aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
+ aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
}
int isClosed = aCI.GetIsClosed();
GeomAPI_Interpolate GBC (aHCurvePoints, isClosed, gp::Resolution());
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_SplineDriver",
- sizeof(GEOMImpl_SplineDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_SplineDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ThruSectionsDriver",
- sizeof(GEOMImpl_ThruSectionsDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_ThruSectionsDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_TorusDriver",
- sizeof(GEOMImpl_TorusDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_TorusDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_TranslateDriver",
- sizeof(GEOMImpl_TranslateDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_TranslateDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_VectorDriver",
- sizeof(GEOMImpl_VectorDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOMImpl_VectorDriver),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// the selected file type code through <filter> argument.
//=======================================================================
static QString getFileName( QWidget* parent,
- const QString& initial,
- const FilterMap& filterMap,
+ const QString& initial,
+ const FilterMap& filterMap,
const QStringList& filters,
- const QString& caption,
- bool open,
- QString& format,
- bool showCurrentDirInitially = false )
+ const QString& caption,
+ bool open,
+ QString& format,
+ bool showCurrentDirInitially = false )
{
//QStringList filters;
QString aBrepFilter;
// the selected file type code through <format> argument.
//=======================================================================
static QStringList getFileNames( QWidget* parent,
- const QString& initial,
- const FilterMap& filterMap,
- const QString& caption,
- QString& format,
- bool showCurrentDirInitially = false)
+ const QString& initial,
+ const FilterMap& filterMap,
+ const QString& caption,
+ QString& format,
+ bool showCurrentDirInitially = false)
{
QString aBrepFilter;
QStringList allFilters;
int aRefLength = aReferences.size();
if (aRefLength) {
for (int i = 0; i < aRefLength; i++) {
- _PTR(SObject) firstSO( aReferences[i] );
- _PTR(SComponent) aComponent = firstSO->GetFatherComponent();
- QString type = aComponent->ComponentDataType().c_str();
- if ( type == "SMESH" )
- return true;
+ _PTR(SObject) firstSO( aReferences[i] );
+ _PTR(SComponent) aComponent = firstSO->GetFatherComponent();
+ QString type = aComponent->ComponentDataType().c_str();
+ if ( type == "SMESH" )
+ return true;
}
}
}
bool deleted = false;
QMap<QString, GEOM::GEOM_Object_var>::Iterator git;
for ( git = gobjects.begin(); git != gobjects.end() && ( !depends || !deleted ); ++git ) {
- depends = depends || list[i]->_is_equivalent( *git );
- deleted = deleted || git.key() == child->GetID().c_str() ;//geomObj->_is_equivalent( *git );
+ depends = depends || list[i]->_is_equivalent( *git );
+ deleted = deleted || git.key() == child->GetID().c_str() ;//geomObj->_is_equivalent( *git );
}
if ( depends && !deleted )
- return true;
+ return true;
}
}
return false;
{
case 31: // COPY
{
- OnEditCopy();
- break;
+ OnEditCopy();
+ break;
}
case 33: // DELETE
{
- OnEditDelete();
- break;
+ OnEditDelete();
+ break;
}
case 111: // IMPORT BREP
case 112: // IMPORT IGES
case 113: // IMPORT STEP
{
- Import();
- break;
+ Import();
+ break;
}
case 121: // EXPORT BREP
case 122: // EXPORT IGES
case 123: // EXPORT STEP
{
- Export();
- break;
+ Export();
+ break;
}
case 2171: // POPUP VIEWER - SELECT ONLY - VERTEX
{
- OnSelectOnly( GEOM_POINT );
- break;
+ OnSelectOnly( GEOM_POINT );
+ break;
}
case 2172: // POPUP VIEWER - SELECT ONLY - EDGE
{
- OnSelectOnly( GEOM_EDGE );
- break;
+ OnSelectOnly( GEOM_EDGE );
+ break;
}
case 2173: // POPUP VIEWER - SELECT ONLY - WIRE
{
- OnSelectOnly( GEOM_WIRE );
- break;
+ OnSelectOnly( GEOM_WIRE );
+ break;
}
case 2174: // POPUP VIEWER - SELECT ONLY - FACE
{
- OnSelectOnly( GEOM_FACE );
- break;
+ OnSelectOnly( GEOM_FACE );
+ break;
}
case 2175: // POPUP VIEWER - SELECT ONLY - SHELL
{
- OnSelectOnly( GEOM_SHELL );
- break;
+ OnSelectOnly( GEOM_SHELL );
+ break;
}
case 2176: // POPUP VIEWER - SELECT ONLY - SOLID
{
- OnSelectOnly( GEOM_SOLID );
- break;
+ OnSelectOnly( GEOM_SOLID );
+ break;
}
case 2177: // POPUP VIEWER - SELECT ONLY - COMPOUND
{
- OnSelectOnly( GEOM_COMPOUND );
- break;
+ OnSelectOnly( GEOM_COMPOUND );
+ break;
}
case 2178: // POPUP VIEWER - SELECT ONLY - SELECT ALL
{
- OnSelectOnly( GEOM_ALLOBJECTS );
- break;
+ OnSelectOnly( GEOM_ALLOBJECTS );
+ break;
}
case 411: // SETTINGS - ADD IN STUDY
{
- // SAN -- TO BE REMOVED !!!
- break;
+ // SAN -- TO BE REMOVED !!!
+ break;
}
case 412: // SETTINGS - SHADING COLOR
{
- OnSettingsColor();
- break;
+ OnSettingsColor();
+ break;
}
case 804: // ADD IN STUDY - POPUP VIEWER
{
- // SAN -- TO BE REMOVED !!!!
- break;
+ // SAN -- TO BE REMOVED !!!!
+ break;
}
case 901: // RENAME
{
- OnRename();
- break;
+ OnRename();
+ break;
}
case 5103: // CHECK GEOMETRY
{
- OnCheckGeometry();
- break;
+ OnCheckGeometry();
+ break;
}
case 8032: // COLOR - POPUP VIEWER
{
- OnColor();
- break;
+ OnColor();
+ break;
}
case 8033: // TRANSPARENCY - POPUP VIEWER
{
- OnTransparency();
- break;
+ OnTransparency();
+ break;
}
case 8034: // ISOS - POPUP VIEWER
{
- OnNbIsos();
- break;
+ OnNbIsos();
+ break;
}
case 8035: // AUTO COLOR - POPUP VIEWER
{
- OnAutoColor();
- break;
+ OnAutoColor();
+ break;
}
case 8036: // DISABLE AUTO COLOR - POPUP VIEWER
{
- OnDisableAutoColor();
- break;
+ OnDisableAutoColor();
+ break;
}
case 8037: // SHOW CHILDREN - POPUP VIEWER
case 8038: // HIDE CHILDREN - POPUP VIEWER
{
- OnShowHideChildren( theCommandID == 8037 );
- break;
+ OnShowHideChildren( theCommandID == 8037 );
+ break;
}
case 8039: // POINT MARKER
{
- OnPointMarker();
- break;
+ OnPointMarker();
+ break;
}
case 9024 : // OPEN - OBJBROSER POPUP
{
- OnOpen();
- break;
+ OnOpen();
+ break;
}
default:
{
- SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
- break;
+ SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
+ break;
}
}
return true;
// check if study is locked
if ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() )->IsLocked() ) {
SUIT_MessageBox::warning( app->desktop(),
- tr("WRN_WARNING"),
- tr("WRN_STUDY_LOCKED") );
+ tr("WRN_WARNING"),
+ tr("WRN_STUDY_LOCKED") );
return; // study is locked
}
QString parentComp = getParentComponent( obj );
if ( parentComp != geomComp ) {
SUIT_MessageBox::warning( app->desktop(),
- QObject::tr("ERR_ERROR"),
- QObject::tr("NON_GEOM_OBJECTS_SELECTED").arg( getGeometryGUI()->moduleName() ) );
+ QObject::tr("ERR_ERROR"),
+ QObject::tr("NON_GEOM_OBJECTS_SELECTED").arg( getGeometryGUI()->moduleName() ) );
return; // not GEOM object selected
}
// if GEOM component is selected, so skip other checks
if ( isComponentSelected ) continue;
///////////////////////////////////////////////////////
-
+
// check if object is reference
_PTR(SObject) refobj;
if ( obj && obj->ReferencedObject( refobj ) ) {
for ( it->InitEx( true ); it->More(); it->Next() ) {
_PTR(SObject) child( it->Value() );
if ( child && child->ReferencedObject( refobj ) )
- continue; // skip references
+ continue; // skip references
aName = child->GetName().c_str();
if ( !aName.isEmpty() )
- allDeleted.insert( child->GetID().c_str(), aName );
+ allDeleted.insert( child->GetID().c_str(), aName );
}
}
// GEOM component is not selected: check if selected objects are in use
if ( inUse( aStudy, geomComp, allDeleted ) ) {
SUIT_MessageBox::warning( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("DEP_OBJECT") );
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("DEP_OBJECT") );
return; // object(s) in use
}
// ... and then delete all objects
bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
if ( aLocked ) {
SUIT_MessageBox::warning( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED") );
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED") );
return false;
}
GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
if ( CORBA::is_nil( eng ) ) {
SUIT_MessageBox::critical( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr( "GEOM Engine is not started" ) );
+ QObject::tr("WRN_WARNING"),
+ QObject::tr( "GEOM Engine is not started" ) );
return false;
}
// select files to be imported
QString fileType;
QStringList fileNames = getFileNames( app->desktop(), "", aMap,
- tr( "GEOM_MEN_IMPORT" ), fileType, true );
+ tr( "GEOM_MEN_IMPORT" ), fileType, true );
// set Wait cursor
SUIT_OverrideCursor wc;
QString ext = QFileInfo( fileName ).suffix().toUpper();
QRegExp re( "\\*\\.(\\w+)" );
for ( FilterMap::const_iterator it = aMap.begin();
- it != aMap.end() && aCurrentType.isEmpty(); ++it ) {
- int pos = 0;
- while ( re.indexIn( it.key(), pos ) >= 0 ) {
- QString f = re.cap(1).trimmed().toUpper();
- if ( ext == f ) { aCurrentType = it.value(); break; }
- pos = re.pos() + re.cap(1).length() + 2;
- }
+ it != aMap.end() && aCurrentType.isEmpty(); ++it ) {
+ int pos = 0;
+ while ( re.indexIn( it.key(), pos ) >= 0 ) {
+ QString f = re.cap(1).trimmed().toUpper();
+ if ( ext == f ) { aCurrentType = it.value(); break; }
+ pos = re.pos() + re.cap(1).length() + 2;
+ }
}
}
else {
// skl 29.05.2009
if ( aCurrentType == "IGES" ) {
- GEOM::GEOM_Object_var anObj = aInsOp->Import( fileN, "IGES_UNIT" );
- bool needConvert = false;
- TCollection_AsciiString aUnitName = aInsOp->GetErrorCode();
- if ( aUnitName.SubString( 1, 4 ) == "UNIT" )
- needConvert = aUnitName.SubString( 6, aUnitName.Length() ) != "M";
-
- if ( needConvert ) {
- if ( igesAnswer == SUIT_MessageBox::NoToAll ) {
- // converting for all files is already approved
- fileT = "IGES_SCALE";
- }
- else if ( igesAnswer != SUIT_MessageBox::YesToAll ) {
- SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No;
- if ( i < fileNames.count()-1 ) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
- igesAnswer = SUIT_MessageBox::question( app->desktop(),
- "Question",//tr("WRN_WARNING"),
- tr("GEOM_SCALE_DIMENSIONS"),
- btns | SUIT_MessageBox::Cancel,
- SUIT_MessageBox::No );
- switch ( igesAnswer ) {
- case SUIT_MessageBox::Cancel:
- return false; // cancel (break) import operation
- case SUIT_MessageBox::Yes:
- case SUIT_MessageBox::YesToAll:
- break; // scaling is confirmed
- case SUIT_MessageBox::No:
- case SUIT_MessageBox::NoAll:
- fileT = "IGES_SCALE";
- default:
- break; // scaling is rejected
- } // switch ( igesAnswer )
- } // if ( igeAnswer != NoToAll )
- } // if ( needConvert )
+ GEOM::GEOM_Object_var anObj = aInsOp->Import( fileN, "IGES_UNIT" );
+ bool needConvert = false;
+ TCollection_AsciiString aUnitName = aInsOp->GetErrorCode();
+ if ( aUnitName.SubString( 1, 4 ) == "UNIT" )
+ needConvert = aUnitName.SubString( 6, aUnitName.Length() ) != "M";
+
+ if ( needConvert ) {
+ if ( igesAnswer == SUIT_MessageBox::NoToAll ) {
+ // converting for all files is already approved
+ fileT = "IGES_SCALE";
+ }
+ else if ( igesAnswer != SUIT_MessageBox::YesToAll ) {
+ SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No;
+ if ( i < fileNames.count()-1 ) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
+ igesAnswer = SUIT_MessageBox::question( app->desktop(),
+ "Question",//tr("WRN_WARNING"),
+ tr("GEOM_SCALE_DIMENSIONS"),
+ btns | SUIT_MessageBox::Cancel,
+ SUIT_MessageBox::No );
+ switch ( igesAnswer ) {
+ case SUIT_MessageBox::Cancel:
+ return false; // cancel (break) import operation
+ case SUIT_MessageBox::Yes:
+ case SUIT_MessageBox::YesToAll:
+ break; // scaling is confirmed
+ case SUIT_MessageBox::No:
+ case SUIT_MessageBox::NoAll:
+ fileT = "IGES_SCALE";
+ default:
+ break; // scaling is rejected
+ } // switch ( igesAnswer )
+ } // if ( igeAnswer != NoToAll )
+ } // if ( needConvert )
} // if ( aCurrentType == "IGES" )
else if ( aCurrentType == "ACIS" ) {
- if ( acisAnswer != SUIT_MessageBox::YesToAll && acisAnswer != SUIT_MessageBox::NoToAll ) {
- SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No;
- if ( i < fileNames.count()-1 ) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
- acisAnswer = SUIT_MessageBox::question( app->desktop(),
- "Question",//tr("WRN_WARNING"),
- tr("GEOM_PUBLISH_NAMED_SHAPES"),
- btns | SUIT_MessageBox::Cancel,
- SUIT_MessageBox::No );
- if ( acisAnswer == SUIT_MessageBox::Cancel )
- return false; // cancel (break) import operation
- } // if ( acisAnswer != YesToAll && acisAnswer != NoToAll )
+ if ( acisAnswer != SUIT_MessageBox::YesToAll && acisAnswer != SUIT_MessageBox::NoToAll ) {
+ SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No;
+ if ( i < fileNames.count()-1 ) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
+ acisAnswer = SUIT_MessageBox::question( app->desktop(),
+ "Question",//tr("WRN_WARNING"),
+ tr("GEOM_PUBLISH_NAMED_SHAPES"),
+ btns | SUIT_MessageBox::Cancel,
+ SUIT_MessageBox::No );
+ if ( acisAnswer == SUIT_MessageBox::Cancel )
+ return false; // cancel (break) import operation
+ } // if ( acisAnswer != YesToAll && acisAnswer != NoToAll )
} // else if ( aCurrentType == "ACIS" )
GEOM::GEOM_Object_var anObj = aInsOp->Import( fileN, fileT );
if ( !anObj->_is_nil() && aInsOp->IsDone() ) {
- QString aPublishObjName =
- GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, /*withExten=*/true ) );
-
- SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy );
- GeometryGUI::GetGeomGen()->PublishInStudy( aDSStudy,
- SALOMEDS::SObject::_nil(),
- anObj,
- aPublishObjName.toLatin1().constData() );
-
- objsForDisplay.append( anObj );
-
- if ( aCurrentType == "ACIS" ) {
- if ( acisAnswer == SUIT_MessageBox::Yes || acisAnswer == SUIT_MessageBox::YesToAll )
- GeometryGUI::GetGeomGen()->PublishNamedShapesInStudy( aDSStudy, anObj );
- }
-
- anOp->commit();
+ QString aPublishObjName =
+ GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, /*withExten=*/true ) );
+
+ SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy );
+ GeometryGUI::GetGeomGen()->PublishInStudy( aDSStudy,
+ SALOMEDS::SObject::_nil(),
+ anObj,
+ aPublishObjName.toLatin1().constData() );
+
+ objsForDisplay.append( anObj );
+
+ if ( aCurrentType == "ACIS" ) {
+ if ( acisAnswer == SUIT_MessageBox::Yes || acisAnswer == SUIT_MessageBox::YesToAll )
+ GeometryGUI::GetGeomGen()->PublishNamedShapesInStudy( aDSStudy, anObj );
+ }
+
+ anOp->commit();
}
else {
- anOp->abort();
- errors.append( QString( "%1 : %2" ).arg( fileName ).arg( aInsOp->GetErrorCode() ) );
+ anOp->abort();
+ errors.append( QString( "%1 : %2" ).arg( fileName ).arg( aInsOp->GetErrorCode() ) );
}
}
catch( const SALOME::SALOME_Exception& S_ex ) {
if ( errors.count() > 0 ) {
SUIT_MessageBox::critical( app->desktop(),
- QObject::tr( "GEOM_ERROR" ),
- QObject::tr( "GEOM_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ QObject::tr( "GEOM_ERROR" ),
+ QObject::tr( "GEOM_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
}
app->updateActions(); //SRN: To update a Save button in the toolbar
GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
if ( CORBA::is_nil( eng ) ) {
SUIT_MessageBox::critical( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr( "GEOM Engine is not started" ) );
+ QObject::tr("WRN_WARNING"),
+ QObject::tr( "GEOM Engine is not started" ) );
return false;
}
QString fileType;
QString file = getFileName(app->desktop(), QString( IObject->getName() ), aMap, filters,
- tr("GEOM_MEN_EXPORT"), false, fileType, true);
+ tr("GEOM_MEN_EXPORT"), false, fileType, true);
// User has pressed "Cancel" --> stop the operation
if ( file.isEmpty() || fileType.isEmpty() )
aInsOp->Export( anObj, file.toStdString().c_str(), fileType.toLatin1().constData() );
if ( aInsOp->IsDone() )
- anOp->commit();
+ anOp->commit();
else
- {
- anOp->abort();
- wc.suspend();
- SUIT_MessageBox::critical( app->desktop(),
- QObject::tr( "GEOM_ERROR" ),
- QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ) );
- return false;
- }
+ {
+ anOp->abort();
+ wc.suspend();
+ SUIT_MessageBox::critical( app->desktop(),
+ QObject::tr( "GEOM_ERROR" ),
+ QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ) );
+ return false;
+ }
}
catch (const SALOME::SALOME_Exception& S_ex) {
//QtCatchCorbaException(S_ex);
if ( !appropriateObj )
SUIT_MessageBox::warning( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("GEOM_WRN_NO_APPROPRIATE_SELECTION") );
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("GEOM_WRN_NO_APPROPRIATE_SELECTION") );
return true;
}
// Erase graphical object
QListIterator<SALOME_View*> it( views );
while ( it.hasNext() )
- if ( SALOME_View* view = it.next() )
- disp->Erase(geomObj, true, view);
+ if ( SALOME_View* view = it.next() )
+ disp->Erase(geomObj, true, view);
// Remove object from Engine
// We can't directly remove object from engine. All we can do is to unpublish the object
// Recursive deletion of object with children
void removeObjectWithChildren( _PTR(SObject),
- _PTR(Study),
- QList<SALOME_View*>,
- GEOM_Displayer* );
+ _PTR(Study),
+ QList<SALOME_View*>,
+ GEOM_Displayer* );
};
#endif // GEOMTOOLSGUI_H
if ( aSelMgr && appStudy ) {
aSelMgr->selectedObjects( selected );
if ( !selected.IsEmpty() ) {
- _PTR(Study) aStudy = appStudy->studyDS();
-
- bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
- if ( aLocked ) {
- SUIT_MessageBox::warning ( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED") );
- return;
- }
+ _PTR(Study) aStudy = appStudy->studyDS();
+
+ bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
+ if ( aLocked ) {
+ SUIT_MessageBox::warning ( app->desktop(),
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED") );
+ return;
+ }
bool isAny = false; // is there any appropriate object selected
- for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
- Handle(SALOME_InteractiveObject) IObject = It.Value();
+ for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
+ Handle(SALOME_InteractiveObject) IObject = It.Value();
- _PTR(SObject) obj ( aStudy->FindObjectID(IObject->getEntry()) );
- _PTR(GenericAttribute) anAttr;
- if ( obj ) {
- if ( obj->FindAttribute(anAttr, "AttributeName") ) {
- _PTR(AttributeName) aName (anAttr);
+ _PTR(SObject) obj ( aStudy->FindObjectID(IObject->getEntry()) );
+ _PTR(GenericAttribute) anAttr;
+ if ( obj ) {
+ if ( obj->FindAttribute(anAttr, "AttributeName") ) {
+ _PTR(AttributeName) aName (anAttr);
GEOM::GEOM_Object_var anObj =
GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj));
(dynamic_cast<SalomeApp_Module*>(app->activeModule()))->updateObjBrowser( false );
}
} // if ( anObj )
- } // if ( name attribute )
- } // if ( obj )
- } // iterator
+ } // if ( name attribute )
+ } // if ( obj )
+ } // iterator
if (!isAny) {
- SUIT_MessageBox::warning( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("GEOM_WRN_NO_APPROPRIATE_SELECTION") );
- return;
+ SUIT_MessageBox::warning( app->desktop(),
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("GEOM_WRN_NO_APPROPRIATE_SELECTION") );
+ return;
}
}
}
{
SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
if ( !vtkVW )
- return;
+ return;
SVTK_View* aView = vtkVW->getView();
SUIT_OverrideCursor();
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
- aView->SetColor( It.Value(), c );
+ aView->SetColor( It.Value(), c );
}
else if ( isOCC )
{
SOCC_Prs* anOCCPrs = dynamic_cast<SOCC_Prs*>( aPrs );
if( !anOCCPrs )
- continue;
+ continue;
AIS_ListOfInteractive aList;
anOCCPrs->GetObjects( aList );
if( !aList.Extent() )
- continue;
+ continue;
Handle(AIS_InteractiveObject) io = aList.First();
if( io.IsNull() )
- continue;
+ continue;
Quantity_Color aQuanColor( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
Aspect_TypeOfMarker aCurTypeOfMarker;
aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
if ( aCurTypeOfMarker != Aspect_TOM_USERDEFINED ) {
- aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aQuanColor, aCurScale) );
+ aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aQuanColor, aCurScale) );
}
else {
- Standard_Integer aWidth, aHeight;
- aCurPointAspect->GetTextureSize( aWidth, aHeight );
- Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture();
- aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aQuanColor, 1, aWidth, aHeight, aTexture ) );
+ Standard_Integer aWidth, aHeight;
+ aCurPointAspect->GetTextureSize( aWidth, aHeight );
+ Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture();
+ aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aQuanColor, 1, aWidth, aHeight, aTexture ) );
}
ic->SetLocalAttributes( io, aCurDrawer );
io->SetColor( aQuanColor );
if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) )
- Handle(GEOM_AISShape)::DownCast( io )->SetShadingColor( aQuanColor );
+ Handle(GEOM_AISShape)::DownCast( io )->SetShadingColor( aQuanColor );
io->Redisplay( Standard_True );
}
if ( aSelMgr ) {
aSelMgr->selectedObjects( selected );
if ( !selected.IsEmpty() ) {
- SUIT_ViewWindow* window = app->desktop()->activeWindow();
- bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
- bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
- if ( isVTK ) {
- SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
- if ( !vtkVW )
- return;
- SVTK_View* aView = vtkVW->getView();
- QColor initcolor = aView->GetColor( selected.First() );
- QColor c = QColorDialog::getColor( initcolor, app->desktop() );
- if ( c.isValid() ) {
- SUIT_OverrideCursor();
- for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
- aView->SetColor( It.Value(), c );
- }
- }
- } // if ( isVTK )
- else if ( isOCC ) {
- Handle(AIS_InteractiveObject) io = GEOMBase::GetAIS( selected.First() );
- if ( !io.IsNull() ) {
- Quantity_Color aColor;
- io->Color( aColor );
- QColor initcolor( (int)( aColor.Red() * 255.0 ), (int)( aColor.Green() * 255.0 ), (int)( aColor.Blue() * 255.0 ) );
- QColor c = QColorDialog::getColor( initcolor, app->desktop() );
- if ( c.isValid() ) {
- SUIT_OverrideCursor();
- aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
- for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
- io = GEOMBase::GetAIS( It.Value(), true );
- if ( !io.IsNull() ) {
- // Set color for a point
- OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
- Handle (AIS_InteractiveContext) ic = vm->getAISContext();
- Handle(AIS_Drawer) aCurDrawer = io->Attributes();
- Handle(Prs3d_PointAspect) aCurPointAspect = aCurDrawer->PointAspect();
- Quantity_Color aCurColor;
- Standard_Real aCurScale;
- Aspect_TypeOfMarker aCurTypeOfMarker;
- aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
- if ( aCurTypeOfMarker != Aspect_TOM_USERDEFINED ) {
- aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aColor, aCurScale) );
- }
- else {
- Standard_Integer aWidth, aHeight;
- aCurPointAspect->GetTextureSize( aWidth, aHeight );
- Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture();
- aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aColor, 1, aWidth, aHeight, aTexture ) );
- }
- ic->SetLocalAttributes(io, aCurDrawer);
-
- io->SetColor( aColor );
- if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) )
- Handle(GEOM_AISShape)::DownCast( io )->SetShadingColor( aColor );
-
- io->Redisplay( Standard_True );
-
- // store color to GEOM_Object
- _PTR(Study) aStudy = appStudy->studyDS();
- _PTR(SObject) aSObject( aStudy->FindObjectID( It.Value()->getEntry() ) );
- GEOM::GEOM_Object_var anObject =
- GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObject));
-
- SALOMEDS::Color aSColor;
- aSColor.R = (double)c.red() / 255.0;
- aSColor.G = (double)c.green() / 255.0;
- aSColor.B = (double)c.blue() / 255.0;
- anObject->SetColor( aSColor );
- anObject->SetAutoColor( false );
- }
- }
- } // if c.isValid()
- } // first IO is not null
- } // if ( isOCC )
+ SUIT_ViewWindow* window = app->desktop()->activeWindow();
+ bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
+ bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
+ if ( isVTK ) {
+ SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
+ if ( !vtkVW )
+ return;
+ SVTK_View* aView = vtkVW->getView();
+ QColor initcolor = aView->GetColor( selected.First() );
+ QColor c = QColorDialog::getColor( initcolor, app->desktop() );
+ if ( c.isValid() ) {
+ SUIT_OverrideCursor();
+ for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
+ aView->SetColor( It.Value(), c );
+ }
+ }
+ } // if ( isVTK )
+ else if ( isOCC ) {
+ Handle(AIS_InteractiveObject) io = GEOMBase::GetAIS( selected.First() );
+ if ( !io.IsNull() ) {
+ Quantity_Color aColor;
+ io->Color( aColor );
+ QColor initcolor( (int)( aColor.Red() * 255.0 ), (int)( aColor.Green() * 255.0 ), (int)( aColor.Blue() * 255.0 ) );
+ QColor c = QColorDialog::getColor( initcolor, app->desktop() );
+ if ( c.isValid() ) {
+ SUIT_OverrideCursor();
+ aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
+ for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
+ io = GEOMBase::GetAIS( It.Value(), true );
+ if ( !io.IsNull() ) {
+ // Set color for a point
+ OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
+ Handle (AIS_InteractiveContext) ic = vm->getAISContext();
+ Handle(AIS_Drawer) aCurDrawer = io->Attributes();
+ Handle(Prs3d_PointAspect) aCurPointAspect = aCurDrawer->PointAspect();
+ Quantity_Color aCurColor;
+ Standard_Real aCurScale;
+ Aspect_TypeOfMarker aCurTypeOfMarker;
+ aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
+ if ( aCurTypeOfMarker != Aspect_TOM_USERDEFINED ) {
+ aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aColor, aCurScale) );
+ }
+ else {
+ Standard_Integer aWidth, aHeight;
+ aCurPointAspect->GetTextureSize( aWidth, aHeight );
+ Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture();
+ aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aColor, 1, aWidth, aHeight, aTexture ) );
+ }
+ ic->SetLocalAttributes(io, aCurDrawer);
+
+ io->SetColor( aColor );
+ if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) )
+ Handle(GEOM_AISShape)::DownCast( io )->SetShadingColor( aColor );
+
+ io->Redisplay( Standard_True );
+
+ // store color to GEOM_Object
+ _PTR(Study) aStudy = appStudy->studyDS();
+ _PTR(SObject) aSObject( aStudy->FindObjectID( It.Value()->getEntry() ) );
+ GEOM::GEOM_Object_var anObject =
+ GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObject));
+
+ SALOMEDS::Color aSColor;
+ aSColor.R = (double)c.red() / 255.0;
+ aSColor.G = (double)c.green() / 255.0;
+ aSColor.B = (double)c.blue() / 255.0;
+ anObject->SetColor( aSColor );
+ anObject->SetAutoColor( false );
+ }
+ }
+ } // if c.isValid()
+ } // first IO is not null
+ } // if ( isOCC )
} // if ( selection not empty )
}
}
int VIso = CurDrawer->VIsoAspect()->Number();
GEOMToolsGUI_NbIsosDlg * NbIsosDlg =
- new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
+ new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
NbIsosDlg->setU( UIso );
NbIsosDlg->setV( VIso );
if ( NbIsosDlg->exec() ) {
- SUIT_OverrideCursor();
- for(; ic->MoreCurrent(); ic->NextCurrent()) {
- CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
- Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
-
- int nbUIso = NbIsosDlg->getU();
- int nbVIso = NbIsosDlg->getV();
-
- CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , nbUIso) );
- CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , nbVIso) );
-
- ic->SetLocalAttributes(CurObject, CurDrawer);
- ic->Redisplay(CurObject);
- }
+ SUIT_OverrideCursor();
+ for(; ic->MoreCurrent(); ic->NextCurrent()) {
+ CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
+ Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
+
+ int nbUIso = NbIsosDlg->getU();
+ int nbVIso = NbIsosDlg->getV();
+
+ CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , nbUIso) );
+ CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , nbVIso) );
+
+ ic->SetLocalAttributes(CurObject, CurDrawer);
+ ic->Redisplay(CurObject);
+ }
}
}
}
SALOME_Prs* aPrs = view->CreatePrs( anIObject->getEntry() );
SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( aPrs );
if ( vtkPrs ) {
- vtkActorCollection* anActors = vtkPrs->GetObjects();
- anActors->InitTraversal();
- vtkActor* anAct = anActors->GetNextActor();
- aCollection->AddItem(anAct);
+ vtkActorCollection* anActors = vtkPrs->GetObjects();
+ anActors->InitTraversal();
+ vtkActor* anAct = anActors->GetNextActor();
+ aCollection->AddItem(anAct);
}
}
SUIT_OverrideCursor();
while( anAct!=NULL ) {
- if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)){
- // There are no casting to needed actor.
- UIso = NbIsosDlg->getU();
- VIso = NbIsosDlg->getV();
- int aIsos[2]={UIso,VIso};
- anActor->SetNbIsos(aIsos);
- }
- anAct = aCollection->GetNextActor();
+ if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)){
+ // There are no casting to needed actor.
+ UIso = NbIsosDlg->getU();
+ VIso = NbIsosDlg->getV();
+ int aIsos[2]={UIso,VIso};
+ anActor->SetNbIsos(aIsos);
+ }
+ anAct = aCollection->GetNextActor();
}
}
} // end vtkviewer
_PTR(GenericAttribute) anAttr;
bool useSubItems = false;
while (anIter->More() && !useSubItems) {
- _PTR(SObject) subobj ( anIter->Value() );
- if (subobj->FindAttribute(anAttr, "AttributePersistentRef")) {
- useSubItems = true;
- obj = subobj;
- }
- else
- anIter->Next();
+ _PTR(SObject) subobj ( anIter->Value() );
+ if (subobj->FindAttribute(anAttr, "AttributePersistentRef")) {
+ useSubItems = true;
+ obj = subobj;
+ }
+ else
+ anIter->Next();
}
obj->FindAttribute(anAttr, "AttributePersistentRef");
while(useSubItems?anIter->More():!anAttr->_is_nil()) {
- if(!obj->FindAttribute(anAttr, "AttributeIOR") &&
- obj->FindAttribute(anAttr, "AttributePersistentRef")) {
- _PTR(SComponent) FComp ( obj->GetFatherComponent() );
- if (FComp) {
- if (FComp->FindAttribute(anAttr, "AttributeName")) {
- _PTR(AttributeName) aName ( anAttr );
- QString compName = QAD_Application::getDesktop()->getComponentName(aName->Value().c_str());
- // parent->loadComponentData(parent->getComponentName(aName->Value()));
- Engines::Component_var comp ;
- if ( compName.compare("SUPERV") == 0 ) {
- comp = QAD_Application::getDesktop()->getEngine( "SuperVisionContainer", compName) ;
- }
- else {
- comp = QAD_Application::getDesktop()->getEngine( "FactoryServer", compName);
- if ( comp->_is_nil() )
- comp = QAD_Application::getDesktop()->getEngine( "FactoryServerPy", compName);
- }
-
- if (!CORBA::is_nil(comp)) {
- SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
- if (!CORBA::is_nil(driver)) {
- SALOMEDS::StudyBuilder_var B = dynamic_cast<SALOMEDS_Study*>(aStudy.get())->GetStudy()->NewBuilder();
- if (!CORBA::is_nil(B)) {
- B->LoadWith(FComp,driver);
- } else {
- return;
- }
- }
- else {
- MESSAGE("loadComponentData(): Driver is null");
- return;
- }
- }
- else {
- MESSAGE("loadComponentData(): Engine is null");
- return;
- }
- // // load
- // Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM");
- // if (!CORBA::is_nil(comp)) {
- // SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
- // SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
- // SALOMEDS::SComponent_var SC = aStudy->FindComponent("GEOM");
- // if (!CORBA::is_nil(SC))
- // aStudyBuilder->LoadWith(SC,driver);
- }
- }
- else {
- MESSAGE("Component is null");
- }
- }
- if(useSubItems) {
- anIter->Next();
- obj.reset( anIter->Value() );
- }
- else
- anAttr = NULL;
+ if(!obj->FindAttribute(anAttr, "AttributeIOR") &&
+ obj->FindAttribute(anAttr, "AttributePersistentRef")) {
+ _PTR(SComponent) FComp ( obj->GetFatherComponent() );
+ if (FComp) {
+ if (FComp->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aName ( anAttr );
+ QString compName = QAD_Application::getDesktop()->getComponentName(aName->Value().c_str());
+ // parent->loadComponentData(parent->getComponentName(aName->Value()));
+ Engines::Component_var comp ;
+ if ( compName.compare("SUPERV") == 0 ) {
+ comp = QAD_Application::getDesktop()->getEngine( "SuperVisionContainer", compName) ;
+ }
+ else {
+ comp = QAD_Application::getDesktop()->getEngine( "FactoryServer", compName);
+ if ( comp->_is_nil() )
+ comp = QAD_Application::getDesktop()->getEngine( "FactoryServerPy", compName);
+ }
+
+ if (!CORBA::is_nil(comp)) {
+ SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
+ if (!CORBA::is_nil(driver)) {
+ SALOMEDS::StudyBuilder_var B = dynamic_cast<SALOMEDS_Study*>(aStudy.get())->GetStudy()->NewBuilder();
+ if (!CORBA::is_nil(B)) {
+ B->LoadWith(FComp,driver);
+ } else {
+ return;
+ }
+ }
+ else {
+ MESSAGE("loadComponentData(): Driver is null");
+ return;
+ }
+ }
+ else {
+ MESSAGE("loadComponentData(): Engine is null");
+ return;
+ }
+ // // load
+ // Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM");
+ // if (!CORBA::is_nil(comp)) {
+ // SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
+ // SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ // SALOMEDS::SComponent_var SC = aStudy->FindComponent("GEOM");
+ // if (!CORBA::is_nil(SC))
+ // aStudyBuilder->LoadWith(SC,driver);
+ }
+ }
+ else {
+ MESSAGE("Component is null");
+ }
+ }
+ if(useSubItems) {
+ anIter->Next();
+ obj.reset( anIter->Value() );
+ }
+ else
+ anAttr = NULL;
}
}
}
if ( aSelMgr && appStudy ) {
aSelMgr->selectedObjects( selected );
if ( !selected.IsEmpty() ) {
- _PTR(Study) aStudy = appStudy->studyDS();
- _PTR(StudyBuilder) B = aStudy->NewBuilder();
-
- bool aLocked = ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() ) )->IsLocked();
- if ( aLocked ) {
- SUIT_MessageBox::warning( app->desktop(),
- QObject::tr( "WRN_WARNING" ),
- QObject::tr( "WRN_STUDY_LOCKED" ) );
- return;
- }
-
- for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
- Handle(SALOME_InteractiveObject) IObject = It.Value();
-
- _PTR(SObject) obj ( aStudy->FindObjectID( IObject->getEntry() ) );
- _PTR(GenericAttribute) anAttr;
- if ( obj ) {
- _PTR(AttributeExpandable) aExp = B->FindOrCreateAttribute( obj, "AttributeExpandable" );
- aExp->SetExpandable( show );
- } // if ( obj )
- } // iterator
+ _PTR(Study) aStudy = appStudy->studyDS();
+ _PTR(StudyBuilder) B = aStudy->NewBuilder();
+
+ bool aLocked = ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() ) )->IsLocked();
+ if ( aLocked ) {
+ SUIT_MessageBox::warning( app->desktop(),
+ QObject::tr( "WRN_WARNING" ),
+ QObject::tr( "WRN_STUDY_LOCKED" ) );
+ return;
+ }
+
+ for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
+ Handle(SALOME_InteractiveObject) IObject = It.Value();
+
+ _PTR(SObject) obj ( aStudy->FindObjectID( IObject->getEntry() ) );
+ _PTR(GenericAttribute) anAttr;
+ if ( obj ) {
+ _PTR(AttributeExpandable) aExp = B->FindOrCreateAttribute( obj, "AttributeExpandable" );
+ aExp->SetExpandable( show );
+ } // if ( obj )
+ } // iterator
}
}
app->updateObjectBrowser( false );
\param parent parent widget
*/
GEOMToolsGUI_DeleteDlg::GEOMToolsGUI_DeleteDlg( QWidget* parent,
- const QMap<QString, QString>& objects,
- bool deleteAll )
+ const QMap<QString, QString>& objects,
+ bool deleteAll )
: QDialog( parent )
{
setModal( true );
SALOME_ListIO selected;
selMgr->selectedObjects( selected );
if ( !selected.IsEmpty() ) {
- _PTR(Study) study = getStudy()->studyDS();
- for ( SALOME_ListIteratorOfListIO it( selected ); it.More(); it.Next() ) {
- _PTR(SObject) aSObject( study->FindObjectID( it.Value()->getEntry() ) );
- GEOM::GEOM_Object_var anObject =
- GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( aSObject ) );
- if ( !anObject->_is_nil() ) {
- if ( myWGStack->currentIndex() == 0 )
- anObject->SetMarkerStd( getMarkerType(), getStandardMarkerScale() );
- else if ( getCustomMarkerID() > 0 )
- anObject->SetMarkerTexture( getCustomMarkerID() );
- }
- }
- GEOM_Displayer displayer( getStudy() );
- displayer.Redisplay( selected, true );
+ _PTR(Study) study = getStudy()->studyDS();
+ for ( SALOME_ListIteratorOfListIO it( selected ); it.More(); it.Next() ) {
+ _PTR(SObject) aSObject( study->FindObjectID( it.Value()->getEntry() ) );
+ GEOM::GEOM_Object_var anObject =
+ GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( aSObject ) );
+ if ( !anObject->_is_nil() ) {
+ if ( myWGStack->currentIndex() == 0 )
+ anObject->SetMarkerStd( getMarkerType(), getStandardMarkerScale() );
+ else if ( getCustomMarkerID() > 0 )
+ anObject->SetMarkerTexture( getCustomMarkerID() );
+ }
+ }
+ GEOM_Displayer displayer( getStudy() );
+ displayer.Redisplay( selected, true );
}
}
}
SALOME_ListIO selected;
selMgr->selectedObjects( selected );
if ( !selected.IsEmpty() ) {
- _PTR(Study) study = getStudy()->studyDS();
- for ( SALOME_ListIteratorOfListIO it( selected ); it.More(); it.Next() ) {
- _PTR(SObject) aSObject( study->FindObjectID( it.Value()->getEntry() ) );
- GEOM::GEOM_Object_var anObject =
- GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( aSObject ) );
- if ( !anObject->_is_nil() ) {
- GEOM::marker_type mtype = anObject->GetMarkerType();
- if ( aType == -1 )
- aType = mtype;
- else if ( aType != mtype ) {
- aType = (GEOM::marker_type)-1;
- break;
- }
- if ( mtype > GEOM::MT_NONE && mtype < GEOM::MT_USER ) {
- GEOM::marker_size msize = anObject->GetMarkerSize();
- if ( aSize == -1 )
- aSize = msize;
- else if ( aSize != msize )
- break;
- }
- else if ( mtype == GEOM::MT_USER ) {
- int mtexture = anObject->GetMarkerTexture();
- if ( aTexture == 0 )
- aTexture = mtexture;
- else if ( aTexture != mtexture )
- break;
- }
- }
- }
+ _PTR(Study) study = getStudy()->studyDS();
+ for ( SALOME_ListIteratorOfListIO it( selected ); it.More(); it.Next() ) {
+ _PTR(SObject) aSObject( study->FindObjectID( it.Value()->getEntry() ) );
+ GEOM::GEOM_Object_var anObject =
+ GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( aSObject ) );
+ if ( !anObject->_is_nil() ) {
+ GEOM::marker_type mtype = anObject->GetMarkerType();
+ if ( aType == -1 )
+ aType = mtype;
+ else if ( aType != mtype ) {
+ aType = (GEOM::marker_type)-1;
+ break;
+ }
+ if ( mtype > GEOM::MT_NONE && mtype < GEOM::MT_USER ) {
+ GEOM::marker_size msize = anObject->GetMarkerSize();
+ if ( aSize == -1 )
+ aSize = msize;
+ else if ( aSize != msize )
+ break;
+ }
+ else if ( mtype == GEOM::MT_USER ) {
+ int mtexture = anObject->GetMarkerTexture();
+ if ( aTexture == 0 )
+ aTexture = mtexture;
+ else if ( aTexture != mtexture )
+ break;
+ }
+ }
+ }
}
}
}
setCustomMarker( aTexture );
else
setStandardMarker((GEOM::marker_type)(resMgr->integerValue("Geometry", "type_of_marker", (int)Aspect_TOM_PLUS) + 1),
- (GEOM::marker_size)(resMgr->integerValue("Geometry", "marker_scale", 1)));
+ (GEOM::marker_size)(resMgr->integerValue("Geometry", "marker_scale", 1)));
}
void GEOMToolsGUI_MarkerDlg::addTexture( int id, bool select ) const
image.setColor( 1, qRgba( 0, 0, 0, 255 ) );
int bytesperline = tWidth/8;
for ( int j = texture->Lower(); j <= texture->Upper(); j++ ) {
- uchar val = (uchar)texture->Value( j );
- for ( int k = 0; k < 8; k++ ) {
- int row = ( j - texture->Lower() ) / bytesperline;
- int col = ( ( j - texture->Lower() ) % bytesperline ) * 8 + k;
- image.setPixel( row, col, ( val & (1<<(8-k-1)) ) ? 1 : 0 );
- }
+ uchar val = (uchar)texture->Value( j );
+ for ( int k = 0; k < 8; k++ ) {
+ int row = ( j - texture->Lower() ) / bytesperline;
+ int col = ( ( j - texture->Lower() ) % bytesperline ) * 8 + k;
+ image.setPixel( row, col, ( val & (1<<(8-k-1)) ) ? 1 : 0 );
+ }
}
QPixmap pixmap = QPixmap::fromImage( image );
if ( !pixmap.isNull() ) {
- myCustomTypeCombo->addItem( pixmap, QString::number( id ) );
- myCustomTypeCombo->setId( myCustomTypeCombo->count()-1, id );
- if ( select ) myCustomTypeCombo->setCurrentId( id );
+ myCustomTypeCombo->addItem( pixmap, QString::number( id ) );
+ myCustomTypeCombo->setId( myCustomTypeCombo->count()-1, id );
+ if ( select ) myCustomTypeCombo->setCurrentId( id );
}
}
}
app->onHelpContextModule(aGeomGUI ? app->moduleName(aGeomGUI->moduleName()) : QString(""), myHelpFileName);
}
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
app->onHelpContextModule(aGeomGUI ? app->moduleName(aGeomGUI->moduleName()) : QString(""), myHelpFileName);
}
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
Handle(SALOME_InteractiveObject) FirstIOS = selected.First();
if ( FirstIOS.IsNull() )
return;
-
+
SUIT_ViewWindow* window = app->desktop()->activeWindow();
bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
if ( !vtkVW )
return;
SVTK_View* aView = vtkVW->getView();
- if ( myFirstInit ) {
+ if ( myFirstInit ) {
myFirstInit = false;
int transp = int (100 - ((aView->GetTransparency(FirstIOS))*100.0) + 0.5);
mySlider->setValue(transp);
}
aView->Repaint();
} // if ( isVTK )
-
+
else if ( isOCC ) {
GEOMBase* gb = new GEOMBase();
Standard_Boolean found;
myFirstInit = false;
aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, found );
if( !found )
- return;
+ return;
int transp = int( 100 - ( aisShape->Transparency() * 100.0 ) + 0.5);
mySlider->setValue(transp);
ValueHasChanged();
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
aisShape = gb->ConvertIOinGEOMAISShape( It.Value(), found );
if ( found ) {
- ic->SetTransparency( aisShape, newValue, false );
- ic->Redisplay( aisShape, Standard_False, Standard_True );
+ ic->SetTransparency( aisShape, newValue, false );
+ ic->Redisplay( aisShape, Standard_False, Standard_True );
}
} // for...
ic->UpdateCurrentViewer();
// TRUE to construct a modal dialog.
//=================================================================================
GenerationGUI_FillingDlg::GenerationGUI_FillingDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FILLING" ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_FILLING" ) );
resize(100,100);
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection( GEOM_COMPOUND );
displayPreview();
}
{
GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
GEOM::GEOM_Object_var anObj = anOper->MakeFilling( myCompound, myMinDeg, myMaxDeg,
- myTol2D, myTol3D, myNbIter, myIsApprox );
+ myTol2D, myTol3D, myNbIter, myIsApprox );
if ( !anObj->_is_nil() )
{
if ( !IsPreview() )
initName();
if ( getConstructorId() != 1 )
- ConstructorsClicked( getConstructorId() );
+ ConstructorsClicked( getConstructorId() );
// activate selection and connect selection manager
GroupPoints->PushButton1->click();
return true;
S.ShapeType() == TopAbs_SHAPE)
return;
if ( getConstructorId() == 1 &&
- (S.ShapeType() == TopAbs_SHELL ||
- S.ShapeType() == TopAbs_VERTEX))
+ (S.ShapeType() == TopAbs_SHELL ||
+ S.ShapeType() == TopAbs_VERTEX))
return;
myBase = aSelectedObject;
GroupPoints->PushButton3->click();
}
else if (myEditCurrentArgument == GroupPoints->LineEdit2 ||
- myEditCurrentArgument == GroupPoints->LineEdit3) {
+ myEditCurrentArgument == GroupPoints->LineEdit3) {
myEditCurrentArgument == GroupPoints->LineEdit2 ? myOkPath = false : myOkVec = false;
bool myOk = false;
QString aName = GEOMBase::GetName(aSelectedObject);
}
else
{
- if (aSelectedObject != myBase) {
- TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes(aSelList.First(), aMap);
- if (aMap.Extent() == 1) {
- int anIndex = aMap(1);
- aName.append(":edge_" + QString::number(anIndex));
-
- //Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
-
- if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations(getStudyId());
- aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- myOk = true;
- }
- else { // get Object from study
- aSelectedObject = aFindedObject;
- myOk = true;
- }
- }
- else {
- myOk = true;
- if (S.ShapeType() != TopAbs_EDGE) {
- aSelectedObject = GEOM::GEOM_Object::_nil();
- aName = "";
- myOk = false;
- }
- }
- if (myEditCurrentArgument == GroupPoints->LineEdit2) {
- myPath = aSelectedObject;
- myOkPath = myOk;
- }
- else if (myEditCurrentArgument == GroupPoints->LineEdit3) {
- myVec = aSelectedObject;
- myOkVec = myOk;
- }
- }
- myEditCurrentArgument->setText(aName);
-
- if (myOkPath) {
- if (!myOkBase)
- GroupPoints->PushButton1->click();
- else if (!myOkVec)
- GroupPoints->PushButton3->click();
- }
- else if (myOkVec) {
- if (!myOkBase)
- GroupPoints->PushButton1->click();
- else if (!myOkPath)
- GroupPoints->PushButton2->click();
- }
+ if (aSelectedObject != myBase) {
+ TColStd_IndexedMapOfInteger aMap;
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
+ if (aMap.Extent() == 1) {
+ int anIndex = aMap(1);
+ aName.append(":edge_" + QString::number(anIndex));
+
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
+
+ if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp =
+ getGeomEngine()->GetIShapesOperations(getStudyId());
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ myOk = true;
+ }
+ else { // get Object from study
+ aSelectedObject = aFindedObject;
+ myOk = true;
+ }
+ }
+ else {
+ myOk = true;
+ if (S.ShapeType() != TopAbs_EDGE) {
+ aSelectedObject = GEOM::GEOM_Object::_nil();
+ aName = "";
+ myOk = false;
+ }
+ }
+ if (myEditCurrentArgument == GroupPoints->LineEdit2) {
+ myPath = aSelectedObject;
+ myOkPath = myOk;
+ }
+ else if (myEditCurrentArgument == GroupPoints->LineEdit3) {
+ myVec = aSelectedObject;
+ myOkVec = myOk;
+ }
+ }
+ myEditCurrentArgument->setText(aName);
+
+ if (myOkPath) {
+ if (!myOkBase)
+ GroupPoints->PushButton1->click();
+ else if (!myOkVec)
+ GroupPoints->PushButton3->click();
+ }
+ else if (myOkVec) {
+ if (!myOkBase)
+ GroupPoints->PushButton1->click();
+ else if (!myOkPath)
+ GroupPoints->PushButton2->click();
+ }
}
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked(getConstructorId());
}
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
displayPreview();
}
if ( aStudy->GetProperties()->IsLocked() ) {
SUIT_MessageBox::warning( parent,
- tr( "WRN_WARNING" ),
- tr( "WRN_STUDY_LOCKED" ) );
+ tr( "WRN_WARNING" ),
+ tr( "WRN_STUDY_LOCKED" ) );
return false;
}
aSelMgr->selectedObjects( aList );
if ( aList.Extent() == 1 ) {
- Standard_Boolean aResult = Standard_False;
- GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( aList.First(), aResult );
-
- if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) {
- aDlg = new GroupGUI_GroupDlg( GroupGUI_GroupDlg::EditGroup, getGeometryGUI(), parent );
- break;
- }
+ Standard_Boolean aResult = Standard_False;
+ GEOM::GEOM_Object_var anObj =
+ GEOMBase::ConvertIOinGEOMObject( aList.First(), aResult );
+
+ if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) {
+ aDlg = new GroupGUI_GroupDlg( GroupGUI_GroupDlg::EditGroup, getGeometryGUI(), parent );
+ break;
+ }
}
SUIT_MessageBox::warning( parent, tr( "WRN_WARNING" ), tr( "NO_GROUP" ) );
break;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: IGESExport.cxx
-// Created: Wed May 19 14:49:45 2004
-// Author: Pavel TELKOV
-// <ptv@mutex.nnov.opencascade.com>
+// File: IGESExport.cxx
+// Created: Wed May 19 14:49:45 2004
+// Author: Pavel TELKOV
+// <ptv@mutex.nnov.opencascade.com>
//
#include "utilities.h"
// initialize writer
IGESControl_Controller::Init();
//IGESControl_Writer ICW (Interface_Static::CVal("write.iges.unit"),
- // Interface_Static::IVal("write.iges.brep.mode"));
+ // Interface_Static::IVal("write.iges.brep.mode"));
IGESControl_Writer ICW ("M", aBrepMode); // "write.iges.unit" ->> VSR 15.09.09: export explicitly in meters
Interface_Static::SetCVal("xstep.cascade.unit","M");
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: IGESImport.cxx
-// Created: Wed May 19 14:36:35 2004
-// Author: Pavel TELKOV
-// <ptv@mutex.nnov.opencascade.com>
+// File: IGESImport.cxx
+// Created: Wed May 19 14:36:35 2004
+// Author: Pavel TELKOV
+// <ptv@mutex.nnov.opencascade.com>
//
#include "utilities.h"
TopoDS_Shape Import (const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName,
TCollection_AsciiString& theError,
- const TDF_Label&)
+ const TDF_Label&)
{
// Set "C" numeric locale to save numbers correctly
Kernel_Utils::Localizer loc;
if (status == IFSelect_RetDone) {
- if( theFormatName == "IGES_UNIT" ) {
- Handle(IGESData_IGESModel) aModel =
- Handle(IGESData_IGESModel)::DownCast(aReader.Model());
- gp_Pnt P(1.0,0.0,0.0);
- if(!aModel.IsNull()) {
- Handle(TCollection_HAsciiString) aUnitName =
- aModel->GlobalSection().UnitName();
- //cout<<"aUnitName = "<<aUnitName->ToCString()<<endl;
- //cout<<"aUnitFlag = "<<aModel->GlobalSection().UnitFlag()<<endl;
- if( aUnitName->String()=="MM" ) {
- P = gp_Pnt(0.001,0.0,0.0);
- }
- else if( aUnitName->String()=="CM" ) {
- P = gp_Pnt(0.01,0.0,0.0);
- }
- }
- BRep_Builder B;
- TopoDS_Vertex V;
- B.MakeVertex(V,P,1.e-7);
- aResShape = V;
- return aResShape;
- }
- if( theFormatName == "IGES_SCALE" ) {
- //cout<<"need re-scale a model"<<endl;
- // set UnitFlag to 'meter'
- Handle(IGESData_IGESModel) aModel =
- Handle(IGESData_IGESModel)::DownCast(aReader.Model());
- if(!aModel.IsNull()) {
- IGESData_GlobalSection aGS = aModel->GlobalSection();
- aGS.SetUnitFlag(6);
- aModel->SetGlobalSection(aGS);
- }
- }
+ if( theFormatName == "IGES_UNIT" ) {
+ Handle(IGESData_IGESModel) aModel =
+ Handle(IGESData_IGESModel)::DownCast(aReader.Model());
+ gp_Pnt P(1.0,0.0,0.0);
+ if(!aModel.IsNull()) {
+ Handle(TCollection_HAsciiString) aUnitName =
+ aModel->GlobalSection().UnitName();
+ //cout<<"aUnitName = "<<aUnitName->ToCString()<<endl;
+ //cout<<"aUnitFlag = "<<aModel->GlobalSection().UnitFlag()<<endl;
+ if( aUnitName->String()=="MM" ) {
+ P = gp_Pnt(0.001,0.0,0.0);
+ }
+ else if( aUnitName->String()=="CM" ) {
+ P = gp_Pnt(0.01,0.0,0.0);
+ }
+ }
+ BRep_Builder B;
+ TopoDS_Vertex V;
+ B.MakeVertex(V,P,1.e-7);
+ aResShape = V;
+ return aResShape;
+ }
+ if( theFormatName == "IGES_SCALE" ) {
+ //cout<<"need re-scale a model"<<endl;
+ // set UnitFlag to 'meter'
+ Handle(IGESData_IGESModel) aModel =
+ Handle(IGESData_IGESModel)::DownCast(aReader.Model());
+ if(!aModel.IsNull()) {
+ IGESData_GlobalSection aGS = aModel->GlobalSection();
+ aGS.SetUnitFlag(6);
+ aModel->SetGlobalSection(aGS);
+ }
+ }
MESSAGE("ImportIGES : all Geometry Transfer");
//OCC 5.1.2 porting
// break;
// }
theError = "Wrong format of the imported file. Can't import file.";
- aResShape.Nullify();
+ aResShape.Nullify();
}
}
catch(Standard_Failure) {
private:
void Init();
bool getParameters( double&, double&,
- double&, double&,
- double&, double& );
+ double&, double&,
+ double&, double& );
private:
MeasureGUI_1Sel6LineEdit* myGrp;
connect( myGrp->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_POINT") );
globalSelection();
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL(currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL(currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection();
displayPreview();
void Init();
void enterEvent( QEvent* );
bool getBCErrors( bool&,
- GEOM::GEOM_IBlocksOperations::BCErrors& );
+ GEOM::GEOM_IBlocksOperations::BCErrors& );
void activateSelection();
private:
MeasureGUI_Skeleton::Init();
connect( myGrp->CheckBox1, SIGNAL( toggled( bool) ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
}
//=================================================================================
private:
void Init();
bool getParameters( double&,
- gp_Pnt&,
- gp_Pnt& );
+ gp_Pnt&,
+ gp_Pnt& );
private:
QLineEdit* myEditCurrentArgument;
QLineEdit* mySelEdit2;
try {
double x, y, z;
anOper->GetInertia( myObj,
- I( 1, 1 ), I( 1, 2 ), I( 1, 3 ),
- I( 2, 1 ), I( 2, 2 ), I( 2, 3 ),
- I( 3, 1 ), I( 3, 2 ), I( 3, 3 ),
- x, y, z );
+ I( 1, 1 ), I( 1, 2 ), I( 1, 3 ),
+ I( 2, 1 ), I( 2, 2 ), I( 2, 3 ),
+ I( 3, 1 ), I( 3, 2 ), I( 3, 3 ),
+ x, y, z );
theIXYZ.SetCoord( x, y, z );
}
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
try {
anOper->GetTolerance( myObj,
- theMinFaceToler, theMaxFaceToler, theMinEdgeToler,
- theMaxEdgeToler, theMinVertexToler, theMaxVertexToler );
+ theMinFaceToler, theMaxFaceToler, theMinEdgeToler,
+ theMaxEdgeToler, theMinVertexToler, theMaxVertexToler );
}
catch( const SALOME::SALOME_Exception& e ) {
SalomeApp_Tools::QtCatchCorbaException( e );
private:
void Init();
bool getParameters( double&, double&, double&,
- double&, double&, double& );
+ double&, double&, double& );
private:
MeasureGUI_1Sel6LineEdit* myGrp;
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
displayPreview();
}
private:
void Init();
bool getParameters( double&,
- double&,
- double& );
+ double&,
+ double& );
private:
MeasureGUI_1Sel3LineEdit* myGrp;
// TRUE to construct a modal dialog.
//=================================================================================
MeasureGUI_Skeleton::MeasureGUI_Skeleton( GeometryGUI* GUI, QWidget* parent,
- bool modal, Qt::WindowFlags f )
+ bool modal, Qt::WindowFlags f )
: QDialog( parent, f ),
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
myGeomGUI( GUI )
/* signals and slots connections */
connect( buttonClose(), SIGNAL( clicked() ),
- this, SLOT( ClickOnCancel() ) );
+ this, SLOT( ClickOnCancel() ) );
connect( buttonHelp(), SIGNAL( clicked() ),
- this, SLOT( ClickOnHelp() ) );
+ this, SLOT( ClickOnHelp() ) );
if ( myGeomGUI ) {
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ),
- this, SLOT ( DeactivateActiveDialog() ) );
+ this, SLOT ( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ),
- this, SLOT ( ClickOnCancel() ) );
+ this, SLOT ( ClickOnCancel() ) );
}
if ( mySelEdit ) {
connect( mySelEdit, SIGNAL( returnPressed() ),
- this, SLOT( LineEditReturnPressed() ) );
+ this, SLOT( LineEditReturnPressed() ) );
}
if ( mySelBtn ) {
connect( mySelBtn, SIGNAL( clicked() ),
- this, SLOT ( SetEditCurrentArgument() ) );
+ this, SLOT ( SetEditCurrentArgument() ) );
}
LightApp_SelectionMgr* aSel = ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr();
if ( aSel ) {
connect( aSel, SIGNAL( currentSelectionChanged() ),
- this, SLOT ( SelectionIntoArgument() ) ) ;
+ this, SLOT ( SelectionIntoArgument() ) ) ;
}
/* displays Dialog */
platform = "application";
#endif
SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( myHelpFileName ) );
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( myHelpFileName ) );
}
}
LightApp_SelectionMgr* aSel = ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr();
if ( aSel )
connect( aSel, SIGNAL( currentSelectionChanged() ),
- this, SLOT ( SelectionIntoArgument() ) ) ;
+ this, SLOT ( SelectionIntoArgument() ) ) ;
redisplayPreview();
activateSelection();
//////////////////////////////////////////
MeasureGUI_1Sel1TextView1Check::MeasureGUI_1Sel1TextView1Check( QWidget* parent,
- Qt::WindowFlags f )
+ Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
//////////////////////////////////////////
MeasureGUI_1Sel1TextView2ListBox::MeasureGUI_1Sel1TextView2ListBox( QWidget* parent,
- Qt::WindowFlags f )
+ Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTAlgo_Algo.cxx
-// Created: Tue Jan 27 14:58:21 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTAlgo_Algo.cxx
+// Created: Tue Jan 27 14:58:21 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTAlgo_Algo.ixx>
#include <stdlib.h>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTAlgo_Inter3d.cxx
-// Created: Tue Jan 27 15:14:13 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTAlgo_Inter3d.cxx
+// Created: Tue Jan 27 15:14:13 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTAlgo_Builder.ixx>
//
aItF2.Initialize(aLF2);
for (; aItF2.More(); aItF2.Next()) {
- const TopoDS_Face& aF2y=TopoDS::Face(aItF2.Value());
- bIsSDF=NMTTools_Tools::AreFacesSameDomain(aF1x, aF2y, aCtx);
- if (bIsSDF) {
- NMTTools_CoupleOfShape aCS;
- //
- aCS.SetShape1(aF1x);
- aCS.SetShape2(aF2y);
- aLCS.Append(aCS);
- }
+ const TopoDS_Face& aF2y=TopoDS::Face(aItF2.Value());
+ bIsSDF=NMTTools_Tools::AreFacesSameDomain(aF1x, aF2y, aCtx);
+ if (bIsSDF) {
+ NMTTools_CoupleOfShape aCS;
+ //
+ aCS.SetShape1(aF1x);
+ aCS.SetShape2(aF2y);
+ aLCS.Append(aCS);
+ }
}
}
}//for (i=1; i<=aNbFF; ++i)
const TopoDS_Shape& aE=aME(j);
//
if (myImagesEdges.HasImage(aE)) {
- aMFP.Add(i);
- break;
+ aMFP.Add(i);
+ break;
}
}
}// for (i=1; i<=aNb; ++i)
const TopoDS_Edge& aE=TopoDS::Edge(anExp.Current());
//
if (!myImagesEdges.HasImage(aE)) {
- aWES.AddStartElement(aE);
- continue;
+ aWES.AddStartElement(aE);
+ continue;
}
//
bIsDegenerated=BRep_Tool::Degenerated(aE);
const TopTools_ListOfShape& aLIE=myImagesEdges.Image(aE);
aIt.Initialize(aLIE);
for (; aIt.More(); aIt.Next()) {
- aSp=TopoDS::Edge(aIt.Value());
- //
- if (bIsDegenerated) {
- aSp.Orientation(aE.Orientation());
- aWES.AddStartElement(aSp);
- continue;
- }
- //
- if (bIsClosed){
- if (!aMFence.Contains(aSp)){
- aMFence.Add(aSp);
- //
- if (!BRep_Tool::IsClosed(aSp, aF)){
- BOPTools_Tools3D::DoSplitSEAMOnFace(aSp, aF);
- }
- //
- aSp.Orientation(TopAbs_FORWARD);
- aWES.AddStartElement(aSp);
- //
- aSp.Orientation(TopAbs_REVERSED);
- aWES.AddStartElement(aSp);
- continue;
- }
- }
- //
- bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, aCtx);
- if (bToReverse) {
- aSp.Reverse();
- }
- aWES.AddStartElement(aSp);
+ aSp=TopoDS::Edge(aIt.Value());
+ //
+ if (bIsDegenerated) {
+ aSp.Orientation(aE.Orientation());
+ aWES.AddStartElement(aSp);
+ continue;
+ }
+ //
+ if (bIsClosed){
+ if (!aMFence.Contains(aSp)){
+ aMFence.Add(aSp);
+ //
+ if (!BRep_Tool::IsClosed(aSp, aF)){
+ BOPTools_Tools3D::DoSplitSEAMOnFace(aSp, aF);
+ }
+ //
+ aSp.Orientation(TopAbs_FORWARD);
+ aWES.AddStartElement(aSp);
+ //
+ aSp.Orientation(TopAbs_REVERSED);
+ aWES.AddStartElement(aSp);
+ continue;
+ }
+ }
+ //
+ bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, aCtx);
+ if (bToReverse) {
+ aSp.Reverse();
+ }
+ aWES.AddStartElement(aSp);
}
}
//
const TopTools_ListOfShape& aLE=myIn2DParts.FindFromKey(aF);
aIt.Initialize(aLE);
for (; aIt.More(); aIt.Next()) {
- aSp=TopoDS::Edge(aIt.Value());
- //
- aSp.Orientation(TopAbs_FORWARD);
- aWES.AddStartElement(aSp);
- //
- aSp.Orientation(TopAbs_REVERSED);
- aWES.AddStartElement(aSp);
- }
+ aSp=TopoDS::Edge(aIt.Value());
+ //
+ aSp.Orientation(TopAbs_FORWARD);
+ aWES.AddStartElement(aSp);
+ //
+ aSp.Orientation(TopAbs_REVERSED);
+ aWES.AddStartElement(aSp);
+ }
}
//
// 2.1.3. Add Section Parts
const TopTools_ListOfShape& aLE=mySectionParts.FindFromKey(aF);
aIt.Initialize(aLE);
for (; aIt.More(); aIt.Next()) {
- aSp=TopoDS::Edge(aIt.Value());
- //
- aSp.Orientation(TopAbs_FORWARD);
- aWES.AddStartElement(aSp);
- //
- aSp.Orientation(TopAbs_REVERSED);
- aWES.AddStartElement(aSp);
+ aSp=TopoDS::Edge(aIt.Value());
+ //
+ aSp.Orientation(TopAbs_FORWARD);
+ aWES.AddStartElement(aSp);
+ //
+ aSp.Orientation(TopAbs_REVERSED);
+ aWES.AddStartElement(aSp);
}
}
//
for (; aIt.More(); aIt.Next()) {
TopoDS_Shape& aFR=aIt.Value();
if (anOriF==TopAbs_REVERSED) {
- aFR.Orientation(TopAbs_REVERSED);
+ aFR.Orientation(TopAbs_REVERSED);
}
aLFR.Append(aFR);
}
BOPTools_SequenceOfCurves& aSC=aFF.Curves();
aNbCurves=aSC.Length();
if (!aNbCurves) {
- continue;
+ continue;
}
//
const BOPTools_Curve& aBC=aSC(1);
//
aItPBSc.Initialize(aLPB);
for (; aItPBSc.More(); aItPBSc.Next()) {
- const BOPTools_PaveBlock& aPBSc=aItPBSc.Value();
- aLPBSc.Append(aPBSc);
+ const BOPTools_PaveBlock& aPBSc=aItPBSc.Value();
+ aLPBSc.Append(aPBSc);
}
}// for (j=1; j<=aNbFF; ++j)
//
nSpIn=aPBR.Edge();
const TopoDS_Shape& aSpIn=aDS.Shape(nSpIn);
if (!aMFence.Contains(aSpIn)){
- aMFence.Add(aSpIn);
- aLSpIn.Append(aSpIn);
+ aMFence.Add(aSpIn);
+ aLSpIn.Append(aSpIn);
}
}
myIn2DParts.Add(aF, aLSpIn);
nSpSc=aPBSc.Edge();
const TopoDS_Shape& aSpSc=aDS.Shape(nSpSc);
if (!aMFence.Contains(aSpSc)){
- aMFence.Add(aSpSc);
- aLSpSc.Append(aSpSc);
+ aMFence.Add(aSpSc);
+ aLSpSc.Append(aSpSc);
}
}
mySectionParts.Add(aF, aLSpSc);
nSp=aPBR1.Edge();
const TopoDS_Shape& aSp1=aDS.Shape(nSp);
if (aSp1.IsSame(aE)) {
- continue;
+ continue;
}
}
//modified by NIZNHY-PKV Fri Jan 21 17:01:14 2005 t
//
nV1=aPBR.Pave1().Index();
if (aDS.IsNewShape(nV1)) {
- const TopoDS_Shape& aV1=aDS.Shape(nV1);
- myQueryShapes.Add(aV1);
+ const TopoDS_Shape& aV1=aDS.Shape(nV1);
+ myQueryShapes.Add(aV1);
}
//
nV2=aPBR.Pave2().Index();
if (aDS.IsNewShape(nV2)) {
- const TopoDS_Shape& aV2=aDS.Shape(nV2);
- myQueryShapes.Add(aV2);
+ const TopoDS_Shape& aV2=aDS.Shape(nV2);
+ myQueryShapes.Add(aV2);
}
}
}
// purpose:
//=======================================================================
Standard_Boolean NMTAlgo_Builder::IsSameDomainF(const TopoDS_Face& aF1,
- const TopoDS_Face& aF2)const
+ const TopoDS_Face& aF2)const
{
Standard_Boolean bFlag=Standard_False;
TopTools_ListIteratorOfListOfShape aItF1, aItF2;
for (; aItF2.More(); aItF2.Next()) {
const TopoDS_Shape& aF2y=aItF2.Value();
if (!mySDFaces.Contains(aF2y)){
- continue;
+ continue;
}
const TopoDS_Shape& aFSD2y=mySDFaces.FindFromKey(aF2y);
if (aFSD1x.IsSame(aFSD2y)) {
- return !bFlag;
+ return !bFlag;
}
}
}
for (; itF.More(); itF.Next()) {
const TopoDS_Shape& FF = itF.Value();
if (AvoidFacesMap.Contains( FF ) ||
- ! AddedFacesMap.Add( FF ) )
+ ! AddedFacesMap.Add( FF ) )
continue;
// make a new shell
TopExp_Explorer EdgeExp(F, TopAbs_EDGE);
for (; EdgeExp.More(); EdgeExp.Next()){
const TopoDS_Edge& E = TopoDS::Edge( EdgeExp.Current());
- if (! CheckedEdgesMap.Add( E ))
- continue;
-
- // candidate faces list
+ if (! CheckedEdgesMap.Add( E ))
+ continue;
+
+ // candidate faces list
const TopTools_ListOfShape& FL = myEFMap.ChangeFromKey(E);
if (FL.IsEmpty())
continue;
- // select one of neighbors
+ // select one of neighbors
TopoDS_Face SelF;
if (FL.Extent() == 2) {
if (! F.IsSame( FL.First() ))
}
else {
// check if a face already added to Shell shares E
- TopTools_ListIteratorOfListOfShape it (FL);
+ TopTools_ListIteratorOfListOfShape it (FL);
Standard_Boolean found = Standard_False;
for (; !found && it.More(); it.Next())
if (F != it.Value())
}
}
if (!SelF.IsNull() &&
- AddedFacesMap.Add( SelF ) &&
- !AvoidFacesMap.Contains( SelF ))
+ AddedFacesMap.Add( SelF ) &&
+ !AvoidFacesMap.Contains( SelF ))
Builder.Add( Shell, SelF);
} // loop on edges of F
//purpose :
//=======================================================================
gp_Vec NMTAlgo_Loop3d::Normal(const TopoDS_Edge& E,
- const TopoDS_Face& F)
+ const TopoDS_Face& F)
{
gp_Vec Norm, V1, V2;
Standard_Real First, Last;
// check if faces are oriented well for sewing
//=======================================================================
Standard_Boolean NMTAlgo_Loop3d::IsInside(const TopoDS_Edge& E,
- const TopoDS_Face& F1,
- const TopoDS_Face& F2,
- const Standard_Boolean CountDot,
- Standard_Real& Dot,
- Standard_Boolean& GoodOri)
+ const TopoDS_Face& F1,
+ const TopoDS_Face& F2,
+ const Standard_Boolean CountDot,
+ Standard_Real& Dot,
+ Standard_Boolean& GoodOri)
{
Standard_Real f, l;
gp_Pnt P;
//warning : E must be properly oriented in F.
//=======================================================================
gp_Vec NextNormal(const TopoDS_Edge& E,
- const TopoDS_Face& F)
+ const TopoDS_Face& F)
{
Standard_Real First, Last;
//purpose : find E in F
//=======================================================================
TopoDS_Edge FindEinF(const TopoDS_Edge& E,
- const TopoDS_Face& F)
+ const TopoDS_Face& F)
{
TopExp_Explorer expl (F, TopAbs_EDGE);
for (; expl.More(); expl.Next())
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTAlgo_Splitter.cxx
-// Created: Thu Jan 29 17:13:03 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTAlgo_Splitter.cxx
+// Created: Thu Jan 29 17:13:03 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTAlgo_Splitter.ixx>
//
aIt.Initialize(aLSp);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aSp=aIt.Value();
- myQueryShapes.Add(aSp);
+ const TopoDS_Shape& aSp=aIt.Value();
+ myQueryShapes.Add(aSp);
}
}
}
const TopTools_ListOfShape& aLSc=mySectionParts.FindFromKey(aF);
aIt.Initialize(aLSc);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aSc=aIt.Value();
- myQueryShapes.Add(aSc);
+ const TopoDS_Shape& aSc=aIt.Value();
+ myQueryShapes.Add(aSc);
}
}
}
aOriFS= aFS.Orientation();
//
if (!myImagesFaces.HasImage(aFS)) {
- myQueryShapes.Add(aFS);
- //modified by NIZNHY-PKV Mon Jan 24 09:50:42 2005 f
- if (!myModifiedFaces.IsBound(aFS)) {
- TopTools_ListOfShape aLS;
- //
- aLS.Append(aFS);
- myModifiedFaces.Bind(aFS, aLS);
- }
- //modified by NIZNHY-PKV Mon Jan 24 09:50:44 2005 t
- continue;
+ myQueryShapes.Add(aFS);
+ //modified by NIZNHY-PKV Mon Jan 24 09:50:42 2005 f
+ if (!myModifiedFaces.IsBound(aFS)) {
+ TopTools_ListOfShape aLS;
+ //
+ aLS.Append(aFS);
+ myModifiedFaces.Bind(aFS, aLS);
+ }
+ //modified by NIZNHY-PKV Mon Jan 24 09:50:44 2005 t
+ continue;
}
//
const TopTools_ListOfShape& aLFI=myImagesFaces.Image(aFS);
aItFI.Initialize(aLFI);
for (; aItFI.More(); aItFI.Next()) {
- const TopoDS_Face& aFI=TopoDS::Face(aItFI.Value());
- aFIx=aFI;
- aFIx.Orientation(aOriFS);
- //
- if (mySDFaces.Contains(aFIx)) {
- const TopoDS_Face& aFSDI=TopoDS::Face(mySDFaces.FindFromKey(aFIx));
- TopoDS_Face aFSDIx=aFSDI;
- //
- iSense=NMTAlgo_Tools::Sense(aFIx, aFSDIx);
- //
- if (iSense < 0) {
- aFSDIx.Reverse();
- }
- myQueryShapes.Add(aFSDIx);
- //modified by NIZNHY-PKV Mon Jan 24 09:56:06 2005f
- aFIy=aFSDIx;
- //modified by NIZNHY-PKV Mon Jan 24 09:56:09 2005t
- }
- else {
- myQueryShapes.Add(aFIx);
- //modified by NIZNHY-PKV Mon Jan 24 09:56:06 2005f
- aFIy=aFIx;
- //modified by NIZNHY-PKV Mon Jan 24 09:56:09 2005t
- }
- //modified by NIZNHY-PKV Mon Jan 24 09:53:38 2005f
- if (!myModifiedFaces.IsBound(aFS)) {
- TopTools_ListOfShape aLS;
- //
- aLS.Append(aFIy);
- myModifiedFaces.Bind(aFS, aLS);
- }
- else {
- TopTools_ListOfShape& aLS=myModifiedFaces.ChangeFind(aFS);
- aLS.Append(aFIy);
- }
- //modified by NIZNHY-PKV Mon Jan 24 09:53:43 2005t
+ const TopoDS_Face& aFI=TopoDS::Face(aItFI.Value());
+ aFIx=aFI;
+ aFIx.Orientation(aOriFS);
+ //
+ if (mySDFaces.Contains(aFIx)) {
+ const TopoDS_Face& aFSDI=TopoDS::Face(mySDFaces.FindFromKey(aFIx));
+ TopoDS_Face aFSDIx=aFSDI;
+ //
+ iSense=NMTAlgo_Tools::Sense(aFIx, aFSDIx);
+ //
+ if (iSense < 0) {
+ aFSDIx.Reverse();
+ }
+ myQueryShapes.Add(aFSDIx);
+ //modified by NIZNHY-PKV Mon Jan 24 09:56:06 2005f
+ aFIy=aFSDIx;
+ //modified by NIZNHY-PKV Mon Jan 24 09:56:09 2005t
+ }
+ else {
+ myQueryShapes.Add(aFIx);
+ //modified by NIZNHY-PKV Mon Jan 24 09:56:06 2005f
+ aFIy=aFIx;
+ //modified by NIZNHY-PKV Mon Jan 24 09:56:09 2005t
+ }
+ //modified by NIZNHY-PKV Mon Jan 24 09:53:38 2005f
+ if (!myModifiedFaces.IsBound(aFS)) {
+ TopTools_ListOfShape aLS;
+ //
+ aLS.Append(aFIy);
+ myModifiedFaces.Bind(aFS, aLS);
+ }
+ else {
+ TopTools_ListOfShape& aLS=myModifiedFaces.ChangeFind(aFS);
+ aLS.Append(aFIy);
+ }
+ //modified by NIZNHY-PKV Mon Jan 24 09:53:43 2005t
}
}//for (; aExp.More(); aExp.Next()) {
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTAlgo_Splitter1.cxx
-// Created: Wed Feb 11 14:26:27 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTAlgo_Splitter1.cxx
+// Created: Wed Feb 11 14:26:27 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTAlgo_Splitter1.ixx>
#include <NMTAlgo_Splitter.hxx>
//purpose :
//=======================================================================
void NMTAlgo_Splitter1::SetMaterial(const TopoDS_Shape& aS,
- const Standard_Integer iMt)
+ const Standard_Integer iMt)
{
TopExp_Explorer aExp;
//
//purpose :
//=======================================================================
void NMTAlgo_Splitter1::AddTool(const TopoDS_Shape& aS)
-
+
{
SetMaterial(aS, 0);
NMTAlgo_Splitter::AddTool(aS);
const TopoDS_Shape& aS=aIt.Value();
if (aS.ShapeType()==TopAbs_SOLID){
if (myMapSWMOut.IsBound(aS)) {
- continue;
+ continue;
}
}
myBuilder.Add(aR, aS);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aIF=aIt.Value();
if (aMFS.Contains(aIF)) {
- const TopTools_ListOfShape& aLS=aMFS.FindFromKey(aIF);
- aItLS.Initialize(aLS);
- for ( ;aItLS.More(); aItLS.Next()) {
- const TopoDS_Shape& aSd=aItLS.Value();
- if (!aMSd.Contains(aSd)) {
- aMSd.Add(aSd);
- }
- }
+ const TopTools_ListOfShape& aLS=aMFS.FindFromKey(aIF);
+ aItLS.Initialize(aLS);
+ for ( ;aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aSd=aItLS.Value();
+ if (!aMSd.Contains(aSd)) {
+ aMSd.Add(aSd);
+ }
+ }
}
}
//
//aMSd.Add(aSd);
bFound=NMTAlgo_Tools::FindImageSolid(aFC, aMSo, aSd);
if (!aSd.IsNull()) {
- aMSd.Add(aSd);
+ aMSd.Add(aSd);
}
//modified by NIZNHY-PKV Thu Dec 23 15:09:02 2004 t
}
const TopoDS_Shape& aSdx=aMSdx(j);
//
if (aMFS.Contains(aSdx)) {
- TopTools_ListOfShape& aLS=aMFS.ChangeFromKey(aSdx);
- aLS.Append(aSd);
+ TopTools_ListOfShape& aLS=aMFS.ChangeFromKey(aSdx);
+ aLS.Append(aSd);
}
else {
- TopTools_ListOfShape aLS;
- aLS.Append(aSd);
- aMFS.Add(aSdx, aLS);
+ TopTools_ListOfShape aLS;
+ aLS.Append(aSd);
+ aMFS.Add(aSdx, aLS);
}
}
}
const TopoDS_Shape& aSd=aItLS.Value();
//
if (!myMapSWM.IsBound(aSd)){
- continue;
+ continue;
}
//
nMt=myMapSWM.Find(aSd);
if (!j) {
- nMtMax=nMt;
- continue;
+ nMtMax=nMt;
+ continue;
}
if (nMt>nMtMax) {
- nMtMax=nMt;
+ nMtMax=nMt;
}
}
myMapSWMOut.Bind(aSdx, nMtMax);
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTAlgo_Splitter_1.cxx
-// Created: Mon Feb 2 14:58:54 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTAlgo_Splitter_1.cxx
+// Created: Mon Feb 2 14:58:54 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTAlgo_Splitter.ixx>
//
static
void RefineShells(const TopoDS_Shape& ,
- TopTools_ListOfShape&);
+ TopTools_ListOfShape&);
static
void RefineSolids(const TopoDS_Shape& ,
- TopTools_ListOfShape&);
+ TopTools_ListOfShape&);
static
void GetPlanes (const TopoDS_Edge& anEx,
- const TopTools_IndexedDataMapOfShapeListOfShape& anEFMapx,
- const TopoDS_Face& aF1,
- TopAbs_State& aStPF1);
+ const TopTools_IndexedDataMapOfShapeListOfShape& anEFMapx,
+ const TopoDS_Face& aF1,
+ TopAbs_State& aStPF1);
//=======================================================================
//function : ShellsAndSolids
//purpose : split S into compound of shells
//=======================================================================
void NMTAlgo_Splitter::MakeShells(const TopoDS_Shape& aS,
- TopTools_ListOfShape& aLNS)
+ TopTools_ListOfShape& aLNS)
{
NMTAlgo_Loop3d aShellMaker;
//
//purpose : make solids out of Shells
//=======================================================================
void NMTAlgo_Splitter::MakeSolids(const TopoDS_Shape& theSolid,
- TopTools_ListOfShape& theShellList)
+ TopTools_ListOfShape& theShellList)
{
// for a solid wrapping other shells or solids without intersection,
// it is necessary to find shells making holes in it
// <All> makes return already added faces
//=======================================================================
TopoDS_Shape NMTAlgo_Splitter::FindFacesInside(const TopoDS_Shape& theShape,
- const Standard_Boolean CheckClosed,
- const Standard_Boolean All)
+ const Standard_Boolean CheckClosed,
+ const Standard_Boolean All)
{
TopExp_Explorer expl;
TopAbs_State aState;
// add to DMSEFP edges that are new
expl.Init(aF1, TopAbs_EDGE);
for (; expl.More(); expl.Next()) {
- TopoDS_Shape aE1 = expl.Current();
- if ( MSE.Contains(aE1)) {// section edge
- if (!DMSEFP.IsBound(aE1)) {
- DMSEFP.Bind(aE1, EmptyL);
- }
- DMSEFP(aE1).Append(aF1);
- }
+ TopoDS_Shape aE1 = expl.Current();
+ if ( MSE.Contains(aE1)) {// section edge
+ if (!DMSEFP.IsBound(aE1)) {
+ DMSEFP.Bind(aE1, EmptyL);
+ }
+ DMSEFP(aE1).Append(aF1);
+ }
}
}
}//for (;itl.More(); itl.Next())
// remove aFace1 form DMSEFP and MFP
LSF.Remove( itl ); // == itl.Next();
if (!MFP.Remove(aFace1)) {
- continue; // was not is MFP (i.e already checked)
+ continue; // was not is MFP (i.e already checked)
}
//
// check if aFace1 was already added to 2 shells
if (!All &&
- myAddedFacesMap.Contains(aFace1) &&
- myAddedFacesMap.Contains(aFace1.Reversed())) {
- skipAlreadyAdded = Standard_True;
+ myAddedFacesMap.Contains(aFace1) &&
+ myAddedFacesMap.Contains(aFace1.Reversed())) {
+ skipAlreadyAdded = Standard_True;
}
//
//xf
if (aMFCSF.Contains(aFace1)) {
- // the face aFace1 can not be inside CSF
- // if CSF contains the aFace1
- continue;
+ // the face aFace1 can not be inside CSF
+ // if CSF contains the aFace1
+ continue;
}
//xt
//
const TopTools_ListOfShape& FL = DMEF.FindFromKey(E); //faces of CSF sharing E
//
const TopoDS_Shape& origF1 = myImagesFaces.IsImage(FL.First()) ?
- myImagesFaces.Root(FL.First()) : FL.First();
+ myImagesFaces.Root(FL.First()) : FL.First();
//
const TopoDS_Shape& origF2 = myImagesFaces.IsImage(FL.Last()) ?
- myImagesFaces.Root(FL.Last()) : FL.Last();
+ myImagesFaces.Root(FL.Last()) : FL.Last();
//
sameDom1 = anOrigFace.IsSame( origF1 );
sameDom2 = anOrigFace.IsSame( origF2 );
//
if (!(sameDom1 || sameDom2) && HasSameDomainF( TopoDS::Face(anOrigFace) )) {
- sameDom1 = IsSameDomainF( TopoDS::Face(anOrigFace), TopoDS::Face(origF1));
+ sameDom1 = IsSameDomainF( TopoDS::Face(anOrigFace), TopoDS::Face(origF1));
if (origF1 == origF2) {
sameDom2 = sameDom1;
- }
+ }
}
if (sameDom1 && sameDom2){
- continue;
+ continue;
}
//
if (sameDom1 || sameDom2) {
- inside = NMTAlgo_Loop3d::IsInside (E,
- TopoDS::Face(FL.First()),
- TopoDS::Face(FL.Last()),
- 1, dot, GoodOri);
- if (inside || (dot + Precision::Angular() >= 1.0)) {
- continue; // E is convex between origF1 and origF2 or they are tangent
- }
+ inside = NMTAlgo_Loop3d::IsInside (E,
+ TopoDS::Face(FL.First()),
+ TopoDS::Face(FL.Last()),
+ 1, dot, GoodOri);
+ if (inside || (dot + Precision::Angular() >= 1.0)) {
+ continue; // E is convex between origF1 and origF2 or they are tangent
+ }
}
//
GetPlanes(E, DMEF, aFace1, aState);
if (aState==TopAbs_IN) {
- KeepFaces.Append(aFace1);
+ KeepFaces.Append(aFace1);
}
} //while (itl.More()) {
} //for (; Mapit.More() ; Mapit.Next() )
if (isSolid && myClosedShapes.Contains(anOrigShape)) {
// to make a special care at solid reconstruction
myWrappingSolid.Add ( theShape );
- }
+ }
// keep faces of an internal shape anOrigShape
KeptFaces.Append( aSplitFaceL );
}
MFP.Add( F );
// remove bad face from DMEF
for (expl.Init( F, TopAbs_EDGE); expl.More(); expl.Next()) {
- const TopoDS_Shape& E = expl.Current();
+ const TopoDS_Shape& E = expl.Current();
TopTools_ListOfShape& FL = DMEF.ChangeFromKey( E );
for (itl.Initialize( FL ); itl.More(); itl.Next() ) {
if ( F.IsSame( itl.Value() )) {
TopoDS_Shape & aIntFace = itl.Value();
//
if (!All &&
- myAddedFacesMap.Contains(aIntFace) &&
- myAddedFacesMap.Contains(aIntFace.Reversed())) {
+ myAddedFacesMap.Contains(aIntFace) &&
+ myAddedFacesMap.Contains(aIntFace.Reversed())) {
continue;
}
//
for (; itl.More(); itl.Next() ) {
TopoDS_Shape & aIntFace = itl.Value();
if (! MFP.Contains(aIntFace )){
- myBuilder.Add(aCIF, aIntFace);
+ myBuilder.Add(aCIF, aIntFace);
}
}
myMapSIFC.Bind(theShape, aCIF);
// If S1.IsNull(), check infinite point against S2.
//=======================================================================
Standard_Boolean NMTAlgo_Splitter::IsInside (const TopoDS_Shape& theS1,
- const TopoDS_Shape& theS2)
+ const TopoDS_Shape& theS2)
{
BRepClass3d_SolidClassifier aClassifier( theS2 );
//
//purpose :
//=======================================================================
void RefineShells(const TopoDS_Shape& aS,
- TopTools_ListOfShape& aLNS)
+ TopTools_ListOfShape& aLNS)
{
Standard_Boolean bFound;
Standard_Integer iS, jS, aNbSOrs, aNbSIms, aNbFOrs, aNbFIms, kFOrs, aNb;
for (jS=1; jS<=aNbSIms; ++jS) {
const TopoDS_Shape& aSIm=aMSIms(jS);
if (aMImOr.Contains(aSIm)) {
- continue;
+ continue;
}
//
aMFIms.Clear();
aNbFIms=aMFIms.Extent();
//
if (aNbFIms==aNbFOrs) {
- bFound=Standard_True;
- for (kFOrs=1; kFOrs<=aNbFOrs; ++kFOrs) {
- const TopoDS_Shape& aFOr=aMFOrs(kFOrs);
- if (!aMFIms.Contains(aFOr)) {
- bFound=Standard_False;
- break; //next aSIm
- }
- }
- if (bFound){
- aMImOr.Add(aSIm, aSOr);
- break; //next aSOr
- }
+ bFound=Standard_True;
+ for (kFOrs=1; kFOrs<=aNbFOrs; ++kFOrs) {
+ const TopoDS_Shape& aFOr=aMFOrs(kFOrs);
+ if (!aMFIms.Contains(aFOr)) {
+ bFound=Standard_False;
+ break; //next aSIm
+ }
+ }
+ if (bFound){
+ aMImOr.Add(aSIm, aSOr);
+ break; //next aSOr
+ }
} //if (aNbFIms==aNbFOrs)
}
}
//purpose :
//=======================================================================
void RefineSolids(const TopoDS_Shape& aSolidOr,
- TopTools_ListOfShape& aLNS)
+ TopTools_ListOfShape& aLNS)
{
Standard_Integer aNb, iS, aNbSOrs, aNbSIms;
TopoDS_Shape aSolidIm;
//purpose :
//=======================================================================
void GetPlanes (const TopoDS_Edge& anEx,
- const TopTools_IndexedDataMapOfShapeListOfShape& anEFMapx,
- const TopoDS_Face& aF1,
- TopAbs_State& aStPF1)
-
+ const TopTools_IndexedDataMapOfShapeListOfShape& anEFMapx,
+ const TopoDS_Face& aF1,
+ TopAbs_State& aStPF1)
+
{
Standard_Boolean bIsAdjExists;
Standard_Real aT, aT1, aT2;
//modified by NIZNHY-PKV Fri Feb 25 17:00:03 2005t XX
/*
- A
+ A
//
TopoDS_Shape aFace2;
if ( !isSectionE ) {
while (itl.More()) {
aFace2 = itl.Value();
- //
- TopoDS_Shape anOrigFace2 = aFace2;
- if (myImagesFaces.IsImage(aFace2)) {
- anOrigFace2 = myImagesFaces.Root(aFace2);
- }
- //
+ //
+ TopoDS_Shape anOrigFace2 = aFace2;
+ if (myImagesFaces.IsImage(aFace2)) {
+ anOrigFace2 = myImagesFaces.Root(aFace2);
+ }
+ //
if (!MFP.Contains( aFace2 )) {
LSF.Remove( itl );
continue;
//if (anOrigFace.IsSame( myImagesFaces.Root( aFace2 )))
if (anOrigFace.IsSame(anOrigFace2)) {
break;
- }
+ }
itl.Next();
}
if (itl.More()) { // aFace2 found, remove it from maps
}
else{
aFace2.Nullify();
- }
+ }
itl.Initialize( LSF );
}
*/
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTAlgo_Splitter_2.cxx
-// Created: Mon Feb 9 15:07:51 2004
-// Author: Igor FEOKTISTOV
-// <ifv@philipox.nnov.matra-dtv.fr>
+// File: NMTAlgo_Splitter_2.cxx
+// Created: Mon Feb 9 15:07:51 2004
+// Author: Igor FEOKTISTOV
+// <ifv@philipox.nnov.matra-dtv.fr>
//
#include <NMTAlgo_Splitter.ixx>
for (; expResF.More(); expResF.Next()) {
const TopoDS_Shape& aFR=expResF.Current();
if (!MIF.Contains(aFR)) {
- break;
+ break;
}
}
//
else {
// add faces of a removed shape to RFM
for (expResF.ReInit(); expResF.More(); expResF.Next()) {
- const TopoDS_Shape& aF = expResF.Current();
- if (!RFM.Remove(aF)) {
- RFM.Add(aF);
- }
+ const TopoDS_Shape& aF = expResF.Current();
+ if (!RFM.Remove(aF)) {
+ RFM.Add(aF);
+ }
}
}
}// for (; it.More(); it.Next())
//
itF.Initialize (RFM);
for ( ; itF.More(); itF.Next()) {
- const TopoDS_Shape& aF=itF.Key();
+ const TopoDS_Shape& aF=itF.Key();
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, MEF);
}
// add only faces forming a closed shell
for (itF.Reset() ; itF.More(); itF.Next()) {
- const TopoDS_Shape& aF=itF.Key();
+ const TopoDS_Shape& aF=itF.Key();
TopExp_Explorer expE (aF, TopAbs_EDGE);
for (; expE.More(); expE.Next()) {
if (MEF.FindFromKey(expE.Current()).Extent() == 1) {
break;
- }
- }
+ }
+ }
if (!expE.More()) {
myBuilder.Add( Shell, aF);
- }
- else {
- //int a=0;
- }
+ }
+ else {
+ //int a=0;
+ }
}
if (S.ShapeType() == TopAbs_SOLID) {
else {
it.Initialize(aSIm);
for (; it.More(); it.Next()) {
- myBuilder.Add (C, it.Value());
+ myBuilder.Add (C, it.Value());
}
}
}
anExp.Init(myShape, TopAbs_EDGE);
for(; anExp.More(); anExp.Next()) {
- aMap.Add(anExp.Current());
+ aMap.Add(anExp.Current());
}
for (; it.More(); it.Next()) {
- if(aMap.Contains(it.Value())) {
- myGenerated.Append(it.Value());
- }
+ if(aMap.Contains(it.Value())) {
+ myGenerated.Append(it.Value());
+ }
}
}
const TopoDS_Shape& aS = aDS.Shape(i);
if(S.IsSame(aS)) {
- anIndex = i;
- break;
+ anIndex = i;
+ break;
}
}
if(ind1 == anIndex || ind2 == anIndex) {
- Standard_Integer aNSI = aES.NewShape();
- if(aDS.GetShapeType(aNSI) == TopAbs_VERTEX) {
- myGenerated.Append(aDS.Shape(aNSI));
- bCheckVert = Standard_True;
- }
+ Standard_Integer aNSI = aES.NewShape();
+ if(aDS.GetShapeType(aNSI) == TopAbs_VERTEX) {
+ myGenerated.Append(aDS.Shape(aNSI));
+ bCheckVert = Standard_True;
+ }
}
}
-
+
if(bCheckVert) {
aMap.Clear();
anExp.Init(myShape, TopAbs_VERTEX);
for(; anExp.More(); anExp.Next()) {
- aMap.Add(anExp.Current());
+ aMap.Add(anExp.Current());
}
it.Initialize(myGenerated);
for (; it.More(); it.Next()) {
- if(it.Value().ShapeType() != TopAbs_VERTEX) continue;
-
- if(!aMap.Contains(it.Value())) {
- myGenerated.Remove(it);
- }
+ if(it.Value().ShapeType() != TopAbs_VERTEX) continue;
+
+ if(!aMap.Contains(it.Value())) {
+ myGenerated.Remove(it);
+ }
}
}
const TopoDS_Shape& aS = aDS.Shape(i);
if(S.IsSame(aS)) {
- anIndex = i;
- break;
+ anIndex = i;
+ break;
}
}
if(ind1 == anIndex || ind2 == anIndex) {
- Standard_Integer aNSI = aEE.NewShape();
- if(aDS.GetShapeType(aNSI) == TopAbs_VERTEX) {
- myGenerated.Append(aDS.Shape(aNSI));
- bCheckVert = Standard_True;
- }
+ Standard_Integer aNSI = aEE.NewShape();
+ if(aDS.GetShapeType(aNSI) == TopAbs_VERTEX) {
+ myGenerated.Append(aDS.Shape(aNSI));
+ bCheckVert = Standard_True;
+ }
}
-
+
}
const BOPTools_CArray1OfESInterference& aESs = anIP->ESInterferences();
if(ind1 == anIndex || ind2 == anIndex) {
- Standard_Integer aNSI = aES.NewShape();
- if(aDS.GetShapeType(aNSI) == TopAbs_VERTEX) {
- myGenerated.Append(aDS.Shape(aNSI));
- bCheckVert = Standard_True;
- }
+ Standard_Integer aNSI = aES.NewShape();
+ if(aDS.GetShapeType(aNSI) == TopAbs_VERTEX) {
+ myGenerated.Append(aDS.Shape(aNSI));
+ bCheckVert = Standard_True;
+ }
}
-
+
}
if(bCheckVert) {
anExp.Init(myShape, TopAbs_VERTEX);
for(; anExp.More(); anExp.Next()) {
- aMap.Add(anExp.Current());
+ aMap.Add(anExp.Current());
}
it.Initialize(myGenerated);
for (; it.More(); it.Next()) {
- if(!aMap.Contains(it.Value())) {
- myGenerated.Remove(it);
- }
+ if(!aMap.Contains(it.Value())) {
+ myGenerated.Remove(it);
+ }
}
}
return myGenerated;
//purpose :
//=======================================================================
void NMTAlgo_Splitter::FindImage(const TopoDS_Shape& aS,
- TopTools_ListOfShape& aLIms)
+ TopTools_ListOfShape& aLIms)
{
TopAbs_ShapeEnum aType;
//
//
aIt.Initialize(aIFC);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aIF=aIt.Value();
- if (aMFS.Contains(aIF)) {
- const TopTools_ListOfShape& aLS=aMFS.FindFromKey(aIF);
- //
- aItLS.Initialize(aLS);
- for (; aItLS.More(); aItLS.Next()) {
- const TopoDS_Shape& aSx=aItLS.Value();
- aMSd.Add(aSx);
- }
- }
+ const TopoDS_Shape& aIF=aIt.Value();
+ if (aMFS.Contains(aIF)) {
+ const TopTools_ListOfShape& aLS=aMFS.FindFromKey(aIF);
+ //
+ aItLS.Initialize(aLS);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aSx=aItLS.Value();
+ aMSd.Add(aSx);
+ }
+ }
}
//
aNbSd=aMSd.Extent();
if (aNbSd) {
- for (i=1; i<=aNbSd; ++i) {
- const TopoDS_Shape& aSx=aMSd(i);
- if (!aSx.IsSame(aS)) {
- aLIms.Append(aSx);
- }
- }
- return;
+ for (i=1; i<=aNbSd; ++i) {
+ const TopoDS_Shape& aSx=aMSd(i);
+ if (!aSx.IsSame(aS)) {
+ aLIms.Append(aSx);
+ }
+ }
+ return;
}
}
//
bHasImage=NMTAlgo_Tools::FindImageSolid(aFC, aMSo, aSd);
if (bHasImage) {
if (!aSd.IsSame(aS)) {
- aLIms.Append(aSd);
+ aLIms.Append(aSd);
}
}
} //if (aType==TopAbs_SOLID) {
if (myModifiedFaces.IsBound(aS)) {
anExp.Init(myShape, aType);
for(; anExp.More(); anExp.Next()) {
- aMap.Add(anExp.Current());
+ aMap.Add(anExp.Current());
}
//
const TopTools_ListOfShape& aLS=myModifiedFaces.Find(aS);
aIt.Initialize(aLS);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aFx=aIt.Value();
- if (!aFx.IsSame(aS)) {
- if (aMap.Contains(aFx)) {
- aLIms.Append(aFx);
- }
- }
+ const TopoDS_Shape& aFx=aIt.Value();
+ if (!aFx.IsSame(aS)) {
+ if (aMap.Contains(aFx)) {
+ aLIms.Append(aFx);
+ }
+ }
}
}
} // else if (aType==TopAbs_FACE)
if (myImagesEdges.HasImage(aS)) {
anExp.Init(myShape, aType);
for(; anExp.More(); anExp.Next()) {
- aMap.Add(anExp.Current());
+ aMap.Add(anExp.Current());
}
//
const TopTools_ListOfShape& aLE=myImagesEdges.Image(aS);
aIt.Initialize(aLE);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aEx=aIt.Value();
- if (!aEx.IsSame(aS)) {
- if(aMap.Contains(aEx)) {
- aLIms.Append(aEx);
- }
- }
+ const TopoDS_Shape& aEx=aIt.Value();
+ if (!aEx.IsSame(aS)) {
+ if(aMap.Contains(aEx)) {
+ aLIms.Append(aEx);
+ }
+ }
}
}
}// else if (aType==TopAbs_EDGE)
for(i=1; i<=aNbS; ++i) {
const TopoDS_Shape& aSx = aDS.Shape(i);
if(aS.IsSame(aSx)) {
- anIndex = i;
- break;
+ anIndex = i;
+ break;
}
}
//
for(; anExp.More(); anExp.Next()) {
const TopoDS_Shape& aVx=anExp.Current();
if(aSDV.IsSame(aVx)) {
- aLIms.Append(aSDV);
- break;
+ aLIms.Append(aSDV);
+ break;
}
}
}// else if (aType==TopAbs_VERTEX)
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTAlgo_Tools.cxx
-// Created: Fri Jan 30 16:30:45 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTAlgo_Tools.cxx
+// Created: Fri Jan 30 16:30:45 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTAlgo_Tools.ixx>
// purpose:
//=======================================================================
Standard_Integer NMTAlgo_Tools::Sense (const TopoDS_Face& aF1,
- const TopoDS_Face& aF2)
+ const TopoDS_Face& aF2)
{
Standard_Integer iSense=0;
gp_Dir aDNF1, aDNF2;
aE1=TopoDS::Edge(anExp.Current());
if (!BRep_Tool::Degenerated(aE1)) {
if (!BRep_Tool::IsClosed(aE1, aF1)) {
- break;
+ break;
}
}
}
aE2=TopoDS::Edge(anExp.Current());
if (!BRep_Tool::Degenerated(aE2)) {
if (!BRep_Tool::IsClosed(aE2, aF2)) {
- if (aE2.IsSame(aE1)) {
- iSense=1;
- break;
- }
+ if (aE2.IsSame(aE1)) {
+ iSense=1;
+ break;
+ }
}
}
}
// purpose:
//=======================================================================
void NMTAlgo_Tools::OrientFacesOnShell (const TopoDS_Face& aF1,
- TopoDS_Shell& aSh)
+ TopoDS_Shell& aSh)
{
Standard_Integer aNbFSh, iSenseFlag;
gp_Dir aDNF1, aDNF2;
//
iSenseFlag=BOPTools_Tools3D::SenseFlag(aDNF1, aDNF2);
if (iSenseFlag==1) {
- return;
+ return;
}
//
anExp.Init(aSh, TopAbs_FACE);
for (; anExp.More(); anExp.Next()) {
- const TopoDS_Shape& aFx=anExp.Current();
- TopoDS_Shape *pFx=(TopoDS_Shape *)&aFx;
- pFx->Reverse();
+ const TopoDS_Shape& aFx=anExp.Current();
+ TopoDS_Shape *pFx=(TopoDS_Shape *)&aFx;
+ pFx->Reverse();
}
}
}
// purpose:
//=======================================================================
void NMTAlgo_Tools::OrientFacesOnShell (const TopoDS_Shell& aShell,
- TopoDS_Shell& aShellNew)
+ TopoDS_Shell& aShellNew)
{
Standard_Boolean bIsProcessed1, bIsProcessed2;
Standard_Integer i, aNbE, aNbF, j;
TopTools_ListIteratorOfListOfShape anIt(aLF);
for (; anIt.More(); anIt.Next()) {
- const TopoDS_Shape& aF=anIt.Value();
- if (!aFM.Contains(aF)) {
- aFM.Add(aF);
- aLFTmp.Append(aF);
- }
+ const TopoDS_Shape& aF=anIt.Value();
+ if (!aFM.Contains(aF)) {
+ aFM.Add(aF);
+ aLFTmp.Append(aF);
+ }
}
aLF.Clear();
aLF=aLFTmp;
bIsProcessed2=aProcessedFaces.Contains(aF2);
if (bIsProcessed1 && bIsProcessed2) {
- continue;
+ continue;
}
if (!bIsProcessed1 && !bIsProcessed2) {
- aProcessedFaces.Add(aF1);
- aBB.Add(aShellNew, aF1);
+ aProcessedFaces.Add(aF1);
+ aBB.Add(aShellNew, aF1);
- bIsProcessed1=!bIsProcessed1;
+ bIsProcessed1=!bIsProcessed1;
}
//
aF1x=aF1;
if (bIsProcessed1) {
- j=aProcessedFaces.FindIndex(aF1);
- aF1x=TopoDS::Face(aProcessedFaces.FindKey(j));
+ j=aProcessedFaces.FindIndex(aF1);
+ aF1x=TopoDS::Face(aProcessedFaces.FindKey(j));
}
aF2x=aF2;
if (bIsProcessed2) {
- j=aProcessedFaces.FindIndex(aF2);
- aF2x=TopoDS::Face(aProcessedFaces.FindKey(j));
+ j=aProcessedFaces.FindIndex(aF2);
+ aF2x=TopoDS::Face(aProcessedFaces.FindKey(j));
}
//
anOrE2=NMTAlgo_Tools::Orientation(aE, aF2x);
if (bIsProcessed1 && !bIsProcessed2) {
-
- if (anOrE1==anOrE2) {
- if (!BRep_Tool::IsClosed(aE, aF1) &&
- !BRep_Tool::IsClosed(aE, aF2)) {
- aF2.Reverse();
- }
- }
- aProcessedFaces.Add(aF2);
- aBB.Add(aShellNew, aF2);
+
+ if (anOrE1==anOrE2) {
+ if (!BRep_Tool::IsClosed(aE, aF1) &&
+ !BRep_Tool::IsClosed(aE, aF2)) {
+ aF2.Reverse();
+ }
+ }
+ aProcessedFaces.Add(aF2);
+ aBB.Add(aShellNew, aF2);
}
else if (!bIsProcessed1 && bIsProcessed2) {
- if (anOrE1==anOrE2) {
- if (!BRep_Tool::IsClosed(aE, aF1) &&
- !BRep_Tool::IsClosed(aE, aF2)) {
- aF1.Reverse();
- }
- }
- aProcessedFaces.Add(aF1);
- aBB.Add(aShellNew, aF1);
+ if (anOrE1==anOrE2) {
+ if (!BRep_Tool::IsClosed(aE, aF1) &&
+ !BRep_Tool::IsClosed(aE, aF2)) {
+ aF1.Reverse();
+ }
+ }
+ aProcessedFaces.Add(aF1);
+ aBB.Add(aShellNew, aF1);
}
}
}
if (aNbF!=2) {
TopTools_ListIteratorOfListOfShape anIt(aLF);
for(; anIt.More(); anIt.Next()) {
- const TopoDS_Face& aF=TopoDS::Face(anIt.Value());
- if (!aProcessedFaces.Contains(aF)) {
- aProcessedFaces.Add(aF);
- aBB.Add(aShellNew, aF);
- }
+ const TopoDS_Face& aF=TopoDS::Face(anIt.Value());
+ if (!aProcessedFaces.Contains(aF)) {
+ aProcessedFaces.Add(aF);
+ aBB.Add(aShellNew, aF);
+ }
}
}
}
//purpose :
//=======================================================================
TopAbs_Orientation NMTAlgo_Tools::Orientation(const TopoDS_Edge& anE,
- const TopoDS_Face& aF)
+ const TopoDS_Face& aF)
{
TopAbs_Orientation anOr=TopAbs_INTERNAL;
// If S1.IsNull(), check infinite point against S2.
//=======================================================================
Standard_Boolean NMTAlgo_Tools::IsInside (const TopoDS_Shape& theS1,
- const TopoDS_Shape& theS2)
+ const TopoDS_Shape& theS2)
{
BRepClass3d_SolidClassifier aClassifier( theS2 );
//
//purpose :
//=======================================================================
void NMTAlgo_Tools::MakeShells (const TopoDS_Shape& aFC,
- TopTools_ListOfShape& aLNS)
+ TopTools_ListOfShape& aLNS)
{
NMTAlgo_Loop3d aShellMaker;
TopTools_MapOfOrientedShape aMTmp;
//purpose :
//=======================================================================
void NMTAlgo_Tools::MakeSolids(const TopoDS_Shape& aFC,
- TopTools_ListOfShape& theShellList)
+ TopTools_ListOfShape& theShellList)
{
NMTAlgo_Tools::MakeShells(aFC, theShellList);
NMTAlgo_Tools::MakeSolids(theShellList);
//purpose :
//=======================================================================
void NMTAlgo_Tools::BreakWebs(const TopoDS_Shape& aCS,
- TopoDS_Shape& aCSR)
+ TopoDS_Shape& aCSR)
{
Standard_Integer i, aNbF, aNbS;
TopTools_IndexedDataMapOfShapeListOfShape aMFS;
//purpose :
//=======================================================================
Standard_Boolean NMTAlgo_Tools::FindImageSolid(const TopoDS_Shape& aFC,
- const TopTools_IndexedMapOfShape& aMSo,
- TopoDS_Shape& aSox)
+ const TopTools_IndexedMapOfShape& aMSo,
+ TopoDS_Shape& aSox)
{
Standard_Boolean bFound=Standard_False;
Standard_Integer i, j, aNbSo, aNbF, aNbFSo;
for (j=1; j<=aNbFSo; ++j) {
const TopoDS_Shape& aFSo=aMFSo(j);
if (!aMFC.Contains(aFSo)) {
- bFound=Standard_False;
- break;
+ bFound=Standard_False;
+ break;
}
}
if (bFound) {
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_BoxBndTree.cxx
-// Created: Tue Oct 17 13:04:11 2006
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_BoxBndTree.cxx
+// Created: Tue Oct 17 13:04:11 2006
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTDS_BoxBndTree.hxx>
//=======================================================================
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_BoxBndTree.hxx
-// Created: Tue Oct 17 12:50:31 2006
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_BoxBndTree.hxx
+// Created: Tue Oct 17 12:50:31 2006
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#ifndef NMTDS_BoxBndTree_HeaderFile
#define NMTDS_BoxBndTree_HeaderFile
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger",
- sizeof(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_IndexRange.cxx
-// Created: Fri Nov 28 10:34:59 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_IndexRange.cxx
+// Created: Fri Nov 28 10:34:59 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTDS_IndexRange.ixx>
//=======================================================================
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger",
- sizeof(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape",
- sizeof(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox",
- sizeof(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_.InterfPoolcxx
-// Created: Wed Feb 21 10:35:35 2007
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_.InterfPoolcxx
+// Created: Wed Feb 21 10:35:35 2007
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTDS_InterfPool.ixx>
#include <NMTDS_PassKeyBoolean.hxx>
//purpose :
//=======================================================================
Standard_Boolean NMTDS_InterfPool::Add (const NMTDS_PassKeyBoolean& aPKB,
- const NMTDS_InterfType aType)
+ const NMTDS_InterfType aType)
{
Standard_Boolean bRet;
Standard_Integer iType;
//purpose :
//=======================================================================
Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
- const Standard_Integer aInd2,
- const NMTDS_InterfType aType)
+ const Standard_Integer aInd2,
+ const NMTDS_InterfType aType)
{
NMTDS_PassKeyBoolean aPKB;
//
//purpose :
//=======================================================================
Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
- const Standard_Integer aInd2,
- const Standard_Boolean bFlag,
- const NMTDS_InterfType aType)
+ const Standard_Integer aInd2,
+ const Standard_Boolean bFlag,
+ const NMTDS_InterfType aType)
{
NMTDS_PassKeyBoolean aPKB;
//
//purpose :
//=======================================================================
Standard_Boolean NMTDS_InterfPool::Contains(const Standard_Integer aInd1,
- const Standard_Integer aInd2)const
+ const Standard_Integer aInd2)const
{
NMTDS_PassKeyBoolean aPKB;
//
const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
aPKB.Ids(n1, n2);
if(n1==aInd || n2==aInd) {
- pL->Append(aPKB);
+ pL->Append(aPKB);
}
}
}
//purpose :
//=======================================================================
const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd,
- const NMTDS_InterfType aType)const
+ const NMTDS_InterfType aType)const
{
Standard_Integer n1, n2;
NMTDS_ListOfPassKeyBoolean *pL, aLPKB;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_Iterator.cxx
-// Created: Sun May 07 15:04:41 2006
-// Author: Peter KURNEV
+// File: NMTDS_Iterator.cxx
+// Created: Sun May 07 15:04:41 2006
+// Author: Peter KURNEV
//
#include <NMTDS_Iterator.ixx>
//
// purpose:
//=======================================================================
void NMTDS_Iterator::Initialize(const TopAbs_ShapeEnum aType1,
- const TopAbs_ShapeEnum aType2)
+ const TopAbs_ShapeEnum aType2)
{
Standard_Integer iX;
//
// purpose:
//=======================================================================
void NMTDS_Iterator::Current(Standard_Integer& aIndex1,
- Standard_Integer& aIndex2,
- Standard_Boolean& aWithSubShape) const
+ Standard_Integer& aIndex2,
+ Standard_Boolean& aWithSubShape) const
{
const NMTDS_PassKeyBoolean& aPKB=myIterator.Value();
aPKB.Ids(aIndex1, aIndex2);
const TopoDS_Shape& aSi=myDS->Shape(i);
aTi=aSi.ShapeType();
if (!NMTDS_Tools::HasBRep(aTi)){
- continue;
+ continue;
}
const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi);
aSelector.Clear();
aNbSD=aBBTree.Select(aSelector);
//
if (!aNbSD){
- continue;
+ continue;
}
//
const TColStd_ListOfInteger& aLI=aSelector.Indices();
//
aIt.Initialize(aLI);
for (; aIt.More(); aIt.Next()) {
- jB=aIt.Value(); // box index in MII
- j=aMII.Find(jB); // DS index
- if (j>=i1 && j<=i2) {
- continue;// same range
- }
- //
- aPKXB.SetIds(i, j);
- //
- if (aMPKXB.Add(aPKXB)) {
- bFlag=Standard_False;// Bounding boxes are intersected
- const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
- const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
- if (aBoxi.IsOut(aBoxj)) {
- bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
- }
- const TopoDS_Shape& aSj=myDS->Shape(j);
- aTj=aSj.ShapeType();
- iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
- //bFlag=(iStatus==2);
- aPKXB.SetFlag(bFlag);
- myLists[iX].Append(aPKXB);
- //
- // VSD prepare
- if (iX==5) { //VV
- aLV.Append(j);
- }
- }// if (aMPKXB.Add(aPKXB)) {
+ jB=aIt.Value(); // box index in MII
+ j=aMII.Find(jB); // DS index
+ if (j>=i1 && j<=i2) {
+ continue;// same range
+ }
+ //
+ aPKXB.SetIds(i, j);
+ //
+ if (aMPKXB.Add(aPKXB)) {
+ bFlag=Standard_False;// Bounding boxes are intersected
+ const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
+ const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
+ if (aBoxi.IsOut(aBoxj)) {
+ bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
+ }
+ const TopoDS_Shape& aSj=myDS->Shape(j);
+ aTj=aSj.ShapeType();
+ iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
+ //bFlag=(iStatus==2);
+ aPKXB.SetFlag(bFlag);
+ myLists[iX].Append(aPKXB);
+ //
+ // VSD prepare
+ if (iX==5) { //VV
+ aLV.Append(j);
+ }
+ }// if (aMPKXB.Add(aPKXB)) {
}// for (; aIt.More(); aIt.Next()) {
//
// VSD treatment
aNbLV=aLV.Extent();
if (aNbLV) {
- TColStd_ListOfInteger aLV1;
- //
- const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
- aIt.Initialize(aLV);
- for (; aIt.More(); aIt.Next()) {
- j=aIt.Value();
- const TopoDS_Shape& aSj=myDS->Shape(j);
- const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
- iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
- if (!iFlag) {
- aLV1.Append(j);
- }
- else {
- aPKXB.SetIds(i, j);
- aMPKXB.Remove(aPKXB);
- }
- }
- aMVSD.Bind(i, aLV1);
+ TColStd_ListOfInteger aLV1;
+ //
+ const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
+ aIt.Initialize(aLV);
+ for (; aIt.More(); aIt.Next()) {
+ j=aIt.Value();
+ const TopoDS_Shape& aSj=myDS->Shape(j);
+ const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
+ iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
+ if (!iFlag) {
+ aLV1.Append(j);
+ }
+ else {
+ aPKXB.SetIds(i, j);
+ aMPKXB.Remove(aPKXB);
+ }
+ }
+ aMVSD.Bind(i, aLV1);
}
}//for (i=i1; i<=i2; ++i) {
}//for (iR=1; iR<aNbR; ++iR) {
//purpose :
//=======================================================================
void NMTDS_Iterator::FillMVSD(const TColStd_DataMapOfIntegerListOfInteger& aMVSD,
- TColStd_DataMapOfIntegerListOfInteger& bMVSD)
+ TColStd_DataMapOfIntegerListOfInteger& bMVSD)
{
Standard_Boolean bFound;
Standard_Integer aNbVSD, iCnt, i, j, k;
iCnt=0;
aItj.Initialize(aDMIMI);
for (; aItj.More(); aItj.Next()) {
- j=aItj.Key();
- if (aMF.Contains(j)) {
- continue;
- }
- //
- //TColStd_MapOfInteger& aMIj=aDMIMI.ChangeFind(j);
- TColStd_MapOfInteger *pMj=(TColStd_MapOfInteger *)&aItj.Value();
- TColStd_MapOfInteger& aMIj=*pMj;
- //
- aItMI.Initialize(aMIj);
- for (; aItMI.More(); aItMI.Next()) {
- k=aItMI.Key();
- bFound=aMIi.Contains(k);
- if (bFound) {
- break;
- }
- }
- if (!bFound) {
- continue;
- }
- //
- aItMI.Initialize(aMIj);
- for (; aItMI.More(); aItMI.Next()) {
- k=aItMI.Key();
- aMIi.Add(k);
- }
- //
- if (aMF.Add(j)) {
- ++iCnt;
- }
+ j=aItj.Key();
+ if (aMF.Contains(j)) {
+ continue;
+ }
+ //
+ //TColStd_MapOfInteger& aMIj=aDMIMI.ChangeFind(j);
+ TColStd_MapOfInteger *pMj=(TColStd_MapOfInteger *)&aItj.Value();
+ TColStd_MapOfInteger& aMIj=*pMj;
+ //
+ aItMI.Initialize(aMIj);
+ for (; aItMI.More(); aItMI.Next()) {
+ k=aItMI.Key();
+ bFound=aMIi.Contains(k);
+ if (bFound) {
+ break;
+ }
+ }
+ if (!bFound) {
+ continue;
+ }
+ //
+ aItMI.Initialize(aMIj);
+ for (; aItMI.More(); aItMI.Next()) {
+ k=aItMI.Key();
+ aMIi.Add(k);
+ }
+ //
+ if (aMF.Add(j)) {
+ ++iCnt;
+ }
} //for (; aItj.More(); aItj.Next()) {
if (!iCnt) {
- break;
+ break;
}
} // while (1) {
//
aItMI.Initialize(aMIi);
for (; aItMI.More(); aItMI.Next()) {
k=aItMI.Key();
- if (k!=i) {
- aLV.Append(k);
- }
+ if (k!=i) {
+ aLV.Append(k);
+ }
}
bMVSD.Bind(i, aLV);
}// for (; aIti.More(); aIti.Next()) {
const TColStd_ListOfInteger& aLV=aItX.Value();
aIt.Initialize(aLV);
for (; aIt.More(); aIt.Next()) {
- j=aIt.Value();
- printf(" %d", j);
+ j=aIt.Value();
+ printf(" %d", j);
}
printf(")\n");
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_IteratorChecker.cxx
-// Created: Tue Feb 6 10:37:59 2007
-// Author: Peter KURNEV
+// File: NMTDS_IteratorChecker.cxx
+// Created: Tue Feb 6 10:37:59 2007
+// Author: Peter KURNEV
//
#include <NMTDS_IteratorCheckerSI.ixx>
aTi=aSi.ShapeType();
if (NMTDS_Tools::HasBRep(aTi)) {
if (aTi!=TopAbs_VERTEX) {
- TColStd_IndexedMapOfInteger aMA;
- //
- myDS->GetAllSuccessors(i, aMA);
- //
- aNbA=aMA.Extent();
- for (j=1; j<=aNbA; ++j) {
- iX=aMA(j);
- aPKXB.Clear();
- aPKXB.SetIds(i, iX);
- aMPA.Add(aPKXB);
- }
+ TColStd_IndexedMapOfInteger aMA;
+ //
+ myDS->GetAllSuccessors(i, aMA);
+ //
+ aNbA=aMA.Extent();
+ for (j=1; j<=aNbA; ++j) {
+ iX=aMA(j);
+ aPKXB.Clear();
+ aPKXB.SetIds(i, iX);
+ aMPA.Add(aPKXB);
+ }
}
else {
- aPKXB.Clear();
- aPKXB.SetIds(i, i);
- aMPA.Add(aPKXB);
+ aPKXB.Clear();
+ aPKXB.SetIds(i, i);
+ aMPA.Add(aPKXB);
}
//
Bnd_Box aBoxEx;
//
aPKXB.SetIds(i, j);
if (aMPA.Contains(aPKXB)) {
- continue;
+ continue;
}
//
if (aMPKXB.Add(aPKXB)) {
- bFlag=Standard_False;// Bounding boxes are intersected
- const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
- const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
- if (aBoxi.IsOut(aBoxj)) {
- bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
- }
- const TopoDS_Shape& aSj=myDS->Shape(j);
- aTj=aSj.ShapeType();
- iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
- //bFlag=(iStatus==2);
- aPKXB.SetFlag(bFlag);
- myLists[iX].Append(aPKXB);
- //
- // VSD prepare
- if (iX==5) { //VV
- aLV.Append(j);
- }
+ bFlag=Standard_False;// Bounding boxes are intersected
+ const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
+ const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
+ if (aBoxi.IsOut(aBoxj)) {
+ bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
+ }
+ const TopoDS_Shape& aSj=myDS->Shape(j);
+ aTj=aSj.ShapeType();
+ iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
+ //bFlag=(iStatus==2);
+ aPKXB.SetFlag(bFlag);
+ myLists[iX].Append(aPKXB);
+ //
+ // VSD prepare
+ if (iX==5) { //VV
+ aLV.Append(j);
+ }
}// if (aMPKXB.Add(aPKXB)) {
}// for (; aIt.More(); aIt.Next()) {
//
const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
aIt.Initialize(aLV);
for (; aIt.More(); aIt.Next()) {
- j=aIt.Value();
- const TopoDS_Shape& aSj=myDS->Shape(j);
- const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
- iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
- if (!iFlag) {
- aLV1.Append(j);
- }
- else {
- aPKXB.SetIds(i, j);
- aMPKXB.Remove(aPKXB);
- }
- }
+ j=aIt.Value();
+ const TopoDS_Shape& aSj=myDS->Shape(j);
+ const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
+ iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
+ if (!iFlag) {
+ aLV1.Append(j);
+ }
+ else {
+ aPKXB.SetIds(i, j);
+ aMPKXB.Remove(aPKXB);
+ }
+ }
aMVSD.Bind(i, aLV1);
}
}//for (i=1; i<=aNbS; ++i) {
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors",
- sizeof(NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTDS_ListNodeOfListOfPassKeyBoolean",
- sizeof(NMTDS_ListNodeOfListOfPassKeyBoolean),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTDS_ListNodeOfListOfPassKeyBoolean),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTDS_ListNodeOfListOfPassKey",
- sizeof(NMTDS_ListNodeOfListOfPassKey),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTDS_ListNodeOfListOfPassKey),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_Algo.cxx
-// Created: Sat Dec 04 12:39:47 2004
-// Author: Peter KURNEV
-// <peter@PREFEX>
+// File: NMTDS_Algo.cxx
+// Created: Sat Dec 04 12:39:47 2004
+// Author: Peter KURNEV
+// <peter@PREFEX>
//
#include <NMTDS_PassKey.ixx>
static
Standard_Integer NormalizedId(const Standard_Integer aId,
- const Standard_Integer aDiv);
+ const Standard_Integer aDiv);
//=======================================================================
//function :
//purpose :
//=======================================================================
void NMTDS_PassKey::SetIds(const Standard_Integer aId1)
-
+
{
Clear();
myNbIds=1;
//purpose :
//=======================================================================
void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
- const Standard_Integer aId2)
+ const Standard_Integer aId2)
{
TColStd_ListOfInteger aLI;
//
//purpose :
//=======================================================================
void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
- const Standard_Integer aId2,
- const Standard_Integer aId3)
+ const Standard_Integer aId2,
+ const Standard_Integer aId3)
{
TColStd_ListOfInteger aLI;
//
//purpose :
//=======================================================================
void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
- const Standard_Integer aId2,
- const Standard_Integer aId3,
- const Standard_Integer aId4)
+ const Standard_Integer aId2,
+ const Standard_Integer aId3,
+ const Standard_Integer aId4)
{
TColStd_ListOfInteger aLI;
//
//purpose :
//=======================================================================
void NMTDS_PassKey::Ids(Standard_Integer& aId1,
- Standard_Integer& aId2) const
+ Standard_Integer& aId2) const
{
aId1=0;
aId2=0;
// purpose :
//=======================================================================
Standard_Integer NormalizedId(const Standard_Integer aId,
- const Standard_Integer aDiv)
+ const Standard_Integer aDiv)
{
Standard_Integer aMax, aTresh, aIdRet;
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_PassKeyBoolean.cxx
-// Created: Mon May 15 14:31:05 2006
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_PassKeyBoolean.cxx
+// Created: Mon May 15 14:31:05 2006
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTDS_PassKeyBoolean.ixx>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_PassKeyMapHasher.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_PassKeyMapHasher.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTDS_PassKeyMapHasher.ixx>
//purpose :
//=======================================================================
Standard_Integer NMTDS_PassKeyMapHasher::HashCode(const NMTDS_PassKey& aPK,
- const Standard_Integer Upper)
+ const Standard_Integer Upper)
{
return aPK.HashCode(Upper);
}
//purpose :
//=======================================================================
Standard_Boolean NMTDS_PassKeyMapHasher::IsEqual(const NMTDS_PassKey& aPK1,
- const NMTDS_PassKey& aPK2)
+ const NMTDS_PassKey& aPK2)
{
return aPK1.IsEqual(aPK2);
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_PassKeyShape.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_PassKeyShape.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTDS_PassKeyShape.ixx>
static
Standard_Integer NormalizedId(const Standard_Integer aId,
- const Standard_Integer aDiv);
+ const Standard_Integer aDiv);
//=======================================================================
//function :
//purpose :
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1)
-
+
{
Standard_Integer aHC;
//
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
- const TopoDS_Shape& aS2)
+ const TopoDS_Shape& aS2)
{
TopTools_ListOfShape aLS;
//
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
- const TopoDS_Shape& aS2,
- const TopoDS_Shape& aS3)
+ const TopoDS_Shape& aS2,
+ const TopoDS_Shape& aS3)
{
TopTools_ListOfShape aLS;
//
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
- const TopoDS_Shape& aS2,
- const TopoDS_Shape& aS3,
- const TopoDS_Shape& aS4)
+ const TopoDS_Shape& aS2,
+ const TopoDS_Shape& aS3,
+ const TopoDS_Shape& aS4)
{
TopTools_ListOfShape aLS;
//
// purpose :
//=======================================================================
Standard_Integer NormalizedId(const Standard_Integer aId,
- const Standard_Integer aDiv)
+ const Standard_Integer aDiv)
{
Standard_Integer aMax, aTresh, aIdRet;
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_PassKeyMapHasher.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_PassKeyMapHasher.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTDS_PassKeyShapeMapHasher.ixx>
//purpose :
//=======================================================================
Standard_Integer NMTDS_PassKeyShapeMapHasher::HashCode(const NMTDS_PassKeyShape& aPK,
- const Standard_Integer Upper)
+ const Standard_Integer Upper)
{
return aPK.HashCode(Upper);
}
//purpose :
//=======================================================================
Standard_Boolean NMTDS_PassKeyShapeMapHasher::IsEqual(const NMTDS_PassKeyShape& aPK1,
- const NMTDS_PassKeyShape& aPK2)
+ const NMTDS_PassKeyShape& aPK2)
{
return aPK1.IsEqual(aPK2);
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_ShapesDataStructure.cxx
-// Created: Mon Dec 1 10:21:04 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_ShapesDataStructure.cxx
+// Created: Mon Dec 1 10:21:04 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTDS_ShapesDataStructure.ixx>
#include <TopoDS_Iterator.hxx>
static
void ComputeBoxExS(const Standard_Integer aIx,
- const NMTDS_ShapesDataStructure* pDS,
- Bnd_Box& aBoxEx);
+ const NMTDS_ShapesDataStructure* pDS,
+ Bnd_Box& aBoxEx);
static
void GetAllSuccessorsS(const Standard_Integer nS,
- const NMTDS_ShapesDataStructure* myDS,
- TColStd_IndexedMapOfInteger& aMA);
+ const NMTDS_ShapesDataStructure* myDS,
+ TColStd_IndexedMapOfInteger& aMA);
//===========================================================================
//function : NMTDS_ShapesDataStructure::NMTDS_ShapesDataStructure
for(j=1; j<=aNbSc; ++j) {
aIndex=aAS1.GetSuccessor(j);
if(aMFence.Add(aIndex)) {
- BooleanOperations_AncestorsSeqAndSuccessorsSeq& aAS2=aMSA.ChangeFromIndex(aIndex);
- aAS2.SetNewAncestor(iX);
+ BooleanOperations_AncestorsSeqAndSuccessorsSeq& aAS2=aMSA.ChangeFromIndex(aIndex);
+ aAS2.SetNewAncestor(iX);
}
}
}
//purpose :
//===========================================================================
Standard_Integer NMTDS_ShapesDataStructure::ShapeIndex(const TopoDS_Shape& aS,
- const Standard_Integer aRank)const
+ const Standard_Integer aRank)const
{
Standard_Boolean bFound;
Standard_Integer aIndex=0;
//purpose :
//=======================================================================
void NMTDS_ShapesDataStructure::ComputeBoxEx (const Standard_Integer aIx,
- Bnd_Box& aBoxEx)const
+ Bnd_Box& aBoxEx)const
{
ComputeBoxExS(aIx, this, aBoxEx);
}
//purpose :
//=======================================================================
void NMTDS_ShapesDataStructure::GetAllSuccessors(const Standard_Integer nS,
- TColStd_IndexedMapOfInteger& aMA)const
+ TColStd_IndexedMapOfInteger& aMA)const
{
GetAllSuccessorsS(nS, this, aMA);
}
//purpose :
//=======================================================================
void GetAllSuccessorsS(const Standard_Integer nS,
- const NMTDS_ShapesDataStructure* myDS,
- TColStd_IndexedMapOfInteger& aMA)
+ const NMTDS_ShapesDataStructure* myDS,
+ TColStd_IndexedMapOfInteger& aMA)
{
TopAbs_ShapeEnum aT;
Standard_Integer i, nSx, aNbSuccessors, *pSuccessors;
// purpose:
//=======================================================================
void ComputeBoxExS(const Standard_Integer aIx,
- const NMTDS_ShapesDataStructure* pDS,
- Bnd_Box& aBoxEx)
+ const NMTDS_ShapesDataStructure* pDS,
+ Bnd_Box& aBoxEx)
{
Standard_Integer i, aNbS, iS;
//
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTDS_StdMapNodeOfMapOfPassKeyBoolean",
- sizeof(NMTDS_StdMapNodeOfMapOfPassKeyBoolean),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTDS_StdMapNodeOfMapOfPassKeyBoolean),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTDS_StdMapNodeOfMapOfPassKey",
- sizeof(NMTDS_StdMapNodeOfMapOfPassKey),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTDS_StdMapNodeOfMapOfPassKey),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_Tools.cxx
-// Created: Tue Feb 20 14:57:28 2007
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_Tools.cxx
+// Created: Tue Feb 20 14:57:28 2007
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTDS_Tools.ixx>
#include <TopoDS_Vertex.hxx>
#include <BRep_Builder.hxx>
void CopySource(const TopoDS_Shape& aS,
- TopTools_IndexedDataMapOfShapeShape& aMapSS,
- TopoDS_Shape& aSC);
+ TopTools_IndexedDataMapOfShapeShape& aMapSS,
+ TopoDS_Shape& aSC);
//=======================================================================
//function : CopyShape
//purpose :
//=======================================================================
void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
- TopoDS_Shape& aSC)
+ TopoDS_Shape& aSC)
{
TopTools_IndexedDataMapOfShapeShape aMapSS;
//
//purpose :
//=======================================================================
void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
- TopoDS_Shape& aSC,
- TopTools_IndexedDataMapOfShapeShape& aMapSS)
+ TopoDS_Shape& aSC,
+ TopTools_IndexedDataMapOfShapeShape& aMapSS)
{
CopySource(aS, aMapSS, aSC);
}
//purpose :
//=======================================================================
void CopySource(const TopoDS_Shape& aS,
- TopTools_IndexedDataMapOfShapeShape& aMapSS,
- TopoDS_Shape& aSC)
+ TopTools_IndexedDataMapOfShapeShape& aMapSS,
+ TopoDS_Shape& aSC)
{
Standard_Boolean bFree;
TopAbs_ShapeEnum aT;
// purpose:
//=======================================================================
Standard_Integer NMTDS_Tools::ComputeVV(const TopoDS_Vertex& aV1,
- const TopoDS_Vertex& aV2)
+ const TopoDS_Vertex& aV2)
{
Standard_Real aTolV1, aTolV2, aTolSum, aTolSum2, aD2;
gp_Pnt aP1, aP2;
//purpose :
//=======================================================================
Standard_Integer NMTDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1,
- const TopAbs_ShapeEnum aType2)
+ const TopAbs_ShapeEnum aType2)
{
Standard_Integer iRet, iT1, iT2, iX;
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_CheckerSI.cxx
-// Created: Mon Feb 19 11:32:08 2007
-// Author: Peter KURNEV
+// File: NMTTools_CheckerSI.cxx
+// Created: Mon Feb 19 11:32:08 2007
+// Author: Peter KURNEV
//
#include <NMTTools_CheckerSI.ixx>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_CheckerSI.cxx
-// Created: Mon Feb 19 11:32:08 2007
-// Author: Peter KURNEV
+// File: NMTTools_CheckerSI.cxx
+// Created: Mon Feb 19 11:32:08 2007
+// Author: Peter KURNEV
//
#include <NMTTools_CheckerSI.ixx>
#include <NMTDS_ShapesDataStructure.hxx>
static
Standard_Boolean IsValid(const TopoDS_Edge& aE,
- const TopoDS_Vertex& aV,
- const Standard_Real aTV1,
- const Standard_Real aTV2);
+ const TopoDS_Vertex& aV,
+ const Standard_Real aTV1,
+ const Standard_Real aTV2);
//=======================================================================
// function: PreparePaveBlocks
// purpose:
//=======================================================================
void NMTTools_CheckerSI::PreparePaveBlocks(const TopAbs_ShapeEnum aType1,
- const TopAbs_ShapeEnum aType2)
+ const TopAbs_ShapeEnum aType2)
{
NMTTools_PaveFiller::PreparePaveBlocks(aType1, aType2);
}
if (nV1==nV2) {
bIsValid=IsValid(aE, aV1, aT1, aT2);
if (!bIsValid) {
- //printf(" pb SR: nV nE: %d nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
- myStopStatus=1;
+ //printf(" pb SR: nV nE: %d nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
+ myStopStatus=1;
}
}
//
//purpose :
//=======================================================================
Standard_Boolean IsValid(const TopoDS_Edge& aE,
- const TopoDS_Vertex& aV,
- const Standard_Real aTV1,
- const Standard_Real aTV2)
+ const TopoDS_Vertex& aV,
+ const Standard_Real aTV1,
+ const Standard_Real aTV2)
{
Standard_Boolean bRet;
Standard_Integer i, aNbP, aNbP1;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_CommonBlock.cxx
-// Created: Tue Dec 9 12:23:29 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_CommonBlock.cxx
+// Created: Tue Dec 9 12:23:29 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_CommonBlock.ixx>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_CommonBlockAPI.cxx
-// Created: Mon Dec 15 11:38:04 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_CommonBlockAPI.cxx
+// Created: Mon Dec 15 11:38:04 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_CommonBlockAPI.ixx>
const BOPTools_PaveBlock& aPB=anItPB.Value();
anECurrent=aPB.OriginalEdge();
if (anECurrent==anE) {
- pmyListOfPaveBlock->Append(aPB);
- break;
+ pmyListOfPaveBlock->Append(aPB);
+ break;
}
}
}
for (; anItPB.More(); anItPB.Next()) {
const BOPTools_PaveBlock& aPBx=anItPB.Value();
if (aPBx.IsEqual(aPB)) {
- return aCB;
+ return aCB;
}
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_CoupleOfShape.cxx
-// Created: Wed Jan 28 15:06:11 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_CoupleOfShape.cxx
+// Created: Wed Jan 28 15:06:11 2004
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_CoupleOfShape.ixx>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_DEProcessor.cxx
-// Created: Wed Sep 12 12:10:52 2001
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_DEProcessor.cxx
+// Created: Wed Sep 12 12:10:52 2001
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_DEProcessor.ixx>
const TopoDS_Edge& aE=TopoDS::Edge(aS);
if (BRep_Tool::Degenerated(aE)) {
- iRankE=myDS->Rank(i);
- aV=TopExp::FirstVertex(aE);
- nVx=myDS->ShapeIndex(aV, iRankE);
- //
- nV=nVx;
- ip=myFiller->FindSDVertex(nV);
- if (ip) {
- nV=ip;
- }
- //
- TColStd_ListOfInteger aLFn;
- const TopTools_ListOfShape& aLF=aMEF.FindFromKey(aE);
- TopTools_ListIteratorOfListOfShape anIt(aLF);
- for (; anIt.More(); anIt.Next()) {
- const TopoDS_Shape& aF=anIt.Value();
- nF=myDS->ShapeIndex(aF, iRankE);
- aLFn.Append(nF);
- }
- BOPTools_DEInfo aDEInfo;
- aDEInfo.SetVertex(nV);
- aDEInfo.SetFaces(aLFn);
+ iRankE=myDS->Rank(i);
+ aV=TopExp::FirstVertex(aE);
+ nVx=myDS->ShapeIndex(aV, iRankE);
+ //
+ nV=nVx;
+ ip=myFiller->FindSDVertex(nV);
+ if (ip) {
+ nV=ip;
+ }
+ //
+ TColStd_ListOfInteger aLFn;
+ const TopTools_ListOfShape& aLF=aMEF.FindFromKey(aE);
+ TopTools_ListIteratorOfListOfShape anIt(aLF);
+ for (; anIt.More(); anIt.Next()) {
+ const TopoDS_Shape& aF=anIt.Value();
+ nF=myDS->ShapeIndex(aF, iRankE);
+ aLFn.Append(nF);
+ }
+ BOPTools_DEInfo aDEInfo;
+ aDEInfo.SetVertex(nV);
+ aDEInfo.SetFaces(aLFn);
- myDEMap.Add (i, aDEInfo);
+ myDEMap.Add (i, aDEInfo);
}
}
}
//
aNbLPB=aLPB.Extent();
if (!aNbLPB) {
- continue;
+ continue;
}
//
FillPaveSet (nED, nVD, nFD, aLPB);
// purpose:
//=======================================================================
void NMTTools_DEProcessor::FindPaveBlocks(const Standard_Integer ,
- const Standard_Integer nVD,
- const Standard_Integer nFD,
- BOPTools_ListOfPaveBlock& aLPBOut)
+ const Standard_Integer nVD,
+ const Standard_Integer nFD,
+ BOPTools_ListOfPaveBlock& aLPBOut)
{
BOPTools_ListIteratorOfListOfPaveBlock anIt;
Standard_Integer i, aNb, nF2, nV;
const BOPTools_Pave& aPave1=aPBSp.Pave1();
nV=aPave1.Index();
if (nV==nVD) {
- aLPBOut.Append(aPBSp);
- continue;
+ aLPBOut.Append(aPBSp);
+ continue;
}
//
const BOPTools_Pave& aPave2=aPBSp.Pave2();
nV=aPave2.Index();
if (nV==nVD) {
- aLPBOut.Append(aPBSp);
- continue;
+ aLPBOut.Append(aPBSp);
+ continue;
}
}
//
//
anIt.Initialize(aLPBSe);
for (; anIt.More(); anIt.Next()) {
- const BOPTools_PaveBlock& aPBSe=anIt.Value();
- //
- const BOPTools_Pave& aPv1=aPBSe.Pave1();
- nV=aPv1.Index();
- if (nV==nVD) {
- aLPBOut.Append(aPBSe);
- continue;
- }
- //
- const BOPTools_Pave& aPv2=aPBSe.Pave2();
- nV=aPv2.Index();
- if (nV==nVD) {
- aLPBOut.Append(aPBSe);
- continue;
- }
+ const BOPTools_PaveBlock& aPBSe=anIt.Value();
+ //
+ const BOPTools_Pave& aPv1=aPBSe.Pave1();
+ nV=aPv1.Index();
+ if (nV==nVD) {
+ aLPBOut.Append(aPBSe);
+ continue;
+ }
+ //
+ const BOPTools_Pave& aPv2=aPBSe.Pave2();
+ nV=aPv2.Index();
+ if (nV==nVD) {
+ aLPBOut.Append(aPBSe);
+ continue;
+ }
}
}
}
// purpose:
//=======================================================================
void NMTTools_DEProcessor::FillPaveSet (const Standard_Integer nED,
- const Standard_Integer nVD,
- const Standard_Integer nFD,
- const BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nVD,
+ const Standard_Integer nFD,
+ const BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Boolean bIsDone, bXDir, bRejectFlag;
Standard_Integer nE, aNbPoints, j;
if(bIsDone) {
aNbPoints=aGInter.NbPoints();
if (aNbPoints) {
- for (j=1; j<=aNbPoints; ++j) {
- aP2D=aGInter.Point(j).Value();
- Handle(Geom2d_Line) aCLDE;
- //
- //modified by NIZNHY-PKV Thu Mar 20 17:37:32 2008f
- Handle(Geom2d_TrimmedCurve) aCLDET1=
- Handle(Geom2d_TrimmedCurve)::DownCast(aC2DDE1);
- if (aCLDET1.IsNull()) {
- aCLDE=Handle(Geom2d_Line)::DownCast(aC2DDE1);
- }
- else {
- Handle(Geom2d_Curve) aBasisCurve=aCLDET1->BasisCurve();
- aCLDE=Handle(Geom2d_Line)::DownCast(aBasisCurve);
- }
- //aCLDE=Handle(Geom2d_Line)::DownCast(aC2DDE1);
- //modified by NIZNHY-PKV Thu Mar 20 17:37:37 2008t
-
- if (aCLDE.IsNull()) {
- continue;
- }
+ for (j=1; j<=aNbPoints; ++j) {
+ aP2D=aGInter.Point(j).Value();
+ Handle(Geom2d_Line) aCLDE;
+ //
+ //modified by NIZNHY-PKV Thu Mar 20 17:37:32 2008f
+ Handle(Geom2d_TrimmedCurve) aCLDET1=
+ Handle(Geom2d_TrimmedCurve)::DownCast(aC2DDE1);
+ if (aCLDET1.IsNull()) {
+ aCLDE=Handle(Geom2d_Line)::DownCast(aC2DDE1);
+ }
+ else {
+ Handle(Geom2d_Curve) aBasisCurve=aCLDET1->BasisCurve();
+ aCLDE=Handle(Geom2d_Line)::DownCast(aBasisCurve);
+ }
+ //aCLDE=Handle(Geom2d_Line)::DownCast(aC2DDE1);
+ //modified by NIZNHY-PKV Thu Mar 20 17:37:37 2008t
+
+ if (aCLDE.IsNull()) {
+ continue;
+ }
- aLDE=aCLDE->Lin2d();
- aX=ElCLib::Parameter(aLDE, aP2D);
- //
- if (fabs (aX-aTD1) < aDT || fabs (aX-aTD2) < aDT) {
- continue;
- }
- if (aX < aTD1 || aX > aTD2) {
- continue;
- }
- //
- bRejectFlag=Standard_False;
- const BOPTools_ListOfPave& aListOfPave=aPaveSet.Set();
- BOPTools_ListIteratorOfListOfPave aPaveIt(aListOfPave);
- for (; aPaveIt.More(); aPaveIt.Next()) {
- const BOPTools_Pave& aPavex=aPaveIt.Value();
- aXx=aPavex.Param();
- if (fabs (aX-aXx) < aDT) {
- bRejectFlag=Standard_True;
- break;
- }
- }
- if (bRejectFlag) {
- continue;
- }
- //
- BOPTools_Pave aPave(nVD, aX, BooleanOperations_UnknownInterference);
- aPaveSet.Append(aPave);
- }
+ aLDE=aCLDE->Lin2d();
+ aX=ElCLib::Parameter(aLDE, aP2D);
+ //
+ if (fabs (aX-aTD1) < aDT || fabs (aX-aTD2) < aDT) {
+ continue;
+ }
+ if (aX < aTD1 || aX > aTD2) {
+ continue;
+ }
+ //
+ bRejectFlag=Standard_False;
+ const BOPTools_ListOfPave& aListOfPave=aPaveSet.Set();
+ BOPTools_ListIteratorOfListOfPave aPaveIt(aListOfPave);
+ for (; aPaveIt.More(); aPaveIt.Next()) {
+ const BOPTools_Pave& aPavex=aPaveIt.Value();
+ aXx=aPavex.Param();
+ if (fabs (aX-aXx) < aDT) {
+ bRejectFlag=Standard_True;
+ break;
+ }
+ }
+ if (bRejectFlag) {
+ continue;
+ }
+ //
+ BOPTools_Pave aPave(nVD, aX, BooleanOperations_UnknownInterference);
+ aPaveSet.Append(aPave);
+ }
}
}
}
// purpose:
//=======================================================================
void NMTTools_DEProcessor::MakeSplitEdges (const Standard_Integer nED,
- const Standard_Integer nFD)
+ const Standard_Integer nFD)
{
const BOPTools_SplitShapesPool& aSplitShapesPool=myFiller->SplitShapesPool();
const BOPTools_ListOfPaveBlock& aSplitEdges=aSplitShapesPool(myDS->RefEdge(nED));
// purpose:
//=======================================================================
void NMTTools_DEProcessor::MakeSplitEdge (const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- const TopoDS_Vertex& aV1,
- const Standard_Real aP1,
- const TopoDS_Vertex& aV2,
- const Standard_Real aP2,
- TopoDS_Edge& aNewEdge)
+ const TopoDS_Face& aF,
+ const TopoDS_Vertex& aV1,
+ const Standard_Real aP1,
+ const TopoDS_Vertex& aV2,
+ const Standard_Real aP2,
+ TopoDS_Edge& aNewEdge)
{
Standard_Real aTol=1.e-7;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_DSFiller.cxx
-// Created: Fri Dec 5 14:06:34 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_DSFiller.cxx
+// Created: Fri Dec 5 14:06:34 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_DSFiller.ixx>
#include <NMTTools_PaveFiller.hxx>
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock",
- sizeof(NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger",
- sizeof(NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape",
- sizeof(NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock",
- sizeof(NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_IteratorOfCoupleOfShape.cxx
-// Created: Thu Dec 4 17:00:03 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_IteratorOfCoupleOfShape.cxx
+// Created: Thu Dec 4 17:00:03 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_IteratorOfCoupleOfShape.ixx>
#include <Standard_NoSuchObject.hxx>
// purpose:
//=======================================================================
void NMTTools_IteratorOfCoupleOfShape::Initialize(const TopAbs_ShapeEnum Type1,
- const TopAbs_ShapeEnum Type2)
+ const TopAbs_ShapeEnum Type2)
{
if(myPDS==NULL) {
Standard_NoSuchObject::Raise("NMTTools_IteratorOfCoupleOfShape::Initialize: myPDS==NULL");
// purpose:
//=======================================================================
void NMTTools_IteratorOfCoupleOfShape::Current(Standard_Integer& aIndex1,
- Standard_Integer& aIndex2,
- Standard_Boolean& aWithSubShape) const
+ Standard_Integer& aIndex2,
+ Standard_Boolean& aWithSubShape) const
{
aIndex1=myIndex1;
aIndex2=myIndex2;
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTTools_ListNodeOfListOfCommonBlock",
- sizeof(NMTTools_ListNodeOfListOfCommonBlock),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTTools_ListNodeOfListOfCommonBlock),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTTools_ListNodeOfListOfCoupleOfShape",
- sizeof(NMTTools_ListNodeOfListOfCoupleOfShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTTools_ListNodeOfListOfCoupleOfShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PCurveMaker.cxx
-// Created:
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PCurveMaker.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PCurveMaker.ixx>
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller.cxx
-// Created: Fri Dec 5 14:58:54 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller.cxx
+// Created: Fri Dec 5 14:58:54 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller_0.cxx
-// Created: Mon Dec 8 11:45:51 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller_0.cxx
+// Created: Mon Dec 8 11:45:51 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::IsSuccessorsComputed(const Standard_Integer aN1,
- const Standard_Integer aN2)const
+ const Standard_Integer aN2)const
{
Standard_Boolean bComputed;
Standard_Integer i, nSuc, n1, n2, ntmp, aNbS;
//purpose :
//=======================================================================
void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
- Standard_Integer& theWith)const
+ Standard_Integer& theWith)const
{
Standard_Integer aWhat, aWith;
Standard_Boolean aReverseFlag;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller_1.cxx
-// Created: Mon Dec 8 11:47:55 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller_1.cxx
+// Created: Mon Dec 8 11:47:55 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
for (i=0; aItX.More(); aItX.Next(), ++i) {
aItY.Initialize(aLIX);
for (j=0; aItY.More(); aItY.Next(), ++j) {
- if (j>i) {
- n1=aItX.Value();
- n2=aItY.Value();
- myIP->Add(n1, n2, Standard_True, NMTDS_TI_VV);
- //
- BOPTools_VVInterference aVV(n1, n2);
- aVV.SetNewShape(nVnew);
- aVVs.Append(aVV);
- }
+ if (j>i) {
+ n1=aItX.Value();
+ n2=aItY.Value();
+ myIP->Add(n1, n2, Standard_True, NMTDS_TI_VV);
+ //
+ BOPTools_VVInterference aVV(n1, n2);
+ aVV.SetNewShape(nVnew);
+ aVVs.Append(aVV);
+ }
}
}
}//for (; aIt1.More(); aIt1.Next()) {
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller_2.cxx
-// Created: Mon Dec 8 12:02:56 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller_2.cxx
+// Created: Mon Dec 8 12:02:56 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
static
Standard_Boolean Contains(const TopoDS_Edge& aE,
- const TopoDS_Vertex& aV);
+ const TopoDS_Vertex& aV);
// Contribution of Samtech www.samcef.com END
//=======================================================================
aWhat=n1; // Vertex
aWith=n2; // Edge
if (myDS->GetShapeType(n1)==TopAbs_EDGE) {
- aWhat=n2;
- aWith=n1;
+ aWhat=n2;
+ aWith=n1;
}
//
if(bJustAdd) {
- //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
- continue;
+ //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
+ continue;
}
// Edge
aE2=TopoDS::Edge(myDS->Shape(aWith));
if (BRep_Tool::Degenerated(aE2)){
- continue;
+ continue;
}
// Vertex
nV1=aWhat;
//
iSDV=FindSDVertex(aWhat);
if (iSDV) {
- nV1=iSDV;
- aV1=TopoDS::Vertex(myDS->Shape(nV1));
- // Modified to find same domain vertex Thu Sep 14 14:35:18 2006
- // Contribution of Samtech www.samcef.com BEGIN
- Standard_Integer nVE, iSDVE, iRet;
- //
- BooleanOperations_OnceExplorer aExp(*myDS);
- iRet=0;
- aExp.Init(aWith, TopAbs_VERTEX);
- for (; aExp.More(); aExp.Next()) {
- nVE=aExp.Current();
- iSDVE=FindSDVertex(nVE);
- if (iSDVE==iSDV) {
- iRet=1;
- break;
- }
- }
- if (iRet) {
- continue;
- }
+ nV1=iSDV;
+ aV1=TopoDS::Vertex(myDS->Shape(nV1));
+ // Modified to find same domain vertex Thu Sep 14 14:35:18 2006
+ // Contribution of Samtech www.samcef.com BEGIN
+ Standard_Integer nVE, iSDVE, iRet;
+ //
+ BooleanOperations_OnceExplorer aExp(*myDS);
+ iRet=0;
+ aExp.Init(aWith, TopAbs_VERTEX);
+ for (; aExp.More(); aExp.Next()) {
+ nVE=aExp.Current();
+ iSDVE=FindSDVertex(nVE);
+ if (iSDVE==iSDV) {
+ iRet=1;
+ break;
+ }
+ }
+ if (iRet) {
+ continue;
+ }
}
else {
- if (Contains(aE2, aV1)) {
- continue;
- }
- // Contribution of Samtech www.samcef.com END
+ if (Contains(aE2, aV1)) {
+ continue;
+ }
+ // Contribution of Samtech www.samcef.com END
}
//
aFlag=myContext.ComputeVE (aV1, aE2, aT);
//
if (!aFlag) {
- // Add Interference to the Pool
- BOPTools_VEInterference anInterf (aWhat, aWith, aT);
- anIndexIn=aVEs.Append(anInterf);
- //
- // Add Pave to the Edge's myPavePool
- aCouple.SetCouple(nV1, aWith);
- if (!aSnareMap.Contains(aCouple)){
- aSnareMap.Add(aCouple);
- //
- BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
- aPave.SetInterference(anIndexIn);
- BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
- aPaveSet.Append(aPave);
- }
- //
- // State for the Vertex in DS;
- myDS->SetState (aWhat, BooleanOperations_ON);
- // Insert Vertex in Interference Object
- BOPTools_VEInterference& aVE=aVEs(anIndexIn);
- aVE.SetNewShape(aWhat);
- // qqf
- {
- myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VE);
- }
- // qqt
+ // Add Interference to the Pool
+ BOPTools_VEInterference anInterf (aWhat, aWith, aT);
+ anIndexIn=aVEs.Append(anInterf);
+ //
+ // Add Pave to the Edge's myPavePool
+ aCouple.SetCouple(nV1, aWith);
+ if (!aSnareMap.Contains(aCouple)){
+ aSnareMap.Add(aCouple);
+ //
+ BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
+ aPave.SetInterference(anIndexIn);
+ BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
+ aPaveSet.Append(aPave);
+ }
+ //
+ // State for the Vertex in DS;
+ myDS->SetState (aWhat, BooleanOperations_ON);
+ // Insert Vertex in Interference Object
+ BOPTools_VEInterference& aVE=aVEs(anIndexIn);
+ aVE.SetNewShape(aWhat);
+ // qqf
+ {
+ myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VE);
+ }
+ // qqt
}
//myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
}
aE=TopoDS::Edge(myDS->Shape(i));
//
if (BRep_Tool::Degenerated(aE)){
- continue;
+ continue;
}
//
BOPTools_PaveSet& aPaveSet=myPavePool(myDS->RefEdge(i));
// A <-
aNBSuc=myDS->NumberOfSuccessors(i);
for (ii=1; ii <=aNBSuc; ii++) {
- nV=myDS->GetSuccessor(i, ii);
- anOr=myDS->GetOrientation(i, ii);
- aV=TopoDS::Vertex(myDS->Shape(nV));
- aV.Orientation(anOr);
- aT=BRep_Tool::Parameter(aV, aE);
- //
- ip=FindSDVertex(nV);
- if (ip) {
- aV=TopoDS::Vertex(myDS->Shape(ip));
- aV.Orientation(anOr);// XX ? if the edge is closed it'll be amazing result
- nV=ip;
- }
- //
- BOPTools_Pave aPave(nV, aT);
- aPaveSet.Append (aPave);
+ nV=myDS->GetSuccessor(i, ii);
+ anOr=myDS->GetOrientation(i, ii);
+ aV=TopoDS::Vertex(myDS->Shape(nV));
+ aV.Orientation(anOr);
+ aT=BRep_Tool::Parameter(aV, aE);
+ //
+ ip=FindSDVertex(nV);
+ if (ip) {
+ aV=TopoDS::Vertex(myDS->Shape(ip));
+ aV.Orientation(anOr);// XX ? if the edge is closed it'll be amazing result
+ nV=ip;
+ }
+ //
+ BOPTools_Pave aPave(nV, aT);
+ aPaveSet.Append (aPave);
}
}
}
//purpose :
//=======================================================================
Standard_Boolean Contains(const TopoDS_Edge& aE,
- const TopoDS_Vertex& aV)
+ const TopoDS_Vertex& aV)
{
Standard_Boolean bRet;
TopoDS_Iterator aIt;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller_3.cxx
-// Created: Mon Dec 8 16:06:56 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller_3.cxx
+// Created: Mon Dec 8 16:06:56 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
// Contribution of Samtech www.samcef.com BEGIN
static
Standard_Boolean Contains(const TopoDS_Face& aF,
- const TopoDS_Vertex& aV);
+ const TopoDS_Vertex& aV);
// Contribution of Samtech www.samcef.com END
//=======================================================================
// function: PerformVF
aWhat=n1; // Vertex
aWith=n2; // Face
if (myDS->GetShapeType(n1)==TopAbs_FACE) {
- aWhat=n2;
- aWith=n1;
+ aWhat=n2;
+ aWith=n1;
}
//
iSDV=FindSDVertex(aWhat);
- //
+ //
if(aJustAdd) {
- //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
- continue;
+ //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
+ continue;
}
//
aV1=TopoDS::Vertex(myDS->Shape(aWhat));
if (iSDV) {
- aV1=TopoDS::Vertex(myDS->Shape(iSDV));
+ aV1=TopoDS::Vertex(myDS->Shape(iSDV));
}
- //
+ //
aF2=TopoDS::Face(myDS->Shape(aWith));
//
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
if (Contains(aF2, aV1)) {
- continue;
+ continue;
}
// Contribution of Samtech www.samcef.com END
//
aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
//
if (!aFlag) {
- //
- // Add Interference to the Pool
- BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
- anIndexIn=aVSs.Append(anInterf);
- //
- // SetState for Vertex in DS;
- myDS->SetState (aWhat, BooleanOperations_ON);
- // Insert Vertex in Interference Object
- BOPTools_VSInterference& aVS=aVSs(anIndexIn);
- aVS.SetNewShape(aWhat);
- // qqf
- {
- myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VF);
- }
- // qqt
+ //
+ // Add Interference to the Pool
+ BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
+ anIndexIn=aVSs.Append(anInterf);
+ //
+ // SetState for Vertex in DS;
+ myDS->SetState (aWhat, BooleanOperations_ON);
+ // Insert Vertex in Interference Object
+ BOPTools_VSInterference& aVS=aVSs(anIndexIn);
+ aVS.SetNewShape(aWhat);
+ // qqf
+ {
+ myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VF);
+ }
+ // qqt
}
//myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
}
//purpose :
//=======================================================================
Standard_Boolean Contains(const TopoDS_Face& aF,
- const TopoDS_Vertex& aV)
+ const TopoDS_Vertex& aV)
{
Standard_Boolean bRet;
TopExp_Explorer aExp;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller_4.cxx
-// Created: Mon Dec 8 17:08:58 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller_4.cxx
+// Created: Mon Dec 8 17:08:58 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
//
static
void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI,
- TopTools_DataMapOfShapeListOfShape& myImages,
- TopTools_DataMapOfShapeShape& myOrigins);
+ TopTools_DataMapOfShapeListOfShape& myImages,
+ TopTools_DataMapOfShapeShape& myOrigins);
static
void MakeNewVertex(const TopTools_ListOfShape& aLV,
- TopoDS_Vertex& aNewVertex);
+ TopoDS_Vertex& aNewVertex);
static
void VertexParameters(const IntTools_CommonPrt& aCPart,
- Standard_Real& aT1,
- Standard_Real& aT2);
+ Standard_Real& aT1,
+ Standard_Real& aT2);
static
Standard_Boolean IsOnPave(const Standard_Real& aT1,
- const IntTools_Range& aRange,
- const Standard_Real& aTolerance);
+ const IntTools_Range& aRange,
+ const Standard_Real& aTolerance);
static
void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB);
static
void ProcessBlock(const BOPTools_PaveBlock& aPB,
- const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
- BOPTools_IMapOfPaveBlock& aProcessedBlocks,
- BOPTools_IMapOfPaveBlock& aChain);
+ const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
+ BOPTools_IMapOfPaveBlock& aProcessedBlocks,
+ BOPTools_IMapOfPaveBlock& aChain);
static
void FindChains(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
- NMTTools_ListOfCommonBlock& aLCB);
+ NMTTools_ListOfCommonBlock& aLCB);
//=======================================================================
// function: PerformEE
const Bnd_Box& aBB1=aShrunkRange1.BndBox();
//
for (anIt2.Initialize(aLPB2); anIt2.More(); anIt2.Next()) {
- BOPTools_PaveBlock& aPB2=anIt2.Value();
- const IntTools_ShrunkRange& aShrunkRange2=aPB2.ShrunkRange();
+ BOPTools_PaveBlock& aPB2=anIt2.Value();
+ const IntTools_ShrunkRange& aShrunkRange2=aPB2.ShrunkRange();
- const IntTools_Range& aSR2=aShrunkRange2.ShrunkRange();
- const Bnd_Box& aBB2=aShrunkRange2.BndBox();
- //
- if (aBB1.IsOut (aBB2)) {
- continue;
- }
- //
- // EE
- IntTools_EdgeEdge aEE;
- aEE.SetEdge1 (aE1);
- aEE.SetEdge2 (aE2);
- aEE.SetTolerance1 (aTolE1);
- aEE.SetTolerance2 (aTolE2);
- aEE.SetDiscretize (aDiscretize);
- aEE.SetDeflection (aDeflection);
- //
- IntTools_Range anewSR1 = aSR1;
- IntTools_Range anewSR2 = aSR2;
- //
- BOPTools_Tools::CorrectRange (aE1, aE2, aSR1, anewSR1);
- BOPTools_Tools::CorrectRange (aE2, aE1, aSR2, anewSR2);
- //
- aEE.SetRange1(anewSR1);
- aEE.SetRange2(anewSR2);
-
- aEE.Perform();
- //
- anIndexIn=0;
- //
- if (aEE.IsDone()) {
- // reverse order if it is necessary
- aEWhat=aE1;
- aEWith=aE2;
- aWhat=nE1;
- aWith=nE2;
- if (aEE.Order()) {
- aTmp=aWhat;
- aWhat=aWith;
- aWith=aTmp;
- aEWhat=aE2;
- aEWith=aE1;
- }
- //
- const IntTools_SequenceOfCommonPrts& aCPrts=aEE.CommonParts();
- aNbCPrts=aCPrts.Length();
- for (i=1; i<=aNbCPrts; i++) {
- const IntTools_CommonPrt& aCPart=aCPrts(i);
- const IntTools_SequenceOfRanges& aRanges2=aCPart.Ranges2();
- //
- anIndexIn=0;
- //
- TopAbs_ShapeEnum aType=aCPart.Type();
- switch (aType) {
- case TopAbs_VERTEX: {
- Standard_Real aT1, aT2, aTol=Precision::PConfusion();
- Standard_Boolean bIsOnPave1, bIsOnPave2;
- IntTools_Range aR1, aR2;
- //
- VertexParameters(aCPart, aT1, aT2);
- //
- //decide to keep the pave or not
- aR1 = (aEE.Order()) ? anewSR2 : anewSR1;
- aR2 = (aEE.Order()) ? anewSR1 : anewSR2;
- //
- bIsOnPave1=IsOnPave(aT1, aR1, aTol);
- bIsOnPave2=IsOnPave(aT2, aR2, aTol);
- //
- if(bIsOnPave1 || bIsOnPave2) {
- continue;
- }
- //
- BOPTools_Tools::MakeNewVertex(aEWhat, aT1, aEWith, aT2, aNewVertex);
- //
- {
- Standard_Integer nV11, nV12, nV21, nV22, nVS[2], k, j, iFound;
- Standard_Real aTolVx, aTolVnew, aD2, aDT2;
- TColStd_MapOfInteger aMV;
- gp_Pnt aPnew, aPx;
- //
- iFound=0;
- j=-1;
- nV11=aPB1.Pave1().Index();
- nV12=aPB1.Pave2().Index();
- nV21=aPB2.Pave1().Index();
- nV22=aPB2.Pave2().Index();
- aMV.Add(nV11);
- aMV.Add(nV12);
- //
- if (aMV.Contains(nV21)) {
- ++j;
- nVS[j]=nV21;
- }
- if (aMV.Contains(nV22)) {
- ++j;
- nVS[j]=nV22;
- }
- //
- aTolVnew=BRep_Tool::Tolerance(aNewVertex);
- aPnew=BRep_Tool::Pnt(aNewVertex);
- //
- for (k=0; k<=j; ++k) {
- const TopoDS_Vertex& aVx=TopoDS::Vertex(myDS->Shape(nVS[k]));
- aTolVx=BRep_Tool::Tolerance(aVx);
- aPx=BRep_Tool::Pnt(aVx);
- aD2=aPnew.SquareDistance(aPx);
- //
- aDT2=100.*(aTolVnew+aTolVx)*(aTolVnew+aTolVx);
- //
- if (aD2<aDT2) {
- iFound=1;
- break;
- }
- }
- //
- if (iFound) {
- continue;
- }
- }
- //
- // Add Interference to the Pool
- BOPTools_EEInterference anInterf (aWhat, aWith, aCPart);
- //
- anIndexIn=aEEs.Append(anInterf);
- // qqf
- {
- myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
- }
- // qqt
- //
- // Collect
- aMapVI.Add(aNewVertex, anIndexIn);
- }
- break;
-
- case TopAbs_EDGE: {
- Standard_Integer aNbComPrt2;
- Standard_Boolean aCoinsideFlag;
- //
- aNbComPrt2=aRanges2.Length();
- aCoinsideFlag=IsBlocksCoinside(aPB1, aPB2);
- //
- if (aNbComPrt2>1 || !aCoinsideFlag) {
- //myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
- break;
- }
- //
- // Fill aMapCB
- if (aMapCB.Contains(aPB1)) {
- BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.ChangeFromKey(aPB1);
- aMapPB.Add(aPB1);
- aMapPB.Add(aPB2);
- }
- else {
- BOPTools_IMapOfPaveBlock aMapPB;
- aMapPB.Add(aPB1);
- aMapPB.Add(aPB2);
- aMapCB.Add(aPB1, aMapPB);
- }
- //
- if (aMapCB.Contains(aPB2)) {
- BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.ChangeFromKey(aPB2);
- aMapPB.Add(aPB1);
- aMapPB.Add(aPB2);
- }
- else {
- BOPTools_IMapOfPaveBlock aMapPB;
- aMapPB.Add(aPB1);
- aMapPB.Add(aPB2);
- aMapCB.Add(aPB2, aMapPB);
- }
- // qqf
- {
- myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
- }
- // qqt
- }
- break;
- default:
- break;
- } // switch (aType)
- } // for (i=1; i<=aNbCPrts; i++)
- }// if (aEE.IsDone())
+ const IntTools_Range& aSR2=aShrunkRange2.ShrunkRange();
+ const Bnd_Box& aBB2=aShrunkRange2.BndBox();
+ //
+ if (aBB1.IsOut (aBB2)) {
+ continue;
+ }
+ //
+ // EE
+ IntTools_EdgeEdge aEE;
+ aEE.SetEdge1 (aE1);
+ aEE.SetEdge2 (aE2);
+ aEE.SetTolerance1 (aTolE1);
+ aEE.SetTolerance2 (aTolE2);
+ aEE.SetDiscretize (aDiscretize);
+ aEE.SetDeflection (aDeflection);
+ //
+ IntTools_Range anewSR1 = aSR1;
+ IntTools_Range anewSR2 = aSR2;
+ //
+ BOPTools_Tools::CorrectRange (aE1, aE2, aSR1, anewSR1);
+ BOPTools_Tools::CorrectRange (aE2, aE1, aSR2, anewSR2);
+ //
+ aEE.SetRange1(anewSR1);
+ aEE.SetRange2(anewSR2);
+
+ aEE.Perform();
+ //
+ anIndexIn=0;
+ //
+ if (aEE.IsDone()) {
+ // reverse order if it is necessary
+ aEWhat=aE1;
+ aEWith=aE2;
+ aWhat=nE1;
+ aWith=nE2;
+ if (aEE.Order()) {
+ aTmp=aWhat;
+ aWhat=aWith;
+ aWith=aTmp;
+ aEWhat=aE2;
+ aEWith=aE1;
+ }
+ //
+ const IntTools_SequenceOfCommonPrts& aCPrts=aEE.CommonParts();
+ aNbCPrts=aCPrts.Length();
+ for (i=1; i<=aNbCPrts; i++) {
+ const IntTools_CommonPrt& aCPart=aCPrts(i);
+ const IntTools_SequenceOfRanges& aRanges2=aCPart.Ranges2();
+ //
+ anIndexIn=0;
+ //
+ TopAbs_ShapeEnum aType=aCPart.Type();
+ switch (aType) {
+ case TopAbs_VERTEX: {
+ Standard_Real aT1, aT2, aTol=Precision::PConfusion();
+ Standard_Boolean bIsOnPave1, bIsOnPave2;
+ IntTools_Range aR1, aR2;
+ //
+ VertexParameters(aCPart, aT1, aT2);
+ //
+ //decide to keep the pave or not
+ aR1 = (aEE.Order()) ? anewSR2 : anewSR1;
+ aR2 = (aEE.Order()) ? anewSR1 : anewSR2;
+ //
+ bIsOnPave1=IsOnPave(aT1, aR1, aTol);
+ bIsOnPave2=IsOnPave(aT2, aR2, aTol);
+ //
+ if(bIsOnPave1 || bIsOnPave2) {
+ continue;
+ }
+ //
+ BOPTools_Tools::MakeNewVertex(aEWhat, aT1, aEWith, aT2, aNewVertex);
+ //
+ {
+ Standard_Integer nV11, nV12, nV21, nV22, nVS[2], k, j, iFound;
+ Standard_Real aTolVx, aTolVnew, aD2, aDT2;
+ TColStd_MapOfInteger aMV;
+ gp_Pnt aPnew, aPx;
+ //
+ iFound=0;
+ j=-1;
+ nV11=aPB1.Pave1().Index();
+ nV12=aPB1.Pave2().Index();
+ nV21=aPB2.Pave1().Index();
+ nV22=aPB2.Pave2().Index();
+ aMV.Add(nV11);
+ aMV.Add(nV12);
+ //
+ if (aMV.Contains(nV21)) {
+ ++j;
+ nVS[j]=nV21;
+ }
+ if (aMV.Contains(nV22)) {
+ ++j;
+ nVS[j]=nV22;
+ }
+ //
+ aTolVnew=BRep_Tool::Tolerance(aNewVertex);
+ aPnew=BRep_Tool::Pnt(aNewVertex);
+ //
+ for (k=0; k<=j; ++k) {
+ const TopoDS_Vertex& aVx=TopoDS::Vertex(myDS->Shape(nVS[k]));
+ aTolVx=BRep_Tool::Tolerance(aVx);
+ aPx=BRep_Tool::Pnt(aVx);
+ aD2=aPnew.SquareDistance(aPx);
+ //
+ aDT2=100.*(aTolVnew+aTolVx)*(aTolVnew+aTolVx);
+ //
+ if (aD2<aDT2) {
+ iFound=1;
+ break;
+ }
+ }
+ //
+ if (iFound) {
+ continue;
+ }
+ }
+ //
+ // Add Interference to the Pool
+ BOPTools_EEInterference anInterf (aWhat, aWith, aCPart);
+ //
+ anIndexIn=aEEs.Append(anInterf);
+ // qqf
+ {
+ myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
+ }
+ // qqt
+ //
+ // Collect
+ aMapVI.Add(aNewVertex, anIndexIn);
+ }
+ break;
+
+ case TopAbs_EDGE: {
+ Standard_Integer aNbComPrt2;
+ Standard_Boolean aCoinsideFlag;
+ //
+ aNbComPrt2=aRanges2.Length();
+ aCoinsideFlag=IsBlocksCoinside(aPB1, aPB2);
+ //
+ if (aNbComPrt2>1 || !aCoinsideFlag) {
+ //myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
+ break;
+ }
+ //
+ // Fill aMapCB
+ if (aMapCB.Contains(aPB1)) {
+ BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.ChangeFromKey(aPB1);
+ aMapPB.Add(aPB1);
+ aMapPB.Add(aPB2);
+ }
+ else {
+ BOPTools_IMapOfPaveBlock aMapPB;
+ aMapPB.Add(aPB1);
+ aMapPB.Add(aPB2);
+ aMapCB.Add(aPB1, aMapPB);
+ }
+ //
+ if (aMapCB.Contains(aPB2)) {
+ BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.ChangeFromKey(aPB2);
+ aMapPB.Add(aPB1);
+ aMapPB.Add(aPB2);
+ }
+ else {
+ BOPTools_IMapOfPaveBlock aMapPB;
+ aMapPB.Add(aPB1);
+ aMapPB.Add(aPB2);
+ aMapCB.Add(aPB2, aMapPB);
+ }
+ // qqf
+ {
+ myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
+ }
+ // qqt
+ }
+ break;
+ default:
+ break;
+ } // switch (aType)
+ } // for (i=1; i<=aNbCPrts; i++)
+ }// if (aEE.IsDone())
} // for (; anIt2.More(); anIt2.Next())
} // for (; anIt1.More(); anIt1.Next())
}// for (; myDSIt.More(); myDSIt.Next())
//
aItLP.Initialize(aLP);
for (; aItLP.More(); aItLP.Next()) {
- const BOPTools_Pave& aPave=aItLP.Value();
- nV=aPave.Index();
- aMI.Add(nV);
+ const BOPTools_Pave& aPave=aItLP.Value();
+ nV=aPave.Index();
+ aMI.Add(nV);
}
}//for (; anItLPB.More(); anItLPB.Next()) {
//
//
aItMI.Initialize(aMI);
for (; aItMI.More(); aItMI.Next()) {
- nV=aItMI.Key();
- bFound=Standard_False;
- aItLP.Initialize(aLP);
- for (; aItLP.More(); aItLP.Next()) {
- const BOPTools_Pave& aPave=aItLP.Value();
- nVp=aPave.Index();
- if (nVp==nV) {
- bFound=!bFound;
- break;
- }
- }
- //
- if (!bFound) {
- // Append Pave of nV to rhe edge nE
- const TopoDS_Edge& aE=*(TopoDS_Edge*)(&myDS->Shape(nE));
- const TopoDS_Vertex& aV= *(TopoDS_Vertex*)(&myDS->Shape(nV));
- iFlag=myContext.ComputeVE (aV, aE, aT);
- if (!iFlag) {
- BOPTools_Pave aPave;
- //
- aPave.SetInterference(-1);
- aPave.SetType (BooleanOperations_EdgeEdge);
- aPave.SetIndex(nV);
- aPave.SetParam(aT);
- aPaveSet.Append(aPave);
- }
- }
+ nV=aItMI.Key();
+ bFound=Standard_False;
+ aItLP.Initialize(aLP);
+ for (; aItLP.More(); aItLP.Next()) {
+ const BOPTools_Pave& aPave=aItLP.Value();
+ nVp=aPave.Index();
+ if (nVp==nV) {
+ bFound=!bFound;
+ break;
+ }
+ }
+ //
+ if (!bFound) {
+ // Append Pave of nV to rhe edge nE
+ const TopoDS_Edge& aE=*(TopoDS_Edge*)(&myDS->Shape(nE));
+ const TopoDS_Vertex& aV= *(TopoDS_Vertex*)(&myDS->Shape(nV));
+ iFlag=myContext.ComputeVE (aV, aE, aT);
+ if (!iFlag) {
+ BOPTools_Pave aPave;
+ //
+ aPave.SetInterference(-1);
+ aPave.SetType (BooleanOperations_EdgeEdge);
+ aPave.SetIndex(nV);
+ aPave.SetParam(aT);
+ aPaveSet.Append(aPave);
+ }
+ }
}//for (; aItMI.More(); aItMI.Next()) {
}//for (; anItLPB.More(); anItLPB.Next()) {
}
aEE.SetNewShape(nVnew);
//
for (j=0; j<2; ++j) {
- if (aMFence.Add(nE[j])) {
- aE=TopoDS::Edge(myDS->Shape(nE[j]));
- iFlag=myContext.ComputeVE (aVnew, aE, aT);
- if (!iFlag) {
- aPave.SetInterference(-1);
- aPave.SetType (BooleanOperations_EdgeEdge);
- aPave.SetIndex(nVnew);
- aPave.SetParam(aT);
- //
- BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE[j]));
- aPaveSet.Append(aPave);
- }
- }// if (aMFence.Add(nE[j])) {
+ if (aMFence.Add(nE[j])) {
+ aE=TopoDS::Edge(myDS->Shape(nE[j]));
+ iFlag=myContext.ComputeVE (aVnew, aE, aT);
+ if (!iFlag) {
+ aPave.SetInterference(-1);
+ aPave.SetType (BooleanOperations_EdgeEdge);
+ aPave.SetIndex(nVnew);
+ aPave.SetParam(aT);
+ //
+ BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE[j]));
+ aPaveSet.Append(aPave);
+ }
+ }// if (aMFence.Add(nE[j])) {
}// for (j=0; j<2; ++j) {
}//for (; aIt.More(); aIt.Next()) {
}// for (; aItIm.More(); aItIm.Next())
//purpose :
//=======================================================================
void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI,
- TopTools_DataMapOfShapeListOfShape& myImages,
- TopTools_DataMapOfShapeShape& myOrigins)
+ TopTools_DataMapOfShapeListOfShape& myImages,
+ TopTools_DataMapOfShapeShape& myOrigins)
{
Standard_Integer j, i, aNbV, aNbVSD;
Standard_Real aTol;
aNbIP=aMIP.Extent();
aIt1.Initialize(aMIP);
for(; aIt1.More(); aIt1.Next()) {
- aIP=aIt1.Key();
- if (aMIPC.Contains(aIP)) {
- continue;
- }
- //
- const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
- const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
- //
- aSelector.Clear();
- aSelector.SetBox(aBoxVP);
- //
- aNbVSD=aBBTree.Select(aSelector);
- if (!aNbVSD) {
- continue; // it must not be
- }
- //
- const TColStd_ListOfInteger& aLI=aSelector.Indices();
- aIt.Initialize(aLI);
- for (; aIt.More(); aIt.Next()) {
- aIP1=aIt.Value();
- if (aMIP.Contains(aIP1)) {
- continue;
- }
- aMIP1.Add(aIP1);
- } //for (; aIt.More(); aIt.Next()) {
+ aIP=aIt1.Key();
+ if (aMIPC.Contains(aIP)) {
+ continue;
+ }
+ //
+ const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+ const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
+ //
+ aSelector.Clear();
+ aSelector.SetBox(aBoxVP);
+ //
+ aNbVSD=aBBTree.Select(aSelector);
+ if (!aNbVSD) {
+ continue; // it must not be
+ }
+ //
+ const TColStd_ListOfInteger& aLI=aSelector.Indices();
+ aIt.Initialize(aLI);
+ for (; aIt.More(); aIt.Next()) {
+ aIP1=aIt.Value();
+ if (aMIP.Contains(aIP1)) {
+ continue;
+ }
+ aMIP1.Add(aIP1);
+ } //for (; aIt.More(); aIt.Next()) {
}//for(; aIt1.More(); aIt1.Next()) {
//
aNbIP1=aMIP1.Extent();
if (!aNbIP1) {
- break; // from while(1)
+ break; // from while(1)
}
//
aIt1.Initialize(aMIP);
for(; aIt1.More(); aIt1.Next()) {
- aIP=aIt1.Key();
- aMIPC.Add(aIP);
+ aIP=aIt1.Key();
+ aMIPC.Add(aIP);
}
//
aMIP.Clear();
aIt1.Initialize(aMIP1);
for(; aIt1.More(); aIt1.Next()) {
- aIP=aIt1.Key();
- aMIP.Add(aIP);
+ aIP=aIt1.Key();
+ aMIP.Add(aIP);
}
aMIP1.Clear();
}// while(1)
aIP=aIt1.Key();
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
if (!j) {
- aVF=aVP;
+ aVF=aVP;
}
aLVSD.Append(aVP);
aMVProcessed.Add(aVP);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aVSD=aItS.Value();
if (!myOrigins.IsBound(aVSD)) {
- myOrigins.Bind(aVSD, aV);
+ myOrigins.Bind(aVSD, aV);
}
}
}
//purpose :
//=======================================================================
void MakeNewVertex(const TopTools_ListOfShape& aLV,
- TopoDS_Vertex& aNewVertex)
+ TopoDS_Vertex& aNewVertex)
{
Standard_Integer aNbV;
Standard_Real aTolV, aD, aDmax;
// purpose:
//=======================================================================
void NMTTools_PaveFiller::EENewVertices (const TopoDS_Vertex& aNewVertex,
- const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
+ const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
{
Standard_Integer i, aNewShape, nE1, nE2;
Standard_Real aT1, aT2;
- BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
+ BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
BOPTools_Pave aPave;
//
BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
//
aNbNew=aNewLP.Extent();
if (aNbNew) {
- BOPTools_ListIteratorOfListOfPave anIt(aNewLP);
- for (; anIt.More(); anIt.Next()) {
- const BOPTools_Pave& aPave=anIt.Value();
- aPS.Append(aPave);
- }
- // Clear the ListOfPaveBlock
- BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(i));
- aLPB.Clear();
- // Prepare the paveBlocks for that egde again
- PreparePaveBlocks(i);
+ BOPTools_ListIteratorOfListOfPave anIt(aNewLP);
+ for (; anIt.More(); anIt.Next()) {
+ const BOPTools_Pave& aPave=anIt.Value();
+ aPS.Append(aPave);
+ }
+ // Clear the ListOfPaveBlock
+ BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(i));
+ aLPB.Clear();
+ // Prepare the paveBlocks for that egde again
+ PreparePaveBlocks(i);
}
aNewLP.Clear();
}
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PreparePaveBlocks(const TopAbs_ShapeEnum aType1,
- const TopAbs_ShapeEnum aType2)
+ const TopAbs_ShapeEnum aType2)
{
myIsDone=Standard_False;
//
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE[i]));
aNbSplits=aLPB.Extent();
if (!aNbSplits) {
- if (aMap.Add(nE[i])) {
- PreparePaveBlocks(nE[i]);
- if (!myIsDone) {
- return;
- }
- }
+ if (aMap.Add(nE[i])) {
+ PreparePaveBlocks(nE[i]);
+ if (!myIsDone) {
+ return;
+ }
+ }
}
}
}// for (; myDSIt.More(); myDSIt.Next())
BOPTColStd_Dump::PrintMessage(buf);
sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
throw
- BOPTColStd_Failure(buf) ;
+ BOPTColStd_Failure(buf) ;
}
//
if (iErr==6) {
sprintf(buf,
- "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
+ "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
BOPTColStd_Dump::PrintMessage(buf);
}
else {
// purpose:
//=======================================================================
void NMTTools_PaveFiller::CorrectShrunkRanges(const Standard_Integer aSide,
- const BOPTools_Pave& aPave,
- IntTools_ShrunkRange& aShrunkRange)
+ const BOPTools_Pave& aPave,
+ IntTools_ShrunkRange& aShrunkRange)
{
BooleanOperations_KindOfInterference aType;
Standard_Integer anIndexInterf ;
aNewRange.SetFirst(tNV);
aNewRange.SetLast (aSR.Last());
if(aNewRange.First() < aNewRange.Last()) {
- aShrunkRange.SetShrunkRange(aNewRange);
+ aShrunkRange.SetShrunkRange(aNewRange);
}
}
}
aNewRange.SetLast (tNV);
if(aNewRange.First() < aNewRange.Last()) {
- aShrunkRange.SetShrunkRange(aNewRange);
+ aShrunkRange.SetShrunkRange(aNewRange);
}
}
}
//=======================================================================
Standard_Boolean
NMTTools_PaveFiller::IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,
- const BOPTools_PaveBlock& aPB2) const
+ const BOPTools_PaveBlock& aPB2) const
{
Standard_Boolean bRetFlag=Standard_True;
Standard_Real aTolV11, aTolV12, aTolV21, aTolV22;
//
anItLPE.Initialize(aLPBx);
for (; anItLPE.More(); anItLPE.Next()) {
- const BOPTools_PaveBlock& aPBx=anItLPE.Value();
- nE=aPBx.OriginalEdge();
- NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
- aLCBE.Append(aCBx);
+ const BOPTools_PaveBlock& aPBx=anItLPE.Value();
+ nE=aPBx.OriginalEdge();
+ NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
+ aLCBE.Append(aCBx);
}
}
}
aTolMax=-1.;
anItLPE.Initialize(aLPBE);
for (i=0; anItLPE.More(); anItLPE.Next(), ++i) {
- const BOPTools_PaveBlock& aPB=anItLPE.Value();
- nSp=aPB.OriginalEdge();
- const TopoDS_Edge& aSp=TopoDS::Edge(myDS->Shape(nSp));
- aTolSp=BRep_Tool::Tolerance(aSp);
- if (aTolSp>aTolMax) {
- iMax=i;
- aTolSp=aTolMax;
- }
+ const BOPTools_PaveBlock& aPB=anItLPE.Value();
+ nSp=aPB.OriginalEdge();
+ const TopoDS_Edge& aSp=TopoDS::Edge(myDS->Shape(nSp));
+ aTolSp=BRep_Tool::Tolerance(aSp);
+ if (aTolSp>aTolMax) {
+ iMax=i;
+ aTolSp=aTolMax;
+ }
}
//
BOPTools_ListOfPaveBlock aLPBx;
//
anItLPE.Initialize(aLPBE);
for (i=0; anItLPE.More(); anItLPE.Next(), ++i) {
- const BOPTools_PaveBlock& aPB=anItLPE.Value();
- if (i==iMax) {
- aLPBx.Prepend(aPB);
- }
- else {
- aLPBx.Append(aPB);
- }
+ const BOPTools_PaveBlock& aPB=anItLPE.Value();
+ if (i==iMax) {
+ aLPBx.Prepend(aPB);
+ }
+ else {
+ aLPBx.Append(aPB);
+ }
}
//
pLPBE=(BOPTools_ListOfPaveBlock *)&aLPBE;
NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
anItCBE.Initialize(aLCBE);
for (; anItCBE.More(); anItCBE.Next()) {
- const NMTTools_CommonBlock& aCBE=anItCBE.Value();
- if (aCBE.IsEqual(aCB)) {
- aLCBE.Remove(anItCBE);
- break;
- }
+ const NMTTools_CommonBlock& aCBE=anItCBE.Value();
+ if (aCBE.IsEqual(aCB)) {
+ aLCBE.Remove(anItCBE);
+ break;
+ }
}
}
}
// purpose:
//=======================================================================
void NMTTools_PaveFiller::SplitCommonBlock(const NMTTools_CommonBlock& aCB,
- NMTTools_ListOfCommonBlock& aLCBx)
+ NMTTools_ListOfCommonBlock& aLCBx)
{
Standard_Integer i, j, k, nE, aNbE, aNbSPBx, aNbPB;
BOPTools_SequenceOfPaveBlock aSPBx;
for (; anIt.More(); anIt.Next()) {
const BOPTools_Pave& aPx=anIt.Value();
if (aPB.IsInBlock(aPx)) {
- aPSx.Append(aPx);
+ aPSx.Append(aPx);
}
}
aNbPB=aPSx.Set().Extent();
for (; anIt.More(); anIt.Next()) {
const BOPTools_Pave& aPx=anIt.Value();
if (aPB.IsInBlock(aPx)) {
- aPSx.Append(aPx);
+ aPSx.Append(aPx);
}
}
//
// purpose:
//=======================================================================
void VertexParameters(const IntTools_CommonPrt& aCPart,
- Standard_Real& aT1,
- Standard_Real& aT2)
+ Standard_Real& aT1,
+ Standard_Real& aT2)
{
const IntTools_Range& aR1=aCPart.Range1();
aT1=0.5*(aR1.First()+aR1.Last());
// purpose:
//=======================================================================
Standard_Boolean IsOnPave(const Standard_Real& aT1,
- const IntTools_Range& aRange,
- const Standard_Real& aTolerance)
+ const IntTools_Range& aRange,
+ const Standard_Real& aTolerance)
{
Standard_Boolean firstisonpave1, firstisonpave2, bIsOnPave;
//
// purpose:
//=======================================================================
void FindChains(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
- NMTTools_ListOfCommonBlock& aLCB)
+ NMTTools_ListOfCommonBlock& aLCB)
{
Standard_Integer i, j, aNbCB, aNbPB;
BOPTools_IMapOfPaveBlock aProcessedBlocks, aChain;
// purpose:
//=======================================================================
void ProcessBlock(const BOPTools_PaveBlock& aPB,
- const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
- BOPTools_IMapOfPaveBlock& aProcessedBlocks,
- BOPTools_IMapOfPaveBlock& aChain)
+ const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
+ BOPTools_IMapOfPaveBlock& aProcessedBlocks,
+ BOPTools_IMapOfPaveBlock& aChain)
{
Standard_Integer j, aNbPB;
//
const TopoDS_Face& aF=TopoDS::Face(myDS->Shape(nF));
const Bnd_Box& aBF=myDS->GetBoundingBox(nF);
if (aBF.IsOut(aBV)) {
- continue;
+ continue;
}
//
anIndexIn=0;
aFlag=myContext.ComputeVS (aVnew, aF, aU, aV);
if (!aFlag) {
- BOPTools_VSInterference anInterf (nNewShape, nF, aU, aV);
- //
- anIndexIn=aVSs.Append(anInterf);
- BOPTools_VSInterference& aVS=aVSs(anIndexIn);
- aVS.SetNewShape(nNewShape);//->
+ BOPTools_VSInterference anInterf (nNewShape, nF, aU, aV);
+ //
+ anIndexIn=aVSs.Append(anInterf);
+ BOPTools_VSInterference& aVS=aVSs(anIndexIn);
+ aVS.SetNewShape(nNewShape);//->
}
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller_5.cxx
-// Created: Mon Dec 15 11:28:33 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller_5.cxx
+// Created: Mon Dec 15 11:28:33 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
static
void VertexParameter(const IntTools_CommonPrt& aCPart,
- Standard_Real& aT);
+ Standard_Real& aT);
static
Standard_Boolean IsOnPave(const Standard_Real& aTR,
- const IntTools_Range& aCPRange,
- const Standard_Real& aTolerance);
+ const IntTools_Range& aCPRange,
+ const Standard_Real& aTolerance);
//
//=======================================================================
// function: PerformEF
for (; anIt.More(); anIt.Next()) {
BOPTools_PaveBlock& aPB=anIt.Value();
if (aCBAPIF.IsCommonBlock(aPB)) {
- continue;
+ continue;
}
//
const IntTools_ShrunkRange& aShrunkRange=aPB.ShrunkRange();
const Bnd_Box& aBBE=aShrunkRange.BndBox();
//
if (aBBF.IsOut (aBBE)) {
- continue;
+ continue;
}
//
// EF
aEF.Perform();
//
if (aEF.IsDone()) {
- Standard_Boolean bCoinsideFlag;
- Standard_Integer i, aNbCPrts;
- TopAbs_ShapeEnum aType;
- //
- const IntTools_SequenceOfCommonPrts& aCPrts=aEF.CommonParts();
- //
- aNbCPrts=aCPrts.Length();
- for (i=1; i<=aNbCPrts; ++i) {
- anIndexIn=0;
- //
- const IntTools_CommonPrt& aCPart=aCPrts(i);
- aType=aCPart.Type();
- //
- switch (aType) {
- //
- case TopAbs_VERTEX: {
- Standard_Boolean bIsOnPave1, bIsOnPave2;
- Standard_Integer nVF;
- Standard_Real aT, aTolToDecide;
- TopoDS_Vertex aNewVertex;
- //
- const IntTools_Range& aR=aCPart.Range1();
- //
- // New Vertex
- VertexParameter(aCPart, aT);
- BOPTools_Tools::MakeNewVertex(aE, aT, aF, aNewVertex);
- //
- //decide to add pave or not
- aTolToDecide=5.e-8;
- bIsOnPave1=IsOnPave(anewSR.First(), aR, aTolToDecide);
- bIsOnPave2=IsOnPave(anewSR.Last() , aR, aTolToDecide);
- //
- if (!bIsOnPave1 && !bIsOnPave2) {
- nVF=CheckFacePaves(aNewVertex, nF);
- if (!nVF) {
- // really new vertex
- // Add Interference to the Pool
- BOPTools_ESInterference anInterf (nE, nF, aCPart);
- anIndexIn=aEFs.Append(anInterf);
- anInterf.SetNewShape(0);
- //
- aMapVI.Add(aNewVertex, anIndexIn);
- aIMPBx.Add(aPB);
- //
- myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
- //
- }// if (!nVF)
- }// if (!bIsOnPave1 && !bIsOnPave2)
- //
- //modified by NIZNHY-PKV Fri Apr 18 10:55:38 2008f
- else {
- const BOPTools_Pave& aPave=(bIsOnPave1)? aPB.Pave1() : aPB.Pave2();
- nVF=aPave.Index();
- const TopoDS_Vertex& aVF=TopoDS::Vertex(myDS->Shape(nVF));
- BOPTools_Tools::UpdateVertex (aVF, aNewVertex);
- }
- //modified by NIZNHY-PKV Fri Apr 18 10:55:40 2008t
- //
- }// case TopAbs_VERTEX:
- break;
- //
- case TopAbs_EDGE: {
- bCoinsideFlag=BOPTools_Tools::IsBlockInOnFace(aPB, aF, myContext);
- if (!bCoinsideFlag) {
- break;
- }
- //
- // Fill aMapCB
- if (aMapCB.Contains(aPB)) {
- TColStd_IndexedMapOfInteger& aMapF=aMapCB.ChangeFromKey(aPB);
- aMapF.Add(nF);
- }
- else {
- TColStd_IndexedMapOfInteger aMapF;
- aMapF.Add(nF);
- aMapCB.Add(aPB, aMapF);
- }
- //
- aIMPBx.Add(aPB);
- myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
- }// case TopAbs_EDGE:
- break;
+ Standard_Boolean bCoinsideFlag;
+ Standard_Integer i, aNbCPrts;
+ TopAbs_ShapeEnum aType;
+ //
+ const IntTools_SequenceOfCommonPrts& aCPrts=aEF.CommonParts();
+ //
+ aNbCPrts=aCPrts.Length();
+ for (i=1; i<=aNbCPrts; ++i) {
+ anIndexIn=0;
+ //
+ const IntTools_CommonPrt& aCPart=aCPrts(i);
+ aType=aCPart.Type();
+ //
+ switch (aType) {
+ //
+ case TopAbs_VERTEX: {
+ Standard_Boolean bIsOnPave1, bIsOnPave2;
+ Standard_Integer nVF;
+ Standard_Real aT, aTolToDecide;
+ TopoDS_Vertex aNewVertex;
+ //
+ const IntTools_Range& aR=aCPart.Range1();
+ //
+ // New Vertex
+ VertexParameter(aCPart, aT);
+ BOPTools_Tools::MakeNewVertex(aE, aT, aF, aNewVertex);
+ //
+ //decide to add pave or not
+ aTolToDecide=5.e-8;
+ bIsOnPave1=IsOnPave(anewSR.First(), aR, aTolToDecide);
+ bIsOnPave2=IsOnPave(anewSR.Last() , aR, aTolToDecide);
+ //
+ if (!bIsOnPave1 && !bIsOnPave2) {
+ nVF=CheckFacePaves(aNewVertex, nF);
+ if (!nVF) {
+ // really new vertex
+ // Add Interference to the Pool
+ BOPTools_ESInterference anInterf (nE, nF, aCPart);
+ anIndexIn=aEFs.Append(anInterf);
+ anInterf.SetNewShape(0);
+ //
+ aMapVI.Add(aNewVertex, anIndexIn);
+ aIMPBx.Add(aPB);
+ //
+ myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
+ //
+ }// if (!nVF)
+ }// if (!bIsOnPave1 && !bIsOnPave2)
+ //
+ //modified by NIZNHY-PKV Fri Apr 18 10:55:38 2008f
+ else {
+ const BOPTools_Pave& aPave=(bIsOnPave1)? aPB.Pave1() : aPB.Pave2();
+ nVF=aPave.Index();
+ const TopoDS_Vertex& aVF=TopoDS::Vertex(myDS->Shape(nVF));
+ BOPTools_Tools::UpdateVertex (aVF, aNewVertex);
+ }
+ //modified by NIZNHY-PKV Fri Apr 18 10:55:40 2008t
+ //
+ }// case TopAbs_VERTEX:
+ break;
+ //
+ case TopAbs_EDGE: {
+ bCoinsideFlag=BOPTools_Tools::IsBlockInOnFace(aPB, aF, myContext);
+ if (!bCoinsideFlag) {
+ break;
+ }
+ //
+ // Fill aMapCB
+ if (aMapCB.Contains(aPB)) {
+ TColStd_IndexedMapOfInteger& aMapF=aMapCB.ChangeFromKey(aPB);
+ aMapF.Add(nF);
+ }
+ else {
+ TColStd_IndexedMapOfInteger aMapF;
+ aMapF.Add(nF);
+ aMapCB.Add(aPB, aMapF);
+ }
+ //
+ aIMPBx.Add(aPB);
+ myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
+ }// case TopAbs_EDGE:
+ break;
- default:
- break;
- } // switch (aType)
- } // for (i=1; i<=aNbCPrts; i++)
+ default:
+ break;
+ } // switch (aType)
+ } // for (i=1; i<=aNbCPrts; i++)
} //if (aEF.IsDone())
} // for (; anIt.More(); anIt.Next())
}// for (; myDSIt.More(); myDSIt.Next())
nEx=aPBx.OriginalEdge();
NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nEx));
if (aLCB.Extent()) {
- NMTTools_CommonBlockAPI aCBAPIx(aLCB);
- if (aCBAPIx.IsCommonBlock(aPBx)) {
- NMTTools_CommonBlock& aCBx=aCBAPIx.CommonBlock(aPBx);
- const BOPTools_PaveBlock& aPB1=aCBx.PaveBlock1();
- if (!aMx.Contains(aPB1)){
- aMx.Add(aPB1);
- aLCBx.Append(aCBx);
- }
- }
+ NMTTools_CommonBlockAPI aCBAPIx(aLCB);
+ if (aCBAPIx.IsCommonBlock(aPBx)) {
+ NMTTools_CommonBlock& aCBx=aCBAPIx.CommonBlock(aPBx);
+ const BOPTools_PaveBlock& aPB1=aCBx.PaveBlock1();
+ if (!aMx.Contains(aPB1)){
+ aMx.Add(aPB1);
+ aLCBx.Append(aCBx);
+ }
+ }
}
}
}
if (aCBAPI.IsCommonBlock(aPB)) {
NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
for (j=1; j<=aNbF; ++j) {
- nF=aMapF(j);
- aCB.AddFace(nF);
+ nF=aMapF(j);
+ aCB.AddFace(nF);
}
}
else {
//
aCB.AddPaveBlock(aPB);
for (j=1; j<=aNbF; ++j) {
- nF=aMapF(j);
- aCB.AddFace(nF);
+ nF=aMapF(j);
+ aCB.AddFace(nF);
}
aLCB.Append(aCB);
}
aFlag=myContext.ComputeVE (aNewVertex, aE, aT);
//
if (!aFlag) {
- aPave.SetInterference(-1);
- aPave.SetType (BooleanOperations_EdgeSurface);
- aPave.SetIndex(aNewShape);
- aPave.SetParam(aT);
- //
- BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
- aPaveSet.Append(aPave);
+ aPave.SetInterference(-1);
+ aPave.SetType (BooleanOperations_EdgeSurface);
+ aPave.SetIndex(aNewShape);
+ aPave.SetParam(aT);
+ //
+ BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
+ aPaveSet.Append(aPave);
}
}
}
// purpose:
//=======================================================================
void VertexParameter(const IntTools_CommonPrt& aCPart,
- Standard_Real& aT)
+ Standard_Real& aT)
{
const IntTools_Range& aR=aCPart.Range1();
aT=0.5*(aR.First()+aR.Last());
// purpose:
//=======================================================================
Standard_Boolean IsOnPave(const Standard_Real& aTR,
- const IntTools_Range& aCPRange,
- const Standard_Real& aTolerance)
+ const IntTools_Range& aCPRange,
+ const Standard_Real& aTolerance)
{
Standard_Boolean bIsOnPave;
Standard_Real aT1, aT2, dT1, dT2;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// IMPROVED by NIZNHY-PKV Thu Oct 12 16:03:33 2006
-// File: NMTTools_PaveFiller_6.cxx
-// Created: Fri Dec 19 10:27:31 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller_6.cxx
+// Created: Fri Dec 19 10:27:31 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
#include <NMTTools_PaveFiller.ixx>
/*
static
void SharedEdges1(const TopoDS_Face& aF1,
- const TopoDS_Face& aF2,
- TopTools_ListOfShape& aLS);
+ const TopoDS_Face& aF2,
+ TopTools_ListOfShape& aLS);
*/
static
Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
- IntTools_Context& aCtx);
+ IntTools_Context& aCtx);
//=======================================================================
// function: PerformFF
IntTools_FaceFace aFF;
//
aFF.SetParameters (bToApproxC3d, bToApproxC2dOnS1,
- bToApproxC2dOnS2, anApproxTol);
+ bToApproxC2dOnS2, anApproxTol);
//
aFF.Perform(aF1, aF2);
//
aType=aS.ShapeType();
//
if (aType==TopAbs_EDGE) {
- const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(i));
- aItCB.Initialize(aLCB);
- for (; aItCB.More(); aItCB.Next()) {
- const NMTTools_CommonBlock& aCB=aItCB.Value();
- const BOPTools_PaveBlock &aPB1=aCB.PaveBlock1();
- //
- const TColStd_ListOfInteger& aLF=aCB.Faces();
- aNbF=aLF.Extent();
- if (aNbF) {
- aItF.Initialize(aLF);
- for (; aItF.More(); aItF.Next()) {
- nF=aItF.Value();
- if (aMFInOn.IsBound(nF)) {
- BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
- aLPB.Append(aPB1);
- }
- else {
- BOPTools_ListOfPaveBlock aLPB;
- aLPB.Append(aPB1);
- aMFInOn.Bind(nF, aLPB);
- }
- }
- }// if (aNbF) {
- } // for (; aItCB.More(); aItCB.Next()) {
+ const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(i));
+ aItCB.Initialize(aLCB);
+ for (; aItCB.More(); aItCB.Next()) {
+ const NMTTools_CommonBlock& aCB=aItCB.Value();
+ const BOPTools_PaveBlock &aPB1=aCB.PaveBlock1();
+ //
+ const TColStd_ListOfInteger& aLF=aCB.Faces();
+ aNbF=aLF.Extent();
+ if (aNbF) {
+ aItF.Initialize(aLF);
+ for (; aItF.More(); aItF.Next()) {
+ nF=aItF.Value();
+ if (aMFInOn.IsBound(nF)) {
+ BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
+ aLPB.Append(aPB1);
+ }
+ else {
+ BOPTools_ListOfPaveBlock aLPB;
+ aLPB.Append(aPB1);
+ aMFInOn.Bind(nF, aLPB);
+ }
+ }
+ }// if (aNbF) {
+ } // for (; aItCB.More(); aItCB.Next()) {
}//if (aS.ShapeType()==TopAbs_EDGE) {
//
else if (aType==TopAbs_FACE) {
- BOPTools_ListOfPaveBlock aLPBOn;
- //
- nF=i;
- RealSplitsFace(nF, aLPBOn);
- //
- aNbOn=aLPBOn.Extent();
- if (aNbOn) {
- if (aMFInOn.IsBound(nF)) {
- BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
- aLPB.Append(aLPBOn);
- }
- else {
- aMFInOn.Bind(nF, aLPBOn);
- }
- }
+ BOPTools_ListOfPaveBlock aLPBOn;
+ //
+ nF=i;
+ RealSplitsFace(nF, aLPBOn);
+ //
+ aNbOn=aLPBOn.Extent();
+ if (aNbOn) {
+ if (aMFInOn.IsBound(nF)) {
+ BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
+ aLPB.Append(aLPBOn);
+ }
+ else {
+ aMFInOn.Bind(nF, aLPBOn);
+ }
+ }
}
} // for (i=1; i<=aNbS; ++i) {
//
BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
anItPB.Initialize(aLPB);
for (; anItPB.More(); anItPB.Next()) {
- const BOPTools_PaveBlock& aPB=anItPB.Value();
- nSp=aPB.Edge();
- if (aMTmp.Add(nSp)) {
- aLPBX.Append(aPB);
- }
+ const BOPTools_PaveBlock& aPB=anItPB.Value();
+ nSp=aPB.Edge();
+ if (aMTmp.Add(nSp)) {
+ aLPBX.Append(aPB);
+ }
}
aLPB.Clear();
aLPB.Append(aLPBX);
NMTTools_MapOfPaveBlock aMPB;
//
if (aMFInOn.IsBound(nF1)) {
- const BOPTools_ListOfPaveBlock& aLPBF1=aMFInOn.Find(nF1);
- anItPB.Initialize(aLPBF1);
- for (; anItPB.More(); anItPB.Next()) {
- const BOPTools_PaveBlock& aPB=anItPB.Value();
- if (aMPB.Add(aPB)) {
- aLPB.Append(aPB);
- }
- }
+ const BOPTools_ListOfPaveBlock& aLPBF1=aMFInOn.Find(nF1);
+ anItPB.Initialize(aLPBF1);
+ for (; anItPB.More(); anItPB.Next()) {
+ const BOPTools_PaveBlock& aPB=anItPB.Value();
+ if (aMPB.Add(aPB)) {
+ aLPB.Append(aPB);
+ }
+ }
}
if (aMFInOn.IsBound(nF2)) {
- const BOPTools_ListOfPaveBlock& aLPBF2=aMFInOn.Find(nF2);
- anItPB.Initialize(aLPBF2);
- for (; anItPB.More(); anItPB.Next()) {
- const BOPTools_PaveBlock& aPB=anItPB.Value();
- if (aMPB.Contains(aPB)) {
- aFFi.AppendBlock(aPB);
- }
- else {
- aLPB.Append(aPB);
- }
- }
+ const BOPTools_ListOfPaveBlock& aLPBF2=aMFInOn.Find(nF2);
+ anItPB.Initialize(aLPBF2);
+ for (; anItPB.More(); anItPB.Next()) {
+ const BOPTools_PaveBlock& aPB=anItPB.Value();
+ if (aMPB.Contains(aPB)) {
+ aFFi.AppendBlock(aPB);
+ }
+ else {
+ aLPB.Append(aPB);
+ }
+ }
}
}
//---
//
BOPTools_PaveBlockIterator aPBIter(0, aPaveSet);
for (; aPBIter.More(); aPBIter.Next()) {
- BOPTools_PaveBlock& aPBNew=aPBIter.Value();
- aPBNew.SetCurve(aIC);
- aPBNew.SetFace1(nF1);
- aPBNew.SetFace2(nF2);
- //
- nV1=aPBNew.Pave1().Index();
- nV2=aPBNew.Pave2().Index();
- aT1=aPBNew.Pave1().Param();
- aT2=aPBNew.Pave2().Param();
- //
- if((nV1==nV2) && (Abs(aT2 - aT1) < aTolPPC)) {
- continue;// mkk ft ???
- }
- //
- // 1
- bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLPB, aTolR3D);
- if (bIsExistingPaveBlock) {
- continue;
- }
- //
- bIsCoincided=CheckCoincidence(aPBNew, aLPB);
- if(bIsCoincided) {
- continue;
- }
- //
- // Modified
- // to provide checking whether aPBNew already exists in list
- // of section edges aLSE
- // Thu Sep 14 14:35:18 2006
- // Contribution of Samtech www.samcef.com BEGIN
- // 2
- bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLSE, aTolR3D);
- if (bIsExistingPaveBlock) {
- continue;
- }
- // Contribution of Samtech www.samcef.com END
- //
- // Checking of validity in 2D
- //
- bIsValidIn2D=myContext.IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTol2D);
- if (!bIsValidIn2D) {
- continue;
- }
- //
- //
- // Make Section Edge
- TopoDS_Edge aES;
- //
- const TopoDS_Vertex aV1=TopoDS::Vertex(myDS->Shape(nV1));//mpv
- const TopoDS_Vertex aV2=TopoDS::Vertex(myDS->Shape(nV2));//mpv
- //
- BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
- //
- NMTTools_Tools::UpdateEdge (aES, aTolR3D);
- bIsMicroEdge=IsMicroEdge(aES, myContext);
- if (bIsMicroEdge) {
- continue;
- }
- //
-
- {
- Handle(Geom2d_Curve) aC2D1, aC2D2;
- //
- aC2D1=aIC.FirstCurve2d();
- aC2D2=aIC.SecondCurve2d();
- //
- NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
- NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
- }
- //
- aMEPB.Add(aES, aPBNew);
- aMapEI.Add(aES, i);
- //
- bHasES=Standard_True;
+ BOPTools_PaveBlock& aPBNew=aPBIter.Value();
+ aPBNew.SetCurve(aIC);
+ aPBNew.SetFace1(nF1);
+ aPBNew.SetFace2(nF2);
+ //
+ nV1=aPBNew.Pave1().Index();
+ nV2=aPBNew.Pave2().Index();
+ aT1=aPBNew.Pave1().Param();
+ aT2=aPBNew.Pave2().Param();
+ //
+ if((nV1==nV2) && (Abs(aT2 - aT1) < aTolPPC)) {
+ continue;// mkk ft ???
+ }
+ //
+ // 1
+ bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLPB, aTolR3D);
+ if (bIsExistingPaveBlock) {
+ continue;
+ }
+ //
+ bIsCoincided=CheckCoincidence(aPBNew, aLPB);
+ if(bIsCoincided) {
+ continue;
+ }
+ //
+ // Modified
+ // to provide checking whether aPBNew already exists in list
+ // of section edges aLSE
+ // Thu Sep 14 14:35:18 2006
+ // Contribution of Samtech www.samcef.com BEGIN
+ // 2
+ bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLSE, aTolR3D);
+ if (bIsExistingPaveBlock) {
+ continue;
+ }
+ // Contribution of Samtech www.samcef.com END
+ //
+ // Checking of validity in 2D
+ //
+ bIsValidIn2D=myContext.IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTol2D);
+ if (!bIsValidIn2D) {
+ continue;
+ }
+ //
+ //
+ // Make Section Edge
+ TopoDS_Edge aES;
+ //
+ const TopoDS_Vertex aV1=TopoDS::Vertex(myDS->Shape(nV1));//mpv
+ const TopoDS_Vertex aV2=TopoDS::Vertex(myDS->Shape(nV2));//mpv
+ //
+ BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
+ //
+ NMTTools_Tools::UpdateEdge (aES, aTolR3D);
+ bIsMicroEdge=IsMicroEdge(aES, myContext);
+ if (bIsMicroEdge) {
+ continue;
+ }
+ //
+
+ {
+ Handle(Geom2d_Curve) aC2D1, aC2D2;
+ //
+ aC2D1=aIC.FirstCurve2d();
+ aC2D2=aIC.SecondCurve2d();
+ //
+ NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
+ NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
+ }
+ //
+ aMEPB.Add(aES, aPBNew);
+ aMapEI.Add(aES, i);
+ //
+ bHasES=Standard_True;
}// for (; aPBIter.More(); aPBIter.Next())
} // end of for (j=1; j<=aNbCurves; ++j)
// qqf
nV1=aPBSE.Pave1().Index();
const TopoDS_Shape aV1=myDS->Shape(nV1);//mpv
if (aV1.IsSame(aV)) {
- aMNewOld.Add(i, nV1);
- break;
+ aMNewOld.Add(i, nV1);
+ break;
}
nV2=aPBSE.Pave2().Index();
const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
if (aV2.IsSame(aV)) {
- aMNewOld.Add(i, nV2);
- break;
+ aMNewOld.Add(i, nV2);
+ break;
}
}
}
const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));
//
if (aCBAPI.IsCommonBlock(aPB)) {
- // it can be Common Block
- Standard_Real aTolEx;
- Handle(Geom2d_Curve) aC2D1, aC2D2;
- TopoDS_Face aF1FWD, aF2FWD;
- //
- NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
- //const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
- //
- aPB=aCB.PaveBlock1();
- mE=aPB.Edge(); // index of edge in tDS
- const TopoDS_Edge& aEx=TopoDS::Edge(tDS.Shape(mE));
- aTolEx=BRep_Tool::Tolerance(aEx);
+ // it can be Common Block
+ Standard_Real aTolEx;
+ Handle(Geom2d_Curve) aC2D1, aC2D2;
+ TopoDS_Face aF1FWD, aF2FWD;
//
- aF1FWD=aF1;
- aF1FWD.Orientation(TopAbs_FORWARD);
- aF2FWD=aF2;
- aF2FWD.Orientation(TopAbs_FORWARD);
- //
- NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
- NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
- NMTTools_Tools::UpdateEdge (aEx, aTolEx);
+ NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
+ //const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
+ //
+ aPB=aCB.PaveBlock1();
+ mE=aPB.Edge(); // index of edge in tDS
+ const TopoDS_Edge& aEx=TopoDS::Edge(tDS.Shape(mE));
+ aTolEx=BRep_Tool::Tolerance(aEx);
+ //
+ aF1FWD=aF1;
+ aF1FWD.Orientation(TopAbs_FORWARD);
+ aF2FWD=aF2;
+ aF2FWD.Orientation(TopAbs_FORWARD);
+ //
+ NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
+ NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
+ NMTTools_Tools::UpdateEdge (aEx, aTolEx);
} //if (aCBAPI.IsCommonBlock(aPB))
//
// new SE
const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
//
if (!aMNewOld.Contains(mE)) {
- // add new SE to the myDS
- BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
- //
- anASSeq.SetNewSuccessor(nV1);
- anASSeq.SetNewOrientation(aV1.Orientation());
+ // add new SE to the myDS
+ BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
+ //
+ anASSeq.SetNewSuccessor(nV1);
+ anASSeq.SetNewOrientation(aV1.Orientation());
- anASSeq.SetNewSuccessor(nV2);
- anASSeq.SetNewOrientation(aV2.Orientation());
-
- myDS->InsertShapeAndAncestorsSuccessors(aSp, anASSeq);
- nE=myDS->NumberOfInsertedShapes();
- //
- aMNewOld.Add(mE, nE);
+ anASSeq.SetNewSuccessor(nV2);
+ anASSeq.SetNewOrientation(aV2.Orientation());
+
+ myDS->InsertShapeAndAncestorsSuccessors(aSp, anASSeq);
+ nE=myDS->NumberOfInsertedShapes();
+ //
+ aMNewOld.Add(mE, nE);
}
else {
- nE=aMNewOld.FindFromKey(mE);
+ nE=aMNewOld.FindFromKey(mE);
}
// Form PaveBlock;
BOPTools_PaveBlock aPBx;
const TColStd_ListOfInteger& aLF=aCB.Faces();
aNbF=aLF.Extent();
if (!aNbF) {
- continue;
+ continue;
}
//
nSp=aPB1.Edge();
//
aItF.Initialize(aLF);
for (; aItF.More(); aItF.Next()) {
- nF=aItF.Value();
- aF1FWD=TopoDS::Face(myDS->Shape(nF));
- aF1FWD.Orientation(TopAbs_FORWARD);
- //
- BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aSp, aF1FWD);
+ nF=aItF.Value();
+ aF1FWD=TopoDS::Face(myDS->Shape(nF));
+ aF1FWD.Orientation(TopAbs_FORWARD);
+ //
+ BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aSp, aF1FWD);
} // for (; aItCB.More(); aItCB.Next()) {
}//if (aS.ShapeType()==TopAbs_EDGE) {
}
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
- const BOPTools_ListOfPaveBlock& aLPBR,
- const Standard_Real aTolR3D)
+ const BOPTools_ListOfPaveBlock& aLPBR,
+ const Standard_Real aTolR3D)
{
Standard_Boolean bFlag;
Standard_Integer nVNew1, nVNew2, nV1, nV2, iC;
//
iC=CheckIntermediatePoint(aPBNew, aPBR, aTolR3D);
if (!iC) {
- return !bFlag;
+ return !bFlag;
}
}
}
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
- const TopTools_ListOfShape& aLSE,
- const Standard_Real aTolR3D)
+ const TopTools_ListOfShape& aLSE,
+ const Standard_Real aTolR3D)
{
Standard_Boolean bFlag;
Standard_Integer aNbSE, iC;
// purpose:
//=======================================================================
Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
- const BOPTools_PaveBlock& aPBR,
- const Standard_Real aTolC)
-
+ const BOPTools_PaveBlock& aPBR,
+ const Standard_Real aTolC)
+
{
Standard_Integer iVM, nE2;
//
// purpose:
//=======================================================================
Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
- const TopoDS_Edge& aE2,
- const Standard_Real aTolC)
+ const TopoDS_Edge& aE2,
+ const Standard_Real aTolC)
{
Standard_Real aT11, aT12, aTM, aTmp;
Standard_Integer iVM;
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PutBoundPaveOnCurve(BOPTools_Curve& aBC,
- BOPTools_SSInterference& aFFi)
+ BOPTools_SSInterference& aFFi)
{
Standard_Boolean bHasBounds, bVF;
Standard_Integer nF1, nF2;
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PutBoundPaveOnCurve(const gp_Pnt& aP,
- const Standard_Real aT,
- BOPTools_Curve& aBC,
- BOPTools_SSInterference& aFFi)
+ const Standard_Real aT,
+ BOPTools_Curve& aBC,
+ BOPTools_SSInterference& aFFi)
{
Standard_Boolean bFound1, bFound2;
Standard_Integer nV;
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::FindPave(const gp_Pnt& aP,
- const Standard_Real aTolPV,
- const BOPTools_PaveSet& aPS,
- BOPTools_Pave& aPave)
+ const Standard_Real aTolPV,
+ const BOPTools_PaveSet& aPS,
+ BOPTools_Pave& aPave)
{
Standard_Integer nV;
Standard_Boolean bIsVertex=Standard_False;
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PrepareSetForFace(const Standard_Integer ,//nF1,
- const Standard_Integer ,//nF2,
- const BOPTools_ListOfPaveBlock& aLPBC,
- BOPTools_PaveSet& aPSF)
+ const Standard_Integer ,//nF2,
+ const BOPTools_ListOfPaveBlock& aLPBC,
+ BOPTools_PaveSet& aPSF)
{
Standard_Integer nV1, nV2;
TColStd_MapOfInteger aMap;
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PutPaveOnCurve(const BOPTools_PaveSet& aPaveSet,
- const Standard_Real aTolR3D,
- BOPTools_Curve& aBC)
+ const Standard_Real aTolR3D,
+ BOPTools_Curve& aBC)
{
Standard_Integer nV;
Standard_Boolean bIsVertexOnLine;
//=======================================================================
/*
void SharedEdges1(const TopoDS_Face& aF1,
- const TopoDS_Face& aF2,
- TopTools_ListOfShape& aLS)
+ const TopoDS_Face& aF2,
+ TopTools_ListOfShape& aLS)
{
Standard_Integer i, aNbE, aNbF;;
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
aNbF=aLF.Extent();
if (aNbF>1) {
if (aNbF==2) {
- const TopoDS_Shape& aF1x=aLF.First();
- const TopoDS_Shape& aF2x=aLF.Last();
- if (aF1x.IsSame(aF2x)) {
- continue;
- }
+ const TopoDS_Shape& aF1x=aLF.First();
+ const TopoDS_Shape& aF2x=aLF.Last();
+ if (aF1x.IsSame(aF2x)) {
+ continue;
+ }
}
const TopoDS_Shape& aE=aMEF.FindKey(i);
aLS.Append (aE);
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& aPBNew,
- const BOPTools_ListOfPaveBlock& aLPBFF)
-
+ const BOPTools_ListOfPaveBlock& aLPBFF)
+
{
Standard_Boolean bRet;
Standard_Real aTE;
iCount++;
iV++;
if (iCount>iCountExt) {
- break;
+ break;
}
}
//
iCount++;
iV++;
if (iCount>iCountExt) {
- break;
+ break;
}
}
// VE
if (!iV) {
iVE=myContext.ComputeVE (aV11, aE2, aTE);
if (!iVE) {
- iCount++;
- if (iCount>iCountExt) {
- break;
- }
+ iCount++;
+ if (iCount>iCountExt) {
+ break;
+ }
}
}
// VV
iCount++;
iV++;
if (iCount>iCountExt) {
- break;
+ break;
}
}
//
iCount++;
iV++;
if (iCount>iCountExt) {
- break;
+ break;
}
}
// VE
if (!iV) {
iVE=myContext.ComputeVE (aV12, aE2, aTE);
if (!iVE) {
- iCount++;
- if (iCount>iCountExt) {
- break;
- }
+ iCount++;
+ if (iCount>iCountExt) {
+ break;
+ }
}
}
} // next aPBR
//purpose :
//=======================================================================
Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
- IntTools_Context& aCtx)
+ IntTools_Context& aCtx)
{
Standard_Boolean bRet;
Standard_Integer iErr;
IntTools_Range aR;
//
bRet=(BRep_Tool::Degenerated(aE) ||
- !BRep_Tool::IsGeometric(aE));
+ !BRep_Tool::IsGeometric(aE));
if (bRet) {
return bRet;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller_7.cxx
-// Created: Thu Dec 18 15:14:55 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller_7.cxx
+// Created: Thu Dec 18 15:14:55 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
// Contribution of Samtech www.samcef.com BEGIN
static
void FuseVertices(const TopoDS_Shape& aCompound,
- TopTools_DataMapOfShapeShape& aDMVV);
+ TopTools_DataMapOfShapeShape& aDMVV);
// Contribution of Samtech www.samcef.com END
//=======================================================================
aV2.Orientation(TopAbs_REVERSED);
//xx
if (aNbPaveBlocks==1) {
- bIsNewVertex1=myDS->IsNewShape (nV1);
- bIsNewVertex2=myDS->IsNewShape (nV2);
- if (!bIsNewVertex1 && !bIsNewVertex2) {
- aPB.SetEdge(i);
- continue;
- }
+ bIsNewVertex1=myDS->IsNewShape (nV1);
+ bIsNewVertex2=myDS->IsNewShape (nV2);
+ if (!bIsNewVertex1 && !bIsNewVertex2) {
+ aPB.SetEdge(i);
+ continue;
+ }
}
//xx
BOPTools_Tools::MakeSplitEdge(aE, aV1, t1, aV2, t2, aESplit);
anASSeq.SetNewOrientation(aV2.Orientation());
//
if (anOri==TopAbs_INTERNAL) {
- anASSeq.SetNewAncestor(i);
- aESplit.Orientation(anOri);
+ anASSeq.SetNewAncestor(i);
+ aESplit.Orientation(anOri);
}
//
myDS->InsertShapeAndAncestorsSuccessors(aESplit, anASSeq);
// Among all PBs of aCB the first PB will be one
// that have max tolerance value
{
- Standard_Real aTolEx, aTolExMax;
- BOPTools_ListOfPaveBlock *pLPB, aLPBx;
- //
- aTolExMax=-1.;
- pLPB=(BOPTools_ListOfPaveBlock *)&aCB.PaveBlocks();
- aPBIt.Initialize(*pLPB);
- for (; aPBIt.More(); aPBIt.Next()) {
- const BOPTools_PaveBlock& aPBx=aPBIt.Value();
- nEx=aPBx.OriginalEdge();
- const TopoDS_Edge& aEx=TopoDS::Edge(myDS->Shape(nEx));
- aTolEx=BRep_Tool::Tolerance(aEx);
- if (aTolEx>aTolExMax) {
- aTolExMax=aTolEx;
- aLPBx.Prepend(aPBx);
- }
- else{
- aLPBx.Append(aPBx);
- }
- }
- //
- pLPB->Clear();
- *pLPB=aLPBx;
+ Standard_Real aTolEx, aTolExMax;
+ BOPTools_ListOfPaveBlock *pLPB, aLPBx;
+ //
+ aTolExMax=-1.;
+ pLPB=(BOPTools_ListOfPaveBlock *)&aCB.PaveBlocks();
+ aPBIt.Initialize(*pLPB);
+ for (; aPBIt.More(); aPBIt.Next()) {
+ const BOPTools_PaveBlock& aPBx=aPBIt.Value();
+ nEx=aPBx.OriginalEdge();
+ const TopoDS_Edge& aEx=TopoDS::Edge(myDS->Shape(nEx));
+ aTolEx=BRep_Tool::Tolerance(aEx);
+ if (aTolEx>aTolExMax) {
+ aTolExMax=aTolEx;
+ aLPBx.Prepend(aPBx);
+ }
+ else{
+ aLPBx.Append(aPBx);
+ }
+ }
+ //
+ pLPB->Clear();
+ *pLPB=aLPBx;
}
//modified by NIZNHY-PKV Wed Nov 8 15:59:50 2006t
//
const BOPTools_ListOfPaveBlock& aCBLPB=aCB.PaveBlocks();
aPBIt.Initialize(aCBLPB);
for (; aPBIt.More(); aPBIt.Next()) {
- BOPTools_PaveBlock& aPBx=aPBIt.Value();
- nEx=aPBx.OriginalEdge();
- if (nEx==nE) {
- continue;
- }
- //
- nSpx=SplitIndex(aPBx);
- aPBx.SetEdge(nSpx);
+ BOPTools_PaveBlock& aPBx=aPBIt.Value();
+ nEx=aPBx.OriginalEdge();
+ if (nEx==nE) {
+ continue;
+ }
+ //
+ nSpx=SplitIndex(aPBx);
+ aPBx.SetEdge(nSpx);
}
//
}
aE=TopoDS::Edge(aExp.Current());
//
if (BRep_Tool::Degenerated(aE)) {
- continue;
+ continue;
}
//
nE=myDS->ShapeIndex(aE, iRankF);
//
if (aME.Contains(nE)) {
- continue;
+ continue;
}
aME.Add(nE);
//
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
aNbPB=aLPB.Extent();
if (aNbPB) {
- continue;
+ continue;
}
TopExp::Vertices(aE, aV1, aV2);
//
const TopoDS_Shape& aVy=aDMVV.Find(aVx);
if (aDMVFF1.IsBound(aVy)) {
- TColStd_ListOfInteger& aLIy=aDMVFF1.ChangeFind(aVy);
- aIt.Initialize(aLIx);
- for(; aIt.More(); aIt.Next()) {
- nFx=aIt.Value();
- aLIy.Append(nFx);
- }
+ TColStd_ListOfInteger& aLIy=aDMVFF1.ChangeFind(aVy);
+ aIt.Initialize(aLIx);
+ for(; aIt.More(); aIt.Next()) {
+ nFx=aIt.Value();
+ aLIy.Append(nFx);
+ }
}
else {
- aDMVFF1.Bind(aVy, aLIx);
+ aDMVFF1.Bind(aVy, aLIx);
}
}
}
for(; aIt.More(); aIt.Next()) {
nFx=aIt.Value();
if (aMIy.Add(nFx)) {
- aLIy.Append(nFx);
+ aLIy.Append(nFx);
}
}
aLIx.Clear();
//
aIt.Initialize(aLIFF);
for (; aIt.More(); aIt.Next()) {
- nFx=aIt.Value();
- if (myAloneVertices.Contains(nFx)) {
- TColStd_IndexedMapOfInteger& aMVx=myAloneVertices.ChangeFromKey(nFx);
- aMVx.Add(nV);
- }
- else {
- TColStd_IndexedMapOfInteger aMVx;
- aMVx.Add(nV);
- myAloneVertices.Add(nFx, aMVx);
- }
+ nFx=aIt.Value();
+ if (myAloneVertices.Contains(nFx)) {
+ TColStd_IndexedMapOfInteger& aMVx=myAloneVertices.ChangeFromKey(nFx);
+ aMVx.Add(nV);
+ }
+ else {
+ TColStd_IndexedMapOfInteger aMVx;
+ aMVx.Add(nV);
+ myAloneVertices.Add(nFx, aMVx);
+ }
}
}
}
const TColStd_IndexedMapOfInteger& aMAV=myAloneVertices(i);
aNbAV=aMAV.Extent();
for(j=1; j<=aNbAV; ++j) {
- nV=aMAV(j);
- if (aMAVF.Contains(nV)) {
- TColStd_IndexedMapOfInteger& aMF=aMAVF.ChangeFromKey(nV);
- aMF.Add(nF);
- }
- else{
- TColStd_IndexedMapOfInteger aMF;
- aMF.Add(nF);
- aMAVF.Add(nV, aMF);
- }
+ nV=aMAV(j);
+ if (aMAVF.Contains(nV)) {
+ TColStd_IndexedMapOfInteger& aMF=aMAVF.ChangeFromKey(nV);
+ aMF.Add(nF);
+ }
+ else{
+ TColStd_IndexedMapOfInteger aMF;
+ aMF.Add(nF);
+ aMAVF.Add(nV, aMF);
+ }
}
}
//
const TColStd_IndexedMapOfInteger& aMF=aMAVF(i);
aNbF=aMF.Extent();
for(j=1; j<aNbF; ++j) {
- nF1=aMF(j);
- for(k=j+1; k<=aNbF; ++k) {
- nF2=aMF(k);
- myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
- }
+ nF1=aMF(j);
+ for(k=j+1; k<=aNbF; ++k) {
+ nF2=aMF(k);
+ myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
+ }
}
}
}
// purpose:
//=======================================================================
void NMTTools_PaveFiller::FuseVertices(const TopoDS_Shape& aCompound,
- TopTools_DataMapOfShapeShape& aDMVV)const
+ TopTools_DataMapOfShapeShape& aDMVV)const
{
Standard_Integer i, aNbVV, n1, n2, nX;
NMTTools_PaveFiller tPF;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller_8.cxx
-// Created: Fri Dec 19 11:15:53 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller_8.cxx
+// Created: Fri Dec 19 11:15:53 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
// purpose:
//=======================================================================
void NMTTools_PaveFiller::SharedEdges(const Standard_Integer nF1,
- const Standard_Integer nF2,
- TColStd_ListOfInteger& aLNE,
- TopTools_ListOfShape& aLSE)
+ const Standard_Integer nF2,
+ TColStd_ListOfInteger& aLNE,
+ TopTools_ListOfShape& aLSE)
{
Standard_Integer nE1, nE2;
TColStd_MapOfInteger aM1;
// purpose:
//=======================================================================
Standard_Integer NMTTools_PaveFiller::CommonBlocksFace(const Standard_Integer nF,
- NMTTools_ListOfCommonBlock& aLCB)
+ NMTTools_ListOfCommonBlock& aLCB)
{
Standard_Integer nE;
TopAbs_ShapeEnum aT;
// purpose:
//=======================================================================
void NMTTools_PaveFiller::RealSplitsFace(const Standard_Integer nF,
- BOPTools_ListOfPaveBlock& aLPB)
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nE;
BOPTools_ListIteratorOfListOfPaveBlock anIt;
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::HasRealSplitsInOnFace(const Standard_Integer nF1,
- const Standard_Integer nF2)
+ const Standard_Integer nF2)
{
Standard_Boolean bFlag;
BOPTools_ListOfPaveBlock aLPB;
// purpose:
//=======================================================================
void NMTTools_PaveFiller::RealSplitsInFace(const Standard_Integer ,//for overriding
- const Standard_Integer nF1,
- const Standard_Integer nF2,
- BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nE1;
//
// purpose:
//=======================================================================
void NMTTools_PaveFiller::RealSplitsInFace(const Standard_Integer nE1,
- const Standard_Integer nF2,
- BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nF2,
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nF1;
//
for (; anItLFCB.More(); anItLFCB.Next()) {
nF1=anItLFCB.Value();
if (nF1==nF2) {
- aLPB.Append(aPB1R);
+ aLPB.Append(aPB1R);
}
}
}
// purpose:
//=======================================================================
void NMTTools_PaveFiller::RealSplitsOnEdge(const Standard_Integer nE1,
- const Standard_Integer nE2,
- BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nE2,
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nE;
//
const BOPTools_PaveBlock& aPB2=anIt.Value();
nE=aPB2.OriginalEdge();
if (nE==nE2) {
- aLPB.Append(aPB1R);
+ aLPB.Append(aPB1R);
}
}
}
// purpose:
//=======================================================================
void NMTTools_PaveFiller::RealSplitsOnFace(const Standard_Integer nE1,
- const Standard_Integer nF2,
- BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nF2,
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nE2;
//
// purpose:
//=======================================================================
void NMTTools_PaveFiller::RealSplitsOnFace(const Standard_Integer ,//for overriding
- const Standard_Integer nF1,
- const Standard_Integer nF2,
- BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nE1;
//
// purpose:
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsFace(const Standard_Integer nF,
- BOPTools_ListOfPaveBlock& aLPB)
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nE;
TopAbs_ShapeEnum aT;
// purpose: splits of edges from nF1 in nF2
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer ,//for overriding
- const Standard_Integer nF1,
- const Standard_Integer nF2,
- BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nE1;
TopAbs_ShapeEnum aT1, aT2;
// purpose: splits of edge nE1 in aFace2
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer nE1,
- const Standard_Integer nF2,
- BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nF2,
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nF1;
TopAbs_ShapeEnum aT1, aT2;
for (; anItLFCB.More(); anItLFCB.Next()) {
nF1=anItLFCB.Value();
if (nF1==nF2) {
- aLPB.Append(aPB1);
+ aLPB.Append(aPB1);
}
}
}
// purpose: splits of edge nE1 on nE2
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsOnEdge(const Standard_Integer nE1,
- const Standard_Integer nE2,
- BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nE2,
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nE;
TopAbs_ShapeEnum aT1, aT2;
const BOPTools_PaveBlock& aPB2=anIt.Value();
nE=aPB2.OriginalEdge();
if (nE==nE2) {
- aLPB.Append(aPB1);
+ aLPB.Append(aPB1);
}
}
}
// purpose: splits of edge nE1 on face nF2
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer nE1,
- const Standard_Integer nF2,
- BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nF2,
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nE2, ip;
TopAbs_ShapeEnum aT1, aT2;
// purpose: splits of edges from face nF1 on face nF2
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer ,//for overriding
- const Standard_Integer nF1,
- const Standard_Integer nF2,
- BOPTools_ListOfPaveBlock& aLPB)
+ const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ BOPTools_ListOfPaveBlock& aLPB)
{
Standard_Integer nE1, ip;
TopAbs_ShapeEnum aT1, aT2;
// purpose:
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsFace(const Standard_Integer nF,
- TColStd_ListOfInteger& aSplits)
+ TColStd_ListOfInteger& aSplits)
{
Standard_Integer nE, iErr;
BOPTools_ListIteratorOfListOfPaveBlock aIt;
// purpose: splits of edges from nF1 in nF2
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer ,//for overriding
- const Standard_Integer nF1,
- const Standard_Integer nF2,
- TColStd_ListOfInteger& aSplits)
+ const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ TColStd_ListOfInteger& aSplits)
{
Standard_Integer nE, iErr;
BOPTools_ListIteratorOfListOfPaveBlock aIt;
// purpose: splits of edge nE1 in aFace2
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsInFace(const Standard_Integer nE1,
- const Standard_Integer nF2,
- TColStd_ListOfInteger& aSplits)
+ const Standard_Integer nF2,
+ TColStd_ListOfInteger& aSplits)
{
Standard_Integer nE, iErr;
BOPTools_ListIteratorOfListOfPaveBlock aIt;
// purpose: splits of edge nE1 on nE2
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsOnEdge(const Standard_Integer nE1,
- const Standard_Integer nE2,
- TColStd_ListOfInteger& aSplits)
+ const Standard_Integer nE2,
+ TColStd_ListOfInteger& aSplits)
{
Standard_Integer nE, iErr;
BOPTools_ListIteratorOfListOfPaveBlock aIt;
// purpose: splits of edge nE1 on face nF2
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer nE1,
- const Standard_Integer nF2,
- TColStd_ListOfInteger& aSplits)
+ const Standard_Integer nF2,
+ TColStd_ListOfInteger& aSplits)
{
Standard_Integer nE, iErr;
BOPTools_ListIteratorOfListOfPaveBlock aIt;
// purpose: splits of edges from face nF1 on face nF2
//=======================================================================
Standard_Integer NMTTools_PaveFiller::SplitsOnFace(const Standard_Integer ,//for overriding
- const Standard_Integer nF1,
- const Standard_Integer nF2,
- TColStd_ListOfInteger& aSplits)
+ const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ TColStd_ListOfInteger& aSplits)
{
Standard_Integer nE, iErr;
BOPTools_ListIteratorOfListOfPaveBlock aIt;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller_9.cxx
-// Created: Fri Dec 19 11:15:53 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_PaveFiller_9.cxx
+// Created: Fri Dec 19 11:15:53 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PrepareFace(const Standard_Integer nF,
- TopoDS_Face& newFace)
+ TopoDS_Face& newFace)
{
Standard_Boolean bToReverse, bIsDegenerated;
Standard_Integer iRankF, nE, nSp, aNbPB;
const BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
aNbPB=aLPB.Extent();
if (!aNbPB) {
- aBB.Add(newWire, aE);
- continue;
+ aBB.Add(newWire, aE);
+ continue;
}
//
aItPB.Initialize(aLPB);
for (; aItPB.More(); aItPB.Next()) {
- const BOPTools_PaveBlock& aPB=aItPB.Value();
- const BOPTools_PaveBlock& aPBR=RealPaveBlock(aPB);
- nSp=aPBR.Edge();
- //
- aSp=TopoDS::Edge(myDS->Shape(nSp));
- if (!bIsDegenerated) {
- bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, myContext);
- if (bToReverse) {
- aSp.Reverse();
- }
- }
- else {
- aSp.Orientation(anOrE);
- }
- aBB.Add(newWire, aSp);
+ const BOPTools_PaveBlock& aPB=aItPB.Value();
+ const BOPTools_PaveBlock& aPBR=RealPaveBlock(aPB);
+ nSp=aPBR.Edge();
+ //
+ aSp=TopoDS::Edge(myDS->Shape(nSp));
+ if (!bIsDegenerated) {
+ bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, myContext);
+ if (bToReverse) {
+ aSp.Reverse();
+ }
+ }
+ else {
+ aSp.Orientation(anOrE);
+ }
+ aBB.Add(newWire, aSp);
}
}
aBB.Add(newFace, newWire);
// Type management
//
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("NMTTools_StdMapNodeOfMapOfPaveBlock",
- sizeof(NMTTools_StdMapNodeOfMapOfPaveBlock),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(NMTTools_StdMapNodeOfMapOfPaveBlock),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_Tools.cxx
-// Created: Mon Dec 8 10:35:15 2003
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTTools_Tools.cxx
+// Created: Mon Dec 8 10:35:15 2003
+// Author: Peter KURNEV
+// <pkv@irinox>
//
#include <NMTTools_Tools.ixx>
static
void ProcessBlock(const Standard_Integer iV,
- const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
- TColStd_IndexedMapOfInteger& aProcessed,
- TColStd_IndexedMapOfInteger& aChain);
+ const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
+ TColStd_IndexedMapOfInteger& aProcessed,
+ TColStd_IndexedMapOfInteger& aChain);
static
void ProcessBlock(const TopoDS_Shape& aF,
- const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV,
- TopTools_IndexedMapOfShape& aProcessed,
- TopTools_IndexedMapOfShape& aChain);
+ const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV,
+ TopTools_IndexedMapOfShape& aProcessed,
+ TopTools_IndexedMapOfShape& aChain);
//modified by NIZNHY-PKV Thu Nov 16 10:46:53 2006f SKL/PartC5
//=======================================================================
// purpose:
//=======================================================================
void NMTTools_Tools::UpdateEdge(const TopoDS_Edge& aE,
- const Standard_Real aTolR)
+ const Standard_Real aTolR)
{
Standard_Real aTolE, aTolES, aTolV;
TopoDS_Iterator aIt;
// purpose:
//=======================================================================
void NMTTools_Tools::MakePCurve(const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- const Handle(Geom2d_Curve)& aC2Dx1)
-
+ const TopoDS_Face& aF,
+ const Handle(Geom2d_Curve)& aC2Dx1)
+
{
Standard_Real aTolE, aT1, aT2, aOutFirst, aOutLast, aOutTol;
Handle(Geom2d_Curve) aC2D, aC2DA;
// purpose:
//=======================================================================
void NMTTools_Tools::MakePCurve(const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- const Handle(Geom2d_Curve)& aC2Dx,
- const Standard_Real aTolR2D)
+ const TopoDS_Face& aF,
+ const Handle(Geom2d_Curve)& aC2Dx,
+ const Standard_Real aTolR2D)
{
Standard_Integer k, aNbV;
Standard_Real aTolEdge, aTolFact, aTolV, aTolVmax;
// purpose:
//=======================================================================
Standard_Boolean NMTTools_Tools::IsSplitInOnFace(const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- IntTools_Context& aContext)
+ const TopoDS_Face& aF,
+ IntTools_Context& aContext)
{
Standard_Boolean bFlag;
Standard_Real aT, aTolE, aTolF, aTol, aDist, aU, aV;
// purpose :
//=======================================================================
void NMTTools_Tools::MakeNewVertex(const TopTools_ListOfShape& aLVs,
- TopoDS_Vertex& aNewVertex)
+ TopoDS_Vertex& aNewVertex)
{
Standard_Integer aNb;
Standard_Real aTi, aDi, aDmax=-1.e5;
// purpose :
//=======================================================================
void NMTTools_Tools::FindChains(const BOPTools_CArray1OfSSInterference& FFs,
- BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
{
Standard_Boolean bIsTangentFaces;
Standard_Integer j, aNb, anIndex1, anIndex2;
// purpose :
//=======================================================================
void NMTTools_Tools::FindChains(const BOPTools_CArray1OfVVInterference& VVs,
- BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
{
Standard_Integer j, aNb, anIndex1, anIndex2;
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger aMCV;
// purpose :
//=======================================================================
void NMTTools_Tools::FindChains(const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
- BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapChains)
{
Standard_Integer i, j, aNbCV, aNbV, iV, iVx;
TColStd_IndexedMapOfInteger aProcessed, aChain;
// purpose:
//=======================================================================
void ProcessBlock(const Standard_Integer iV,
- const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
- TColStd_IndexedMapOfInteger& aProcessed,
- TColStd_IndexedMapOfInteger& aChain)
+ const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMCV,
+ TColStd_IndexedMapOfInteger& aProcessed,
+ TColStd_IndexedMapOfInteger& aChain)
{
Standard_Integer j, aNbV, iVx;
//
// purpose :
//=======================================================================
Standard_Boolean NMTTools_Tools::AreFacesSameDomain(const TopoDS_Face& aF1x,
- const TopoDS_Face& aF2y,
- IntTools_Context& aCtx)
+ const TopoDS_Face& aF2y,
+ IntTools_Context& aCtx)
{
Standard_Boolean bFlag;
// Modified Thu Sep 14 14:35:18 2006
const TopoDS_Edge& aE=TopoDS::Edge(aExp.Current());
if (!BRep_Tool::Degenerated(aE)) {
if (!aME1.Contains(aE)) {
- return bFlag;
+ return bFlag;
}
aME2.Add(aE);
}
// purpose :
//=======================================================================
void NMTTools_Tools::FindChains(const NMTTools_ListOfCoupleOfShape& aLCS,
- NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains)
+ NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains)
{
NMTTools_ListIteratorOfListOfCoupleOfShape aItCS;
NMTTools_IndexedDataMapOfShapeIndexedMapOfShape aMCV;
// purpose :
//=======================================================================
void NMTTools_Tools::FindChains(const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV,
- NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains)
+ NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains)
{
Standard_Integer i, j, aNbCV, aNbV;
TopTools_IndexedMapOfShape aProcessed, aChain;
// purpose:
//=======================================================================
void ProcessBlock(const TopoDS_Shape& aF,
- const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV,
- TopTools_IndexedMapOfShape& aProcessed,
- TopTools_IndexedMapOfShape& aChain)
+ const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aMCV,
+ TopTools_IndexedMapOfShape& aProcessed,
+ TopTools_IndexedMapOfShape& aChain)
{
Standard_Integer j, aNbV;
//
using namespace std;
static void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
- const Handle(AIS_InteractiveContext)& theIC,
- SelectMgr_IndexedMapOfOwner& theMap )
+ const Handle(AIS_InteractiveContext)& theIC,
+ SelectMgr_IndexedMapOfOwner& theMap )
{
if ( theObj.IsNull() || theIC.IsNull() )
return;
for ( sel->Init(); sel->More(); sel->Next() ) {
Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive();
if ( entity.IsNull() )
- continue;
+ continue;
Handle(SelectMgr_EntityOwner) owner =
- Handle(SelectMgr_EntityOwner)::DownCast(entity->OwnerId());
+ Handle(SelectMgr_EntityOwner)::DownCast(entity->OwnerId());
if ( !owner.IsNull() )
- theMap.Add( owner );
+ theMap.Add( owner );
}
}
}
static void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap,
- const TopoDS_Shape& aMainShape,
- const SelectMgr_IndexedMapOfOwner& anAllMap,
- SelectMgr_IndexedMapOfOwner& aToHiliteMap )
+ const TopoDS_Shape& aMainShape,
+ const SelectMgr_IndexedMapOfOwner& anAllMap,
+ SelectMgr_IndexedMapOfOwner& aToHiliteMap )
{
TopTools_IndexedMapOfShape aMapOfShapes;
TopExp::MapShapes(aMainShape, aMapOfShapes);
}
GEOM_AISShape::GEOM_AISShape(const TopoDS_Shape& shape,
- const Standard_CString aName)
+ const Standard_CString aName)
: SALOME_AISShape(shape), myName(aName), myDisplayVectors(false)
{
myShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
}
void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
- const Handle(Prs3d_Presentation)& aPrs,
- const Standard_Integer aMode)
+ const Handle(Prs3d_Presentation)& aPrs,
+ const Standard_Integer aMode)
{
if (IsInfinite()) aPrs->SetInfiniteState(Standard_True); //pas de prise en compte lors du FITALL
if ( C.IsNull() ) continue;
if ( anEdgeE.Orientation() == TopAbs_FORWARD )
- C->D1(lp, aP2, aDirVec);
+ C->D1(lp, aP2, aDirVec);
else {
- C->D1(fp, aP1, aDirVec);
- aP2 = aP1;
+ C->D1(fp, aP1, aDirVec);
+ aP2 = aP1;
}
GeomAdaptor_Curve aAdC;
Standard_Real aDist = GCPnts_AbscissaPoint::Length(aAdC, fp, lp);
if (aDist > gp::Resolution()) {
- gp_Dir aDir;
- if ( anEdgeE.Orientation() == TopAbs_FORWARD )
- aDir = aDirVec;
- else
- aDir = -aDirVec;
+ gp_Dir aDir;
+ if ( anEdgeE.Orientation() == TopAbs_FORWARD )
+ aDir = aDirVec;
+ else
+ aDir = -aDirVec;
- Prs3d_Arrow::Draw(aPrs, aP2, aDir, PI/180.*5., aDist/10.);
+ Prs3d_Arrow::Draw(aPrs, aP2, aDir, PI/180.*5., aDist/10.);
}
}
}
}
void GEOM_AISShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap,
- const Standard_Boolean aHighlight )
+ const Standard_Boolean aHighlight )
{
Handle(AIS_InteractiveObject) anObj = this;
Handle(AIS_InteractiveContext) anIC = GetContext();
// }
// Methods PUBLIC
//
- GEOM_AISShape(const TopoDS_Shape& shape, const Standard_CString aName);
- Standard_Boolean hasIO() ;
- void setIO(const Handle(SALOME_InteractiveObject)& name) ;
- void setName(const Standard_CString aName) ;
- Standard_CString getName() ;
- Handle_SALOME_InteractiveObject getIO() ;
- void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight );
- ~GEOM_AISShape();
-
- void SetTransparency(const Standard_Real aValue);
- void SetShadingColor(const Quantity_Color &aCol);
- void SetDisplayVectors(bool isShow);
-
- virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
- const Handle(Prs3d_Presentation)& aPresentation,
- const Standard_Integer aMode = 0) ;
-
- virtual bool isShowVectors () { return myDisplayVectors; }
-
+ GEOM_AISShape(const TopoDS_Shape& shape, const Standard_CString aName);
+ Standard_Boolean hasIO() ;
+ void setIO(const Handle(SALOME_InteractiveObject)& name) ;
+ void setName(const Standard_CString aName) ;
+ Standard_CString getName() ;
+ Handle_SALOME_InteractiveObject getIO() ;
+ void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight );
+ ~GEOM_AISShape();
+
+ void SetTransparency(const Standard_Real aValue);
+ void SetShadingColor(const Quantity_Color &aCol);
+ void SetDisplayVectors(bool isShow);
+
+ virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
+ const Handle(Prs3d_Presentation)& aPresentation,
+ const Standard_Integer aMode = 0) ;
+
+ virtual bool isShowVectors () { return myDisplayVectors; }
+
// Type management
//
- friend Handle_Standard_Type& GEOM_AISShape_Type_();
- const Handle(Standard_Type)& DynamicType() const;
- Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ friend Handle_Standard_Type& GEOM_AISShape_Type_();
+ const Handle(Standard_Type)& DynamicType() const;
+ Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
Quantity_Color myShadingColor;
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,aType6,aType7,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOM_AISShape",
- sizeof(GEOM_AISShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOM_AISShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
{
#ifdef MYDEBUG
MESSAGE ( "GEOM_Actor::SetVisibility = "<<theVisibility <<" myIsSelected="<< myIsSelected
- << " theVisibility="<<theVisibility<<" myIsPreselected="<<myIsPreselected );
+ << " theVisibility="<<theVisibility<<" myIsPreselected="<<myIsPreselected );
#endif
SALOME_Actor::SetVisibility(theVisibility);
myWireframeFaceSource->AddFace(aFace);
myShadingFaceSource->AddFace(aFace);
TopExp_Explorer anEdgeExp(aFaceExp.Current(), TopAbs_EDGE);
- for(; anEdgeExp.More(); anEdgeExp.Next()) {
- const TopoDS_Edge& anEdge = TopoDS::Edge(anEdgeExp.Current());
+ for(; anEdgeExp.More(); anEdgeExp.Next()) {
+ const TopoDS_Edge& anEdge = TopoDS::Edge(anEdgeExp.Current());
if(!BRep_Tool::Degenerated(anEdge)){
- // compute the number of faces
- int aNbOfFaces = theEdgeMap.FindFromKey(anEdge).Extent();
- switch(aNbOfFaces){
- case 0: // isolated edge
- myIsolatedEdgeSource->AddEdge(anEdge,theIsVector);
- break;
- case 1: // edge in only one face
- myOneFaceEdgeSource->AddEdge(anEdge,theIsVector);
- break;
- default: // edge shared by at least two faces
- mySharedEdgeSource->AddEdge(anEdge,theIsVector);
- }
+ // compute the number of faces
+ int aNbOfFaces = theEdgeMap.FindFromKey(anEdge).Extent();
+ switch(aNbOfFaces){
+ case 0: // isolated edge
+ myIsolatedEdgeSource->AddEdge(anEdge,theIsVector);
+ break;
+ case 1: // edge in only one face
+ myOneFaceEdgeSource->AddEdge(anEdge,theIsVector);
+ break;
+ default: // edge shared by at least two faces
+ mySharedEdgeSource->AddEdge(anEdge,theIsVector);
+ }
}
}
}
bool
GEOM_Actor
::PreHighlight(vtkInteractorStyle *theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
#ifdef MYDEBUG
MESSAGE ( this<<" GEOM_Actor::PreHighlight (3) theIsHighlight="<<theIsHighlight );
// cout << " nbio = " << nbio << endl;
if( !mySelector->IsSelected( myIO ) ) {
- // printf ("!!!!!!!!!!!!!!!!\n");
- SetPreSelected( true );
+ // printf ("!!!!!!!!!!!!!!!!\n");
+ SetPreSelected( true );
}
}
default:
bool
GEOM_Actor
::Highlight(vtkInteractorStyle *theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
// define the selection of object
#ifdef MYDEBUG
else
{
distance = sqrt(
- (pos[0] - this->Position[0])*(pos[0] - this->Position[0]) +
+ (pos[0] - this->Position[0])*(pos[0] - this->Position[0]) +
(pos[1] - this->Position[1])*(pos[1] - this->Position[1]) +
(pos[2] - this->Position[2])*(pos[2] - this->Position[2]));
for (i = 0; i < 3; i++)
- {
+ {
Rz[i] = (pos[i] - this->Position[i])/distance;
- }
+ }
}
vtkMath::Cross(vup,Rz,Rx);
void ReleaseGraphicsResources(vtkWindow *);
const TopoDS_Shape& getTopo();
void setInputShape(const TopoDS_Shape& ashape, double adef1,
- int imode, bool isVector = false);
+ int imode, bool isVector = false);
double getDeflection();
double isVector();
virtual
bool
PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//! To process highlight (called from #SVTK_InteractorStyle)
virtual
bool
Highlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//! Visibility management
virtual
using namespace std;
// SALOME
-#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) )
-#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) )
+#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) )
+#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) )
void GEOM_AssemblyBuilder::InitProperties(vtkProperty* IsoProp,
- vtkProperty* FaceProp,
- vtkProperty* EdgeFProp,
- vtkProperty* EdgeSProp,
- vtkProperty* EdgeIProp,
- vtkProperty* VertexProp,
- vtkProperty* IsoPVProp,
- vtkProperty* EdgePVProp,
- vtkProperty* VertexPVProp)
+ vtkProperty* FaceProp,
+ vtkProperty* EdgeFProp,
+ vtkProperty* EdgeSProp,
+ vtkProperty* EdgeIProp,
+ vtkProperty* VertexProp,
+ vtkProperty* IsoPVProp,
+ vtkProperty* EdgePVProp,
+ vtkProperty* VertexPVProp)
{
// Shading like default OCC material
FaceProp->SetRepresentationToSurface();
void GEOM_AssemblyBuilder::MeshShape(const TopoDS_Shape myShape,
- Standard_Real deflection,
- Standard_Boolean forced)
+ Standard_Real deflection,
+ Standard_Boolean forced)
{
// Mesh the shape if necessary
Standard_Boolean alreadymesh = Standard_True;
TopExp_Explorer ex2;
for (ex2.Init(ex.Current(), TopAbs_EDGE); ex2.More(); ex2.Next()) {
- const TopoDS_Edge& aEdge = TopoDS::Edge(ex2.Current());
-
- if (BRep_Tool::Degenerated(aEdge)) {
- continue;
- }
-
- // compute the number of faces
- Standard_Integer nbf = edgemap.FindFromKey(ex2.Current()).Extent();
- GEOM_Actor* EdgeActor = GEOM_Actor::New();
- EdgeActor->SubShapeOn();
- EdgeActor->setInputShape(ex2.Current(),deflection,mode);
-
- switch (nbf) {
-
- case 0 : // isolated edge
- {
- EdgeActor->SetShadingProperty(EdgeIProp);
- EdgeActor->SetWireframeProperty(EdgeIProp);
- }
- break;
-
- case 1 :// edge in only one face
- {
- EdgeActor->SetShadingProperty(EdgeFProp);
- EdgeActor->SetWireframeProperty(EdgeFProp);
- }
- break;
-
- default : // edge shared by at least two faces
- {
- EdgeActor->SetShadingProperty(EdgeSProp);
- EdgeActor->SetWireframeProperty(EdgeSProp);
- }
- }
-
- EdgeActor->SetPreviewProperty(EdgePVProp);
- AISActors->AddItem(EdgeActor);
+ const TopoDS_Edge& aEdge = TopoDS::Edge(ex2.Current());
+
+ if (BRep_Tool::Degenerated(aEdge)) {
+ continue;
+ }
+
+ // compute the number of faces
+ Standard_Integer nbf = edgemap.FindFromKey(ex2.Current()).Extent();
+ GEOM_Actor* EdgeActor = GEOM_Actor::New();
+ EdgeActor->SubShapeOn();
+ EdgeActor->setInputShape(ex2.Current(),deflection,mode);
+
+ switch (nbf) {
+
+ case 0 : // isolated edge
+ {
+ EdgeActor->SetShadingProperty(EdgeIProp);
+ EdgeActor->SetWireframeProperty(EdgeIProp);
+ }
+ break;
+
+ case 1 :// edge in only one face
+ {
+ EdgeActor->SetShadingProperty(EdgeFProp);
+ EdgeActor->SetWireframeProperty(EdgeFProp);
+ }
+ break;
+
+ default : // edge shared by at least two faces
+ {
+ EdgeActor->SetShadingProperty(EdgeSProp);
+ EdgeActor->SetWireframeProperty(EdgeSProp);
+ }
+ }
+
+ EdgeActor->SetPreviewProperty(EdgePVProp);
+ AISActors->AddItem(EdgeActor);
}
}
} else if ( myShape.ShapeType() == TopAbs_WIRE ) { // WIRE Actor
TopExp_Explorer ex;
for (ex.Init(myShape, TopAbs_EDGE); ex.More(); ex.Next()) {
const TopoDS_Edge& aEdge = TopoDS::Edge(ex.Current());
-
+
if (BRep_Tool::Degenerated(aEdge)) {
- continue;
+ continue;
}
-
+
GEOM_Actor* EdgeActor = GEOM_Actor::New();
EdgeActor->setInputShape(ex.Current(),deflection,mode);
EdgeActor->SetShadingProperty(EdgeIProp);
// BUILD ASSEMBLY
//-------------------------------------------------------------
vtkAssembly* GEOM_AssemblyBuilder::BuildAssembly(const TopoDS_Shape& myShape,
- Standard_Real deflection,
- Standard_Integer mode,
- Standard_Boolean forced)
+ Standard_Real deflection,
+ Standard_Integer mode,
+ Standard_Boolean forced)
{
// Create a new vtkAssembly
const TopoDS_Edge& aEdge = TopoDS::Edge(ex2.Current());
if (BRep_Tool::Degenerated(aEdge)) {
- continue;
+ continue;
}
Standard_Integer nbf = edgemap.FindFromKey(ex2.Current()).Extent();
GEOM_Actor* EdgeActor = GEOM_Actor::New();
switch (nbf) {
-
+
case 0 : // isolated edge
- {
- EdgeActor->SetShadingProperty(EdgeIProp);
- EdgeActor->SetWireframeProperty(EdgeIProp);
- }
- break;
-
+ {
+ EdgeActor->SetShadingProperty(EdgeIProp);
+ EdgeActor->SetWireframeProperty(EdgeIProp);
+ }
+ break;
+
case 1 :// edge in only one face
- {
- EdgeActor->SetShadingProperty(EdgeFProp);
- EdgeActor->SetWireframeProperty(EdgeFProp);
- }
- break;
-
+ {
+ EdgeActor->SetShadingProperty(EdgeFProp);
+ EdgeActor->SetWireframeProperty(EdgeFProp);
+ }
+ break;
+
default : // edge shared by at least two faces
- {
- EdgeActor->SetShadingProperty(EdgeSProp);
- EdgeActor->SetWireframeProperty(EdgeSProp);
- }
+ {
+ EdgeActor->SetShadingProperty(EdgeSProp);
+ EdgeActor->SetWireframeProperty(EdgeSProp);
+ }
}
EdgeActor->setInputShape(ex2.Current(),deflection,mode);
private:
static void InitProperties(vtkProperty* IsoProp,
- vtkProperty* FaceProp,
- vtkProperty* EdgeFProp,
- vtkProperty* EdgeSProp,
- vtkProperty* EdgeIProp,
- vtkProperty* VertexProp,
- vtkProperty* IsoPVProp,
- vtkProperty* EdgePVProp,
- vtkProperty* VertePVProp);
+ vtkProperty* FaceProp,
+ vtkProperty* EdgeFProp,
+ vtkProperty* EdgeSProp,
+ vtkProperty* EdgeIProp,
+ vtkProperty* VertexProp,
+ vtkProperty* IsoPVProp,
+ vtkProperty* EdgePVProp,
+ vtkProperty* VertePVProp);
static void MeshShape(const TopoDS_Shape myShape,
- Standard_Real deflection,
- Standard_Boolean forced);
+ Standard_Real deflection,
+ Standard_Boolean forced);
public:
//------------------------------------------------------------------
static vtkAssembly* BuildAssembly(const TopoDS_Shape& myShape,
- Standard_Real deflection,
- Standard_Integer amode,
- Standard_Boolean forced);
+ Standard_Real deflection,
+ Standard_Integer amode,
+ Standard_Boolean forced);
//------------------------------------------------------------------
// Good performance
//------------------------------------------------------------------
static vtkActorCollection* BuildActors(const TopoDS_Shape& myShape,
- Standard_Real deflection,
- Standard_Integer amode,
- Standard_Boolean forced,
- Standard_Boolean isVector = Standard_False);
+ Standard_Real deflection,
+ Standard_Integer amode,
+ Standard_Boolean forced,
+ Standard_Boolean isVector = Standard_False);
//------------------------------------------------------------------
gp_Pnt pt2 = anId2Pnts(id2);
if(!isidtrsf) {
- // apply edge transformation
+ // apply edge transformation
pt1.Transform(edgeTransf);
pt2.Transform(edgeTransf);
}
}
GEOM_InteractiveObject::GEOM_InteractiveObject(const char* anIOR,
- const char* aFatherIOR,
- const char* aComponentDataType,
- const char* anEntry)
+ const char* aFatherIOR,
+ const char* aComponentDataType,
+ const char* anEntry)
: SALOME_InteractiveObject(anEntry,aComponentDataType)
{
myIOR = anIOR;
//
Standard_EXPORT GEOM_InteractiveObject();
Standard_EXPORT GEOM_InteractiveObject(const char* anIOR,
- const char* aFatherIOR,
- const char* aComponentDataType,
- const char* anEntry = "");
+ const char* aFatherIOR,
+ const char* aComponentDataType,
+ const char* anEntry = "");
Standard_EXPORT void setIOR(const char* anEntry) ;
Standard_EXPORT const char* getIOR() ;
Standard_EXPORT void setFatherIOR(const char* anEntry) ;
//
Standard_EXPORT friend Handle_Standard_Type& GEOM_InteractiveObject_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOM_InteractiveObject",
- sizeof(GEOM_InteractiveObject),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(GEOM_InteractiveObject),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
using namespace std;
-#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) )
-#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) )
+#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) )
+#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) )
// Constante for iso building
static Standard_Real IntersectorConfusion = 1.e-10 ; // -8 ;
// Allocation
Pts = vtkPoints::New();
Cells = vtkCellArray::New();
-
+
//Compute number of triangles and points
Standard_Integer nbpoly=0,nbpts=0;
const TopoDS_Face& aFace = TopoDS::Face(myShape);
Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
if(aPoly.IsNull()) {
- Pts->Delete();
- Cells->Delete();
- return;
+ Pts->Delete();
+ Cells->Delete();
+ return;
}
nbpts = aPoly->NbNodes();
Cells->Allocate(Cells->EstimateSize(nbpoly,3));
}
else {
- Cells->Delete();
- Pts->Delete();
- return;
+ Cells->Delete();
+ Pts->Delete();
+ return;
}
}
//=======================================================================
void GEOM_OCCReader::TransferFaceWData(const TopoDS_Face& aFace,
- vtkPoints* Pts,
- vtkCellArray* Cells)
+ vtkPoints* Pts,
+ vtkCellArray* Cells)
{
TopoDS_Face aCopyFace = aFace;
aCopyFace.Orientation (TopAbs_FORWARD);
//=======================================================================
void GEOM_OCCReader::createISO (const TopoDS_Face& TopologicalFace,
- const Standard_Real Infinite,
- const Standard_Integer NbIsos,
- vtkPoints* Pts,
- vtkCellArray* Cell)
+ const Standard_Real Infinite,
+ const Standard_Integer NbIsos,
+ vtkPoints* Pts,
+ vtkCellArray* Cell)
{
Geom2dHatch_Hatcher aHatcher (Geom2dHatch_Intersector (IntersectorConfusion,
- IntersectorTangency),
- HatcherConfusion2d,
- HatcherConfusion3d,
- Standard_True,
- Standard_False);
+ IntersectorTangency),
+ HatcherConfusion2d,
+ HatcherConfusion3d,
+ Standard_True,
+ Standard_False);
Standard_Real myInfinite,myUMin,myUMax,myVMin,myVMax;
//myInfinite = Precision::Infinite();
//-- Test if a TrimmedCurve is necessary
if( Abs(PCurve->FirstParameter()-U1)<= Precision::PConfusion()
- && Abs(PCurve->LastParameter()-U2)<= Precision::PConfusion()) {
+ && Abs(PCurve->LastParameter()-U2)<= Precision::PConfusion()) {
aHatcher.AddElement (PCurve, TopologicalEdge.Orientation()) ;
}
else {
if (!PCurve->IsPeriodic()) {
- Handle (Geom2d_TrimmedCurve) TrimPCurve =Handle(Geom2d_TrimmedCurve)::DownCast(PCurve);
- if (!TrimPCurve.IsNull()) {
- if (TrimPCurve->BasisCurve()->FirstParameter()-U1 > Precision::PConfusion() ||
- U2-TrimPCurve->BasisCurve()->LastParameter() > Precision::PConfusion()) {
- aHatcher.AddElement (PCurve, TopologicalEdge.Orientation()) ;
- return;
- }
- }
- else {
- if (PCurve->FirstParameter()-U1 > Precision::PConfusion()){
- U1=PCurve->FirstParameter();
- }
- if (U2-PCurve->LastParameter() > Precision::PConfusion()){
- U2=PCurve->LastParameter();
- }
- }
+ Handle (Geom2d_TrimmedCurve) TrimPCurve =Handle(Geom2d_TrimmedCurve)::DownCast(PCurve);
+ if (!TrimPCurve.IsNull()) {
+ if (TrimPCurve->BasisCurve()->FirstParameter()-U1 > Precision::PConfusion() ||
+ U2-TrimPCurve->BasisCurve()->LastParameter() > Precision::PConfusion()) {
+ aHatcher.AddElement (PCurve, TopologicalEdge.Orientation()) ;
+ return;
+ }
+ }
+ else {
+ if (PCurve->FirstParameter()-U1 > Precision::PConfusion()){
+ U1=PCurve->FirstParameter();
+ }
+ if (U2-PCurve->LastParameter() > Precision::PConfusion()){
+ U2=PCurve->LastParameter();
+ }
+ }
}
Handle (Geom2d_TrimmedCurve) TrimPCurve = new Geom2d_TrimmedCurve (PCurve, U1, U2) ;
aHatcher.AddElement (TrimPCurve, TopologicalEdge.Orientation()) ;
Index = myUInd(IIso) ;
if (Index != 0) {
if (aHatcher.TrimDone (Index) && !aHatcher.TrimFailed (Index)) {
- aHatcher.ComputeDomains (Index);
- if (aHatcher.IsDone (Index)) myNbDom = myNbDom + aHatcher.NbDomains (Index) ;
+ aHatcher.ComputeDomains (Index);
+ if (aHatcher.IsDone (Index)) myNbDom = myNbDom + aHatcher.NbDomains (Index) ;
}
}
Index = myVInd(IIso) ;
if (Index != 0) {
if (aHatcher.TrimDone (Index) && !aHatcher.TrimFailed (Index)) {
- aHatcher.ComputeDomains (Index);
- if (aHatcher.IsDone (Index)) myNbDom = myNbDom + aHatcher.NbDomains (Index) ;
+ aHatcher.ComputeDomains (Index);
+ if (aHatcher.IsDone (Index)) myNbDom = myNbDom + aHatcher.NbDomains (Index) ;
}
}
}
if (UInd != 0) {
Standard_Real UPrm = myUPrm.Value (UIso) ;
if (!aHatcher.IsDone (UInd)) {
- MESSAGE("DBRep_IsoBuilder:: U iso of parameter: "<<UPrm)
- switch (aHatcher.Status (UInd)) {
- case HatchGen_NoProblem : MESSAGE("No Problem") ; break ;
- case HatchGen_TrimFailure : MESSAGE("Trim Failure") ; break ;
- case HatchGen_TransitionFailure : MESSAGE("Transition Failure") ; break ;
- case HatchGen_IncoherentParity : MESSAGE("Incoherent Parity") ; break ;
- case HatchGen_IncompatibleStates : MESSAGE("Incompatible States") ; break ;
- }
+ MESSAGE("DBRep_IsoBuilder:: U iso of parameter: "<<UPrm)
+ switch (aHatcher.Status (UInd)) {
+ case HatchGen_NoProblem : MESSAGE("No Problem") ; break ;
+ case HatchGen_TrimFailure : MESSAGE("Trim Failure") ; break ;
+ case HatchGen_TransitionFailure : MESSAGE("Transition Failure") ; break ;
+ case HatchGen_IncoherentParity : MESSAGE("Incoherent Parity") ; break ;
+ case HatchGen_IncompatibleStates : MESSAGE("Incompatible States") ; break ;
+ }
} else {
- Standard_Integer NbDom = aHatcher.NbDomains (UInd) ;
- for (Standard_Integer IDom = 1 ; IDom <= NbDom ; IDom++) {
- const HatchGen_Domain& Dom = aHatcher.Domain (UInd, IDom) ;
- Standard_Real V1 = Dom.HasFirstPoint() ? Dom.FirstPoint().Parameter() : myVMin - myInfinite ;
- Standard_Real V2 = Dom.HasSecondPoint() ? Dom.SecondPoint().Parameter() : myVMax + myInfinite ;
- DrawIso(GeomAbs_IsoU, UPrm, V1, V2, Pts, Cell,pt_start_idx);
- }
+ Standard_Integer NbDom = aHatcher.NbDomains (UInd) ;
+ for (Standard_Integer IDom = 1 ; IDom <= NbDom ; IDom++) {
+ const HatchGen_Domain& Dom = aHatcher.Domain (UInd, IDom) ;
+ Standard_Real V1 = Dom.HasFirstPoint() ? Dom.FirstPoint().Parameter() : myVMin - myInfinite ;
+ Standard_Real V2 = Dom.HasSecondPoint() ? Dom.SecondPoint().Parameter() : myVMax + myInfinite ;
+ DrawIso(GeomAbs_IsoU, UPrm, V1, V2, Pts, Cell,pt_start_idx);
+ }
}
}
}
if (VInd != 0) {
Standard_Real VPrm = myVPrm.Value (VIso) ;
if (!aHatcher.IsDone (VInd)) {
- MESSAGE("DBRep_IsoBuilder:: V iso of parameter: "<<VPrm)
- switch (aHatcher.Status (VInd)) {
- case HatchGen_NoProblem : MESSAGE("No Problem") ; break ;
- case HatchGen_TrimFailure : MESSAGE("Trim Failure") ; break ;
- case HatchGen_TransitionFailure : MESSAGE("Transition Failure") ; break ;
- case HatchGen_IncoherentParity : MESSAGE("Incoherent Parity") ; break ;
- case HatchGen_IncompatibleStates : MESSAGE("Incompatible States") ; break ;
- }
+ MESSAGE("DBRep_IsoBuilder:: V iso of parameter: "<<VPrm)
+ switch (aHatcher.Status (VInd)) {
+ case HatchGen_NoProblem : MESSAGE("No Problem") ; break ;
+ case HatchGen_TrimFailure : MESSAGE("Trim Failure") ; break ;
+ case HatchGen_TransitionFailure : MESSAGE("Transition Failure") ; break ;
+ case HatchGen_IncoherentParity : MESSAGE("Incoherent Parity") ; break ;
+ case HatchGen_IncompatibleStates : MESSAGE("Incompatible States") ; break ;
+ }
} else {
- Standard_Integer NbDom = aHatcher.NbDomains (VInd) ;
- for (Standard_Integer IDom = 1 ; IDom <= NbDom ; IDom++) {
- const HatchGen_Domain& Dom = aHatcher.Domain (VInd, IDom) ;
- Standard_Real U1 = Dom.HasFirstPoint() ? Dom.FirstPoint().Parameter() : myVMin - myInfinite ;
- Standard_Real U2 = Dom.HasSecondPoint() ? Dom.SecondPoint().Parameter() : myVMax + myInfinite ;
- DrawIso(GeomAbs_IsoV, VPrm, U1, U2, Pts, Cell,pt_start_idx) ;
- }
+ Standard_Integer NbDom = aHatcher.NbDomains (VInd) ;
+ for (Standard_Integer IDom = 1 ; IDom <= NbDom ; IDom++) {
+ const HatchGen_Domain& Dom = aHatcher.Domain (VInd, IDom) ;
+ Standard_Real U1 = Dom.HasFirstPoint() ? Dom.FirstPoint().Parameter() : myVMin - myInfinite ;
+ Standard_Real U2 = Dom.HasSecondPoint() ? Dom.SecondPoint().Parameter() : myVMax + myInfinite ;
+ DrawIso(GeomAbs_IsoV, VPrm, U1, U2, Pts, Cell,pt_start_idx) ;
+ }
}
}
}
// Purpose : Init VTK ISO PLOT
//=======================================================================
void GEOM_OCCReader::MoveTo(gp_Pnt P,
- vtkPoints* Pts)
+ vtkPoints* Pts)
{
float coord[3];
// Purpose : Plot point in VTK
//=======================================================================
void GEOM_OCCReader::DrawTo(gp_Pnt P,
- vtkPoints* Pts,
- vtkCellArray* Cells)
+ vtkPoints* Pts,
+ vtkCellArray* Cells)
{
float coord[3];
coord[0] = P.X(); coord[1] = P.Y(); coord[2] = P.Z();
// Purpose : Draw an iso on vtk
//=======================================================================
void GEOM_OCCReader::DrawIso(GeomAbs_IsoType T,
- Standard_Real Par,
- Standard_Real T1,
- Standard_Real T2,
- vtkPoints* Pts,
- vtkCellArray* Cells,
- Standard_Integer& startidx)
+ Standard_Real Par,
+ Standard_Real T1,
+ Standard_Real T2,
+ vtkPoints* Pts,
+ vtkCellArray* Cells,
+ Standard_Integer& startidx)
{
Standard_Boolean halt = Standard_False;
V2 = Par;
stepV = 0;
nbIntv = nbUIntv;
- }
-
+ }
+
S.D0(U1,V1,P);
MoveTo(P,Pts);
for (Intrv = 1; Intrv <= nbIntv; Intrv++) {
if (TI(Intrv) <= T1 && TI(Intrv + 1) <= T1)
- continue;
+ continue;
if (TI(Intrv) >= T2 && TI(Intrv + 1) >= T2)
- continue;
+ continue;
if (T == GeomAbs_IsoU) {
- V1 = Max(T1, TI(Intrv));
- V2 = Min(T2, TI(Intrv + 1));
- stepV = (V2 - V1) / myDiscret;
+ V1 = Max(T1, TI(Intrv));
+ V2 = Min(T2, TI(Intrv + 1));
+ stepV = (V2 - V1) / myDiscret;
}
else {
- U1 = Max(T1, TI(Intrv));
- U2 = Min(T2, TI(Intrv + 1));
- stepU = (U2 - U1) / myDiscret;
+ U1 = Max(T1, TI(Intrv));
+ U2 = Min(T2, TI(Intrv + 1));
+ stepU = (U2 - U1) / myDiscret;
}
switch (SurfType) {
- //-------------GeomAbs_Plane---------------
+ //-------------GeomAbs_Plane---------------
case GeomAbs_Plane :
- break;
- //----GeomAbs_Cylinder GeomAbs_Cone------
+ break;
+ //----GeomAbs_Cylinder GeomAbs_Cone------
case GeomAbs_Cylinder :
case GeomAbs_Cone :
- if (T == GeomAbs_IsoV) {
- for (j = 1; j < myDiscret; j++) {
- U1 += stepU;
- V1 += stepV;
- S.D0(U1,V1,P);
- DrawTo(P,Pts,Cells);
- }
- }
- break;
- //---GeomAbs_Sphere GeomAbs_Torus--------
- //GeomAbs_BezierSurface GeomAbs_BezierSurface
+ if (T == GeomAbs_IsoV) {
+ for (j = 1; j < myDiscret; j++) {
+ U1 += stepU;
+ V1 += stepV;
+ S.D0(U1,V1,P);
+ DrawTo(P,Pts,Cells);
+ }
+ }
+ break;
+ //---GeomAbs_Sphere GeomAbs_Torus--------
+ //GeomAbs_BezierSurface GeomAbs_BezierSurface
case GeomAbs_Sphere :
case GeomAbs_Torus :
case GeomAbs_OffsetSurface :
case GeomAbs_OtherSurface :
- for (j = 1; j < myDiscret; j++) {
- U1 += stepU;
- V1 += stepV;
- S.D0(U1,V1,P);
- DrawTo(P,Pts,Cells);
- }
- break;
- //-------------GeomAbs_BSplineSurface------
+ for (j = 1; j < myDiscret; j++) {
+ U1 += stepU;
+ V1 += stepV;
+ S.D0(U1,V1,P);
+ DrawTo(P,Pts,Cells);
+ }
+ break;
+ //-------------GeomAbs_BSplineSurface------
case GeomAbs_BezierSurface :
case GeomAbs_BSplineSurface :
- for (j = 1; j <= myDiscret/2; j++) {
+ for (j = 1; j <= myDiscret/2; j++) {
- PlotCount = 0;
+ PlotCount = 0;
- PlotIso ( S, T, U1, V1, (T == GeomAbs_IsoV) ? stepU*2. : stepV*2., halt, Pts, Cells);
- U1 += stepU*2.;
- V1 += stepV*2.;
- }
- break;
- //-------------GeomAbs_SurfaceOfExtrusion--
- //-------------GeomAbs_SurfaceOfRevolution-
+ PlotIso ( S, T, U1, V1, (T == GeomAbs_IsoV) ? stepU*2. : stepV*2., halt, Pts, Cells);
+ U1 += stepU*2.;
+ V1 += stepV*2.;
+ }
+ break;
+ //-------------GeomAbs_SurfaceOfExtrusion--
+ //-------------GeomAbs_SurfaceOfRevolution-
case GeomAbs_SurfaceOfExtrusion :
case GeomAbs_SurfaceOfRevolution :
- if ((T == GeomAbs_IsoV && SurfType == GeomAbs_SurfaceOfRevolution) ||
- (T == GeomAbs_IsoU && SurfType == GeomAbs_SurfaceOfExtrusion)) {
- if (SurfType == GeomAbs_SurfaceOfExtrusion) break;
- for (j = 1; j < myDiscret; j++) {
- U1 += stepU;
- V1 += stepV;
- S.D0(U1,V1,P);
- DrawTo(P,Pts,Cells);
- }
- } else {
- CurvType = (S.BasisCurve())->GetType();
- switch (CurvType) {
- case GeomAbs_Line :
- break;
- case GeomAbs_Circle :
- case GeomAbs_Ellipse :
- for (j = 1; j < myDiscret; j++) {
- U1 += stepU;
- V1 += stepV;
- S.D0(U1,V1,P);
- DrawTo(P,Pts,Cells);
- }
- break;
- case GeomAbs_Parabola :
- case GeomAbs_Hyperbola :
- case GeomAbs_BezierCurve :
- case GeomAbs_BSplineCurve :
- case GeomAbs_OtherCurve :
- for (j = 1; j <= myDiscret/2; j++) {
-
- PlotCount = 0;
-
- PlotIso ( S, T, U1, V1,(T == GeomAbs_IsoV) ? stepU*2. : stepV*2., halt, Pts, Cells);
- U1 += stepU*2.;
- V1 += stepV*2.;
- }
- break;
- }
- }
+ if ((T == GeomAbs_IsoV && SurfType == GeomAbs_SurfaceOfRevolution) ||
+ (T == GeomAbs_IsoU && SurfType == GeomAbs_SurfaceOfExtrusion)) {
+ if (SurfType == GeomAbs_SurfaceOfExtrusion) break;
+ for (j = 1; j < myDiscret; j++) {
+ U1 += stepU;
+ V1 += stepV;
+ S.D0(U1,V1,P);
+ DrawTo(P,Pts,Cells);
+ }
+ } else {
+ CurvType = (S.BasisCurve())->GetType();
+ switch (CurvType) {
+ case GeomAbs_Line :
+ break;
+ case GeomAbs_Circle :
+ case GeomAbs_Ellipse :
+ for (j = 1; j < myDiscret; j++) {
+ U1 += stepU;
+ V1 += stepV;
+ S.D0(U1,V1,P);
+ DrawTo(P,Pts,Cells);
+ }
+ break;
+ case GeomAbs_Parabola :
+ case GeomAbs_Hyperbola :
+ case GeomAbs_BezierCurve :
+ case GeomAbs_BSplineCurve :
+ case GeomAbs_OtherCurve :
+ for (j = 1; j <= myDiscret/2; j++) {
+
+ PlotCount = 0;
+
+ PlotIso ( S, T, U1, V1,(T == GeomAbs_IsoV) ? stepU*2. : stepV*2., halt, Pts, Cells);
+ U1 += stepU*2.;
+ V1 += stepV*2.;
+ }
+ break;
+ }
+ }
}
}
S.D0(U2,V2,P);
//=======================================================================
void GEOM_OCCReader::PlotIso (BRepAdaptor_Surface& S,
- GeomAbs_IsoType T,
- Standard_Real& U,
- Standard_Real& V,
- Standard_Real Step,
- Standard_Boolean& halt,
- vtkPoints* Pts,
- vtkCellArray* Cells)
+ GeomAbs_IsoType T,
+ Standard_Real& U,
+ Standard_Real& V,
+ Standard_Real Step,
+ Standard_Boolean& halt,
+ vtkPoints* Pts,
+ vtkCellArray* Cells)
{
++PlotCount;
//=======================================================================
void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge,
- vtkPoints* Pts,
- vtkCellArray* Cells) {
+ vtkPoints* Pts,
+ vtkCellArray* Cells) {
Handle(Poly_PolygonOnTriangulation) aEdgePoly;
gp_Pnt pt2 = theNodesP(j+1);
if(!isidtrsf) {
- // apply edge transformation
- pt1.Transform(edgeTransf);
- pt2.Transform(edgeTransf);
+ // apply edge transformation
+ pt1.Transform(edgeTransf);
+ pt2.Transform(edgeTransf);
}
// insert pt1
gp_Pnt pt2 = theNodesPoly(id2);
if(!isidtrsf) {
- // apply edge transformation
- pt1.Transform(edgeTransf);
- pt2.Transform(edgeTransf);
+ // apply edge transformation
+ pt1.Transform(edgeTransf);
+ pt2.Transform(edgeTransf);
}
// insert pt1
//=======================================================================
void GEOM_OCCReader::TransferVertexWData(const TopoDS_Vertex& aVertex,
- vtkPoints* Pts,
- vtkCellArray* Cells) {
+ vtkPoints* Pts,
+ vtkCellArray* Cells) {
#define ZERO_COORD coord[0] = 0.0; coord[1] = 0.0; coord[2] = 0.0
gp_Pnt P = BRep_Tool::Pnt( aVertex );
Cells->InsertNextCell(2,pts);
#undef ZERO_COORD
-}
+}
//=======================================================================
// Function : TransferEdgeSData(
//=======================================================================
void GEOM_OCCReader::TransferEdgeSData(const TopoDS_Edge& aFace,
- vtkPoints* Pts,
- vtkCellArray* Cells)
+ vtkPoints* Pts,
+ vtkCellArray* Cells)
{
}
// Purpose : Transfert shading data for FACE
//=======================================================================
void GEOM_OCCReader::TransferFaceSData(const TopoDS_Face& aFace,
- vtkPoints* Pts,
- vtkCellArray* Cells) {
+ vtkPoints* Pts,
+ vtkCellArray* Cells) {
TopLoc_Location aLoc;
Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
Standard_Integer nbNodesInFace = aPoly->NbNodes();
Standard_Integer nbTriInFace = aPoly->NbTriangles();
-
+
const Poly_Array1OfTriangle& Triangles = aPoly->Triangles();
const TColgp_Array1OfPnt& Nodes = aPoly->Nodes();
for(i=1;i<=nbTriInFace;i++) {
// Get the triangle
-
+
Standard_Integer N1,N2,N3;
Triangles(i).Get(N1,N2,N3);
-
+
vtkIdType pts[3];
pts[0] = N1-1; pts[1] = N2-1; pts[2] = N3-1;
Cells->InsertNextCell(3,pts);
class GEOM_OBJECT_EXPORT GEOM_OCCReader : public vtkPolyDataSource {
- // methods
+ // methods
- public:
+ public:
static GEOM_OCCReader* New();
GEOM_OCCReader();
~GEOM_OCCReader();
- void Execute();
+ void Execute();
void ComputeShading(vtkPoints* Pts,vtkCellArray* Cells);
void ComputeWireframe(vtkPoints* Pts,vtkCellArray* Cells);
void TransferFaceSData(const TopoDS_Face& aFace,
- vtkPoints* Pts,
- vtkCellArray* Cells);
+ vtkPoints* Pts,
+ vtkCellArray* Cells);
void TransferFaceWData(const TopoDS_Face& aFace,
- vtkPoints* Pts,
- vtkCellArray* Cells);
+ vtkPoints* Pts,
+ vtkCellArray* Cells);
void TransferEdgeSData(const TopoDS_Edge& aEdge,
- vtkPoints* Pts,
- vtkCellArray* Cells);
+ vtkPoints* Pts,
+ vtkCellArray* Cells);
void TransferEdgeWData(const TopoDS_Edge& aEdge,
- vtkPoints* Pts,
- vtkCellArray* Cells);
+ vtkPoints* Pts,
+ vtkCellArray* Cells);
void TransferVertexWData(const TopoDS_Vertex& aVertex,
- vtkPoints* Pts,
- vtkCellArray* Cells);
+ vtkPoints* Pts,
+ vtkCellArray* Cells);
void createISO(const TopoDS_Face &,
- double, int,
- vtkPoints* Pts,
- vtkCellArray* Cells);
+ double, int,
+ vtkPoints* Pts,
+ vtkCellArray* Cells);
void DrawIso(GeomAbs_IsoType aType,
- Standard_Real PParm,
- Standard_Real p1,
- Standard_Real p2,
- vtkPoints* Pts,
- vtkCellArray* Cells,
- Standard_Integer& startidx);
+ Standard_Real PParm,
+ Standard_Real p1,
+ Standard_Real p2,
+ vtkPoints* Pts,
+ vtkCellArray* Cells,
+ Standard_Integer& startidx);
void MoveTo(gp_Pnt P,
- vtkPoints* Pts);
+ vtkPoints* Pts);
void DrawTo(gp_Pnt P,
- vtkPoints* Pts,
- vtkCellArray* Cells);
+ vtkPoints* Pts,
+ vtkCellArray* Cells);
void PlotIso(BRepAdaptor_Surface& S,
- GeomAbs_IsoType T,
- Standard_Real& U,
- Standard_Real& V,
- Standard_Real Step,
- Standard_Boolean& halt,
- vtkPoints* Pts,
- vtkCellArray* Cells);
+ GeomAbs_IsoType T,
+ Standard_Real& U,
+ Standard_Real& V,
+ Standard_Real Step,
+ Standard_Boolean& halt,
+ vtkPoints* Pts,
+ vtkCellArray* Cells);
// fields
Standard_Boolean forced;
int discretiso;
- int amode;
+ int amode;
int nbisos;
TopoDS_Shape myShape;
bool myIsVector;
if(!aLoc.IsIdentity()){
identity = false;
myTransf = aLoc.Transformation();
- }
+ }
Standard_Integer i;
int aNbOfNodes = thePts->GetNumberOfPoints();
void GEOM_VTKTrihedronAxis::SetSize( vtkFloatingPointType theSize )
{
vtkFloatingPointType aPosition[ 3 ] = { myOri[ 0 ] + myDir[ 0 ] * theSize,
- myOri[ 1 ] + myDir[ 1 ] * theSize,
- myOri[ 2 ] + myDir[ 2 ] * theSize };
+ myOri[ 1 ] + myDir[ 1 ] * theSize,
+ myOri[ 2 ] + myDir[ 2 ] * theSize };
myLineSource->SetPoint1( myOri[ 0 ], myOri[ 1 ], myOri[ 2 ] );
myLineSource->SetPoint2( aPosition );
GEOM_WireframeFace::
OCC2VTK(const TopoDS_Face& theFace,
vtkPolyData* thePolyData,
- vtkPoints* thePts,
+ vtkPoints* thePts,
const int theNbIso[2],
const int theDiscret)
{
void
GEOM_WireframeFace::
CreateIso(const TopoDS_Face& theFace,
- const int theNbIso[2],
+ const int theNbIso[2],
const int theDiscret,
vtkPolyData* thePolyData,
vtkPoints* thePts)
Geom2dHatch_Hatcher
aHatcher(Geom2dHatch_Intersector(INTERSECTOR_CONFUSION,
INTERSECTOR_TANGENCY),
- HATHCER_CONFUSION_2D,
- HATHCER_CONFUSION_3D,
- Standard_True,
- Standard_False);
+ HATHCER_CONFUSION_2D,
+ HATHCER_CONFUSION_3D,
+ Standard_True,
+ Standard_False);
Standard_Real anUMin, anUMax, aVMin, aVMax;
TColStd_Array1OfReal anUPrm(1, theNbIso[0]), aVPrm(1, theNbIso[1]);
//-- Test if a TrimmedCurve is necessary
if(Abs(PCurve->FirstParameter()-U1) <= Precision::PConfusion() &&
- Abs(PCurve->LastParameter()-U2) <= Precision::PConfusion())
+ Abs(PCurve->LastParameter()-U2) <= Precision::PConfusion())
{
aHatcher.AddElement(PCurve, anEdge.Orientation()) ;
}else{
if(!PCurve->IsPeriodic()){
- Handle(Geom2d_TrimmedCurve) TrimPCurve =
+ Handle(Geom2d_TrimmedCurve) TrimPCurve =
Handle(Geom2d_TrimmedCurve)::DownCast(PCurve);
- if(!TrimPCurve.IsNull()){
+ if(!TrimPCurve.IsNull()){
Handle_Geom2d_Curve aBasisCurve = TrimPCurve->BasisCurve();
- if(aBasisCurve->FirstParameter()-U1 > Precision::PConfusion() ||
- U2-aBasisCurve->LastParameter() > Precision::PConfusion())
+ if(aBasisCurve->FirstParameter()-U1 > Precision::PConfusion() ||
+ U2-aBasisCurve->LastParameter() > Precision::PConfusion())
{
- aHatcher.AddElement(PCurve, anEdge.Orientation()) ;
- return;
- }
- }else{
- if(PCurve->FirstParameter()-U1 > Precision::PConfusion()){
- U1=PCurve->FirstParameter();
- }
- if(U2-PCurve->LastParameter() > Precision::PConfusion()){
- U2=PCurve->LastParameter();
- }
- }
+ aHatcher.AddElement(PCurve, anEdge.Orientation()) ;
+ return;
+ }
+ }else{
+ if(PCurve->FirstParameter()-U1 > Precision::PConfusion()){
+ U1=PCurve->FirstParameter();
+ }
+ if(U2-PCurve->LastParameter() > Precision::PConfusion()){
+ U2=PCurve->LastParameter();
+ }
+ }
}
Handle(Geom2d_TrimmedCurve) TrimPCurve =
new Geom2d_TrimmedCurve(PCurve, U1, U2);
Index = anUInd(IIso) ;
if(Index != 0){
if(aHatcher.TrimDone(Index) && !aHatcher.TrimFailed(Index)){
- aHatcher.ComputeDomains(Index);
- if(aHatcher.IsDone (Index))
+ aHatcher.ComputeDomains(Index);
+ if(aHatcher.IsDone (Index))
aNbDom = aHatcher.NbDomains (Index);
}
}
Index = aVInd(IIso);
if(Index != 0){
if(aHatcher.TrimDone (Index) && !aHatcher.TrimFailed(Index)){
- aHatcher.ComputeDomains (Index);
- if(aHatcher.IsDone (Index))
+ aHatcher.ComputeDomains (Index);
+ if(aHatcher.IsDone (Index))
aNbDom = aHatcher.NbDomains (Index);
}
}
if(UInd != 0){
Standard_Real UPrm = anUPrm.Value(UIso);
if(aHatcher.IsDone(UInd)){
- Standard_Integer NbDom = aHatcher.NbDomains(UInd);
- for(Standard_Integer IDom = 1 ; IDom <= NbDom ; IDom++){
- const HatchGen_Domain& Dom = aHatcher.Domain(UInd, IDom) ;
- Standard_Real V1 = Dom.HasFirstPoint()? Dom.FirstPoint().Parameter(): aVMin - VTKINFINITE;
- Standard_Real V2 = Dom.HasSecondPoint()? Dom.SecondPoint().Parameter(): aVMax + VTKINFINITE;
- CreateIso_(theFace, GeomAbs_IsoU, UPrm, V1, V2, theDiscret, thePolyData, thePts);
- }
- }
+ Standard_Integer NbDom = aHatcher.NbDomains(UInd);
+ for(Standard_Integer IDom = 1 ; IDom <= NbDom ; IDom++){
+ const HatchGen_Domain& Dom = aHatcher.Domain(UInd, IDom) ;
+ Standard_Real V1 = Dom.HasFirstPoint()? Dom.FirstPoint().Parameter(): aVMin - VTKINFINITE;
+ Standard_Real V2 = Dom.HasSecondPoint()? Dom.SecondPoint().Parameter(): aVMax + VTKINFINITE;
+ CreateIso_(theFace, GeomAbs_IsoU, UPrm, V1, V2, theDiscret, thePolyData, thePts);
+ }
+ }
}
}
if(VInd != 0){
Standard_Real VPrm = aVPrm.Value(VIso);
if(aHatcher.IsDone (VInd)){
- Standard_Integer NbDom = aHatcher.NbDomains(VInd);
- for (Standard_Integer IDom = 1 ; IDom <= NbDom ; IDom++){
- const HatchGen_Domain& Dom = aHatcher.Domain(VInd, IDom);
- Standard_Real U1 = Dom.HasFirstPoint()? Dom.FirstPoint().Parameter(): aVMin - VTKINFINITE;
- Standard_Real U2 = Dom.HasSecondPoint()? Dom.SecondPoint().Parameter(): aVMax + VTKINFINITE;
- CreateIso_(theFace, GeomAbs_IsoV, VPrm, U1, U2, theDiscret, thePolyData, thePts);
- }
+ Standard_Integer NbDom = aHatcher.NbDomains(VInd);
+ for (Standard_Integer IDom = 1 ; IDom <= NbDom ; IDom++){
+ const HatchGen_Domain& Dom = aHatcher.Domain(VInd, IDom);
+ Standard_Real U1 = Dom.HasFirstPoint()? Dom.FirstPoint().Parameter(): aVMin - VTKINFINITE;
+ Standard_Real U2 = Dom.HasSecondPoint()? Dom.SecondPoint().Parameter(): aVMax + VTKINFINITE;
+ CreateIso_(theFace, GeomAbs_IsoV, VPrm, U1, U2, theDiscret, thePolyData, thePts);
+ }
}
}
}
V2 = Par;
stepV = 0;
nbIntv = nbUIntv;
- }
-
+ }
+
S.D0(U1,V1,P);
MoveTo(P,thePts);
for(Intrv = 1; Intrv <= nbIntv; Intrv++){
if(TI(Intrv) <= T1 && TI(Intrv + 1) <= T1)
- continue;
+ continue;
if(TI(Intrv) >= T2 && TI(Intrv + 1) >= T2)
- continue;
+ continue;
if(theIsoType == GeomAbs_IsoU){
- V1 = Max(T1, TI(Intrv));
- V2 = Min(T2, TI(Intrv + 1));
- stepV = (V2 - V1) / theDiscret;
+ V1 = Max(T1, TI(Intrv));
+ V2 = Min(T2, TI(Intrv + 1));
+ stepV = (V2 - V1) / theDiscret;
}else{
- U1 = Max(T1, TI(Intrv));
- U2 = Min(T2, TI(Intrv + 1));
- stepU = (U2 - U1) / theDiscret;
+ U1 = Max(T1, TI(Intrv));
+ U2 = Min(T2, TI(Intrv + 1));
+ stepU = (U2 - U1) / theDiscret;
}
switch (SurfType) {
case GeomAbs_Plane :
- break;
+ break;
case GeomAbs_Cylinder :
case GeomAbs_Cone :
- if(theIsoType == GeomAbs_IsoV){
- for(j = 1; j < theDiscret; j++){
- U1 += stepU;
- V1 += stepV;
- S.D0(U1,V1,P);
- DrawTo(P,thePolyData,thePts);
- }
- }
- break;
+ if(theIsoType == GeomAbs_IsoV){
+ for(j = 1; j < theDiscret; j++){
+ U1 += stepU;
+ V1 += stepV;
+ S.D0(U1,V1,P);
+ DrawTo(P,thePolyData,thePts);
+ }
+ }
+ break;
case GeomAbs_Sphere :
case GeomAbs_Torus :
case GeomAbs_OffsetSurface :
case GeomAbs_OtherSurface :
- for(j = 1; j < theDiscret; j++){
- U1 += stepU;
- V1 += stepV;
- S.D0(U1,V1,P);
- DrawTo(P,thePolyData,thePts);
- }
- break;
+ for(j = 1; j < theDiscret; j++){
+ U1 += stepU;
+ V1 += stepV;
+ S.D0(U1,V1,P);
+ DrawTo(P,thePolyData,thePts);
+ }
+ break;
case GeomAbs_BezierSurface :
case GeomAbs_BSplineSurface :
- for(j = 1; j <= theDiscret/2; j++){
+ for(j = 1; j <= theDiscret/2; j++){
Standard_Real aStep = (theIsoType == GeomAbs_IsoV) ? stepU*2. : stepV*2.;
- CreateIso__(S, theIsoType, U1, V1, aStep, thePolyData, thePts);
- U1 += stepU*2.;
- V1 += stepV*2.;
- }
- break;
+ CreateIso__(S, theIsoType, U1, V1, aStep, thePolyData, thePts);
+ U1 += stepU*2.;
+ V1 += stepV*2.;
+ }
+ break;
case GeomAbs_SurfaceOfExtrusion :
case GeomAbs_SurfaceOfRevolution :
- if((theIsoType == GeomAbs_IsoV && SurfType == GeomAbs_SurfaceOfRevolution) ||
- (theIsoType == GeomAbs_IsoU && SurfType == GeomAbs_SurfaceOfExtrusion))
+ if((theIsoType == GeomAbs_IsoV && SurfType == GeomAbs_SurfaceOfRevolution) ||
+ (theIsoType == GeomAbs_IsoU && SurfType == GeomAbs_SurfaceOfExtrusion))
{
- if(SurfType == GeomAbs_SurfaceOfExtrusion)
+ if(SurfType == GeomAbs_SurfaceOfExtrusion)
break;
- for(j = 1; j < theDiscret; j++){
- U1 += stepU;
- V1 += stepV;
- S.D0(U1,V1,P);
- DrawTo(P,thePolyData,thePts);
- }
- }else{
- CurvType = (S.BasisCurve())->GetType();
- switch(CurvType){
- case GeomAbs_Line :
- break;
- case GeomAbs_Circle :
- case GeomAbs_Ellipse :
- for (j = 1; j < theDiscret; j++) {
- U1 += stepU;
- V1 += stepV;
- S.D0(U1,V1,P);
- DrawTo(P,thePolyData,thePts);
- }
- break;
- case GeomAbs_Parabola :
- case GeomAbs_Hyperbola :
- case GeomAbs_BezierCurve :
- case GeomAbs_BSplineCurve :
- case GeomAbs_OtherCurve :
- for(j = 1; j <= theDiscret/2; j++){
+ for(j = 1; j < theDiscret; j++){
+ U1 += stepU;
+ V1 += stepV;
+ S.D0(U1,V1,P);
+ DrawTo(P,thePolyData,thePts);
+ }
+ }else{
+ CurvType = (S.BasisCurve())->GetType();
+ switch(CurvType){
+ case GeomAbs_Line :
+ break;
+ case GeomAbs_Circle :
+ case GeomAbs_Ellipse :
+ for (j = 1; j < theDiscret; j++) {
+ U1 += stepU;
+ V1 += stepV;
+ S.D0(U1,V1,P);
+ DrawTo(P,thePolyData,thePts);
+ }
+ break;
+ case GeomAbs_Parabola :
+ case GeomAbs_Hyperbola :
+ case GeomAbs_BezierCurve :
+ case GeomAbs_BSplineCurve :
+ case GeomAbs_OtherCurve :
+ for(j = 1; j <= theDiscret/2; j++){
Standard_Real aStep = (theIsoType == GeomAbs_IsoV) ? stepU*2. : stepV*2.;
- CreateIso__(S, theIsoType, U1, V1, aStep, thePolyData, thePts);
- U1 += stepU*2.;
- V1 += stepV*2.;
- }
- break;
- }
- }
+ CreateIso__(S, theIsoType, U1, V1, aStep, thePolyData, thePts);
+ U1 += stepU*2.;
+ V1 += stepV*2.;
+ }
+ break;
+ }
+ }
}
}
S.D0(U2,V2,P);
GEOM_WireframeFace::
CreateIso__(const BRepAdaptor_Surface& theSurface,
GeomAbs_IsoType theIsoType,
- Standard_Real& theU,
- Standard_Real& theV,
- Standard_Real theStep,
+ Standard_Real& theU,
+ Standard_Real& theV,
+ Standard_Real theStep,
vtkPolyData* thePolyData,
vtkPoints* thePts)
{
static
void
CreateIso(const TopoDS_Face& theFace,
- const int theNbIso[2],
+ const int theNbIso[2],
const int theDiscret,
vtkPolyData* thePolyData,
vtkPoints* thePts);
void
CreateIso__(const BRepAdaptor_Surface& theSurface,
GeomAbs_IsoType theIsoType,
- Standard_Real& theU,
- Standard_Real& theV,
- Standard_Real theStep,
+ Standard_Real& theU,
+ Standard_Real& theV,
+ Standard_Real theStep,
vtkPolyData* thePolyData,
vtkPoints* thePts);
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_ARCHIMEDE" ) );
GEOMBase_Skeleton::ActivateThisDialog();
globalSelection( GEOM_ALLSHAPES );
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
case 1:
if (myRadioButton[ RadioButton21 ]->isChecked())
{
- ok = mySpinBox[ SpinBox21 ]->isValid( msg, !IsPreview() ) && ok;
- ok = mySpinBox[ SpinBox22 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox21 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox22 ]->isValid( msg, !IsPreview() ) && ok;
}
else
{
- ok = mySpinBox[ SpinBox23 ]->isValid( msg, !IsPreview() ) && ok;
- ok = mySpinBox[ SpinBox24 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox23 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox24 ]->isValid( msg, !IsPreview() ) && ok;
}
return !myShape->_is_nil() && myFace[ Face1 ] > 0 && myFace[ Face2 ] > 0 && ok;
case 2:
if (myRadioButton[ RadioButton31 ]->isChecked())
{
- ok = mySpinBox[ SpinBox31 ]->isValid( msg, !IsPreview() ) && ok;
- ok = mySpinBox[ SpinBox32 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox31 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox32 ]->isValid( msg, !IsPreview() ) && ok;
}
else
{
- ok = mySpinBox[ SpinBox33 ]->isValid( msg, !IsPreview() ) && ok;
- ok = mySpinBox[ SpinBox34 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox33 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox34 ]->isValid( msg, !IsPreview() ) && ok;
}
return !myShape->_is_nil() && myFaces.Extent() > 0 && ok;
case 3:
if (myRadioButton[ RadioButton41 ]->isChecked())
{
- ok = mySpinBox[ SpinBox41 ]->isValid( msg, !IsPreview() ) && ok;
- ok = mySpinBox[ SpinBox42 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox41 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox42 ]->isValid( msg, !IsPreview() ) && ok;
}
else
{
- ok = mySpinBox[ SpinBox43 ]->isValid( msg, !IsPreview() ) && ok;
- ok = mySpinBox[ SpinBox44 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox43 ]->isValid( msg, !IsPreview() ) && ok;
+ ok = mySpinBox[ SpinBox44 ]->isValid( msg, !IsPreview() ) && ok;
}
return !myShape->_is_nil() && myEdges.Extent() > 0 && ok;
default: return false;
else if (anId == 1) {
if (flag) {
anObj = anOper->MakeChamferEdge(myShape,
- mySpinBox[ SpinBox21 ]->value(),
- mySpinBox[ SpinBox22 ]->value(),
- myFace[ Face1 ],
- myFace[ Face2 ]);
+ mySpinBox[ SpinBox21 ]->value(),
+ mySpinBox[ SpinBox22 ]->value(),
+ myFace[ Face1 ],
+ myFace[ Face2 ]);
if (!anObj->_is_nil())
{
- aParameters << mySpinBox[ SpinBox21 ]->text();
- aParameters << mySpinBox[ SpinBox22 ]->text();
+ aParameters << mySpinBox[ SpinBox21 ]->text();
+ aParameters << mySpinBox[ SpinBox22 ]->text();
}
}
else {
anObj = anOper->MakeChamferEdgeAD(myShape,
- mySpinBox[ SpinBox23 ]->value(),
- mySpinBox[ SpinBox24 ]->value() * PI180,
- myFace[ Face1 ],
- myFace[ Face2 ]);
+ mySpinBox[ SpinBox23 ]->value(),
+ mySpinBox[ SpinBox24 ]->value() * PI180,
+ myFace[ Face1 ],
+ myFace[ Face2 ]);
if (!anObj->_is_nil())
{
- aParameters << mySpinBox[ SpinBox23 ]->text();
- aParameters << mySpinBox[ SpinBox24 ]->text();
+ aParameters << mySpinBox[ SpinBox23 ]->text();
+ aParameters << mySpinBox[ SpinBox24 ]->text();
}
}
}
if (flag) {
anObj = anOper->MakeChamferFaces(myShape,
- mySpinBox[ SpinBox31 ]->value(),
- mySpinBox[ SpinBox32 ]->value(),
- anArray);
+ mySpinBox[ SpinBox31 ]->value(),
+ mySpinBox[ SpinBox32 ]->value(),
+ anArray);
if (!anObj->_is_nil())
{
- aParameters << mySpinBox[ SpinBox31 ]->text();
- aParameters << mySpinBox[ SpinBox32 ]->text();
+ aParameters << mySpinBox[ SpinBox31 ]->text();
+ aParameters << mySpinBox[ SpinBox32 ]->text();
}
}
else {
anObj = anOper->MakeChamferFacesAD(myShape,
- mySpinBox[ SpinBox33 ]->value(),
- mySpinBox[ SpinBox34 ]->value() * PI180,
- anArray);
+ mySpinBox[ SpinBox33 ]->value(),
+ mySpinBox[ SpinBox34 ]->value() * PI180,
+ anArray);
if (!anObj->_is_nil())
{
- aParameters << mySpinBox[ SpinBox33 ]->text();
- aParameters << mySpinBox[ SpinBox34 ]->text();
+ aParameters << mySpinBox[ SpinBox33 ]->text();
+ aParameters << mySpinBox[ SpinBox34 ]->text();
}
}
}
anArray[ i - 1 ] = myEdges(i);
if (flag) {
anObj = anOper->MakeChamferEdges(myShape,
- mySpinBox[ SpinBox41 ]->value(),
- mySpinBox[ SpinBox42 ]->value(),
- anArray);
+ mySpinBox[ SpinBox41 ]->value(),
+ mySpinBox[ SpinBox42 ]->value(),
+ anArray);
if (!anObj->_is_nil())
{
- aParameters << mySpinBox[ SpinBox41 ]->text();
- aParameters << mySpinBox[ SpinBox42 ]->text();
+ aParameters << mySpinBox[ SpinBox41 ]->text();
+ aParameters << mySpinBox[ SpinBox42 ]->text();
}
}
else {
anObj = anOper->MakeChamferEdgesAD(myShape,
- mySpinBox[ SpinBox43 ]->value(),
- mySpinBox[ SpinBox44 ]->value() * PI180,
- anArray);
+ mySpinBox[ SpinBox43 ]->value(),
+ mySpinBox[ SpinBox44 ]->value() * PI180,
+ anArray);
if (!anObj->_is_nil())
{
- aParameters << mySpinBox[ SpinBox43 ]->text();
- aParameters << mySpinBox[ SpinBox44 ]->text();
+ aParameters << mySpinBox[ SpinBox43 ]->text();
+ aParameters << mySpinBox[ SpinBox44 ]->text();
}
}
}
enum { MainObj1, MainObj2, Face1, Face2, MainObj3, Faces, MainObj4, Edges};
enum { SpinBox1,
- SpinBox21, SpinBox22, SpinBox23, SpinBox24,
- SpinBox31, SpinBox32, SpinBox33, SpinBox34,
- SpinBox41, SpinBox42, SpinBox43, SpinBox44 };
+ SpinBox21, SpinBox22, SpinBox23, SpinBox24,
+ SpinBox31, SpinBox32, SpinBox33, SpinBox34,
+ SpinBox41, SpinBox42, SpinBox43, SpinBox44 };
enum { RadioButton21, RadioButton22,
RadioButton31, RadioButton32,
RadioButton41, RadioButton42 };
void Init();
void enterEvent( QEvent* );
void createSelWg( const QString&, QPixmap&, QWidget*,
- QGridLayout*, const int );
+ QGridLayout*, const int );
void createRadioWg( const QString&, const QString&, QWidget*,
- QGridLayout*, const int, const int, const int );
+ QGridLayout*, const int, const int, const int );
void activateSelection();
void enableWidgets();
center[2] = ( bounds[4] + bounds[5] ) / 2.0;
double width = sqrt( ( bounds[1]-bounds[0] ) * ( bounds[1]-bounds[0] ) +
- ( bounds[3]-bounds[2] ) * ( bounds[3]-bounds[2] ) +
- ( bounds[5]-bounds[4] ) * ( bounds[5]-bounds[4] ) );
+ ( bounds[3]-bounds[2] ) * ( bounds[3]-bounds[2] ) +
+ ( bounds[5]-bounds[4] ) * ( bounds[5]-bounds[4] ) );
double distance = sqrt( ( position[0]-center[0] ) * ( position[0]-center[0] ) +
- ( position[1]-center[1] ) * ( position[1]-center[1] ) +
- ( position[2]-center[2] ) * ( position[2]-center[2] ) );
+ ( position[1]-center[1] ) * ( position[1]-center[1] ) +
+ ( position[2]-center[2] ) * ( position[2]-center[2] ) );
vtkFloatingPointType range[2] = { distance - width/2.0, distance + width/2.0 };
center[2] = ( bounds[4] + bounds[5] ) / 2.0;
double width = sqrt( ( bounds[1]-bounds[0] ) * ( bounds[1]-bounds[0] ) +
- ( bounds[3]-bounds[2] ) * ( bounds[3]-bounds[2] ) +
- ( bounds[5]-bounds[4] ) * ( bounds[5]-bounds[4] ) );
+ ( bounds[3]-bounds[2] ) * ( bounds[3]-bounds[2] ) +
+ ( bounds[5]-bounds[4] ) * ( bounds[5]-bounds[4] ) );
double distance = sqrt( ( position[0]-center[0] ) * ( position[0]-center[0] ) +
- ( position[1]-center[1] ) * ( position[1]-center[1] ) +
- ( position[2]-center[2] ) * ( position[2]-center[2] ) );
+ ( position[1]-center[1] ) * ( position[1]-center[1] ) +
+ ( position[2]-center[2] ) * ( position[2]-center[2] ) );
vtkFloatingPointType range[2] = { distance - width/2.0, distance + width/2.0 };
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
if (aResult && !anObj->_is_nil()) {
- QString aName = GEOMBase::GetName( anObj );
- TopoDS_Shape aShape;
- if ( GEOMBase::GetShape( anObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
- TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes(aSelList.First(), aMap);
- if ( aMap.Extent() == 1 ) { // Local Selection
- int anIndex = aMap( 1 );
- aName += QString( myIs1D ? ":wire_%1" : ":face_%1" ).arg( anIndex );
+ QString aName = GEOMBase::GetName( anObj );
+ TopoDS_Shape aShape;
+ if ( GEOMBase::GetShape( anObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
+ TColStd_IndexedMapOfInteger aMap;
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
+ if ( aMap.Extent() == 1 ) { // Local Selection
+ int anIndex = aMap( 1 );
+ aName += QString( myIs1D ? ":wire_%1" : ":face_%1" ).arg( anIndex );
- //Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( anObj, aName );
-
- if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
- anObj = aShapesOp->GetSubShape( anObj, anIndex );
- }
- else
- anObj = aFindedObject; // get Object from study
- }
- else { // Global Selection
- if ( aShape.ShapeType() != (myIs1D ? TopAbs_WIRE : TopAbs_FACE) ) {
- anObj = GEOM::GEOM_Object::_nil();
- aName = "";
- }
- }
- }
- myShape = anObj;
- myEditCurrentArgument->setText(aName
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( anObj, aName );
+
+ if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ anObj = aShapesOp->GetSubShape( anObj, anIndex );
+ }
+ else
+ anObj = aFindedObject; // get Object from study
+ }
+ else { // Global Selection
+ if ( aShape.ShapeType() != (myIs1D ? TopAbs_WIRE : TopAbs_FACE) ) {
+ anObj = GEOM::GEOM_Object::_nil();
+ aName = "";
+ }
+ }
+ }
+ myShape = anObj;
+ myEditCurrentArgument->setText(aName
);
- displayPreview();
+ displayPreview();
}
}
} else if (myEditCurrentArgument == GroupVertexes->LineEdit2) {
isPreview = true;
myEditCurrentArgument->setText(aName);
- myVertexes = anIndexes;
+ myVertexes = anIndexes;
}
}
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
return !myShape->_is_nil() && ok;
case 1:
if (Group2->RadioButton1->isChecked())
- ok = Group2->SpinBox_DX->isValid( msg, !IsPreview() );
+ ok = Group2->SpinBox_DX->isValid( msg, !IsPreview() );
else
{
- ok = Group2->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
- ok = Group2->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+ ok = Group2->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ ok = Group2->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
}
return !myShape->_is_nil() && myEdges.Extent() > 0 && ok;
case 2:
if (Group3->RadioButton1->isChecked())
- ok = Group3->SpinBox_DX->isValid( msg, !IsPreview() );
+ ok = Group3->SpinBox_DX->isValid( msg, !IsPreview() );
else
{
- ok = Group3->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
- ok = Group3->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+ ok = Group3->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+ ok = Group3->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
}
return !myShape->_is_nil() && myFaces.Extent() > 0 && ok;
default: return false;
{
anObj = anOper->MakeFilletEdges(myShape, getRadius(), aList);
if (!anObj->_is_nil())
- aParameters << Group2->SpinBox_DX->text();
+ aParameters << Group2->SpinBox_DX->text();
}
else
{
anObj = anOper->MakeFilletEdgesR1R2(myShape,
- Group2->SpinBox_DY->value(),
- Group2->SpinBox_DZ->value(),
- aList);
+ Group2->SpinBox_DY->value(),
+ Group2->SpinBox_DZ->value(),
+ aList);
if (!anObj->_is_nil())
{
- aParameters << Group2->SpinBox_DY->text();
- aParameters << Group2->SpinBox_DZ->text();
+ aParameters << Group2->SpinBox_DY->text();
+ aParameters << Group2->SpinBox_DZ->text();
}
}
}
if (Group3->RadioButton1->isChecked()) {
anObj = anOper->MakeFilletFaces(myShape, getRadius(), aList);
if (!anObj->_is_nil())
- aParameters << Group3->SpinBox_DX->text();
+ aParameters << Group3->SpinBox_DX->text();
}
else {
anObj = anOper->MakeFilletFacesR1R2(myShape,
- Group3->SpinBox_DY->value(),
- Group3->SpinBox_DZ->value(), aList);
+ Group3->SpinBox_DY->value(),
+ Group3->SpinBox_DZ->value(), aList);
if (!anObj->_is_nil())
{
- aParameters << Group3->SpinBox_DY->text();
- aParameters << Group3->SpinBox_DZ->text();
+ aParameters << Group3->SpinBox_DY->text();
+ aParameters << Group3->SpinBox_DZ->text();
}
}
}
GEOMBase_Skeleton::ActivateThisDialog();
globalSelection(GEOM_ALLSHAPES);
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
}
//=================================================================================
GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
GEOM::GEOM_Object_var anObj = anOper->GetShapesOnShapeAsCompound(myObject2, myObject1,
- (CORBA::Short) aLimit,
- aState);
+ (CORBA::Short) aLimit,
+ aState);
if (!anObj->_is_nil())
objects.push_back(anObj._retn());
QStringList labels;
labels << GEOMBase::GetName( anObject );
labels << ( ind < myListMaterials.length() ?
- QString::number( myListMaterials[ind] ) : QString( "0" ) );
+ QString::number( myListMaterials[ind] ) : QString( "0" ) );
GroupPoints->ListView1->addTopLevelItem( new QTreeWidgetItem( labels ) );
}
}
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetMaterial() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
return;
}
public:
OperationGUI_MaterialDlg( GeometryGUI*, QWidget*, GEOM::ListOfGO,
- bool = false );
+ bool = false );
~OperationGUI_MaterialDlg();
private:
connect( GroupPoints->ComboBox1, SIGNAL( activated( int ) ), this, SLOT( ComboTextChanged() ) );
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_PARTITION" ) );
myEditCurrentArgument->setFocus();
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
bool OperationGUI_PartitionDlg::isValid( QString& )
{
return ( myListShapes.length() || myListTools.length() ||
- myListKeepInside.length() || myListRemoveInside.length() );
+ myListKeepInside.length() || myListRemoveInside.length() );
}
if ( isValid( msg ) ) {
GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
anObj = anOper->MakePartition( myListShapes, myListTools,
- myListKeepInside, myListRemoveInside,
- aLimit, false, myListMaterials, aKeepNonlimitShapes );
+ myListKeepInside, myListRemoveInside,
+ aLimit, false, myListMaterials, aKeepNonlimitShapes );
res = true;
}
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
- /*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory,
- /*theInheritFirstArg=*/myListShapes.length() == 1 ); // ? false
+ /*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory,
+ /*theInheritFirstArg=*/myListShapes.length() == 1 ); // ? false
}
}
//=======================================================================
void Partition_Inter3d::CompletPart3d(const TopTools_ListOfShape& SetOfFaces1,
- const TopTools_DataMapOfShapeShape& FaceShapeMap)
+ const TopTools_DataMapOfShapeShape& FaceShapeMap)
{
if (myAsDes.IsNull())
myAsDes = new BRepAlgo_AsDes;
for (; itLI.More(); itLI.Next()) {
TopoDS_Face F2 = TopoDS::Face(BOS.TouchedShape(itLI));
if (F1.IsSame(F2) || IsDone(F1,F2))
- continue;
+ continue;
TopoDS_Shape S2;
if (FaceShapeMap.IsBound(F2)) S2 = FaceShapeMap.Find(F2);
if (!S1.IsNull() && S1.IsSame(S2))
- continue; // descendants of one shape
+ continue; // descendants of one shape
TopExp_Explorer expE (F2, TopAbs_EDGE);
for ( ; expE.More(); expE.Next())
- if (EM.Contains( expE.Current() ))
- break;
+ if (EM.Contains( expE.Current() ))
+ break;
if (expE.More())
{
// faces have a common edge, check if they are a tool and a face
F1.Orientation(TopAbs_FORWARD);
F2.Orientation(TopAbs_FORWARD);
- FacesPartition(F1,F2);
+ FacesPartition(F1,F2);
}
// mark as modified a face which has at least one new edge
TopTools_ListIteratorOfListOfShape itE (myAsDes->Descendant( F1 ));
for ( ; itE.More(); itE.Next()) {
if (myNewEdges.Contains( itE.Value())) {
- myTouched.Add( F1 );
- break;
+ myTouched.Add( F1 );
+ break;
}
}
}
//=======================================================================
static void PutInBounds (const TopoDS_Face& F,
- const TopoDS_Edge& E,
- Handle(Geom2d_Curve)& C2d)
+ const TopoDS_Edge& E,
+ Handle(Geom2d_Curve)& C2d)
{
Standard_Real umin,umax,vmin,vmax;
Standard_Real f,l;
Standard_Real d2 = umin - minC + period;
if (d2 < d1) du =-period;
if ( du != 0.) {
- gp_Vec2d T2(du,0.);
- C2d->Translate(T2);
+ gp_Vec2d T2(du,0.);
+ C2d->Translate(T2);
}
}
}
Standard_Real d2 = vmin - minC + period;
if (d2 < d1) dv =-period;
if ( dv != 0.) {
- gp_Vec2d T2(0.,dv);
- C2d->Translate(T2);
+ gp_Vec2d T2(0.,dv);
+ C2d->Translate(T2);
}
}
}
//=======================================================================
void Partition_Inter3d::Inter3D(const TopoDS_Face& F1,
- const TopoDS_Face& F2,
- TopTools_ListOfShape& L)
+ const TopoDS_Face& F2,
+ TopTools_ListOfShape& L)
{
BRep_Builder B;
itLE.Next();
if (itLE.More()) {
- pc1 = Handle(Geom2d_Curve)::DownCast(pc1->Copy());
- pc2 = Handle(Geom2d_Curve)::DownCast(pc2->Copy());
+ pc1 = Handle(Geom2d_Curve)::DownCast(pc1->Copy());
+ pc2 = Handle(Geom2d_Curve)::DownCast(pc2->Copy());
}
}
}
oe = TopoDS::Edge( DS.Shape( itP.Support()));
if (itP.IsVertex()) {
// there is a vertex at intersection
- if ( !MIV.Add( itP.Current() ))
- continue;
- V = TopoDS::Vertex( DS.Shape( itP.Current()));
- if ( !sde.IsNull() && (V.IsSame(sdeV1) || V.IsSame(sdeV2)) )
- oe = sde;
- V = ReplaceSameDomainV( V , oe );
- V.Orientation( TopAbs_INTERNAL);
- B.UpdateVertex( V, itP.Parameter(), se, 0.); // AddVonE() sets real U
+ if ( !MIV.Add( itP.Current() ))
+ continue;
+ V = TopoDS::Vertex( DS.Shape( itP.Current()));
+ if ( !sde.IsNull() && (V.IsSame(sdeV1) || V.IsSame(sdeV2)) )
+ oe = sde;
+ V = ReplaceSameDomainV( V , oe );
+ V.Orientation( TopAbs_INTERNAL);
+ B.UpdateVertex( V, itP.Parameter(), se, 0.); // AddVonE() sets real U
}
else {
// create a new vertex at the intersection point
- const TopOpeBRepDS_Point& DSP = DS.Point( itP.Current());
- V = BRepLib_MakeVertex( DSP.Point() );
- V.Orientation( TopAbs_INTERNAL);
- B.UpdateVertex( V, itP.Parameter(), se, DSP.Tolerance());
- // make V be on the other edge
- TopOpeBRepDS_PointIterator itOP (DS.ShapeInterferences( oe ));
- for (; itOP.More(); itOP.Next()) {
- const TopOpeBRepDS_Point& ODSP = DS.Point( itOP.Current());
- if ( DSP.IsEqual (ODSP)) {
- B.UpdateVertex( V, itOP.Parameter(), TopoDS::Edge(oe), ODSP.Tolerance());
- break;
- }
- }
+ const TopOpeBRepDS_Point& DSP = DS.Point( itP.Current());
+ V = BRepLib_MakeVertex( DSP.Point() );
+ V.Orientation( TopAbs_INTERNAL);
+ B.UpdateVertex( V, itP.Parameter(), se, DSP.Tolerance());
+ // make V be on the other edge
+ TopOpeBRepDS_PointIterator itOP (DS.ShapeInterferences( oe ));
+ for (; itOP.More(); itOP.Next()) {
+ const TopOpeBRepDS_Point& ODSP = DS.Point( itOP.Current());
+ if ( DSP.IsEqual (ODSP)) {
+ B.UpdateVertex( V, itOP.Parameter(), TopoDS::Edge(oe), ODSP.Tolerance());
+ break;
+ }
+ }
}
// add V on the both intersecting edges
TopoDS_Vertex addedV = Partition_Inter2d::AddVonE( V,se,oe,myAsDes,dummyF);
if (!addedV.IsSame( V ))
- mySameDomainVM.Bind (V, addedV); // equal vertex is already there
+ mySameDomainVM.Bind (V, addedV); // equal vertex is already there
MV.Add( addedV ); // to ease storage of vertices of ON splits
}
TopTools_ListIteratorOfListOfShape itE( myAsDes->Descendant( F ));
if (myAsDes->HasDescendant( F )) {
for ( ; itE.More(); itE.Next())
- if (se.IsSame( itE.Value() ))
- break;
+ if (se.IsSame( itE.Value() ))
+ break;
}
if (!itE.More())
{
Standard_Real tol, f,l, umin=1e100, umax=-1e100;
Handle(Geom2d_Curve) pc = BRep_Tool::CurveOnSurface( se, F, f,l);
if (pc.IsNull()) {
- itSP.Initialize( TopB.Splits(se,TopAbs_ON) );
- for ( ; itSP.More(); itSP.Next()) {
- const TopoDS_Edge& E = TopoDS::Edge ( itSP.Value());
- BRep_Tool::Range(E, f, l);
- umin = Min( umin, f);
- umax = Max( umax, l);
- }
- Handle(Geom_Curve) C3d = BRep_Tool::Curve( se, f, l);
- if (umin < umax) // sometimes umin == umax for closed edge
- C3d = new Geom_TrimmedCurve( C3d, umin, umax);
- pc = TopOpeBRepTool_CurveTool::MakePCurveOnFace (F,C3d,tol);
- if (pc.IsNull()) {
- MESSAGE (" CANT BUILD PCURVE ");
- }
- B.UpdateEdge( se, pc, F, tol);
+ itSP.Initialize( TopB.Splits(se,TopAbs_ON) );
+ for ( ; itSP.More(); itSP.Next()) {
+ const TopoDS_Edge& E = TopoDS::Edge ( itSP.Value());
+ BRep_Tool::Range(E, f, l);
+ umin = Min( umin, f);
+ umax = Max( umax, l);
+ }
+ Handle(Geom_Curve) C3d = BRep_Tool::Curve( se, f, l);
+ if (umin < umax) // sometimes umin == umax for closed edge
+ C3d = new Geom_TrimmedCurve( C3d, umin, umax);
+ pc = TopOpeBRepTool_CurveTool::MakePCurveOnFace (F,C3d,tol);
+ if (pc.IsNull()) {
+ MESSAGE (" CANT BUILD PCURVE ");
+ }
+ B.UpdateEdge( se, pc, F, tol);
}
}
for ( ; itSP.More(); itSP.Next()) {
const TopoDS_Shape& SP = itSP.Value();
if (!SPM.Add( SP ))
- SPM.Remove( SP );
+ SPM.Remove( SP );
}
}
for ( ; itSP.More(); itSP.Next())
{
if (!SPM.Contains( itSP.Value() ))
- continue;
+ continue;
const TopoDS_Edge& S = TopoDS::Edge ( itSP.Value());
TopExp::Vertices (S, VS[0], VS[1]);
for (j=0; j<2; ++j)
{
- if (mySameDomainVM.IsBound( VS[j] ))
- VS[j] = TopoDS::Vertex( mySameDomainVM( VS[j] ));
- if ( !MV.Contains( VS[j] )) {
- // find equal vertex on se - point interference
- gp_Pnt P1 = BRep_Tool::Pnt( VS[j] );
- TopTools_ListIteratorOfListOfShape itV( myAsDes->Descendant(se) );
- for (; itV.More(); itV.Next()) {
- V = TopoDS::Vertex( itV.Value() );
+ if (mySameDomainVM.IsBound( VS[j] ))
+ VS[j] = TopoDS::Vertex( mySameDomainVM( VS[j] ));
+ if ( !MV.Contains( VS[j] )) {
+ // find equal vertex on se - point interference
+ gp_Pnt P1 = BRep_Tool::Pnt( VS[j] );
+ TopTools_ListIteratorOfListOfShape itV( myAsDes->Descendant(se) );
+ for (; itV.More(); itV.Next()) {
+ V = TopoDS::Vertex( itV.Value() );
if ( V.IsSame( VS[j] ))
break;
- gp_Pnt P2 = BRep_Tool::Pnt( V );
- if (P1.IsEqual( P2, Precision::Confusion())) {
- mySameDomainVM.Bind (VS[j], V);
- VS[j] = V;
- break;
- }
- }
- if (!itV.More()) // no interferences with edges
- myAsDes->Add( se, VS[j]);
- }
+ gp_Pnt P2 = BRep_Tool::Pnt( V );
+ if (P1.IsEqual( P2, Precision::Confusion())) {
+ mySameDomainVM.Bind (VS[j], V);
+ VS[j] = V;
+ break;
+ }
+ }
+ if (!itV.More()) // no interferences with edges
+ myAsDes->Add( se, VS[j]);
+ }
// add ends of ON splits to F in order to detect later
// if a split is on face in IsSplitOn()
- mySectionEdgesAD->Add( F, VS[j]);
+ mySectionEdgesAD->Add( F, VS[j]);
}
// in the descendants of F, first go ends of an ON split and
// then a split itself
//=======================================================================
void Partition_Inter3d::FacesPartition(const TopoDS_Face& F1,
- const TopoDS_Face& F2)
+ const TopoDS_Face& F2)
//(const TopTools_DataMapOfShapeListOfShape& /*SetOfFaces2*/)
{
TopTools_ListOfShape LInt;
//=======================================================================
void Partition_Inter3d::SetDone(const TopoDS_Face& F1,
- const TopoDS_Face& F2)
+ const TopoDS_Face& F2)
{
if (!myDone.IsBound(F1)) {
TopTools_ListOfShape emptyList;
//=======================================================================
Standard_Boolean Partition_Inter3d::IsDone(const TopoDS_Face& F1,
- const TopoDS_Face& F2)
+ const TopoDS_Face& F2)
const
{
//=======================================================================
void Partition_Inter3d::StorePart3d(const TopoDS_Face& F1,
- const TopoDS_Face& F2,
- const TopTools_ListOfShape& LInt)
+ const TopoDS_Face& F2,
+ const TopTools_ListOfShape& LInt)
{
if (!LInt.IsEmpty()) {
myAsDes->Add( F1,LInt);
//=======================================================================
Standard_Boolean Partition_Inter3d::IsSameDomainF(const TopoDS_Shape& F1,
- const TopoDS_Shape& F2) const
+ const TopoDS_Shape& F2) const
{
if (mySameDomainFM.IsBound( F1 )) {
TopTools_ListIteratorOfListOfShape it (mySameDomainFM( F1 ));
for (; it.More(); it.Next())
if (F2.IsSame( it.Value()))
- return Standard_True;
+ return Standard_True;
}
return F1.IsSame( F2 );
}
//=======================================================================
TopoDS_Vertex Partition_Inter3d::ReplaceSameDomainV(const TopoDS_Vertex& V,
- const TopoDS_Edge& E) const
+ const TopoDS_Edge& E) const
{
TopoDS_Vertex SDV = V;
if (mySameDomainVM.IsBound( V )) {
Standard_Boolean
Partition_Inter3d::IsSplitOn(const TopoDS_Edge& NewE,
- const TopoDS_Edge& OldE,
- const TopoDS_Face& F) const
+ const TopoDS_Edge& OldE,
+ const TopoDS_Face& F) const
{
if (! mySectionEdgesAD->HasDescendant(F))
return Standard_False;
TopTools_ListIteratorOfListOfShape itE ( mySectionEdgesAD->Descendant(F) );
for ( ; itE.More(); itE.Next()) {
if ( itE.Value().ShapeType() != TopAbs_EDGE ||
- ! OldE.IsSame ( itE.Value() ))
+ ! OldE.IsSame ( itE.Value() ))
continue;
// an edge encountered, its vertices and a split come next
itE.Next();
TopExp::Vertices( OldE, V1, V2);
if ( V1.IsSame(V2) &&
- (V1.IsSame(V3) || V1.IsSame(V4)) ) {
+ (V1.IsSame(V3) || V1.IsSame(V4)) ) {
// closed old edge; use the split for the test
itE.Next();
if (!itE.More()) break;
Standard_Real f1,l1, f2,l2;
Handle(Geom2d_Curve) PC1 = BRep_Tool::CurveOnSurface( split, F ,f1,l1);
if (!PC1.IsNull()) {
- Handle(Geom2d_Curve) PC2 = BRep_Tool::CurveOnSurface(NewE, F ,f2,l2);
- gp_Pnt2d P = PC2->Value( 0.5*(f2+l2) );
- Geom2dAPI_ProjectPointOnCurve proj (P, PC1, f1, l1);
- if (proj.NbPoints() &&
- proj.LowerDistance() <= Precision::Confusion())
- return Standard_True;
+ Handle(Geom2d_Curve) PC2 = BRep_Tool::CurveOnSurface(NewE, F ,f2,l2);
+ gp_Pnt2d P = PC2->Value( 0.5*(f2+l2) );
+ Geom2dAPI_ProjectPointOnCurve proj (P, PC1, f1, l1);
+ if (proj.NbPoints() &&
+ proj.LowerDistance() <= Precision::Confusion())
+ return Standard_True;
}
else {
Handle(Geom_Curve) C1 = BRep_Tool::Curve( split ,f1,l1);
- Handle(Geom_Curve) C2 = BRep_Tool::Curve( NewE ,f2,l2);
- gp_Pnt P = C2->Value( 0.5*(f2+l2) );
- GeomAPI_ProjectPointOnCurve proj (P, C1, f1, l1);
- if (proj.NbPoints() &&
- proj.LowerDistance() <= Precision::Confusion())
- return Standard_True;
+ Handle(Geom_Curve) C2 = BRep_Tool::Curve( NewE ,f2,l2);
+ gp_Pnt P = C2->Value( 0.5*(f2+l2) );
+ GeomAPI_ProjectPointOnCurve proj (P, C1, f1, l1);
+ if (proj.NbPoints() &&
+ proj.LowerDistance() <= Precision::Confusion())
+ return Standard_True;
}
}
else {
//purpose :
//=======================================================================
static Standard_Real FindDelta(TopTools_ListOfShape& LE,
- const TopoDS_Face& F)
+ const TopoDS_Face& F)
{
Standard_Real dist, f, l;
Standard_Real d = Precision::Infinite();
//function : SelectEdge
//purpose : Find the edge <NE> connected <CE> by the vertex <CV> in the list <LE>.
// <NE> Is erased of the list. If <CE> is too in the list <LE>
-// with the same orientation, it's erased of the list
+// with the same orientation, it's erased of the list
//=======================================================================
static Standard_Boolean SelectEdge(const TopoDS_Face& F,
- const TopoDS_Edge& CE,
- const TopoDS_Vertex& CV,
- TopoDS_Edge& NE,
- TopTools_ListOfShape& LE)
+ const TopoDS_Edge& CE,
+ const TopoDS_Vertex& CV,
+ TopoDS_Edge& NE,
+ TopTools_ListOfShape& LE)
{
TopTools_ListIteratorOfListOfShape itl;
NE.Nullify();
TopoDS_Face FForward = F;
Handle(Geom2d_Curve) Cc, C;
FForward.Orientation(TopAbs_FORWARD);
-
+
Cc = BRep_Tool::CurveOnSurface(CE,FForward,cf,cl);
Standard_Real dist,distmin = 100*BRep_Tool::Tolerance(CV);
Standard_Real uc,u;
for ( itl.Initialize(LE); itl.More(); itl.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(itl.Value());
if (!E.IsSame(CE)) {
- C = BRep_Tool::CurveOnSurface(E,FForward,f,l);
- if (E.Orientation () == TopAbs_FORWARD) u = f;
- else u = l;
- P2 = C->Value(u);
- dist = PV.Distance(P2);
- if (dist <= distmin){
- distmin = dist;
- }
-
+ C = BRep_Tool::CurveOnSurface(E,FForward,f,l);
+ if (E.Orientation () == TopAbs_FORWARD) u = f;
+ else u = l;
+ P2 = C->Value(u);
+ dist = PV.Distance(P2);
+ if (dist <= distmin){
+ distmin = dist;
+ }
+
}
}
Standard_Real anglemax = - PI;
- TopoDS_Edge SelectedEdge;
+ TopoDS_Edge SelectedEdge;
for ( itl.Initialize(LE); itl.More(); itl.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(itl.Value());
if (!E.IsSame(CE)) {
- C = BRep_Tool::CurveOnSurface(E,FForward,f,l);
- if (E.Orientation () == TopAbs_FORWARD) u = f;
- else u = l;
- P2 = C->Value(u);
- dist = PV.Distance(P2);
- if (dist <= distmin + (1./3)*delta){
- gp_Pnt2d PC, P;
- gp_Vec2d CTg1, CTg2, Tg1, Tg2;
- Cc->D2(uc, PC, CTg1, CTg2);
- C->D2(u, P, Tg1, Tg2);
-
- Standard_Real angle;
-
- if (CE.Orientation () == TopAbs_REVERSED && E.Orientation () == TopAbs_FORWARD) {
- angle = CTg1.Angle(Tg1.Reversed());
- }
- else if (CE.Orientation () == TopAbs_FORWARD && E.Orientation () == TopAbs_REVERSED) {
- angle = (CTg1.Reversed()).Angle(Tg1);
- }
- else if (CE.Orientation () == TopAbs_REVERSED && E.Orientation () == TopAbs_REVERSED) {
- angle = CTg1.Angle(Tg1);
- }
- else if (CE.Orientation () == TopAbs_FORWARD && E.Orientation () == TopAbs_FORWARD) {
- angle = (CTg1.Reversed()).Angle(Tg1.Reversed());
- }
- if (angle >= anglemax) {
- anglemax = angle ;
- SelectedEdge = E;
- }
- }
+ C = BRep_Tool::CurveOnSurface(E,FForward,f,l);
+ if (E.Orientation () == TopAbs_FORWARD) u = f;
+ else u = l;
+ P2 = C->Value(u);
+ dist = PV.Distance(P2);
+ if (dist <= distmin + (1./3)*delta){
+ gp_Pnt2d PC, P;
+ gp_Vec2d CTg1, CTg2, Tg1, Tg2;
+ Cc->D2(uc, PC, CTg1, CTg2);
+ C->D2(u, P, Tg1, Tg2);
+
+ Standard_Real angle;
+
+ if (CE.Orientation () == TopAbs_REVERSED && E.Orientation () == TopAbs_FORWARD) {
+ angle = CTg1.Angle(Tg1.Reversed());
+ }
+ else if (CE.Orientation () == TopAbs_FORWARD && E.Orientation () == TopAbs_REVERSED) {
+ angle = (CTg1.Reversed()).Angle(Tg1);
+ }
+ else if (CE.Orientation () == TopAbs_REVERSED && E.Orientation () == TopAbs_REVERSED) {
+ angle = CTg1.Angle(Tg1);
+ }
+ else if (CE.Orientation () == TopAbs_FORWARD && E.Orientation () == TopAbs_FORWARD) {
+ angle = (CTg1.Reversed()).Angle(Tg1.Reversed());
+ }
+ if (angle >= anglemax) {
+ anglemax = angle ;
+ SelectedEdge = E;
+ }
+ }
}
}
for ( itl.Initialize(LE); itl.More(); itl.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(itl.Value());
if (E.IsEqual(SelectedEdge)) {
- NE = TopoDS::Edge(E);
- LE.Remove(itl);
- break;
+ NE = TopoDS::Edge(E);
+ LE.Remove(itl);
+ break;
}
- }
+ }
}
else if (LE.Extent() == 1) {
NE = TopoDS::Edge(LE.First());
//purpose :
//=======================================================================
static Standard_Boolean SamePnt2d(TopoDS_Vertex V,
- TopoDS_Edge& E1,
- TopoDS_Edge& E2,
- TopoDS_Face& F)
+ TopoDS_Edge& E1,
+ TopoDS_Edge& E2,
+ TopoDS_Face& F)
{
Standard_Real f1,f2,l1,l2;
gp_Pnt2d P1,P2;
//purpose :
//=======================================================================
static void PurgeNewEdges(TopTools_ListOfShape& ConstEdges,
- const TopTools_MapOfOrientedShape& UsedEdges)
+ const TopTools_MapOfOrientedShape& UsedEdges)
{
TopTools_ListIteratorOfListOfShape it(ConstEdges);
while ( it.More()) {
//purpose :
//=======================================================================
static void StoreInMVE (const TopoDS_Face& F,
- TopoDS_Edge& E,
- TopTools_DataMapOfShapeListOfShape& MVE )
+ TopoDS_Edge& E,
+ TopTools_DataMapOfShapeListOfShape& MVE )
{
TopoDS_Vertex V1, V2;
MVE.Bind(V1,Empty);
}
MVE(V1).Append(E);
-
+
if (!MVE.IsBound(V2)) {
MVE.Bind(V2,Empty);
}
if (!MVE.IsBound(CV)) continue;
for ( itl.Initialize(MVE(CV)); itl.More(); itl.Next()) {
if (itl.Value().IsEqual(CE)) {
- MVE(CV).Remove(itl);
- break;
+ MVE(CV).Remove(itl);
+ break;
}
}
//--------------
// stop test
- //--------------
+ //--------------
if (!MVE.IsBound(CV) || MVE(CV).IsEmpty() || CV.IsSame(VF) ) {
- if (CV.IsSame(VF)) {
- if (MVE(CV).Extent() == 1 ) MVE.UnBind(CV);
- else {
- for ( itl.Initialize(MVE(CV)); itl.More(); itl.Next()) {
- if (itl.Value().IsEqual(CE)) {
- MVE(CV).Remove(itl);
- break;
- }
- }
- }
- }
- End=Standard_True;
+ if (CV.IsSame(VF)) {
+ if (MVE(CV).Extent() == 1 ) MVE.UnBind(CV);
+ else {
+ for ( itl.Initialize(MVE(CV)); itl.More(); itl.Next()) {
+ if (itl.Value().IsEqual(CE)) {
+ MVE(CV).Remove(itl);
+ break;
+ }
+ }
+ }
+ }
+ End=Standard_True;
}
//--------------
// select edge
//--------------
else {
- Standard_Boolean find = SelectEdge(myFace,CE,CV,NE,MVE(CV));
- if (find) {
- CE=NE;
- if (MVE(CV).IsEmpty()) MVE.UnBind(CV);
- if (CE.IsNull() ) {
- MESSAGE ( " CE is NULL !!! " )
- End=Standard_True;
- }
- }
- else {
- MESSAGE ( " edge doesn't exist " )
- End=Standard_True;
- }
+ Standard_Boolean find = SelectEdge(myFace,CE,CV,NE,MVE(CV));
+ if (find) {
+ CE=NE;
+ if (MVE(CV).IsEmpty()) MVE.UnBind(CV);
+ if (CE.IsNull() ) {
+ MESSAGE ( " CE is NULL !!! " )
+ End=Standard_True;
+ }
+ }
+ else {
+ MESSAGE ( " edge doesn't exist " )
+ End=Standard_True;
+ }
}
}
else{
MESSAGE ( "wire not closed" )
}
- myNewWires.Append (NW);
+ myNewWires.Append (NW);
}
PurgeNewEdges(myConstEdges,UsedEdges);
if (FR.IsDone()) {
for (; FR.More(); FR.Next()) {
- myNewFaces.Append(FR.Current().Oriented(OriF));
+ myNewFaces.Append(FR.Current().Oriented(OriF));
}
}
}
{
const TopoDS_Shape& FF = itF.Value();
if (AvoidFacesMap.Contains( FF ) ||
- ! AddedFacesMap.Add( FF ) )
+ ! AddedFacesMap.Add( FF ) )
continue;
// make a new shell
for (; EdgeExp.More(); EdgeExp.Next())
{
const TopoDS_Edge& E = TopoDS::Edge( EdgeExp.Current());
- if (! CheckedEdgesMap.Add( E ))
- continue;
+ if (! CheckedEdgesMap.Add( E ))
+ continue;
- // candidate faces list
+ // candidate faces list
const TopTools_ListOfShape& FL = myEFMap.ChangeFromKey(E);
if (FL.IsEmpty())
continue;
- // select one of neighbors
+ // select one of neighbors
TopoDS_Face SelF;
if (FL.Extent() == 2) {
if (! F.IsSame( FL.First() ))
}
else {
// check if a face already added to Shell shares E
- TopTools_ListIteratorOfListOfShape it (FL);
+ TopTools_ListIteratorOfListOfShape it (FL);
Standard_Boolean found = Standard_False;
for (; !found && it.More(); it.Next())
if (F != it.Value())
}
}
if (!SelF.IsNull() &&
- AddedFacesMap.Add( SelF ) &&
- !AvoidFacesMap.Contains( SelF ))
+ AddedFacesMap.Add( SelF ) &&
+ !AvoidFacesMap.Contains( SelF ))
Builder.Add( Shell, SelF);
} // loop on edges of F
//=======================================================================
gp_Vec Partition_Loop3d::Normal(const TopoDS_Edge& E,
- const TopoDS_Face& F)
+ const TopoDS_Face& F)
{
gp_Vec Norm, V1, V2;
Standard_Real First, Last;
//=======================================================================
static gp_Vec NextNormal(const TopoDS_Edge& E,
- const TopoDS_Face& F)
+ const TopoDS_Face& F)
{
Standard_Real First, Last;
//=======================================================================
static TopoDS_Edge FindEinF(const TopoDS_Edge& E,
- const TopoDS_Face& F)
+ const TopoDS_Face& F)
{
TopExp_Explorer expl (F, TopAbs_EDGE);
for (; expl.More(); expl.Next())
//=======================================================================
Standard_Boolean Partition_Loop3d::IsInside(const TopoDS_Edge& E,
- const TopoDS_Face& F1,
- const TopoDS_Face& F2,
- const Standard_Boolean CountDot,
- Standard_Real& Dot,
- Standard_Boolean& GoodOri)
+ const TopoDS_Face& F1,
+ const TopoDS_Face& F2,
+ const Standard_Boolean CountDot,
+ Standard_Real& Dot,
+ Standard_Boolean& GoodOri)
{
Standard_Real f, l;
gp_Pnt P;
if (isTool1 || isTool2)
{
TopExp::Vertices(EE,V1,V2);
- Standard_Real Tol = Max (BRep_Tool::Tolerance( V1 ),
- BRep_Tool::Tolerance( V2 ));
+ Standard_Real Tol = Max (BRep_Tool::Tolerance( V1 ),
+ BRep_Tool::Tolerance( V2 ));
gp_Pnt P1 = BRep_Tool::Pnt(V1);
gp_Pnt P2 = BRep_Tool::Pnt(V2);
TopTools_ListOfShape LNE;
MakeEdges (EE,aListV, LNE);
myImagesEdges.Bind(EE,LNE);
- LSE.Append( LNE );
+ LSE.Append( LNE );
}
}
const TopTools_ListOfShape& aListVV = myAsDes->Descendant(EE);
MakeEdges (EE, aListVV, LNE);
myImagesEdges.Bind(EE,LNE);
- LSE.Append( LNE );
+ LSE.Append( LNE );
}
}
#ifdef PART_PERF
if (myMapTools.Contains( itl.Value() ))
continue; // skip tool faces
for ( exp.Init( itl.Value(), TopAbs_EDGE ); exp.More(); exp.Next()) {
- itNE.Initialize( myImagesEdges.Image( exp.Current() ));
- for ( ; itNE.More(); itNE.Next())
- myBuilder.Add ( myShape, itNE.Value() );
+ itNE.Initialize( myImagesEdges.Image( exp.Current() ));
+ for ( ; itNE.More(); itNE.Next())
+ myBuilder.Add ( myShape, itNE.Value() );
}
}
// add splits of new edges
Limit == TopAbs_FACE) {
for (itl.Initialize(myListShapes);itl.More();itl.Next()) {
if ( myMapTools.Contains( itl.Value() ))
- continue; // no result needed for a tool face
+ continue; // no result needed for a tool face
const TopoDS_Shape& FacesComp = myImageShape.Image( itl.Value() ).First();
for ( exp.Init( FacesComp, Limit); exp.More(); exp.Next())
- myBuilder.Add ( myShape, exp.Current());
+ myBuilder.Add ( myShape, exp.Current());
}
return;
}
//-----------------------------------------------
Standard_Boolean makeSolids = (Limit == TopAbs_SHAPE ||
- Limit < TopAbs_SHELL);
+ Limit < TopAbs_SHELL);
for (itl.Initialize(myListShapes);itl.More();itl.Next())
{
const TopoDS_Shape & S = itl.Value();
//=======================================================================
TopoDS_Shape Partition_Spliter::FindFacesInside(const TopoDS_Shape& theShape,
- const Standard_Boolean CheckClosed,
- const Standard_Boolean All)
+ const Standard_Boolean CheckClosed,
+ const Standard_Boolean All)
{
// ================================================
// check if internal faces have been already found
// iterate on edges of split faces of aShape,
// add to DMSEFP edges that are new
for (expl.Init( sf, TopAbs_EDGE ); expl.More(); expl.Next()) {
- TopoDS_Shape se = expl.Current();
- if ( MSE.Contains(se)) {// section edge
- if (!DMSEFP.IsBound(se))
- DMSEFP.Bind(se,EmptyL);
- DMSEFP(se).Append(sf);
- }
+ TopoDS_Shape se = expl.Current();
+ if ( MSE.Contains(se)) {// section edge
+ if (!DMSEFP.IsBound(se))
+ DMSEFP.Bind(se,EmptyL);
+ DMSEFP(se).Append(sf);
+ }
}
}
}
// remove aFace1 form DMSEFP and MFP
LSF.Remove( itl ); // == itl.Next();
if (!MFP.Remove( aFace1 ))
- continue; // was not is MFP ( i.e already checked)
+ continue; // was not is MFP ( i.e already checked)
// check if aFace1 was already added to 2 shells
if (!All &&
- myAddedFacesMap.Contains( aFace1 ) &&
- myAddedFacesMap.Contains( aFace1.Reversed() )) {
- skipAlreadyAdded = Standard_True;
- continue;
+ myAddedFacesMap.Contains( aFace1 ) &&
+ myAddedFacesMap.Contains( aFace1.Reversed() )) {
+ skipAlreadyAdded = Standard_True;
+ continue;
}
// find another face which originates from the same face as aFace1:
Standard_Boolean sameDom1 = anOrigFace.IsSame( origF1 );
Standard_Boolean sameDom2 = anOrigFace.IsSame( origF2 );
if (!(sameDom1 || sameDom2) && myInter3d.HasSameDomainF( anOrigFace )) {
- sameDom1 = myInter3d.IsSameDomainF( anOrigFace, origF1);
+ sameDom1 = myInter3d.IsSameDomainF( anOrigFace, origF1);
if (origF1 == origF2)
sameDom2 = sameDom1;
else
myInter3d.IsSameDomainF( anOrigFace, origF2);
}
if (sameDom1 && sameDom2)
- continue;
+ continue;
if ((sameDom1 || sameDom2)) {
- inside = Partition_Loop3d::IsInside (E,
- TopoDS::Face(FL.First()),
- TopoDS::Face(FL.Last()),
- 1, dot, GoodOri);
- if (inside || (dot + Precision::Angular() >= 1.0))
- continue; // E is convex between origF1 and origF2 or they are tangent
+ inside = Partition_Loop3d::IsInside (E,
+ TopoDS::Face(FL.First()),
+ TopoDS::Face(FL.Last()),
+ 1, dot, GoodOri);
+ if (inside || (dot + Precision::Angular() >= 1.0))
+ continue; // E is convex between origF1 and origF2 or they are tangent
}
const TopoDS_Shape& aShapeFace = sameDom1 ? FL.Last() : FL.First();
// analyse aFace1 state
inside = Partition_Loop3d::IsInside (E, TopoDS::Face(aShapeFace), aFace1,
- 1, dot, GoodOri);
+ 1, dot, GoodOri);
if (inside && isSectionE)
{
// aFace1 must be tested with both adjacent faces of CSF
MFP.Add( F );
// remove bad face from DMEF
for (expl.Init( F, TopAbs_EDGE); expl.More(); expl.Next()) {
- const TopoDS_Shape& E = expl.Current();
+ const TopoDS_Shape& E = expl.Current();
TopTools_ListOfShape& FL = DMEF.ChangeFromKey( E );
for (itl.Initialize( FL ); itl.More(); itl.Next() ) {
if ( F.IsSame( itl.Value() )) {
//=======================================================================
static void findEqual (const TopTools_ListOfShape& EL1,
- const TopTools_ListOfShape& EL2,
- const Standard_Boolean addSame,
- TopTools_DataMapOfShapeListOfShape& EEM,
- TopTools_MapOfShape& AllEqMap)
+ const TopTools_ListOfShape& EL2,
+ const Standard_Boolean addSame,
+ TopTools_DataMapOfShapeListOfShape& EEM,
+ TopTools_MapOfShape& AllEqMap)
{
// map vertices to edges for EL2
TopTools_DataMapOfShapeListOfShape VEM;
for (itV.Initialize( itE2.Value() ); itV.More(); itV.Next()) {
const TopoDS_Shape& V = itV.Value();
if (! VEM.IsBound( V ) )
- VEM.Bind( V, emptyL);
+ VEM.Bind( V, emptyL);
VEM( V ).Append( itE2.Value());
}
}
continue;
if (E1.IsSame(E2)) {
- if (!addSame)
- continue;
+ if (!addSame)
+ continue;
}
else {
- TopExp::Vertices( E2, V3, V4);
- if (!V2.IsSame(V4) && !V2.IsSame(V3))
- continue;
- // E1 and E2 have same vertices
- // check D1 at end points.
+ TopExp::Vertices( E2, V3, V4);
+ if (!V2.IsSame(V4) && !V2.IsSame(V3))
+ continue;
+ // E1 and E2 have same vertices
+ // check D1 at end points.
C2 = BRep_Tool::Curve( E2, f,l);
C1 = BRep_Tool::Curve( E1, f,l);
- u = BRep_Tool::Parameter(V1,E1);
+ u = BRep_Tool::Parameter(V1,E1);
C1->D1(u, P, D1);
- u = BRep_Tool::Parameter(V1.IsSame(V3) ? V3 : V4, E2);
- C2->D1(u, P, D2);
+ u = BRep_Tool::Parameter(V1.IsSame(V3) ? V3 : V4, E2);
+ C2->D1(u, P, D2);
D1.Normalize(); D2.Normalize();
if (Abs(D1*D2) + Precision::Angular() < 1.0)
continue;
- if (! V1.IsSame(V2)) {
- u = BRep_Tool::Parameter(V2,E1);
- C1->D1(u, P, D1);
- u = BRep_Tool::Parameter(V2.IsSame(V3) ? V3 : V4, E2);
- C2->D1(u, P, D2);
- D1.Normalize(); D2.Normalize();
- if (Abs(D1*D2) + Precision::Angular() < 1.0)
- continue;
- }
+ if (! V1.IsSame(V2)) {
+ u = BRep_Tool::Parameter(V2,E1);
+ C1->D1(u, P, D1);
+ u = BRep_Tool::Parameter(V2.IsSame(V3) ? V3 : V4, E2);
+ C2->D1(u, P, D2);
+ D1.Normalize(); D2.Normalize();
+ if (Abs(D1*D2) + Precision::Angular() < 1.0)
+ continue;
+ }
// check distance at a couple of internal points
tol = Max(BRep_Tool::Tolerance(E1),
BRep_Tool::Tolerance(E2));
GeomAdaptor_Curve AC1(C1);
Extrema.Initialize(AC1,f,l);
- Standard_Boolean ok = Standard_True, hasMin = Standard_False;
- BRep_Tool::Range( E2, f, l);
+ Standard_Boolean ok = Standard_True, hasMin = Standard_False;
+ BRep_Tool::Range( E2, f, l);
Standard_Integer i=1, nbi=3;
for (; i<nbi && ok; ++i) {
Extrema.Perform( C2->Value( f+(l-f)*i/nbi ));
Standard_Integer j=1, nbj=Extrema.NbExt();
for (; j<=nbj && ok; ++j) {
if (Extrema.IsMin(j)) {
- hasMin = Standard_True;
+ hasMin = Standard_True;
ok = Extrema.Value(j) <= tol;
- }
+ }
}
}
if ( !hasMin || !ok)
// bind E2 to E1 in EEM
if (!EEM.IsBound(E1)) {
EEM.Bind (E1, emptyL);
- AllEqMap.Add (E1);
+ AllEqMap.Add (E1);
}
EEM(E1).Append(E2);
AllEqMap.Add (E2);
myImagesFaces.LastImage( F, LNF );
TopAbs_Orientation oriF = F.Orientation();
for ( itl.Initialize( LNF ); itl.More(); itl.Next())
- itl.Value().Orientation( oriF );
+ itl.Value().Orientation( oriF );
}
else {
// LE: old edges + new not splitted edges
const TopTools_ListOfShape& LE = myAsDes->Descendant(F);
for (itl.Initialize(LE); itl.More(); itl.Next()) {
- const TopoDS_Edge& E = TopoDS::Edge( itl.Value() );
+ const TopoDS_Edge& E = TopoDS::Edge( itl.Value() );
- Standard_Boolean isSectionE = myInter3d.IsSectionEdge(E);
- Standard_Boolean isNewE = !EM.Contains( E );
+ Standard_Boolean isSectionE = myInter3d.IsSectionEdge(E);
+ Standard_Boolean isNewE = !EM.Contains( E );
- // LSE: list of split edges
- TopTools_ListOfShape LSE;
- myImagesEdges.LastImage(E,LSE); // splits of E or E itself
+ // LSE: list of split edges
+ TopTools_ListOfShape LSE;
+ myImagesEdges.LastImage(E,LSE); // splits of E or E itself
- for (itNE.Initialize(LSE); itNE.More(); itNE.Next()) {
+ for (itNE.Initialize(LSE); itNE.More(); itNE.Next()) {
- TopoDS_Edge NE = TopoDS::Edge( itNE.Value() );
- Standard_Boolean isSameE = NE.IsSame ( E );
-
- if ( isNewE || isSectionE || !isSameE) {
- if (AddedEqualM.Contains( NE )) {
+ TopoDS_Edge NE = TopoDS::Edge( itNE.Value() );
+ Standard_Boolean isSameE = NE.IsSame ( E );
+
+ if ( isNewE || isSectionE || !isSameE) {
+ if (AddedEqualM.Contains( NE )) {
// a seam must be twice in a loop
if (!BRep_Tool::IsClosed( E, F ) || !EqualSeamM.Add( NE ))
continue;
}
- if (isNewE) {
- if (isSectionE) {
- if ( ! myInter3d.IsSplitOn( NE, E, F) )
- continue;
- }
- else {
- TopoDS_Vertex V1,V2;
- TopExp::Vertices(NE,V1,V2);
- const TopTools_ListOfShape& EL1 = myAsDes->Ascendant(V1);
- const TopTools_ListOfShape& EL2 = myAsDes->Ascendant(V2);
- if ( EL1.Extent() < 2 && EL2.Extent() < 2 )
- continue;
- }
- }
- else {
- NE.Orientation( E.Orientation());
- if (!isSameE) {
- // orient NE because it may be a split of other edge
- Standard_Real f,l,u;
- Handle(Geom_Curve) C3d = BRep_Tool::Curve( E,f,l );
- Handle(Geom_Curve) NC3d = BRep_Tool::Curve( NE,f,l);
- if ( C3d != NC3d) {
- gp_Vec D1, ND1; gp_Pnt P;
- TopoDS_Vertex V = TopExp::FirstVertex(NE);
- u = BRep_Tool::Parameter(V,NE);
- NC3d->D1 (u, P, ND1);
- u = BRep_Tool::Parameter(V,E);
- C3d ->D1 (u, P, D1);
- if (ND1.Dot(D1) < 0)
- NE.Reverse();
- }
- }
- }
- if (myEqualEdges.Contains( NE ))
+ if (isNewE) {
+ if (isSectionE) {
+ if ( ! myInter3d.IsSplitOn( NE, E, F) )
+ continue;
+ }
+ else {
+ TopoDS_Vertex V1,V2;
+ TopExp::Vertices(NE,V1,V2);
+ const TopTools_ListOfShape& EL1 = myAsDes->Ascendant(V1);
+ const TopTools_ListOfShape& EL2 = myAsDes->Ascendant(V2);
+ if ( EL1.Extent() < 2 && EL2.Extent() < 2 )
+ continue;
+ }
+ }
+ else {
+ NE.Orientation( E.Orientation());
+ if (!isSameE) {
+ // orient NE because it may be a split of other edge
+ Standard_Real f,l,u;
+ Handle(Geom_Curve) C3d = BRep_Tool::Curve( E,f,l );
+ Handle(Geom_Curve) NC3d = BRep_Tool::Curve( NE,f,l);
+ if ( C3d != NC3d) {
+ gp_Vec D1, ND1; gp_Pnt P;
+ TopoDS_Vertex V = TopExp::FirstVertex(NE);
+ u = BRep_Tool::Parameter(V,NE);
+ NC3d->D1 (u, P, ND1);
+ u = BRep_Tool::Parameter(V,E);
+ C3d ->D1 (u, P, D1);
+ if (ND1.Dot(D1) < 0)
+ NE.Reverse();
+ }
+ }
+ }
+ if (myEqualEdges.Contains( NE ))
AddedEqualM.Add( NE );
- needRebuild = Standard_True;
- }
+ needRebuild = Standard_True;
+ }
- if (isNewE || isSectionE)
- myNewSection.Add( NE );
+ if (isNewE || isSectionE)
+ myNewSection.Add( NE );
- if (isNewE)
- loops.AddSectionEdge(NE);
- else
- loops.AddConstEdge(NE);
- }
+ if (isNewE)
+ loops.AddSectionEdge(NE);
+ else
+ loops.AddConstEdge(NE);
+ }
}
//-------------------
//-------------------
if (needRebuild) {
-
+
loops.Perform();
loops.WiresToFaces(myImagesEdges);
} // if (needRebuild)
else {
- LNF.Append( F );
- myImagesFaces.Bind(F,LNF);
+ LNF.Append( F );
+ myImagesFaces.Bind(F,LNF);
}
} // if (myImagesFaces.HasImage( F ))
//=======================================================================
static void Tri(const TopoDS_Edge& E,
- TopTools_SequenceOfShape& Seq,
+ TopTools_SequenceOfShape& Seq,
const Partition_Inter3d & theInter3d)
{
Standard_Boolean Invert = Standard_True;
Seq.Remove(i+1); // remove V2
else
Seq.Remove(i);
- i--;
- continue;
+ i--;
+ continue;
}
if (U2 < U1) {
- Seq.Exchange(i,i+1);
- Invert = Standard_True;
+ Seq.Exchange(i,i+1);
+ Invert = Standard_True;
}
}
}
if (VOnE.Extent() < 3) { // do not rebuild not cut edge
if (( VF.IsSame( VOnE.First() ) && VL.IsSame( VOnE.Last() )) ||
- VL.IsSame( VOnE.First() ) && VF.IsSame( VOnE.Last() ) ) {
+ VL.IsSame( VOnE.First() ) && VF.IsSame( VOnE.Last() ) ) {
NE.Append( E );
return;
}
if (SV.Length() < 3) { // do not rebuild not cut edge
if (( VF.IsSame( SV.First() ) && VL.IsSame( SV.Last() )) ||
- VL.IsSame( SV.First() ) && VF.IsSame( SV.Last() ) ) {
+ VL.IsSame( SV.First() ) && VF.IsSame( SV.Last() ) ) {
NE.Append( E );
return;
}
Standard_Real minDU = 1.e10;
TopoDS_Vertex endV = Partition_Inter2d::FindEndVertex(VOnE, f,l, E, isFirst,minDU);
if (endV.IsSame(SV.First()))
- SV.Append(endV);
+ SV.Append(endV);
else if (endV.IsSame(SV.Last()))
- SV.Prepend(endV);
+ SV.Prepend(endV);
else
- MESSAGE ("END VERTEX IS IN SEQUNCE MIDDLE");
+ MESSAGE ("END VERTEX IS IN SEQUNCE MIDDLE");
}
NbVer = SV.Length();
}
if (iVer==1)
U1 = f;
- else {
+ else {
V1.Orientation(TopAbs_INTERNAL);
U1=BRep_Tool::Parameter(V1,WE);
}
if (iVer+1 == NbVer)
U2 = l;
- else {
+ else {
V2.Orientation(TopAbs_INTERNAL);
U2=BRep_Tool::Parameter(V2,WE);
}
TopExp_Explorer expResF( it.Value(), TopAbs_FACE );
for (; expResF.More(); expResF.Next())
if (!MIF.Contains( expResF.Current()))
- break;
+ break;
if (expResF.More())
// add shape to result
else
// add faces of a removed shape to RFM
for (expResF.ReInit(); expResF.More(); expResF.Next()) {
- const TopoDS_Shape& F = expResF.Current();
- if ( ! RFM.Remove ( F ))
- RFM.Add( F );
+ const TopoDS_Shape& F = expResF.Current();
+ if ( ! RFM.Remove ( F ))
+ RFM.Add( F );
}
}
myImagesFaces.LastImage( F, LNF);
TopTools_ListIteratorOfListOfShape itF (LNF);
for ( ; itF.More(); itF.Next())
- myBuilder.Add( C, itF.Value().Oriented(Fori) );
+ myBuilder.Add( C, itF.Value().Oriented(Fori) );
continue;
}
// add section edges
TopExp_Explorer expE;
for ( ; expE.More(); expE.Next()) {
- if (! myImagesEdges.HasImage( expE.Current() ))
- continue;
- myImagesEdges.LastImage( expE.Current(), NEL );
- for ( itNE.Initialize( NEL ); itNE.More(); itNE.Next())
- myBuilder.Add ( NW, itNE.Value());
+ if (! myImagesEdges.HasImage( expE.Current() ))
+ continue;
+ myImagesEdges.LastImage( expE.Current(), NEL );
+ for ( itNE.Initialize( NEL ); itNE.More(); itNE.Next())
+ myBuilder.Add ( NW, itNE.Value());
}
}
if (hasNewE) {
// add new adges
NEL = myAsDes->Descendant( F );
for ( itNE.Initialize( NEL ); itNE.More(); itNE.Next()) {
- TopTools_ListOfShape SEL; // splits
- myImagesEdges.LastImage( itNE.Value(), SEL );
- TopTools_ListIteratorOfListOfShape itSE (SEL);
- for ( ; itSE.More(); itSE.Next())
- myBuilder.Add ( NW, itSE.Value());
+ TopTools_ListOfShape SEL; // splits
+ myImagesEdges.LastImage( itNE.Value(), SEL );
+ TopTools_ListIteratorOfListOfShape itSE (SEL);
+ for ( ; itSE.More(); itSE.Next())
+ myBuilder.Add ( NW, itSE.Value());
}
}
myBuilder.Add( NF, NW );
anObj = anOper->MakeBoxDXDYDZ(x, y, z);
if (!anObj->_is_nil() && !IsPreview())
{
- QStringList aParameters;
- aParameters << GroupDimensions->SpinBox_DX->text();
- aParameters << GroupDimensions->SpinBox_DY->text();
- aParameters << GroupDimensions->SpinBox_DZ->text();
+ QStringList aParameters;
+ aParameters << GroupDimensions->SpinBox_DX->text();
+ aParameters << GroupDimensions->SpinBox_DY->text();
+ aParameters << GroupDimensions->SpinBox_DZ->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
res = true;
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
anObj = anOper->MakeConePntVecR1R2H(myPoint, myDir, getRadius1(), getRadius2(), getHeight());
if (!anObj->_is_nil() && !IsPreview())
{
- QStringList aParameters;
- aParameters << GroupPoints->SpinBox_DX->text();
- aParameters << GroupPoints->SpinBox_DY->text();
- aParameters << GroupPoints->SpinBox_DZ->text();
+ QStringList aParameters;
+ aParameters << GroupPoints->SpinBox_DX->text();
+ aParameters << GroupPoints->SpinBox_DY->text();
+ aParameters << GroupPoints->SpinBox_DZ->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
res = true;
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
anObj = anOper->MakeCylinderPntVecRH(myPoint, myDir, getRadius(), getHeight());
if (!anObj->_is_nil() && !IsPreview())
{
- QStringList aParameters;
- aParameters << GroupPoints->SpinBox_DX->text();
- aParameters << GroupPoints->SpinBox_DY->text();
+ QStringList aParameters;
+ aParameters << GroupPoints->SpinBox_DX->text();
+ aParameters << GroupPoints->SpinBox_DY->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
res = true;
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
// TRUE to construct a modal dialog.
//=================================================================================
PrimitiveGUI_FaceDlg::PrimitiveGUI_FaceDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_FACE_OBJ_HW")));
initSpinBox( GroupDimensions->SpinBox_DY, 0.00001, COORD_MAX, aStep, 5 ); // VSR: TODO: DBL_DIGITS_DISPLAY
GroupDimensions->SpinBox_DY->setValue( aDefaultSize );
-
+
/* signals and slots connections */
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect( GroupType->RadioButton2, SIGNAL( clicked() ), this, SLOT( TypeButtonClicked() ) );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_FACE" ) );
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
if (GroupType->RadioButton2->isChecked())
- aNeedType = TopAbs_FACE;
+ aNeedType = TopAbs_FACE;
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes( aSelList.First(), aMap );
if ( aMap.Extent() == 1 ) { // Local Selection
- int anIndex = aMap( 1 );
- if ( aNeedType == TopAbs_EDGE )
+ int anIndex = aMap( 1 );
+ if ( aNeedType == TopAbs_EDGE )
aName += QString( ":edge_%1" ).arg( anIndex );
else
- aName += QString( ":face_%1" ).arg( anIndex );
+ aName += QString( ":face_%1" ).arg( anIndex );
- //Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
- if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
- aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
- }
- else
- aSelectedObject = aFindedObject; // get Object from study
+ if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ }
+ else
+ aSelectedObject = aFindedObject; // get Object from study
}
else { // Global Selection
if ( aShape.ShapeType() != aNeedType ) {
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
switch (getConstructorId()) {
case 0:
anObj = anOper->MakeFaceHW(GroupDimensions->SpinBox_DX->value(),
- GroupDimensions->SpinBox_DY->value(), myOrientationType);
+ GroupDimensions->SpinBox_DY->value(), myOrientationType);
if (!anObj->_is_nil() && !IsPreview())
{
aParameters << GroupDimensions->SpinBox_DX->text();
// TRUE to construct a modal dialog.
//=================================================================================
PrimitiveGUI_SphereDlg::PrimitiveGUI_SphereDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
:GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SPHERE_P" ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_SPHERE" ) );
myPoint = GEOM::GEOM_Object::_nil();
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
break;
}
case 1:
GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName );
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations( getStudyId() );
- aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ GEOM::GEOM_IShapesOperations_var aShapesOp =
+ getGeomEngine()->GetIShapesOperations( getStudyId() );
+ aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
}
else {
- aSelectedObject = aFindedObject; // get Object from study
+ aSelectedObject = aFindedObject; // get Object from study
}
}
else { // Global Selection
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
case 0 :
{
if ( !CORBA::is_nil( myPoint ) ) {
- anObj = anOper->MakeSpherePntR( myPoint, getRadius() );
- if (!anObj->_is_nil() && !IsPreview())
+ anObj = anOper->MakeSpherePntR( myPoint, getRadius() );
+ if (!anObj->_is_nil() && !IsPreview())
{
- QStringList aParameters;
- aParameters << GroupPoints->SpinBox_DX->text();
+ QStringList aParameters;
+ aParameters << GroupPoints->SpinBox_DX->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
- }
- res = true;
+ }
+ res = true;
}
break;
}
anObj = anOper->MakeSphereR( getRadius() );
if (!anObj->_is_nil() && !IsPreview())
{
- QStringList aParameters;
- aParameters << GroupDimensions->SpinBox_DX->text();
+ QStringList aParameters;
+ aParameters << GroupDimensions->SpinBox_DX->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
res = true;
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
anObj = anOper->MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
if (!anObj->_is_nil() && !IsPreview())
{
- QStringList aParameters;
- aParameters << GroupPoints->SpinBox_DX->text();
- aParameters << GroupPoints->SpinBox_DY->text();
+ QStringList aParameters;
+ aParameters << GroupPoints->SpinBox_DX->text();
+ aParameters << GroupPoints->SpinBox_DY->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
res = true;
// TRUE to construct a modal dialog.
//=================================================================================
RepairGUI_ChangeOrientationDlg::RepairGUI_ChangeOrientationDlg( GeometryGUI* theGeometryGUI,
- QWidget* parent,
- bool modal )
+ QWidget* parent,
+ bool modal )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal )
{
//QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SUPRESS_FACE")));
connect( GroupPoints->CheckButton1, SIGNAL( toggled( bool ) ), this, SLOT( CreateCopyModeChanged( bool ) ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "CHANGE_ORIENTATION_NEW_OBJ_NAME" ) );
resize(100,100);
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
myEditCurrentArgument = GroupPoints->LineEdit1;
myEditCurrentArgument->setText( "" );
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "DEVIDE_EDGE_NEW_OBJECT_NAME" ) );
resize(100,100);
{
myIndex = aMap( 1 );
myObject = aSelectedObj;
- myEditCurrentArgument->setText( aName += QString( ":edge_%1" ).arg( myIndex ) );
+ myEditCurrentArgument->setText( aName += QString( ":edge_%1" ).arg( myIndex ) );
}
else if ( aType == TopAbs_EDGE ) // single shape selection
{
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
// myObject = GEOM::GEOM_Object::_nil();
myIndex = -1;
platform = "application";
#endif
SUIT_MessageBox::warning( this,
- tr( "WRN_WARNING" ),
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg( app->resourceMgr()->stringValue( "ExternalBrowser",
- platform ) ).arg( myHelpFileName ) );
+ tr( "WRN_WARNING" ),
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ platform ) ).arg( myHelpFileName ) );
}
}
setEnabled( true );
myGeomGUI->SetActiveDialogBox( this );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
+ SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
activateSelection();
onSelectionDone();
}
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT ( onDeactivate() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
+ SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
activateSelection();
onSelectionDone();
// TRUE to construct a modal dialog.
//=================================================================================
RepairGUI_FreeFacesDlg::RepairGUI_FreeFacesDlg( GeometryGUI* GUI, QWidget* parent,
- bool modal )
+ bool modal )
: QDialog( parent, false ),
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
myGeomGUI( GUI ),
platform = "application";
#endif
SUIT_MessageBox::warning( this,
- tr( "WRN_WARNING" ),
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser",
- platform ) ).
- arg( myHelpFileName ) );
+ tr( "WRN_WARNING" ),
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ platform ) ).
+ arg( myHelpFileName ) );
}
}
setEnabled( true );
myGeomGUI->SetActiveDialogBox( this );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
+ SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
activateSelection();
}
/* signals and slots connections */
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT ( onDeactivate() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), SLOT ( onSelectionDone() ) );
+ SIGNAL( currentSelectionChanged() ), SLOT ( onSelectionDone() ) );
activateSelection();
onSelectionDone();
try {
getDisplayer()->SetColor( Quantity_NOC_RED );
getDisplayer()->SetToActivate( false );
- aPrs = !aFace.IsNull() ? getDisplayer()->BuildPrs( aFace ) : 0;
+ aPrs = !aFace.IsNull() ? getDisplayer()->BuildPrs( aFace ) : 0;
if ( aPrs )
- displayPreview( aPrs, true );
+ displayPreview( aPrs, true );
}
catch( const SALOME::SALOME_Exception& e )
{
myTolEdt2->setValue( DEFAULT_TOLERANCE_VALUE );
myDetectBtn = new QPushButton( tr( "GEOM_DETECT" ) + QString( " [%1]" ).arg( tr( "GLUE_FACES" ) ),
- GroupPoints2->Box );
+ GroupPoints2->Box );
mySubShapesChk = new QCheckBox( tr( "SELECT_FACES" ), GroupPoints2->Box );
boxLayout = new QGridLayout( GroupPoints2->Box );
connect( mySubShapesChk, SIGNAL( stateChanged( int ) ), this, SLOT( onSubShapesChk() ) );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
connect( myDetectBtn, SIGNAL( clicked() ), this, SLOT( onDetect() ) );
myEditCurrentArgument->setFocus();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
qApp->processEvents();
updateGeometry();
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
//GroupPoints->LineEdit1->setText("");
//GroupPoints2->LineEdit1->setText("");
aResult = !anObj->_is_nil();
if ( aResult && !IsPreview() )
{
- QStringList aParameters;
- aParameters << myTolEdt->text();
+ QStringList aParameters;
+ aParameters << myTolEdt->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
objects.push_back( anObj._retn() );
if ( aResult )
{
- if ( !IsPreview() )
- {
- QStringList aParameters;
- aParameters << myTolEdt2->text();
+ if ( !IsPreview() )
+ {
+ QStringList aParameters;
+ aParameters << myTolEdt2->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
- }
+ }
objects.push_back( anObj._retn() );
}
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
- aFindMethod, /*theInheritFirstArg=*/true );
+ aFindMethod, /*theInheritFirstArg=*/true );
}
}
addInStudy( *it, aName.toLatin1().data() );
display( *it, false );
}
-
+
if ( nbObjs ) {
commitCommand();
updateObjBrowser();
}
// JFA 28.12.2004 BEGIN // To enable warnings
- GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
+ GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
if ( !CORBA::is_nil(anOper) && !anOper->IsDone() ) {
- wc.suspend();
- QString msgw = QObject::tr( anOper->GetErrorCode() );
- SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ), msgw, tr( "BUT_OK" ) );
+ wc.suspend();
+ QString msgw = QObject::tr( anOper->GetErrorCode() );
+ SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ), msgw, tr( "BUT_OK" ) );
}
// JFA 28.12.2004 END
}
}
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) ) ;
+ this, SLOT( SelectionIntoArgument() ) ) ;
SUIT_MessageBox::information( this, tr( "GEOM_FREE_BOUNDS_TLT" ), msg, tr( "Close" ) );
updateButtonState();
activateSelection();
if ( anId == 0 ) {
// Case of whole gluing
disconnect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
globalSelection( GEOM_ALLSHAPES );
if ( myObject->_is_nil())
else {
displayPreview( true, false, false, 2/*line width*/, 1/*display mode*/, Quantity_NOC_RED );
disconnect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) ) ;
+ this, SLOT( SelectionIntoArgument() ) ) ;
globalSelection( GEOM_PREVIEW );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) ) ;
+ this, SLOT( SelectionIntoArgument() ) ) ;
}
}
updateViewer();
// TRUE to construct a modal dialog.
//=================================================================================
RepairGUI_RemoveExtraEdgesDlg::RepairGUI_RemoveExtraEdgesDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal )
+ bool modal )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal )
{
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
initName( tr( "REMOVE_EXTRA_EDGES_NEW_OBJ_NAME" ) );
resize(100,100);
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
activateSelection();
}
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
- /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory
- /*theInheritFirstArg=*/true );
+ /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory
+ /*theInheritFirstArg=*/true );
}
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
myEditCurrentArgument = GroupPoints->LineEdit1;
myEditCurrentArgument->setText( "" );
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
myEditCurrentArgument = GroupPoints->LineEdit1;
myEditCurrentArgument->setText( "" );
// TRUE to construct a modal dialog.
//=================================================================================
RepairGUI_SewingDlg::RepairGUI_SewingDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal )
+ bool modal )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SEWING" ) ) );
myTolEdt->setValue( DEFAULT_TOLERANCE_VALUE );
QLabel* aLbl1 = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints->Box );
myFreeBoundBtn = new QPushButton( tr( "GEOM_DETECT" ) + QString( " [%1]" ).arg( tr( "GEOM_FREE_BOUNDARIES" ) ),
- GroupPoints->Box );
+ GroupPoints->Box );
aLay->addWidget( aLbl1, 0, 0 );
aLay->addWidget( myTolEdt, 0, 1 );
aLay->addWidget( myFreeBoundBtn, 1, 0, 1, 2 );
myClosed = -1;
myOpen = -1;
-
+
/* signals and slots connections */
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
connect( myFreeBoundBtn, SIGNAL( clicked() ), this, SLOT( onDetect() ) );
bool RepairGUI_SewingDlg::ClickOnApply()
{
if ( !onAccept() )
- return false;
+ return false;
initName();
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
GroupPoints->LineEdit1->setText( "" );
myObject = GEOM::GEOM_Object::_nil();
myOpen = anOpen->length();
int i;
for ( i = 0; i < myClosed; i++ )
- objects.push_back( aClosed[i]._retn() );
+ objects.push_back( aClosed[i]._retn() );
for ( i = 0; i < myOpen; i++ )
- objects.push_back( anOpen[i]._retn() );
+ objects.push_back( anOpen[i]._retn() );
}
else
myClosed = -1;
{
if ( !IsPreview() )
{
- QStringList aParameters;
- aParameters << myTolEdt->text();
+ QStringList aParameters;
+ aParameters << myTolEdt->text();
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
objects.push_back( anObj._retn() );
// TRUE to construct a modal dialog.
//=================================================================================
RepairGUI_ShapeProcessDlg::RepairGUI_ShapeProcessDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal )
+ bool modal )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal )
{
setHelpFileName( "shape_processing_operation_page.html" );
initParamsValues();
initSelection();
-
+
setWindowTitle( tr( "GEOM_SHAPEPROCESS_TITLE" ) );
mainFrame()->GroupConstructors->hide();
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( onApply() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
connect( mySelectWdgt->PushButton1, SIGNAL( clicked() ), this, SLOT( selectClicked() ) );
connect( mySelectWdgt->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( lineEditReturnPressed() ) );
void RepairGUI_ShapeProcessDlg::selectionChanged()
{
reset();
-
+
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
- myObjects[i++] = aSelectedObject;
+ myObjects[i++] = aSelectedObject;
}
myObjects->length( i );
if ( i == 1 )
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( ) ))->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
-
+ SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
+
reset();
//myGeomGUI->SetState( 0 );
initSelection();
void RepairGUI_ShapeProcessDlg::reset()
{
myObjects = new GEOM::ListOfGO();
- myObjects->length( 0 );
+ myObjects->length( 0 );
mySelectWdgt->LineEdit1->setText( "" );
}
const QString& aParam = aListIter.next();
QWidget* aControl = getControl( aParam );
if ( qobject_cast<SalomeApp_DoubleSpinBox*>( aControl ) )
- ok = qobject_cast<SalomeApp_DoubleSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
+ ok = qobject_cast<SalomeApp_DoubleSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
else if ( qobject_cast<SalomeApp_IntSpinBox*>( aControl ) )
- ok = qobject_cast<SalomeApp_IntSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
+ ok = qobject_cast<SalomeApp_IntSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
}
}
/*//-- check --
int z;
- MESSAGE("Objects : ");
- for ( z = 0; z < myObjects->length(); z++ )
- MESSAGE(myObjects[z]->GetName() << " ");
- MESSAGE("\nOperators : ");
- for ( z = 0; z < anOperators->length(); z++ )
- MESSAGE(anOperators[z] << " ");
- MESSAGE("\nParameters : ");
- for ( z = 0; z < aParams->length(); z++ )
- MESSAGE(aParams[z] << " ");
- MESSAGE("\nValues : ");
- for ( z = 0; z < aValues->length(); z ++ )
- MESSAGE(aValues[z] << " ");
- MESSAGE("\n");
+ MESSAGE("Objects : ");
+ for ( z = 0; z < myObjects->length(); z++ )
+ MESSAGE(myObjects[z]->GetName() << " ");
+ MESSAGE("\nOperators : ");
+ for ( z = 0; z < anOperators->length(); z++ )
+ MESSAGE(anOperators[z] << " ");
+ MESSAGE("\nParameters : ");
+ for ( z = 0; z < aParams->length(); z++ )
+ MESSAGE(aParams[z] << " ");
+ MESSAGE("\nValues : ");
+ for ( z = 0; z < aValues->length(); z ++ )
+ MESSAGE(aValues[z] << " ");
+ MESSAGE("\n");
*/// -----------
QStringList anErrorObjNames;
{
if ( !IsPreview() )
{
- QStringList aParameters;
+ QStringList aParameters;
- for ( int i = 0; i < anOperators->length(); i++ )
- aParameters << QString( anOperators[i] );
+ for ( int i = 0; i < anOperators->length(); i++ )
+ aParameters << QString( anOperators[i] );
- for ( int i = 0; i < aParams->length(); i++ )
- aParameters << QString( aParams[i] );
+ for ( int i = 0; i < aParams->length(); i++ )
+ aParameters << QString( aParams[i] );
- aParameters << getTexts( aParams );
+ aParameters << getTexts( aParams );
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
objects.push_back( anObj._retn() );
for ( int i = 0; i < aCheckedList.count(); i++ )
anOperators[i] = CORBA::string_dup( aCheckedList[i].toLatin1().constData() );
-
+
return anOperators._retn();
}
{
QString aText = getText( aCtrl );
if( !aText.isNull() )
- aTexts.append( aText );
+ aTexts.append( aText );
}
}
QAbstractButton* btn = (QAbstractButton*)sender();
if ( on && btn->isCheckable() &&
SUIT_MessageBox::warning( this,
- tr( "GEOM_WRN_WARNING" ), tr( "TIME_CONSUMING" ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No ) == SUIT_MessageBox::No )
+ tr( "GEOM_WRN_WARNING" ), tr( "TIME_CONSUMING" ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No ) == SUIT_MessageBox::No )
btn->toggle();
}
//myGeomGUI->SetState( 0 );
initSelection();
-
+
/* signals and slots connections */
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "SUPRESS_FACE_NEW_OBJ_NAME" ) );
resize(100,100);
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) ) {
- if ( aShape.ShapeType() <= TopAbs_FACE ) { // FACE, SHELL, SOLID, COMPOUND
- GEOM::short_array anIndexes;
-
- TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( anIO, aMap );
-
- if ( !aMap.IsEmpty() ) {
- Convert( aMap, anIndexes );
- myObjects[i++] = aSelectedObject; // append the object
- myFaces.append( anIndexes ); // append faces' indexes
- numFaces += anIndexes.length();// just for text field output
- }
- }
+ if ( aShape.ShapeType() <= TopAbs_FACE ) { // FACE, SHELL, SOLID, COMPOUND
+ GEOM::short_array anIndexes;
+
+ TColStd_IndexedMapOfInteger aMap;
+ aSelMgr->GetIndexes( anIO, aMap );
+
+ if ( !aMap.IsEmpty() ) {
+ Convert( aMap, anIndexes );
+ myObjects[i++] = aSelectedObject; // append the object
+ myFaces.append( anIndexes ); // append faces' indexes
+ numFaces += anIndexes.length();// just for text field output
+ }
+ }
}
}
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
//myGeomGUI->SetState( 0 );
initSelection();
void enterEvent( QEvent* );
void Convert( const TColStd_IndexedMapOfInteger&,
- GEOM::short_array& );
+ GEOM::short_array& );
void initSelection();
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: STEPExport.cxx
-// Created: Wed May 19 14:53:52 2004
-// Author: Pavel TELKOV
-// <ptv@mutex.nnov.opencascade.com>
+// File: STEPExport.cxx
+// Created: Wed May 19 14:53:52 2004
+// Author: Pavel TELKOV
+// <ptv@mutex.nnov.opencascade.com>
//
#include "utilities.h"
status = aWriter.Transfer( theShape, STEPControl_AsIs );
//VRV: OCC 4.0 migration
if ( status == IFSelect_RetDone )
- status = aWriter.Write( theFileName.ToCString() );
+ status = aWriter.Write( theFileName.ToCString() );
// Return previous locale
if ( status == IFSelect_RetDone )
- return 1;
+ return 1;
}
catch(Standard_Failure)
{
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: STEPImport.cxx
-// Created: Wed May 19 14:41:10 2004
-// Author: Pavel TELKOV
-// <ptv@mutex.nnov.opencascade.com>
+// File: STEPImport.cxx
+// Created: Wed May 19 14:41:10 2004
+// Author: Pavel TELKOV
+// <ptv@mutex.nnov.opencascade.com>
//
#include "utilities.h"
TopoDS_Shape Import (const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& /*theFormatName*/,
TCollection_AsciiString& theError,
- const TDF_Label&)
+ const TDF_Label&)
{
MESSAGE("Import STEP model from file " << theFileName.ToCString());
// Set "C" numeric locale to save numbers correctly
IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString());
if (status == IFSelect_RetDone) {
- Standard_Boolean failsonly = Standard_False ;
- aReader.PrintCheckLoad (failsonly, IFSelect_ItemsByEntity);
- /* Root transfers */
- Standard_Integer nbr = aReader.NbRootsForTransfer();
- aReader.PrintCheckTransfer (failsonly, IFSelect_ItemsByEntity);
+ Standard_Boolean failsonly = Standard_False ;
+ aReader.PrintCheckLoad (failsonly, IFSelect_ItemsByEntity);
+ /* Root transfers */
+ Standard_Integer nbr = aReader.NbRootsForTransfer();
+ aReader.PrintCheckTransfer (failsonly, IFSelect_ItemsByEntity);
- for ( Standard_Integer n=1; n <= nbr; n++) {
- Standard_Boolean ok = aReader.TransferRoot(n);
- /* Collecting resulting entities */
- Standard_Integer nbs = aReader.NbShapes();
- if (!ok || nbs == 0)
- {
- // THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::ImportStep", SALOME::BAD_PARAM);
- continue; // skip empty root
- }
- /* For a single entity */
- else if (nbr == 1 && nbs == 1) {
- aResShape = aReader.Shape(1);
- break;
- }
+ for ( Standard_Integer n=1; n <= nbr; n++) {
+ Standard_Boolean ok = aReader.TransferRoot(n);
+ /* Collecting resulting entities */
+ Standard_Integer nbs = aReader.NbShapes();
+ if (!ok || nbs == 0)
+ {
+ // THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::ImportStep", SALOME::BAD_PARAM);
+ continue; // skip empty root
+ }
+ /* For a single entity */
+ else if (nbr == 1 && nbs == 1) {
+ aResShape = aReader.Shape(1);
+ break;
+ }
- for ( Standard_Integer i=1; i<=nbs; i++ ) {
- TopoDS_Shape aShape = aReader.Shape(i);
- if ( aShape.IsNull() ) {
- // THROW_SALOME_CORBA_EXCEPTION("Null shape in GEOM_Gen_i::ImportStep", SALOME::BAD_PARAM) ;
- //return aResShape;
- continue;
- }
- else {
- B.Add( compound, aShape ) ;
- }
- }
- }
- if ( aResShape.IsNull() )
- aResShape = compound;
+ for ( Standard_Integer i=1; i<=nbs; i++ ) {
+ TopoDS_Shape aShape = aReader.Shape(i);
+ if ( aShape.IsNull() ) {
+ // THROW_SALOME_CORBA_EXCEPTION("Null shape in GEOM_Gen_i::ImportStep", SALOME::BAD_PARAM) ;
+ //return aResShape;
+ continue;
+ }
+ else {
+ B.Add( compound, aShape ) ;
+ }
+ }
+ }
+ if ( aResShape.IsNull() )
+ aResShape = compound;
} else {
// switch (status) {
// break;
// }
theError = "Wrong format of the imported file. Can't import file.";
- aResShape.Nullify();
+ aResShape.Nullify();
}
}
catch (Standard_Failure) {
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: STLExport.cxx
-// Created: Wed May 19 14:53:52 2004
-// Author: Pavel TELKOV
-// <ptv@mutex.nnov.opencascade.com>
+// File: STLExport.cxx
+// Created: Wed May 19 14:53:52 2004
+// Author: Pavel TELKOV
+// <ptv@mutex.nnov.opencascade.com>
//
#include "utilities.h"
if (!BRep_Tool::Degenerated (TopoDS::Edge (aExp.Current())))
if(myEdgeFaces.Contains(aExp.Current()) && myEdgeFaces.FindFromKey(aExp.Current()).Extent() >1)
continue;
- aSeqEdges->Append(aExp.Current());
+ aSeqEdges->Append(aExp.Current());
}
}
try {
GeomPlate_BuildPlateSurface aBuilder(myDegree, myNbPtsOnCur, myNbIter,
- myTol2d, myTol3d, myTolAng, myTolCrv);
+ myTol2d, myTol3d, myTolAng, myTolCrv);
TopoDS_Iterator aIter;
for(aIter.Initialize (theWire); aIter.More(); aIter.Next()) {
BRepAdaptor_Curve adC(ae);
Handle(BRepAdaptor_HCurve) aHAD= new BRepAdaptor_HCurve(adC);
Handle(BRepFill_CurveConstraint) aConst =
- new BRepFill_CurveConstraint (aHAD, (Standard_Integer) GeomAbs_C0, myNbPtsOnCur, myTol3d);
+ new BRepFill_CurveConstraint (aHAD, (Standard_Integer) GeomAbs_C0, myNbPtsOnCur, myTol3d);
//Handle(GeomPlate_CurveConstraint) aConst =
// new GeomPlate_CurveConstraint(aHAD, (Standard_Integer) GeomAbs_C0, myNbPtsOnCur, myTol3d);
aBuilder.Add (aConst);
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
public:
TransformationGUI_MirrorDlg( GeometryGUI*, QWidget* = 0,
- bool = false, Qt::WindowFlags = 0 );
+ bool = false, Qt::WindowFlags = 0 );
~TransformationGUI_MirrorDlg();
protected:
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
public:
TransformationGUI_MultiRotationDlg( GeometryGUI*, QWidget* = 0,
- bool = false, Qt::WindowFlags = 0 );
+ bool = false, Qt::WindowFlags = 0 );
~TransformationGUI_MultiRotationDlg();
protected:
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVectorU) &&
!CORBA::is_nil(myVectorV)) {
anObj = anOper->MultiTranslate2D(myBase,
- myVectorU, myStepU, myNbTimesU,
- myVectorV, myStepV, myNbTimesV);
+ myVectorU, myStepU, myNbTimesU,
+ myVectorV, myStepV, myNbTimesV);
if(!IsPreview()) {
aParameters<<GroupDimensions->SpinBox_DX1->text();
aParameters<<GroupDimensions->SpinBox_DY1->text();
public:
TransformationGUI_MultiTranslationDlg( GeometryGUI*, QWidget* = 0,
- bool = false, Qt::WindowFlags = 0 );
+ bool = false, Qt::WindowFlags = 0 );
~TransformationGUI_MultiTranslationDlg();
protected:
// TRUE to construct a modal dialog.
//=================================================================================
TransformationGUI_OffsetDlg::TransformationGUI_OffsetDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_OFFSET" ) ) );
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
connect( GroupPoints->CheckButton1, SIGNAL( toggled( bool ) ), this, SLOT( CreateCopyModeChanged( bool ) ) );
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection( GEOM_ALLSHAPES );
myEditCurrentArgument = GroupPoints->LineEdit1;
myEditCurrentArgument->setFocus();
if(!IsPreview()) {
anObj->SetParameters(GroupPoints->SpinBox_DX->text().toLatin1().constData());
}
- objects.push_back( anObj._retn() );
+ objects.push_back( anObj._retn() );
}
}
}
for ( int i = 0; i < myObjects.length(); i++ ) {
anObj = anOper->OffsetShape( myObjects[i], GetOffset() );
if ( !anObj->_is_nil() )
- objects.push_back( anObj._retn() );
+ objects.push_back( anObj._retn() );
}
}
res = true;
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
- /*theFindMethod=*/GEOM::FSM_Transformed,
- /*theInheritFirstArg=*/true );
+ /*theFindMethod=*/GEOM::FSM_Transformed,
+ /*theInheritFirstArg=*/true );
}
}
public:
TransformationGUI_OffsetDlg( GeometryGUI*, QWidget* = 0,
- bool = false, Qt::WindowFlags = 0 );
+ bool = false, Qt::WindowFlags = 0 );
~TransformationGUI_OffsetDlg();
protected:
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations(getStudyId());
- aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ GEOM::GEOM_IShapesOperations_var aShapesOp =
+ getGeomEngine()->GetIShapesOperations(getStudyId());
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
}
else { // get Object from study
- aSelectedObject = aFindedObject;
+ aSelectedObject = aFindedObject;
}
}
else {
if (S.ShapeType() != TopAbs_EDGE && S.ShapeType() != TopAbs_WIRE) {
- aSelectedObject = GEOM::GEOM_Object::_nil();
- aName = "";
- return;
+ aSelectedObject = GEOM::GEOM_Object::_nil();
+ aName = "";
+ return;
}
}
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
case 0:
{
for (int i = 0; i < myObjects.length(); i++) {
- anObj = toCreateCopy ?
- anOper->PositionShapeCopy(myObjects[i], myObjects[i], myEndLCS) :
- anOper->PositionShape(myObjects[i], myObjects[i], myEndLCS);
+ anObj = toCreateCopy ?
+ anOper->PositionShapeCopy(myObjects[i], myObjects[i], myEndLCS) :
+ anOper->PositionShape(myObjects[i], myObjects[i], myEndLCS);
if (!anObj->_is_nil())
objects.push_back(anObj._retn());
for (int i = 0; i < myObjects.length(); i++) {
if (toCreateCopy)
anObj = toCreateCopy ?
- anOper->PositionShapeCopy(myObjects[i], myStartLCS, myEndLCS) :
- anOper->PositionShape(myObjects[i], myStartLCS, myEndLCS);
+ anOper->PositionShapeCopy(myObjects[i], myStartLCS, myEndLCS) :
+ anOper->PositionShape(myObjects[i], myStartLCS, myEndLCS);
if (!anObj->_is_nil())
objects.push_back(anObj._retn());
}
double aDistance = Group1->SpinBox_DX->value();
bool toReverse = Group1->CheckButton3->isChecked();
for (int i = 0; i < myObjects.length(); i++) {
- anObj = anOper->PositionAlongPath(myObjects[i], myPath, aDistance, toCreateCopy, toReverse);
- if (!anObj->_is_nil())
- objects.push_back(anObj._retn());
+ anObj = anOper->PositionAlongPath(myObjects[i], myPath, aDistance, toCreateCopy, toReverse);
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
}
res = true;
break;
public:
TransformationGUI_PositionDlg( GeometryGUI*, QWidget* = 0,
- bool = false, Qt::WindowFlags = 0 );
+ bool = false, Qt::WindowFlags = 0 );
~TransformationGUI_PositionDlg();
protected:
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
/* if (myObjects.length()) {
if (getConstructorId() == 0 && myAxis->_is_nil() || getConstructorId() == 1 && myCentPoint->_is_nil() )
- GroupPoints->PushButton2->click();
+ GroupPoints->PushButton2->click();
}*/ // here commented, because multiple objects can be selected IPAL 21437
}
else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0) {
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
if (!anObj->_is_nil()) {
if(!IsPreview()) {
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
- updateAttributes(anObj, aParameters);
- }
+ updateAttributes(anObj, aParameters);
+ }
objects.push_back(anObj._retn());
- }
+ }
}
}
res = true;
public:
TransformationGUI_RotationDlg( GeometryGUI*, QWidget* = 0,
- bool = false, Qt::WindowFlags = 0 );
+ bool = false, Qt::WindowFlags = 0 );
~TransformationGUI_RotationDlg();
protected:
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
for (int i = 0; i < myObjects.length(); i++)
{
anObj = anOper->ScaleShapeAlongAxesCopy(myObjects[i], myPoint, SpinBox_FX->value(),
- SpinBox_FY->value(), SpinBox_FZ->value());
+ SpinBox_FY->value(), SpinBox_FZ->value());
if (!anObj->_is_nil())
if(!IsPreview()) {
QStringList aParameters;
for (int i = 0; i < myObjects.length(); i++)
{
anObj = anOper->ScaleShapeAlongAxes(myObjects[i], myPoint, SpinBox_FX->value(),
- SpinBox_FY->value(), SpinBox_FZ->value());
+ SpinBox_FY->value(), SpinBox_FZ->value());
if (!anObj->_is_nil())
objects.push_back(anObj._retn());
}
public:
TransformationGUI_ScaleDlg( GeometryGUI*, QWidget* = 0,
- bool = false, Qt::WindowFlags = 0 );
+ bool = false, Qt::WindowFlags = 0 );
~TransformationGUI_ScaleDlg();
protected:
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
anObj = anOper->TranslateDXDYDZCopy(myObjects[i], dx, dy, dz);
if (!anObj->_is_nil()) {
if(!IsPreview())
- anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ anObj->SetParameters(aParameters.join(":").toLatin1().constData());
objects.push_back(anObj._retn());
}
}
anObj = anOper->TranslateDXDYDZ(myObjects[i], dx, dy, dz);
if (!anObj->_is_nil()) {
if(!IsPreview()) {
- anObj->SetParameters(aParameters.join(":").toLatin1().constData());
- updateAttributes(anObj, aParameters);
- }
+ anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ updateAttributes(anObj, aParameters);
+ }
objects.push_back(anObj._retn());
- }
+ }
}
}
res = true;
myCurrObject = myObjects[i];
anObj = anOper->TranslateVectorDistance(myObjects[i], myVector, aDistance, toCreateCopy);
if (!anObj->_is_nil()) {
- if(!IsPreview()) {
+ if(!IsPreview()) {
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
- if (!toCreateCopy)
- updateAttributes(anObj, aParameters);
- }
+ if (!toCreateCopy)
+ updateAttributes(anObj, aParameters);
+ }
objects.push_back(anObj._retn());
}
}
public:
TransformationGUI_TranslationDlg( GeometryGUI*, QWidget* = 0,
- bool = false, Qt::WindowFlags = 0 );
+ bool = false, Qt::WindowFlags = 0 );
~TransformationGUI_TranslationDlg();
protected: