Optimization of GetShapesOn<xxx> functionality

This commit is contained in:
jfa 2005-03-23 07:27:20 +00:00
parent 847b1b1b59
commit 390fa7af81
86 changed files with 3944 additions and 2469 deletions

View File

@ -962,6 +962,54 @@ module GEOM
in double theRadius, in double theRadius,
in shape_state theState); in shape_state theState);
/*!
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
* the specified plane by the certain way, defined through \a theState parameter.
* \param theShape Shape to find sub-shapes of.
* \param theShapeType Type of sub-shapes to be retrieved.
* \param theAx1 Vector (or line, or linear edge), specifying normal
* direction and location of the plane to find shapes on.
* \param theState The state of the subshapes to find.
* \return List of IDs of all found sub-shapes.
*/
ListOfLong GetShapesOnPlaneIDs (in GEOM_Object theShape,
in long theShapeType,
in GEOM_Object theAx1,
in shape_state theState);
/*!
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
* the specified cylinder by the certain way, defined through \a theState parameter.
* \param theShape Shape to find sub-shapes of.
* \param theShapeType Type of sub-shapes to be retrieved.
* \param theAxis Vector (or line, or linear edge), specifying
* axis of the cylinder to find shapes on.
* \param theRadius Radius of the cylinder to find shapes on.
* \param theState The state of the subshapes to find.
* \return List of IDs of all found sub-shapes.
*/
ListOfLong GetShapesOnCylinderIDs (in GEOM_Object theShape,
in long theShapeType,
in GEOM_Object theAxis,
in double theRadius,
in shape_state theState);
/*!
* Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
* the specified sphere by the certain way, defined through \a theState parameter.
* \param theShape Shape to find sub-shapes of.
* \param theShapeType Type of sub-shapes to be retrieved.
* \param theCenter Point, specifying center of the sphere to find shapes on.
* \param theRadius Radius of the sphere to find shapes on.
* \param theState The state of the subshapes to find.
* \return List of IDs of all found sub-shapes.
*/
ListOfLong GetShapesOnSphereIDs (in GEOM_Object theShape,
in long theShapeType,
in GEOM_Object theCenter,
in double theRadius,
in shape_state theState);
/*! /*!
* Get sub-shape(s) of theShapeWhere, which are * Get sub-shape(s) of theShapeWhere, which are
* coincident with \a theShapeWhat or could be a part of it. * coincident with \a theShapeWhat or could be a part of it.
@ -1880,6 +1928,20 @@ module GEOM
*/ */
void DifferenceList (in GEOM_Object theGroup, in ListOfGO theSubShapes); void DifferenceList (in GEOM_Object theGroup, in ListOfGO theSubShapes);
/*!
* Adds to the group all the given shapes. No errors, if some shapes are alredy included.
* \param theGroup is a GEOM group to which the new sub shapes are added.
* \param theSubShapes is a list of IDs of sub shapes to be added.
*/
void UnionIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
/*!
* Removes from the group all the given shapes. No errors, if some shapes are not included.
* \param theGroup is a GEOM group from which the sub-shapes are removed.
* \param theSubShapes is a list of IDs of sub-shapes to be removed.
*/
void DifferenceIDs (in GEOM_Object theGroup, in ListOfLong theSubShapes);
/*! /*!
* Returns a type of sub objects stored in the group * Returns a type of sub objects stored in the group
* \param theGroup is a GEOM group which type is returned. * \param theGroup is a GEOM group which type is returned.

View File

@ -14,7 +14,8 @@ uses
TColStd, TColStd,
Geom, Geom,
Bnd, Bnd,
gp, gp,
GeomAdaptor,
TopAbs, TopAbs,
TopoDS, TopoDS,
TopTools, TopTools,
@ -44,10 +45,12 @@ is
class Gluer; class Gluer;
class GlueAnalyser; class GlueAnalyser;
class CoupleOfShapes; class CoupleOfShapes;
class PassKey; class PassKey;
class PassKeyMapHasher; class PassKeyMapHasher;
class PassKeyShape;
class SurfaceTools; class SurfaceTools;
class Tools; class Tools;
-- --
-- finder on -- finder on
deferred class ShapeSolid; deferred class ShapeSolid;
@ -56,10 +59,13 @@ is
class VertexSolid; class VertexSolid;
class SolidSolid; class SolidSolid;
class FinderShapeOn; class FinderShapeOn;
--
class FinderShapeOn1;
class StateCollector;
-- --
-- instantiations -- instantiations
class IndexedDataMapOfPassKeyListOfShape class IndexedDataMapOfPassKeyShapeListOfShape
instantiates IndexedDataMap from TCollection (PassKey from GEOMAlgo, instantiates IndexedDataMap from TCollection (PassKeyShape from GEOMAlgo,
ListOfShape from TopTools, ListOfShape from TopTools,
PassKeyMapHasher from GEOMAlgo); PassKeyMapHasher from GEOMAlgo);
@ -80,5 +86,20 @@ is
instantiates IndexedDataMap from TCollection (Shape from TopoDS, instantiates IndexedDataMap from TCollection (Shape from TopoDS,
State from TopAbs, State from TopAbs,
ShapeMapHasher from TopTools); ShapeMapHasher from TopTools);
--
class ListOfPnt
instantiates List from TCollection (Pnt from gp);
-- class IndexedDataMapOfPassKeyInteger
-- instantiates IndexedDataMap from TCollection (PassKeyRoot from GEOMAlgo,
-- Integer from Standard,
-- PassKeyMapHasher from GEOMAlgo);
class DataMapOfPassKeyInteger
instantiates DataMap from TCollection (PassKey from GEOMAlgo,
Integer from Standard,
PassKeyMapHasher from GEOMAlgo);
end GEOMAlgo; end GEOMAlgo;

View File

@ -19,26 +19,23 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#ifndef _GEOMAlgo_ShapeSolid_HeaderFile #ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger_HeaderFile
#define _GEOMAlgo_ShapeSolid_HeaderFile #define _GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger_HeaderFile
#ifndef _TopTools_ListOfShape_HeaderFile #ifndef _TCollection_BasicMapIterator_HeaderFile
#include <TopTools_ListOfShape.hxx> #include <TCollection_BasicMapIterator.hxx>
#endif #endif
#ifndef _Standard_Integer_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#endif #endif
#ifndef _BOPTools_PDSFiller_HeaderFile #ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_HeaderFile
#include <BOPTools_PDSFiller.hxx> #include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx>
#endif #endif
#ifndef _GEOMAlgo_Algo_HeaderFile class Standard_NoSuchObject;
#include <GEOMAlgo_Algo.hxx> class GEOMAlgo_PassKey;
#endif class GEOMAlgo_PassKeyMapHasher;
#ifndef _TopAbs_State_HeaderFile class GEOMAlgo_DataMapOfPassKeyInteger;
#include <TopAbs_State.hxx> class GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger;
#endif
class BOPTools_DSFiller;
class TopTools_ListOfShape;
#ifndef _Standard_HeaderFile #ifndef _Standard_HeaderFile
@ -48,7 +45,7 @@ class TopTools_ListOfShape;
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#endif #endif
class GEOMAlgo_ShapeSolid : public GEOMAlgo_Algo { class GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger : public TCollection_BasicMapIterator {
public: public:
@ -66,9 +63,11 @@ public:
} }
// Methods PUBLIC // Methods PUBLIC
// //
Standard_EXPORT void SetFiller(const BOPTools_DSFiller& aDSF) ; Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger();
Standard_EXPORT virtual ~GEOMAlgo_ShapeSolid(); Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger(const GEOMAlgo_DataMapOfPassKeyInteger& aMap);
Standard_EXPORT const TopTools_ListOfShape& Shapes(const TopAbs_State aState) const; Standard_EXPORT void Initialize(const GEOMAlgo_DataMapOfPassKeyInteger& aMap) ;
Standard_EXPORT const GEOMAlgo_PassKey& Key() const;
Standard_EXPORT const Standard_Integer& Value() const;
@ -78,18 +77,10 @@ protected:
// Methods PROTECTED // Methods PROTECTED
// //
Standard_EXPORT GEOMAlgo_ShapeSolid();
Standard_EXPORT virtual void BuildResult() = 0;
Standard_EXPORT virtual void Prepare() = 0;
// Fields PROTECTED // Fields PROTECTED
// //
TopTools_ListOfShape myLSIN;
TopTools_ListOfShape myLSOUT;
TopTools_ListOfShape myLSON;
Standard_Integer myRank;
BOPTools_PDSFiller myDSFiller;
private: private:

View File

@ -0,0 +1,56 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
#ifndef _Standard_NoSuchObject_HeaderFile
#include <Standard_NoSuchObject.hxx>
#endif
#ifndef _GEOMAlgo_PassKey_HeaderFile
#include <GEOMAlgo_PassKey.hxx>
#endif
#ifndef _GEOMAlgo_PassKeyMapHasher_HeaderFile
#include <GEOMAlgo_PassKeyMapHasher.hxx>
#endif
#ifndef _GEOMAlgo_DataMapOfPassKeyInteger_HeaderFile
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#endif
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_HeaderFile
#include <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx>
#endif
#define TheKey GEOMAlgo_PassKey
#define TheKey_hxx <GEOMAlgo_PassKey.hxx>
#define TheItem Standard_Integer
#define TheItem_hxx <Standard_Integer.hxx>
#define Hasher GEOMAlgo_PassKeyMapHasher
#define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx>
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx>
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_Type_()
#define TCollection_DataMap GEOMAlgo_DataMapOfPassKeyInteger
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#include <TCollection_DataMapIterator.gxx>

View File

@ -0,0 +1,144 @@
// File generated by CPPExt (Transient)
//
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_HeaderFile
#define _GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_HeaderFile
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx>
#endif
#ifndef _GEOMAlgo_PassKey_HeaderFile
#include <GEOMAlgo_PassKey.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TCollection_MapNode_HeaderFile
#include <TCollection_MapNode.hxx>
#endif
#ifndef _TCollection_MapNodePtr_HeaderFile
#include <TCollection_MapNodePtr.hxx>
#endif
class GEOMAlgo_PassKey;
class GEOMAlgo_PassKeyMapHasher;
class GEOMAlgo_DataMapOfPassKeyInteger;
class GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger;
class GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger : public TCollection_MapNode {
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
//
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger(const GEOMAlgo_PassKey& K,const Standard_Integer& I,const TCollection_MapNodePtr& n);
GEOMAlgo_PassKey& Key() const;
Standard_Integer& Value() const;
Standard_EXPORT ~GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
GEOMAlgo_PassKey myKey;
Standard_Integer myValue;
};
#define TheKey GEOMAlgo_PassKey
#define TheKey_hxx <GEOMAlgo_PassKey.hxx>
#define TheItem Standard_Integer
#define TheItem_hxx <Standard_Integer.hxx>
#define Hasher GEOMAlgo_PassKeyMapHasher
#define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx>
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx>
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_Type_()
#define TCollection_DataMap GEOMAlgo_DataMapOfPassKeyInteger
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#include <TCollection_DataMapNode.lxx>
#undef TheKey
#undef TheKey_hxx
#undef TheItem
#undef TheItem_hxx
#undef Hasher
#undef Hasher_hxx
#undef TCollection_DataMapNode
#undef TCollection_DataMapNode_hxx
#undef TCollection_DataMapIterator
#undef TCollection_DataMapIterator_hxx
#undef Handle_TCollection_DataMapNode
#undef TCollection_DataMapNode_Type_
#undef TCollection_DataMap
#undef TCollection_DataMap_hxx
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,105 @@
// File generated by CPPExt (Transient)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#include <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx>
#ifndef _Standard_TypeMismatch_HeaderFile
#include <Standard_TypeMismatch.hxx>
#endif
#ifndef _GEOMAlgo_PassKey_HeaderFile
#include <GEOMAlgo_PassKey.hxx>
#endif
#ifndef _GEOMAlgo_PassKeyMapHasher_HeaderFile
#include <GEOMAlgo_PassKeyMapHasher.hxx>
#endif
#ifndef _GEOMAlgo_DataMapOfPassKeyInteger_HeaderFile
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#endif
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger_HeaderFile
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
#endif
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger::~GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger() {}
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_Type_()
{
static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TCollection_MapNode);
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
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);
return _aType;
}
// DownCast method
// allow safe downcasting
//
const Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger) Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger))) {
_anOtherObject = Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)((Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)&)AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger::DynamicType() const
{
return STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger) ;
}
Standard_Boolean GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger::IsKind(const Handle(Standard_Type)& AType) const
{
return (STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger) == AType || TCollection_MapNode::IsKind(AType));
}
Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger::~Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger() {}
#define TheKey GEOMAlgo_PassKey
#define TheKey_hxx <GEOMAlgo_PassKey.hxx>
#define TheItem Standard_Integer
#define TheItem_hxx <Standard_Integer.hxx>
#define Hasher GEOMAlgo_PassKeyMapHasher
#define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx>
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx>
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_Type_()
#define TCollection_DataMap GEOMAlgo_DataMapOfPassKeyInteger
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#include <TCollection_DataMapNode.gxx>

View File

@ -0,0 +1,135 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#ifndef _GEOMAlgo_DataMapOfPassKeyInteger_HeaderFile
#define _GEOMAlgo_DataMapOfPassKeyInteger_HeaderFile
#ifndef _TCollection_BasicMap_HeaderFile
#include <TCollection_BasicMap.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_HeaderFile
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
class Standard_DomainError;
class Standard_NoSuchObject;
class GEOMAlgo_PassKey;
class GEOMAlgo_PassKeyMapHasher;
class GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger;
class GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class GEOMAlgo_DataMapOfPassKeyInteger : public TCollection_BasicMap {
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
//
Standard_EXPORT GEOMAlgo_DataMapOfPassKeyInteger(const Standard_Integer NbBuckets = 1);
Standard_EXPORT GEOMAlgo_DataMapOfPassKeyInteger& Assign(const GEOMAlgo_DataMapOfPassKeyInteger& Other) ;
GEOMAlgo_DataMapOfPassKeyInteger& operator =(const GEOMAlgo_DataMapOfPassKeyInteger& Other)
{
return Assign(Other);
}
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
Standard_EXPORT void Clear() ;
~GEOMAlgo_DataMapOfPassKeyInteger()
{
Clear();
}
Standard_EXPORT Standard_Boolean Bind(const GEOMAlgo_PassKey& K,const Standard_Integer& I) ;
Standard_EXPORT Standard_Boolean IsBound(const GEOMAlgo_PassKey& K) const;
Standard_EXPORT Standard_Boolean UnBind(const GEOMAlgo_PassKey& K) ;
Standard_EXPORT const Standard_Integer& Find(const GEOMAlgo_PassKey& K) const;
const Standard_Integer& operator()(const GEOMAlgo_PassKey& K) const
{
return Find(K);
}
Standard_EXPORT Standard_Integer& ChangeFind(const GEOMAlgo_PassKey& K) ;
Standard_Integer& operator()(const GEOMAlgo_PassKey& K)
{
return ChangeFind(K);
}
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
Standard_EXPORT GEOMAlgo_DataMapOfPassKeyInteger(const GEOMAlgo_DataMapOfPassKeyInteger& Other);
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,59 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#ifndef _Standard_DomainError_HeaderFile
#include <Standard_DomainError.hxx>
#endif
#ifndef _Standard_NoSuchObject_HeaderFile
#include <Standard_NoSuchObject.hxx>
#endif
#ifndef _GEOMAlgo_PassKey_HeaderFile
#include <GEOMAlgo_PassKey.hxx>
#endif
#ifndef _GEOMAlgo_PassKeyMapHasher_HeaderFile
#include <GEOMAlgo_PassKeyMapHasher.hxx>
#endif
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_HeaderFile
#include <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx>
#endif
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger_HeaderFile
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
#endif
#define TheKey GEOMAlgo_PassKey
#define TheKey_hxx <GEOMAlgo_PassKey.hxx>
#define TheItem Standard_Integer
#define TheItem_hxx <Standard_Integer.hxx>
#define Hasher GEOMAlgo_PassKeyMapHasher
#define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx>
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx>
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_Type_()
#define TCollection_DataMap GEOMAlgo_DataMapOfPassKeyInteger
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#include <TCollection_DataMap.gxx>

View File

@ -1,96 +0,0 @@
-- File: GEOMAlgo_FinderShapeOn.cdl
-- Created: Tue Jan 11 14:35:52 2005
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright: Matra Datavision 2005
class FinderShapeOn from GEOMAlgo
inherits ShapeAlgo from GEOMAlgo
---Purpose:
uses
Surface from Geom,
ShapeEnum from TopAbs,
ListOfShape from TopTools,
DataMapOfShapeShape from TopTools,
Shape from TopoDS,
State from GEOMAlgo,
IndexedDataMapOfShapeState from GEOMAlgo
--raises
is
Create
returns FinderShapeOn from GEOMAlgo;
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn();"
Perform(me:out)
is redefined;
SetSurface(me:out;
aS:Surface from Geom);
SetShapeType(me:out;
aST:ShapeEnum from TopAbs);
SetState(me:out;
aSF:State from GEOMAlgo);
Surface(me)
returns Surface from Geom;
---C++: return const &
ShapeType(me)
returns ShapeEnum from TopAbs;
State(me)
returns State from GEOMAlgo;
Shapes(me)
returns ListOfShape from TopTools;
---C++: return const &
--
-- protected methods
--
CheckData(me:out)
is redefined protected;
MakeArgument1(me:out)
is protected;
MakeArgument2(me:out)
is protected;
Find(me:out)
is protected;
Find(me:out;
aS:Shape from TopoDS)
is protected;
FindVertices(me:out)
is protected;
CopySource(myclass;
aS :Shape from TopoDS;
aImages : out DataMapOfShapeShape from TopTools;
aOriginals: out DataMapOfShapeShape from TopTools;
aSC : out Shape from TopoDS);
fields
mySurface : Surface from Geom is protected;
myShapeType : ShapeEnum from TopAbs is protected;
myState : State from GEOMAlgo is protected;
myArg1 : Shape from TopoDS is protected;
myArg2 : Shape from TopoDS is protected;
myLS : ListOfShape from TopTools is protected;
myImages : DataMapOfShapeShape from TopTools is protected;
myMSS : IndexedDataMapOfShapeState from GEOMAlgo is protected;
myIsAnalytic : Boolean from Standard is protected;
end FinderShapeOn;

View File

@ -1,528 +0,0 @@
// File: GEOMAlgo_FinderShapeOn.cxx
// Created: Tue Jan 11 14:44:31 2005
// Author: Peter KURNEV
// <pkv@irinox>
#include <GEOMAlgo_FinderShapeOn.ixx>
#include <gp_Pnt.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepLib_MakeFace.hxx>
#include <BRepLib_FaceError.hxx>
#include <BOPTools_DSFiller.hxx>
#include <GEOMAlgo_WireSolid.hxx>
#include <GEOMAlgo_ShellSolid.hxx>
#include <GEOMAlgo_VertexSolid.hxx>
#include <GEOMAlgo_ShapeSolid.hxx>
#include <GEOMAlgo_SolidSolid.hxx>
#include <GEOMAlgo_SurfaceTools.hxx>
#include <GEOMAlgo_Tools.hxx>
//=======================================================================
//function : GEOMAlgo_FinderShapeOn
//purpose :
//=======================================================================
GEOMAlgo_FinderShapeOn::GEOMAlgo_FinderShapeOn()
:
GEOMAlgo_ShapeAlgo()
{
myTolerance=0.0001;
myShapeType=TopAbs_VERTEX;
myState=GEOMAlgo_ST_UNKNOWN;
myIsAnalytic=Standard_True;
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
GEOMAlgo_FinderShapeOn::~GEOMAlgo_FinderShapeOn()
{
}
//=======================================================================
//function : SetSurface
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::SetSurface(const Handle(Geom_Surface)& aS)
{
mySurface=aS;
}
//=======================================================================
//function : Surface
//purpose :
//=======================================================================
const Handle(Geom_Surface)& GEOMAlgo_FinderShapeOn::Surface() const
{
return mySurface;
}
//=======================================================================
//function : SetShapeType
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::SetShapeType(const TopAbs_ShapeEnum aType)
{
myShapeType=aType;
}
//=======================================================================
//function : ShapeType
//purpose :
//=======================================================================
TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn::ShapeType()const
{
return myShapeType;
}
//=======================================================================
//function : SetState
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::SetState(const GEOMAlgo_State aState)
{
myState=aState;
}
//=======================================================================
//function : State
//purpose :
//=======================================================================
GEOMAlgo_State GEOMAlgo_FinderShapeOn::State() const
{
return myState;
}
//=======================================================================
// function: Shapes
// purpose:
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_FinderShapeOn::Shapes() const
{
Standard_Boolean bIsConformState;
Standard_Integer i, aNb;
TopAbs_State aSt;
TopTools_ListOfShape* pL;
//
pL=(TopTools_ListOfShape*) &myLS;
pL->Clear();
//
aNb=myMSS.Extent();
for (i=1; i<=aNb; ++i) {
const TopoDS_Shape& aS=myMSS.FindKey(i);
aSt=myMSS.FindFromIndex(i);
//
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
if (bIsConformState) {
pL->Append(aS);
}
}
return myLS;
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::Perform()
{
myErrorStatus=0;
myWarningStatus=0;
myLS.Clear();
myMSS.Clear();
//
if (!myResult.IsNull()){
myResult.Nullify();
}
//
CheckData();
if(myErrorStatus) {
return;
}
//
myIsAnalytic=GEOMAlgo_SurfaceTools::IsAnalytic(mySurface);
//
MakeArgument1();
if(myErrorStatus) {
return;
}
//
if (myIsAnalytic && myShapeType==TopAbs_VERTEX) {
FindVertices();
return;
}
//
MakeArgument2();
if(myErrorStatus) {
return;
}
//
Find();
if(myErrorStatus || myWarningStatus) {
return;
}
//
}
//=======================================================================
//function : FindVertices
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::FindVertices()
{
Standard_Integer i, aNb, iErr;
TopAbs_State aSt;
TopAbs_Orientation aOr;
gp_Pnt aP;
TopTools_IndexedMapOfShape aM;
//
TopExp::MapShapes(myArg1, TopAbs_FACE, aM);
const TopoDS_Face& aF=TopoDS::Face(aM(1));
aOr=aF.Orientation();
//
aM.Clear();
TopExp::MapShapes(myShape, myShapeType, aM);
aNb=aM.Extent();
if (!aNb) {
myWarningStatus=10; // No found subshapes of type myShapeType
return;
}
//
for (i=1; i<=aNb; ++i) {
const TopoDS_Shape& aS=aM(i);
const TopoDS_Vertex& aV=TopoDS::Vertex(aS);
aP=BRep_Tool::Pnt(aV);
iErr=GEOMAlgo_SurfaceTools::GetState(aP, mySurface, myTolerance, aSt);
if (aOr==TopAbs_REVERSED) {
aSt=GEOMAlgo_SurfaceTools::ReverseState(aSt);
}
myMSS.Add(aS, aSt);
}
}
//=======================================================================
//function : Find
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::Find()
{
Standard_Integer i, aNb;
Standard_Boolean bICS;
TopTools_IndexedMapOfShape aM;
//
TopExp::MapShapes(myArg2, myShapeType, aM);
//
aNb=aM.Extent();
if (!aNb) {
myWarningStatus=10; // No found subshapes of type myShapeType
return;
}
//
bICS=GEOMAlgo_Tools::IsCompositeShape(myArg2);
if (!bICS || myIsAnalytic) {
TopoDS_Compound aCmp;
BRep_Builder aBB;
//
aBB.MakeCompound(aCmp);
for (i=1; i<=aNb; ++i) {
const TopoDS_Shape& aSi=aM(i);
aBB.Add(aCmp, aSi);
}
//
aM.Clear();
aM.Add(aCmp);
aNb=1;
}
//
for (i=1; i<=aNb; ++i) {
const TopoDS_Shape& aS=aM(i);
Find(aS);
if (myErrorStatus) {
return;
}
}
}
//=======================================================================
//function : Find
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::Find(const TopoDS_Shape& aS)
{
myErrorStatus=0;
//
Standard_Boolean bIsDone;
Standard_Integer i, iErr;
TopAbs_State aSts[]={TopAbs_IN, TopAbs_OUT, TopAbs_ON};
TopTools_ListIteratorOfListOfShape aIt;
BOPTools_DSFiller aDF;
//
// 1. Prepare DSFiller
aDF.SetShapes (myArg1, aS);
bIsDone=aDF.IsDone();
if (!bIsDone) {
myErrorStatus=30; // wrong args are used for DSFiller
return;
}
aDF.Perform();
bIsDone=aDF.IsDone();
if (!bIsDone) {
myErrorStatus=31; // DSFiller failed
return;
}
//
// 2. Find shapes
GEOMAlgo_ShapeSolid* pSS;
GEOMAlgo_VertexSolid aVXS;
GEOMAlgo_WireSolid aWRS;
GEOMAlgo_ShellSolid aSHS;
GEOMAlgo_SolidSolid aSLS;
//
pSS=NULL;
//
switch (myShapeType) {
case TopAbs_VERTEX:
pSS=&aVXS;
break;
case TopAbs_EDGE:
pSS=&aWRS;
break;
case TopAbs_FACE:
pSS=&aSHS;
break;
case TopAbs_SOLID:
aSLS.SetShape2(myArg2);
pSS=&aSLS;
break;
default:
myErrorStatus=12; // unallowed subshape type
return;
}
//
pSS->SetFiller(aDF);
pSS->Perform();
iErr=pSS->ErrorStatus();
if (iErr) {
myErrorStatus=32; // builder ShapeSolid failed
return;
}
//
for (i=0; i<3; ++i) {
const TopTools_ListOfShape& aLS=pSS->Shapes(aSts[i]);
aIt.Initialize(aLS);
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]);
}
else {
myErrorStatus=33;// can not find original shape
return;
}
}
}
}
//=======================================================================
//function : MakeArgument1
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::MakeArgument1()
{
myErrorStatus=0;
//
Standard_Integer i, aNb;
TopAbs_ShapeEnum aType;
BRepLib_FaceError aFErr;
BRepLib_MakeFace aMF;
TopTools_IndexedMapOfShape aM;
BRep_Builder aBB;
TopoDS_Face aFace;
TopoDS_Shell aSh;
TopoDS_Solid aSd;
//
// Argument 1
if (!myIsAnalytic) {
aMF.Init(mySurface, Standard_True);
aFErr=aMF.Error();
if (aFErr!=BRepLib_FaceDone) {
myErrorStatus=20; // can not build the face
return;
}
//
const TopoDS_Shape& aF=aMF.Shape();
aFace=TopoDS::Face(aF);
//
// update tolerances
aM.Add(aF);
TopExp::MapShapes(aF, TopAbs_VERTEX, aM);
TopExp::MapShapes(aF, TopAbs_EDGE, aM);
aNb=aM.Extent();
for (i=1; i<=aNb; ++i) {
const TopoDS_Shape& aS=aM(i);
aType=aS.ShapeType();
switch (aType) {
case TopAbs_VERTEX: {
const TopoDS_Vertex& aVx=TopoDS::Vertex(aS);
aBB.UpdateVertex(aVx, myTolerance);
}
break;
case TopAbs_EDGE: {
const TopoDS_Edge& aEx=TopoDS::Edge(aS);
aBB.UpdateEdge(aEx, myTolerance);
}
break;
case TopAbs_FACE: {
const TopoDS_Face& aFx=TopoDS::Face(aS);
aBB.UpdateFace(aFx, myTolerance);
}
break;
default:
break;
}
}
} //
else {
aBB.MakeFace(aFace, mySurface, myTolerance);
}
//
// make solid
aBB.MakeShell(aSh);
aBB.Add(aSh, aFace);
aBB.MakeSolid(aSd);
aBB.Add(aSd, aSh);
myArg1=aSd;
}
//=======================================================================
//function : MakeArgument2
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::MakeArgument2()
{
myErrorStatus=0;
//
TopoDS_Shape aSC;
TopTools_DataMapOfShapeShape aOriginals;
//
myImages.Clear();
//
GEOMAlgo_FinderShapeOn::CopySource(myShape, myImages, aOriginals, aSC);
//
myArg2=aSC;
}
//=======================================================================
//function : CheckData
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::CheckData()
{
myErrorStatus=0;
//
if(mySurface.IsNull()) {
myErrorStatus=10; // mySurface=NULL
return;
}
//
if (myShape.IsNull()) {
myErrorStatus=11; // myShape=NULL
return;
}
//
if (!(myShapeType==TopAbs_VERTEX ||
myShapeType==TopAbs_EDGE ||
myShapeType==TopAbs_FACE ||
myShapeType==TopAbs_SOLID)) {
myErrorStatus=12; // unallowed subshape type
return;
}
//
if (myState==GEOMAlgo_ST_UNKNOWN ||
myState==GEOMAlgo_ST_INOUT) {
myErrorStatus=13; // unallowed state type
return;
}
}
//
//=======================================================================
//function : CopySource
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn::CopySource(const TopoDS_Shape& aE,
TopTools_DataMapOfShapeShape& aImages,
TopTools_DataMapOfShapeShape& aOriginals,
TopoDS_Shape& aEx)
{
Standard_Boolean bFree;
TopAbs_ShapeEnum aType;
Standard_Integer aR;
BRep_Builder BB;
TopoDS_Iterator aIt;
//
aType=aE.ShapeType();
//
if (aOriginals.IsBound(aE)) {
aEx=aOriginals.ChangeFind(aE);
return;
}
else {
aEx=aE.EmptyCopied();
aOriginals.Bind(aE, aEx);
aImages.Bind(aEx, aE);
}
//
aR=(Standard_Integer)aType+1;
if (aR>TopAbs_VERTEX) {
return;
}
//
bFree=aEx.Free();
aEx.Free(Standard_True);
//
aType=(TopAbs_ShapeEnum) aR;
//
aIt.Initialize(aE);//, Standard_False);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aV=aIt.Value();
TopoDS_Shape aVx;
//
CopySource (aV, aImages, aOriginals, aVx);
//
aVx.Orientation(aV.Orientation());
BB.Add(aEx, aVx);
}
//
aEx.Free(bFree);
}
//
// myErrorStatus :
//
// 10 -mySurface=NULL
// 11 -myShape=NULL
// 12 -unallowed type of subshapes
// 13 -unallowed state
// 20 -can not build the face
// 30 -wrong args are used for DSFiller
// 31 -DSFiller failed
// 32 -builder ShapeSolid failed
// 33 -can not find original shape
//
// myWarningStatus
//
// 10 -subshapes of type myShapeType can not be fond in myShape

View File

@ -1,26 +0,0 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#include <GEOMAlgo_FinderShapeOn.jxx>

View File

@ -1,15 +0,0 @@
#ifndef _Geom_Surface_HeaderFile
#include <Geom_Surface.hxx>
#endif
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopTools_DataMapOfShapeShape_HeaderFile
#include <TopTools_DataMapOfShapeShape.hxx>
#endif
#ifndef _GEOMAlgo_FinderShapeOn_HeaderFile
#include <GEOMAlgo_FinderShapeOn.hxx>
#endif

View File

@ -0,0 +1,120 @@
-- File: GEOMAlgo_FinderShapeOn1.cdl
-- Created: Fri Mar 4 10:26:54 2005
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright: Matra Datavision 2005
class FinderShapeOn1 from GEOMAlgo
inherits ShapeAlgo from GEOMAlgo
---Purpose:
uses
Surface from Geom,
Surface from GeomAdaptor,
ShapeEnum from TopAbs,
Face from TopoDS,
Edge from TopoDS,
ListOfShape from TopTools,
State from GEOMAlgo,
ListOfPnt from GEOMAlgo,
IndexedDataMapOfShapeState from GEOMAlgo
--raises
is
Create
returns FinderShapeOn1 from GEOMAlgo;
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn1();"
SetSurface(me:out;
aS:Surface from Geom);
SetShapeType(me:out;
aST:ShapeEnum from TopAbs);
SetState(me:out;
aSF:State from GEOMAlgo);
SetNbPntsMin(me:out;
aNb:Integer from Standard);
NbPntsMin(me)
returns Integer from Standard;
SetNbPntsMax(me:out;
aNb:Integer from Standard);
NbPntsMax(me)
returns Integer from Standard;
Surface(me)
returns Surface from Geom;
---C++: return const &
ShapeType(me)
returns ShapeEnum from TopAbs;
State(me)
returns State from GEOMAlgo;
Perform(me:out)
is redefined;
Shapes(me)
returns ListOfShape from TopTools;
---C++: return const &
--
-- protected methods
--
CheckData(me:out)
is redefined protected;
ProcessVertices(me:out)
is protected;
ProcessEdges(me:out)
is protected;
ProcessFaces(me:out)
is protected;
ProcessSolids(me:out)
is protected;
InnerPoints(me:out;
aF :Face from TopoDS;
aLP:out ListOfPnt from GEOMAlgo)
is protected;
InnerPoints(me:out;
aE :Edge from TopoDS;
aLP:out ListOfPnt from GEOMAlgo)
is protected;
InnerPoints(me:out;
aE :Edge from TopoDS;
aNbPnts: Integer from Standard;
aLP:out ListOfPnt from GEOMAlgo)
is protected;
MSS (me)
returns IndexedDataMapOfShapeState from GEOMAlgo;
---C++:return const &
fields
mySurface : Surface from Geom is protected;
myShapeType : ShapeEnum from TopAbs is protected;
myState : State from GEOMAlgo is protected;
myNbPntsMin : Integer from Standard is protected;
myNbPntsMax : Integer from Standard is protected;
--
myGAS : Surface from GeomAdaptor is protected;
myLS : ListOfShape from TopTools is protected;
--
myMSS : IndexedDataMapOfShapeState from GEOMAlgo is protected;
end FinderShapeOn1;

View File

@ -0,0 +1,822 @@
// File: GEOMAlgo_FinderShapeOn1.cxx
// Created: Fri Mar 4 10:31:06 2005
// Author: Peter KURNEV
// <pkv@irinox>
#include <GEOMAlgo_FinderShapeOn1.ixx>
#include <math.h>
#include <Precision.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <gp_Trsf.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Pnt.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <Poly_Array1OfTriangle.hxx>
#include <Poly_Triangle.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <Poly_Triangulation.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomAbs_SurfaceType.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAbs_CurveType.hxx>
#include <TopAbs_State.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRep_Tool.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#include <GEOMAlgo_PassKey.hxx>
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
#include <GEOMAlgo_SurfaceTools.hxx>
#include <GEOMAlgo_StateCollector.hxx>
//=======================================================================
//function : GEOMAlgo_FinderShapeOn1
//purpose :
//=======================================================================
GEOMAlgo_FinderShapeOn1::GEOMAlgo_FinderShapeOn1()
:
GEOMAlgo_ShapeAlgo()
{
myTolerance=0.0001;
myShapeType=TopAbs_VERTEX;
myState=GEOMAlgo_ST_UNKNOWN;
myNbPntsMin=3;
myNbPntsMax=0;
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
GEOMAlgo_FinderShapeOn1::~GEOMAlgo_FinderShapeOn1()
{
}
//=======================================================================
//function : SetSurface
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::SetSurface(const Handle(Geom_Surface)& aS)
{
mySurface=aS;
}
//=======================================================================
//function : Surface
//purpose :
//=======================================================================
const Handle(Geom_Surface)& GEOMAlgo_FinderShapeOn1::Surface() const
{
return mySurface;
}
//=======================================================================
//function : SetShapeType
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::SetShapeType(const TopAbs_ShapeEnum aType)
{
myShapeType=aType;
}
//=======================================================================
//function : ShapeType
//purpose :
//=======================================================================
TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn1::ShapeType()const
{
return myShapeType;
}
//=======================================================================
//function : SetState
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::SetState(const GEOMAlgo_State aState)
{
myState=aState;
}
//=======================================================================
//function : State
//purpose :
//=======================================================================
GEOMAlgo_State GEOMAlgo_FinderShapeOn1::State() const
{
return myState;
}
//=======================================================================
//function : SetNbPntsMin
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::SetNbPntsMin(const Standard_Integer aNb)
{
myNbPntsMin=aNb;
}
//=======================================================================
//function : NbPntsMin
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_FinderShapeOn1::NbPntsMin()const
{
return myNbPntsMin;
}
//=======================================================================
//function : SetNbPntsMax
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::SetNbPntsMax(const Standard_Integer aNb)
{
myNbPntsMax=aNb;
}
//=======================================================================
//function : NbPntsMax
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_FinderShapeOn1::NbPntsMax()const
{
return myNbPntsMax;
}
//=======================================================================
// function: MSS
// purpose:
//=======================================================================
const GEOMAlgo_IndexedDataMapOfShapeState& GEOMAlgo_FinderShapeOn1::MSS() const
{
return myMSS;
}
//=======================================================================
// function: Shapes
// purpose:
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_FinderShapeOn1::Shapes() const
{
Standard_Integer i, aNb;
TopTools_ListOfShape* pL;
//
pL=(TopTools_ListOfShape*) &myLS;
pL->Clear();
//
aNb=myMSS.Extent();
for (i=1; i<=aNb; ++i) {
const TopoDS_Shape& aS=myMSS.FindKey(i);
if (aS.ShapeType()==myShapeType) {
pL->Append(aS);
}
}
return myLS;
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::Perform()
{
myErrorStatus=0;
myWarningStatus=0;
myLS.Clear();
myMSS.Clear();
//
CheckData();
if(myErrorStatus) {
return;
}
//
// 1
ProcessVertices();
if(myErrorStatus) {
return;
}
if (myShapeType==TopAbs_VERTEX) {
return;
}
//
// 2
ProcessEdges();
if(myErrorStatus) {
return;
}
if (myShapeType==TopAbs_EDGE) {
return;
}
//
// 3
ProcessFaces();
if(myErrorStatus) {
return;
}
if (myShapeType==TopAbs_FACE) {
return;
}
//
// 4
ProcessSolids();
//
}
//=======================================================================
//function : ProcessVertices
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::ProcessVertices()
{
myErrorStatus=0;
//
Standard_Boolean bIsConformState;
Standard_Integer i, aNb;
gp_Pnt aP;
TopTools_IndexedMapOfShape aM;
TopAbs_State aSt;
//
TopExp::MapShapes(myShape, TopAbs_VERTEX, aM);
aNb=aM.Extent();
for (i=1; i<=aNb; ++i) {
const TopoDS_Vertex& aV=TopoDS::Vertex(aM(i));
aP=BRep_Tool::Pnt(aV);
//
GEOMAlgo_SurfaceTools::GetState(aP, myGAS, myTolerance, aSt);
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
//
if (myShapeType==TopAbs_VERTEX){
if (bIsConformState) {
myMSS.Add(aV, aSt);
}
}
else if (bIsConformState || aSt==TopAbs_ON) {
myMSS.Add(aV, aSt);
}
}
}
//=======================================================================
//function : ProcessEdges
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::ProcessEdges()
{
myErrorStatus=0;
//
Standard_Boolean bIsConformState, bIsToBreak;
Standard_Integer i, aNb, iCnt;
TopAbs_State aSt;
TopTools_IndexedMapOfShape aM;
TopExp_Explorer aExp;
GEOMAlgo_ListIteratorOfListOfPnt aIt;
GeomAbs_SurfaceType aType1;
//
aType1=myGAS.GetType();
//
TopExp::MapShapes(myShape, TopAbs_EDGE, aM);
aNb=aM.Extent();
for (i=1; i<=aNb; ++i) {
GEOMAlgo_ListOfPnt aLP;
GEOMAlgo_StateCollector aSC;
//
const TopoDS_Edge& aE=TopoDS::Edge(aM(i));
//
aExp.Init(aE, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aV=aExp.Current();
//
bIsConformState=myMSS.Contains(aV);
if (!bIsConformState) {
break;// vertex has non-conformed state
}
else {
aSt=myMSS.FindFromKey(aV);
aSC.AppendState(aSt);
}
}
//
if (!bIsConformState) {
continue; // vertex has non-conformed state,skip edge
}
//
if (BRep_Tool::Degenerated(aE)) {
myMSS.Add(aE, aSt);
continue;
}
//
if (myState==GEOMAlgo_ST_ON && aType1==GeomAbs_Sphere) {
Standard_Real aT1, aT2;
Handle(Geom_Curve) aC;
GeomAdaptor_Curve aGAC;
GeomAbs_CurveType aType2;
//
aC=BRep_Tool::Curve(aE, aT1, aT2);
aGAC.Load(aC);
//
aType2=aGAC.GetType();
if (aType2==GeomAbs_Line) {
continue;
}
}
//
InnerPoints(aE, aLP);
if (myErrorStatus) {
return;
}
//
bIsConformState=Standard_True;
aIt.Initialize(aLP);
for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
if (myNbPntsMax) {
if (iCnt > myNbPntsMax) {
break;
}
}
//
const gp_Pnt& aP=aIt.Value();
GEOMAlgo_SurfaceTools::GetState(aP, myGAS, myTolerance, aSt);
bIsToBreak=aSC.AppendState(aSt);
if (bIsToBreak) {
break;
}
}
//
aSt=aSC.State();
//
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
if (myShapeType==TopAbs_EDGE) {
if (bIsConformState) {
myMSS.Add(aE, aSt);
}
}
else if (bIsConformState || aSt==TopAbs_ON) {
myMSS.Add(aE, aSt);
}
} // for (i=1; i<=aNb; ++i) next edge
}
//=======================================================================
//function : ProcessFaces
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::ProcessFaces()
{
myErrorStatus=0;
//
Standard_Boolean bIsConformState, bIsToBreak;
Standard_Integer i, aNbF, iCnt;
TopAbs_State aSt;
TopTools_IndexedMapOfShape aM;
TopExp_Explorer aExp;
GEOMAlgo_ListIteratorOfListOfPnt aIt;
GeomAbs_SurfaceType aType1, aType2;
//
aType1=myGAS.GetType();
//
TopExp::MapShapes(myShape, TopAbs_FACE, aM);
aNbF=aM.Extent();
for (i=1; i<=aNbF; ++i) {
GEOMAlgo_StateCollector aSC;
GEOMAlgo_ListOfPnt aLP;
//
const TopoDS_Face& aF=TopoDS::Face(aM(i));
//
if (myState==GEOMAlgo_ST_ON) {
Handle(Geom_Surface) aS;
GeomAdaptor_Surface aGAS;
//
aS=BRep_Tool::Surface(aF);
aGAS.Load(aS);
aType2=aGAS.GetType();
if (aType2!=aType1) {
continue;
}
}
//
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aE=aExp.Current();
bIsConformState=myMSS.Contains(aE);
if (!bIsConformState) {
break;// edge has non-conformed state
}
else {
aSt=myMSS.FindFromKey(aE);
aSC.AppendState(aSt);
}
}
//
if (!bIsConformState) {
continue; // edge has non-conformed state,skip face
}
//
InnerPoints(aF, aLP);
if (myErrorStatus) {
return;
}
//
bIsConformState=Standard_True;
aIt.Initialize(aLP);
for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
if (myNbPntsMax) {
if (iCnt > myNbPntsMax) {
break;
}
}
//
const gp_Pnt& aP=aIt.Value();
GEOMAlgo_SurfaceTools::GetState(aP, myGAS, myTolerance, aSt);
bIsToBreak=aSC.AppendState(aSt);
if (bIsToBreak) {
break;
}
}
//
aSt=aSC.State();
//
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
if (myShapeType==TopAbs_FACE) {
if (bIsConformState) {
myMSS.Add(aF, aSt);
}
}
else if (bIsConformState || aSt==TopAbs_ON) {
myMSS.Add(aF, aSt);
}
}// for (i=1; i<=aNb; ++i) next face
}
//=======================================================================
//function : ProcessSolids
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::ProcessSolids()
{
myErrorStatus=0;
//
Standard_Boolean bIsConformState;
Standard_Integer i, aNbS, j, aNbF;
TopTools_IndexedMapOfShape aM, aMF;
TopAbs_State aSt;
//
TopExp::MapShapes(myShape, TopAbs_SOLID, aM);
aNbS=aM.Extent();
for (i=1; i<=aNbS; ++i) {
GEOMAlgo_StateCollector aSC;
//
const TopoDS_Shape& aSd=aM(i);
aMF.Clear();
TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
aNbF=aMF.Extent();
for (j=1; j<=aNbF; ++j) {
const TopoDS_Shape& aF=aMF(j);
bIsConformState=myMSS.Contains(aF);
if (!bIsConformState) {
break;// face has non-conformed state
}
else {
aSt=myMSS.FindFromKey(aF);
aSC.AppendState(aSt);
}
}
//
if (!bIsConformState) {
continue; // face has non-conformed state,skip solid
}
//
aSt=aSC.State();
//
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
if (bIsConformState) {
myMSS.Add(aSd, aSt);
}
}
}
//
//=======================================================================
//function : InnerPoints
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Face& aF,
GEOMAlgo_ListOfPnt& aLP)
{
myErrorStatus=0;
//
Standard_Integer j, j1, j2, k, n[4], aNbLinks, aNx, aNbMax, aNb;
Standard_Integer iCnt, *pIds;
TopLoc_Location aLoc;
Handle(Poly_Triangulation) aTRF;
TColStd_MapOfInteger aMBN;
GEOMAlgo_DataMapOfPassKeyInteger aMPKI;
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger aIt;
gp_Pnt aP, aP1, aP2;
//
aLP.Clear();
//
aTRF=BRep_Tool::Triangulation(aF, aLoc);
if (aTRF.IsNull()) {
myErrorStatus=20; // no triangulation found
return;
}
//
const gp_Trsf& aTrsf=aLoc.Transformation();
const Poly_Array1OfTriangle& aTrs=aTRF->Triangles();
const TColgp_Array1OfPnt& aNodes=aTRF->Nodes();
//
// map link/nbtriangles
j1=aTrs.Lower();
j2=aTrs.Upper();
for (j=j1; j<=j2; ++j) {
const Poly_Triangle& aTr=aTrs(j);
aTr.Get(n[0], n[1], n[2]);
n[3]=n[0];
for (k=0; k<3; ++k) {
GEOMAlgo_PassKey aPK;
//
aPK.SetIds(n[k], n[k+1]);
if (aMPKI.IsBound(aPK)) {
Standard_Integer& iCntX=aMPKI.ChangeFind(aPK);
++iCntX;
}
else {
aMPKI.Bind(aPK, 1);
}
}
}
//
// boundary nodes aMBN
aNbLinks=aMPKI.Extent();
aIt.Initialize(aMPKI);
for (; aIt.More(); aIt.Next()) {
iCnt=aIt.Value();
if (iCnt==1) {
const GEOMAlgo_PassKey& aPK=aIt.Key();
aNbMax=aPK.NbMax();
pIds=(Standard_Integer*)aPK.Key();
for (k=1; k<3; ++k) {
aNx=*(pIds+aNbMax-k);
aMBN.Add(aNx);
}
}
}
//
// inner nodes=all_nodes - boundary_nodes
j1=aNodes.Lower();
j2=aNodes.Upper();
for (j=j1; j<=j2; ++j) {
if (!aMBN.Contains(j)) {
aP=aNodes(j).Transformed(aTrsf);
aLP.Append(aP);
}
}
//
aNb=aLP.Extent();
//
if (!aNb && myNbPntsMin) {
// try to fill it yourself
Standard_Boolean bIsDone;
Standard_Integer aN1, aN2;
Handle(Geom_Surface) aS;
GeomAdaptor_Surface aGAS;
GeomAbs_SurfaceType aType;
//
aS=BRep_Tool::Surface(aF);
aGAS.Load(aS);
aType=aGAS.GetType();
if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) {
// inner links
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();
aNbMax=aPK.NbMax();
pIds=(Standard_Integer*)aPK.Key();
aN1=*(pIds+aNbMax-1);
aN2=*(pIds+aNbMax-2);
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) {
}
//=======================================================================
//function : InnerPoints
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
GEOMAlgo_ListOfPnt& aLP)
{
myErrorStatus=0;
//
Standard_Integer j, aNbNodes, aIndex, aNb;
Handle(Poly_PolygonOnTriangulation) aPTE;
Handle(Poly_Triangulation) aTRE;
TopLoc_Location aLoc;
gp_Pnt aP;
//
aLP.Clear();
BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc);
if (aTRE.IsNull() || aPTE.IsNull()) {
myErrorStatus=20; // no triangulation found
return;
}
//
const gp_Trsf& aTrsf=aLoc.Transformation();
const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
//
aNbNodes=aPTE->NbNodes();
const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
for (j=2; j<aNbNodes; ++j) {
aIndex=aInds(j);
aP=aNodes(aIndex).Transformed(aTrsf);
aLP.Append(aP);
}
//
aNb=aLP.Extent();
if (!aNb && myNbPntsMin) {
// try to fill it yourself
InnerPoints(aE, myNbPntsMin, aLP);
aNb=aLP.Extent();
}
}
//=======================================================================
//function : InnerPoints
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
const Standard_Integer aNbPntsMin,
GEOMAlgo_ListOfPnt& aLP)
{
// try to fill it yourself
Standard_Boolean bInf1, bInf2;
Standard_Integer j, aNbT;
Standard_Real dT, aT, aT1, aT2;
gp_Pnt aP;
Handle(Geom_Curve) aC3D;
//
aC3D=BRep_Tool::Curve(aE, aT1, aT2);
if (aC3D.IsNull()) {
return;
}
//
bInf1=Precision::IsNegativeInfinite(aT1);
bInf2=Precision::IsPositiveInfinite(aT2);
if (bInf1 || bInf2) {
return;
}
//
aNbT=myNbPntsMin+1;
dT=(aT2-aT1)/aNbT;
for (j=1; j<=aNbPntsMin; ++j) {
aT=aT1+j*dT;
aC3D->D0(aT, aP);
aLP.Append(aP);
}
}
//=======================================================================
//function : CheckData
//purpose :
//=======================================================================
void GEOMAlgo_FinderShapeOn1::CheckData()
{
myErrorStatus=0;
//
if(mySurface.IsNull()) {
myErrorStatus=10; // mySurface=NULL
return;
}
//
if (myShape.IsNull()) {
myErrorStatus=11; // myShape=NULL
return;
}
//
if (!(myShapeType==TopAbs_VERTEX ||
myShapeType==TopAbs_EDGE ||
myShapeType==TopAbs_FACE ||
myShapeType==TopAbs_SOLID)) {
myErrorStatus=12; // unallowed subshape type
return;
}
//
if (myState==GEOMAlgo_ST_UNKNOWN ||
myState==GEOMAlgo_ST_INOUT) {
myErrorStatus=13; // unallowed state type
return;
}
//
GeomAbs_SurfaceType aType;
//
myGAS.Load(mySurface);
aType=myGAS.GetType();
if (!(aType==GeomAbs_Plane ||
aType==GeomAbs_Cylinder ||
aType==GeomAbs_Sphere)) {
myErrorStatus=14; // unallowed surface type
}
}
//
// myErrorStatus :
//
// 10 -mySurface=NULL
// 11 -myShape=NULL
// 12 -unallowed type of subshapes
// 13 -unallowed state
// 14 -unallowed surface type
// 15 -unallowed surface type
// 20- no triangulation found
// 30- can not obtain the line from the link
/*
// Chronometer
#include <OSD_Chronometer.hxx>
#include <Standard_Static.hxx>
Standard_STATIC(OSD_Chronometer, x_S_Chrono);
static void x_StartChrono();
static void x_StopChrono();
static Standard_Boolean x_IsToShow();
//
//=======================================================================
//function : x_StartChrono
//purpose :
//=======================================================================
void x_StartChrono()
{
if (x_IsToShow()){
x_S_Chrono().Reset();
x_S_Chrono().Start();
}
}
//=======================================================================
//function : x_StopChrono
//purpose :
//=======================================================================
void x_StopChrono()
{
if (x_IsToShow()){
Standard_Real Chrono;
x_S_Chrono().Stop();
x_S_Chrono().Show(Chrono);
printf(" Tps: %lf\n", Chrono);
//cout << "Tps: " << Chrono << endl;
}
}
//=======================================================================
//function : x_IsToShow
//purpose :
//=======================================================================
Standard_Boolean x_IsToShow()
{
Standard_Boolean bFlag=Standard_False;
//
char *xr=getenv ("STDCHRONO");
if (xr!=NULL){
if (!strcmp (xr, "yes")) {
bFlag=!bFlag;
}
}
return bFlag;
}
*/

View File

@ -19,8 +19,8 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#ifndef _GEOMAlgo_FinderShapeOn_HeaderFile #ifndef _GEOMAlgo_FinderShapeOn1_HeaderFile
#define _GEOMAlgo_FinderShapeOn_HeaderFile #define _GEOMAlgo_FinderShapeOn1_HeaderFile
#ifndef _Handle_Geom_Surface_HeaderFile #ifndef _Handle_Geom_Surface_HeaderFile
#include <Handle_Geom_Surface.hxx> #include <Handle_Geom_Surface.hxx>
@ -31,28 +31,27 @@
#ifndef _GEOMAlgo_State_HeaderFile #ifndef _GEOMAlgo_State_HeaderFile
#include <GEOMAlgo_State.hxx> #include <GEOMAlgo_State.hxx>
#endif #endif
#ifndef _TopoDS_Shape_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <TopoDS_Shape.hxx> #include <Standard_Integer.hxx>
#endif
#ifndef _GeomAdaptor_Surface_HeaderFile
#include <GeomAdaptor_Surface.hxx>
#endif #endif
#ifndef _TopTools_ListOfShape_HeaderFile #ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
#endif #endif
#ifndef _TopTools_DataMapOfShapeShape_HeaderFile
#include <TopTools_DataMapOfShapeShape.hxx>
#endif
#ifndef _GEOMAlgo_IndexedDataMapOfShapeState_HeaderFile #ifndef _GEOMAlgo_IndexedDataMapOfShapeState_HeaderFile
#include <GEOMAlgo_IndexedDataMapOfShapeState.hxx> #include <GEOMAlgo_IndexedDataMapOfShapeState.hxx>
#endif #endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _GEOMAlgo_ShapeAlgo_HeaderFile #ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
#include <GEOMAlgo_ShapeAlgo.hxx> #include <GEOMAlgo_ShapeAlgo.hxx>
#endif #endif
class Geom_Surface; class Geom_Surface;
class TopTools_ListOfShape; class TopTools_ListOfShape;
class TopoDS_Shape; class TopoDS_Face;
class TopTools_DataMapOfShapeShape; class GEOMAlgo_ListOfPnt;
class TopoDS_Edge;
class GEOMAlgo_IndexedDataMapOfShapeState;
#ifndef _Standard_HeaderFile #ifndef _Standard_HeaderFile
@ -62,7 +61,7 @@ class TopTools_DataMapOfShapeShape;
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#endif #endif
class GEOMAlgo_FinderShapeOn : public GEOMAlgo_ShapeAlgo { class GEOMAlgo_FinderShapeOn1 : public GEOMAlgo_ShapeAlgo {
public: public:
@ -80,17 +79,21 @@ public:
} }
// Methods PUBLIC // Methods PUBLIC
// //
Standard_EXPORT GEOMAlgo_FinderShapeOn(); Standard_EXPORT GEOMAlgo_FinderShapeOn1();
Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn(); Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn1();
Standard_EXPORT virtual void Perform() ;
Standard_EXPORT void SetSurface(const Handle(Geom_Surface)& aS) ; Standard_EXPORT void SetSurface(const Handle(Geom_Surface)& aS) ;
Standard_EXPORT void SetShapeType(const TopAbs_ShapeEnum aST) ; Standard_EXPORT void SetShapeType(const TopAbs_ShapeEnum aST) ;
Standard_EXPORT void SetState(const GEOMAlgo_State aSF) ; Standard_EXPORT void SetState(const GEOMAlgo_State aSF) ;
Standard_EXPORT void SetNbPntsMin(const Standard_Integer aNb) ;
Standard_EXPORT Standard_Integer NbPntsMin() const;
Standard_EXPORT void SetNbPntsMax(const Standard_Integer aNb) ;
Standard_EXPORT Standard_Integer NbPntsMax() const;
Standard_EXPORT const Handle_Geom_Surface& Surface() const; Standard_EXPORT const Handle_Geom_Surface& Surface() const;
Standard_EXPORT TopAbs_ShapeEnum ShapeType() const; Standard_EXPORT TopAbs_ShapeEnum ShapeType() const;
Standard_EXPORT GEOMAlgo_State State() const; Standard_EXPORT GEOMAlgo_State State() const;
Standard_EXPORT virtual void Perform() ;
Standard_EXPORT const TopTools_ListOfShape& Shapes() const; Standard_EXPORT const TopTools_ListOfShape& Shapes() const;
Standard_EXPORT static void CopySource(const TopoDS_Shape& aS,TopTools_DataMapOfShapeShape& aImages,TopTools_DataMapOfShapeShape& aOriginals,TopoDS_Shape& aSC) ; Standard_EXPORT const GEOMAlgo_IndexedDataMapOfShapeState& MSS() const;
@ -101,11 +104,13 @@ protected:
// Methods PROTECTED // Methods PROTECTED
// //
Standard_EXPORT virtual void CheckData() ; Standard_EXPORT virtual void CheckData() ;
Standard_EXPORT void MakeArgument1() ; Standard_EXPORT void ProcessVertices() ;
Standard_EXPORT void MakeArgument2() ; Standard_EXPORT void ProcessEdges() ;
Standard_EXPORT void Find() ; Standard_EXPORT void ProcessFaces() ;
Standard_EXPORT void Find(const TopoDS_Shape& aS) ; Standard_EXPORT void ProcessSolids() ;
Standard_EXPORT void FindVertices() ; Standard_EXPORT void InnerPoints(const TopoDS_Face& aF,GEOMAlgo_ListOfPnt& aLP) ;
Standard_EXPORT void InnerPoints(const TopoDS_Edge& aE,GEOMAlgo_ListOfPnt& aLP) ;
Standard_EXPORT void InnerPoints(const TopoDS_Edge& aE,const Standard_Integer aNbPnts,GEOMAlgo_ListOfPnt& aLP) ;
// Fields PROTECTED // Fields PROTECTED
@ -113,12 +118,11 @@ Standard_EXPORT void FindVertices() ;
Handle_Geom_Surface mySurface; Handle_Geom_Surface mySurface;
TopAbs_ShapeEnum myShapeType; TopAbs_ShapeEnum myShapeType;
GEOMAlgo_State myState; GEOMAlgo_State myState;
TopoDS_Shape myArg1; Standard_Integer myNbPntsMin;
TopoDS_Shape myArg2; Standard_Integer myNbPntsMax;
GeomAdaptor_Surface myGAS;
TopTools_ListOfShape myLS; TopTools_ListOfShape myLS;
TopTools_DataMapOfShapeShape myImages;
GEOMAlgo_IndexedDataMapOfShapeState myMSS; GEOMAlgo_IndexedDataMapOfShapeState myMSS;
Standard_Boolean myIsAnalytic;
private: private:

View File

@ -19,7 +19,7 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#include <GEOMAlgo_SolidSolid.jxx> #include <GEOMAlgo_FinderShapeOn1.jxx>

View File

@ -0,0 +1,21 @@
#ifndef _Geom_Surface_HeaderFile
#include <Geom_Surface.hxx>
#endif
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
#endif
#ifndef _TopoDS_Face_HeaderFile
#include <TopoDS_Face.hxx>
#endif
#ifndef _GEOMAlgo_ListOfPnt_HeaderFile
#include <GEOMAlgo_ListOfPnt.hxx>
#endif
#ifndef _TopoDS_Edge_HeaderFile
#include <TopoDS_Edge.hxx>
#endif
#ifndef _GEOMAlgo_IndexedDataMapOfShapeState_HeaderFile
#include <GEOMAlgo_IndexedDataMapOfShapeState.hxx>
#endif
#ifndef _GEOMAlgo_FinderShapeOn1_HeaderFile
#include <GEOMAlgo_FinderShapeOn1.hxx>
#endif

View File

@ -22,8 +22,8 @@
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx> #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx> #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <GEOMAlgo_PassKey.hxx> #include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx> #include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <GEOMAlgo_Tools.hxx> #include <GEOMAlgo_Tools.hxx>
#include <GEOMAlgo_CoupleOfShapes.hxx> #include <GEOMAlgo_CoupleOfShapes.hxx>
@ -242,8 +242,8 @@
TopoDS_Shape aNewShape; TopoDS_Shape aNewShape;
TopTools_IndexedMapOfShape aMF; TopTools_IndexedMapOfShape aMF;
TopTools_ListIteratorOfListOfShape aItS; TopTools_ListIteratorOfListOfShape aItS;
GEOMAlgo_PassKey aPKF; GEOMAlgo_PassKeyShape aPKF;
GEOMAlgo_IndexedDataMapOfPassKeyListOfShape aMPKLF; GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLF;
// //
TopExp::MapShapes(myShape, aType, aMF); TopExp::MapShapes(myShape, aType, aMF);
// //
@ -322,8 +322,8 @@
TopTools_IndexedDataMapOfShapeListOfShape aMFS; TopTools_IndexedDataMapOfShapeListOfShape aMFS;
TopTools_IndexedMapOfShape aMx, aMS; TopTools_IndexedMapOfShape aMx, aMS;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm; TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
GEOMAlgo_IndexedDataMapOfPassKeyListOfShape aMPKLS; GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLS;
GEOMAlgo_PassKey aPKSx; GEOMAlgo_PassKeyShape aPKSx;
GEOMAlgo_CoupleOfShapes aCS; GEOMAlgo_CoupleOfShapes aCS;
// //
aBB.MakeCompound(aCmp); aBB.MakeCompound(aCmp);

View File

@ -20,7 +20,7 @@ uses
DataMapOfShapeShape from TopTools, DataMapOfShapeShape from TopTools,
DataMapOfShapeListOfShape from TopTools, DataMapOfShapeListOfShape from TopTools,
Context from IntTools, Context from IntTools,
PassKey from GEOMAlgo PassKeyShape from GEOMAlgo
--raises --raises
@ -87,12 +87,12 @@ is
EdgePassKey(me:out; EdgePassKey(me:out;
aE:Edge from TopoDS; aE:Edge from TopoDS;
aPK:out PassKey from GEOMAlgo) aPK:out PassKeyShape from GEOMAlgo)
is protected; is protected;
FacePassKey(me:out; FacePassKey(me:out;
aF:Face from TopoDS; aF:Face from TopoDS;
aPK:out PassKey from GEOMAlgo) aPK:out PassKeyShape from GEOMAlgo)
is protected; is protected;
MakeVertex(me:out; MakeVertex(me:out;

View File

@ -58,8 +58,8 @@
#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx> #include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx> #include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx> #include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <GEOMAlgo_PassKey.hxx> #include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_Tools.hxx> #include <GEOMAlgo_Tools.hxx>
// //
@ -324,7 +324,7 @@ void GEOMAlgo_Gluer::MakeSolids()
// //
aNbS=aMS.Extent(); aNbS=aMS.Extent();
if (aNbS) { if (aNbS) {
//Standard_Real aTol=1.e-7; Standard_Real aTol=1.e-7;
BOP_CorrectTolerances::CorrectCurveOnSurface(myResult); BOP_CorrectTolerances::CorrectCurveOnSurface(myResult);
} }
} }
@ -405,8 +405,8 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
TopoDS_Shape aNewShape; TopoDS_Shape aNewShape;
TopTools_IndexedMapOfShape aMF; TopTools_IndexedMapOfShape aMF;
TopTools_ListIteratorOfListOfShape aItS; TopTools_ListIteratorOfListOfShape aItS;
GEOMAlgo_PassKey aPKF; GEOMAlgo_PassKeyShape aPKF;
GEOMAlgo_IndexedDataMapOfPassKeyListOfShape aMPKLF; GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLF;
// //
TopExp::MapShapes(myShape, aType, aMF); TopExp::MapShapes(myShape, aType, aMF);
// //
@ -460,8 +460,6 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
// //
const TopoDS_Shape& aS1=aLSDF.First(); const TopoDS_Shape& aS1=aLSDF.First();
// //
//modified by NIZNHY-PKV Fri Jan 21 15:34:00 2005 f
//
bHasNewSubShape=Standard_True; bHasNewSubShape=Standard_True;
// prevent creation of a new shape if there are not // prevent creation of a new shape if there are not
// new subshapes of aSS among the originals // new subshapes of aSS among the originals
@ -472,9 +470,8 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
aNewShape.Orientation(TopAbs_FORWARD); aNewShape.Orientation(TopAbs_FORWARD);
} }
} }
//modified by NIZNHY-PKV Fri Jan 21 15:34:05 2005 t
// //
if (bHasNewSubShape) {//modified by NIZNHY-PKV Fri Jan 21 15:34:10 2005ft if (bHasNewSubShape) {
if (aType==TopAbs_FACE) { if (aType==TopAbs_FACE) {
TopoDS_Face aNewFace; TopoDS_Face aNewFace;
// //
@ -604,7 +601,7 @@ void GEOMAlgo_Gluer::InnerTolerance()
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF, void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
GEOMAlgo_PassKey& aPK) GEOMAlgo_PassKeyShape& aPK)
{ {
Standard_Integer i, aNbE, aNbMax; Standard_Integer i, aNbE, aNbMax;
TopTools_ListOfShape aLE; TopTools_ListOfShape aLE;
@ -634,7 +631,7 @@ void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE, void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
GEOMAlgo_PassKey& aPK) GEOMAlgo_PassKeyShape& aPK)
{ {
TopoDS_Vertex aV1, aV2; TopoDS_Vertex aV1, aV2;
// //
@ -867,8 +864,6 @@ Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
} }
return bRet; return bRet;
} }
//
//modified by NIZNHY-PKV Fri Jan 21 10:55:42 2005 f
//======================================================================= //=======================================================================
//function : HasNewSubShape //function : HasNewSubShape
//purpose : //purpose :
@ -975,7 +970,6 @@ Standard_Boolean GEOMAlgo_Gluer::IsDeleted (const TopoDS_Shape& aS)
// //
return bRet; return bRet;
} }
//modified by NIZNHY-PKV Fri Jan 21 10:59:21 2005 t
// //
// ErrorStatus // ErrorStatus
// //

View File

@ -49,7 +49,7 @@
class TopTools_ListOfShape; class TopTools_ListOfShape;
class TopoDS_Shape; class TopoDS_Shape;
class TopoDS_Edge; class TopoDS_Edge;
class GEOMAlgo_PassKey; class GEOMAlgo_PassKeyShape;
class TopoDS_Face; class TopoDS_Face;
class TopoDS_Vertex; class TopoDS_Vertex;
class TopTools_DataMapOfShapeListOfShape; class TopTools_DataMapOfShapeListOfShape;
@ -110,8 +110,8 @@ Standard_EXPORT void MakeShapes(const TopAbs_ShapeEnum aType) ;
Standard_EXPORT void MakeShells() ; Standard_EXPORT void MakeShells() ;
Standard_EXPORT void MakeSolids() ; Standard_EXPORT void MakeSolids() ;
Standard_EXPORT void InnerTolerance() ; Standard_EXPORT void InnerTolerance() ;
Standard_EXPORT void EdgePassKey(const TopoDS_Edge& aE,GEOMAlgo_PassKey& aPK) ; Standard_EXPORT void EdgePassKey(const TopoDS_Edge& aE,GEOMAlgo_PassKeyShape& aPK) ;
Standard_EXPORT void FacePassKey(const TopoDS_Face& aF,GEOMAlgo_PassKey& aPK) ; Standard_EXPORT void FacePassKey(const TopoDS_Face& aF,GEOMAlgo_PassKeyShape& aPK) ;
Standard_EXPORT void MakeVertex(const TopTools_ListOfShape& aLV,TopoDS_Vertex& aNewV) ; Standard_EXPORT void MakeVertex(const TopTools_ListOfShape& aLV,TopoDS_Vertex& aNewV) ;
Standard_EXPORT void MakeEdge(const TopoDS_Edge& aEdge,TopoDS_Edge& aNewEdge) ; Standard_EXPORT void MakeEdge(const TopoDS_Edge& aEdge,TopoDS_Edge& aNewEdge) ;
Standard_EXPORT void MakeFace(const TopoDS_Face& aFace,TopoDS_Face& aNewEdge) ; Standard_EXPORT void MakeFace(const TopoDS_Face& aFace,TopoDS_Face& aNewEdge) ;

View File

@ -7,8 +7,8 @@
#ifndef _TopoDS_Edge_HeaderFile #ifndef _TopoDS_Edge_HeaderFile
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#endif #endif
#ifndef _GEOMAlgo_PassKey_HeaderFile #ifndef _GEOMAlgo_PassKeyShape_HeaderFile
#include <GEOMAlgo_PassKey.hxx> #include <GEOMAlgo_PassKeyShape.hxx>
#endif #endif
#ifndef _TopoDS_Face_HeaderFile #ifndef _TopoDS_Face_HeaderFile
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>

View File

@ -20,18 +20,18 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#ifndef _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_HeaderFile #ifndef _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#define _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_HeaderFile #define _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#ifndef _Standard_HeaderFile #ifndef _Standard_HeaderFile
#include <Standard.hxx> #include <Standard.hxx>
#endif #endif
#ifndef _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_HeaderFile #ifndef _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#include <Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx> #include <Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
#endif #endif
#ifndef _GEOMAlgo_PassKey_HeaderFile #ifndef _GEOMAlgo_PassKeyShape_HeaderFile
#include <GEOMAlgo_PassKey.hxx> #include <GEOMAlgo_PassKeyShape.hxx>
#endif #endif
#ifndef _Standard_Integer_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
@ -45,13 +45,13 @@
#ifndef _TCollection_MapNode_HeaderFile #ifndef _TCollection_MapNode_HeaderFile
#include <TCollection_MapNode.hxx> #include <TCollection_MapNode.hxx>
#endif #endif
class GEOMAlgo_PassKey; class GEOMAlgo_PassKeyShape;
class TopTools_ListOfShape; class TopTools_ListOfShape;
class GEOMAlgo_PassKeyMapHasher; class GEOMAlgo_PassKeyMapHasher;
class GEOMAlgo_IndexedDataMapOfPassKeyListOfShape; class GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape;
class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape : public TCollection_MapNode { class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape : public TCollection_MapNode {
public: public:
@ -69,19 +69,19 @@ public:
} }
// Methods PUBLIC // Methods PUBLIC
// //
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape(const GEOMAlgo_PassKey& K1,const Standard_Integer K2,const TopTools_ListOfShape& I,const TCollection_MapNodePtr& n1,const TCollection_MapNodePtr& n2); GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape(const GEOMAlgo_PassKeyShape& K1,const Standard_Integer K2,const TopTools_ListOfShape& I,const TCollection_MapNodePtr& n1,const TCollection_MapNodePtr& n2);
GEOMAlgo_PassKey& Key1() const; GEOMAlgo_PassKeyShape& Key1() const;
Standard_Integer& Key2() const; Standard_Integer& Key2() const;
TCollection_MapNodePtr& Next2() const; TCollection_MapNodePtr& Next2() const;
TopTools_ListOfShape& Value() const; TopTools_ListOfShape& Value() const;
Standard_EXPORT ~GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape(); Standard_EXPORT ~GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape();
// Type management // Type management
// //
Standard_EXPORT friend Handle_Standard_Type& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_Type_(); Standard_EXPORT friend Handle_Standard_Type& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; 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;
@ -103,7 +103,7 @@ private:
// Fields PRIVATE // Fields PRIVATE
// //
GEOMAlgo_PassKey myKey1; GEOMAlgo_PassKeyShape myKey1;
Standard_Integer myKey2; Standard_Integer myKey2;
TopTools_ListOfShape myValue; TopTools_ListOfShape myValue;
TCollection_MapNodePtr myNext2; TCollection_MapNodePtr myNext2;
@ -111,18 +111,18 @@ TCollection_MapNodePtr myNext2;
}; };
#define TheKey GEOMAlgo_PassKey #define TheKey GEOMAlgo_PassKeyShape
#define TheKey_hxx <GEOMAlgo_PassKey.hxx> #define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
#define TheItem TopTools_ListOfShape #define TheItem TopTools_ListOfShape
#define TheItem_hxx <TopTools_ListOfShape.hxx> #define TheItem_hxx <TopTools_ListOfShape.hxx>
#define Hasher GEOMAlgo_PassKeyMapHasher #define Hasher GEOMAlgo_PassKeyMapHasher
#define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx> #define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx>
#define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape #define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
#define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx> #define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
#define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape #define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
#define TCollection_IndexedDataMapNode_Type_() GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_Type_() #define TCollection_IndexedDataMapNode_Type_() GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_Type_()
#define TCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfPassKeyListOfShape #define TCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape
#define TCollection_IndexedDataMap_hxx <GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx> #define TCollection_IndexedDataMap_hxx <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <TCollection_IndexedDataMapNode.lxx> #include <TCollection_IndexedDataMapNode.lxx>

View File

@ -19,14 +19,14 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#include <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx> #include <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
#ifndef _Standard_TypeMismatch_HeaderFile #ifndef _Standard_TypeMismatch_HeaderFile
#include <Standard_TypeMismatch.hxx> #include <Standard_TypeMismatch.hxx>
#endif #endif
#ifndef _GEOMAlgo_PassKey_HeaderFile #ifndef _GEOMAlgo_PassKeyShape_HeaderFile
#include <GEOMAlgo_PassKey.hxx> #include <GEOMAlgo_PassKeyShape.hxx>
#endif #endif
#ifndef _TopTools_ListOfShape_HeaderFile #ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
@ -34,14 +34,14 @@
#ifndef _GEOMAlgo_PassKeyMapHasher_HeaderFile #ifndef _GEOMAlgo_PassKeyMapHasher_HeaderFile
#include <GEOMAlgo_PassKeyMapHasher.hxx> #include <GEOMAlgo_PassKeyMapHasher.hxx>
#endif #endif
#ifndef _GEOMAlgo_IndexedDataMapOfPassKeyListOfShape_HeaderFile #ifndef _GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#include <GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx> #include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#endif #endif
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape::~GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape() {} GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape::~GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape() {}
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_Type_() Standard_EXPORT Handle_Standard_Type& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_Type_()
{ {
static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
@ -53,8 +53,8 @@ Standard_EXPORT Handle_Standard_Type& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMa
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape", static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape",
sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape), sizeof(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape),
1, 1,
(Standard_Address)_Ancestors, (Standard_Address)_Ancestors,
(Standard_Address)NULL); (Standard_Address)NULL);
@ -66,38 +66,38 @@ Standard_EXPORT Handle_Standard_Type& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMa
// DownCast method // DownCast method
// allow safe downcasting // allow safe downcasting
// //
const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape) Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)::DownCast(const Handle(Standard_Transient)& AnObject) const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape) Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)::DownCast(const Handle(Standard_Transient)& AnObject)
{ {
Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape) _anOtherObject; Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape) _anOtherObject;
if (!AnObject.IsNull()) { if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape))) { if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape))) {
_anOtherObject = Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)((Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)&)AnObject); _anOtherObject = Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)((Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)&)AnObject);
} }
} }
return _anOtherObject ; return _anOtherObject ;
} }
const Handle(Standard_Type)& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape::DynamicType() const const Handle(Standard_Type)& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape::DynamicType() const
{ {
return STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape) ; return STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape) ;
} }
Standard_Boolean GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape::IsKind(const Handle(Standard_Type)& AType) const Standard_Boolean GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape::IsKind(const Handle(Standard_Type)& AType) const
{ {
return (STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape) == AType || TCollection_MapNode::IsKind(AType)); return (STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape) == AType || TCollection_MapNode::IsKind(AType));
} }
Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape::~Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape() {} Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape::~Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape() {}
#define TheKey GEOMAlgo_PassKey #define TheKey GEOMAlgo_PassKeyShape
#define TheKey_hxx <GEOMAlgo_PassKey.hxx> #define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
#define TheItem TopTools_ListOfShape #define TheItem TopTools_ListOfShape
#define TheItem_hxx <TopTools_ListOfShape.hxx> #define TheItem_hxx <TopTools_ListOfShape.hxx>
#define Hasher GEOMAlgo_PassKeyMapHasher #define Hasher GEOMAlgo_PassKeyMapHasher
#define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx> #define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx>
#define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape #define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
#define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx> #define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
#define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape #define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
#define TCollection_IndexedDataMapNode_Type_() GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_Type_() #define TCollection_IndexedDataMapNode_Type_() GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_Type_()
#define TCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfPassKeyListOfShape #define TCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape
#define TCollection_IndexedDataMap_hxx <GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx> #define TCollection_IndexedDataMap_hxx <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <TCollection_IndexedDataMapNode.gxx> #include <TCollection_IndexedDataMapNode.gxx>

View File

@ -19,14 +19,14 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#ifndef _GEOMAlgo_IndexedDataMapOfPassKeyListOfShape_HeaderFile #ifndef _GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#define _GEOMAlgo_IndexedDataMapOfPassKeyListOfShape_HeaderFile #define _GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#ifndef _TCollection_BasicMap_HeaderFile #ifndef _TCollection_BasicMap_HeaderFile
#include <TCollection_BasicMap.hxx> #include <TCollection_BasicMap.hxx>
#endif #endif
#ifndef _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_HeaderFile #ifndef _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#include <Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx> #include <Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
#endif #endif
#ifndef _Standard_Integer_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
@ -37,10 +37,10 @@
class Standard_DomainError; class Standard_DomainError;
class Standard_OutOfRange; class Standard_OutOfRange;
class Standard_NoSuchObject; class Standard_NoSuchObject;
class GEOMAlgo_PassKey; class GEOMAlgo_PassKeyShape;
class TopTools_ListOfShape; class TopTools_ListOfShape;
class GEOMAlgo_PassKeyMapHasher; class GEOMAlgo_PassKeyMapHasher;
class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape; class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape;
#ifndef _Standard_HeaderFile #ifndef _Standard_HeaderFile
@ -50,7 +50,7 @@ class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape;
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#endif #endif
class GEOMAlgo_IndexedDataMapOfPassKeyListOfShape : public TCollection_BasicMap { class GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape : public TCollection_BasicMap {
public: public:
@ -68,25 +68,25 @@ public:
} }
// Methods PUBLIC // Methods PUBLIC
// //
Standard_EXPORT GEOMAlgo_IndexedDataMapOfPassKeyListOfShape(const Standard_Integer NbBuckets = 1); Standard_EXPORT GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape(const Standard_Integer NbBuckets = 1);
Standard_EXPORT GEOMAlgo_IndexedDataMapOfPassKeyListOfShape& Assign(const GEOMAlgo_IndexedDataMapOfPassKeyListOfShape& Other) ; Standard_EXPORT GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& Assign(const GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& Other) ;
GEOMAlgo_IndexedDataMapOfPassKeyListOfShape& operator =(const GEOMAlgo_IndexedDataMapOfPassKeyListOfShape& Other) GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& operator =(const GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& Other)
{ {
return Assign(Other); return Assign(Other);
} }
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
Standard_EXPORT void Clear() ; Standard_EXPORT void Clear() ;
~GEOMAlgo_IndexedDataMapOfPassKeyListOfShape() ~GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape()
{ {
Clear(); Clear();
} }
Standard_EXPORT Standard_Integer Add(const GEOMAlgo_PassKey& K,const TopTools_ListOfShape& I) ; Standard_EXPORT Standard_Integer Add(const GEOMAlgo_PassKeyShape& K,const TopTools_ListOfShape& I) ;
Standard_EXPORT void Substitute(const Standard_Integer I,const GEOMAlgo_PassKey& K,const TopTools_ListOfShape& T) ; Standard_EXPORT void Substitute(const Standard_Integer I,const GEOMAlgo_PassKeyShape& K,const TopTools_ListOfShape& T) ;
Standard_EXPORT void RemoveLast() ; Standard_EXPORT void RemoveLast() ;
Standard_EXPORT Standard_Boolean Contains(const GEOMAlgo_PassKey& K) const; Standard_EXPORT Standard_Boolean Contains(const GEOMAlgo_PassKeyShape& K) const;
Standard_EXPORT const GEOMAlgo_PassKey& FindKey(const Standard_Integer I) const; Standard_EXPORT const GEOMAlgo_PassKeyShape& FindKey(const Standard_Integer I) const;
Standard_EXPORT const TopTools_ListOfShape& FindFromIndex(const Standard_Integer I) const; Standard_EXPORT const TopTools_ListOfShape& FindFromIndex(const Standard_Integer I) const;
const TopTools_ListOfShape& operator ()(const Standard_Integer I) const const TopTools_ListOfShape& operator ()(const Standard_Integer I) const
{ {
@ -99,9 +99,9 @@ Standard_EXPORT TopTools_ListOfShape& ChangeFromIndex(const Standard_Integer I
return ChangeFromIndex(I); return ChangeFromIndex(I);
} }
Standard_EXPORT Standard_Integer FindIndex(const GEOMAlgo_PassKey& K) const; Standard_EXPORT Standard_Integer FindIndex(const GEOMAlgo_PassKeyShape& K) const;
Standard_EXPORT const TopTools_ListOfShape& FindFromKey(const GEOMAlgo_PassKey& K) const; Standard_EXPORT const TopTools_ListOfShape& FindFromKey(const GEOMAlgo_PassKeyShape& K) const;
Standard_EXPORT TopTools_ListOfShape& ChangeFromKey(const GEOMAlgo_PassKey& K) ; Standard_EXPORT TopTools_ListOfShape& ChangeFromKey(const GEOMAlgo_PassKeyShape& K) ;
@ -121,7 +121,7 @@ private:
// Methods PRIVATE // Methods PRIVATE
// //
Standard_EXPORT GEOMAlgo_IndexedDataMapOfPassKeyListOfShape(const GEOMAlgo_IndexedDataMapOfPassKeyListOfShape& Other); Standard_EXPORT GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape(const GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& Other);
// Fields PRIVATE // Fields PRIVATE

View File

@ -19,7 +19,7 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#include <GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx> #include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#ifndef _Standard_DomainError_HeaderFile #ifndef _Standard_DomainError_HeaderFile
#include <Standard_DomainError.hxx> #include <Standard_DomainError.hxx>
@ -30,8 +30,8 @@
#ifndef _Standard_NoSuchObject_HeaderFile #ifndef _Standard_NoSuchObject_HeaderFile
#include <Standard_NoSuchObject.hxx> #include <Standard_NoSuchObject.hxx>
#endif #endif
#ifndef _GEOMAlgo_PassKey_HeaderFile #ifndef _GEOMAlgo_PassKeyShape_HeaderFile
#include <GEOMAlgo_PassKey.hxx> #include <GEOMAlgo_PassKeyShape.hxx>
#endif #endif
#ifndef _TopTools_ListOfShape_HeaderFile #ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
@ -39,22 +39,22 @@
#ifndef _GEOMAlgo_PassKeyMapHasher_HeaderFile #ifndef _GEOMAlgo_PassKeyMapHasher_HeaderFile
#include <GEOMAlgo_PassKeyMapHasher.hxx> #include <GEOMAlgo_PassKeyMapHasher.hxx>
#endif #endif
#ifndef _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_HeaderFile #ifndef _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#include <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx> #include <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
#endif #endif
#define TheKey GEOMAlgo_PassKey #define TheKey GEOMAlgo_PassKeyShape
#define TheKey_hxx <GEOMAlgo_PassKey.hxx> #define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
#define TheItem TopTools_ListOfShape #define TheItem TopTools_ListOfShape
#define TheItem_hxx <TopTools_ListOfShape.hxx> #define TheItem_hxx <TopTools_ListOfShape.hxx>
#define Hasher GEOMAlgo_PassKeyMapHasher #define Hasher GEOMAlgo_PassKeyMapHasher
#define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx> #define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx>
#define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape #define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
#define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx> #define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
#define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape #define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
#define TCollection_IndexedDataMapNode_Type_() GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_Type_() #define TCollection_IndexedDataMapNode_Type_() GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_Type_()
#define TCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfPassKeyListOfShape #define TCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape
#define TCollection_IndexedDataMap_hxx <GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx> #define TCollection_IndexedDataMap_hxx <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <TCollection_IndexedDataMap.gxx> #include <TCollection_IndexedDataMap.gxx>

View File

@ -0,0 +1,131 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#ifndef _GEOMAlgo_ListIteratorOfListOfPnt_HeaderFile
#define _GEOMAlgo_ListIteratorOfListOfPnt_HeaderFile
#ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx>
#endif
#ifndef _Handle_GEOMAlgo_ListNodeOfListOfPnt_HeaderFile
#include <Handle_GEOMAlgo_ListNodeOfListOfPnt.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
class Standard_NoMoreObject;
class Standard_NoSuchObject;
class GEOMAlgo_ListOfPnt;
class gp_Pnt;
class GEOMAlgo_ListNodeOfListOfPnt;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class GEOMAlgo_ListIteratorOfListOfPnt {
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
//
Standard_EXPORT GEOMAlgo_ListIteratorOfListOfPnt();
Standard_EXPORT GEOMAlgo_ListIteratorOfListOfPnt(const GEOMAlgo_ListOfPnt& L);
Standard_EXPORT void Initialize(const GEOMAlgo_ListOfPnt& L) ;
Standard_Boolean More() const;
Standard_EXPORT void Next() ;
Standard_EXPORT gp_Pnt& Value() const;
friend class GEOMAlgo_ListOfPnt;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
Standard_Address current;
Standard_Address previous;
};
#define Item gp_Pnt
#define Item_hxx <gp_Pnt.hxx>
#define TCollection_ListNode GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_hxx <GEOMAlgo_ListNodeOfListOfPnt.hxx>
#define TCollection_ListIterator GEOMAlgo_ListIteratorOfListOfPnt
#define TCollection_ListIterator_hxx <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#define Handle_TCollection_ListNode Handle_GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_Type_() GEOMAlgo_ListNodeOfListOfPnt_Type_()
#define TCollection_List GEOMAlgo_ListOfPnt
#define TCollection_List_hxx <GEOMAlgo_ListOfPnt.hxx>
#include <TCollection_ListIterator.lxx>
#undef Item
#undef Item_hxx
#undef TCollection_ListNode
#undef TCollection_ListNode_hxx
#undef TCollection_ListIterator
#undef TCollection_ListIterator_hxx
#undef Handle_TCollection_ListNode
#undef TCollection_ListNode_Type_
#undef TCollection_List
#undef TCollection_List_hxx
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,52 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#ifndef _Standard_NoMoreObject_HeaderFile
#include <Standard_NoMoreObject.hxx>
#endif
#ifndef _Standard_NoSuchObject_HeaderFile
#include <Standard_NoSuchObject.hxx>
#endif
#ifndef _GEOMAlgo_ListOfPnt_HeaderFile
#include <GEOMAlgo_ListOfPnt.hxx>
#endif
#ifndef _gp_Pnt_HeaderFile
#include <gp_Pnt.hxx>
#endif
#ifndef _GEOMAlgo_ListNodeOfListOfPnt_HeaderFile
#include <GEOMAlgo_ListNodeOfListOfPnt.hxx>
#endif
#define Item gp_Pnt
#define Item_hxx <gp_Pnt.hxx>
#define TCollection_ListNode GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_hxx <GEOMAlgo_ListNodeOfListOfPnt.hxx>
#define TCollection_ListIterator GEOMAlgo_ListIteratorOfListOfPnt
#define TCollection_ListIterator_hxx <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#define Handle_TCollection_ListNode Handle_GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_Type_() GEOMAlgo_ListNodeOfListOfPnt_Type_()
#define TCollection_List GEOMAlgo_ListOfPnt
#define TCollection_List_hxx <GEOMAlgo_ListOfPnt.hxx>
#include <TCollection_ListIterator.gxx>

View File

@ -0,0 +1,130 @@
// File generated by CPPExt (Transient)
//
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#ifndef _GEOMAlgo_ListNodeOfListOfPnt_HeaderFile
#define _GEOMAlgo_ListNodeOfListOfPnt_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_GEOMAlgo_ListNodeOfListOfPnt_HeaderFile
#include <Handle_GEOMAlgo_ListNodeOfListOfPnt.hxx>
#endif
#ifndef _gp_Pnt_HeaderFile
#include <gp_Pnt.hxx>
#endif
#ifndef _TCollection_MapNode_HeaderFile
#include <TCollection_MapNode.hxx>
#endif
#ifndef _TCollection_MapNodePtr_HeaderFile
#include <TCollection_MapNodePtr.hxx>
#endif
class gp_Pnt;
class GEOMAlgo_ListOfPnt;
class GEOMAlgo_ListIteratorOfListOfPnt;
class GEOMAlgo_ListNodeOfListOfPnt : public TCollection_MapNode {
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
//
GEOMAlgo_ListNodeOfListOfPnt(const gp_Pnt& I,const TCollection_MapNodePtr& n);
gp_Pnt& Value() const;
Standard_EXPORT ~GEOMAlgo_ListNodeOfListOfPnt();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& GEOMAlgo_ListNodeOfListOfPnt_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
gp_Pnt myValue;
};
#define Item gp_Pnt
#define Item_hxx <gp_Pnt.hxx>
#define TCollection_ListNode GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_hxx <GEOMAlgo_ListNodeOfListOfPnt.hxx>
#define TCollection_ListIterator GEOMAlgo_ListIteratorOfListOfPnt
#define TCollection_ListIterator_hxx <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#define Handle_TCollection_ListNode Handle_GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_Type_() GEOMAlgo_ListNodeOfListOfPnt_Type_()
#define TCollection_List GEOMAlgo_ListOfPnt
#define TCollection_List_hxx <GEOMAlgo_ListOfPnt.hxx>
#include <TCollection_ListNode.lxx>
#undef Item
#undef Item_hxx
#undef TCollection_ListNode
#undef TCollection_ListNode_hxx
#undef TCollection_ListIterator
#undef TCollection_ListIterator_hxx
#undef Handle_TCollection_ListNode
#undef TCollection_ListNode_Type_
#undef TCollection_List
#undef TCollection_List_hxx
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,98 @@
// File generated by CPPExt (Transient)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#include <GEOMAlgo_ListNodeOfListOfPnt.hxx>
#ifndef _Standard_TypeMismatch_HeaderFile
#include <Standard_TypeMismatch.hxx>
#endif
#ifndef _gp_Pnt_HeaderFile
#include <gp_Pnt.hxx>
#endif
#ifndef _GEOMAlgo_ListOfPnt_HeaderFile
#include <GEOMAlgo_ListOfPnt.hxx>
#endif
#ifndef _GEOMAlgo_ListIteratorOfListOfPnt_HeaderFile
#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#endif
GEOMAlgo_ListNodeOfListOfPnt::~GEOMAlgo_ListNodeOfListOfPnt() {}
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_ListNodeOfListOfPnt_Type_()
{
static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TCollection_MapNode);
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
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);
return _aType;
}
// DownCast method
// allow safe downcasting
//
const Handle(GEOMAlgo_ListNodeOfListOfPnt) Handle(GEOMAlgo_ListNodeOfListOfPnt)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(GEOMAlgo_ListNodeOfListOfPnt) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_ListNodeOfListOfPnt))) {
_anOtherObject = Handle(GEOMAlgo_ListNodeOfListOfPnt)((Handle(GEOMAlgo_ListNodeOfListOfPnt)&)AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& GEOMAlgo_ListNodeOfListOfPnt::DynamicType() const
{
return STANDARD_TYPE(GEOMAlgo_ListNodeOfListOfPnt) ;
}
Standard_Boolean GEOMAlgo_ListNodeOfListOfPnt::IsKind(const Handle(Standard_Type)& AType) const
{
return (STANDARD_TYPE(GEOMAlgo_ListNodeOfListOfPnt) == AType || TCollection_MapNode::IsKind(AType));
}
Handle_GEOMAlgo_ListNodeOfListOfPnt::~Handle_GEOMAlgo_ListNodeOfListOfPnt() {}
#define Item gp_Pnt
#define Item_hxx <gp_Pnt.hxx>
#define TCollection_ListNode GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_hxx <GEOMAlgo_ListNodeOfListOfPnt.hxx>
#define TCollection_ListIterator GEOMAlgo_ListIteratorOfListOfPnt
#define TCollection_ListIterator_hxx <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#define Handle_TCollection_ListNode Handle_GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_Type_() GEOMAlgo_ListNodeOfListOfPnt_Type_()
#define TCollection_List GEOMAlgo_ListOfPnt
#define TCollection_List_hxx <GEOMAlgo_ListOfPnt.hxx>
#include <TCollection_ListNode.gxx>

View File

@ -0,0 +1,157 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#ifndef _GEOMAlgo_ListOfPnt_HeaderFile
#define _GEOMAlgo_ListOfPnt_HeaderFile
#ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx>
#endif
#ifndef _Handle_GEOMAlgo_ListNodeOfListOfPnt_HeaderFile
#include <Handle_GEOMAlgo_ListNodeOfListOfPnt.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
class Standard_NoSuchObject;
class GEOMAlgo_ListIteratorOfListOfPnt;
class gp_Pnt;
class GEOMAlgo_ListNodeOfListOfPnt;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class GEOMAlgo_ListOfPnt {
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
//
Standard_EXPORT GEOMAlgo_ListOfPnt();
Standard_EXPORT void Assign(const GEOMAlgo_ListOfPnt& Other) ;
void operator=(const GEOMAlgo_ListOfPnt& Other)
{
Assign(Other);
}
Standard_EXPORT Standard_Integer Extent() const;
Standard_EXPORT void Clear() ;
~GEOMAlgo_ListOfPnt()
{
Clear();
}
Standard_Boolean IsEmpty() const;
Standard_EXPORT void Prepend(const gp_Pnt& I) ;
Standard_EXPORT void Prepend(const gp_Pnt& I,GEOMAlgo_ListIteratorOfListOfPnt& theIt) ;
Standard_EXPORT void Prepend(GEOMAlgo_ListOfPnt& Other) ;
Standard_EXPORT void Append(const gp_Pnt& I) ;
Standard_EXPORT void Append(const gp_Pnt& I,GEOMAlgo_ListIteratorOfListOfPnt& theIt) ;
Standard_EXPORT void Append(GEOMAlgo_ListOfPnt& Other) ;
Standard_EXPORT gp_Pnt& First() const;
Standard_EXPORT gp_Pnt& Last() const;
Standard_EXPORT void RemoveFirst() ;
Standard_EXPORT void Remove(GEOMAlgo_ListIteratorOfListOfPnt& It) ;
Standard_EXPORT void InsertBefore(const gp_Pnt& I,GEOMAlgo_ListIteratorOfListOfPnt& It) ;
Standard_EXPORT void InsertBefore(GEOMAlgo_ListOfPnt& Other,GEOMAlgo_ListIteratorOfListOfPnt& It) ;
Standard_EXPORT void InsertAfter(const gp_Pnt& I,GEOMAlgo_ListIteratorOfListOfPnt& It) ;
Standard_EXPORT void InsertAfter(GEOMAlgo_ListOfPnt& Other,GEOMAlgo_ListIteratorOfListOfPnt& It) ;
friend class GEOMAlgo_ListIteratorOfListOfPnt;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
Standard_EXPORT GEOMAlgo_ListOfPnt(const GEOMAlgo_ListOfPnt& Other);
// Fields PRIVATE
//
Standard_Address myFirst;
Standard_Address myLast;
};
#define Item gp_Pnt
#define Item_hxx <gp_Pnt.hxx>
#define TCollection_ListNode GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_hxx <GEOMAlgo_ListNodeOfListOfPnt.hxx>
#define TCollection_ListIterator GEOMAlgo_ListIteratorOfListOfPnt
#define TCollection_ListIterator_hxx <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#define Handle_TCollection_ListNode Handle_GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_Type_() GEOMAlgo_ListNodeOfListOfPnt_Type_()
#define TCollection_List GEOMAlgo_ListOfPnt
#define TCollection_List_hxx <GEOMAlgo_ListOfPnt.hxx>
#include <TCollection_List.lxx>
#undef Item
#undef Item_hxx
#undef TCollection_ListNode
#undef TCollection_ListNode_hxx
#undef TCollection_ListIterator
#undef TCollection_ListIterator_hxx
#undef Handle_TCollection_ListNode
#undef TCollection_ListNode_Type_
#undef TCollection_List
#undef TCollection_List_hxx
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,49 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#include <GEOMAlgo_ListOfPnt.hxx>
#ifndef _Standard_NoSuchObject_HeaderFile
#include <Standard_NoSuchObject.hxx>
#endif
#ifndef _GEOMAlgo_ListIteratorOfListOfPnt_HeaderFile
#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#endif
#ifndef _gp_Pnt_HeaderFile
#include <gp_Pnt.hxx>
#endif
#ifndef _GEOMAlgo_ListNodeOfListOfPnt_HeaderFile
#include <GEOMAlgo_ListNodeOfListOfPnt.hxx>
#endif
#define Item gp_Pnt
#define Item_hxx <gp_Pnt.hxx>
#define TCollection_ListNode GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_hxx <GEOMAlgo_ListNodeOfListOfPnt.hxx>
#define TCollection_ListIterator GEOMAlgo_ListIteratorOfListOfPnt
#define TCollection_ListIterator_hxx <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
#define Handle_TCollection_ListNode Handle_GEOMAlgo_ListNodeOfListOfPnt
#define TCollection_ListNode_Type_() GEOMAlgo_ListNodeOfListOfPnt_Type_()
#define TCollection_List GEOMAlgo_ListOfPnt
#define TCollection_List_hxx <GEOMAlgo_ListOfPnt.hxx>
#include <TCollection_List.gxx>

View File

@ -11,40 +11,40 @@ class PassKey from GEOMAlgo
uses uses
Shape from TopoDS, Shape from TopoDS,
ListOfShape from TopTools ListOfInteger from TColStd
--raises --raises
is is
Create Create
returns PassKey from GEOMAlgo; returns PassKey from GEOMAlgo;
Assign(me:out; Assign(me:out;
Other : PassKey from GEOMAlgo) Other : PassKey from GEOMAlgo)
returns PassKey from GEOMAlgo; returns PassKey from GEOMAlgo;
---C++: alias operator = ---C++: alias operator =
---C++: return & ---C++: return &
--
SetIds(me:out;
aI1 :Integer from Standard);
SetIds(me:out;
aI1 :Integer from Standard;
aI2 :Integer from Standard);
SetIds(me:out;
aI1 :Integer from Standard;
aI2 :Integer from Standard;
aI3 :Integer from Standard);
SetIds(me:out;
aI1 :Integer from Standard;
aI2 :Integer from Standard;
aI3 :Integer from Standard;
aI4 :Integer from Standard);
SetIds(me:out;
aS :Shape from TopoDS);
SetIds(me:out;
aS1 :Shape from TopoDS;
aS2 :Shape from TopoDS);
SetIds(me:out;
aS1 :Shape from TopoDS;
aS2 :Shape from TopoDS;
aS3 :Shape from TopoDS);
SetIds(me:out; SetIds(me:out;
aS1 :Shape from TopoDS; aLS :ListOfInteger from TColStd);
aS2 :Shape from TopoDS;
aS3 :Shape from TopoDS;
aS4 :Shape from TopoDS);
SetIds(me:out;
aLS :ListOfShape from TopTools);
NbMax(me) NbMax(me)
returns Integer from Standard; returns Integer from Standard;
@ -64,6 +64,11 @@ is
Upper : Integer from Standard) Upper : Integer from Standard)
returns Integer from Standard; returns Integer from Standard;
Id(me;
aIndex: Integer from Standard)
returns Integer from Standard;
Dump(me); Dump(me);
fields fields
@ -72,7 +77,5 @@ fields
myNbMax: Integer from Standard is protected; myNbMax: Integer from Standard is protected;
mySum : Integer from Standard is protected; mySum : Integer from Standard is protected;
myIds : Integer from Standard [8] is protected; myIds : Integer from Standard [8] is protected;
myShapes : Shape from TopoDS [8] is protected;
myUpper : Integer from Standard is protected;
end PassKey; end PassKey;

View File

@ -8,8 +8,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#ifdef WNT #ifdef WNT
#pragma warning( disable : 4101) #pragma warning( disable : 4101)
@ -17,6 +16,9 @@
static static
void SortShell(const int n, int* a); void SortShell(const int n, int* a);
static
Standard_Integer NormalizedId(const Standard_Integer aId,
const Standard_Integer aDiv);
//======================================================================= //=======================================================================
//function : //function :
@ -27,19 +29,6 @@ static
Clear(); Clear();
} }
//======================================================================= //=======================================================================
//function :Clear
//purpose :
//=======================================================================
void GEOMAlgo_PassKey::Clear()
{
myNbIds=0;
myNbMax=8;
mySum=0;
myIds[0]=0; myIds[1]=0; myIds[2]=0; myIds[3]=0;
myIds[4]=0; myIds[5]=0; myIds[6]=0; myIds[7]=0;
myUpper=432123;//2147483647;
}
//=======================================================================
//function :Assign //function :Assign
//purpose : //purpose :
//======================================================================= //=======================================================================
@ -52,115 +41,140 @@ static
return *this; return *this;
} }
//======================================================================= //=======================================================================
//function :Clear
//purpose :
//=======================================================================
void GEOMAlgo_PassKey::Clear()
{
Standard_Integer i;
//
myNbIds=0;
myNbMax=8;
mySum=0;
for (i=0; i<myNbMax; ++i) {
myIds[i]=0;
}
}
//=======================================================================
//function :SetIds //function :SetIds
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_PassKey::SetIds(const TopoDS_Shape& aS1) void GEOMAlgo_PassKey::SetIds(const Standard_Integer anId1)
{ {
Standard_Integer anId1;
//
anId1=aS1.HashCode(myUpper);
//
myNbIds=1; myNbIds=1;
myIds[7]=anId1; myIds[myNbMax-1]=anId1;
mySum=anId1; mySum=anId1;
} }
//======================================================================= //=======================================================================
//function :SetIds //function :SetIds
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_PassKey::SetIds(const TopoDS_Shape& aS1, void GEOMAlgo_PassKey::SetIds(const Standard_Integer anId1,
const TopoDS_Shape& aS2) const Standard_Integer anId2)
{ {
Standard_Integer anId1, anId2; Standard_Integer aIdN1, aIdN2;
//
anId1=aS1.HashCode(myUpper);
anId2=aS2.HashCode(myUpper);
// //
myNbIds=2; myNbIds=2;
mySum=anId1+anId2; aIdN1=NormalizedId(anId1, myNbIds);
aIdN2=NormalizedId(anId2, myNbIds);
mySum=aIdN1+aIdN2;
//
if (anId1<anId2) { if (anId1<anId2) {
myIds[6]=anId1; myIds[myNbMax-2]=anId1;
myIds[7]=anId2; myIds[myNbMax-1]=anId2;
return; return;
} }
myIds[6]=anId2; myIds[myNbMax-2]=anId2;
myIds[7]=anId1; myIds[myNbMax-1]=anId1;
} }
//======================================================================= //=======================================================================
//function :SetIds //function :SetIds
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_PassKey::SetIds(const TopoDS_Shape& aS1, void GEOMAlgo_PassKey::SetIds(const Standard_Integer anId1,
const TopoDS_Shape& aS2, const Standard_Integer anId2,
const TopoDS_Shape& aS3) const Standard_Integer anId3)
{ {
Standard_Integer anId1, anId2, anId3; Standard_Integer aIdN1, aIdN2, aIdN3;
//
anId1=aS1.HashCode(myUpper);
anId2=aS2.HashCode(myUpper);
anId3=aS3.HashCode(myUpper);
// //
myNbIds=3; myNbIds=3;
myIds[5]=anId1; aIdN1=NormalizedId(anId1, myNbIds);
myIds[6]=anId2; aIdN2=NormalizedId(anId2, myNbIds);
myIds[7]=anId3; aIdN3=NormalizedId(anId3, myNbIds);
mySum=anId1+anId2+anId3; mySum=aIdN1+aIdN2+aIdN3;
//
myIds[myNbMax-3]=anId1;
myIds[myNbMax-2]=anId2;
myIds[myNbMax-1]=anId3;
//
Compute(); Compute();
} }
//======================================================================= //=======================================================================
//function :SetIds //function :SetIds
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_PassKey::SetIds(const TopoDS_Shape& aS1, void GEOMAlgo_PassKey::SetIds(const Standard_Integer anId1,
const TopoDS_Shape& aS2, const Standard_Integer anId2,
const TopoDS_Shape& aS3, const Standard_Integer anId3,
const TopoDS_Shape& aS4) const Standard_Integer anId4)
{ {
Standard_Integer anId1, anId2, anId3, anId4; Standard_Integer aIdN1, aIdN2, aIdN3, aIdN4;
//
anId1=aS1.HashCode(myUpper);
anId2=aS2.HashCode(myUpper);
anId3=aS3.HashCode(myUpper);
anId4=aS4.HashCode(myUpper);
// //
myNbIds=4; myNbIds=4;
myIds[4]=anId1; aIdN1=NormalizedId(anId1, myNbIds);
myIds[5]=anId2; aIdN2=NormalizedId(anId2, myNbIds);
myIds[6]=anId3; aIdN3=NormalizedId(anId3, myNbIds);
myIds[7]=anId4; aIdN4=NormalizedId(anId4, myNbIds);
mySum=anId1+anId2+anId3+anId4; mySum=aIdN1+aIdN2+aIdN3+aIdN4;
//
myIds[myNbMax-4]=anId1;
myIds[myNbMax-3]=anId2;
myIds[myNbMax-2]=anId3;
myIds[myNbMax-1]=anId4;
//
Compute(); Compute();
} }
//======================================================================= //=======================================================================
//function :SetIds //function :SetIds
//purpose : //purpose :
//======================================================================= //=======================================================================
void GEOMAlgo_PassKey::SetIds(const TopTools_ListOfShape& aLS) void GEOMAlgo_PassKey::SetIds(const TColStd_ListOfInteger& aLI)
{ {
Standard_Integer aNb, i, anId; Standard_Integer aNb, i, anId, aIdN;
TopTools_ListIteratorOfListOfShape aIt; TColStd_ListIteratorOfListOfInteger aIt;
// //
aNb=aLS.Extent(); aNb=aLI.Extent();
if (aNb<1 || aNb > myNbMax) { if (!aNb || aNb > myNbMax) {
return; return;
} }
// //
myNbIds=aNb; myNbIds=aNb;
mySum=0; mySum=0;
i=myNbMax-myNbIds; i=myNbMax-myNbIds;
aIt.Initialize(aLS); aIt.Initialize(aLI);
for (; aIt.More(); aIt.Next(), ++i) { for (; aIt.More(); aIt.Next(), ++i) {
const TopoDS_Shape& aS=aIt.Value(); anId=aIt.Value();
anId=aS.HashCode(myUpper);
myIds[i]=anId; myIds[i]=anId;
mySum+=anId; aIdN=NormalizedId(anId, myNbIds);
mySum+=aIdN;
} }
// //
Compute(); Compute();
} }
//======================================================================= //=======================================================================
//function :Id
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_PassKey::Id(const Standard_Integer aIndex)const
{
if (aIndex < 0 || aIndex >= myNbMax) {
return 0;
}
return myIds[aIndex];
}
//=======================================================================
//function :NbMax //function :NbMax
//purpose : //purpose :
//======================================================================= //=======================================================================
@ -206,7 +220,8 @@ static
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_PassKey::HashCode(const Standard_Integer Upper) const Standard_Integer GEOMAlgo_PassKey::HashCode(const Standard_Integer Upper) const
{ {
return (mySum % Upper); //return (mySum % Upper);
return ::HashCode(mySum, Upper);
} }
//======================================================================= //=======================================================================
//function : Dump //function : Dump
@ -223,6 +238,23 @@ static
printf(" }"); printf(" }");
} }
//======================================================================= //=======================================================================
// function: NormalizedId
// purpose :
//=======================================================================
Standard_Integer NormalizedId(const Standard_Integer aId,
const Standard_Integer aDiv)
{
Standard_Integer aMax, aTresh, aIdRet;
//
aIdRet=aId;
aMax=::IntegerLast();
aTresh=aMax/aDiv;
if (aId>aTresh) {
aIdRet=aId%aTresh;
}
return aIdRet;
}
//=======================================================================
// function: SortShell // function: SortShell
// purpose : // purpose :
//======================================================================= //=======================================================================

View File

@ -25,17 +25,13 @@
#ifndef _Standard_Integer_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#endif #endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile #ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#endif #endif
#ifndef _Standard_Address_HeaderFile #ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx> #include <Standard_Address.hxx>
#endif #endif
class TopoDS_Shape; class TColStd_ListOfInteger;
class TopTools_ListOfShape;
#ifndef _Standard_HeaderFile #ifndef _Standard_HeaderFile
@ -70,17 +66,18 @@ Standard_EXPORT GEOMAlgo_PassKey& Assign(const GEOMAlgo_PassKey& Other) ;
return Assign(Other); return Assign(Other);
} }
Standard_EXPORT void SetIds(const TopoDS_Shape& aS) ; Standard_EXPORT void SetIds(const Standard_Integer aI1) ;
Standard_EXPORT void SetIds(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2) ; Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2) ;
Standard_EXPORT void SetIds(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3) ; Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2,const Standard_Integer aI3) ;
Standard_EXPORT void SetIds(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3,const TopoDS_Shape& aS4) ; Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2,const Standard_Integer aI3,const Standard_Integer aI4) ;
Standard_EXPORT void SetIds(const TopTools_ListOfShape& aLS) ; Standard_EXPORT void SetIds(const TColStd_ListOfInteger& aLS) ;
Standard_EXPORT Standard_Integer NbMax() const; Standard_EXPORT Standard_Integer NbMax() const;
Standard_EXPORT void Clear() ; Standard_EXPORT void Clear() ;
Standard_EXPORT void Compute() ; Standard_EXPORT void Compute() ;
Standard_EXPORT Standard_Boolean IsEqual(const GEOMAlgo_PassKey& aOther) const; Standard_EXPORT Standard_Boolean IsEqual(const GEOMAlgo_PassKey& aOther) const;
Standard_EXPORT Standard_Address Key() const; Standard_EXPORT Standard_Address Key() const;
Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const; Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const;
Standard_EXPORT Standard_Integer Id(const Standard_Integer aIndex) const;
Standard_EXPORT void Dump() const; Standard_EXPORT void Dump() const;
@ -99,8 +96,6 @@ Standard_Integer myNbIds;
Standard_Integer myNbMax; Standard_Integer myNbMax;
Standard_Integer mySum; Standard_Integer mySum;
Standard_Integer myIds[8]; Standard_Integer myIds[8];
TopoDS_Shape myShapes[8];
Standard_Integer myUpper;
private: private:

View File

@ -1,8 +1,5 @@
#ifndef _TopoDS_Shape_HeaderFile #ifndef _TColStd_ListOfInteger_HeaderFile
#include <TopoDS_Shape.hxx> #include <TColStd_ListOfInteger.hxx>
#endif
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
#endif #endif
#ifndef _GEOMAlgo_PassKey_HeaderFile #ifndef _GEOMAlgo_PassKey_HeaderFile
#include <GEOMAlgo_PassKey.hxx> #include <GEOMAlgo_PassKey.hxx>

View File

@ -0,0 +1,48 @@
-- File: GEOMAlgo_PassKeyShape.cdl
-- Created:
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright:
class PassKeyShape from GEOMAlgo
inherits PassKey from GEOMAlgo
---Purpose:
uses
Shape from TopoDS,
ListOfShape from TopTools
--raises
is
Create
returns PassKeyShape from GEOMAlgo;
SetIds(me:out;
aS :Shape from TopoDS);
SetIds(me:out;
aS1 :Shape from TopoDS;
aS2 :Shape from TopoDS);
SetIds(me:out;
aS1 :Shape from TopoDS;
aS2 :Shape from TopoDS;
aS3 :Shape from TopoDS);
SetIds(me:out;
aS1 :Shape from TopoDS;
aS2 :Shape from TopoDS;
aS3 :Shape from TopoDS;
aS4 :Shape from TopoDS);
SetIds(me:out;
aLS :ListOfShape from TopTools);
fields
myUpper : Integer from Standard is protected;
end PassKeyShape;

View File

@ -0,0 +1,112 @@
// File: GEOMAlgo_PassKeyShape.cxx
// Created:
// Author: Peter KURNEV
// <pkv@irinox>
#include <GEOMAlgo_PassKeyShape.ixx>
#include <stdio.h>
#include <string.h>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TColStd_ListOfInteger.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
GEOMAlgo_PassKeyShape::GEOMAlgo_PassKeyShape()
:
GEOMAlgo_PassKey()
{
myUpper=432123;
GEOMAlgo_PassKey::Clear();
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1)
{
Standard_Integer anId1;
//
anId1=aS1.HashCode(myUpper);
GEOMAlgo_PassKey::SetIds(anId1);
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2)
{
Standard_Integer anId1, anId2;
//
anId1=aS1.HashCode(myUpper);
anId2=aS2.HashCode(myUpper);
//
GEOMAlgo_PassKey::SetIds(anId1, anId2);
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2,
const TopoDS_Shape& aS3)
{
Standard_Integer anId1, anId2, anId3;
//
anId1=aS1.HashCode(myUpper);
anId2=aS2.HashCode(myUpper);
anId3=aS3.HashCode(myUpper);
//
GEOMAlgo_PassKey::SetIds(anId1, anId2, anId3);
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2,
const TopoDS_Shape& aS3,
const TopoDS_Shape& aS4)
{
Standard_Integer anId1, anId2, anId3, anId4;
//
anId1=aS1.HashCode(myUpper);
anId2=aS2.HashCode(myUpper);
anId3=aS3.HashCode(myUpper);
anId4=aS4.HashCode(myUpper);
//
GEOMAlgo_PassKey::SetIds(anId1, anId2, anId3, anId4);
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
void GEOMAlgo_PassKeyShape::SetIds(const TopTools_ListOfShape& aLS)
{
Standard_Integer anId;
TopTools_ListIteratorOfListOfShape aIt;
TColStd_ListOfInteger aLI;
//
//aNb=aLS.Extent();
//if (aNb<1 || aNb > myNbMax) {
// return;
//}
//
//myNbIds=aNb;
//mySum=0;
//i=myNbMax-myNbIds;
aIt.Initialize(aLS);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Value();
anId=aS.HashCode(myUpper);
aLI.Append(anId);
}
GEOMAlgo_PassKey::SetIds(aLI);
}

View File

@ -19,16 +19,17 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#ifndef _GEOMAlgo_SolidSolid_HeaderFile #ifndef _GEOMAlgo_PassKeyShape_HeaderFile
#define _GEOMAlgo_SolidSolid_HeaderFile #define _GEOMAlgo_PassKeyShape_HeaderFile
#ifndef _TopoDS_Shape_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <TopoDS_Shape.hxx> #include <Standard_Integer.hxx>
#endif #endif
#ifndef _GEOMAlgo_ShellSolid_HeaderFile #ifndef _GEOMAlgo_PassKey_HeaderFile
#include <GEOMAlgo_ShellSolid.hxx> #include <GEOMAlgo_PassKey.hxx>
#endif #endif
class TopoDS_Shape; class TopoDS_Shape;
class TopTools_ListOfShape;
#ifndef _Standard_HeaderFile #ifndef _Standard_HeaderFile
@ -38,7 +39,7 @@ class TopoDS_Shape;
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#endif #endif
class GEOMAlgo_SolidSolid : public GEOMAlgo_ShellSolid { class GEOMAlgo_PassKeyShape : public GEOMAlgo_PassKey {
public: public:
@ -56,11 +57,12 @@ public:
} }
// Methods PUBLIC // Methods PUBLIC
// //
Standard_EXPORT GEOMAlgo_SolidSolid(); Standard_EXPORT GEOMAlgo_PassKeyShape();
Standard_EXPORT virtual ~GEOMAlgo_SolidSolid(); Standard_EXPORT void SetIds(const TopoDS_Shape& aS) ;
Standard_EXPORT virtual void Perform() ; Standard_EXPORT void SetIds(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2) ;
Standard_EXPORT void SetShape2(const TopoDS_Shape& aS) ; Standard_EXPORT void SetIds(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3) ;
Standard_EXPORT const TopoDS_Shape& Shape2() const; Standard_EXPORT void SetIds(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3,const TopoDS_Shape& aS4) ;
Standard_EXPORT void SetIds(const TopTools_ListOfShape& aLS) ;
@ -70,12 +72,11 @@ protected:
// Methods PROTECTED // Methods PROTECTED
// //
Standard_EXPORT virtual void BuildResult() ;
// Fields PROTECTED // Fields PROTECTED
// //
TopoDS_Shape myS2; Standard_Integer myUpper;
private: private:

View File

@ -19,7 +19,7 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#include <GEOMAlgo_ShellSolid.jxx> #include <GEOMAlgo_PassKeyShape.jxx>

View File

@ -0,0 +1,9 @@
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
#endif
#ifndef _GEOMAlgo_PassKeyShape_HeaderFile
#include <GEOMAlgo_PassKeyShape.hxx>
#endif

View File

@ -1,48 +0,0 @@
-- File: GEOMAlgo_ShapeSolid.cdl
-- Created: Thu Jan 13 12:44:07 2005
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright: Matra Datavision 2005
deferred class ShapeSolid from GEOMAlgo
inherits Algo from GEOMAlgo
---Purpose:
uses
State from TopAbs,
ListOfShape from TopTools,
PDSFiller from BOPTools,
DSFiller from BOPTools
--raises
is
Initialize
returns ShapeSolid from GEOMAlgo;
SetFiller(me:out;
aDSF:DSFiller from BOPTools);
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ShapeSolid();"
Shapes(me;
aState:State from TopAbs)
returns ListOfShape from TopTools;
---C++: return const &
BuildResult (me:out)
is deferred protected;
Prepare(me:out)
is deferred protected;
fields
myLSIN : ListOfShape from TopTools is protected;
myLSOUT : ListOfShape from TopTools is protected;
myLSON : ListOfShape from TopTools is protected;
myRank : Integer from Standard is protected;
myDSFiller : PDSFiller from BOPTools is protected;
end ShapeSolid;

View File

@ -1,61 +0,0 @@
// File: GEOMAlgo_ShapeSolid.cxx
// Created: Thu Jan 13 12:54:48 2005
// Author: Peter KURNEV
// <pkv@irinox>
#include <GEOMAlgo_ShapeSolid.ixx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
//=======================================================================
//function : GEOMAlgo_ShapeSolid
//purpose :
//=======================================================================
GEOMAlgo_ShapeSolid::GEOMAlgo_ShapeSolid()
:
GEOMAlgo_Algo(),
myRank(0),
myDSFiller(NULL)
{
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
GEOMAlgo_ShapeSolid::~GEOMAlgo_ShapeSolid()
{
}
//=======================================================================
//function : SetFiller
//purpose :
//=======================================================================
void GEOMAlgo_ShapeSolid::SetFiller(const BOPTools_DSFiller& aDSFiller)
{
myDSFiller=(BOPTools_DSFiller*) &aDSFiller;
}
//=======================================================================
// function: Shapes
// purpose:
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_ShapeSolid::Shapes(const TopAbs_State aState) const
{
const TopTools_ListOfShape *pL;
//
switch (aState) {
case TopAbs_IN:
pL=&myLSIN;
break;
case TopAbs_OUT:
pL=&myLSOUT;
break;
case TopAbs_ON:
pL=&myLSON;
break;
default:
pL=&myLSON;
break;
}
return *pL;
}

View File

@ -1,9 +0,0 @@
#ifndef _BOPTools_DSFiller_HeaderFile
#include <BOPTools_DSFiller.hxx>
#endif
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
#endif
#ifndef _GEOMAlgo_ShapeSolid_HeaderFile
#include <GEOMAlgo_ShapeSolid.hxx>
#endif

View File

@ -1,34 +0,0 @@
-- File: GEOMAlgo_ShellSolid.cdl
-- Created: Wed Jan 12 12:45:20 2005
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright: Matra Datavision 2005
class ShellSolid from GEOMAlgo
inherits ShapeSolid from GEOMAlgo
---Purpose:
--uses
--raises
is
Create
returns ShellSolid from GEOMAlgo;
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ShellSolid();"
Perform (me:out)
is redefined;
Prepare(me:out)
is redefined protected;
BuildResult (me:out)
is redefined protected;
DetectSDFaces(me:out)
is protected;
--fields
end ShellSolid;

View File

@ -1,350 +0,0 @@
// File: GEOMAlgo_ShellSolid.cxx
// Created: Wed Jan 12 12:49:45 2005
// Author: Peter KURNEV
// <pkv@irinox>
#include <GEOMAlgo_ShellSolid.ixx>
#include <Standard_Failure.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Solid.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <IntTools_Context.hxx>
#include <BOPTColStd_Dump.hxx>
#include <BooleanOperations_ShapesDataStructure.hxx>
#include <BOPTools_PaveFiller.hxx>
#include <BOPTools_SolidStateFiller.hxx>
#include <BOPTools_PCurveMaker.hxx>
#include <BOPTools_DEProcessor.hxx>
#include <BOPTools_InterferencePool.hxx>
#include <BOPTools_CArray1OfSSInterference.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_PaveBlock.hxx>
#include <BOPTools_SSInterference.hxx>
#include <BOPTools_SequenceOfCurves.hxx>
#include <BOPTools_Curve.hxx>
#include <BOPTools_PaveFiller.hxx>
#include <BOPTools_SplitShapesPool.hxx>
#include <BOPTools_Tools3D.hxx>
#include <BOPTools_DSFiller.hxx>
#include <BOP_WireEdgeSet.hxx>
#include <BOP_SDFWESFiller.hxx>
#include <BOP_FaceBuilder.hxx>
//=======================================================================
//function : GEOMAlgo_ShellSolid
//purpose :
//=======================================================================
GEOMAlgo_ShellSolid::GEOMAlgo_ShellSolid()
:
GEOMAlgo_ShapeSolid()
{
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
GEOMAlgo_ShellSolid::~GEOMAlgo_ShellSolid()
{
}
//=======================================================================
// function:
// purpose:
//=======================================================================
void GEOMAlgo_ShellSolid::Perform()
{
myErrorStatus=0;
//
try {
if (myDSFiller==NULL) {
myErrorStatus=10;
return;
}
if(!myDSFiller->IsDone()) {
myErrorStatus=11;
return;
}
//
Standard_Boolean bIsNewFiller;
//
bIsNewFiller=myDSFiller->IsNewFiller();
if (bIsNewFiller) {
Prepare();
myDSFiller->SetNewFiller(!bIsNewFiller);
}
//
myRank=(myDSFiller->DS().Object().ShapeType()==TopAbs_SHELL) ? 1 : 2;
BuildResult();
}
catch (Standard_Failure) {
myErrorStatus=12;
}
}
//=======================================================================
// function: Prepare
// purpose:
//=======================================================================
void GEOMAlgo_ShellSolid::Prepare()
{
const BOPTools_PaveFiller& aPaveFiller=myDSFiller->PaveFiller();
//
// 1 States
BOPTools_SolidStateFiller aStateFiller(aPaveFiller);
aStateFiller.Do();
//
// 2 Project section edges on corresp. faces -> P-Curves on edges.
BOPTools_PCurveMaker aPCurveMaker(aPaveFiller);
aPCurveMaker.Do();
//
// 3. Degenerated Edges Processing
BOPTools_DEProcessor aDEProcessor(aPaveFiller);
aDEProcessor.Do();
//
// 4. Detect Same Domain Faces
DetectSDFaces();
}
//=================================================================================
// function: BuildResult
// purpose:
//=================================================================================
void GEOMAlgo_ShellSolid::BuildResult()
{
Standard_Boolean bIsTouchCase;
Standard_Integer i, j, nF1, nF2, aNbFFs, aNbS, aNbCurves, nSp, iRank1;
Standard_Integer nE, nF, aNbPB, iBeg, iEnd;
BooleanOperations_StateOfShape aState;
TopExp_Explorer anExp;
TopAbs_ShapeEnum aType;
gp_Pnt2d aP2D;
gp_Pnt aP3D;
//
const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
const BOPTools_InterferencePool& anInterfPool=myDSFiller->InterfPool();
BOPTools_InterferencePool* pInterfPool=(BOPTools_InterferencePool*) &anInterfPool;
BOPTools_CArray1OfSSInterference& aFFs=pInterfPool->SSInterferences();
const BOPTools_PaveFiller& aPaveFiller=myDSFiller->PaveFiller();
const BOPTools_SplitShapesPool& aSplitShapesPool=aPaveFiller.SplitShapesPool();
//
// 1. process pf non-interferring faces
iBeg=1;
iEnd=aDS.NumberOfShapesOfTheObject();
if (myRank==2) {
iBeg=iEnd+1;
iEnd=aDS.NumberOfSourceShapes();
}
//
for (i=iBeg; i<=iEnd; ++i) {
aType=aDS.GetShapeType(i);
if (aType!=TopAbs_FACE) {
continue;
}
//
const TopoDS_Face& aF1=TopoDS::Face(aDS.Shape(i));
aState=aDS.GetState(i);
if (aState==BooleanOperations_IN) {
myLSIN.Append(aF1);
}
else if (aState==BooleanOperations_OUT) {
myLSOUT.Append(aF1);
}
}
//
// 2. process pf interferred faces
aNbFFs=aFFs.Extent();
for (i=1; i<=aNbFFs; ++i) {
BOPTools_SSInterference& aFFi=aFFs(i);
//
nF1=aFFi.Index1();
nF2=aFFi.Index2();
iRank1=aDS.Rank(nF1);
nF=(iRank1==myRank) ? nF1 : nF2;
const TopoDS_Face& aF1=TopoDS::Face(aDS.Shape(nF));
//
bIsTouchCase=aFFi.IsTangentFaces();
//
if (bIsTouchCase) {
myLSON.Append(aF1);
continue;
}
//
// Has section edges ?
aNbS=0;
BOPTools_SequenceOfCurves& aBCurves=aFFi.Curves();
aNbCurves=aBCurves.Length();
for (j=1; j<=aNbCurves; j++) {
BOPTools_Curve& aBC=aBCurves(j);
const BOPTools_ListOfPaveBlock& aSectEdges=aBC.NewPaveBlocks();
aNbS=aSectEdges.Extent();
if (aNbS) {
break;
}
}
//
if (aNbS) { // it has
continue;
}
//
anExp.Init(aF1, TopAbs_EDGE);
for (; anExp.More(); anExp.Next()) {
const TopoDS_Edge& aE=TopoDS::Edge(anExp.Current());
if (BRep_Tool::Degenerated(aE)) {
continue;
}
//
nE=aDS.ShapeIndex(aE, myRank);
const BOPTools_ListOfPaveBlock& aLPB=aSplitShapesPool(aDS.RefEdge(nE));
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;
} // if (aNbPB<2) {
} //for (; anExp.More(); anExp.Next())
}
}
//=======================================================================
// function: DetectSDFaces
// purpose:
//=======================================================================
void GEOMAlgo_ShellSolid::DetectSDFaces()
{
const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
BOPTools_InterferencePool* pIntrPool=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
BOPTools_CArray1OfSSInterference& aFFs=pIntrPool->SSInterferences();
//
Standard_Boolean bFlag;
Standard_Integer i, aNb, nF1, nF2, iZone, aNbSps, iSenseFlag;
gp_Dir aDNF1, aDNF2;
aNb=aFFs.Extent();
for (i=1; i<=aNb; i++) {
bFlag=Standard_False;
BOPTools_SSInterference& aFF=aFFs(i);
nF1=aFF.Index1();
nF2=aFF.Index2();
const TopoDS_Face& aF1=TopoDS::Face(aDS.Shape(nF1));
const TopoDS_Face& aF2=TopoDS::Face(aDS.Shape(nF2));
//
// iSenseFlag;
const BOPTools_ListOfPaveBlock& aLPB=aFF.PaveBlocks();
aNbSps=aLPB.Extent();
if (!aNbSps) {
continue;
}
const BOPTools_PaveBlock& aPB=aLPB.First();
const TopoDS_Edge& aSpE=TopoDS::Edge(aDS.Shape(aPB.Edge()));
BOPTools_Tools3D::GetNormalToFaceOnEdge (aSpE, aF1, aDNF1);
BOPTools_Tools3D::GetNormalToFaceOnEdge (aSpE, aF2, aDNF2);
iSenseFlag=BOPTools_Tools3D::SenseFlag (aDNF1, aDNF2);
//
if (iSenseFlag==1 || iSenseFlag==-1) {
//
//
TopoDS_Face aF1FWD=aF1;
aF1FWD.Orientation (TopAbs_FORWARD);
BOP_WireEdgeSet aWES (aF1FWD);
BOP_SDFWESFiller aWESFiller(nF1, nF2, *myDSFiller);
aWESFiller.SetSenseFlag(iSenseFlag);
aWESFiller.SetOperation(BOP_COMMON);
aWESFiller.Do(aWES);
BOP_FaceBuilder aFB;
aFB.Do(aWES);
const TopTools_ListOfShape& aLF=aFB.NewFaces();
iZone=0;
TopTools_ListIteratorOfListOfShape anIt(aLF);
for (; anIt.More(); anIt.Next()) {
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 (iZone) {
bFlag=Standard_True;
aFF.SetStatesMap(aWESFiller.StatesMap());
}
}// if (iSenseFlag)
aFF.SetTangentFacesFlag(bFlag);
aFF.SetSenseFlag (iSenseFlag);
}// end of for (i=1; i<=aNb; i++)
}

View File

@ -1,96 +0,0 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#ifndef _GEOMAlgo_ShellSolid_HeaderFile
#define _GEOMAlgo_ShellSolid_HeaderFile
#ifndef _GEOMAlgo_ShapeSolid_HeaderFile
#include <GEOMAlgo_ShapeSolid.hxx>
#endif
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class GEOMAlgo_ShellSolid : public GEOMAlgo_ShapeSolid {
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
//
Standard_EXPORT GEOMAlgo_ShellSolid();
Standard_EXPORT virtual ~GEOMAlgo_ShellSolid();
Standard_EXPORT virtual void Perform() ;
protected:
// Methods PROTECTED
//
Standard_EXPORT virtual void Prepare() ;
Standard_EXPORT virtual void BuildResult() ;
Standard_EXPORT void DetectSDFaces() ;
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -1,3 +0,0 @@
#ifndef _GEOMAlgo_ShellSolid_HeaderFile
#include <GEOMAlgo_ShellSolid.hxx>
#endif

View File

@ -1,39 +0,0 @@
-- File: GEOMAlgo_SolidSolid.cdl
-- Created: Wed Jan 26 12:05:14 2005
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright: Matra Datavision 2005
class SolidSolid from GEOMAlgo
inherits ShellSolid from GEOMAlgo
---Purpose:
uses
Shape from TopoDS
--raises
is
Create
returns SolidSolid from GEOMAlgo;
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_SolidSolid();"
Perform (me:out)
is redefined;
BuildResult (me:out)
is redefined protected;
SetShape2 (me:out;
aS: Shape from TopoDS);
Shape2 (me)
returns Shape from TopoDS;
---C++: return const &
fields
myS2: Shape from TopoDS is protected;
end SolidSolid;

View File

@ -1,182 +0,0 @@
// File: GEOMAlgo_SolidSolid.cxx
// Created: Wed Jan 26 12:06:26 2005
// Author: Peter KURNEV
// <pkv@irinox>
#include <GEOMAlgo_SolidSolid.ixx>
#include <Standard_Failure.hxx>
#include <TopAbs_State.hxx>
#include <TopoDS_Shape.hxx>
#include <TopExp.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BooleanOperations_ShapesDataStructure.hxx>
#include <BOPTools_DSFiller.hxx>
#include <GEOMAlgo_IndexedDataMapOfShapeState.hxx>
//=======================================================================
//function : GEOMAlgo_SolidSolid
//purpose :
//=======================================================================
GEOMAlgo_SolidSolid::GEOMAlgo_SolidSolid()
:
GEOMAlgo_ShellSolid()
{
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
GEOMAlgo_SolidSolid::~GEOMAlgo_SolidSolid()
{
}
//=======================================================================
// function: SetShape2
// purpose:
//=======================================================================
void GEOMAlgo_SolidSolid::SetShape2(const TopoDS_Shape& aS2)
{
myS2=aS2;
}
//=======================================================================
// function: Shape2
// purpose:
//=======================================================================
const TopoDS_Shape& GEOMAlgo_SolidSolid::Shape2()const
{
return myS2;
}
//=======================================================================
// function: Perform
// purpose:
//=======================================================================
void GEOMAlgo_SolidSolid::Perform()
{
myErrorStatus=0;
try {
if (myDSFiller==NULL) {
myErrorStatus=10;
return;
}
if(!myDSFiller->IsDone()) {
myErrorStatus=11;
return;
}
//
Standard_Boolean bIsNewFiller;
//
bIsNewFiller=myDSFiller->IsNewFiller();
if (bIsNewFiller) {
Prepare();
myDSFiller->SetNewFiller(!bIsNewFiller);
}
//
myRank=2;
BuildResult();
}
catch (Standard_Failure) {
myErrorStatus=12;
}
}
//=================================================================================
// function: BuildResult
// purpose:
//=================================================================================
void GEOMAlgo_SolidSolid::BuildResult()
{
myErrorStatus=0;
//
Standard_Integer i, j, aNbF, aNbS;
Standard_Integer aNbFIN, aNbFOUT, aNbFON, aNbFINTR;
TopAbs_State aState;
TopTools_ListIteratorOfListOfShape aIt;
TopTools_IndexedMapOfShape aMF, aMS;
GEOMAlgo_IndexedDataMapOfShapeState aMFS;
//
// 1. classify the faces
GEOMAlgo_ShellSolid::BuildResult();
//
// 2. fill Shape-State map
aIt.Initialize(myLSIN);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
aMFS.Add(aF, TopAbs_IN);
}
aIt.Initialize(myLSOUT);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
aMFS.Add(aF, TopAbs_OUT);
}
aIt.Initialize(myLSON);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
aMFS.Add(aF, TopAbs_ON);
}
myLSIN.Clear();
myLSON.Clear();
myLSOUT.Clear();
//
// 3. fill states for solids
TopExp::MapShapes(myS2, TopAbs_SOLID, aMS);
//
aNbS=aMS.Extent();
for (i=1; i<=aNbS; ++i) {
const TopoDS_Shape& aSolid=aMS(i);
//
aMF.Clear();
TopExp::MapShapes(aSolid, TopAbs_FACE, aMF);
//
aNbFIN=0;
aNbFOUT=0;
aNbFON=0;
aNbFINTR=0;
//
aNbF=aMF.Extent();
for(j=1; j<aNbF; ++j) {
const TopoDS_Shape& aF=aMF(j);
//
if (!aMFS.Contains(aF)) {// the face is intesected
++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;
}
if (aNbFIN && aNbFOUT) {
++aNbFINTR;
break;
}
}
//
if (!aNbFINTR) {
if (aNbFON==aNbF) {
myLSON.Append(aSolid);
}
else if (aNbFIN) {
myLSIN.Append(aSolid);
}
else if (aNbFOUT) {
myLSOUT.Append(aSolid);
}
}
}
}

View File

@ -1,6 +0,0 @@
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _GEOMAlgo_SolidSolid_HeaderFile
#include <GEOMAlgo_SolidSolid.hxx>
#endif

View File

@ -0,0 +1,31 @@
-- File: GEOMAlgo_StateCollector.cdl
-- Created: Thu Mar 10 09:39:25 2005
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright: Matra Datavision 2005
class StateCollector from GEOMAlgo
---Purpose:
uses
State from TopAbs
--raises
is
Create
returns StateCollector from GEOMAlgo;
AppendState(me:out;
aSt:State from TopAbs)
returns Boolean from Standard;
State(me)
returns State from TopAbs;
fields
myCounter:Integer from Standard[3];
end StateCollector;

View File

@ -0,0 +1,71 @@
// File: GEOMAlgo_StateCollector.cxx
// Created: Thu Mar 10 09:42:11 2005
// Author: Peter KURNEV
// <pkv@irinox>
#include <GEOMAlgo_StateCollector.ixx>
//=======================================================================
//function : GEOMAlgo_StateCollector
//purpose :
//=======================================================================
GEOMAlgo_StateCollector::GEOMAlgo_StateCollector()
{
myCounter[0]=0;
myCounter[1]=0;
myCounter[2]=0;
}
//=======================================================================
//function : AppendState
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_StateCollector::AppendState(const TopAbs_State aSt)
{
Standard_Boolean bIsToBreak;
//
switch(aSt) {
case TopAbs_IN:
++myCounter[0];
break;
case TopAbs_OUT:
++myCounter[1];
break;
case TopAbs_ON:
++myCounter[2];
break;
default:
break;
}
bIsToBreak=(myCounter[0] && myCounter[1]);
//
return bIsToBreak;
}
//=======================================================================
//function : State
//purpose :
//=======================================================================
TopAbs_State GEOMAlgo_StateCollector::State()const
{
TopAbs_State aSt;
//
aSt=TopAbs_UNKNOWN;
//
if (myCounter[0] && myCounter[1]) {
return aSt;
}
//
else if (myCounter[0] && myCounter[2]>=0) {
aSt=TopAbs_IN;
}
//
else if (myCounter[1] && myCounter[2]>=0) {
aSt=TopAbs_OUT;
}
//
else if (!myCounter[0] && !myCounter[1] && myCounter[2]) {
aSt=TopAbs_ON;
}
//
return aSt;
}

View File

@ -19,11 +19,17 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#ifndef _GEOMAlgo_WireSolid_HeaderFile #ifndef _GEOMAlgo_StateCollector_HeaderFile
#define _GEOMAlgo_WireSolid_HeaderFile #define _GEOMAlgo_StateCollector_HeaderFile
#ifndef _GEOMAlgo_ShapeSolid_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <GEOMAlgo_ShapeSolid.hxx> #include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _TopAbs_State_HeaderFile
#include <TopAbs_State.hxx>
#endif #endif
@ -34,7 +40,7 @@
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#endif #endif
class GEOMAlgo_WireSolid : public GEOMAlgo_ShapeSolid { class GEOMAlgo_StateCollector {
public: public:
@ -52,9 +58,9 @@ public:
} }
// Methods PUBLIC // Methods PUBLIC
// //
Standard_EXPORT GEOMAlgo_WireSolid(); Standard_EXPORT GEOMAlgo_StateCollector();
Standard_EXPORT virtual ~GEOMAlgo_WireSolid(); Standard_EXPORT Standard_Boolean AppendState(const TopAbs_State aSt) ;
Standard_EXPORT virtual void Perform() ; Standard_EXPORT TopAbs_State State() const;
@ -64,8 +70,6 @@ protected:
// Methods PROTECTED // Methods PROTECTED
// //
Standard_EXPORT virtual void Prepare() ;
Standard_EXPORT virtual void BuildResult() ;
// Fields PROTECTED // Fields PROTECTED
@ -80,6 +84,7 @@ private:
// Fields PRIVATE // Fields PRIVATE
// //
Standard_Integer myCounter[3];
}; };

View File

@ -19,7 +19,7 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#include <GEOMAlgo_ShapeSolid.jxx> #include <GEOMAlgo_StateCollector.jxx>

View File

@ -0,0 +1,3 @@
#ifndef _GEOMAlgo_StateCollector_HeaderFile
#include <GEOMAlgo_StateCollector.hxx>
#endif

View File

@ -15,21 +15,38 @@ uses
Cylinder from gp, Cylinder from gp,
Sphere from gp, Sphere from gp,
Surface from Geom, Surface from Geom,
Surface from GeomAdaptor,
State from TopAbs, State from TopAbs,
State from GEOMAlgo State from GEOMAlgo
--raises --raises
is is
IsAnalytic(myclass; IsAnalytic(myclass;
aS:Surface from Geom) aS:Surface from Geom)
returns Boolean from Standard; returns Boolean from Standard;
IsCoaxial(myclass;
aP1 : Pnt from gp;
aP2 : Pnt from gp;
aCyl : Cylinder from gp;
aTol : Real from Standard)
returns Boolean from Standard;
IsConformState(myclass; IsConformState(myclass;
aST1:State from TopAbs; aST1:State from TopAbs;
aST2:State from GEOMAlgo) aST2:State from GEOMAlgo)
returns Boolean from Standard; returns Boolean from Standard;
GetState(myclass;
aP:Pnt from gp;
aS:Surface from GeomAdaptor;
aTol:Real from Standard;
aSt:out State from TopAbs)
returns Integer from Standard;
GetState(myclass; GetState(myclass;
aP:Pnt from gp; aP:Pnt from gp;
aS:Surface from Geom; aS:Surface from Geom;

View File

@ -6,6 +6,8 @@
#include <GEOMAlgo_SurfaceTools.ixx> #include <GEOMAlgo_SurfaceTools.ixx>
#include <math.h>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <gp_Cylinder.hxx> #include <gp_Cylinder.hxx>
#include <gp_Sphere.hxx> #include <gp_Sphere.hxx>
@ -13,30 +15,31 @@
#include <gp_Lin.hxx> #include <gp_Lin.hxx>
#include <gp_Ax3.hxx> #include <gp_Ax3.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
#include <gp_Ax1.hxx>
#include <gp_Vec.hxx>
#include <GeomAbs_SurfaceType.hxx> #include <GeomAbs_SurfaceType.hxx>
#include <GeomAdaptor_Surface.hxx> #include <GeomAdaptor_Surface.hxx>
//======================================================================= //=======================================================================
//function : GetState //function : GetState
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP, Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
const Handle(Geom_Surface)& aSurf, const GeomAdaptor_Surface& aGAS,
const Standard_Real aTol, const Standard_Real aTol,
TopAbs_State& aState) TopAbs_State& aState)
{ {
Standard_Integer iErr; Standard_Integer iErr;
Standard_Real aDp, aR; Standard_Real aDp, aR;
GeomAbs_SurfaceType aType; GeomAbs_SurfaceType aType;
GeomAdaptor_Surface aGAS;
gp_Sphere aSph; gp_Sphere aSph;
gp_Cylinder aCyl; gp_Cylinder aCyl;
gp_Pln aPln; gp_Pln aPln;
// //
iErr=0; iErr=0;
aState=TopAbs_UNKNOWN; aState=TopAbs_UNKNOWN;
aGAS.Load(aSurf);
// //
aType=aGAS.GetType(); aType=aGAS.GetType();
switch (aType) { switch (aType) {
@ -76,6 +79,25 @@
return iErr; return iErr;
} }
//======================================================================= //=======================================================================
//function : GetState
//purpose :
//=======================================================================
Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
const Handle(Geom_Surface)& aSurf,
const Standard_Real aTol,
TopAbs_State& aState)
{
Standard_Integer iErr;
GeomAdaptor_Surface aGAS;
//
aState=TopAbs_UNKNOWN;
aGAS.Load(aSurf);
//
iErr=GEOMAlgo_SurfaceTools::GetState(aP, aGAS, aTol, aState);
//
return iErr;
}
//=======================================================================
//function : ReverseState //function : ReverseState
//purpose : //purpose :
//======================================================================= //=======================================================================
@ -103,9 +125,8 @@
Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP, Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
const gp_Sphere& aSph) const gp_Sphere& aSph)
{ {
Standard_Real aD, aR; Standard_Real aD;
// //
aR=aSph.Radius();
const gp_Pnt& aLoc=aSph.Location(); const gp_Pnt& aLoc=aSph.Location();
aD=aLoc.Distance(aP); aD=aLoc.Distance(aP);
// //
@ -118,9 +139,8 @@ Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP, Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
const gp_Cylinder& aCyl) const gp_Cylinder& aCyl)
{ {
Standard_Real aD, aR; Standard_Real aD;
// //
aR=aCyl.Radius();
const gp_Ax1& aAxis=aCyl.Axis(); const gp_Ax1& aAxis=aCyl.Axis();
gp_Lin aLin(aAxis); gp_Lin aLin(aAxis);
aD=aLin.Distance(aP); aD=aLin.Distance(aP);
@ -146,6 +166,31 @@ Standard_Real GEOMAlgo_SurfaceTools::Distance(const gp_Pnt& aP,
return aD; return aD;
} }
//======================================================================= //=======================================================================
//function : IsCoaxial
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
const gp_Pnt& aP2,
const gp_Cylinder& aCyl,
const Standard_Real aTol)
{
Standard_Boolean bRet=Standard_False;
Standard_Real aSM;
//
gp_Vec aV12(aP1, aP2);
gp_Dir aD12(aV12);
//
const gp_Ax1& aAxis=aCyl.Axis();
const gp_Dir& aDAxis=aAxis.Direction();
//
aSM=fabs(aD12*aDAxis);
if (fabs(1.-aSM) > aTol) {
return bRet;
}
//
return !bRet;
}
//=======================================================================
//function : IsAnalytic //function : IsAnalytic
//purpose : //purpose :
//======================================================================= //=======================================================================

View File

@ -28,6 +28,9 @@
#ifndef _Handle_Geom_Surface_HeaderFile #ifndef _Handle_Geom_Surface_HeaderFile
#include <Handle_Geom_Surface.hxx> #include <Handle_Geom_Surface.hxx>
#endif #endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _TopAbs_State_HeaderFile #ifndef _TopAbs_State_HeaderFile
#include <TopAbs_State.hxx> #include <TopAbs_State.hxx>
#endif #endif
@ -37,13 +40,11 @@
#ifndef _Standard_Integer_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#endif #endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
class Geom_Surface; class Geom_Surface;
class gp_Pnt; class gp_Pnt;
class gp_Pln;
class gp_Cylinder; class gp_Cylinder;
class GeomAdaptor_Surface;
class gp_Pln;
class gp_Sphere; class gp_Sphere;
@ -73,7 +74,9 @@ public:
// Methods PUBLIC // Methods PUBLIC
// //
Standard_EXPORT static Standard_Boolean IsAnalytic(const Handle(Geom_Surface)& aS) ; Standard_EXPORT static Standard_Boolean IsAnalytic(const Handle(Geom_Surface)& aS) ;
Standard_EXPORT static Standard_Boolean IsCoaxial(const gp_Pnt& aP1,const gp_Pnt& aP2,const gp_Cylinder& aCyl,const Standard_Real aTol) ;
Standard_EXPORT static Standard_Boolean IsConformState(const TopAbs_State aST1,const GEOMAlgo_State aST2) ; Standard_EXPORT static Standard_Boolean IsConformState(const TopAbs_State aST1,const GEOMAlgo_State aST2) ;
Standard_EXPORT static Standard_Integer GetState(const gp_Pnt& aP,const GeomAdaptor_Surface& aS,const Standard_Real aTol,TopAbs_State& aSt) ;
Standard_EXPORT static Standard_Integer GetState(const gp_Pnt& aP,const Handle(Geom_Surface)& aS,const Standard_Real aTol,TopAbs_State& aSt) ; Standard_EXPORT static Standard_Integer GetState(const gp_Pnt& aP,const Handle(Geom_Surface)& aS,const Standard_Real aTol,TopAbs_State& aSt) ;
Standard_EXPORT static Standard_Real Distance(const gp_Pnt& aP,const gp_Pln& aPln) ; Standard_EXPORT static Standard_Real Distance(const gp_Pnt& aP,const gp_Pln& aPln) ;
Standard_EXPORT static Standard_Real Distance(const gp_Pnt& aP,const gp_Cylinder& aCyl) ; Standard_EXPORT static Standard_Real Distance(const gp_Pnt& aP,const gp_Cylinder& aCyl) ;

View File

@ -4,12 +4,15 @@
#ifndef _gp_Pnt_HeaderFile #ifndef _gp_Pnt_HeaderFile
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#endif #endif
#ifndef _gp_Pln_HeaderFile
#include <gp_Pln.hxx>
#endif
#ifndef _gp_Cylinder_HeaderFile #ifndef _gp_Cylinder_HeaderFile
#include <gp_Cylinder.hxx> #include <gp_Cylinder.hxx>
#endif #endif
#ifndef _GeomAdaptor_Surface_HeaderFile
#include <GeomAdaptor_Surface.hxx>
#endif
#ifndef _gp_Pln_HeaderFile
#include <gp_Pln.hxx>
#endif
#ifndef _gp_Sphere_HeaderFile #ifndef _gp_Sphere_HeaderFile
#include <gp_Sphere.hxx> #include <gp_Sphere.hxx>
#endif #endif

View File

@ -19,7 +19,7 @@ uses
ListOfShape from TopTools, ListOfShape from TopTools,
IndexedDataMapOfShapeListOfShape from TopTools, IndexedDataMapOfShapeListOfShape from TopTools,
Context from IntTools, Context from IntTools,
IndexedDataMapOfPassKeyListOfShape from GEOMAlgo IndexedDataMapOfPassKeyShapeListOfShape from GEOMAlgo
--raises --raises
@ -29,7 +29,7 @@ is
returns Boolean from Standard; returns Boolean from Standard;
RefineSDShapes(myclass; RefineSDShapes(myclass;
aMSD:out IndexedDataMapOfPassKeyListOfShape from GEOMAlgo; aMSD:out IndexedDataMapOfPassKeyShapeListOfShape from GEOMAlgo;
aTol:Real from Standard; aTol:Real from Standard;
aCtx:out Context from IntTools) aCtx:out Context from IntTools)
returns Integer from Standard; returns Integer from Standard;

View File

@ -33,8 +33,8 @@
#include <BOPTools_Tools2D.hxx> #include <BOPTools_Tools2D.hxx>
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>
#include <GEOMAlgo_PassKey.hxx> #include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx> #include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
static static
void GetCount(const TopoDS_Shape& aS, void GetCount(const TopoDS_Shape& aS,
@ -88,7 +88,7 @@ void GetCount(const TopoDS_Shape& aS,
//function : RefineSDShapes //function : RefineSDShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer GEOMAlgo_Tools::RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyListOfShape &aMPKLE, Standard_Integer GEOMAlgo_Tools::RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape &aMPKLE,
const Standard_Real aTol, const Standard_Real aTol,
IntTools_Context& aCtx) IntTools_Context& aCtx)
{ {
@ -132,7 +132,7 @@ Standard_Integer GEOMAlgo_Tools::RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKey
} }
// //
for (i=1; i<=aNbToAdd; ++i) { for (i=1; i<=aNbToAdd; ++i) {
GEOMAlgo_PassKey aPKE1; GEOMAlgo_PassKeyShape aPKE1;
// //
const TopoDS_Shape& aE1=aMEToAdd.FindKey(i); const TopoDS_Shape& aE1=aMEToAdd.FindKey(i);
const TopTools_ListOfShape& aLE=aMEToAdd(i); const TopTools_ListOfShape& aLE=aMEToAdd(i);

View File

@ -35,7 +35,7 @@
#include <Handle_Geom_Surface.hxx> #include <Handle_Geom_Surface.hxx>
#endif #endif
class TopoDS_Shape; class TopoDS_Shape;
class GEOMAlgo_IndexedDataMapOfPassKeyListOfShape; class GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape;
class IntTools_Context; class IntTools_Context;
class TopTools_ListOfShape; class TopTools_ListOfShape;
class TopTools_IndexedDataMapOfShapeListOfShape; class TopTools_IndexedDataMapOfShapeListOfShape;
@ -71,7 +71,7 @@ public:
// Methods PUBLIC // Methods PUBLIC
// //
Standard_EXPORT static Standard_Boolean IsCompositeShape(const TopoDS_Shape& aS) ; Standard_EXPORT static Standard_Boolean IsCompositeShape(const TopoDS_Shape& aS) ;
Standard_EXPORT static Standard_Integer RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyListOfShape& aMSD,const Standard_Real aTol,IntTools_Context& aCtx) ; Standard_EXPORT static Standard_Integer RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMSD,const Standard_Real aTol,IntTools_Context& aCtx) ;
Standard_EXPORT static Standard_Integer FindSDShapes(const TopTools_ListOfShape& aLE,const Standard_Real aTol,TopTools_IndexedDataMapOfShapeListOfShape& aMEE,IntTools_Context& aCtx) ; Standard_EXPORT static Standard_Integer FindSDShapes(const TopTools_ListOfShape& aLE,const Standard_Real aTol,TopTools_IndexedDataMapOfShapeListOfShape& aMEE,IntTools_Context& aCtx) ;
Standard_EXPORT static Standard_Integer FindSDShapes(const TopoDS_Shape& aE1,const TopTools_ListOfShape& aLE,const Standard_Real aTol,TopTools_ListOfShape& aLESD,IntTools_Context& aCtx) ; Standard_EXPORT static Standard_Integer FindSDShapes(const TopoDS_Shape& aE1,const TopTools_ListOfShape& aLE,const Standard_Real aTol,TopTools_ListOfShape& aLESD,IntTools_Context& aCtx) ;
Standard_EXPORT static Standard_Boolean ProjectPointOnShape(const gp_Pnt& aP1,const TopoDS_Shape& aS,gp_Pnt& aP2,IntTools_Context& aCtx) ; Standard_EXPORT static Standard_Boolean ProjectPointOnShape(const gp_Pnt& aP1,const TopoDS_Shape& aS,gp_Pnt& aP2,IntTools_Context& aCtx) ;

View File

@ -1,8 +1,8 @@
#ifndef _TopoDS_Shape_HeaderFile #ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#endif #endif
#ifndef _GEOMAlgo_IndexedDataMapOfPassKeyListOfShape_HeaderFile #ifndef _GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#include <GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx> #include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#endif #endif
#ifndef _IntTools_Context_HeaderFile #ifndef _IntTools_Context_HeaderFile
#include <IntTools_Context.hxx> #include <IntTools_Context.hxx>

View File

@ -1,32 +0,0 @@
-- File: GEOMAlgo_VertexSolid.cdl
-- Created: Wed Jan 12 16:34:53 2005
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright: Matra Datavision 2005
class VertexSolid from GEOMAlgo
inherits ShapeSolid from GEOMAlgo
---Purpose:
--uses
--raises
is
Create
returns VertexSolid from GEOMAlgo;
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_VertexSolid();"
Perform (me:out)
is redefined;
Prepare(me:out)
is redefined protected;
BuildResult (me:out)
is redefined protected;
--fields
end VertexSolid;

View File

@ -1,219 +0,0 @@
// File: GEOMAlgo_VertexSolid.cxx
// Created: Wed Jan 12 16:36:40 2005
// Author: Peter KURNEV
// <pkv@irinox>
#include <GEOMAlgo_VertexSolid.ixx>
#include <gp_Pnt.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopAbs_State.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopExp.hxx>
#include <BRep_Tool.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <BOPTColStd_Dump.hxx>
#include <IntTools_Context.hxx>
#include <BooleanOperations_StateOfShape.hxx>
#include <BooleanOperations_ShapesDataStructure.hxx>
#include <BOPTools_InterferencePool.hxx>
#include <BOPTools_CArray1OfVVInterference.hxx>
#include <BOPTools_VVInterference.hxx>
#include <BOPTools_PaveFiller.hxx>
#include <BOPTools_DSFiller.hxx>
//=======================================================================
//function : GEOMAlgo_VertexSolid
//purpose :
//=======================================================================
GEOMAlgo_VertexSolid::GEOMAlgo_VertexSolid()
:
GEOMAlgo_ShapeSolid()
{
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
GEOMAlgo_VertexSolid::~GEOMAlgo_VertexSolid()
{
}
//=======================================================================
// function: Perform
// purpose:
//=======================================================================
void GEOMAlgo_VertexSolid::Perform()
{
myErrorStatus=0;
//
try {
if (myDSFiller==NULL) {
myErrorStatus=10;
return;
}
if(!myDSFiller->IsDone()) {
myErrorStatus=11;
return;
}
//
Standard_Boolean bIsNewFiller;
Standard_Integer aNbF;
TopTools_IndexedMapOfShape aM;
//
const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
const TopoDS_Shape& aObj=aDS.Object();
//
TopExp::MapShapes(aObj, TopAbs_FACE, aM);
aNbF=aM.Extent();
myRank=(aNbF) ? 2 : 1;
//
bIsNewFiller=myDSFiller->IsNewFiller();
if (bIsNewFiller) {
Prepare();
myDSFiller->SetNewFiller(!bIsNewFiller);
}
BuildResult();
}
//
catch (Standard_Failure) {
myErrorStatus = 12;
}
}
//=======================================================================
// function: Prepare
// purpose:
//=======================================================================
void GEOMAlgo_VertexSolid::Prepare()
{
Standard_Integer i, iBeg, iEnd, aNbVV, j, n1, n2, iFound;
Standard_Real aTol;
TopAbs_State aSt;
TopAbs_ShapeEnum aType;
BooleanOperations_StateOfShape aState;
gp_Pnt aP3D;
//
const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
BooleanOperations_ShapesDataStructure* pDS=(BooleanOperations_ShapesDataStructure*)&aDS;
const BOPTools_InterferencePool& aIP=myDSFiller->InterfPool();
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*) &aIP;
BOPTools_CArray1OfVVInterference& aVVs=pIP->VVInterferences();
const BOPTools_PaveFiller& aPF=myDSFiller->PaveFiller();
BOPTools_PaveFiller* pPF=(BOPTools_PaveFiller*)&aPF;
IntTools_Context& aCtx=pPF->ChangeContext();
//
const TopoDS_Shape& aObj=aDS.Object();
const TopoDS_Shape& aTool=aDS.Tool();
//
const TopoDS_Solid& aSolid=(myRank==1) ? TopoDS::Solid(aTool) : TopoDS::Solid(aObj);
const TopoDS_Shape& aSV =(myRank==1)? aObj : aTool;
//
BRepClass3d_SolidClassifier& aSC=aCtx.SolidClassifier(aSolid);
//
iBeg=1;
iEnd=aDS.NumberOfShapesOfTheObject();
if (myRank==2) {
iBeg=iEnd+1;
iEnd=aDS.NumberOfSourceShapes();
}
//
for (i=iBeg; i<=iEnd; ++i) {
aType=aDS.GetShapeType(i);
if (aType!=TopAbs_VERTEX) {
continue;
}
//
const TopoDS_Vertex& aV=TopoDS::Vertex(aDS.Shape(i));
//
aState=aDS.GetState(i);
if (aState==BooleanOperations_ON ||
aState==BooleanOperations_IN ||
aState==BooleanOperations_OUT) {
continue;
}
//
iFound=0;
aNbVV=aVVs.Extent();
for (j=1; j<=aNbVV; ++j) {
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;
}
}
if (iFound) {
continue;
}
//
aP3D=BRep_Tool::Pnt(aV);
aTol=1.E-7;
aSC.Perform(aP3D, aTol);
aSt=aSC.State();
if (aSt==TopAbs_IN) {
pDS->SetState (i, BooleanOperations_IN);
}
else if (aSt==TopAbs_OUT) {
pDS->SetState (i, BooleanOperations_OUT);
}
}
}
//=======================================================================
// function: BuildResult
// purpose:
//=======================================================================
void GEOMAlgo_VertexSolid::BuildResult()
{
const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
//
Standard_Integer i, iBeg, iEnd;
TopAbs_ShapeEnum aType;
BooleanOperations_StateOfShape aState;
//
myLSIN.Clear();
myLSOUT.Clear();
myLSON.Clear();
//
iBeg=1;
iEnd=aDS.NumberOfShapesOfTheObject();
if (myRank==2) {
iBeg=iEnd+1;
iEnd=aDS.NumberOfSourceShapes();
}
//
for (i=iBeg; i<=iEnd; ++i) {
aType=aDS.GetShapeType(i);
if (aType!=TopAbs_VERTEX) {
continue;
}
const TopoDS_Shape& aV=aDS.Shape(i);
aState=aDS.GetState(i);
//
if (aState==BooleanOperations_IN) {
myLSIN.Append(aV);
}
else if (aState==BooleanOperations_OUT) {
myLSOUT.Append(aV);
}
else if (aState==BooleanOperations_ON) {
myLSON.Append(aV);
}
}
}

View File

@ -1,95 +0,0 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#ifndef _GEOMAlgo_VertexSolid_HeaderFile
#define _GEOMAlgo_VertexSolid_HeaderFile
#ifndef _GEOMAlgo_ShapeSolid_HeaderFile
#include <GEOMAlgo_ShapeSolid.hxx>
#endif
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class GEOMAlgo_VertexSolid : public GEOMAlgo_ShapeSolid {
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
//
Standard_EXPORT GEOMAlgo_VertexSolid();
Standard_EXPORT virtual ~GEOMAlgo_VertexSolid();
Standard_EXPORT virtual void Perform() ;
protected:
// Methods PROTECTED
//
Standard_EXPORT virtual void Prepare() ;
Standard_EXPORT virtual void BuildResult() ;
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -1,26 +0,0 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#include <GEOMAlgo_VertexSolid.jxx>

View File

@ -1,3 +0,0 @@
#ifndef _GEOMAlgo_VertexSolid_HeaderFile
#include <GEOMAlgo_VertexSolid.hxx>
#endif

View File

@ -1,31 +0,0 @@
-- File: GEOMAlgo_WireSolid.cdl
-- Created: Wed Jan 12 10:17:00 2005
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright: Matra Datavision 2005
class WireSolid from GEOMAlgo
inherits ShapeSolid from GEOMAlgo
---Purpose:
--uses
--raises
is
Create
returns WireSolid from GEOMAlgo;
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_WireSolid();"
Perform (me:out)
is redefined;
Prepare(me:out)
is redefined protected;
BuildResult (me:out)
is redefined protected;
--fields
end WireSolid;

View File

@ -1,152 +0,0 @@
// File: GEOMAlgo_WireSolid.cxx
// Created: Wed Jan 12 10:19:31 2005
// Author: Peter KURNEV
// <pkv@irinox>
#include <GEOMAlgo_WireSolid.ixx>
#include <Standard_Failure.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BOPTColStd_Dump.hxx>
#include <BooleanOperations_ShapesDataStructure.hxx>
#include <BooleanOperations_StateOfShape.hxx>
#include <BOPTools_PaveFiller.hxx>
#include <BOPTools_SplitShapesPool.hxx>
#include <BOPTools_PaveBlock.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_DSFiller.hxx>
#include <BOPTools_WireStateFiller.hxx>
//=======================================================================
//function : GEOMAlgo_WireSolid
//purpose :
//=======================================================================
GEOMAlgo_WireSolid::GEOMAlgo_WireSolid()
:
GEOMAlgo_ShapeSolid()
{
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
GEOMAlgo_WireSolid::~GEOMAlgo_WireSolid()
{
}
//=======================================================================
// function: Perform
// purpose:
//=======================================================================
void GEOMAlgo_WireSolid::Perform()
{
myErrorStatus=0;
//
try {
if (myDSFiller==NULL) {
myErrorStatus=10;
return;
}
if(!myDSFiller->IsDone()) {
myErrorStatus=11;
return;
}
//
Standard_Boolean bIsNewFiller;
//
bIsNewFiller=myDSFiller->IsNewFiller();
if (bIsNewFiller) {
Prepare();
myDSFiller->SetNewFiller(!bIsNewFiller);
}
BuildResult();
}
//
catch (Standard_Failure) {
myErrorStatus= 12;
}
}
//=======================================================================
// function: Prepare
// purpose:
//=======================================================================
void GEOMAlgo_WireSolid::Prepare()
{
const BOPTools_PaveFiller& aPaveFiller=myDSFiller->PaveFiller();
//
BOPTools_WireStateFiller aStateFiller(aPaveFiller);
aStateFiller.Do();
//
}
//=======================================================================
// function: BuildResult
// purpose:
//=======================================================================
void GEOMAlgo_WireSolid::BuildResult()
{
const BooleanOperations_ShapesDataStructure& aDS=myDSFiller->DS();
const BOPTools_PaveFiller& aPaveFiller=myDSFiller->PaveFiller();
const BOPTools_SplitShapesPool& aSplitShapesPool=aPaveFiller.SplitShapesPool();
//
Standard_Integer i, aNbPB, nSp, iBeg, iEnd;
TopAbs_ShapeEnum aType;
BooleanOperations_StateOfShape aState;
//
myLSIN.Clear();
myLSOUT.Clear();
myLSON.Clear();
//
iBeg=1;
iEnd=aDS.NumberOfShapesOfTheObject();
if (aDS.Tool().ShapeType()==TopAbs_WIRE) {
iBeg=iEnd+1;
iEnd=aDS.NumberOfSourceShapes();
}
//
for (i=iBeg; i<=iEnd; ++i) {
aType=aDS.GetShapeType(i);
if (aType==TopAbs_EDGE) {
const TopoDS_Shape& aE=aDS.Shape(i);
const BOPTools_ListOfPaveBlock& aLPB=aSplitShapesPool(aDS.RefEdge(i));
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);
}
}
//
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);
}
}
}
}
}

View File

@ -1,26 +0,0 @@
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#include <GEOMAlgo_WireSolid.jxx>

View File

@ -1,3 +0,0 @@
#ifndef _GEOMAlgo_WireSolid_HeaderFile
#include <GEOMAlgo_WireSolid.hxx>
#endif

View File

@ -0,0 +1,91 @@
// File generated by CPPExt (Transient)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_HeaderFile
#define _Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_HeaderFile
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_TCollection_MapNode_HeaderFile
#include <Handle_TCollection_MapNode.hxx>
#endif
class Standard_Transient;
class Handle_Standard_Type;
class Handle(TCollection_MapNode);
class GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger;
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger);
class Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger) : public Handle(TCollection_MapNode) {
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);
}
Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)():Handle(TCollection_MapNode)() {}
Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)(const Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)& aHandle) : Handle(TCollection_MapNode)(aHandle)
{
}
Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)(const GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
{
}
Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)& operator=(const Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)& aHandle)
{
Assign(aHandle.Access());
return *this;
}
Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)& operator=(const GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger* anItem)
{
Assign((Standard_Transient *)anItem);
return *this;
}
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger* operator->()
{
return (GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger *)ControlAccess();
}
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger* operator->() const
{
return (GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger *)ControlAccess();
}
Standard_EXPORT ~Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger)();
Standard_EXPORT static const Handle(GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger) DownCast(const Handle(Standard_Transient)& AnObject);
};
#endif

View File

@ -19,8 +19,8 @@
// the specific terms and conditions governing rights and limitations under the // the specific terms and conditions governing rights and limitations under the
// License. // License.
#ifndef _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_HeaderFile #ifndef _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#define _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_HeaderFile #define _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
#ifndef _Standard_Macro_HeaderFile #ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
@ -36,10 +36,10 @@
class Standard_Transient; class Standard_Transient;
class Handle_Standard_Type; class Handle_Standard_Type;
class Handle(TCollection_MapNode); class Handle(TCollection_MapNode);
class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape; class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape;
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape); Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape);
class Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape) : public Handle(TCollection_MapNode) { class Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape) : public Handle(TCollection_MapNode) {
public: public:
void* operator new(size_t,void* anAddress) void* operator new(size_t,void* anAddress)
{ {
@ -53,39 +53,39 @@ class Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape) :
{ {
if (anAddress) Standard::Free((Standard_Address&)anAddress); if (anAddress) Standard::Free((Standard_Address&)anAddress);
} }
Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)():Handle(TCollection_MapNode)() {} Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)():Handle(TCollection_MapNode)() {}
Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)(const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)& aHandle) : Handle(TCollection_MapNode)(aHandle) Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)(const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)& aHandle) : Handle(TCollection_MapNode)(aHandle)
{ {
} }
Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)(const GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)(const GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
{ {
} }
Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)& operator=(const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)& aHandle) Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)& operator=(const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)& aHandle)
{ {
Assign(aHandle.Access()); Assign(aHandle.Access());
return *this; return *this;
} }
Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)& operator=(const GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape* anItem) Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)& operator=(const GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape* anItem)
{ {
Assign((Standard_Transient *)anItem); Assign((Standard_Transient *)anItem);
return *this; return *this;
} }
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape* operator->() GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape* operator->()
{ {
return (GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape *)ControlAccess(); return (GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape *)ControlAccess();
} }
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape* operator->() const GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape* operator->() const
{ {
return (GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape *)ControlAccess(); return (GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape *)ControlAccess();
} }
Standard_EXPORT ~Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape)(); Standard_EXPORT ~Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape)();
Standard_EXPORT static const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape) DownCast(const Handle(Standard_Transient)& AnObject); Standard_EXPORT static const Handle(GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape) DownCast(const Handle(Standard_Transient)& AnObject);
}; };
#endif #endif

View File

@ -0,0 +1,91 @@
// File generated by CPPExt (Transient)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#ifndef _Handle_GEOMAlgo_ListNodeOfListOfPnt_HeaderFile
#define _Handle_GEOMAlgo_ListNodeOfListOfPnt_HeaderFile
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_TCollection_MapNode_HeaderFile
#include <Handle_TCollection_MapNode.hxx>
#endif
class Standard_Transient;
class Handle_Standard_Type;
class Handle(TCollection_MapNode);
class GEOMAlgo_ListNodeOfListOfPnt;
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_ListNodeOfListOfPnt);
class Handle(GEOMAlgo_ListNodeOfListOfPnt) : public Handle(TCollection_MapNode) {
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);
}
Handle(GEOMAlgo_ListNodeOfListOfPnt)():Handle(TCollection_MapNode)() {}
Handle(GEOMAlgo_ListNodeOfListOfPnt)(const Handle(GEOMAlgo_ListNodeOfListOfPnt)& aHandle) : Handle(TCollection_MapNode)(aHandle)
{
}
Handle(GEOMAlgo_ListNodeOfListOfPnt)(const GEOMAlgo_ListNodeOfListOfPnt* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
{
}
Handle(GEOMAlgo_ListNodeOfListOfPnt)& operator=(const Handle(GEOMAlgo_ListNodeOfListOfPnt)& aHandle)
{
Assign(aHandle.Access());
return *this;
}
Handle(GEOMAlgo_ListNodeOfListOfPnt)& operator=(const GEOMAlgo_ListNodeOfListOfPnt* anItem)
{
Assign((Standard_Transient *)anItem);
return *this;
}
GEOMAlgo_ListNodeOfListOfPnt* operator->()
{
return (GEOMAlgo_ListNodeOfListOfPnt *)ControlAccess();
}
GEOMAlgo_ListNodeOfListOfPnt* operator->() const
{
return (GEOMAlgo_ListNodeOfListOfPnt *)ControlAccess();
}
Standard_EXPORT ~Handle(GEOMAlgo_ListNodeOfListOfPnt)();
Standard_EXPORT static const Handle(GEOMAlgo_ListNodeOfListOfPnt) DownCast(const Handle(Standard_Transient)& AnObject);
};
#endif

View File

@ -36,23 +36,6 @@ VPATH=.:@srcdir@
# Libraries targets # Libraries targets
LIB = libGEOMAlgo.la LIB = libGEOMAlgo.la
LIB_SRC = \ LIB_SRC = \
GEOMAlgo_Algo.cxx \
GEOMAlgo_CoupleOfShapes.cxx \
GEOMAlgo_GlueAnalyser.cxx \
GEOMAlgo_Gluer.cxx \
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_0.cxx \
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx \
GEOMAlgo_IndexedDataMapOfIntegerShape_0.cxx \
GEOMAlgo_IndexedDataMapOfPassKeyListOfShape_0.cxx \
GEOMAlgo_IndexedDataMapOfShapeBox_0.cxx \
GEOMAlgo_ListIteratorOfListOfCoupleOfShapes_0.cxx \
GEOMAlgo_ListNodeOfListOfCoupleOfShapes_0.cxx \
GEOMAlgo_ListOfCoupleOfShapes_0.cxx \
GEOMAlgo_PassKey.cxx \
GEOMAlgo_PassKeyMapHasher.cxx \
GEOMAlgo_ShapeAlgo.cxx \
GEOMAlgo_Tools.cxx \
BlockFix.cxx \ BlockFix.cxx \
BlockFix_BlockFixAPI.cxx \ BlockFix_BlockFixAPI.cxx \
BlockFix_CheckTool.cxx \ BlockFix_CheckTool.cxx \
@ -60,37 +43,57 @@ LIB_SRC = \
BlockFix_SphereSpaceModifier.cxx \ BlockFix_SphereSpaceModifier.cxx \
BlockFix_UnionEdges.cxx \ BlockFix_UnionEdges.cxx \
BlockFix_UnionFaces.cxx \ BlockFix_UnionFaces.cxx \
GEOMAlgo_FinderShapeOn.cxx \ GEOMAlgo_Algo.cxx \
GEOMAlgo_ShapeSolid.cxx \ GEOMAlgo_CoupleOfShapes.cxx \
GEOMAlgo_ShellSolid.cxx \ GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger_0.cxx \
GEOMAlgo_VertexSolid.cxx \ GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_0.cxx \
GEOMAlgo_WireSolid.cxx \ GEOMAlgo_DataMapOfPassKeyInteger_0.cxx \
GEOMAlgo_FinderShapeOn1.cxx \
GEOMAlgo_GlueAnalyser.cxx \
GEOMAlgo_Gluer.cxx \
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_0.cxx \
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx \
GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState_0.cxx \ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState_0.cxx \
GEOMAlgo_IndexedDataMapOfIntegerShape_0.cxx \
GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_0.cxx \
GEOMAlgo_IndexedDataMapOfShapeBox_0.cxx \
GEOMAlgo_IndexedDataMapOfShapeState_0.cxx \ GEOMAlgo_IndexedDataMapOfShapeState_0.cxx \
GEOMAlgo_SolidSolid.cxx \ GEOMAlgo_ListIteratorOfListOfCoupleOfShapes_0.cxx \
GEOMAlgo_SurfaceTools.cxx GEOMAlgo_ListIteratorOfListOfPnt_0.cxx \
GEOMAlgo_ListNodeOfListOfCoupleOfShapes_0.cxx \
GEOMAlgo_ListNodeOfListOfPnt_0.cxx \
GEOMAlgo_ListOfCoupleOfShapes_0.cxx \
GEOMAlgo_ListOfPnt_0.cxx \
GEOMAlgo_PassKey.cxx \
GEOMAlgo_PassKeyMapHasher.cxx \
GEOMAlgo_PassKeyShape.cxx \
GEOMAlgo_ShapeAlgo.cxx \
GEOMAlgo_StateCollector.cxx \
GEOMAlgo_SurfaceTools.cxx \
GEOMAlgo_Tools.cxx
LIB_CLIENT_IDL = LIB_CLIENT_IDL =
LIB_SERVER_IDL = LIB_SERVER_IDL =
# header files # header files
EXPORT_HEADERS = \ EXPORT_HEADERS = \
GEOMAlgo_Gluer.hxx \
GEOMAlgo_ShapeAlgo.hxx \
GEOMAlgo_Algo.hxx \
GEOMAlgo_GlueAnalyser.hxx \
GEOMAlgo_CoupleOfShapes.hxx \
GEOMAlgo_ListOfCoupleOfShapes.hxx \
GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx \
Handle_GEOMAlgo_ListNodeOfListOfCoupleOfShapes.hxx \
BlockFix_BlockFixAPI.hxx \ BlockFix_BlockFixAPI.hxx \
BlockFix_BlockFixAPI.lxx \ BlockFix_BlockFixAPI.lxx \
BlockFix_CheckTool.hxx \ BlockFix_CheckTool.hxx \
Handle_BlockFix_BlockFixAPI.hxx \ Handle_BlockFix_BlockFixAPI.hxx \
GEOMAlgo_State.hxx \ GEOMAlgo_Algo.hxx \
GEOMAlgo_FinderShapeOn.hxx \ GEOMAlgo_CoupleOfShapes.hxx \
GEOMAlgo_GlueAnalyser.hxx \
GEOMAlgo_Gluer.hxx \
GEOMAlgo_FinderShapeOn1.hxx \
GEOMAlgo_IndexedDataMapOfShapeState.hxx \ GEOMAlgo_IndexedDataMapOfShapeState.hxx \
Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState.hxx GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx \
GEOMAlgo_ListOfCoupleOfShapes.hxx \
GEOMAlgo_ShapeAlgo.hxx \
GEOMAlgo_State.hxx \
Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState.hxx \
Handle_GEOMAlgo_ListNodeOfListOfCoupleOfShapes.hxx
# idl files # idl files
EXPORT_IDLS= EXPORT_IDLS=

View File

@ -457,6 +457,149 @@ void GEOMImpl_IGroupOperations::DifferenceList (Handle(GEOM_Object) theGroup,
SetErrorCode(OK); SetErrorCode(OK);
} }
//=============================================================================
/*!
* UnionIDs
*/
//=============================================================================
void GEOMImpl_IGroupOperations::UnionIDs (Handle(GEOM_Object) theGroup,
const Handle(TColStd_HSequenceOfInteger)& theSubShapes)
{
SetErrorCode(KO);
if (theGroup.IsNull()) return;
Handle(GEOM_Function) aFunction = theGroup->GetFunction(1);
if (aFunction.IsNull()) return;
GEOM_ISubShape aSSI (aFunction);
// New contents of the group
TColStd_ListOfInteger aNewIDs;
TColStd_MapOfInteger mapIDs;
// Add current IDs to the list
Handle(TColStd_HArray1OfInteger) aSeq = aSSI.GetIndices();
if (aSeq.IsNull()) return;
Standard_Integer val_j, aLength = aSeq->Length();
for (Standard_Integer j = 1; j <= aLength; j++) {
val_j = aSeq->Value(j);
if (val_j > 0 && mapIDs.Add(val_j)) {
aNewIDs.Append(val_j);
}
}
// Get Main Shape
Handle(GEOM_Function) aMainShapeFunc = aSSI.GetMainShape();
if (aMainShapeFunc.IsNull()) return;
TDF_Label aLabel = aMainShapeFunc->GetOwnerEntry();
if (aLabel.IsRoot()) return;
Handle(GEOM_Object) aMainObj = GEOM_Object::GetObject(aLabel);
if (aMainObj.IsNull()) return;
TopoDS_Shape aMainShape = aMainObj->GetValue();
if (aMainShape.IsNull()) return;
TopTools_IndexedMapOfShape mapIndices;
TopExp::MapShapes(aMainShape, mapIndices);
// Get IDs of sub-shapes to add
Standard_Integer i, new_id, aLen = theSubShapes->Length();
for (i = 1; i <= aLen; i++) {
new_id = theSubShapes->Value(i);
if (0 < new_id && new_id <= mapIndices.Extent()) {
if (mapIDs.Add(new_id)) {
aNewIDs.Append(new_id);
}
}
}
if (aNewIDs.Extent() > 0) {
Standard_Integer k = 1;
TColStd_ListIteratorOfListOfInteger aNewIDsIter (aNewIDs);
Handle(TColStd_HArray1OfInteger) aNewSeq = new TColStd_HArray1OfInteger(1, aNewIDs.Extent());
for (; aNewIDsIter.More(); aNewIDsIter.Next(), k++) {
aNewSeq->SetValue(k, aNewIDsIter.Value());
}
aSSI.SetIndices(aNewSeq);
}
SetErrorCode(OK);
}
//=============================================================================
/*!
* DifferenceIDs
*/
//=============================================================================
void GEOMImpl_IGroupOperations::DifferenceIDs (Handle(GEOM_Object) theGroup,
const Handle(TColStd_HSequenceOfInteger)& theSubShapes)
{
SetErrorCode(KO);
if (theGroup.IsNull()) return;
Handle(GEOM_Function) aFunction = theGroup->GetFunction(1);
if (aFunction.IsNull()) return;
GEOM_ISubShape aSSI (aFunction);
// Map of IDs to be removed
TColStd_MapOfInteger mapIDsToRemove;
// Map of current IDs
Handle(TColStd_HArray1OfInteger) aSeq = aSSI.GetIndices();
if (aSeq.IsNull()) return;
Standard_Integer aLength = aSeq->Length();
if (aLength == 1 && aSeq->Value(1) == -1) // empty group
return;
TColStd_MapOfInteger mapIDsCurrent;
Standard_Integer j = 1;
for (; j <= aLength; j++) {
mapIDsCurrent.Add(aSeq->Value(j));
}
// Get Main Shape
Handle(GEOM_Function) aMainShapeFunc = aSSI.GetMainShape();
if (aMainShapeFunc.IsNull()) return;
TDF_Label aLabel = aMainShapeFunc->GetOwnerEntry();
if (aLabel.IsRoot()) return;
Handle(GEOM_Object) aMainObj = GEOM_Object::GetObject(aLabel);
if (aMainObj.IsNull()) return;
TopoDS_Shape aMainShape = aMainObj->GetValue();
if (aMainShape.IsNull()) return;
TopTools_IndexedMapOfShape mapIndices;
TopExp::MapShapes(aMainShape, mapIndices);
// Get IDs of sub-shapes to be removed
Standard_Integer i, rem_id, aLen = theSubShapes->Length();
for (i = 1; i <= aLen; i++) {
rem_id = theSubShapes->Value(i);
if (mapIDsCurrent.Contains(rem_id)) {
mapIDsToRemove.Add(rem_id);
}
}
if (mapIDsToRemove.Extent() > 0) {
Standard_Integer k = 1, aRemLength = mapIDsToRemove.Extent();
Handle(TColStd_HArray1OfInteger) aNewSeq = new TColStd_HArray1OfInteger(1, aLength - aRemLength);
for (j = 1; j <= aLength; j++) {
if (!mapIDsToRemove.Contains(aSeq->Value(j))) {
aNewSeq->SetValue(k, aSeq->Value(j));
k++;
}
}
aSSI.SetIndices(aNewSeq);
}
SetErrorCode(OK);
}
//============================================================================= //=============================================================================
/*! /*!
* GetType * GetType

View File

@ -8,6 +8,7 @@
#include "GEOM_Object.hxx" #include "GEOM_Object.hxx"
#include <TDocStd_Document.hxx> #include <TDocStd_Document.hxx>
#include <TColStd_HArray1OfInteger.hxx> #include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HSequenceOfInteger.hxx>
#include <TopAbs.hxx> #include <TopAbs.hxx>
class GEOMImpl_IGroupOperations : public GEOM_IOperations { class GEOMImpl_IGroupOperations : public GEOM_IOperations {
@ -27,6 +28,12 @@ class GEOMImpl_IGroupOperations : public GEOM_IOperations {
void DifferenceList (Handle(GEOM_Object) theGroup, void DifferenceList (Handle(GEOM_Object) theGroup,
const Handle(TColStd_HSequenceOfTransient)& theSubShapes); const Handle(TColStd_HSequenceOfTransient)& theSubShapes);
void UnionIDs (Handle(GEOM_Object) theGroup,
const Handle(TColStd_HSequenceOfInteger)& theSubShapes);
void DifferenceIDs (Handle(GEOM_Object) theGroup,
const Handle(TColStd_HSequenceOfInteger)& theSubShapes);
TopAbs_ShapeEnum GetType(Handle(GEOM_Object) theGroup); TopAbs_ShapeEnum GetType(Handle(GEOM_Object) theGroup);
Handle(GEOM_Object) GetMainShape(Handle(GEOM_Object) theGroup); Handle(GEOM_Object) GetMainShape(Handle(GEOM_Object) theGroup);

View File

@ -17,7 +17,7 @@ using namespace std;
#include "GEOM_Function.hxx" #include "GEOM_Function.hxx"
#include "GEOMAlgo_FinderShapeOn.hxx" #include "GEOMAlgo_FinderShapeOn1.hxx"
#include "utilities.h" #include "utilities.h"
#include "OpUtil.hxx" #include "OpUtil.hxx"
@ -35,7 +35,9 @@ using namespace std;
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepGProp.hxx> #include <BRepGProp.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepBndLib.hxx>
#include <BRepBuilderAPI_MakeFace.hxx> #include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <TopAbs.hxx> #include <TopAbs.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
@ -60,6 +62,7 @@ using namespace std;
#include <Geom2d_Curve.hxx> #include <Geom2d_Curve.hxx>
#include <Bnd_Box.hxx>
#include <GProp_GProps.hxx> #include <GProp_GProps.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Lin.hxx> #include <gp_Lin.hxx>
@ -1027,6 +1030,10 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnPlan
{ {
SetErrorCode(KO); SetErrorCode(KO);
// MESSAGE("--------------------------- GetShapesOnPlane phase 1 takes:");
// OSD_Timer timer1;
// timer1.Start();
if (theShape.IsNull() || theAx1.IsNull()) return NULL; if (theShape.IsNull() || theAx1.IsNull()) return NULL;
TopoDS_Shape aShape = theShape->GetValue(); TopoDS_Shape aShape = theShape->GetValue();
@ -1061,8 +1068,12 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnPlan
Handle(Geom_Plane) aPlane = new Geom_Plane(aLoc, aVec); Handle(Geom_Plane) aPlane = new Geom_Plane(aLoc, aVec);
// Check presence of triangulation, build if need
if (!CheckTriangulation(aShape))
return NULL;
// Call algo // Call algo
GEOMAlgo_FinderShapeOn aFinder; GEOMAlgo_FinderShapeOn1 aFinder;
Standard_Real aTol = 0.0001; // default value Standard_Real aTol = 0.0001; // default value
aFinder.SetShape(aShape); aFinder.SetShape(aShape);
@ -1071,11 +1082,33 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnPlan
aFinder.SetShapeType(aShapeType); aFinder.SetShapeType(aShapeType);
aFinder.SetState(theState); aFinder.SetState(theState);
// Sets the minimal number of inner points for the faces that do not have own
// inner points at all (for e.g. rectangular planar faces have just 2 triangles).
// Default value=3
aFinder.SetNbPntsMin(3);
// Sets the maximal number of inner points for edges or faces.
// It is usefull for the cases when this number is very big (e.g =2000) to improve
// the performance. If this value =0, all inner points will be taken into account.
// Default value=0
aFinder.SetNbPntsMax(100);
// timer1.Stop();
// timer1.Show();
// MESSAGE("--------------------------- Perform on Plane takes:");
// timer1.Reset();
// timer1.Start();
aFinder.Perform(); aFinder.Perform();
// timer1.Stop();
// timer1.Show();
// MESSAGE("--------------------------- GetShapesOnPlane phase 3 takes:");
// timer1.Reset();
// timer1.Start();
// Interprete results // Interprete results
Standard_Integer iErr = aFinder.ErrorStatus(); Standard_Integer iErr = aFinder.ErrorStatus();
// the detailed description of error codes is in GEOMAlgo_FinderShapeOn.cxx // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iErr) { if (iErr) {
MESSAGE(" iErr : " << iErr); MESSAGE(" iErr : " << iErr);
TCollection_AsciiString aMsg (" iErr : "); TCollection_AsciiString aMsg (" iErr : ");
@ -1084,7 +1117,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnPlan
return NULL; return NULL;
} }
Standard_Integer iWrn = aFinder.WarningStatus(); Standard_Integer iWrn = aFinder.WarningStatus();
// the detailed description of warning codes is in GEOMAlgo_FinderShapeOn.cxx // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iWrn) { if (iWrn) {
MESSAGE(" *** iWrn : " << iWrn); MESSAGE(" *** iWrn : " << iWrn);
} }
@ -1096,6 +1129,13 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnPlan
return NULL; return NULL;
} }
// timer1.Stop();
// timer1.Show();
// MESSAGE("--------------------------- GetShapesOnPlane phase 4 takes:");
// timer1.Reset();
// timer1.Start();
// Fill sequence of objects // Fill sequence of objects
TopTools_IndexedMapOfShape anIndices; TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(aShape, anIndices); TopExp::MapShapes(aShape, anIndices);
@ -1112,6 +1152,13 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnPlan
anObj = GetEngine()->AddSubShape(theShape, anArray); anObj = GetEngine()->AddSubShape(theShape, anArray);
aSeq->Append(anObj); aSeq->Append(anObj);
} }
// timer1.Stop();
// timer1.Show();
// MESSAGE("--------------------------- GetShapesOnPlane phase 5 takes:");
// timer1.Reset();
// timer1.Start();
// The GetShapesOnPlane() doesn't change object so no new function is required. // The GetShapesOnPlane() doesn't change object so no new function is required.
Handle(GEOM_Function) aFunction = theShape->GetLastFunction(); Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
@ -1129,6 +1176,9 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnPlan
anOldDescr += aDescr; anOldDescr += aDescr;
aFunction->SetDescription(anOldDescr); aFunction->SetDescription(anOldDescr);
// timer1.Stop();
// timer1.Show();
SetErrorCode(OK); SetErrorCode(OK);
return aSeq; return aSeq;
} }
@ -1186,8 +1236,12 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnCyli
Handle(Geom_CylindricalSurface) aCylinder = Handle(Geom_CylindricalSurface) aCylinder =
new Geom_CylindricalSurface(anAx3, theRadius); new Geom_CylindricalSurface(anAx3, theRadius);
// Check presence of triangulation, build if need
if (!CheckTriangulation(aShape))
return NULL;
// Call algo // Call algo
GEOMAlgo_FinderShapeOn aFinder; GEOMAlgo_FinderShapeOn1 aFinder;
Standard_Real aTol = 0.0001; // default value Standard_Real aTol = 0.0001; // default value
aFinder.SetShape(aShape); aFinder.SetShape(aShape);
@ -1196,11 +1250,14 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnCyli
aFinder.SetShapeType(aShapeType); aFinder.SetShapeType(aShapeType);
aFinder.SetState(theState); aFinder.SetState(theState);
aFinder.SetNbPntsMin(3);
aFinder.SetNbPntsMax(100);
aFinder.Perform(); aFinder.Perform();
// Interprete results // Interprete results
Standard_Integer iErr = aFinder.ErrorStatus(); Standard_Integer iErr = aFinder.ErrorStatus();
// the detailed description of error codes is in GEOMAlgo_FinderShapeOn.cxx // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iErr) { if (iErr) {
MESSAGE(" iErr : " << iErr); MESSAGE(" iErr : " << iErr);
TCollection_AsciiString aMsg (" iErr : "); TCollection_AsciiString aMsg (" iErr : ");
@ -1209,7 +1266,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnCyli
return NULL; return NULL;
} }
Standard_Integer iWrn = aFinder.WarningStatus(); Standard_Integer iWrn = aFinder.WarningStatus();
// the detailed description of warning codes is in GEOMAlgo_FinderShapeOn.cxx // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iWrn) { if (iWrn) {
MESSAGE(" *** iWrn : " << iWrn); MESSAGE(" *** iWrn : " << iWrn);
} }
@ -1297,8 +1354,12 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnSphe
Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface) aSphere =
new Geom_SphericalSurface(anAx3, theRadius); new Geom_SphericalSurface(anAx3, theRadius);
// Check presence of triangulation, build if need
if (!CheckTriangulation(aShape))
return NULL;
// Call algo // Call algo
GEOMAlgo_FinderShapeOn aFinder; GEOMAlgo_FinderShapeOn1 aFinder;
Standard_Real aTol = 0.0001; // default value Standard_Real aTol = 0.0001; // default value
aFinder.SetShape(aShape); aFinder.SetShape(aShape);
@ -1307,11 +1368,14 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnSphe
aFinder.SetShapeType(aShapeType); aFinder.SetShapeType(aShapeType);
aFinder.SetState(theState); aFinder.SetState(theState);
aFinder.SetNbPntsMin(3);
aFinder.SetNbPntsMax(100);
aFinder.Perform(); aFinder.Perform();
// Interprete results // Interprete results
Standard_Integer iErr = aFinder.ErrorStatus(); Standard_Integer iErr = aFinder.ErrorStatus();
// the detailed description of error codes is in GEOMAlgo_FinderShapeOn.cxx // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iErr) { if (iErr) {
MESSAGE(" iErr : " << iErr); MESSAGE(" iErr : " << iErr);
TCollection_AsciiString aMsg (" iErr : "); TCollection_AsciiString aMsg (" iErr : ");
@ -1320,7 +1384,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnSphe
return NULL; return NULL;
} }
Standard_Integer iWrn = aFinder.WarningStatus(); Standard_Integer iWrn = aFinder.WarningStatus();
// the detailed description of warning codes is in GEOMAlgo_FinderShapeOn.cxx // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iWrn) { if (iWrn) {
MESSAGE(" *** iWrn : " << iWrn); MESSAGE(" *** iWrn : " << iWrn);
} }
@ -1370,6 +1434,368 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnSphe
return aSeq; return aSeq;
} }
//=============================================================================
/*!
* GetShapesOnPlaneIDs
*/
//=============================================================================
Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::GetShapesOnPlaneIDs
(const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
const Handle(GEOM_Object)& theAx1,
const GEOMAlgo_State theState)
{
SetErrorCode(KO);
if (theShape.IsNull() || theAx1.IsNull()) return NULL;
TopoDS_Shape aShape = theShape->GetValue();
TopoDS_Shape anAx1 = theAx1->GetValue();
if (aShape.IsNull() || anAx1.IsNull()) return NULL;
TopAbs_ShapeEnum aShapeType = TopAbs_ShapeEnum(theShapeType);
if (aShapeType != TopAbs_VERTEX &&
aShapeType != TopAbs_EDGE &&
aShapeType != TopAbs_FACE &&
aShapeType != TopAbs_SOLID) {
SetErrorCode("Only solids, vertices, edges or faces can be found by this method");
return NULL;
}
// Create plane
if (anAx1.ShapeType() != TopAbs_EDGE) return NULL;
TopoDS_Edge anEdge = TopoDS::Edge(anAx1);
TopoDS_Vertex V1, V2;
TopExp::Vertices(anEdge, V1, V2, Standard_True);
if (V1.IsNull() || V2.IsNull()) {
SetErrorCode("Bad edge given for the plane normal vector");
return NULL;
}
gp_Pnt aLoc = BRep_Tool::Pnt(V1);
gp_Vec aVec (aLoc, BRep_Tool::Pnt(V2));
if (aVec.Magnitude() < Precision::Confusion()) {
SetErrorCode("Vector with null magnitude given");
return NULL;
}
Handle(Geom_Plane) aPlane = new Geom_Plane(aLoc, aVec);
// Check presence of triangulation, build if need
if (!CheckTriangulation(aShape))
return NULL;
// Call algo
GEOMAlgo_FinderShapeOn1 aFinder;
Standard_Real aTol = 0.0001; // default value
aFinder.SetShape(aShape);
aFinder.SetTolerance(aTol);
aFinder.SetSurface(aPlane);
aFinder.SetShapeType(aShapeType);
aFinder.SetState(theState);
aFinder.SetNbPntsMin(3);
aFinder.SetNbPntsMax(100);
aFinder.Perform();
// Interprete results
Standard_Integer iErr = aFinder.ErrorStatus();
// the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iErr) {
MESSAGE(" iErr : " << iErr);
TCollection_AsciiString aMsg (" iErr : ");
aMsg += TCollection_AsciiString(iErr);
SetErrorCode(aMsg);
return NULL;
}
Standard_Integer iWrn = aFinder.WarningStatus();
// the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iWrn) {
MESSAGE(" *** iWrn : " << iWrn);
}
const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result
if (listSS.Extent() < 1) {
SetErrorCode("Not a single sub-shape of the requested type found on the given plane");
return NULL;
}
// Fill sequence of objects
TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(aShape, anIndices);
Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger;
TopTools_ListIteratorOfListOfShape itSub (listSS);
for (int index = 1; itSub.More(); itSub.Next(), ++index) {
int id = anIndices.FindIndex(itSub.Value());
aSeq->Append(id);
}
// The GetShapesOnPlane() doesn't change object so no new function is required.
Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
// Make a Python command
TCollection_AsciiString anEntry, aDescr
("\nlistShapesOnPlane = IShapesOperations.GetShapesOnPlaneIDs(");
TDF_Tool::Entry(theShape->GetEntry(), anEntry);
aDescr += anEntry + TCollection_AsciiString(theShapeType) + ",";
TDF_Tool::Entry(theAx1->GetEntry(), anEntry);
aDescr += anEntry + ",";
aDescr += TCollection_AsciiString(theState) + ")";
TCollection_AsciiString anOldDescr = aFunction->GetDescription();
anOldDescr += aDescr;
aFunction->SetDescription(anOldDescr);
SetErrorCode(OK);
return aSeq;
}
//=============================================================================
/*!
* GetShapesOnCylinderIDs
*/
//=============================================================================
Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::GetShapesOnCylinderIDs
(const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
const Handle(GEOM_Object)& theAxis,
const Standard_Real theRadius,
const GEOMAlgo_State theState)
{
SetErrorCode(KO);
if (theShape.IsNull() || theAxis.IsNull()) return NULL;
TopoDS_Shape aShape = theShape->GetValue();
TopoDS_Shape anAxis = theAxis->GetValue();
if (aShape.IsNull() || anAxis.IsNull()) return NULL;
TopAbs_ShapeEnum aShapeType = TopAbs_ShapeEnum(theShapeType);
if (aShapeType != TopAbs_VERTEX &&
aShapeType != TopAbs_EDGE &&
aShapeType != TopAbs_FACE &&
aShapeType != TopAbs_SOLID) {
SetErrorCode("Only solids, vertices, edges or faces can be found by this method");
return NULL;
}
//Axis of the cylinder
if (anAxis.ShapeType() != TopAbs_EDGE) {
SetErrorCode("Not an edge given for the axis");
return NULL;
}
TopoDS_Edge anEdge = TopoDS::Edge(anAxis);
TopoDS_Vertex V1, V2;
TopExp::Vertices(anEdge, V1, V2, Standard_True);
if (V1.IsNull() || V2.IsNull()) {
SetErrorCode("Bad edge given for the axis");
return NULL;
}
gp_Pnt aLoc = BRep_Tool::Pnt(V1);
gp_Vec aVec (aLoc, BRep_Tool::Pnt(V2));
if (aVec.Magnitude() < Precision::Confusion()) {
SetErrorCode("Vector with null magnitude given");
return NULL;
}
gp_Ax3 anAx3 (aLoc, aVec);
Handle(Geom_CylindricalSurface) aCylinder =
new Geom_CylindricalSurface(anAx3, theRadius);
// Check presence of triangulation, build if need
if (!CheckTriangulation(aShape))
return NULL;
// Call algo
GEOMAlgo_FinderShapeOn1 aFinder;
Standard_Real aTol = 0.0001; // default value
aFinder.SetShape(aShape);
aFinder.SetTolerance(aTol);
aFinder.SetSurface(aCylinder);
aFinder.SetShapeType(aShapeType);
aFinder.SetState(theState);
aFinder.SetNbPntsMin(3);
aFinder.SetNbPntsMax(100);
aFinder.Perform();
// Interprete results
Standard_Integer iErr = aFinder.ErrorStatus();
// the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iErr) {
MESSAGE(" iErr : " << iErr);
TCollection_AsciiString aMsg (" iErr : ");
aMsg += TCollection_AsciiString(iErr);
SetErrorCode(aMsg);
return NULL;
}
Standard_Integer iWrn = aFinder.WarningStatus();
// the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iWrn) {
MESSAGE(" *** iWrn : " << iWrn);
}
const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result
if (listSS.Extent() < 1) {
SetErrorCode("Not a single sub-shape of the requested type found on the given cylinder");
return NULL;
}
// Fill sequence of objects
TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(aShape, anIndices);
Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger;
TopTools_ListIteratorOfListOfShape itSub (listSS);
for (int index = 1; itSub.More(); itSub.Next(), ++index) {
int id = anIndices.FindIndex(itSub.Value());
aSeq->Append(id);
}
// The GetShapesOnCylinder() doesn't change object so no new function is required.
Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
// Make a Python command
TCollection_AsciiString anEntry, aDescr
("\nlistShapesOnCylinder = IShapesOperations.GetShapesOnCylinderIDs(");
TDF_Tool::Entry(theShape->GetEntry(), anEntry);
aDescr += anEntry + TCollection_AsciiString(theShapeType) + ",";
TDF_Tool::Entry(theAxis->GetEntry(), anEntry);
aDescr += anEntry + ",";
aDescr += TCollection_AsciiString(theRadius) + ",";
aDescr += TCollection_AsciiString(theState) + ")";
TCollection_AsciiString anOldDescr = aFunction->GetDescription();
anOldDescr += aDescr;
aFunction->SetDescription(anOldDescr);
SetErrorCode(OK);
return aSeq;
}
//=============================================================================
/*!
* GetShapesOnSphereIDs
*/
//=============================================================================
Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::GetShapesOnSphereIDs
(const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
const Handle(GEOM_Object)& theCenter,
const Standard_Real theRadius,
const GEOMAlgo_State theState)
{
SetErrorCode(KO);
if (theShape.IsNull() || theCenter.IsNull()) return NULL;
TopoDS_Shape aShape = theShape->GetValue();
TopoDS_Shape aCenter = theCenter->GetValue();
if (aShape.IsNull() || aCenter.IsNull()) return NULL;
TopAbs_ShapeEnum aShapeType = TopAbs_ShapeEnum(theShapeType);
if (aShapeType != TopAbs_VERTEX &&
aShapeType != TopAbs_EDGE &&
aShapeType != TopAbs_FACE &&
aShapeType != TopAbs_SOLID) {
SetErrorCode("Only solids, vertices, edges or faces can be found by this method");
return NULL;
}
// Center of the sphere
if (aCenter.ShapeType() != TopAbs_VERTEX) return NULL;
gp_Pnt aLoc = BRep_Tool::Pnt(TopoDS::Vertex(aCenter));
gp_Ax3 anAx3 (aLoc, gp::DZ());
Handle(Geom_SphericalSurface) aSphere =
new Geom_SphericalSurface(anAx3, theRadius);
// Check presence of triangulation, build if need
if (!CheckTriangulation(aShape))
return NULL;
// Call algo
GEOMAlgo_FinderShapeOn1 aFinder;
Standard_Real aTol = 0.0001; // default value
aFinder.SetShape(aShape);
aFinder.SetTolerance(aTol);
aFinder.SetSurface(aSphere);
aFinder.SetShapeType(aShapeType);
aFinder.SetState(theState);
aFinder.SetNbPntsMin(3);
aFinder.SetNbPntsMax(100);
aFinder.Perform();
// Interprete results
Standard_Integer iErr = aFinder.ErrorStatus();
// the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iErr) {
MESSAGE(" iErr : " << iErr);
TCollection_AsciiString aMsg (" iErr : ");
aMsg += TCollection_AsciiString(iErr);
SetErrorCode(aMsg);
return NULL;
}
Standard_Integer iWrn = aFinder.WarningStatus();
// the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
if (iWrn) {
MESSAGE(" *** iWrn : " << iWrn);
}
const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result
if (listSS.Extent() < 1) {
SetErrorCode("Not a single sub-shape of the requested type found on the given sphere");
return NULL;
}
// Fill sequence of objects
TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(aShape, anIndices);
Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger;
TopTools_ListIteratorOfListOfShape itSub (listSS);
for (int index = 1; itSub.More(); itSub.Next(), ++index) {
int id = anIndices.FindIndex(itSub.Value());
aSeq->Append(id);
}
// The GetShapesOnSphere() doesn't change object so no new function is required.
Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
// Make a Python command
TCollection_AsciiString anEntry, aDescr
("\nlistShapesOnSphere = IShapesOperations.GetShapesOnSphereIDs(");
TDF_Tool::Entry(theShape->GetEntry(), anEntry);
aDescr += anEntry + TCollection_AsciiString(theShapeType) + ",";
TDF_Tool::Entry(theCenter->GetEntry(), anEntry);
aDescr += anEntry + ",";
aDescr += TCollection_AsciiString(theRadius) + ",";
aDescr += TCollection_AsciiString(theState) + ")";
TCollection_AsciiString anOldDescr = aFunction->GetDescription();
anOldDescr += aDescr;
aFunction->SetDescription(anOldDescr);
SetErrorCode(OK);
return aSeq;
}
//============================================================================= //=============================================================================
/*! /*!
* GetInPlace * GetInPlace
@ -1562,3 +1988,47 @@ void GEOMImpl_IShapesOperations::SortShapes(TopTools_ListOfShape& SL)
for (Index=1; Index <= MaxShapes; Index++) for (Index=1; Index <= MaxShapes; Index++)
SL.Append( aShapes( OrderInd(Index) )); SL.Append( aShapes( OrderInd(Index) ));
} }
//=======================================================================
//function : CheckTriangulation
//purpose :
//=======================================================================
bool GEOMImpl_IShapesOperations::CheckTriangulation (const TopoDS_Shape& aShape)
{
// MESSAGE("CheckTriangulation");
//
// OSD_Timer timer1;
// timer1.Start();
TopExp_Explorer exp (aShape, TopAbs_FACE);
if (!exp.More()) {
SetErrorCode("Shape without faces given");
return false;
}
TopLoc_Location aTopLoc;
Handle(Poly_Triangulation) aTRF;
aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc);
if (aTRF.IsNull()) {
// calculate deflection
Standard_Real aDeviationCoefficient = 0.001;
Bnd_Box B;
BRepBndLib::Add(aShape, B);
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin;
Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4;
// MESSAGE("Deflection = " << aDeflection);
Standard_Real aHLRAngle = 0.349066;
BRepMesh_IncrementalMesh Inc (aShape, aDeflection, Standard_False, aHLRAngle);
}
// timer1.Stop();
// timer1.Show();
return true;
}

View File

@ -81,6 +81,23 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
const Standard_Real theRadius, const Standard_Real theRadius,
const GEOMAlgo_State theState); const GEOMAlgo_State theState);
Handle(TColStd_HSequenceOfInteger) GetShapesOnPlaneIDs (const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
const Handle(GEOM_Object)& theAx1,
const GEOMAlgo_State theState);
Handle(TColStd_HSequenceOfInteger) GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
const Handle(GEOM_Object)& theAxis,
const Standard_Real theRadius,
const GEOMAlgo_State theState);
Handle(TColStd_HSequenceOfInteger) GetShapesOnSphereIDs (const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
const Handle(GEOM_Object)& theCenter,
const Standard_Real theRadius,
const GEOMAlgo_State theState);
Handle(GEOM_Object) GetShapesOnCylinderOld (Handle(GEOM_Object) theShape, Handle(GEOM_Object) GetShapesOnCylinderOld (Handle(GEOM_Object) theShape,
const Standard_Integer theShapeType, const Standard_Integer theShapeType,
Handle(GEOM_Object) theAxis, Handle(GEOM_Object) theAxis,
@ -101,6 +118,8 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
const Standard_Integer theObjectType, const Standard_Integer theObjectType,
const Standard_Integer theFunctionType, const Standard_Integer theFunctionType,
const TCollection_AsciiString theMethodName); const TCollection_AsciiString theMethodName);
bool CheckTriangulation (const TopoDS_Shape& aShape);
}; };
#endif #endif

View File

@ -174,6 +174,68 @@ void GEOM_IGroupOperations_i::DifferenceList (GEOM::GEOM_Object_ptr theGroup,
return; return;
} }
//=============================================================================
/*!
* UnionIDs
*/
//=============================================================================
void GEOM_IGroupOperations_i::UnionIDs (GEOM::GEOM_Object_ptr theGroup,
const GEOM::ListOfLong& theSubShapes)
{
//Set a not done flag
GetOperations()->SetNotDone();
if (theGroup == NULL) return;
//Get the reference group
Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject
(theGroup->GetStudyID(), theGroup->GetEntry());
if (aGroupRef.IsNull()) return;
//Get sub-shape to add
Handle(TColStd_HSequenceOfInteger) aSubShapes = new TColStd_HSequenceOfInteger;
int ind, aLen = theSubShapes.length();
for (ind = 0; ind < aLen; ind++) {
aSubShapes->Append(theSubShapes[ind]);
}
//Perform the operation
GetOperations()->UnionIDs(aGroupRef, aSubShapes);
return;
}
//=============================================================================
/*!
* DifferenceIDs
*/
//=============================================================================
void GEOM_IGroupOperations_i::DifferenceIDs (GEOM::GEOM_Object_ptr theGroup,
const GEOM::ListOfLong& theSubShapes)
{
//Set a not done flag
GetOperations()->SetNotDone();
if (theGroup == NULL) return;
//Get the reference group
Handle(GEOM_Object) aGroupRef = GetOperations()->GetEngine()->GetObject
(theGroup->GetStudyID(), theGroup->GetEntry());
if (aGroupRef.IsNull()) return;
//Get sub-shape to remove
Handle(TColStd_HSequenceOfInteger) aSubShapes = new TColStd_HSequenceOfInteger;
int ind, aLen = theSubShapes.length();
for (ind = 0; ind < aLen; ind++) {
aSubShapes->Append(theSubShapes[ind]);
}
//Perform the operation
GetOperations()->DifferenceIDs(aGroupRef, aSubShapes);
return;
}
//============================================================================= //=============================================================================
/*! /*!
* GetType * GetType

View File

@ -30,6 +30,10 @@ class GEOM_IGroupOperations_i :
void DifferenceList (GEOM::GEOM_Object_ptr theGroup, const GEOM::ListOfGO& theSubShapes); void DifferenceList (GEOM::GEOM_Object_ptr theGroup, const GEOM::ListOfGO& theSubShapes);
void UnionIDs (GEOM::GEOM_Object_ptr theGroup, const GEOM::ListOfLong& theSubShapes);
void DifferenceIDs (GEOM::GEOM_Object_ptr theGroup, const GEOM::ListOfLong& theSubShapes);
CORBA::Long GetType (GEOM::GEOM_Object_ptr theGroup); CORBA::Long GetType (GEOM::GEOM_Object_ptr theGroup);
GEOM::GEOM_Object_ptr GetMainShape (GEOM::GEOM_Object_ptr theGroup); GEOM::GEOM_Object_ptr GetMainShape (GEOM::GEOM_Object_ptr theGroup);

View File

@ -699,6 +699,128 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnSphere
return aSeq._retn(); return aSeq._retn();
} }
//=============================================================================
/*!
* GetShapesOnPlaneIDs
*/
//=============================================================================
GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnPlaneIDs
(GEOM::GEOM_Object_ptr theShape,
const CORBA::Long theShapeType,
GEOM::GEOM_Object_ptr theAx1,
const GEOM::shape_state theState)
{
GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
//Set a not done flag
GetOperations()->SetNotDone();
if (theShape == NULL || theAx1 == NULL) return aSeq._retn();
//Get the reference objects
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
(theShape->GetStudyID(), theShape->GetEntry());
Handle(GEOM_Object) anAx1 = GetOperations()->GetEngine()->GetObject
(theAx1->GetStudyID(), theAx1->GetEntry());
if (aShape.IsNull() || anAx1.IsNull()) return aSeq._retn();
//Get Shapes On Plane
Handle(TColStd_HSequenceOfInteger) aHSeq =
GetOperations()->GetShapesOnPlaneIDs(aShape, theShapeType, anAx1, ShapeState(theState));
if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aSeq._retn();
Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength);
for (Standard_Integer i = 1; i <= aLength; i++)
aSeq[i-1] = aHSeq->Value(i);
return aSeq._retn();
}
//=============================================================================
/*!
* GetShapesOnCylinderIDs
*/
//=============================================================================
GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnCylinderIDs
(GEOM::GEOM_Object_ptr theShape,
const CORBA::Long theShapeType,
GEOM::GEOM_Object_ptr theAxis,
const CORBA::Double theRadius,
const GEOM::shape_state theState)
{
GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
//Set a not done flag
GetOperations()->SetNotDone();
if (theShape == NULL || theAxis == NULL) return aSeq._retn();
//Get the reference objects
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
(theShape->GetStudyID(), theShape->GetEntry());
Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject
(theAxis->GetStudyID(), theAxis->GetEntry());
if (aShape.IsNull() || anAxis.IsNull()) return aSeq._retn();
//Get Shapes On Cylinder
Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnCylinderIDs
(aShape, theShapeType, anAxis, theRadius, ShapeState(theState));
if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aSeq._retn();
Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength);
for (Standard_Integer i = 1; i <= aLength; i++)
aSeq[i-1] = aHSeq->Value(i);
return aSeq._retn();
}
//=============================================================================
/*!
* GetShapesOnSphereIDs
*/
//=============================================================================
GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnSphereIDs
(GEOM::GEOM_Object_ptr theShape,
const CORBA::Long theShapeType,
GEOM::GEOM_Object_ptr theCenter,
const CORBA::Double theRadius,
const GEOM::shape_state theState)
{
GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong;
//Set a not done flag
GetOperations()->SetNotDone();
if (theShape == NULL || theCenter == NULL) return aSeq._retn();
//Get the reference objects
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
(theShape->GetStudyID(), theShape->GetEntry());
Handle(GEOM_Object) aCenter = GetOperations()->GetEngine()->GetObject
(theCenter->GetStudyID(), theCenter->GetEntry());
if (aShape.IsNull() || aCenter.IsNull()) return aSeq._retn();
//Get Shapes On Sphere
Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnSphereIDs
(aShape, theShapeType, aCenter, theRadius, ShapeState(theState));
if (!GetOperations()->IsDone() || aHSeq.IsNull())
return aSeq._retn();
Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength);
for (Standard_Integer i = 1; i <= aLength; i++)
aSeq[i-1] = aHSeq->Value(i);
return aSeq._retn();
}
//============================================================================= //=============================================================================
/*! /*!
* GetInPlace * GetInPlace

View File

@ -82,6 +82,23 @@ class GEOM_IShapesOperations_i :
const CORBA::Double theRadius, const CORBA::Double theRadius,
const GEOM::shape_state theState); const GEOM::shape_state theState);
GEOM::ListOfLong* GetShapesOnPlaneIDs (GEOM::GEOM_Object_ptr theShape,
const CORBA::Long theShapeType,
GEOM::GEOM_Object_ptr theAx1,
const GEOM::shape_state theState);
GEOM::ListOfLong* GetShapesOnCylinderIDs (GEOM::GEOM_Object_ptr theShape,
const CORBA::Long theShapeType,
GEOM::GEOM_Object_ptr theAxis,
const CORBA::Double theRadius,
const GEOM::shape_state theState);
GEOM::ListOfLong* GetShapesOnSphereIDs (GEOM::GEOM_Object_ptr theShape,
const CORBA::Long theShapeType,
GEOM::GEOM_Object_ptr theCenter,
const CORBA::Double theRadius,
const GEOM::shape_state theState);
GEOM::GEOM_Object_ptr GetInPlace (GEOM::GEOM_Object_ptr theShapeWhere, GEOM::GEOM_Object_ptr GetInPlace (GEOM::GEOM_Object_ptr theShapeWhere,
GEOM::GEOM_Object_ptr theShapeWhat); GEOM::GEOM_Object_ptr theShapeWhat);

View File

@ -32,6 +32,6 @@ VPATH=.:@srcdir@
@COMMENCE@ @COMMENCE@
SUBDIRS = OBJECT ARCHIMEDE NMTDS NMTTools NMTAlgo GEOMAlgo SKETCHER PARTITION GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport ShHealOper GEOMImpl GEOM_I GEOMClient DlgRef GEOMFiltersSelection GEOMGUI GEOMBase DisplayGUI GEOMToolsGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_SWIG GEOM_I_Superv SUBDIRS = OBJECT ARCHIMEDE NMTDS NMTTools NMTAlgo GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport ShHealOper GEOMImpl GEOM_I GEOMClient DlgRef GEOMFiltersSelection GEOMGUI GEOMBase DisplayGUI GEOMToolsGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_SWIG GEOM_I_Superv
@MODULE@ @MODULE@