geom/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx

172 lines
8.0 KiB
C++
Raw Normal View History

2005-12-05 21:23:52 +05:00
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2005-12-05 21:23:52 +05:00
//
2004-12-01 15:39:14 +05:00
#ifndef _GEOMImpl_IBlocksOperations_HXX_
#define _GEOMImpl_IBlocksOperations_HXX_
#include "GEOM_IOperations.hxx"
#include <TopTools_ListOfShape.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <list>
class GEOM_Engine;
class Handle(GEOM_Object);
class Handle(TColStd_HArray1OfInteger);
class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
public:
2005-08-11 10:43:57 +06:00
Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine, int theDocID);
Standard_EXPORT ~GEOMImpl_IBlocksOperations();
2004-12-01 15:39:14 +05:00
// Creation of blocks and block faces
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) MakeQuad (Handle(GEOM_Object) theEdge1,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) theEdge2,
Handle(GEOM_Object) theEdge3,
Handle(GEOM_Object) theEdge4);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) MakeQuad2Edges (Handle(GEOM_Object) theEdge1,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) theEdge2);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) MakeQuad4Vertices (Handle(GEOM_Object) thePoint1,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) thePoint2,
Handle(GEOM_Object) thePoint3,
Handle(GEOM_Object) thePoint4);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) MakeHexa (Handle(GEOM_Object) theFace1,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) theFace2,
Handle(GEOM_Object) theFace3,
Handle(GEOM_Object) theFace4,
Handle(GEOM_Object) theFace5,
Handle(GEOM_Object) theFace6);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) MakeHexa2Faces (Handle(GEOM_Object) theFace1,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) theFace2);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) MakeBlockCompound (Handle(GEOM_Object) theCompound);
2004-12-01 15:39:14 +05:00
// Extract elements of blocks and blocks compounds
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) GetPoint (Handle(GEOM_Object) theShape,
2004-12-01 15:39:14 +05:00
const Standard_Real theX,
const Standard_Real theY,
const Standard_Real theZ,
const Standard_Real theEpsilon);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) GetEdge (Handle(GEOM_Object) theShape,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) thePoint1,
Handle(GEOM_Object) thePoint2);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) GetEdgeNearPoint (Handle(GEOM_Object) theBlock,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) thePoint);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) GetFaceByPoints (Handle(GEOM_Object) theShape,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) thePoint1,
Handle(GEOM_Object) thePoint2,
Handle(GEOM_Object) thePoint3,
Handle(GEOM_Object) thePoint4);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) GetFaceByEdges (Handle(GEOM_Object) theShape,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) theEdge1,
Handle(GEOM_Object) theEdge2);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) GetOppositeFace (Handle(GEOM_Object) theBlock,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) theFace);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) GetFaceNearPoint (Handle(GEOM_Object) theBlock,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) thePoint);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) GetFaceByNormale (Handle(GEOM_Object) theBlock,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) theVector);
// Check blocks compounds
2005-08-11 10:43:57 +06:00
Standard_EXPORT Standard_Boolean IsCompoundOfBlocks (Handle(GEOM_Object) theCompound,
2004-12-01 15:39:14 +05:00
const Standard_Integer theMinNbFaces,
const Standard_Integer theMaxNbFaces,
Standard_Integer& theNbBlocks);
enum BCErrorType {
NOT_BLOCK,
2005-01-20 11:24:17 +05:00
EXTRA_EDGE,
2004-12-01 15:39:14 +05:00
INVALID_CONNECTION,
NOT_CONNECTED,
NOT_GLUED
};
struct BCError {
BCErrorType error;
list<int> incriminated;
};
2005-08-11 10:43:57 +06:00
Standard_EXPORT Standard_Boolean CheckCompoundOfBlocksOld (Handle(GEOM_Object) theCompound,
2005-01-20 11:24:17 +05:00
list<BCError>& theErrors);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Standard_Boolean CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound,
2004-12-01 15:39:14 +05:00
list<BCError>& theErrors);
2005-08-11 10:43:57 +06:00
Standard_EXPORT TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object) theCompound,
2004-12-01 15:39:14 +05:00
const list<BCError>& theErrors);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) RemoveExtraEdges (Handle(GEOM_Object) theShape);
2005-01-20 11:24:17 +05:00
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) CheckAndImprove (Handle(GEOM_Object) theCompound);
2005-01-20 11:24:17 +05:00
2005-08-11 10:43:57 +06:00
Standard_EXPORT static void AddBlocksFrom (const TopoDS_Shape& theShape,
2005-01-20 11:24:17 +05:00
TopTools_ListOfShape& BLO,
TopTools_ListOfShape& NOT,
TopTools_ListOfShape& EXT);
2004-12-01 15:39:14 +05:00
// Extract blocks from blocks compounds
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ExplodeCompoundOfBlocks
2004-12-01 15:39:14 +05:00
(Handle(GEOM_Object) theCompound,
const Standard_Integer theMinNbFaces,
const Standard_Integer theMaxNbFaces);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) GetBlockNearPoint (Handle(GEOM_Object) theCompound,
2004-12-01 15:39:14 +05:00
Handle(GEOM_Object) thePoint);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) GetBlockByParts
2004-12-01 15:39:14 +05:00
(Handle(GEOM_Object) theCompound,
const Handle(TColStd_HSequenceOfTransient)& theParts);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetBlocksByParts
2004-12-01 15:39:14 +05:00
(Handle(GEOM_Object) theCompound,
const Handle(TColStd_HSequenceOfTransient)& theParts);
// Operations on blocks with gluing of result
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) MakeMultiTransformation1D (Handle(GEOM_Object) theBlock,
2004-12-01 15:39:14 +05:00
const Standard_Integer theDirFace1,
const Standard_Integer theDirFace2,
const Standard_Integer theNbTimes);
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(GEOM_Object) MakeMultiTransformation2D (Handle(GEOM_Object) theBlock,
2004-12-01 15:39:14 +05:00
const Standard_Integer theDirFace1U,
const Standard_Integer theDirFace2U,
const Standard_Integer theNbTimesU,
const Standard_Integer theDirFace1V,
const Standard_Integer theDirFace2V,
const Standard_Integer theNbTimesV);
2005-01-20 11:24:17 +05:00
// Build groups for Propagation of 1D hypotheses
2005-08-11 10:43:57 +06:00
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Propagate (Handle(GEOM_Object) theShape);
2004-12-01 15:39:14 +05:00
};
#endif