mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0025039: Improvement of code structure of general and supporting tools implemented in BRepMesh
Removed CDL declarations; Data collections are replaced by NCollections; Small code refactoring. Remove definition of BRepMesh class. Code refactoring of BRepMesh_IncrementalMesh. Function BRepMesh_Write storing BRepMesh_DataStructureOfDelaun to BRep file is added for debug needs. Static method BRepMesh_GeomTool::IntLinLin has been added to eliminate code duplications in BRepMesh_Dealun and BRepMesh_CircleTool. BRepMesh_CircleTool simplified method to find circumcircle. Fix merging conflicts Remove redundant function Fix compilation warning on MacOS Revert changes occurred during rebase Resolved merging conflicts Use parallel flag with BRepMesh_FastDiscret Test cases for issue CR25039_2
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
MeshTest_PluginCommands.cxx
|
||||
MeshTest_CheckTopology.cxx
|
||||
MeshTest_CheckTopology.hxx
|
||||
MeshTest_DrawableMesh.cxx
|
||||
MeshTest_DrawableMesh.hxx
|
||||
|
@@ -26,9 +26,7 @@ uses
|
||||
|
||||
is
|
||||
|
||||
class DrawableMesh;
|
||||
---Purpose: Provides a mesh object inherited from Drawable3d
|
||||
-- to draw a triangulation.
|
||||
imported DrawableMesh from MeshTest;
|
||||
|
||||
Commands(DI : in out Interpretor from Draw);
|
||||
---Purpose: Defines meshing commands
|
||||
|
@@ -42,7 +42,6 @@
|
||||
#include <BRepMesh_DataStructureOfDelaun.hxx>
|
||||
#include <BRepMesh_Delaun.hxx>
|
||||
#include <BRepMesh_FastDiscret.hxx>
|
||||
#include <BRepMesh_Array1OfVertexOfDelaun.hxx>
|
||||
#include <BRepMesh_Vertex.hxx>
|
||||
#include <BRepMesh_Edge.hxx>
|
||||
#include <BRepMesh_IncrementalMesh.hxx>
|
||||
@@ -141,7 +140,7 @@ static Standard_Integer incrementalmesh(Draw_Interpretor& di, Standard_Integer n
|
||||
di << "Incremental Mesh, multi-threading "
|
||||
<< (isInParallel ? "ON\n" : "OFF\n");
|
||||
|
||||
BRepMesh_IncrementalMesh MESH(aShape, aDeflection, Standard_False, 0.5, isInParallel);
|
||||
BRepMesh_IncrementalMesh MESH(aShape, aDeflection, 0.5, Standard_False, isInParallel);
|
||||
Standard_Integer statusFlags = MESH.GetStatusFlags();
|
||||
|
||||
di << "Meshing statuses: ";
|
||||
@@ -564,9 +563,9 @@ static Standard_Integer vertices (Draw_Interpretor&, Standard_Integer n, const c
|
||||
|
||||
// the faces
|
||||
for (ex.Init(S,TopAbs_FACE);ex.More();ex.Next()) {
|
||||
BRepMesh_MapOfInteger vtx;
|
||||
BRepMeshCol::MapOfInteger vtx;
|
||||
M->VerticesOfDomain(vtx);
|
||||
for (BRepMesh_MapOfInteger::Iterator it(vtx); it.More(); it.Next())
|
||||
for (BRepMeshCol::MapOfInteger::Iterator it(vtx); it.More(); it.Next())
|
||||
vseq.Append(it.Key());
|
||||
}
|
||||
|
||||
|
@@ -1,82 +0,0 @@
|
||||
-- Created on: 1994-08-03
|
||||
-- Created by: Modeling
|
||||
-- Copyright (c) 1994-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class DrawableMesh from MeshTest inherits Drawable3D from Draw
|
||||
|
||||
---Purpose: A drawable mesh. It contains a sequence of
|
||||
-- highlighted edges and highlighted vertices.
|
||||
|
||||
uses
|
||||
Display from Draw,
|
||||
Interpretor from Draw,
|
||||
Shape from TopoDS,
|
||||
FastDiscret from BRepMesh,
|
||||
SequenceOfInteger from TColStd
|
||||
|
||||
is
|
||||
|
||||
Create returns DrawableMesh from MeshTest;
|
||||
|
||||
Create(S : Shape from TopoDS; Deflect : Real;
|
||||
Partage : Boolean; InShape: Boolean from Standard= Standard_False)
|
||||
returns DrawableMesh from MeshTest;
|
||||
|
||||
|
||||
Create(Tr: FastDiscret from BRepMesh)
|
||||
returns DrawableMesh from MeshTest;
|
||||
|
||||
AddInShape(me: mutable; inshape: Boolean)
|
||||
is static;
|
||||
|
||||
Add(me : mutable; S : Shape from TopoDS)
|
||||
is static;
|
||||
|
||||
Edges(me : mutable) returns SequenceOfInteger from TColStd
|
||||
---C++: return &
|
||||
is static;
|
||||
|
||||
Vertices(me : mutable) returns SequenceOfInteger from TColStd
|
||||
---C++: return &
|
||||
is static;
|
||||
|
||||
Triangles(me : mutable) returns SequenceOfInteger from TColStd
|
||||
---C++: return &
|
||||
is static;
|
||||
|
||||
DrawOn(me; dis : in out Display from Draw);
|
||||
|
||||
Copy(me) returns Drawable3D from Draw
|
||||
is redefined;
|
||||
|
||||
Dump(me; S : in out OStream)
|
||||
is redefined;
|
||||
|
||||
Whatis(me; S : in out Interpretor from Draw)
|
||||
is redefined;
|
||||
|
||||
Mesh(me) returns FastDiscret from BRepMesh
|
||||
is static;
|
||||
|
||||
fields
|
||||
|
||||
myMesh : FastDiscret from BRepMesh;
|
||||
myDeflection : Real;
|
||||
myEdges : SequenceOfInteger from TColStd;
|
||||
myVertices : SequenceOfInteger from TColStd;
|
||||
myTriangles : SequenceOfInteger from TColStd;
|
||||
myinshape : Boolean from Standard;
|
||||
|
||||
end DrawableMesh;
|
@@ -14,7 +14,7 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <MeshTest_DrawableMesh.ixx>
|
||||
#include <MeshTest_DrawableMesh.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <Draw.hxx>
|
||||
#include <Draw_ColorKind.hxx>
|
||||
@@ -29,6 +29,9 @@
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE (MeshTest_DrawableMesh, Draw_Drawable3D)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(MeshTest_DrawableMesh, Draw_Drawable3D)
|
||||
|
||||
//=======================================================================
|
||||
//function : MeshTest_DrawableMesh
|
||||
//purpose :
|
||||
@@ -53,7 +56,7 @@ myDeflection(Deflect), myinshape(inshape)
|
||||
Bnd_Box B;
|
||||
BRepBndLib::Add(S, B);
|
||||
|
||||
myMesh = new BRepMesh_FastDiscret(Deflect, S, B, 0.5, Partage, inshape);
|
||||
myMesh = new BRepMesh_FastDiscret(S, Deflect, 0.5, B, Partage, inshape);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +83,7 @@ void MeshTest_DrawableMesh::Add(const TopoDS_Shape& S)
|
||||
BRepBndLib::Add(S, B);
|
||||
|
||||
if (myMesh.IsNull())
|
||||
myMesh=new BRepMesh_FastDiscret(myDeflection, S, B, 0.5, myinshape);
|
||||
myMesh=new BRepMesh_FastDiscret(S, myDeflection, 0.5, B, myinshape);
|
||||
else
|
||||
myMesh->Perform(S);
|
||||
}
|
||||
|
78
src/MeshTest/MeshTest_DrawableMesh.hxx
Normal file
78
src/MeshTest/MeshTest_DrawableMesh.hxx
Normal file
@@ -0,0 +1,78 @@
|
||||
// Copyright (c) 2013-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _MeshTest_DrawableMesh_HeaderFile
|
||||
#define _MeshTest_DrawableMesh_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#include <BRepMesh_FastDiscret.hxx>
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <Handle_Draw_Drawable3D.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
|
||||
class TopoDS_Shape;
|
||||
class TColStd_SequenceOfInteger;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
//! A drawable mesh.
|
||||
//! Provides a mesh object inherited from Drawable3d to draw a triangulation.
|
||||
//! It contains a sequence of highlighted edges and highlighted vertices. <br>
|
||||
class MeshTest_DrawableMesh : public Draw_Drawable3D
|
||||
{
|
||||
public:
|
||||
|
||||
Standard_EXPORT MeshTest_DrawableMesh();
|
||||
|
||||
Standard_EXPORT MeshTest_DrawableMesh(const TopoDS_Shape& S,const Standard_Real Deflect,const Standard_Boolean Partage,const Standard_Boolean InShape = Standard_False);
|
||||
|
||||
Standard_EXPORT MeshTest_DrawableMesh(const Handle(BRepMesh_FastDiscret)& Tr);
|
||||
|
||||
Standard_EXPORT void AddInShape(const Standard_Boolean inshape) ;
|
||||
|
||||
Standard_EXPORT void Add(const TopoDS_Shape& S) ;
|
||||
|
||||
Standard_EXPORT TColStd_SequenceOfInteger& Edges() ;
|
||||
|
||||
Standard_EXPORT TColStd_SequenceOfInteger& Vertices() ;
|
||||
|
||||
Standard_EXPORT TColStd_SequenceOfInteger& Triangles() ;
|
||||
|
||||
Standard_EXPORT void DrawOn(Draw_Display& dis) const;
|
||||
|
||||
Standard_EXPORT virtual Handle_Draw_Drawable3D Copy() const;
|
||||
|
||||
Standard_EXPORT virtual void Dump(Standard_OStream& S) const;
|
||||
|
||||
Standard_EXPORT virtual void Whatis(Draw_Interpretor& S) const;
|
||||
|
||||
Standard_EXPORT Handle(BRepMesh_FastDiscret) Mesh() const;
|
||||
|
||||
DEFINE_STANDARD_RTTI(MeshTest_DrawableMesh)
|
||||
|
||||
private:
|
||||
|
||||
Handle(BRepMesh_FastDiscret) myMesh;
|
||||
Standard_Real myDeflection;
|
||||
TColStd_SequenceOfInteger myEdges;
|
||||
TColStd_SequenceOfInteger myVertices;
|
||||
TColStd_SequenceOfInteger myTriangles;
|
||||
Standard_Boolean myinshape;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(MeshTest_DrawableMesh, Draw_Drawable3D)
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user