mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024002: Overall code and build procedure refactoring -- automatic
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl": - WOK-generated header files from inc and sources from drv are moved to src - CDL files removed - All packages are converted to nocdlpack
This commit is contained in:
@@ -1,4 +1,22 @@
|
||||
ShapeExtend_DataMapOfShapeListOfMsg.hxx
|
||||
ShapeExtend.cxx
|
||||
ShapeExtend.hxx
|
||||
ShapeExtend_BasicMsgRegistrator.cxx
|
||||
ShapeExtend_BasicMsgRegistrator.hxx
|
||||
ShapeExtend_ComplexCurve.cxx
|
||||
ShapeExtend_ComplexCurve.hxx
|
||||
ShapeExtend_ComplexCurve.lxx
|
||||
ShapeExtend_CompositeSurface.cxx
|
||||
ShapeExtend_CompositeSurface.hxx
|
||||
ShapeExtend_DataMapIteratorOfDataMapOfShapeListOfMsg.hxx
|
||||
ShapeExtend_DataMapOfTransientListOfMsg.hxx
|
||||
ShapeExtend_DataMapIteratorOfDataMapOfTransientListOfMsg.hxx
|
||||
ShapeExtend_DataMapOfShapeListOfMsg.hxx
|
||||
ShapeExtend_DataMapOfTransientListOfMsg.hxx
|
||||
ShapeExtend_Explorer.cxx
|
||||
ShapeExtend_Explorer.hxx
|
||||
ShapeExtend_MsgRegistrator.cxx
|
||||
ShapeExtend_MsgRegistrator.hxx
|
||||
ShapeExtend_MsgRegistrator.lxx
|
||||
ShapeExtend_Parametrisation.hxx
|
||||
ShapeExtend_Status.hxx
|
||||
ShapeExtend_WireData.cxx
|
||||
ShapeExtend_WireData.hxx
|
||||
|
@@ -1,128 +0,0 @@
|
||||
-- Created on: 1998-07-21
|
||||
-- Created by: data exchange team
|
||||
-- Copyright (c) 1998-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.
|
||||
|
||||
package ShapeExtend
|
||||
|
||||
---Purpose: This package provides general tools and data structures common
|
||||
-- for other packages in SHAPEWORKS and extending CAS.CADE
|
||||
-- structures.
|
||||
-- The following items are provided by this package:
|
||||
-- - enumeration Status used for coding status flags in methods
|
||||
-- inside the SHAPEWORKS
|
||||
-- - enumeration Parametrisation used for setting global parametrisation
|
||||
-- on the composite surface
|
||||
-- - class CompositeSurface representing a composite surface
|
||||
-- made of a grid of surface patches
|
||||
-- - class WireData representing a wire in the form of ordered
|
||||
-- list of edges
|
||||
-- - class MsgRegistrator for attaching messages to the objects
|
||||
-- - tools for exploring the shapes
|
||||
-- - tools for creating new shapes.
|
||||
uses
|
||||
|
||||
TCollection,
|
||||
gp,
|
||||
Geom,
|
||||
GeomAbs,
|
||||
TColStd,
|
||||
TColGeom,
|
||||
TopAbs,
|
||||
TopoDS,
|
||||
TopTools,
|
||||
Message
|
||||
|
||||
is
|
||||
|
||||
enumeration Status is
|
||||
---Purpose: This enumeration is used in
|
||||
-- ShapeHealing toolkit for representing flags in the
|
||||
-- return statuses of class methods.
|
||||
-- The status is a field of the class which is set by one or
|
||||
-- several methods of that class.
|
||||
-- It is used for reporting about errors and other situations
|
||||
-- encountered during execution of the method.
|
||||
-- There are defined 8 values for DONE and 8 for FAIL flags:
|
||||
-- ShapeExtend_DONE1 ... ShapeExtend_DONE8,
|
||||
-- ShapeExtend_FAIL1 ... ShapeExtend_FAIL8
|
||||
-- and also enumerations for representing combinations of flags:
|
||||
-- ShapeExtend_OK - no flags at all,
|
||||
-- ShapeExtend_DONE - any of flags DONEi,
|
||||
-- ShapeExtend_FAIL - any of flags FAILi.
|
||||
-- The class that uses statuses provides a method(s) which
|
||||
-- answers whether the flag corresponding to a given
|
||||
-- enumerative value is (are) set:
|
||||
-- Standard_Boolean Status(const ShapeExtend_Status test);
|
||||
-- Note that status can have several flags set simultaneously.
|
||||
-- Status(ShapeExtend_OK) gives True when no flags are set.
|
||||
OK, -- Nothing done, everything OK
|
||||
DONE1, -- Something was done, case 1
|
||||
DONE2, -- Something was done, case 2
|
||||
DONE3, -- Something was done, case 3
|
||||
DONE4, -- Something was done, case 4
|
||||
DONE5, -- Something was done, case 5
|
||||
DONE6, -- Something was done, case 6
|
||||
DONE7, -- Something was done, case 7
|
||||
DONE8, -- Something was done, case 8
|
||||
DONE, -- Something was done (any of DONE#)
|
||||
FAIL1, -- The method failed, case 1
|
||||
FAIL2, -- The method failed, case 2
|
||||
FAIL3, -- The method failed, case 3
|
||||
FAIL4, -- The method failed, case 4
|
||||
FAIL5, -- The method failed, case 5
|
||||
FAIL6, -- The method failed, case 6
|
||||
FAIL7, -- The method failed, case 7
|
||||
FAIL8, -- The method failed, case 8
|
||||
FAIL -- The mathod failed (any of FAIL# occured)
|
||||
end Status;
|
||||
|
||||
enumeration Parametrisation is
|
||||
---Purpose: Defines kind of global parametrisation on the composite surface
|
||||
Natural, -- each patch of the 1st row and column adds its range, Ui+1 = Ui + URange(i,1), etc.
|
||||
Uniform, -- each patch gives range 1.: Ui = i-1, Vj = j-1
|
||||
Unitary -- uniform parametrisation with global range [0,1]
|
||||
end Parametrisation;
|
||||
|
||||
deferred class ComplexCurve;
|
||||
|
||||
class CompositeSurface;
|
||||
|
||||
class WireData;
|
||||
|
||||
class BasicMsgRegistrator;
|
||||
|
||||
class MsgRegistrator;
|
||||
|
||||
class Explorer;
|
||||
|
||||
imported DataMapOfShapeListOfMsg;
|
||||
|
||||
imported DataMapIteratorOfDataMapOfShapeListOfMsg;
|
||||
|
||||
imported DataMapOfTransientListOfMsg;
|
||||
|
||||
imported DataMapIteratorOfDataMapOfTransientListOfMsg;
|
||||
|
||||
Init;
|
||||
---Purpose: Inits using of ShapeExtend.
|
||||
-- Currently, loads messages output by ShapeHealing algorithms.
|
||||
|
||||
EncodeStatus ( status: Status from ShapeExtend ) returns Integer;
|
||||
---Purpose: Encodes status (enumeration) to a bit flag
|
||||
|
||||
DecodeStatus ( flag: Integer; status: Status from ShapeExtend ) returns Boolean;
|
||||
---Purpose: Tells if a bit flag contains bit corresponding to enumerated status
|
||||
|
||||
end ShapeExtend;
|
@@ -14,14 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeExtend.ixx>
|
||||
|
||||
#include <Message_MsgFile.hxx>
|
||||
#include <ShapeExtend.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Init
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ShapeExtend::Init()
|
||||
{
|
||||
static Standard_Boolean init = Standard_False;
|
||||
|
96
src/ShapeExtend/ShapeExtend.hxx
Normal file
96
src/ShapeExtend/ShapeExtend.hxx
Normal file
@@ -0,0 +1,96 @@
|
||||
// Created on: 1998-07-21
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 1998-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 _ShapeExtend_HeaderFile
|
||||
#define _ShapeExtend_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <ShapeExtend_Status.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class ShapeExtend_ComplexCurve;
|
||||
class ShapeExtend_CompositeSurface;
|
||||
class ShapeExtend_WireData;
|
||||
class ShapeExtend_BasicMsgRegistrator;
|
||||
class ShapeExtend_MsgRegistrator;
|
||||
class ShapeExtend_Explorer;
|
||||
|
||||
|
||||
//! This package provides general tools and data structures common
|
||||
//! for other packages in SHAPEWORKS and extending CAS.CADE
|
||||
//! structures.
|
||||
//! The following items are provided by this package:
|
||||
//! - enumeration Status used for coding status flags in methods
|
||||
//! inside the SHAPEWORKS
|
||||
//! - enumeration Parametrisation used for setting global parametrisation
|
||||
//! on the composite surface
|
||||
//! - class CompositeSurface representing a composite surface
|
||||
//! made of a grid of surface patches
|
||||
//! - class WireData representing a wire in the form of ordered
|
||||
//! list of edges
|
||||
//! - class MsgRegistrator for attaching messages to the objects
|
||||
//! - tools for exploring the shapes
|
||||
//! - tools for creating new shapes.
|
||||
class ShapeExtend
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Inits using of ShapeExtend.
|
||||
//! Currently, loads messages output by ShapeHealing algorithms.
|
||||
Standard_EXPORT static void Init();
|
||||
|
||||
//! Encodes status (enumeration) to a bit flag
|
||||
Standard_EXPORT static Standard_Integer EncodeStatus (const ShapeExtend_Status status);
|
||||
|
||||
//! Tells if a bit flag contains bit corresponding to enumerated status
|
||||
Standard_EXPORT static Standard_Boolean DecodeStatus (const Standard_Integer flag, const ShapeExtend_Status status);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class ShapeExtend_ComplexCurve;
|
||||
friend class ShapeExtend_CompositeSurface;
|
||||
friend class ShapeExtend_WireData;
|
||||
friend class ShapeExtend_BasicMsgRegistrator;
|
||||
friend class ShapeExtend_MsgRegistrator;
|
||||
friend class ShapeExtend_Explorer;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeExtend_HeaderFile
|
@@ -1,54 +0,0 @@
|
||||
-- Created on: 2000-01-28
|
||||
-- Created by: data exchange team
|
||||
-- Copyright (c) 2000-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 BasicMsgRegistrator from ShapeExtend inherits TShared from MMgt
|
||||
|
||||
---Purpose: Abstract class that can be used for attaching messages
|
||||
-- to the objects (e.g. shapes).
|
||||
-- It is used by ShapeHealing algorithms to attach a message
|
||||
-- describing encountered case (e.g. removing small edge from
|
||||
-- a wire).
|
||||
--
|
||||
-- The methods of this class are empty and redefined, for instance,
|
||||
-- in the classes for Data Exchange processors for attaching
|
||||
-- messages to interface file entities or CAS.CADE shapes.
|
||||
|
||||
uses
|
||||
|
||||
Shape from TopoDS,
|
||||
Msg from Message,
|
||||
Gravity from Message
|
||||
|
||||
is
|
||||
|
||||
Create returns BasicMsgRegistrator from ShapeExtend;
|
||||
---Purpose: Empty constructor.
|
||||
|
||||
Send (me: mutable; object : Transient;
|
||||
message: Msg from Message;
|
||||
gravity: Gravity from Message) is virtual;
|
||||
---Purpose: Sends a message to be attached to the object.
|
||||
-- Object can be of any type interpreted by redefined MsgRegistrator.
|
||||
|
||||
Send (me: mutable; shape : Shape from TopoDS;
|
||||
message: Msg from Message;
|
||||
gravity: Gravity from Message) is virtual;
|
||||
---Purpose: Sends a message to be attached to the shape.
|
||||
|
||||
Send (me: mutable; message: Msg from Message;
|
||||
gravity: Gravity from Message) is virtual;
|
||||
---Purpose: Calls Send method with Null Transient.
|
||||
|
||||
end BasicMsgRegistrator;
|
@@ -13,13 +13,17 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeExtend_BasicMsgRegistrator.ixx>
|
||||
|
||||
#include <Message_Msg.hxx>
|
||||
#include <ShapeExtend_BasicMsgRegistrator.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeExtend_BasicMsgRegistrator
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeExtend_BasicMsgRegistrator::ShapeExtend_BasicMsgRegistrator()
|
||||
{
|
||||
}
|
||||
|
83
src/ShapeExtend/ShapeExtend_BasicMsgRegistrator.hxx
Normal file
83
src/ShapeExtend/ShapeExtend_BasicMsgRegistrator.hxx
Normal file
@@ -0,0 +1,83 @@
|
||||
// Created on: 2000-01-28
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 2000-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 _ShapeExtend_BasicMsgRegistrator_HeaderFile
|
||||
#define _ShapeExtend_BasicMsgRegistrator_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Message_Gravity.hxx>
|
||||
class Standard_Transient;
|
||||
class Message_Msg;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
class ShapeExtend_BasicMsgRegistrator;
|
||||
DEFINE_STANDARD_HANDLE(ShapeExtend_BasicMsgRegistrator, MMgt_TShared)
|
||||
|
||||
//! Abstract class that can be used for attaching messages
|
||||
//! to the objects (e.g. shapes).
|
||||
//! It is used by ShapeHealing algorithms to attach a message
|
||||
//! describing encountered case (e.g. removing small edge from
|
||||
//! a wire).
|
||||
//!
|
||||
//! The methods of this class are empty and redefined, for instance,
|
||||
//! in the classes for Data Exchange processors for attaching
|
||||
//! messages to interface file entities or CAS.CADE shapes.
|
||||
class ShapeExtend_BasicMsgRegistrator : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Empty constructor.
|
||||
Standard_EXPORT ShapeExtend_BasicMsgRegistrator();
|
||||
|
||||
//! Sends a message to be attached to the object.
|
||||
//! Object can be of any type interpreted by redefined MsgRegistrator.
|
||||
Standard_EXPORT virtual void Send (const Handle(Standard_Transient)& object, const Message_Msg& message, const Message_Gravity gravity);
|
||||
|
||||
//! Sends a message to be attached to the shape.
|
||||
Standard_EXPORT virtual void Send (const TopoDS_Shape& shape, const Message_Msg& message, const Message_Gravity gravity);
|
||||
|
||||
//! Calls Send method with Null Transient.
|
||||
Standard_EXPORT virtual void Send (const Message_Msg& message, const Message_Gravity gravity);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeExtend_BasicMsgRegistrator,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeExtend_BasicMsgRegistrator_HeaderFile
|
@@ -1,115 +0,0 @@
|
||||
-- Created on: 1999-06-22
|
||||
-- Created by: Roman LYGIN
|
||||
-- Copyright (c) 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.
|
||||
|
||||
deferred class ComplexCurve from ShapeExtend inherits Curve from Geom
|
||||
|
||||
---Purpose: Defines a curve which consists of several segments.
|
||||
-- Implements basic interface to it.
|
||||
|
||||
uses
|
||||
|
||||
Pnt from gp,
|
||||
Vec from gp,
|
||||
Trsf from gp,
|
||||
Shape from GeomAbs,
|
||||
Curve from Geom
|
||||
|
||||
is
|
||||
|
||||
Initialize returns ComplexCurve from ShapeExtend;
|
||||
---Purpose:
|
||||
|
||||
NbCurves (me) returns Integer is deferred;
|
||||
---Purpose: Returns number of curves
|
||||
|
||||
Curve (me; index: Integer) returns Curve from Geom is deferred;
|
||||
---C++: return const &
|
||||
---Purpose: Returns curve given by its index
|
||||
|
||||
LocateParameter (me; U : Real;
|
||||
UOut: out Real)
|
||||
returns Integer is deferred;
|
||||
---Purpose: Returns number of the curve for the given parameter U
|
||||
-- and local paramete r UOut for the found curve
|
||||
|
||||
LocalToGlobal (me; index : Integer;
|
||||
Ulocal: Real)
|
||||
returns Real is deferred;
|
||||
---Purpose: Returns global parameter for the whole curve according
|
||||
-- to the segment and local parameter on it
|
||||
|
||||
Transform (me: mutable; T: Trsf) is redefined;
|
||||
---Purpose: Applies transformation to each curve
|
||||
|
||||
ReversedParameter(me; U: Real) returns Real is redefined;
|
||||
---C++: inline
|
||||
---Purpose: Returns 1 - U
|
||||
|
||||
FirstParameter (me) returns Real is redefined;
|
||||
---C++: inline
|
||||
---Purpose: Returns 0
|
||||
|
||||
LastParameter (me) returns Real is redefined;
|
||||
---C++: inline
|
||||
---Purpose: Returns 1
|
||||
|
||||
IsClosed (me) returns Boolean is redefined;
|
||||
---C++: inline
|
||||
---Purpose: Returns True if the curve is closed
|
||||
|
||||
IsPeriodic (me) returns Boolean is redefined;
|
||||
---C++: inline
|
||||
---Purpose: Returns False
|
||||
|
||||
Continuity (me) returns Shape from GeomAbs is redefined;
|
||||
---C++: inline
|
||||
---Purpose: Returns GeomAbs_C0
|
||||
|
||||
IsCN (me; N: Integer) returns Boolean is redefined;
|
||||
---C++: inline
|
||||
---Purpose: Returns False if N > 0
|
||||
|
||||
D0 (me; U: Real; P: out Pnt) is redefined;
|
||||
---Purpose: Returns point at parameter U.
|
||||
-- Finds appropriate curve and local parameter on it.
|
||||
|
||||
D1 (me; U: Real; P: out Pnt; V1: out Vec) is redefined;
|
||||
|
||||
D2 (me; U: Real; P: out Pnt; V1, V2: out Vec) is redefined;
|
||||
|
||||
D3 (me; U: Real; P: out Pnt; V1, V2, V3: out Vec) is redefined;
|
||||
|
||||
DN (me; U: Real; N: Integer) returns Vec is redefined;
|
||||
|
||||
|
||||
GetScaleFactor(me; ind: Integer) returns Real is deferred;
|
||||
---Purpose: Returns scale factor for recomputing of deviatives.
|
||||
|
||||
---Level: Internal
|
||||
|
||||
CheckConnectivity (me: mutable; Preci: Real) returns Boolean;
|
||||
---Purpose: Checks geometrical connectivity of the curves, including
|
||||
-- closure (sets fields myClosed)
|
||||
|
||||
TransformDN (me; V: in out Vec; ind: Integer; N: Integer)
|
||||
is protected;
|
||||
---Purpose: Transform the derivative according to its order
|
||||
|
||||
fields
|
||||
|
||||
myClosed: Boolean is protected;
|
||||
|
||||
end ComplexCurve;
|
@@ -16,14 +16,18 @@
|
||||
|
||||
// pdn 13.07.99 Derivatives are scaled in accordance with local/global parameter transition
|
||||
|
||||
#include <ShapeExtend_ComplexCurve.ixx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ShapeExtend_ComplexCurve.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeExtend_ComplexCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeExtend_ComplexCurve::ShapeExtend_ComplexCurve()
|
||||
{
|
||||
myClosed = Standard_False;
|
||||
|
132
src/ShapeExtend/ShapeExtend_ComplexCurve.hxx
Normal file
132
src/ShapeExtend/ShapeExtend_ComplexCurve.hxx
Normal file
@@ -0,0 +1,132 @@
|
||||
// Created on: 1999-06-22
|
||||
// Created by: Roman LYGIN
|
||||
// Copyright (c) 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 _ShapeExtend_ComplexCurve_HeaderFile
|
||||
#define _ShapeExtend_ComplexCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
class Geom_Curve;
|
||||
class gp_Trsf;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
|
||||
|
||||
class ShapeExtend_ComplexCurve;
|
||||
DEFINE_STANDARD_HANDLE(ShapeExtend_ComplexCurve, Geom_Curve)
|
||||
|
||||
//! Defines a curve which consists of several segments.
|
||||
//! Implements basic interface to it.
|
||||
class ShapeExtend_ComplexCurve : public Geom_Curve
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Returns number of curves
|
||||
Standard_EXPORT virtual Standard_Integer NbCurves() const = 0;
|
||||
|
||||
//! Returns curve given by its index
|
||||
Standard_EXPORT virtual const Handle(Geom_Curve)& Curve (const Standard_Integer index) const = 0;
|
||||
|
||||
//! Returns number of the curve for the given parameter U
|
||||
//! and local paramete r UOut for the found curve
|
||||
Standard_EXPORT virtual Standard_Integer LocateParameter (const Standard_Real U, Standard_Real& UOut) const = 0;
|
||||
|
||||
//! Returns global parameter for the whole curve according
|
||||
//! to the segment and local parameter on it
|
||||
Standard_EXPORT virtual Standard_Real LocalToGlobal (const Standard_Integer index, const Standard_Real Ulocal) const = 0;
|
||||
|
||||
//! Applies transformation to each curve
|
||||
Standard_EXPORT virtual void Transform (const gp_Trsf& T) Standard_OVERRIDE;
|
||||
|
||||
//! Returns 1 - U
|
||||
virtual Standard_Real ReversedParameter (const Standard_Real U) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns 0
|
||||
virtual Standard_Real FirstParameter() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns 1
|
||||
virtual Standard_Real LastParameter() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns True if the curve is closed
|
||||
virtual Standard_Boolean IsClosed() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns False
|
||||
virtual Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns GeomAbs_C0
|
||||
virtual GeomAbs_Shape Continuity() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns False if N > 0
|
||||
virtual Standard_Boolean IsCN (const Standard_Integer N) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns point at parameter U.
|
||||
//! Finds appropriate curve and local parameter on it.
|
||||
Standard_EXPORT virtual void D0 (const Standard_Real U, gp_Pnt& P) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual gp_Vec DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns scale factor for recomputing of deviatives.
|
||||
Standard_EXPORT virtual Standard_Real GetScaleFactor (const Standard_Integer ind) const = 0;
|
||||
|
||||
//! Checks geometrical connectivity of the curves, including
|
||||
//! closure (sets fields myClosed)
|
||||
Standard_EXPORT Standard_Boolean CheckConnectivity (const Standard_Real Preci);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeExtend_ComplexCurve,Geom_Curve)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT ShapeExtend_ComplexCurve();
|
||||
|
||||
//! Transform the derivative according to its order
|
||||
Standard_EXPORT void TransformDN (gp_Vec& V, const Standard_Integer ind, const Standard_Integer N) const;
|
||||
|
||||
Standard_Boolean myClosed;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <ShapeExtend_ComplexCurve.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeExtend_ComplexCurve_HeaderFile
|
@@ -1,315 +0,0 @@
|
||||
-- Created on: 1999-04-27
|
||||
-- Created by: Andrey BETENEV
|
||||
-- Copyright (c) 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 CompositeSurface from ShapeExtend inherits Surface from Geom
|
||||
|
||||
---Purpose: Composite surface is represented by a grid of surfaces
|
||||
-- (patches) connected geometrically. Patches may have different
|
||||
-- parametrisation ranges, but they should be parametrised in
|
||||
-- the same manner so that parameter of each patch (u,v) can be converted
|
||||
-- to global parameter on the whole surface (U,V) with help of linear
|
||||
-- transformation:
|
||||
--
|
||||
-- for any i,j-th patch
|
||||
-- U = Ui + ( u - uijmin ) * ( Ui+1 - Ui ) / ( uijmax - uijmin )
|
||||
-- V = Vj + ( v - vijmin ) * ( Vj+1 - Vj ) / ( vijmax - vijmin )
|
||||
--
|
||||
-- where
|
||||
--
|
||||
-- [uijmin, uijmax] * [ vijmin, vijmax] - parametric range of i,j-th patch,
|
||||
--
|
||||
-- Ui (i=1,..,Nu+1), Vi (j=1,..,Nv+1) - values defining global
|
||||
-- parametrisation by U and V (correspond to points between patches and
|
||||
-- bounds, (Ui,Uj) corresponds to (uijmin,vijmin) on i,j-th patch) and to
|
||||
-- (u(i-1)(j-1)max,v(i-1)(j-1)max) on (i-1),(j-1)-th patch.
|
||||
--
|
||||
-- Geometrical connectivity is expressed via global parameters:
|
||||
-- S[i,j](Ui+1,V) = S[i+1,j](Ui+1,V) for any i, j, V
|
||||
-- S[i,j](U,Vj+1) = S[i,j+1](U,Vj+1) for any i, j, U
|
||||
-- It is checked with Precision::Confusion() by default.
|
||||
--
|
||||
-- NOTE 1: This class is inherited from Geom_Surface in order to
|
||||
-- make it more easy to store and deal with it. However, it should
|
||||
-- not be passed to standard methods dealing with geometry since
|
||||
-- this type is not known to them.
|
||||
-- NOTE 2: Not all the inherited methods are implemented, and some are
|
||||
-- implemented not in the full form.
|
||||
|
||||
uses
|
||||
Pnt2d from gp,
|
||||
Pnt from gp,
|
||||
Vec from gp,
|
||||
Trsf from gp,
|
||||
Trsf2d from gp,
|
||||
Surface from Geom,
|
||||
Curve from Geom,
|
||||
Array1OfReal from TColStd,
|
||||
HArray1OfReal from TColStd,
|
||||
HArray2OfSurface from TColGeom,
|
||||
Shape from GeomAbs,
|
||||
Parametrisation from ShapeExtend
|
||||
|
||||
is
|
||||
|
||||
Create returns CompositeSurface from ShapeExtend;
|
||||
---Purpose: Empty constructor.
|
||||
|
||||
Create (GridSurf: HArray2OfSurface from TColGeom;
|
||||
param : Parametrisation from ShapeExtend = ShapeExtend_Natural)
|
||||
returns CompositeSurface from ShapeExtend;
|
||||
---Purpose: Initializes by a grid of surfaces (calls Init()).
|
||||
|
||||
Create (GridSurf: HArray2OfSurface from TColGeom;
|
||||
UJoints, VJoints : Array1OfReal from TColStd)
|
||||
returns CompositeSurface from ShapeExtend;
|
||||
---Purpose: Initializes by a grid of surfaces (calls Init()).
|
||||
|
||||
Init (me: mutable; GridSurf: HArray2OfSurface from TColGeom;
|
||||
param : Parametrisation from ShapeExtend = ShapeExtend_Natural)
|
||||
returns Boolean;
|
||||
---Purpose: Initializes by a grid of surfaces.
|
||||
-- All the Surfaces of the grid must have geometrical
|
||||
-- connectivity as stated above.
|
||||
-- If geometrical connectivity is not satisfied, method
|
||||
-- returns False.
|
||||
-- However, class is initialized even in that case.
|
||||
--
|
||||
-- Last parameter defines how global parametrisation
|
||||
-- (joint values) will be computed:
|
||||
-- ShapeExtend_Natural: U1 = u11min, Ui+1 = Ui + (ui1max-ui1min), etc.
|
||||
-- ShapeExtend_Uniform: Ui = i-1, Vj = j-1
|
||||
-- ShapeExtend_Unitary: Ui = (i-1)/Nu, Vi = (j-1)/Nv
|
||||
|
||||
Init (me: mutable; GridSurf: HArray2OfSurface from TColGeom;
|
||||
UJoints, VJoints : Array1OfReal from TColStd)
|
||||
returns Boolean;
|
||||
---Purpose: Initializes by a grid of surfaces with given global
|
||||
-- parametrisation defined by UJoints and VJoints arrays,
|
||||
-- each having langth equal to number of patches in corresponding
|
||||
-- direction + 1. Global joint values should be sorted in
|
||||
-- increasing order.
|
||||
-- All the Surfaces of the grid must have geometrical
|
||||
-- connectivity as stated above.
|
||||
-- If geometrical connectivity is not satisfied, method
|
||||
-- returns False.
|
||||
-- However, class is initialized even in that case.
|
||||
|
||||
NbUPatches (me) returns Integer;
|
||||
---Purpose: Returns number of patches in U direction.
|
||||
|
||||
NbVPatches (me) returns Integer;
|
||||
---Purpose: Returns number of patches in V direction.
|
||||
|
||||
Patch (me; i, j: Integer) returns Surface from Geom;
|
||||
---C++: return const &
|
||||
---Purpose: Returns one surface patch
|
||||
|
||||
Patches (me) returns HArray2OfSurface from TColGeom;
|
||||
---C++: return const &
|
||||
---Purpose: Returns grid of surfaces
|
||||
|
||||
UJointValues (me) returns HArray1OfReal from TColStd;
|
||||
---Purpose: Returns the array of U values corresponding to joint
|
||||
-- points between patches as well as to start and end points,
|
||||
-- which define global parametrisation of the surface
|
||||
|
||||
VJointValues (me) returns HArray1OfReal from TColStd;
|
||||
---Purpose: Returns the array of V values corresponding to joint
|
||||
-- points between patches as well as to start and end points,
|
||||
-- which define global parametrisation of the surface
|
||||
|
||||
UJointValue (me; i: Integer) returns Real;
|
||||
---Purpose: Returns i-th joint value in U direction
|
||||
-- (1-st is global Umin, (NbUPatches()+1)-th is global Umax
|
||||
-- on the composite surface)
|
||||
|
||||
VJointValue (me; j: Integer) returns Real;
|
||||
---Purpose: Returns j-th joint value in V direction
|
||||
-- (1-st is global Vmin, (NbVPatches()+1)-th is global Vmax
|
||||
-- on the composite surface)
|
||||
|
||||
SetUJointValues (me: mutable; UJoints: Array1OfReal from TColStd)
|
||||
returns Boolean;
|
||||
---Purpose: Sets the array of U values corresponding to joint
|
||||
-- points, which define global parametrisation of the surface.
|
||||
-- Number of values in array should be equal to NbUPatches()+1.
|
||||
-- All the values should be sorted in increasing order.
|
||||
-- If this is not satisfied, does nothing and returns False.
|
||||
|
||||
SetVJointValues (me: mutable; VJoints: Array1OfReal from TColStd)
|
||||
returns Boolean;
|
||||
---Purpose: Sets the array of V values corresponding to joint
|
||||
-- points, which define global parametrisation of the surface
|
||||
-- Number of values in array should be equal to NbVPatches()+1.
|
||||
-- All the values should be sorted in increasing order.
|
||||
-- If this is not satisfied, does nothing and returns False.
|
||||
|
||||
SetUFirstValue (me: mutable; UFirst: Real);
|
||||
---Purpose: Changes starting value for global U parametrisation (all
|
||||
-- other joint values are shifted accordingly)
|
||||
|
||||
SetVFirstValue (me: mutable; VFirst: Real);
|
||||
---Purpose: Changes starting value for global V parametrisation (all
|
||||
-- other joint values are shifted accordingly)
|
||||
|
||||
LocateUParameter(me; U: Real) returns Integer;
|
||||
---Purpose: Returns number of col that contains given (global) parameter
|
||||
|
||||
LocateVParameter(me; V: Real) returns Integer;
|
||||
---Purpose: Returns number of row that contains given (global) parameter
|
||||
|
||||
LocateUVPoint(me; pnt: Pnt2d from gp;
|
||||
i : out Integer;
|
||||
j : out Integer);
|
||||
---Purpose: Returns number of row and col of surface that contains
|
||||
-- given point
|
||||
|
||||
Patch(me; U, V: Real) returns Surface from Geom;
|
||||
---C++: return const &
|
||||
---Purpose: Returns one surface patch that contains given (global) parameters
|
||||
|
||||
Patch(me; pnt: Pnt2d from gp) returns Surface from Geom;
|
||||
---C++: return const &
|
||||
---Purpose: Returns one surface patch that contains given point
|
||||
|
||||
|
||||
---Advanced: Work with local parameters on patches
|
||||
|
||||
ULocalToGlobal (me; i, j: Integer; u: Real) returns Real;
|
||||
---Purpose: Converts local parameter u on patch i,j to global parameter U
|
||||
|
||||
VLocalToGlobal (me; i, j: Integer; v: Real) returns Real;
|
||||
---Purpose: Converts local parameter v on patch i,j to global parameter V
|
||||
|
||||
LocalToGlobal (me; i, j: Integer; uv: Pnt2d from gp) returns Pnt2d from gp;
|
||||
---Purpose: Converts local parameters uv on patch i,j to global parameters UV
|
||||
|
||||
UGlobalToLocal (me; i, j: Integer; U: Real) returns Real;
|
||||
---Purpose: Converts global parameter U to local parameter u on patch i,j
|
||||
|
||||
VGlobalToLocal (me; i, j: Integer; V: Real) returns Real;
|
||||
---Purpose: Converts global parameter V to local parameter v on patch i,j
|
||||
|
||||
GlobalToLocal (me; i, j: Integer; UV: Pnt2d from gp) returns Pnt2d from gp;
|
||||
---Purpose: Converts global parameters UV to local parameters uv on patch i,j
|
||||
|
||||
GlobalToLocalTransformation (me; i, j : Integer;
|
||||
uFact: out Real; Trsf: out Trsf2d from gp )
|
||||
returns Boolean;
|
||||
---Purpose: Computes transformation operator and uFactor descrinbing affine
|
||||
-- transformation required to convert global parameters on composite
|
||||
-- surface to local parameters on patch (i,j):
|
||||
-- uv = ( uFactor, 1. ) X Trsf * UV;
|
||||
-- NOTE: Thus Trsf contains shift and scale by V, scale by U is stored in uFact.
|
||||
-- Returns True if transformation is not an identity
|
||||
|
||||
|
||||
---Inherited: methods of Geom_Geometry and Geom_Surface
|
||||
|
||||
Transform (me : mutable; T : Trsf) is redefined;
|
||||
---Purpose: Applies transformation to all the patches
|
||||
|
||||
Copy (me) returns like me is redefined;
|
||||
---Purpose: Returns a copy of the surface
|
||||
|
||||
UReverse (me : mutable) is redefined;
|
||||
---Purpose: NOT IMPLEMENTED (does nothing)
|
||||
|
||||
UReversedParameter (me; U : Real) returns Real is redefined;
|
||||
---Purpose: Returns U
|
||||
|
||||
VReverse (me : mutable) is redefined;
|
||||
---Purpose: NOT IMPLEMENTED (does nothing)
|
||||
|
||||
VReversedParameter (me; V : Real) returns Real is redefined;
|
||||
---Purpose: Returns V
|
||||
|
||||
Bounds(me; U1, U2, V1, V2 : out Real) is redefined;
|
||||
---Purpose: Returns the parametric bounds of grid
|
||||
|
||||
IsUClosed (me) returns Boolean is redefined;
|
||||
---Purpose: Returns True if grid is closed in U direction
|
||||
-- (i.e. connected with Precision::Confusion)
|
||||
|
||||
IsVClosed (me) returns Boolean is redefined;
|
||||
---Purpose: Returns True if grid is closed in V direction
|
||||
-- (i.e. connected with Precision::Confusion)
|
||||
|
||||
IsUPeriodic (me) returns Boolean is redefined;
|
||||
---Purpose: Returns False
|
||||
|
||||
IsVPeriodic (me) returns Boolean is redefined;
|
||||
---Purpose: Returns False
|
||||
|
||||
UIso (me; U : Real) returns Curve is redefined;
|
||||
---Purpose: NOT IMPLEMENTED (returns Null curve)
|
||||
|
||||
VIso (me; V : Real) returns Curve is redefined;
|
||||
---Purpose: NOT IMPLEMENTED (returns Null curve)
|
||||
|
||||
|
||||
Continuity (me) returns Shape from GeomAbs is redefined;
|
||||
---Purpose: returns C0
|
||||
|
||||
IsCNu (me; N : Integer) returns Boolean is redefined;
|
||||
---Purpose: returns True if N <=0
|
||||
|
||||
IsCNv (me; N : Integer) returns Boolean is redefined;
|
||||
---Purpose: returns True if N <=0
|
||||
|
||||
D0 (me; U, V : Real; P : out Pnt) is redefined;
|
||||
---Purpose: Computes the point of parameter U,V on the grid.
|
||||
|
||||
D1 (me; U, V : Real; P : out Pnt; D1U, D1V : out Vec) is redefined;
|
||||
---Purpose: Computes the point P and the first derivatives in the
|
||||
-- directions U and V at this point.
|
||||
|
||||
D2 (me; U, V : Real; P : out Pnt; D1U, D1V, D2U, D2V, D2UV : out Vec) is redefined;
|
||||
---Purpose: Computes the point P, the first and the second derivatives in
|
||||
-- the directions U and V at this point.
|
||||
|
||||
D3 (me; U, V : Real; P : out Pnt;
|
||||
D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV: out Vec) is redefined;
|
||||
---Purpose: Computes the point P, the first,the second and the third
|
||||
-- derivatives in the directions U and V at this point.
|
||||
|
||||
DN (me; U, V : Real; Nu, Nv : Integer) returns Vec is redefined;
|
||||
---Purpose: Computes the derivative of order Nu in the direction U and Nv
|
||||
-- in the direction V at the point P(U, V).
|
||||
|
||||
Value(me; pnt: Pnt2d from gp) returns Pnt from gp;
|
||||
---Purpose: Computes the point of parameter pnt on the grid.
|
||||
|
||||
|
||||
---Private: internal methods
|
||||
|
||||
ComputeJointValues (me: mutable; param : Parametrisation from ShapeExtend = ShapeExtend_Natural);
|
||||
---Purpose: Computes Joint values according to parameter
|
||||
|
||||
CheckConnectivity (me: mutable; prec: Real) returns Boolean;
|
||||
---Purpose: Checks geometrical connectivity of the patches, including
|
||||
-- closedness (sets fields muUClosed and myVClosed)
|
||||
|
||||
fields
|
||||
|
||||
myPatches : HArray2OfSurface from TColGeom;
|
||||
myUJointValues: HArray1OfReal from TColStd;
|
||||
myVJointValues: HArray1OfReal from TColStd;
|
||||
myUClosed : Boolean; -- closedness (periodicity) measured with Precision::Confusion()
|
||||
myVClosed : Boolean;
|
||||
|
||||
end;
|
||||
|
@@ -14,15 +14,23 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeExtend_CompositeSurface.ixx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Geometry.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <gp_Trsf2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ShapeExtend_CompositeSurface.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeExtend_CompositeSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeExtend_CompositeSurface::ShapeExtend_CompositeSurface()
|
||||
{
|
||||
}
|
||||
|
320
src/ShapeExtend/ShapeExtend_CompositeSurface.hxx
Normal file
320
src/ShapeExtend/ShapeExtend_CompositeSurface.hxx
Normal file
@@ -0,0 +1,320 @@
|
||||
// Created on: 1999-04-27
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 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 _ShapeExtend_CompositeSurface_HeaderFile
|
||||
#define _ShapeExtend_CompositeSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TColGeom_HArray2OfSurface.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <ShapeExtend_Parametrisation.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
class Geom_Surface;
|
||||
class gp_Pnt2d;
|
||||
class gp_Trsf2d;
|
||||
class gp_Trsf;
|
||||
class Geom_Geometry;
|
||||
class Geom_Curve;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
|
||||
|
||||
class ShapeExtend_CompositeSurface;
|
||||
DEFINE_STANDARD_HANDLE(ShapeExtend_CompositeSurface, Geom_Surface)
|
||||
|
||||
//! Composite surface is represented by a grid of surfaces
|
||||
//! (patches) connected geometrically. Patches may have different
|
||||
//! parametrisation ranges, but they should be parametrised in
|
||||
//! the same manner so that parameter of each patch (u,v) can be converted
|
||||
//! to global parameter on the whole surface (U,V) with help of linear
|
||||
//! transformation:
|
||||
//!
|
||||
//! for any i,j-th patch
|
||||
//! U = Ui + ( u - uijmin ) * ( Ui+1 - Ui ) / ( uijmax - uijmin )
|
||||
//! V = Vj + ( v - vijmin ) * ( Vj+1 - Vj ) / ( vijmax - vijmin )
|
||||
//!
|
||||
//! where
|
||||
//!
|
||||
//! [uijmin, uijmax] * [ vijmin, vijmax] - parametric range of i,j-th patch,
|
||||
//!
|
||||
//! Ui (i=1,..,Nu+1), Vi (j=1,..,Nv+1) - values defining global
|
||||
//! parametrisation by U and V (correspond to points between patches and
|
||||
//! bounds, (Ui,Uj) corresponds to (uijmin,vijmin) on i,j-th patch) and to
|
||||
//! (u(i-1)(j-1)max,v(i-1)(j-1)max) on (i-1),(j-1)-th patch.
|
||||
//!
|
||||
//! Geometrical connectivity is expressed via global parameters:
|
||||
//! S[i,j](Ui+1,V) = S[i+1,j](Ui+1,V) for any i, j, V
|
||||
//! S[i,j](U,Vj+1) = S[i,j+1](U,Vj+1) for any i, j, U
|
||||
//! It is checked with Precision::Confusion() by default.
|
||||
//!
|
||||
//! NOTE 1: This class is inherited from Geom_Surface in order to
|
||||
//! make it more easy to store and deal with it. However, it should
|
||||
//! not be passed to standard methods dealing with geometry since
|
||||
//! this type is not known to them.
|
||||
//! NOTE 2: Not all the inherited methods are implemented, and some are
|
||||
//! implemented not in the full form.
|
||||
class ShapeExtend_CompositeSurface : public Geom_Surface
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Empty constructor.
|
||||
Standard_EXPORT ShapeExtend_CompositeSurface();
|
||||
|
||||
//! Initializes by a grid of surfaces (calls Init()).
|
||||
Standard_EXPORT ShapeExtend_CompositeSurface(const Handle(TColGeom_HArray2OfSurface)& GridSurf, const ShapeExtend_Parametrisation param = ShapeExtend_Natural);
|
||||
|
||||
//! Initializes by a grid of surfaces (calls Init()).
|
||||
Standard_EXPORT ShapeExtend_CompositeSurface(const Handle(TColGeom_HArray2OfSurface)& GridSurf, const TColStd_Array1OfReal& UJoints, const TColStd_Array1OfReal& VJoints);
|
||||
|
||||
//! Initializes by a grid of surfaces.
|
||||
//! All the Surfaces of the grid must have geometrical
|
||||
//! connectivity as stated above.
|
||||
//! If geometrical connectivity is not satisfied, method
|
||||
//! returns False.
|
||||
//! However, class is initialized even in that case.
|
||||
//!
|
||||
//! Last parameter defines how global parametrisation
|
||||
//! (joint values) will be computed:
|
||||
//! ShapeExtend_Natural: U1 = u11min, Ui+1 = Ui + (ui1max-ui1min), etc.
|
||||
//! ShapeExtend_Uniform: Ui = i-1, Vj = j-1
|
||||
//! ShapeExtend_Unitary: Ui = (i-1)/Nu, Vi = (j-1)/Nv
|
||||
Standard_EXPORT Standard_Boolean Init (const Handle(TColGeom_HArray2OfSurface)& GridSurf, const ShapeExtend_Parametrisation param = ShapeExtend_Natural);
|
||||
|
||||
//! Initializes by a grid of surfaces with given global
|
||||
//! parametrisation defined by UJoints and VJoints arrays,
|
||||
//! each having langth equal to number of patches in corresponding
|
||||
//! direction + 1. Global joint values should be sorted in
|
||||
//! increasing order.
|
||||
//! All the Surfaces of the grid must have geometrical
|
||||
//! connectivity as stated above.
|
||||
//! If geometrical connectivity is not satisfied, method
|
||||
//! returns False.
|
||||
//! However, class is initialized even in that case.
|
||||
Standard_EXPORT Standard_Boolean Init (const Handle(TColGeom_HArray2OfSurface)& GridSurf, const TColStd_Array1OfReal& UJoints, const TColStd_Array1OfReal& VJoints);
|
||||
|
||||
//! Returns number of patches in U direction.
|
||||
Standard_EXPORT Standard_Integer NbUPatches() const;
|
||||
|
||||
//! Returns number of patches in V direction.
|
||||
Standard_EXPORT Standard_Integer NbVPatches() const;
|
||||
|
||||
//! Returns one surface patch
|
||||
Standard_EXPORT const Handle(Geom_Surface)& Patch (const Standard_Integer i, const Standard_Integer j) const;
|
||||
|
||||
//! Returns grid of surfaces
|
||||
Standard_EXPORT const Handle(TColGeom_HArray2OfSurface)& Patches() const;
|
||||
|
||||
//! Returns the array of U values corresponding to joint
|
||||
//! points between patches as well as to start and end points,
|
||||
//! which define global parametrisation of the surface
|
||||
Standard_EXPORT Handle(TColStd_HArray1OfReal) UJointValues() const;
|
||||
|
||||
//! Returns the array of V values corresponding to joint
|
||||
//! points between patches as well as to start and end points,
|
||||
//! which define global parametrisation of the surface
|
||||
Standard_EXPORT Handle(TColStd_HArray1OfReal) VJointValues() const;
|
||||
|
||||
//! Returns i-th joint value in U direction
|
||||
//! (1-st is global Umin, (NbUPatches()+1)-th is global Umax
|
||||
//! on the composite surface)
|
||||
Standard_EXPORT Standard_Real UJointValue (const Standard_Integer i) const;
|
||||
|
||||
//! Returns j-th joint value in V direction
|
||||
//! (1-st is global Vmin, (NbVPatches()+1)-th is global Vmax
|
||||
//! on the composite surface)
|
||||
Standard_EXPORT Standard_Real VJointValue (const Standard_Integer j) const;
|
||||
|
||||
//! Sets the array of U values corresponding to joint
|
||||
//! points, which define global parametrisation of the surface.
|
||||
//! Number of values in array should be equal to NbUPatches()+1.
|
||||
//! All the values should be sorted in increasing order.
|
||||
//! If this is not satisfied, does nothing and returns False.
|
||||
Standard_EXPORT Standard_Boolean SetUJointValues (const TColStd_Array1OfReal& UJoints);
|
||||
|
||||
//! Sets the array of V values corresponding to joint
|
||||
//! points, which define global parametrisation of the surface
|
||||
//! Number of values in array should be equal to NbVPatches()+1.
|
||||
//! All the values should be sorted in increasing order.
|
||||
//! If this is not satisfied, does nothing and returns False.
|
||||
Standard_EXPORT Standard_Boolean SetVJointValues (const TColStd_Array1OfReal& VJoints);
|
||||
|
||||
//! Changes starting value for global U parametrisation (all
|
||||
//! other joint values are shifted accordingly)
|
||||
Standard_EXPORT void SetUFirstValue (const Standard_Real UFirst);
|
||||
|
||||
//! Changes starting value for global V parametrisation (all
|
||||
//! other joint values are shifted accordingly)
|
||||
Standard_EXPORT void SetVFirstValue (const Standard_Real VFirst);
|
||||
|
||||
//! Returns number of col that contains given (global) parameter
|
||||
Standard_EXPORT Standard_Integer LocateUParameter (const Standard_Real U) const;
|
||||
|
||||
//! Returns number of row that contains given (global) parameter
|
||||
Standard_EXPORT Standard_Integer LocateVParameter (const Standard_Real V) const;
|
||||
|
||||
//! Returns number of row and col of surface that contains
|
||||
//! given point
|
||||
Standard_EXPORT void LocateUVPoint (const gp_Pnt2d& pnt, Standard_Integer& i, Standard_Integer& j) const;
|
||||
|
||||
//! Returns one surface patch that contains given (global) parameters
|
||||
Standard_EXPORT const Handle(Geom_Surface)& Patch (const Standard_Real U, const Standard_Real V) const;
|
||||
|
||||
//! Returns one surface patch that contains given point
|
||||
Standard_EXPORT const Handle(Geom_Surface)& Patch (const gp_Pnt2d& pnt) const;
|
||||
|
||||
//! Converts local parameter u on patch i,j to global parameter U
|
||||
Standard_EXPORT Standard_Real ULocalToGlobal (const Standard_Integer i, const Standard_Integer j, const Standard_Real u) const;
|
||||
|
||||
//! Converts local parameter v on patch i,j to global parameter V
|
||||
Standard_EXPORT Standard_Real VLocalToGlobal (const Standard_Integer i, const Standard_Integer j, const Standard_Real v) const;
|
||||
|
||||
//! Converts local parameters uv on patch i,j to global parameters UV
|
||||
Standard_EXPORT gp_Pnt2d LocalToGlobal (const Standard_Integer i, const Standard_Integer j, const gp_Pnt2d& uv) const;
|
||||
|
||||
//! Converts global parameter U to local parameter u on patch i,j
|
||||
Standard_EXPORT Standard_Real UGlobalToLocal (const Standard_Integer i, const Standard_Integer j, const Standard_Real U) const;
|
||||
|
||||
//! Converts global parameter V to local parameter v on patch i,j
|
||||
Standard_EXPORT Standard_Real VGlobalToLocal (const Standard_Integer i, const Standard_Integer j, const Standard_Real V) const;
|
||||
|
||||
//! Converts global parameters UV to local parameters uv on patch i,j
|
||||
Standard_EXPORT gp_Pnt2d GlobalToLocal (const Standard_Integer i, const Standard_Integer j, const gp_Pnt2d& UV) const;
|
||||
|
||||
//! Computes transformation operator and uFactor descrinbing affine
|
||||
//! transformation required to convert global parameters on composite
|
||||
//! surface to local parameters on patch (i,j):
|
||||
//! uv = ( uFactor, 1. ) X Trsf * UV;
|
||||
//! NOTE: Thus Trsf contains shift and scale by V, scale by U is stored in uFact.
|
||||
//! Returns True if transformation is not an identity
|
||||
Standard_EXPORT Standard_Boolean GlobalToLocalTransformation (const Standard_Integer i, const Standard_Integer j, Standard_Real& uFact, gp_Trsf2d& Trsf) const;
|
||||
|
||||
//! Applies transformation to all the patches
|
||||
Standard_EXPORT virtual void Transform (const gp_Trsf& T) Standard_OVERRIDE;
|
||||
|
||||
//! Returns a copy of the surface
|
||||
Standard_EXPORT virtual Handle(Geom_Geometry) Copy() const Standard_OVERRIDE;
|
||||
|
||||
//! NOT IMPLEMENTED (does nothing)
|
||||
Standard_EXPORT virtual void UReverse() Standard_OVERRIDE;
|
||||
|
||||
//! Returns U
|
||||
Standard_EXPORT virtual Standard_Real UReversedParameter (const Standard_Real U) const Standard_OVERRIDE;
|
||||
|
||||
//! NOT IMPLEMENTED (does nothing)
|
||||
Standard_EXPORT virtual void VReverse() Standard_OVERRIDE;
|
||||
|
||||
//! Returns V
|
||||
Standard_EXPORT virtual Standard_Real VReversedParameter (const Standard_Real V) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the parametric bounds of grid
|
||||
Standard_EXPORT virtual void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns True if grid is closed in U direction
|
||||
//! (i.e. connected with Precision::Confusion)
|
||||
Standard_EXPORT virtual Standard_Boolean IsUClosed() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns True if grid is closed in V direction
|
||||
//! (i.e. connected with Precision::Confusion)
|
||||
Standard_EXPORT virtual Standard_Boolean IsVClosed() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns False
|
||||
Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns False
|
||||
Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
|
||||
|
||||
//! NOT IMPLEMENTED (returns Null curve)
|
||||
Standard_EXPORT virtual Handle(Geom_Curve) UIso (const Standard_Real U) const Standard_OVERRIDE;
|
||||
|
||||
//! NOT IMPLEMENTED (returns Null curve)
|
||||
Standard_EXPORT virtual Handle(Geom_Curve) VIso (const Standard_Real V) const Standard_OVERRIDE;
|
||||
|
||||
//! returns C0
|
||||
Standard_EXPORT virtual GeomAbs_Shape Continuity() const Standard_OVERRIDE;
|
||||
|
||||
//! returns True if N <=0
|
||||
Standard_EXPORT virtual Standard_Boolean IsCNu (const Standard_Integer N) const Standard_OVERRIDE;
|
||||
|
||||
//! returns True if N <=0
|
||||
Standard_EXPORT virtual Standard_Boolean IsCNv (const Standard_Integer N) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point of parameter U,V on the grid.
|
||||
Standard_EXPORT virtual void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point P and the first derivatives in the
|
||||
//! directions U and V at this point.
|
||||
Standard_EXPORT virtual void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point P, the first and the second derivatives in
|
||||
//! the directions U and V at this point.
|
||||
Standard_EXPORT virtual void D2 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point P, the first,the second and the third
|
||||
//! derivatives in the directions U and V at this point.
|
||||
Standard_EXPORT virtual void D3 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the derivative of order Nu in the direction U and Nv
|
||||
//! in the direction V at the point P(U, V).
|
||||
Standard_EXPORT virtual gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point of parameter pnt on the grid.
|
||||
Standard_EXPORT gp_Pnt Value (const gp_Pnt2d& pnt) const;
|
||||
|
||||
//! Computes Joint values according to parameter
|
||||
Standard_EXPORT void ComputeJointValues (const ShapeExtend_Parametrisation param = ShapeExtend_Natural);
|
||||
|
||||
//! Checks geometrical connectivity of the patches, including
|
||||
//! closedness (sets fields muUClosed and myVClosed)
|
||||
Standard_EXPORT Standard_Boolean CheckConnectivity (const Standard_Real prec);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeExtend_CompositeSurface,Geom_Surface)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(TColGeom_HArray2OfSurface) myPatches;
|
||||
Handle(TColStd_HArray1OfReal) myUJointValues;
|
||||
Handle(TColStd_HArray1OfReal) myVJointValues;
|
||||
Standard_Boolean myUClosed;
|
||||
Standard_Boolean myVClosed;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeExtend_CompositeSurface_HeaderFile
|
@@ -1,95 +0,0 @@
|
||||
-- Created on: 1998-06-03
|
||||
-- Created by: data exchange team
|
||||
-- Copyright (c) 1998-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 Explorer from ShapeExtend
|
||||
|
||||
---Purpose: This class is intended to
|
||||
-- explore shapes and convert different representations
|
||||
-- (list, sequence, compound) of complex shapes. It provides tools for:
|
||||
-- - obtaining type of the shapes in context of TopoDS_Compound,
|
||||
-- - exploring shapes in context of TopoDS_Compound,
|
||||
-- - converting different representations of shapes (list, sequence, compound).
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
ShapeEnum from TopAbs,
|
||||
HSequenceOfShape from TopTools,
|
||||
ListOfShape from TopTools
|
||||
|
||||
raises
|
||||
TypeMismatch from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns Explorer from ShapeExtend;
|
||||
---Purpose: Creates an object Explorer
|
||||
|
||||
CompoundFromSeq (me; seqval: HSequenceOfShape)
|
||||
returns Shape from TopoDS;
|
||||
---Purpose: Converts a sequence of Shapes to a Compound
|
||||
|
||||
SeqFromCompound (me; comp: Shape from TopoDS; expcomp: Boolean)
|
||||
returns HSequenceOfShape;
|
||||
---Purpose: Converts a Compound to a list of Shapes
|
||||
-- if <comp> is not a compound, the list contains only <comp>
|
||||
-- if <comp> is Null, the list is empty
|
||||
-- if <comp> is a Compound, its sub-shapes are put into the list
|
||||
-- then if <expcomp> is True, if a sub-shape is a Compound, it
|
||||
-- is not put to the list but its sub-shapes are (recursive)
|
||||
|
||||
ListFromSeq (me; seqval: HSequenceOfShape;
|
||||
lisval: in out ListOfShape from TopTools;
|
||||
clear: Boolean = Standard_True);
|
||||
---Purpose: Converts a Sequence of Shapes to a List of Shapes
|
||||
-- <clear> if True (D), commands the list to start from scratch
|
||||
-- else, the list is cumulated
|
||||
|
||||
SeqFromList (me; lisval: ListOfShape)
|
||||
returns HSequenceOfShape from TopTools;
|
||||
---Purpose: Converts a List of Shapes to a Sequence of Shapes
|
||||
|
||||
|
||||
ShapeType (me; shape: Shape from TopoDS; compound: Boolean)
|
||||
returns ShapeEnum;
|
||||
---Purpose: Returns the type of a Shape: true type if <compound> is False
|
||||
-- If <compound> is True and <shape> is a Compound, iterates on
|
||||
-- its items. If all are of the same type, returns this type.
|
||||
-- Else, returns COMPOUND. If it is empty, returns SHAPE
|
||||
-- For a Null Shape, returns SHAPE
|
||||
|
||||
SortedCompound (me; shape: Shape from TopoDS; type: ShapeEnum;
|
||||
explore: Boolean; compound: Boolean)
|
||||
returns Shape from TopoDS;
|
||||
---Purpose: Builds a COMPOUND from the given shape.
|
||||
-- It explores the shape level by level, according to the
|
||||
-- <explore> argument. If <explore> is False, only COMPOUND
|
||||
-- items are explored, else all items are.
|
||||
-- The following shapes are added to resulting compound:
|
||||
-- - shapes which comply to <type>
|
||||
-- - if <type> is WIRE, considers also free edges (and makes wires)
|
||||
-- - if <type> is SHELL, considers also free faces (and makes shells)
|
||||
-- If <compound> is True, gathers items in compounds which
|
||||
-- correspond to starting COMPOUND,SOLID or SHELL containers, or
|
||||
-- items directly contained in a Compound
|
||||
|
||||
DispatchList (me; list: HSequenceOfShape;
|
||||
vertices, edges, wires, faces, shells, solids, compsols, compounds:
|
||||
in out HSequenceOfShape);
|
||||
---Purpose: Dispatches starting list of shapes according to their type,
|
||||
-- to the appropriate resulting lists
|
||||
-- For each of these lists, if it is null, it is firstly created
|
||||
-- else, new items are appended to the already existing ones
|
||||
|
||||
end Explorer;
|
@@ -12,20 +12,22 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//szv#4 S4163
|
||||
#include <ShapeExtend_Explorer.ixx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <ShapeExtend_Explorer.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeExtend_Explorer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeExtend_Explorer::ShapeExtend_Explorer()
|
||||
{
|
||||
}
|
||||
|
116
src/ShapeExtend/ShapeExtend_Explorer.hxx
Normal file
116
src/ShapeExtend/ShapeExtend_Explorer.hxx
Normal file
@@ -0,0 +1,116 @@
|
||||
// Created on: 1998-06-03
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 1998-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 _ShapeExtend_Explorer_HeaderFile
|
||||
#define _ShapeExtend_Explorer_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopTools_HSequenceOfShape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
class Standard_TypeMismatch;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! This class is intended to
|
||||
//! explore shapes and convert different representations
|
||||
//! (list, sequence, compound) of complex shapes. It provides tools for:
|
||||
//! - obtaining type of the shapes in context of TopoDS_Compound,
|
||||
//! - exploring shapes in context of TopoDS_Compound,
|
||||
//! - converting different representations of shapes (list, sequence, compound).
|
||||
class ShapeExtend_Explorer
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an object Explorer
|
||||
Standard_EXPORT ShapeExtend_Explorer();
|
||||
|
||||
//! Converts a sequence of Shapes to a Compound
|
||||
Standard_EXPORT TopoDS_Shape CompoundFromSeq (const Handle(TopTools_HSequenceOfShape)& seqval) const;
|
||||
|
||||
//! Converts a Compound to a list of Shapes
|
||||
//! if <comp> is not a compound, the list contains only <comp>
|
||||
//! if <comp> is Null, the list is empty
|
||||
//! if <comp> is a Compound, its sub-shapes are put into the list
|
||||
//! then if <expcomp> is True, if a sub-shape is a Compound, it
|
||||
//! is not put to the list but its sub-shapes are (recursive)
|
||||
Standard_EXPORT Handle(TopTools_HSequenceOfShape) SeqFromCompound (const TopoDS_Shape& comp, const Standard_Boolean expcomp) const;
|
||||
|
||||
//! Converts a Sequence of Shapes to a List of Shapes
|
||||
//! <clear> if True (D), commands the list to start from scratch
|
||||
//! else, the list is cumulated
|
||||
Standard_EXPORT void ListFromSeq (const Handle(TopTools_HSequenceOfShape)& seqval, TopTools_ListOfShape& lisval, const Standard_Boolean clear = Standard_True) const;
|
||||
|
||||
//! Converts a List of Shapes to a Sequence of Shapes
|
||||
Standard_EXPORT Handle(TopTools_HSequenceOfShape) SeqFromList (const TopTools_ListOfShape& lisval) const;
|
||||
|
||||
//! Returns the type of a Shape: true type if <compound> is False
|
||||
//! If <compound> is True and <shape> is a Compound, iterates on
|
||||
//! its items. If all are of the same type, returns this type.
|
||||
//! Else, returns COMPOUND. If it is empty, returns SHAPE
|
||||
//! For a Null Shape, returns SHAPE
|
||||
Standard_EXPORT TopAbs_ShapeEnum ShapeType (const TopoDS_Shape& shape, const Standard_Boolean compound) const;
|
||||
|
||||
//! Builds a COMPOUND from the given shape.
|
||||
//! It explores the shape level by level, according to the
|
||||
//! <explore> argument. If <explore> is False, only COMPOUND
|
||||
//! items are explored, else all items are.
|
||||
//! The following shapes are added to resulting compound:
|
||||
//! - shapes which comply to <type>
|
||||
//! - if <type> is WIRE, considers also free edges (and makes wires)
|
||||
//! - if <type> is SHELL, considers also free faces (and makes shells)
|
||||
//! If <compound> is True, gathers items in compounds which
|
||||
//! correspond to starting COMPOUND,SOLID or SHELL containers, or
|
||||
//! items directly contained in a Compound
|
||||
Standard_EXPORT TopoDS_Shape SortedCompound (const TopoDS_Shape& shape, const TopAbs_ShapeEnum type, const Standard_Boolean explore, const Standard_Boolean compound) const;
|
||||
|
||||
//! Dispatches starting list of shapes according to their type,
|
||||
//! to the appropriate resulting lists
|
||||
//! For each of these lists, if it is null, it is firstly created
|
||||
//! else, new items are appended to the already existing ones
|
||||
Standard_EXPORT void DispatchList (const Handle(TopTools_HSequenceOfShape)& list, Handle(TopTools_HSequenceOfShape)& vertices, Handle(TopTools_HSequenceOfShape)& edges, Handle(TopTools_HSequenceOfShape)& wires, Handle(TopTools_HSequenceOfShape)& faces, Handle(TopTools_HSequenceOfShape)& shells, Handle(TopTools_HSequenceOfShape)& solids, Handle(TopTools_HSequenceOfShape)& compsols, Handle(TopTools_HSequenceOfShape)& compounds) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeExtend_Explorer_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 2000-01-28
|
||||
-- Created by: data exchange team
|
||||
-- Copyright (c) 2000-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 MsgRegistrator from ShapeExtend inherits BasicMsgRegistrator from ShapeExtend
|
||||
|
||||
---Purpose: Attaches messages to the objects (generic Transient or shape).
|
||||
-- The objects of this class are transmitted to the Shape Healing
|
||||
-- algorithms so that they could collect messages occurred during
|
||||
-- processing.
|
||||
--
|
||||
-- Messages are added to the Maps (stored as a field) that can be
|
||||
-- used, for instance, by Data Exchange processors to attach those
|
||||
-- messages to initial file entities.
|
||||
|
||||
uses
|
||||
|
||||
Shape from TopoDS,
|
||||
Gravity from Message,
|
||||
Msg from Message,
|
||||
ListOfMsg from Message,
|
||||
DataMapOfTransientListOfMsg from ShapeExtend,
|
||||
DataMapOfShapeListOfMsg from ShapeExtend
|
||||
|
||||
is
|
||||
|
||||
Create returns MsgRegistrator from ShapeExtend;
|
||||
---Purpose: Creates an object.
|
||||
|
||||
|
||||
Send (me: mutable; object : Transient;
|
||||
message: Msg from Message;
|
||||
gravity: Gravity from Message) is redefined;
|
||||
---Purpose: Sends a message to be attached to the object.
|
||||
-- If the object is in the map then the message is added to the
|
||||
-- list, otherwise the object is firstly added to the map.
|
||||
|
||||
Send (me: mutable; shape : Shape from TopoDS;
|
||||
message: Msg from Message;
|
||||
gravity: Gravity from Message) is redefined;
|
||||
---Purpose: Sends a message to be attached to the shape.
|
||||
-- If the shape is in the map then the message is added to the
|
||||
-- list, otherwise the shape is firstly added to the map.
|
||||
|
||||
MapTransient (me) returns DataMapOfTransientListOfMsg from ShapeExtend;
|
||||
---C++ : inline
|
||||
---C++ : return const&
|
||||
---Purpose: Returns a Map of objects and message list
|
||||
|
||||
MapShape (me) returns DataMapOfShapeListOfMsg from ShapeExtend;
|
||||
---C++ : inline
|
||||
---C++ : return const&
|
||||
---Purpose: Returns a Map of shapes and message list
|
||||
|
||||
fields
|
||||
|
||||
myMapTransient: DataMapOfTransientListOfMsg from ShapeExtend;
|
||||
myMapShape: DataMapOfShapeListOfMsg from ShapeExtend;
|
||||
|
||||
end MsgRegistrator;
|
@@ -13,14 +13,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeExtend_MsgRegistrator.ixx>
|
||||
|
||||
#include <Message_ListOfMsg.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <ShapeExtend_MsgRegistrator.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeExtend_MsgRegistrator
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeExtend_MsgRegistrator::ShapeExtend_MsgRegistrator() : ShapeExtend_BasicMsgRegistrator()
|
||||
{
|
||||
}
|
||||
|
93
src/ShapeExtend/ShapeExtend_MsgRegistrator.hxx
Normal file
93
src/ShapeExtend/ShapeExtend_MsgRegistrator.hxx
Normal file
@@ -0,0 +1,93 @@
|
||||
// Created on: 2000-01-28
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 2000-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 _ShapeExtend_MsgRegistrator_HeaderFile
|
||||
#define _ShapeExtend_MsgRegistrator_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <ShapeExtend_DataMapOfTransientListOfMsg.hxx>
|
||||
#include <ShapeExtend_DataMapOfShapeListOfMsg.hxx>
|
||||
#include <ShapeExtend_BasicMsgRegistrator.hxx>
|
||||
#include <Message_Gravity.hxx>
|
||||
class Standard_Transient;
|
||||
class Message_Msg;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
class ShapeExtend_MsgRegistrator;
|
||||
DEFINE_STANDARD_HANDLE(ShapeExtend_MsgRegistrator, ShapeExtend_BasicMsgRegistrator)
|
||||
|
||||
//! Attaches messages to the objects (generic Transient or shape).
|
||||
//! The objects of this class are transmitted to the Shape Healing
|
||||
//! algorithms so that they could collect messages occurred during
|
||||
//! processing.
|
||||
//!
|
||||
//! Messages are added to the Maps (stored as a field) that can be
|
||||
//! used, for instance, by Data Exchange processors to attach those
|
||||
//! messages to initial file entities.
|
||||
class ShapeExtend_MsgRegistrator : public ShapeExtend_BasicMsgRegistrator
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an object.
|
||||
Standard_EXPORT ShapeExtend_MsgRegistrator();
|
||||
|
||||
//! Sends a message to be attached to the object.
|
||||
//! If the object is in the map then the message is added to the
|
||||
//! list, otherwise the object is firstly added to the map.
|
||||
Standard_EXPORT virtual void Send (const Handle(Standard_Transient)& object, const Message_Msg& message, const Message_Gravity gravity) Standard_OVERRIDE;
|
||||
|
||||
//! Sends a message to be attached to the shape.
|
||||
//! If the shape is in the map then the message is added to the
|
||||
//! list, otherwise the shape is firstly added to the map.
|
||||
Standard_EXPORT virtual void Send (const TopoDS_Shape& shape, const Message_Msg& message, const Message_Gravity gravity) Standard_OVERRIDE;
|
||||
|
||||
//! Returns a Map of objects and message list
|
||||
const ShapeExtend_DataMapOfTransientListOfMsg& MapTransient() const;
|
||||
|
||||
//! Returns a Map of shapes and message list
|
||||
const ShapeExtend_DataMapOfShapeListOfMsg& MapShape() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeExtend_MsgRegistrator,ShapeExtend_BasicMsgRegistrator)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
ShapeExtend_DataMapOfTransientListOfMsg myMapTransient;
|
||||
ShapeExtend_DataMapOfShapeListOfMsg myMapShape;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <ShapeExtend_MsgRegistrator.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeExtend_MsgRegistrator_HeaderFile
|
31
src/ShapeExtend/ShapeExtend_Parametrisation.hxx
Normal file
31
src/ShapeExtend/ShapeExtend_Parametrisation.hxx
Normal file
@@ -0,0 +1,31 @@
|
||||
// Created on: 1998-07-21
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 1998-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 _ShapeExtend_Parametrisation_HeaderFile
|
||||
#define _ShapeExtend_Parametrisation_HeaderFile
|
||||
|
||||
//! Defines kind of global parametrisation on the composite surface
|
||||
//! each patch of the 1st row and column adds its range, Ui+1 = Ui + URange(i,1), etc.
|
||||
//! each patch gives range 1.: Ui = i-1, Vj = j-1
|
||||
//! uniform parametrisation with global range [0,1]
|
||||
enum ShapeExtend_Parametrisation
|
||||
{
|
||||
ShapeExtend_Natural,
|
||||
ShapeExtend_Uniform,
|
||||
ShapeExtend_Unitary
|
||||
};
|
||||
|
||||
#endif // _ShapeExtend_Parametrisation_HeaderFile
|
82
src/ShapeExtend/ShapeExtend_Status.hxx
Normal file
82
src/ShapeExtend/ShapeExtend_Status.hxx
Normal file
@@ -0,0 +1,82 @@
|
||||
// Created on: 1998-07-21
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 1998-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 _ShapeExtend_Status_HeaderFile
|
||||
#define _ShapeExtend_Status_HeaderFile
|
||||
|
||||
//! This enumeration is used in
|
||||
//! ShapeHealing toolkit for representing flags in the
|
||||
//! return statuses of class methods.
|
||||
//! The status is a field of the class which is set by one or
|
||||
//! several methods of that class.
|
||||
//! It is used for reporting about errors and other situations
|
||||
//! encountered during execution of the method.
|
||||
//! There are defined 8 values for DONE and 8 for FAIL flags:
|
||||
//! ShapeExtend_DONE1 ... ShapeExtend_DONE8,
|
||||
//! ShapeExtend_FAIL1 ... ShapeExtend_FAIL8
|
||||
//! and also enumerations for representing combinations of flags:
|
||||
//! ShapeExtend_OK - no flags at all,
|
||||
//! ShapeExtend_DONE - any of flags DONEi,
|
||||
//! ShapeExtend_FAIL - any of flags FAILi.
|
||||
//! The class that uses statuses provides a method(s) which
|
||||
//! answers whether the flag corresponding to a given
|
||||
//! enumerative value is (are) set:
|
||||
//! Standard_Boolean Status(const ShapeExtend_Status test);
|
||||
//! Note that status can have several flags set simultaneously.
|
||||
//! Status(ShapeExtend_OK) gives True when no flags are set.
|
||||
//! Nothing done, everything OK
|
||||
//! Something was done, case 1
|
||||
//! Something was done, case 2
|
||||
//! Something was done, case 3
|
||||
//! Something was done, case 4
|
||||
//! Something was done, case 5
|
||||
//! Something was done, case 6
|
||||
//! Something was done, case 7
|
||||
//! Something was done, case 8
|
||||
//! Something was done (any of DONE#)
|
||||
//! The method failed, case 1
|
||||
//! The method failed, case 2
|
||||
//! The method failed, case 3
|
||||
//! The method failed, case 4
|
||||
//! The method failed, case 5
|
||||
//! The method failed, case 6
|
||||
//! The method failed, case 7
|
||||
//! The method failed, case 8
|
||||
//! The mathod failed (any of FAIL# occured)
|
||||
enum ShapeExtend_Status
|
||||
{
|
||||
ShapeExtend_OK,
|
||||
ShapeExtend_DONE1,
|
||||
ShapeExtend_DONE2,
|
||||
ShapeExtend_DONE3,
|
||||
ShapeExtend_DONE4,
|
||||
ShapeExtend_DONE5,
|
||||
ShapeExtend_DONE6,
|
||||
ShapeExtend_DONE7,
|
||||
ShapeExtend_DONE8,
|
||||
ShapeExtend_DONE,
|
||||
ShapeExtend_FAIL1,
|
||||
ShapeExtend_FAIL2,
|
||||
ShapeExtend_FAIL3,
|
||||
ShapeExtend_FAIL4,
|
||||
ShapeExtend_FAIL5,
|
||||
ShapeExtend_FAIL6,
|
||||
ShapeExtend_FAIL7,
|
||||
ShapeExtend_FAIL8,
|
||||
ShapeExtend_FAIL
|
||||
};
|
||||
|
||||
#endif // _ShapeExtend_Status_HeaderFile
|
@@ -1,227 +0,0 @@
|
||||
-- Created on: 1998-06-03
|
||||
-- Created by: data exchange team
|
||||
-- Copyright (c) 1998-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 WireData from ShapeExtend inherits TShared from MMgt
|
||||
|
||||
---Purpose: This class provides a data structure necessary for work with the wire as with
|
||||
-- ordered list of edges, what is required for many algorithms. The advantage of
|
||||
-- this class is that it allows to work with wires which are not correct.
|
||||
-- The object of the class ShapeExtend_WireData can be initialized by
|
||||
-- TopoDS_Wire, and converted back to TopoDS_Wire.
|
||||
-- An edge in the wire is defined by its rank number. Operations of accessing,
|
||||
-- adding and removing edge at the given rank number are provided. On the whole
|
||||
-- wire, operations of circular permutation and reversing (both orientations of
|
||||
-- all edges and order of edges) are provided as well.
|
||||
-- This class also provides a method to check if the edge in the wire is a seam
|
||||
-- (if the wire lies on a face).
|
||||
-- This class is handled by reference. Such an approach gives the following advantages:
|
||||
-- 1. Sharing the object of this class strongly optimizes the processes of
|
||||
-- analysis and fixing performed in parallel on the wire stored in the form
|
||||
-- of this class. Fixing tool (e.g. ShapeFix_Wire) fixes problems one by
|
||||
-- one using analyzing tool (e.g. ShapeAnalysis_Wire). Sharing allows not
|
||||
-- to reinitialize each time the analyzing tool with modified
|
||||
-- ShapeExtend_WireData what consumes certain time.
|
||||
-- 2. No copying of contents. The object of ShapeExtend_WireData class has
|
||||
-- quite big size, returning it as a result of the function would cause
|
||||
-- additional copying of contents if this class were one handled by value.
|
||||
-- Moreover, this class is stored as a field in other classes which are
|
||||
-- they returned as results of functions, storing only a handle to
|
||||
-- ShapeExtend_WireData saves time and memory.
|
||||
|
||||
uses
|
||||
HSequenceOfInteger from TColStd,
|
||||
Shape from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Wire from TopoDS,
|
||||
Face from TopoDS,
|
||||
HSequenceOfShape from TopTools
|
||||
|
||||
is
|
||||
|
||||
Create returns WireData from ShapeExtend;
|
||||
---Purpose: Empty constructor, creates empty wire with no edges
|
||||
|
||||
Create (wire: Wire from TopoDS; chained: Boolean = Standard_True ;
|
||||
theManifoldMode :Boolean = Standard_True)
|
||||
returns WireData from ShapeExtend;
|
||||
---Purpose: Constructor initializing the data from TopoDS_Wire. Calls Init(wire,chained).
|
||||
|
||||
Init (me: mutable; other: WireData from ShapeExtend);
|
||||
---Purpose: Copies data from another WireData
|
||||
|
||||
Init (me: mutable; wire: Wire from TopoDS; chained: Boolean = Standard_True;
|
||||
theManifoldMode :Boolean = Standard_True)
|
||||
returns Boolean;
|
||||
---Purpose: Loads an already existing wire
|
||||
-- If <chained> is True (default), edges are added in the
|
||||
-- sequence as they are explored by TopoDS_Iterator
|
||||
-- Else, if <chained> is False, wire is explored by
|
||||
-- BRepTools_WireExplorer and it is guaranteed that edges will
|
||||
-- be sequencially connected.
|
||||
-- Remark : In the latter case it can happen that not all edges
|
||||
-- will be found (because of limitations of
|
||||
-- BRepTools_WireExplorer for disconnected wires and wires
|
||||
-- with seam edges).
|
||||
|
||||
Clear (me: mutable);
|
||||
---Purpose: Clears data about Wire.
|
||||
|
||||
ComputeSeams (me: mutable; enforce: Boolean = Standard_True);
|
||||
---Purpose: Computes the list of seam edges
|
||||
-- By default (direct call), computing is enforced
|
||||
-- For indirect call (from IsSeam) it is redone only if not yet
|
||||
-- already done or if the list of edges has changed
|
||||
-- Remark : A Seam Edge is an Edge present twice in the list, once as
|
||||
-- FORWARD and once as REVERSED
|
||||
-- Each sense has its own PCurve, the one for FORWARD
|
||||
-- must be set in first
|
||||
|
||||
SetLast (me: mutable; num: Integer);
|
||||
---Purpose: Does a circular permutation in order to set <num>th edge last
|
||||
|
||||
SetDegeneratedLast (me: mutable);
|
||||
---Purpose: When the wire contains at least one degenerated edge, sets it
|
||||
-- as last one
|
||||
-- Note : It is useful to process pcurves, for instance, while the pcurve
|
||||
-- of a DGNR may not be computed from its 3D part (there is none)
|
||||
-- it is computed after the other edges have been computed and
|
||||
-- chained.
|
||||
|
||||
Add (me: mutable; edge: Edge from TopoDS; atnum: Integer = 0);
|
||||
---Purpose: Adds an edge to a wire, being defined (not yet ended)
|
||||
-- This is the plain, basic, function to add an edge
|
||||
-- <num> = 0 (D): Appends at end
|
||||
-- <num> = 1: Preprends at start
|
||||
-- else, Insert before <num>
|
||||
-- Remark : Null Edge is simply ignored
|
||||
|
||||
Add (me: mutable; wire: Wire from TopoDS; atnum: Integer = 0);
|
||||
---Purpose: Adds an entire wire, considered as a list of edges
|
||||
-- Remark : The wire is assumed to be ordered (TopoDS_Iterator
|
||||
-- is used)
|
||||
|
||||
Add (me: mutable; wire: WireData from ShapeExtend; atnum: Integer = 0);
|
||||
---Purpose: Adds a wire in the form of WireData
|
||||
|
||||
Add (me: mutable; shape: Shape from TopoDS; atnum: Integer = 0);
|
||||
---Purpose: Adds an edge or a wire invoking corresponding method Add
|
||||
|
||||
|
||||
AddOriented (me: mutable; edge: Edge from TopoDS; mode: Integer);
|
||||
---Purpose: Adds an edge to start or end of <me>, according to <mode>
|
||||
-- 0: at end, as direct
|
||||
-- 1: at end, as reversed
|
||||
-- 2: at start, as direct
|
||||
-- 3: at start, as reversed
|
||||
-- < 0: no adding
|
||||
|
||||
AddOriented (me: mutable; wire: Wire from TopoDS; mode: Integer);
|
||||
---Purpose: Adds a wire to start or end of <me>, according to <mode>
|
||||
-- 0: at end, as direct
|
||||
-- 1: at end, as reversed
|
||||
-- 2: at start, as direct
|
||||
-- 3: at start, as reversed
|
||||
-- < 0: no adding
|
||||
|
||||
AddOriented (me: mutable; shape: Shape from TopoDS; mode: Integer);
|
||||
---Purpose: Adds an edge or a wire invoking corresponding method
|
||||
-- AddOriented
|
||||
|
||||
Remove (me: mutable; num: Integer = 0);
|
||||
---Purpose: Removes an Edge, given its rank. By default removes the last edge.
|
||||
|
||||
Set (me: mutable; edge: Edge from TopoDS; num: Integer = 0);
|
||||
---Purpose: Replaces an edge at the given
|
||||
-- rank number <num> with new one. Default is last edge (<num> = 0).
|
||||
|
||||
|
||||
Reverse (me: mutable);
|
||||
---Purpose: Reverses the sense of the list and the orientation of each Edge
|
||||
-- This method should be called when either wire has no seam edges
|
||||
-- or face is not available
|
||||
|
||||
Reverse (me: mutable; face: Face from TopoDS);
|
||||
---Purpose: Reverses the sense of the list and the orientation of each Edge
|
||||
-- The face is necessary for swapping pcurves for seam edges
|
||||
-- (first pcurve corresponds to orientation FORWARD, and second to
|
||||
-- REVERSED; when edge is reversed, pcurves must be swapped)
|
||||
-- If face is NULL, no swapping is performed
|
||||
|
||||
---Basic Querying:
|
||||
|
||||
NbEdges (me) returns Integer;
|
||||
---Purpose: Returns the count of currently recorded edges
|
||||
|
||||
NbNonManifoldEdges (me) returns Integer;
|
||||
---Purpose: Returns the count of currently recorded non-manifold edges
|
||||
|
||||
NonmanifoldEdge (me; num: Integer) returns Edge from TopoDS;
|
||||
---Purpose: Returns <num>th nonmanifold Edge
|
||||
|
||||
NonmanifoldEdges(me) returns HSequenceOfShape from TopTools;
|
||||
---Purpose: Returns sequence of non-manifold edges
|
||||
-- This sequence can be not empty if wire data set in manifold mode but
|
||||
-- initial wire has INTERNAL orientation or contains INTERNAL edges
|
||||
--
|
||||
|
||||
ManifoldMode(me: mutable) returns Boolean;
|
||||
---Purpose: Returns mode defining manifold wire data or not.
|
||||
-- If manifold that nonmanifold edges will not be not
|
||||
-- consider during operations(previous behaviour)
|
||||
-- and they will be added only in result wire
|
||||
-- else non-manifold edges will consider during operations
|
||||
---C++: return &
|
||||
---Default: True
|
||||
|
||||
Edge (me; num: Integer) returns Edge from TopoDS;
|
||||
---Purpose: Returns <num>th Edge
|
||||
|
||||
Index (me: mutable; edge: Edge from TopoDS) returns Integer;
|
||||
---Purpose: Returns the index of the edge
|
||||
-- If the edge is a seam the orientation is also checked
|
||||
-- Returns 0 if the edge is not found in the list
|
||||
|
||||
IsSeam (me: mutable; num: Integer) returns Boolean;
|
||||
---Purpose: Tells if an Edge is seam (see ComputeSeams)
|
||||
-- An edge is considered as seam if it presents twice in
|
||||
-- the edge list, once as FORWARD and once as REVERSED.
|
||||
|
||||
Wire (me) returns Wire from TopoDS;
|
||||
---Purpose: Makes TopoDS_Wire using
|
||||
-- BRep_Builder (just creates the TopoDS_Wire object and adds
|
||||
-- all edges into it). This method should be called when
|
||||
-- the wire is correct (for example, after successful
|
||||
-- fixes by ShapeFix_Wire) and adjacent edges share common
|
||||
-- vertices. In case if adjacent edges do not share the same
|
||||
-- vertices the resulting TopoDS_Wire will be invalid.
|
||||
|
||||
WireAPIMake (me) returns Wire from TopoDS;
|
||||
---Purpose: Makes TopoDS_Wire using
|
||||
-- BRepAPI_MakeWire. Class BRepAPI_MakeWire merges
|
||||
-- geometrically coincided vertices and can disturb
|
||||
-- correct order of edges in the wire. If this class fails,
|
||||
-- null shape is returned.
|
||||
|
||||
fields
|
||||
|
||||
myEdges: HSequenceOfShape from TopTools;
|
||||
myNonmanifoldEdges : HSequenceOfShape from TopTools;
|
||||
mySeams: HSequenceOfInteger from TColStd;
|
||||
mySeamF: Integer;
|
||||
mySeamR: Integer;
|
||||
myManifoldMode : Boolean;
|
||||
|
||||
end WireData;
|
@@ -15,23 +15,27 @@
|
||||
// abv 28.04.99 S4137: added method Add(WireData), method SetLast fixed
|
||||
// abv 05.05.99 S4174: protection against INTERNAL/EXTERNAL edges
|
||||
|
||||
#include <ShapeExtend_WireData.ixx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <ShapeExtend_WireData.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeExtend_WireData
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeExtend_WireData::ShapeExtend_WireData()
|
||||
{
|
||||
Clear();
|
||||
|
249
src/ShapeExtend/ShapeExtend_WireData.hxx
Normal file
249
src/ShapeExtend/ShapeExtend_WireData.hxx
Normal file
@@ -0,0 +1,249 @@
|
||||
// Created on: 1998-06-03
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 1998-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 _ShapeExtend_WireData_HeaderFile
|
||||
#define _ShapeExtend_WireData_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TopTools_HSequenceOfShape.hxx>
|
||||
#include <TColStd_HSequenceOfInteger.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
class TopoDS_Wire;
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Face;
|
||||
|
||||
|
||||
class ShapeExtend_WireData;
|
||||
DEFINE_STANDARD_HANDLE(ShapeExtend_WireData, MMgt_TShared)
|
||||
|
||||
//! This class provides a data structure necessary for work with the wire as with
|
||||
//! ordered list of edges, what is required for many algorithms. The advantage of
|
||||
//! this class is that it allows to work with wires which are not correct.
|
||||
//! The object of the class ShapeExtend_WireData can be initialized by
|
||||
//! TopoDS_Wire, and converted back to TopoDS_Wire.
|
||||
//! An edge in the wire is defined by its rank number. Operations of accessing,
|
||||
//! adding and removing edge at the given rank number are provided. On the whole
|
||||
//! wire, operations of circular permutation and reversing (both orientations of
|
||||
//! all edges and order of edges) are provided as well.
|
||||
//! This class also provides a method to check if the edge in the wire is a seam
|
||||
//! (if the wire lies on a face).
|
||||
//! This class is handled by reference. Such an approach gives the following advantages:
|
||||
//! 1. Sharing the object of this class strongly optimizes the processes of
|
||||
//! analysis and fixing performed in parallel on the wire stored in the form
|
||||
//! of this class. Fixing tool (e.g. ShapeFix_Wire) fixes problems one by
|
||||
//! one using analyzing tool (e.g. ShapeAnalysis_Wire). Sharing allows not
|
||||
//! to reinitialize each time the analyzing tool with modified
|
||||
//! ShapeExtend_WireData what consumes certain time.
|
||||
//! 2. No copying of contents. The object of ShapeExtend_WireData class has
|
||||
//! quite big size, returning it as a result of the function would cause
|
||||
//! additional copying of contents if this class were one handled by value.
|
||||
//! Moreover, this class is stored as a field in other classes which are
|
||||
//! they returned as results of functions, storing only a handle to
|
||||
//! ShapeExtend_WireData saves time and memory.
|
||||
class ShapeExtend_WireData : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Empty constructor, creates empty wire with no edges
|
||||
Standard_EXPORT ShapeExtend_WireData();
|
||||
|
||||
//! Constructor initializing the data from TopoDS_Wire. Calls Init(wire,chained).
|
||||
Standard_EXPORT ShapeExtend_WireData(const TopoDS_Wire& wire, const Standard_Boolean chained = Standard_True, const Standard_Boolean theManifoldMode = Standard_True);
|
||||
|
||||
//! Copies data from another WireData
|
||||
Standard_EXPORT void Init (const Handle(ShapeExtend_WireData)& other);
|
||||
|
||||
//! Loads an already existing wire
|
||||
//! If <chained> is True (default), edges are added in the
|
||||
//! sequence as they are explored by TopoDS_Iterator
|
||||
//! Else, if <chained> is False, wire is explored by
|
||||
//! BRepTools_WireExplorer and it is guaranteed that edges will
|
||||
//! be sequencially connected.
|
||||
//! Remark : In the latter case it can happen that not all edges
|
||||
//! will be found (because of limitations of
|
||||
//! BRepTools_WireExplorer for disconnected wires and wires
|
||||
//! with seam edges).
|
||||
Standard_EXPORT Standard_Boolean Init (const TopoDS_Wire& wire, const Standard_Boolean chained = Standard_True, const Standard_Boolean theManifoldMode = Standard_True);
|
||||
|
||||
//! Clears data about Wire.
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Computes the list of seam edges
|
||||
//! By default (direct call), computing is enforced
|
||||
//! For indirect call (from IsSeam) it is redone only if not yet
|
||||
//! already done or if the list of edges has changed
|
||||
//! Remark : A Seam Edge is an Edge present twice in the list, once as
|
||||
//! FORWARD and once as REVERSED
|
||||
//! Each sense has its own PCurve, the one for FORWARD
|
||||
//! must be set in first
|
||||
Standard_EXPORT void ComputeSeams (const Standard_Boolean enforce = Standard_True);
|
||||
|
||||
//! Does a circular permutation in order to set <num>th edge last
|
||||
Standard_EXPORT void SetLast (const Standard_Integer num);
|
||||
|
||||
//! When the wire contains at least one degenerated edge, sets it
|
||||
//! as last one
|
||||
//! Note : It is useful to process pcurves, for instance, while the pcurve
|
||||
//! of a DGNR may not be computed from its 3D part (there is none)
|
||||
//! it is computed after the other edges have been computed and
|
||||
//! chained.
|
||||
Standard_EXPORT void SetDegeneratedLast();
|
||||
|
||||
//! Adds an edge to a wire, being defined (not yet ended)
|
||||
//! This is the plain, basic, function to add an edge
|
||||
//! <num> = 0 (D): Appends at end
|
||||
//! <num> = 1: Preprends at start
|
||||
//! else, Insert before <num>
|
||||
//! Remark : Null Edge is simply ignored
|
||||
Standard_EXPORT void Add (const TopoDS_Edge& edge, const Standard_Integer atnum = 0);
|
||||
|
||||
//! Adds an entire wire, considered as a list of edges
|
||||
//! Remark : The wire is assumed to be ordered (TopoDS_Iterator
|
||||
//! is used)
|
||||
Standard_EXPORT void Add (const TopoDS_Wire& wire, const Standard_Integer atnum = 0);
|
||||
|
||||
//! Adds a wire in the form of WireData
|
||||
Standard_EXPORT void Add (const Handle(ShapeExtend_WireData)& wire, const Standard_Integer atnum = 0);
|
||||
|
||||
//! Adds an edge or a wire invoking corresponding method Add
|
||||
Standard_EXPORT void Add (const TopoDS_Shape& shape, const Standard_Integer atnum = 0);
|
||||
|
||||
//! Adds an edge to start or end of <me>, according to <mode>
|
||||
//! 0: at end, as direct
|
||||
//! 1: at end, as reversed
|
||||
//! 2: at start, as direct
|
||||
//! 3: at start, as reversed
|
||||
//! < 0: no adding
|
||||
Standard_EXPORT void AddOriented (const TopoDS_Edge& edge, const Standard_Integer mode);
|
||||
|
||||
//! Adds a wire to start or end of <me>, according to <mode>
|
||||
//! 0: at end, as direct
|
||||
//! 1: at end, as reversed
|
||||
//! 2: at start, as direct
|
||||
//! 3: at start, as reversed
|
||||
//! < 0: no adding
|
||||
Standard_EXPORT void AddOriented (const TopoDS_Wire& wire, const Standard_Integer mode);
|
||||
|
||||
//! Adds an edge or a wire invoking corresponding method
|
||||
//! AddOriented
|
||||
Standard_EXPORT void AddOriented (const TopoDS_Shape& shape, const Standard_Integer mode);
|
||||
|
||||
//! Removes an Edge, given its rank. By default removes the last edge.
|
||||
Standard_EXPORT void Remove (const Standard_Integer num = 0);
|
||||
|
||||
//! Replaces an edge at the given
|
||||
//! rank number <num> with new one. Default is last edge (<num> = 0).
|
||||
Standard_EXPORT void Set (const TopoDS_Edge& edge, const Standard_Integer num = 0);
|
||||
|
||||
//! Reverses the sense of the list and the orientation of each Edge
|
||||
//! This method should be called when either wire has no seam edges
|
||||
//! or face is not available
|
||||
Standard_EXPORT void Reverse();
|
||||
|
||||
//! Reverses the sense of the list and the orientation of each Edge
|
||||
//! The face is necessary for swapping pcurves for seam edges
|
||||
//! (first pcurve corresponds to orientation FORWARD, and second to
|
||||
//! REVERSED; when edge is reversed, pcurves must be swapped)
|
||||
//! If face is NULL, no swapping is performed
|
||||
Standard_EXPORT void Reverse (const TopoDS_Face& face);
|
||||
|
||||
//! Returns the count of currently recorded edges
|
||||
Standard_EXPORT Standard_Integer NbEdges() const;
|
||||
|
||||
//! Returns the count of currently recorded non-manifold edges
|
||||
Standard_EXPORT Standard_Integer NbNonManifoldEdges() const;
|
||||
|
||||
//! Returns <num>th nonmanifold Edge
|
||||
Standard_EXPORT TopoDS_Edge NonmanifoldEdge (const Standard_Integer num) const;
|
||||
|
||||
//! Returns sequence of non-manifold edges
|
||||
//! This sequence can be not empty if wire data set in manifold mode but
|
||||
//! initial wire has INTERNAL orientation or contains INTERNAL edges
|
||||
Standard_EXPORT Handle(TopTools_HSequenceOfShape) NonmanifoldEdges() const;
|
||||
|
||||
//! Returns mode defining manifold wire data or not.
|
||||
//! If manifold that nonmanifold edges will not be not
|
||||
//! consider during operations(previous behaviour)
|
||||
//! and they will be added only in result wire
|
||||
//! else non-manifold edges will consider during operations
|
||||
Standard_EXPORT Standard_Boolean& ManifoldMode();
|
||||
|
||||
//! Returns <num>th Edge
|
||||
Standard_EXPORT TopoDS_Edge Edge (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the index of the edge
|
||||
//! If the edge is a seam the orientation is also checked
|
||||
//! Returns 0 if the edge is not found in the list
|
||||
Standard_EXPORT Standard_Integer Index (const TopoDS_Edge& edge);
|
||||
|
||||
//! Tells if an Edge is seam (see ComputeSeams)
|
||||
//! An edge is considered as seam if it presents twice in
|
||||
//! the edge list, once as FORWARD and once as REVERSED.
|
||||
Standard_EXPORT Standard_Boolean IsSeam (const Standard_Integer num);
|
||||
|
||||
//! Makes TopoDS_Wire using
|
||||
//! BRep_Builder (just creates the TopoDS_Wire object and adds
|
||||
//! all edges into it). This method should be called when
|
||||
//! the wire is correct (for example, after successful
|
||||
//! fixes by ShapeFix_Wire) and adjacent edges share common
|
||||
//! vertices. In case if adjacent edges do not share the same
|
||||
//! vertices the resulting TopoDS_Wire will be invalid.
|
||||
Standard_EXPORT TopoDS_Wire Wire() const;
|
||||
|
||||
//! Makes TopoDS_Wire using
|
||||
//! BRepAPI_MakeWire. Class BRepAPI_MakeWire merges
|
||||
//! geometrically coincided vertices and can disturb
|
||||
//! correct order of edges in the wire. If this class fails,
|
||||
//! null shape is returned.
|
||||
Standard_EXPORT TopoDS_Wire WireAPIMake() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeExtend_WireData,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(TopTools_HSequenceOfShape) myEdges;
|
||||
Handle(TopTools_HSequenceOfShape) myNonmanifoldEdges;
|
||||
Handle(TColStd_HSequenceOfInteger) mySeams;
|
||||
Standard_Integer mySeamF;
|
||||
Standard_Integer mySeamR;
|
||||
Standard_Boolean myManifoldMode;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeExtend_WireData_HeaderFile
|
Reference in New Issue
Block a user