remove all references to BRepMesh

This commit is contained in:
Sebastian Hoogen 2014-07-17 21:51:07 +02:00 committed by wmayer
parent eea27448e9
commit a0454af685
8 changed files with 16 additions and 212 deletions

View File

@ -59,7 +59,6 @@
#include <TopTools_ListOfShape.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <BRep_Tool.hxx>
#include <BRepMesh.hxx>
#include <BRepAdaptor_CompCurve.hxx>
#include <Handle_BRepAdaptor_HCompCurve.hxx>

View File

@ -52,7 +52,6 @@
#include <TopTools_ListOfShape.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <BRep_Tool.hxx>
#include <BRepMesh.hxx>
#include <Base/Exception.h>
@ -94,88 +93,6 @@ FeatureViewPart::~FeatureViewPart()
{
}
#if 0
App::DocumentObjectExecReturn *FeatureViewPart::execute(void)
{
std::stringstream result;
std::string ViewName = Label.getValue();
App::DocumentObject* link = Source.getValue();
if (!link)
return new App::DocumentObjectExecReturn("No object linked");
if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))
return new App::DocumentObjectExecReturn("Linked object is not a Part object");
TopoDS_Shape shape = static_cast<Part::Feature*>(link)->Shape.getShape()._Shape;
if (shape.IsNull())
return new App::DocumentObjectExecReturn("Linked shape object is empty");
Handle( HLRBRep_Algo ) brep_hlr = new HLRBRep_Algo;
brep_hlr->Add( shape );
gp_Ax2 transform(gp_Pnt(0,0,0),gp_Dir(0,0,1));
HLRAlgo_Projector projector( transform );
brep_hlr->Projector( projector );
brep_hlr->Update();
brep_hlr->Hide();
// extracting the result sets:
HLRBRep_HLRToShape shapes( brep_hlr );
TopoDS_Shape VisiblyEdges;
VisiblyEdges = shapes.VCompound();
TopoDS_Shape HiddenEdges;
HiddenEdges = shapes.HCompound();
BRepMesh::Mesh(VisiblyEdges,0.1);
//HLRBRep_HLRToShape Tool(Hider);
//TopoDS_Shape V = Tool.VCompound ();// artes vives vues
//TopoDS_Shape V1 = Tool.Rg1LineVCompound();// artes rgulires vues
//TopoDS_Shape VN = Tool.RgNLineVCompound();// artes de couture vues
//TopoDS_Shape VO = Tool.OutLineVCompound();// contours apparents vus
//TopoDS_Shape VI = Tool.IsoLineVCompound();// isoparamtriques vues
//TopoDS_Shape H = Tool.HCompound ();// artes vives caches
//TopoDS_Shape H1 = Tool.Rg1LineHCompound();// artes rgulires caches
//TopoDS_Shape HN = Tool.RgNLineHCompound();// artes de couture caches
//TopoDS_Shape HO = Tool.OutLineHCompound();// contours apparents cachs
//TopoDS_Shape HI = Tool.IsoLineHCompound();// isoparamtriques caches
result << "<g"
<< " id=\"" << ViewName << "\"" << endl
<< " stroke=\"rgb(0, 0, 0)\"" << endl
<< " stroke-width=\"0.35\"" << endl
<< " stroke-linecap=\"butt\"" << endl
<< " stroke-linejoin=\"miter\"" << endl
<< " transform=\"translate("<< X.getValue()<<","<<Y.getValue()<<") scale("<< Scale.getValue()<<","<<Scale.getValue()<<")\"" << endl
<< " fill=\"none\"" << endl
<< " >" << endl;
TopExp_Explorer edges( VisiblyEdges, TopAbs_EDGE );
for (int i = 1 ; edges.More(); edges.Next(),i++ ) {
TopoDS_Edge edge = TopoDS::Edge( edges.Current() );
TopLoc_Location location;
Handle( Poly_Polygon3D ) polygon = BRep_Tool::Polygon3D( edge, location );
if ( !polygon.IsNull() ) {
const TColgp_Array1OfPnt& nodes = polygon->Nodes();
char c = 'M';
result << "<path id= \"" << ViewName << i << "\" d=\" ";
for ( int i = nodes.Lower(); i<= nodes.Upper(); i++ ){
result << c << " " << nodes(i).X() << " " << nodes(i).Y()<< " " ;
c = 'L';
}
result << "\" />" << endl;
}
}
result << "</g>" << endl;
// Apply the resulting fragment
ViewResult.setValue(result.str().c_str());
return App::DocumentObject::StdReturn;
}
#else
App::DocumentObjectExecReturn *FeatureViewPart::execute(void)
{
std::stringstream result;
@ -218,7 +135,6 @@ App::DocumentObjectExecReturn *FeatureViewPart::execute(void)
}
}
#endif
// Python Drawing feature ---------------------------------------------------------

View File

@ -59,7 +59,7 @@
#include <TopTools_ListOfShape.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <BRep_Tool.hxx>
#include <BRepMesh.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <BRepLib.hxx>
#include <BRepAdaptor_CompCurve.hxx>
#include <Handle_BRepAdaptor_HCompCurve.hxx>
@ -172,7 +172,7 @@ std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double to
if (!H.IsNull() && (type & WithHidden)) {
double width = hiddenscale;
BRepMesh::Mesh(H,tolerance);
BRepMesh_IncrementalMesh(H,tolerance);
result << "<g"
//<< " id=\"" << ViewName << "\"" << endl
<< " stroke=\"rgb(0, 0, 0)\"" << endl
@ -188,7 +188,7 @@ std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double to
}
if (!HO.IsNull() && (type & WithHidden)) {
double width = hiddenscale;
BRepMesh::Mesh(HO,tolerance);
BRepMesh_IncrementalMesh(HO,tolerance);
result << "<g"
//<< " id=\"" << ViewName << "\"" << endl
<< " stroke=\"rgb(0, 0, 0)\"" << endl
@ -204,7 +204,7 @@ std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double to
}
if (!VO.IsNull()) {
double width = scale;
BRepMesh::Mesh(VO,tolerance);
BRepMesh_IncrementalMesh(VO,tolerance);
result << "<g"
//<< " id=\"" << ViewName << "\"" << endl
<< " stroke=\"rgb(0, 0, 0)\"" << endl
@ -219,7 +219,7 @@ std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double to
}
if (!V.IsNull()) {
double width = scale;
BRepMesh::Mesh(V,tolerance);
BRepMesh_IncrementalMesh(V,tolerance);
result << "<g"
//<< " id=\"" << ViewName << "\"" << endl
<< " stroke=\"rgb(0, 0, 0)\"" << endl
@ -234,7 +234,7 @@ std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double to
}
if (!V1.IsNull() && (type & WithSmooth)) {
double width = scale;
BRepMesh::Mesh(V1,tolerance);
BRepMesh_IncrementalMesh(V1,tolerance);
result << "<g"
//<< " id=\"" << ViewName << "\"" << endl
<< " stroke=\"rgb(0, 0, 0)\"" << endl
@ -249,7 +249,7 @@ std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double to
}
if (!H1.IsNull() && (type & WithSmooth) && (type & WithHidden)) {
double width = hiddenscale;
BRepMesh::Mesh(H1,tolerance);
BRepMesh_IncrementalMesh(H1,tolerance);
result << "<g"
//<< " id=\"" << ViewName << "\"" << endl
<< " stroke=\"rgb(0, 0, 0)\"" << endl
@ -281,7 +281,7 @@ std::string ProjectionAlgos::getDXF(ExtractionType type, double scale, double to
if (!H.IsNull() && (type & WithHidden)) {
//float width = 0.15f/scale;
BRepMesh::Mesh(H,tolerance);
BRepMesh_IncrementalMesh(H,tolerance);
result //<< "<g"
//<< " id=\"" << ViewName << "\"" << endl
/*<< " stroke=\"rgb(0, 0, 0)\"" << endl
@ -296,7 +296,7 @@ std::string ProjectionAlgos::getDXF(ExtractionType type, double scale, double to
}
if (!HO.IsNull() && (type & WithHidden)) {
//float width = 0.15f/scale;
BRepMesh::Mesh(HO,tolerance);
BRepMesh_IncrementalMesh(HO,tolerance);
result //<< "<g"
//<< " id=\"" << ViewName << "\"" << endl
/*<< " stroke=\"rgb(0, 0, 0)\"" << endl
@ -311,7 +311,7 @@ std::string ProjectionAlgos::getDXF(ExtractionType type, double scale, double to
}
if (!VO.IsNull()) {
//float width = 0.35f/scale;
BRepMesh::Mesh(VO,tolerance);
BRepMesh_IncrementalMesh(VO,tolerance);
result //<< "<g"
//<< " id=\"" << ViewName << "\"" << endl
@ -327,7 +327,7 @@ std::string ProjectionAlgos::getDXF(ExtractionType type, double scale, double to
}
if (!V.IsNull()) {
//float width = 0.35f/scale;
BRepMesh::Mesh(V,tolerance);
BRepMesh_IncrementalMesh(V,tolerance);
result //<< "<g"
//<< " id=\"" << ViewName << "\"" << endl
/*<< " stroke=\"rgb(0, 0, 0)\"" << endl
@ -343,7 +343,7 @@ std::string ProjectionAlgos::getDXF(ExtractionType type, double scale, double to
}
if (!V1.IsNull() && (type & WithSmooth)) {
//float width = 0.35f/scale;
BRepMesh::Mesh(V1,tolerance);
BRepMesh_IncrementalMesh(V1,tolerance);
result //<< "<g"
//<< " id=\"" << ViewName << "\"" << endl
@ -359,7 +359,7 @@ std::string ProjectionAlgos::getDXF(ExtractionType type, double scale, double to
}
if (!H1.IsNull() && (type & WithSmooth) && (type & WithHidden)) {
//float width = 0.15f/scale;
BRepMesh::Mesh(H1,tolerance);
BRepMesh_IncrementalMesh(H1,tolerance);
result //<< "<g"
//<< " id=\"" << ViewName << "\"" << endl
/*<< " stroke=\"rgb(0, 0, 0)\"" << endl

View File

@ -60,7 +60,6 @@
# include <BRepCheck_ListIteratorOfListOfStatus.hxx>
# include <BRepCheck_Result.hxx>
# include <BRepFilletAPI_MakeFillet.hxx>
# include <BRepMesh.hxx>
# include <BRepMesh_IncrementalMesh.hxx>
# include <BRepMesh_Triangle.hxx>
# include <BRepMesh_Edge.hxx>
@ -145,7 +144,6 @@
#endif
# include <Poly_Polygon3D.hxx>
# include <Poly_PolygonOnTriangulation.hxx>
# include <BRepMesh.hxx>
# include <BRepBuilderAPI_Sewing.hxx>
# include <ShapeFix_Shape.hxx>
# include <XSControl_WorkSession.hxx>
@ -2289,7 +2287,6 @@ void TopoShape::getFaces(std::vector<Base::Vector3d> &aPoints,
std::vector<Facet> &aTopo,
float accuracy, uint16_t flags) const
{
#if 1
if (this->_Shape.IsNull())
return;
std::set<MeshVertex> vertices;
@ -2360,110 +2357,6 @@ void TopoShape::getFaces(std::vector<Base::Vector3d> &aPoints,
points[it->i] = it->toPoint();
for (std::vector<gp_Pnt>::iterator it = points.begin(); it != points.end(); ++it)
aPoints.push_back(Base::Vector3d(it->X(),it->Y(),it->Z()));
#endif
#if 0
BRepMesh::Mesh (this->_Shape, accuracy);
std::set<MeshVertex> vertices;
for (TopExp_Explorer xp(this->_Shape,TopAbs_FACE); xp.More(); xp.Next()) {
TopoDS_Face face = TopoDS::Face(xp.Current());
TopAbs_Orientation orient = face.Orientation();
// change orientation of the triangles
Standard_Boolean reversed = false;
if (orient != TopAbs_FORWARD) {
reversed = true;
}
TopLoc_Location aLoc;
Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(face, aLoc);
if (aPoly.IsNull()) continue;
// getting the transformation of the shape/face
gp_Trsf myTransf;
Standard_Boolean identity = true;
if(!aLoc.IsIdentity()) {
identity = false;
myTransf = aLoc.Transformation();
}
// cycling through the poly mesh
const TColgp_Array1OfPnt& Nodes = aPoly->Nodes();
for (Standard_Integer i=1;i<=Nodes.Length();i++) {
Standard_Real X1, Y1, Z1;
gp_Pnt p = Nodes.Value(i);
p.Transform(myTransf);
p.Coord (X1, Y1, Z1);
}
const Poly_Array1OfTriangle& Triangles = aPoly->Triangles();
try {
for (Standard_Integer i=1;i<=Triangles.Length();i++) {
Standard_Integer V1, V2, V3;
Poly_Triangle triangle = Triangles.Value(i);
triangle.Get(V1, V2, V3);
if (reversed)
std::swap(V1,V2);
gp_Pnt P1, P2, P3;
Data::ComplexGeoData::Facet face;
std::set<MeshVertex>::iterator it;
// 1st vertex
P1 = Nodes(V1);
P1.Transform(myTransf);
MeshVertex v1(P1);
it = vertices.find(v1);
if (it == vertices.end()) {
v1.i = vertices.size();
face.I1 = v1.i;
vertices.insert(v1);
}
else {
face.I1 = it->i;
}
// 2nd vertex
P2 = Nodes(V2);
P2.Transform(myTransf);
MeshVertex v2(P2);
it = vertices.find(v2);
if (it == vertices.end()) {
v2.i = vertices.size();
face.I2 = v2.i;
vertices.insert(v2);
}
else {
face.I2 = it->i;
}
// 3rd vertex
P3 = Nodes(V3);
P3.Transform(myTransf);
MeshVertex v3(P3);
it = vertices.find(v3);
if (it == vertices.end()) {
v3.i = vertices.size();
face.I3 = v3.i;
vertices.insert(v3);
}
else {
face.I3 = it->i;
}
// make sure that we don't insert invalid facets
if (face.I1 != face.I2 &&
face.I2 != face.I3 &&
face.I3 != face.I1)
aTopo.push_back(face);
}
}
catch(Standard_Failure) {
}
}
std::map<Standard_Integer,gp_Pnt> points;
for (std::set<MeshVertex>::iterator it = vertices.begin(); it != vertices.end(); ++it)
points[it->i] = it->toPoint();
for (std::map<Standard_Integer,gp_Pnt>::iterator it = points.begin(); it != points.end(); ++it)
aPoints.push_back(Base::Vector3d(it->second.X(),it->second.Y(),it->second.Z()));
#endif
}
void TopoShape::setFaces(const std::vector<Base::Vector3d> &Points,

View File

@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <sstream>
# include <BRepMesh.hxx>
# include <BRepMesh_IncrementalMesh.hxx>
# include <BRepBuilderAPI_Copy.hxx>
# include <BRepBuilderAPI_Sewing.hxx>
# include <BRepBuilderAPI_Transform.hxx>
@ -250,7 +250,7 @@ PyObject* TopoShapePy::writeInventor(PyObject * args)
return NULL;
std::stringstream result;
BRepMesh::Mesh(getTopoShapePtr()->_Shape,dev);
BRepMesh_IncrementalMesh(getTopoShapePtr()->_Shape,dev);
if (mode == 0)
getTopoShapePtr()->exportFaceSet(dev, angle, result);
else if (mode == 1)

View File

@ -27,7 +27,6 @@
# include <Bnd_Box.hxx>
# include <Poly_Polygon3D.hxx>
# include <BRepBndLib.hxx>
# include <BRepMesh.hxx>
# include <BRepMesh_IncrementalMesh.hxx>
# include <BRep_Tool.hxx>
# include <BRepTools.hxx>
@ -468,7 +467,7 @@ void ViewProviderPartBase::updateData(const App::Property* prop)
Standard_Real deflection = ((xMax-xMin)+(yMax-yMin)+(zMax-zMin))/300.0 *
this->meshDeviation;
BRepMesh::Mesh(cShape,deflection);
BRepMesh_IncrementalMesh(cShape,deflection);
//BRepMesh_IncrementalMesh MESH(cShape,meshDeviation);
// We must reset the location here because the transformation data
// are set in the placement property
@ -720,7 +719,6 @@ Standard_Boolean ViewProviderPartBase::computeFaces(SoGroup* FaceRoot, const Top
FaceRoot->addChild(pcShapeMaterial);
// BRepMesh::Mesh(myShape,1.0);
BRepMesh_IncrementalMesh MESH(myShape,defl);
int i = 1;

View File

@ -30,7 +30,6 @@
# include <BRepBndLib.hxx>
# include <BRepBuilderAPI_MakeVertex.hxx>
# include <BRepExtrema_DistShapeShape.hxx>
# include <BRepMesh.hxx>
# include <BRepMesh_IncrementalMesh.hxx>
# include <BRep_Tool.hxx>
# include <BRepTools.hxx>

View File

@ -26,7 +26,6 @@
#ifndef _PreComp_
# include <Poly_Polygon3D.hxx>
# include <BRepBndLib.hxx>
# include <BRepMesh.hxx>
# include <BRepMesh_IncrementalMesh.hxx>
# include <BRep_Tool.hxx>
# include <BRepTools.hxx>