void MakeInternalShells(const TopTools_MapOfShape& ,
TopTools_ListOfShape& );
-//modified by NIZNHY-PKV Tue Aug 5 15:06:50 2008f
static
- Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell);
-//modified by NIZNHY-PKV Tue Aug 5 15:06:57 2008t
+ Standard_Boolean IsClosedShell(const TopoDS_Shell& );
+
+//modified by NIZNHY-PKV Tue Oct 26 13:30:39 2010f
+static
+ Standard_Boolean RefineShell(const TopoDS_Shell& ,
+ TopoDS_Shell& );
+//modified by NIZNHY-PKV Tue Oct 26 13:30:42 2010t
//=======================================================================
//function :
if (!myShapesToAvoid.Contains(aF)) {
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
}
- else {
- int a=0;
+ /*
+ else {
+ int a=0;
}
+ */
}
aNbE=aMEF.Extent();
//
// 2. myFacesToAvoid
for (i=1; i<=aNbE; ++i) {
- const TopoDS_Edge& aE=TopoDS::Edge(aMEF.FindKey(i));
+ const TopoDS_Edge& aE=*((TopoDS_Edge*)(&aMEF.FindKey(i)));
if (BRep_Tool::Degenerated(aE)) {
continue;
}
//
aOrE=aE.Orientation();
//
- const TopoDS_Face& aF1=TopoDS::Face(aLF.First());
+ const TopoDS_Face& aF1=*((TopoDS_Face*)(&aLF.First()));
if (aNbF==1) {
if (aOrE==TopAbs_INTERNAL) {
continue;
myShapesToAvoid.Add(aF1);
}
else if (aNbF==2) {
- const TopoDS_Face& aF2=TopoDS::Face(aLF.Last());
+ const TopoDS_Face& aF2=*((TopoDS_Face*)(&aLF.Last()));
if (aF2.IsSame(aF1)) {
if (BRep_Tool::IsClosed(aE, aF1)) {
continue;
myShapesToAvoid.Add(aF2);
}
}
- //DEB
+ /*//DEB
else {
TopTools_ListIteratorOfListOfShape aItLF;
//
int a=0;
}
}
- //DEB
+ *///DEB
}// for (i=1; i<=aNbE; ++i) {
//
if (!bFound) {
//
myLoops.Clear();
//
- Standard_Integer aNbLF, aNbOff, aNbFP, aNbFA;
+ Standard_Integer aNbLF, aNbOff, aNbFP;
TopAbs_Orientation anOr;
TopoDS_Edge aEL;
BRep_Builder aBB;
NMTTools_CoupleOfShape aCSOff;
- TopTools_MapOfOrientedShape AddedFacesMap;//, aMFP;
+ TopTools_MapOfOrientedShape AddedFacesMap;
TopTools_IndexedDataMapOfShapeListOfShape aEFMap, aMEFP;
TopTools_ListIteratorOfListOfShape aItF, aIt;
TopTools_MapIteratorOfMapOfOrientedShape aItM;
// loop on faces added to Shell; add their neighbor faces to Shell and so on
TopoDS_Iterator aItAddedF (aShell);
for (; aItAddedF.More(); aItAddedF.Next()) {
- const TopoDS_Face& aF = TopoDS::Face(aItAddedF.Value());
+ const TopoDS_Face& aF = *((TopoDS_Face*)(&aItAddedF.Value()));
//
// loop on edges of aF; find a good neighbor face of aF by aE
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
for (; aEdgeExp.More(); aEdgeExp.Next()) {
- const TopoDS_Edge& aE = TopoDS::Edge(aEdgeExp.Current());
+ const TopoDS_Edge& aE=*((TopoDS_Edge*)(&aEdgeExp.Current()));
//
//1
if (aMEFP.Contains(aE)) {
//
aItLF.Initialize(aLF);
for (; aItLF.More(); aItLF.Next()) {
- const TopoDS_Face& aFL=TopoDS::Face(aItLF.Value());
+ const TopoDS_Face& aFL=*((TopoDS_Face*)(&aItLF.Value()));
if (myShapesToAvoid.Contains(aFL)) {
continue;
}
//
TopoDS_Face aSelF;
if (aNbOff==1) {
- aSelF=TopoDS::Face(aLCSOff.First().Shape2());
+ aSelF=*((TopoDS_Face*)(&aLCSOff.First().Shape2()));
}
else if (aNbOff>1){
GEOMAlgo_Tools3D::GetFaceOff(aE, aF, aLCSOff, aSelF);
}
} // for (; aEdgeExp.More(); aEdgeExp.Next()) {
} //for (; aItAddedF.More(); aItAddedF.Next()) {
- //modified by NIZNHY-PKV Tue Aug 5 15:07:08 2008f
- //myLoops.Append(aShell);
+ //
if (IsClosedShell(aShell)) {
myLoops.Append(aShell);
}
- /*
+ //modified by NIZNHY-PKV Wed Oct 27 07:10:41 2010f
else {
- TopoDS_Iterator aItS;
- aItS.Initialize(aShell);
- for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aFs=aItS.Value();
- aMFP.Add(aFs);
+ Standard_Boolean bRefine;
+ TopoDS_Shell aShx;
+ //
+ bRefine=RefineShell(aShell, aShx);
+ if (bRefine) {
+ myLoops.Append(aShx);
}
}
- */
- //modified by NIZNHY-PKV Tue Aug 5 15:07:30 2008t
- } // for (; aItF.More(); aItF.Next()) {
- //modified by NIZNHY-PKV Tue Aug 5 15:07:35 2008f
+ //modified by NIZNHY-PKV Wed Oct 27 07:10:44 2010t
+ } // for (; aItF.More(); aItF.Next()) {
//
// Post Treatment
TopTools_MapOfOrientedShape aMP;
}
}
//
- // b. collect all edges that are to avoid
+ // b. collect all faces that are to avoid
aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aF=aItM.Key();
aMP.Add(aF);
}
//
- // c. add all edges that are not processed to myShapesToAvoid
+ // c. add all faces that are not processed to myShapesToAvoid
aIt.Initialize (myShapes);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
myShapesToAvoid.Add(aF);
}
}
- //modified by NIZNHY-PKV Tue Aug 5 15:07:44 2008t
//=================================================
//
// 2.Internal Shells
aEFMap.Clear();
AddedFacesMap.Clear();
//
- aNbFA=myShapesToAvoid.Extent();
- //
aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aFF=aItM.Key();
//
TopoDS_Iterator aItAddedF (aShell);
for (; aItAddedF.More(); aItAddedF.Next()) {
- const TopoDS_Face& aF = TopoDS::Face(aItAddedF.Value());
+ const TopoDS_Face& aF = *((TopoDS_Face*)(&aItAddedF.Value()));
//
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
for (; aEdgeExp.More(); aEdgeExp.Next()) {
- const TopoDS_Edge& aE = TopoDS::Edge(aEdgeExp.Current());
+ 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());
+ const TopoDS_Face& aFL=*((TopoDS_Face*)(&aItF.Value()));
if (AddedFacesMap.Add(aFL)){
aBB.Add(aShell, aFL);
}
}
else{
// check if a shell is a hole
- //XX
bIsHole=IsHole(aShell, myContext);
- //bIsHole=GEOMAlgo_BuilderTools::IsHole(aShell);
- //XX
+ //
if (bIsHole) {
aHoleShells.Append(aShell);
TopExp::MapShapes(aShell, TopAbs_FACE, aMHF);
// 3. Add aHoles to Solids
aItMSH.Initialize(aMSH);
for (; aItMSH.More(); aItMSH.Next()) {
- TopoDS_Solid aSolid=TopoDS::Solid(aItMSH.Key());
+ TopoDS_Solid aSolid=*((TopoDS_Solid*)(&aItMSH.Key()));
//
const TopTools_ListOfShape& aLH=aItMSH.Value();
aShellIt.Initialize(aLH);
// 2 Process solids
aSolidIt.Initialize(myAreas);
for ( ; aSolidIt.More(); aSolidIt.Next()) {
- TopoDS_Solid& aSolid=TopoDS::Solid(aSolidIt.Value());
+ TopoDS_Solid& aSolid=*((TopoDS_Solid*)(&aSolidIt.Value()));
//
aMEF.Clear();
TopExp::MapShapesAndAncestors(aSolid, TopAbs_EDGE, TopAbs_FACE, aMEF);
aMFP.Clear();
aItMF.Initialize(aMF);
for (; aItMF.More(); aItMF.Next()) {
- const TopoDS_Face& aF=TopoDS::Face(aItMF.Key());
+ const TopoDS_Face& aF=*((TopoDS_Face*)(&aItMF.Key()));
if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, *myContext)) {
aMFP.Add(aF);
}
}
return bRet;
}
-//modified by NIZNHY-PKV Tue Aug 5 15:07:50 2008f
//=======================================================================
//function : IsClosedShell
//purpose :
const TopoDS_Face& aF=TopoDS::Face(aIt.Value());
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
- const TopoDS_Edge& aE=TopoDS::Edge(aExp.Current());
+ const TopoDS_Edge& aE=*((TopoDS_Edge*)(&aExp.Current()));
if (BRep_Tool::Degenerated(aE)) {
continue;
}
- /*
- if (BRep_Tool::IsClosed(aE, aF)) {
- continue;
- }
- */
+ //
if (aE.Orientation()==TopAbs_INTERNAL) {
continue;
}
+ //
if (!aM.Add(aE)) {
aM.Remove(aE);
}
}
return bRet;
}
-//modified by NIZNHY-PKV Tue Aug 5 15:08:07 2008t
-//BRepTools::Write(aFF, "ff");
+//modified by NIZNHY-PKV Tue Oct 26 13:30:23 2010f
+//=======================================================================
+//function : RefineShell
+//purpose :
+//=======================================================================
+ Standard_Boolean RefineShell(const TopoDS_Shell& aShell,
+ TopoDS_Shell& aShx)
+
+{
+ Standard_Boolean bRet;
+ Standard_Integer i, aNbE, aNbF;
+ TopAbs_Orientation aOrE;
+ TopTools_IndexedDataMapOfShapeListOfShape aMEF;
+ TopTools_MapOfOrientedShape aMFx;
+ //
+ bRet=Standard_False;
+ //
+ TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF);
+ aNbE=aMEF.Extent();
+ for (i=1; i<=aNbE; ++i) {
+ const TopoDS_Edge &aE=*((TopoDS_Edge*)(&aMEF.FindKey(i)));
+ //
+ if (BRep_Tool::Degenerated(aE)) {
+ continue;
+ }
+ //
+ aOrE=aE.Orientation();
+ //
+ const TopTools_ListOfShape& aLF=aMEF(i);
+ aNbF=aLF.Extent();
+ if (!aNbF) {
+ continue;
+ }
+ //
+ const TopoDS_Face& aF1=*((TopoDS_Face*)(&aLF.First()));
+ if (aNbF==1) {
+ if (aOrE==TopAbs_INTERNAL) {
+ continue;
+ }
+ aMFx.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;
+ }
+ aMFx.Add(aF1);
+ aMFx.Add(aF2);
+ }
+ }
+ }
+ //
+ aNbF=aMFx.Extent();
+ if (!aNbF) {
+ return bRet;
+ }
+ //
+ BRep_Builder aBB;
+ TopoDS_Iterator aIt;
+ //
+ aNbF=0;
+ aBB.MakeShell(aShx);
+ aIt.Initialize(aShell);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aF=aIt.Value();
+ if (!aMFx.Contains(aF)) {
+ aBB.Add(aShx, aF);
+ ++aNbF;
+ }
+ }
+ //
+ if (aNbF) {
+ bRet=IsClosedShell(aShx);
+ }
+ //
+ return bRet;
+}
+//modified by NIZNHY-PKV Tue Oct 26 13:30:26 2010t
//
// ErrorStatus :
// 11 - Null Context
IntTools_Context& aCtx=pPF->ChangeContext();
//
Standard_Boolean bToReverse;
- Standard_Integer i, aNb, aNbSp, nSp, nSpR, nSpx, aIsCB;
+ Standard_Integer i, aNb, aNbSp, nSp, nSpR, nSpx, aIsCB, aNbLB;
TColStd_ListIteratorOfListOfInteger aItLB;
TColStd_ListOfInteger aLB;
TopoDS_Edge aEE, aESpR;
nSp=aPB.Edge();
const TopoDS_Shape& aSp=aDS.Shape(nSp);
//
- //modified by NIZNHY-PKV Fri Nov 30 10:40:36 2007 f
- //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:40:48 2007t
+ //modified by NIZNHY-PKV Wed Oct 27 11:19:30 2010f
+ aNbLB=aLB.Extent();
+ if (aIsCB && aNbLB<2) {
+ aIsCB=0;
+ }
+ //modified by NIZNHY-PKV Wed Oct 27 11:19:34 2010t
+ //
nSpR=aPBR.Edge();
const TopoDS_Shape& aSpR=aDS.Shape(nSpR);
- //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;
}
//
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);
//
const TopoDS_Shape& aSpx=aDS.Shape(nSpx);
mySameDomainShapes.Add(aSpx ,aSpR);
}
- //
}
}
//
#include <BOPTools_CArray1OfESInterference.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
+
#include <NMTTools_PaveFiller.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_Tools.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_WireEdgeSet.hxx>
#include <GEOMAlgo_BuilderFace.hxx>
-#include <NMTDS_InterfPool.hxx>
+
+#include <GEOMAlgo_ShapeSet.hxx>
static
void UpdateCandidates(const Standard_Integer ,
aNbSE=aLSE.Extent();
if (aNbSE) {
aMFP.Add(i);
+ //modified by NIZNHY-PKV Wed Oct 27 11:40:57 2010f
+ break;
+ //modified by NIZNHY-PKV Wed Oct 27 11:41:07 2010t
}
}
}
}
//
// 2.2. Build images Faces
- GEOMAlgo_BuilderFace aBF;
+ TopTools_ListOfShape aLFR;
+ GEOMAlgo_ShapeSet aS1, aS2;
//
- aBF.SetFace(aFF);
- aBF.SetContext(aCtx);
const TopTools_ListOfShape& aSE=aWES.StartElements();
- //
- //DEB f
- /*
- {
- TopoDS_Compound aCx;
- BRep_Builder aBBx;
- TopTools_ListIteratorOfListOfShape aItx;
+ //modified by NIZNHY-PKV Thu Oct 28 08:30:41 2010f
+ aS1.Add(aSE);
+ aS2.Add(aFF, TopAbs_EDGE);
+ if (aS1.IsEqual(aS2)) {
+ aLFR.Append(aF);
+ }
+ //modified by NIZNHY-PKV Thu Oct 28 08:30:42 2010t
+ else {
+ GEOMAlgo_BuilderFace aBF;
//
- aBBx.MakeCompound(aCx);
- aBBx.Add(aCx, aFF);
- aItx.Initialize(aSE);
- for (; aItx.More(); aItx.Next()) {
- TopoDS_Shape& aEx=aItx.Value();
- aBBx.Add(aCx, aEx);
- }
- int a=0;
- }
- */
- //DEB t
- //
- aBF.SetShapes(aSE);
- //
- aBF.Perform();
- //
- const TopTools_ListOfShape& aLF=aBF.Areas();
- //
- TopTools_ListOfShape aLFR;
- //
- aIt.Initialize(aLF);
- for (; aIt.More(); aIt.Next()) {
- TopoDS_Shape& aFR=aIt.Value();
- if (anOriF==TopAbs_REVERSED) {
- aFR.Orientation(TopAbs_REVERSED);
+ aBF.SetFace(aFF);
+ aBF.SetContext(aCtx);
+ aBF.SetShapes(aSE);
+ // <-DEB
+ aBF.Perform();
+ //
+ const TopTools_ListOfShape& aLF=aBF.Areas();
+ aIt.Initialize(aLF);
+ for (; aIt.More(); aIt.Next()) {
+ TopoDS_Shape& aFR=aIt.Value();
+ if (anOriF==TopAbs_REVERSED) {
+ aFR.Orientation(TopAbs_REVERSED);
+ }
+ aLFR.Append(aFR);
}
- aLFR.Append(aFR);
}
//
// 2.3. Collect draft images Faces
//=======================================================================
void GEOMAlgo_Builder::FillImagesFaces1()
{
- Standard_Integer i, aNb, iSense;
+ Standard_Integer i, aNb, iSense, aNbLFx;
TopoDS_Face aF, aFSp, aFSD;
TopTools_ListOfShape aLFx;
TopTools_ListIteratorOfListOfShape aIt;
aLFx.Append(aFSD);
}
}
- if (!myImages.HasImage(aF)) {//XX
+ if (!myImages.HasImage(aF)) {
+ //modified by NIZNHY-PKV Wed Oct 27 14:41:34 2010f
+ aNbLFx=aLFx.Extent();
+ if (aNbLFx==1) {
+ const TopoDS_Shape& aFx=aLFx.First();
+ if (aF.IsSame(aFx)) {
+ continue;
+ }
+ }
+ //modified by NIZNHY-PKV Wed Oct 27 14:41:36 2010t
myImages.Bind(aF, aLFx);
}
}
theMFMV.Add(theNF, aMV);
}
}
+
+/*
+ {
+ TopoDS_Compound aCx;
+ BRep_Builder aBBx;
+ TopTools_ListIteratorOfListOfShape aItx;
+ //
+ aBBx.MakeCompound(aCx);
+ aBBx.Add(aCx, aFF);
+ aItx.Initialize(aSE);
+ for (; aItx.More(); aItx.Next()) {
+ TopoDS_Shape& aEx=aItx.Value();
+ aBBx.Add(aCx, aEx);
+ }
+ int a=0;
+ }
+ */
---Purpose: Returns the Set
returns ListOfShape from TopTools;
---C++: return const &
-
+ --modified by NIZNHY-PKV Wed Oct 28 13:51:45 2010f
+ IsEqual(me;
+ theOther: ShapeSet from GEOMAlgo)
+ ---Purpose: Returns True if the Set==theSet
+ returns Boolean from Standard;
+ ---C++: alias operator ==
+ --modified by NIZNHY-PKV Wed Oct 28 13:51:50 2010t
+
fields
myMap : MapOfOrientedShape from TopTools is protected;
myList : ListOfShape from TopTools is protected;
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_ShapeSet::GetSet()const
{
- /*
- TopTools_ListOfShape *pL;
- TopTools_MapIteratorOfMapOfOrientedShape aIt;
- //
- pL=(TopTools_ListOfShape *)&myList;
- pL->Clear();
- aIt.Initialize(myMap);
- for (; aIt.More(); aIt.Next()) {
- pL->Append(aIt.Key());
- }
- */
return myList;
}
//=======================================================================
//=======================================================================
void GEOMAlgo_ShapeSet::Subtract(const GEOMAlgo_ShapeSet& theOther)
{
- /*
- TopTools_MapIteratorOfMapOfOrientedShape aIt;
- //
- aIt.Initialize(theOther.myMap);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aS=aIt.Key();
- myMap.Remove(aS);
- }
- */
- //
TopTools_ListIteratorOfListOfShape aIt;
TopTools_ListOfShape aLS;
//
//
myList=aLS;
}
+//modified by NIZNHY-PKV Wed Oct 28 13:51:36 2010f
+//=======================================================================
+//function : IsEqual
+//purpose :
+//=======================================================================
+ Standard_Boolean GEOMAlgo_ShapeSet::IsEqual(const GEOMAlgo_ShapeSet& theOther)const
+{
+ Standard_Boolean bRet;
+ Standard_Integer aNb1, aNb2;
+ TopAbs_Orientation aOr;
+ TopTools_ListIteratorOfListOfShape aIt;
+ //
+ bRet=Standard_True;
+ aNb1=myList.Extent();
+ const TopTools_ListOfShape& aLS2=theOther.GetSet();
+ aNb2=aLS2.Extent();
+ if (aNb1!=aNb2) {
+ return !bRet;
+ }
+ //
+ aIt.Initialize(myList);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aS=aIt.Value();
+ if(!theOther.myMap.Contains(aS)) {
+ bRet=!bRet;
+ break;
+ }
+ }
+ return bRet;
+}
+//modified by NIZNHY-PKV Wed Oct 28 13:51:38 2010t
#ifndef _GEOMAlgo_ShapeSet_HeaderFile
#define _GEOMAlgo_ShapeSet_HeaderFile
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
#ifndef _TopTools_MapOfOrientedShape_HeaderFile
#include <TopTools_MapOfOrientedShape.hxx>
#endif
class TopoDS_Shape;
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-
//! Implementation some formal <br>
//! opereations with Set of shapes <br>
class GEOMAlgo_ShapeSet {
-
public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
- // Methods PUBLIC
- //
-
-//! Empty constructor <br>
-Standard_EXPORT GEOMAlgo_ShapeSet();
-
-//! Adds shapes from the list theLS to the Set <br>
-Standard_EXPORT void Add(const TopTools_ListOfShape& theLS) ;
-
-//! Adds shape theShape to the Set <br>
-Standard_EXPORT void Add(const TopoDS_Shape& theShape) ;
-
-//! Adds sub-shapes of shape theShape, <br>
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+
+ //! Empty constructor <br>
+ Standard_EXPORT GEOMAlgo_ShapeSet();
+ //! Adds shapes from the list theLS to the Set <br>
+ Standard_EXPORT void Add(const TopTools_ListOfShape& theLS) ;
+ //! Adds shape theShape to the Set <br>
+ Standard_EXPORT void Add(const TopoDS_Shape& theShape) ;
+ //! Adds sub-shapes of shape theShape, <br>
//! that have type theType to the Set <br>
-Standard_EXPORT void Add(const TopoDS_Shape& theShape,const TopAbs_ShapeEnum theType) ;
-
-//! Removes shapes of theSet from the Set <br>
-Standard_EXPORT void Subtract(const GEOMAlgo_ShapeSet& theSet) ;
-
-//! Clears internal fields <br>
-Standard_EXPORT void Clear() ;
-
-//! Returns True if the Set contains <br>
+ Standard_EXPORT void Add(const TopoDS_Shape& theShape,const TopAbs_ShapeEnum theType) ;
+ //! Removes shapes of theSet from the Set <br>
+ Standard_EXPORT void Subtract(const GEOMAlgo_ShapeSet& theSet) ;
+ //! Clears internal fields <br>
+ Standard_EXPORT void Clear() ;
+ //! Returns True if the Set contains <br>
//! all shapes of theSet <br>
-Standard_EXPORT Standard_Boolean Contains(const GEOMAlgo_ShapeSet& theSet) const;
-
-//! Returns the Set <br>
-Standard_EXPORT const TopTools_ListOfShape& GetSet() const;
+ Standard_EXPORT Standard_Boolean Contains(const GEOMAlgo_ShapeSet& theSet) const;
+ //! Returns the Set <br>
+ Standard_EXPORT const TopTools_ListOfShape& GetSet() const;
+ //! Returns True if the Set==theSet <br>
+ Standard_EXPORT Standard_Boolean IsEqual(const GEOMAlgo_ShapeSet& theOther) const;
+ Standard_Boolean operator ==(const GEOMAlgo_ShapeSet& theOther) const
+{
+ return IsEqual(theOther);
+}
protected:
- // Methods PROTECTED
- //
- // Fields PROTECTED
- //
TopTools_MapOfOrientedShape myMap;
TopTools_ListOfShape myList;
-private:
+private:
- // Methods PRIVATE
- //
- // Fields PRIVATE
- //
};
// other Inline functions and methods (like "C++: function call" methods)
-//
#endif
#include "GEOM_AISShape.ixx"
#include "SALOME_InteractiveObject.hxx"
+#include "GEOM_AISVector.hxx"
// Open CASCADE Includes
#include <AIS_Drawer.hxx>
if (isShowVectors())
{
+ const bool isVector = IsKind(STANDARD_TYPE(GEOM_AISVector));
TopExp_Explorer Exp ( myshape, TopAbs_EDGE );
for ( ; Exp.More(); Exp.Next() ) {
TopoDS_Vertex aV1, aV2;
TopoDS_Edge anEdgeE = TopoDS::Edge(Exp.Current());
+ if ( !isVector )
+ // draw curve direction (issue 0021087)
+ anEdgeE.Orientation( TopAbs_FORWARD );
if ( anEdgeE.IsNull() ) continue;
TEdgeSet::Iterator anIter (myEdgeSet);
for (; anIter.More(); anIter.Next()) {
- const TopoDS_Edge& anEdge = anIter.Value();
- OCC2VTK(anEdge,aPolyData,aPts,myIsVector);
+ TopoDS_Edge anEdge = anIter.Value();
+ if ( !myIsVector )
+ // draw curve direction (issue 0021087)
+ anEdge.Orientation( TopAbs_FORWARD );
+ OCC2VTK(anEdge,aPolyData,aPts,myIsVector||myIsVectorMode);
}
}
void GEOM_EdgeSource::SetVectorMode (bool theMode)
{
- myIsVector = theMode;
+ myIsVectorMode = theMode;
}
bool GEOM_EdgeSource::GetVectorMode ()
{
- return myIsVector;
+ return !myIsVector && myIsVectorMode;
}
TEdgeSet myEdgeSet;
// The <myIsVector> flag is common for all edges, because the shape,
// representing a vector, can have only one edge.
- bool myIsVector;
+ bool myIsVector, myIsVectorMode;
void Execute();
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// GEOM GEOMGUI : GUI for Geometry component
+// File : TransformationGUI_MultiRotationDlg.cxx
+// Author : Damien COQUERET, Open CASCADE S.A.S.
-// GEOM GEOMGUI : GUI for Geometry component
-// File : TransformationGUI_MultiRotationDlg.cxx
-// Author : Damien COQUERET, Open CASCADE S.A.S.
-//
#include "TransformationGUI_MultiRotationDlg.h"
#include <DlgRef.h>
void TransformationGUI_MultiRotationDlg::SetDoubleSpinBoxStep (double step)
{
GroupDimensions->SpinBox_DX2->setSingleStep(step);
-
+
// san: Commented so as not to override specific step settings
//GroupPoints->SpinBox_DX->setSingleStep((int)step);
//GroupDimensions->SpinBox_DX1->setSingleStep(step);
case 0:
ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
break;
- case 1:
+ case 1:
ok = GroupDimensions->SpinBox_DX1->isValid( msg, !IsPreview() ) && ok;
ok = GroupDimensions->SpinBox_DY1->isValid( msg, !IsPreview() ) && ok;
ok = GroupDimensions->SpinBox_DX2->isValid( msg, !IsPreview() ) && ok;
- ok = GroupDimensions->SpinBox_DY2->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupDimensions->SpinBox_DY2->isValid( msg, !IsPreview() ) && ok;
break;
}
return !(myBase->_is_nil() || myVector->_is_nil()) && ok;
anArgs->length(1);
anArgs[0] = myBase;
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
- /*theFindMethod=*/GEOM::FSM_Transformed,
- /*theInheritFirstArg=*/true,
+ /*theFindMethod=*/GEOM::FSM_GetInPlace,
+ /*theInheritFirstArg=*/false,
mainFrame()->CheckBoxAddPrefix->isChecked());
}
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// GEOM GEOMGUI : GUI for Geometry component
+// File : TransformationGUI_MultiTranslationDlg.cxx
+// Author : Damien COQUERET, Open CASCADE S.A.S.
-// GEOM GEOMGUI : GUI for Geometry component
-// File : TransformationGUI_MultiTranslationDlg.cxx
-// Author : Damien COQUERET, Open CASCADE S.A.S.
-//
#include "TransformationGUI_MultiTranslationDlg.h"
#include <DlgRef.h>
connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int)));
- connect(GroupPoints->SpinBox_DX, SIGNAL(textChanged(const QString& )),
+ connect(GroupPoints->SpinBox_DX, SIGNAL(textChanged(const QString& )),
this, SLOT(TextValueChangedInSpinBox(const QString& )));
- connect(GroupDimensions->SpinBox_DX1, SIGNAL(textChanged(const QString& )),
+ connect(GroupDimensions->SpinBox_DX1, SIGNAL(textChanged(const QString& )),
this, SLOT(TextValueChangedInSpinBox(const QString& )));
- connect(GroupDimensions->SpinBox_DX2, SIGNAL(textChanged(const QString& )),
+ connect(GroupDimensions->SpinBox_DX2, SIGNAL(textChanged(const QString& )),
this, SLOT(TextValueChangedInSpinBox(const QString& )));
-
+
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU()));
void TransformationGUI_MultiTranslationDlg::SetDoubleSpinBoxStep (double step)
{
GroupPoints->SpinBox_DX->setSingleStep(step);
- GroupDimensions->SpinBox_DX1->setSingleStep(step);
+ GroupDimensions->SpinBox_DX1->setSingleStep(step);
GroupDimensions->SpinBox_DX2->setSingleStep(step);
-
+
// san : Commented so as not to override specific step settings
//GroupPoints->SpinBox_DY->setSingleStep((int)step);
//GroupDimensions->SpinBox_DY1->setSingleStep((int)step);
{
QObject* send = (QObject*)sender();
bool isDigit = true;
-
+
switch (getConstructorId()) {
- case 0:
+ case 0:
GroupPoints->SpinBox_DX->text().toDouble(&isDigit);
if(!isDigit){
GroupPoints->CheckButton1->setChecked(false);
}
GroupPoints->CheckButton1->setEnabled(isDigit);
break;
- case 1:
+ case 1:
if (send == GroupDimensions->SpinBox_DX1) {
GroupDimensions->SpinBox_DX1->text().toDouble(&isDigit);
- if(!isDigit)
+ if(!isDigit)
GroupDimensions->CheckButton1->setChecked(false);
GroupDimensions->CheckButton1->setEnabled(isDigit);
}
else if(send == GroupDimensions->SpinBox_DX2){
GroupDimensions->SpinBox_DX2->text().toDouble(&isDigit);
- if(!isDigit)
+ if(!isDigit)
GroupDimensions->CheckButton2->setChecked(false);
GroupDimensions->CheckButton2->setEnabled(isDigit);
}
bool TransformationGUI_MultiTranslationDlg::isValid (QString& msg)
{
int aConstructorId = getConstructorId();
-
+
if (aConstructorId == 0) {
bool ok = true;
ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
anArgs->length(1);
anArgs[0] = myBase;
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
- /*theFindMethod=*/GEOM::FSM_Transformed,
- /*theInheritFirstArg=*/true,
+ /*theFindMethod=*/GEOM::FSM_GetInPlace,
+ /*theInheritFirstArg=*/false,
mainFrame()->CheckBoxAddPrefix->isChecked());
}
}
TopoDS_Shape aVector = BRepBuilderAPI_MakeEdge(BRep_Tool::Pnt(aFirst), BRep_Tool::Pnt(aLast)).Shape();
const char* aName = "tmpVector";
Handle(GEOM_AISVector) anIO = new GEOM_AISVector( aVector, aName );
-
+
// add Prs to preview
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));