1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-26 11:05:31 +03:00
occt/src/BRepTools/BRepTools_WireExplorer.hxx
emv b6cf8ffa35 0028385: Improve drawing isolines (DBRep_IsoBuilder algorithm)
1. When computing the iso-lines for the face (*DBRep_IsoBuilder*) prepare the Hatching algorithm with the following elements:
a. Trimmed p-curves of edges. The trimming parameters are computed by intersection with p-curves of the neighboring edges. The trimming will be performed only if the intersection point is covered by the tolerance of common vertex.
b. 2D segments connecting the p-curves of the neighboring edges. These segments will close the 2D gaps, which are closed in 3D by the tolerance of vertices shared between edges. This will allow trimming correctly the iso-lines passing through such gaps.

2. Implementation of the additional Init() method for WireExplorer algorithm taking UV bounds of the face to avoid their repeated computation when work working with a face having multiple wires.

3. Test cases for the issue.
2018-01-23 20:11:08 +03:00

142 lines
4.3 KiB
C++

// Created on: 1993-01-21
// Created by: Remi LEQUETTE
// Copyright (c) 1993-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.
#ifndef _BRepTools_WireExplorer_HeaderFile
#define _BRepTools_WireExplorer_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Face.hxx>
#include <TopTools_MapOfShape.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <TopAbs_Orientation.hxx>
class Standard_DomainError;
class Standard_NoSuchObject;
class Standard_NoMoreObject;
class TopoDS_Wire;
class TopoDS_Face;
class TopoDS_Edge;
class TopoDS_Vertex;
//! The WireExplorer is a tool to explore the edges of
//! a wire in a connection order.
//!
//! i.e. each edge is connected to the previous one by
//! its origin.
//! If a wire is not closed returns only a segment of edges which
//! length depends on started in exploration edge.
//! Algorithm suggests that wire is valid and has no any defects, which
//! can stop edge exploration. Such defects can be loops, wrong orientation of edges
//! (two edges go in to shared vertex or go out from shared vertex), branching of edges,
//! the presens of edges with INTERNAL or EXTERNAL orientation. If wire has
//! such kind of defects WireExplorer can return not all
//! edges in a wire. it depends on type of defect and position of starting edge.
class BRepTools_WireExplorer
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs an empty explorer (which can be initialized using Init)
Standard_EXPORT BRepTools_WireExplorer();
//! IInitializes an exploration of the wire <W>.
Standard_EXPORT BRepTools_WireExplorer(const TopoDS_Wire& W);
//! Initializes an exploration of the wire <W>.
//! F is used to select the edge connected to the
//! previous in the parametric representation of <F>.
Standard_EXPORT BRepTools_WireExplorer(const TopoDS_Wire& W, const TopoDS_Face& F);
//! Initializes an exploration of the wire <W>.
Standard_EXPORT void Init (const TopoDS_Wire& W);
//! Initializes an exploration of the wire <W>.
//! F is used to select the edge connected to the
//! previous in the parametric representation of <F>.
Standard_EXPORT void Init (const TopoDS_Wire& W, const TopoDS_Face& F);
//! Initializes an exploration of the wire <W>.
//! F is used to select the edge connected to the
//! previous in the parametric representation of <F>.
//! <UMIn>, <UMax>, <VMin>, <VMax> - the UV bounds of the face <F>.
Standard_EXPORT void Init(const TopoDS_Wire& W,
const TopoDS_Face& F,
const Standard_Real UMin,
const Standard_Real UMax,
const Standard_Real VMin,
const Standard_Real VMax);
//! Returns True if there is a current edge.
Standard_EXPORT Standard_Boolean More() const;
//! Proceeds to the next edge.
Standard_EXPORT void Next();
//! Returns the current edge.
Standard_EXPORT const TopoDS_Edge& Current() const;
//! Returns an Orientation for the current edge.
Standard_EXPORT TopAbs_Orientation Orientation() const;
//! Returns the vertex connecting the current edge to
//! the previous one.
Standard_EXPORT const TopoDS_Vertex& CurrentVertex() const;
//! Clears the content of the explorer.
Standard_EXPORT void Clear();
protected:
private:
TopTools_DataMapOfShapeListOfShape myMap;
TopoDS_Edge myEdge;
TopoDS_Vertex myVertex;
TopoDS_Face myFace;
TopTools_MapOfShape myDoubles;
Standard_Boolean myReverse;
Standard_Real myTolU;
Standard_Real myTolV;
};
#endif // _BRepTools_WireExplorer_HeaderFile