mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +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:
27
src/ShapeCustom/FILES
Normal file
27
src/ShapeCustom/FILES
Normal file
@@ -0,0 +1,27 @@
|
||||
ShapeCustom.cxx
|
||||
ShapeCustom.hxx
|
||||
ShapeCustom_BSplineRestriction.cxx
|
||||
ShapeCustom_BSplineRestriction.hxx
|
||||
ShapeCustom_BSplineRestriction.lxx
|
||||
ShapeCustom_ConvertToBSpline.cxx
|
||||
ShapeCustom_ConvertToBSpline.hxx
|
||||
ShapeCustom_ConvertToRevolution.cxx
|
||||
ShapeCustom_ConvertToRevolution.hxx
|
||||
ShapeCustom_Curve.cxx
|
||||
ShapeCustom_Curve.hxx
|
||||
ShapeCustom_Curve2d.cxx
|
||||
ShapeCustom_Curve2d.hxx
|
||||
ShapeCustom_DirectModification.cxx
|
||||
ShapeCustom_DirectModification.hxx
|
||||
ShapeCustom_Modification.cxx
|
||||
ShapeCustom_Modification.hxx
|
||||
ShapeCustom_RestrictionParameters.cxx
|
||||
ShapeCustom_RestrictionParameters.hxx
|
||||
ShapeCustom_RestrictionParameters.lxx
|
||||
ShapeCustom_Surface.cxx
|
||||
ShapeCustom_Surface.hxx
|
||||
ShapeCustom_Surface.lxx
|
||||
ShapeCustom_SweptToElementary.cxx
|
||||
ShapeCustom_SweptToElementary.hxx
|
||||
ShapeCustom_TrsfModification.cxx
|
||||
ShapeCustom_TrsfModification.hxx
|
@@ -1,125 +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.
|
||||
|
||||
package ShapeCustom
|
||||
|
||||
---Purpose: This package is intended to
|
||||
-- convert geometrical objects and topological. The
|
||||
-- modifications of one geometrical object to another
|
||||
-- (one) geometrical object are provided. The supported
|
||||
-- modifications are the following:
|
||||
-- conversion of BSpline and Bezier surfaces to analytical form,
|
||||
-- conversion of indirect elementary surfaces (with left-handed
|
||||
-- coordinate systems) into direct ones,
|
||||
-- conversion of elementary surfaces to surfaces of revolution,
|
||||
-- conversion of surface of linear extrusion, revolution, offset
|
||||
-- surface to bspline,
|
||||
-- modification of parameterization, degree, number of segments of bspline
|
||||
-- surfaces, scale the shape.
|
||||
|
||||
uses
|
||||
|
||||
gp,
|
||||
GeomAbs,
|
||||
Geom,
|
||||
Geom2d,
|
||||
TopLoc,
|
||||
TopoDS,
|
||||
BRepTools,
|
||||
TopTools,
|
||||
TColgp,
|
||||
Precision,
|
||||
Message,
|
||||
ShapeBuild,
|
||||
ShapeExtend
|
||||
|
||||
is
|
||||
|
||||
class Surface;
|
||||
|
||||
class Curve;
|
||||
|
||||
class Curve2d;
|
||||
|
||||
class RestrictionParameters;
|
||||
|
||||
deferred class Modification; -- base class of modifications
|
||||
class DirectModification;
|
||||
|
||||
private class TrsfModification;
|
||||
private class BSplineRestriction;
|
||||
private class ConvertToRevolution;
|
||||
private class SweptToElementary;
|
||||
private class ConvertToBSpline;
|
||||
|
||||
ApplyModifier(S : Shape from TopoDS;
|
||||
M : Modification from BRepTools;
|
||||
context: in out DataMapOfShapeShape from TopTools;
|
||||
MD : in out Modifier from BRepTools;
|
||||
aProgress : ProgressIndicator from Message = NULL;
|
||||
aReShape : ReShape from ShapeBuild = NULL )
|
||||
|
||||
returns Shape from TopoDS;
|
||||
---Purpose: Applies modifier to shape and checks sharing in the case assemblies.
|
||||
|
||||
DirectFaces(S: Shape from TopoDS) returns Shape from TopoDS;
|
||||
---Purpose: Returns a new shape without indirect surfaces.
|
||||
|
||||
ScaleShape (S: Shape from TopoDS; scale: Real) returns Shape from TopoDS;
|
||||
---Purpose: Returns a new shape which is scaled original
|
||||
|
||||
BSplineRestriction(S : Shape from TopoDS;
|
||||
Tol3d, Tol2d : Real;
|
||||
MaxDegree, MaxNbSegment : Integer;
|
||||
Continuity3d, Continuity2d: Shape from GeomAbs;
|
||||
Degree : Boolean;
|
||||
Rational : Boolean;
|
||||
aParameters : RestrictionParameters from ShapeCustom)
|
||||
returns Shape from TopoDS;
|
||||
---Purpose: Returns a new shape with all surfaces, curves and pcurves
|
||||
-- which type is BSpline/Bezier or based on them converted
|
||||
-- having Degree less than <MaxDegree> or number of spans less
|
||||
-- than <NbMaxSegment> in dependence on parameter priority <Degree>.
|
||||
-- <GmaxDegree> and <GMaxSegments> are maximum possible degree
|
||||
-- and number of spans correspondingly.
|
||||
-- These values will be used in those cases when approximation with
|
||||
-- specified parameters is impossible and one of GmaxDegree or
|
||||
-- GMaxSegments is selected in dependence on priority.
|
||||
-- Note that even if approximation is impossible with <GMaxDegree>
|
||||
-- then number of spans can exceed specified <GMaxSegment>
|
||||
-- <Rational> specifies if to convert Rational BSpline/Bezier into
|
||||
-- polynomial B-Spline.
|
||||
-- If flags ConvOffSurf,ConvOffCurve3d,ConvOffCurve2d are Standard_True there are means
|
||||
-- that Offset surfaces , Offset curves 3d and Offset curves 2d are converted to BSPline
|
||||
-- correspondingly.
|
||||
|
||||
ConvertToRevolution (S: Shape from TopoDS) returns Shape from TopoDS;
|
||||
---Purpose: Returns a new shape with all elementary periodic surfaces converted
|
||||
-- to Geom_SurfaceOfRevolution
|
||||
|
||||
SweptToElementary (S: Shape from TopoDS) returns Shape from TopoDS;
|
||||
---Purpose: Returns a new shape with all surfaces of revolution and linear extrusion
|
||||
-- convert to elementary periodic surfaces
|
||||
|
||||
ConvertToBSpline (S : Shape from TopoDS;
|
||||
extrMode : Boolean; revolMode: Boolean;
|
||||
offsetMode: Boolean; planeMode: Boolean = Standard_False)
|
||||
returns Shape from TopoDS;
|
||||
---Purpose: Returns a new shape with all surfaces of linear extrusion, revolution,
|
||||
-- offset, and planar surfaces converted according to flags to
|
||||
-- Geom_BSplineSurface (with same parameterisation).
|
||||
|
||||
end ShapeCustom;
|
142
src/ShapeCustom/ShapeCustom.hxx
Normal file
142
src/ShapeCustom/ShapeCustom.hxx
Normal file
@@ -0,0 +1,142 @@
|
||||
// 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 _ShapeCustom_HeaderFile
|
||||
#define _ShapeCustom_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class TopoDS_Shape;
|
||||
class BRepTools_Modification;
|
||||
class BRepTools_Modifier;
|
||||
class Message_ProgressIndicator;
|
||||
class ShapeBuild_ReShape;
|
||||
class ShapeCustom_RestrictionParameters;
|
||||
class ShapeCustom_Surface;
|
||||
class ShapeCustom_Curve;
|
||||
class ShapeCustom_Curve2d;
|
||||
class ShapeCustom_RestrictionParameters;
|
||||
class ShapeCustom_Modification;
|
||||
class ShapeCustom_DirectModification;
|
||||
class ShapeCustom_TrsfModification;
|
||||
class ShapeCustom_BSplineRestriction;
|
||||
class ShapeCustom_ConvertToRevolution;
|
||||
class ShapeCustom_SweptToElementary;
|
||||
class ShapeCustom_ConvertToBSpline;
|
||||
|
||||
|
||||
//! This package is intended to
|
||||
//! convert geometrical objects and topological. The
|
||||
//! modifications of one geometrical object to another
|
||||
//! (one) geometrical object are provided. The supported
|
||||
//! modifications are the following:
|
||||
//! conversion of BSpline and Bezier surfaces to analytical form,
|
||||
//! conversion of indirect elementary surfaces (with left-handed
|
||||
//! coordinate systems) into direct ones,
|
||||
//! conversion of elementary surfaces to surfaces of revolution,
|
||||
//! conversion of surface of linear extrusion, revolution, offset
|
||||
//! surface to bspline,
|
||||
//! modification of parameterization, degree, number of segments of bspline
|
||||
//! surfaces, scale the shape.
|
||||
class ShapeCustom
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Applies modifier to shape and checks sharing in the case assemblies.
|
||||
Standard_EXPORT static TopoDS_Shape ApplyModifier (const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M, TopTools_DataMapOfShapeShape& context, BRepTools_Modifier& MD, const Handle(Message_ProgressIndicator)& aProgress = NULL, const Handle(ShapeBuild_ReShape)& aReShape = NULL);
|
||||
|
||||
//! Returns a new shape without indirect surfaces.
|
||||
Standard_EXPORT static TopoDS_Shape DirectFaces (const TopoDS_Shape& S);
|
||||
|
||||
//! Returns a new shape which is scaled original
|
||||
Standard_EXPORT static TopoDS_Shape ScaleShape (const TopoDS_Shape& S, const Standard_Real scale);
|
||||
|
||||
//! Returns a new shape with all surfaces, curves and pcurves
|
||||
//! which type is BSpline/Bezier or based on them converted
|
||||
//! having Degree less than <MaxDegree> or number of spans less
|
||||
//! than <NbMaxSegment> in dependence on parameter priority <Degree>.
|
||||
//! <GmaxDegree> and <GMaxSegments> are maximum possible degree
|
||||
//! and number of spans correspondingly.
|
||||
//! These values will be used in those cases when approximation with
|
||||
//! specified parameters is impossible and one of GmaxDegree or
|
||||
//! GMaxSegments is selected in dependence on priority.
|
||||
//! Note that even if approximation is impossible with <GMaxDegree>
|
||||
//! then number of spans can exceed specified <GMaxSegment>
|
||||
//! <Rational> specifies if to convert Rational BSpline/Bezier into
|
||||
//! polynomial B-Spline.
|
||||
//! If flags ConvOffSurf,ConvOffCurve3d,ConvOffCurve2d are Standard_True there are means
|
||||
//! that Offset surfaces , Offset curves 3d and Offset curves 2d are converted to BSPline
|
||||
//! correspondingly.
|
||||
Standard_EXPORT static TopoDS_Shape BSplineRestriction (const TopoDS_Shape& S, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer MaxDegree, const Standard_Integer MaxNbSegment, const GeomAbs_Shape Continuity3d, const GeomAbs_Shape Continuity2d, const Standard_Boolean Degree, const Standard_Boolean Rational, const Handle(ShapeCustom_RestrictionParameters)& aParameters);
|
||||
|
||||
//! Returns a new shape with all elementary periodic surfaces converted
|
||||
//! to Geom_SurfaceOfRevolution
|
||||
Standard_EXPORT static TopoDS_Shape ConvertToRevolution (const TopoDS_Shape& S);
|
||||
|
||||
//! Returns a new shape with all surfaces of revolution and linear extrusion
|
||||
//! convert to elementary periodic surfaces
|
||||
Standard_EXPORT static TopoDS_Shape SweptToElementary (const TopoDS_Shape& S);
|
||||
|
||||
//! Returns a new shape with all surfaces of linear extrusion, revolution,
|
||||
//! offset, and planar surfaces converted according to flags to
|
||||
//! Geom_BSplineSurface (with same parameterisation).
|
||||
Standard_EXPORT static TopoDS_Shape ConvertToBSpline (const TopoDS_Shape& S, const Standard_Boolean extrMode, const Standard_Boolean revolMode, const Standard_Boolean offsetMode, const Standard_Boolean planeMode = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class ShapeCustom_Surface;
|
||||
friend class ShapeCustom_Curve;
|
||||
friend class ShapeCustom_Curve2d;
|
||||
friend class ShapeCustom_RestrictionParameters;
|
||||
friend class ShapeCustom_Modification;
|
||||
friend class ShapeCustom_DirectModification;
|
||||
friend class ShapeCustom_TrsfModification;
|
||||
friend class ShapeCustom_BSplineRestriction;
|
||||
friend class ShapeCustom_ConvertToRevolution;
|
||||
friend class ShapeCustom_SweptToElementary;
|
||||
friend class ShapeCustom_ConvertToBSpline;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_HeaderFile
|
@@ -1,280 +0,0 @@
|
||||
-- Created on: 1999-06-18
|
||||
-- Created by: Galina Koulikova
|
||||
-- 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.
|
||||
|
||||
private class BSplineRestriction from ShapeCustom inherits Modification from ShapeCustom
|
||||
|
||||
---Purpose: this tool intended for aproximation surfaces, curves and pcurves with
|
||||
-- specified degree , max number of segments, tolerance 2d, tolerance 3d. Specified
|
||||
-- continuity can be reduced if approximation with specified continuity was not done.
|
||||
|
||||
uses
|
||||
Surface from Geom,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
Shape from TopoDS,
|
||||
Face from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
Location from TopLoc,
|
||||
Shape from GeomAbs,
|
||||
Pnt from gp,
|
||||
RestrictionParameters from ShapeCustom
|
||||
|
||||
is
|
||||
Create returns BSplineRestriction from ShapeCustom;
|
||||
---Purpose: Empty constructor.
|
||||
|
||||
|
||||
Create(anApproxSurfaceFlag,
|
||||
anApproxCurve3dFlag,
|
||||
anApproxCurve2dFlag : Boolean;
|
||||
aTol3d, aTol2d : Real;
|
||||
aContinuity3d, aContinuity2d: Shape from GeomAbs ;
|
||||
aMaxDegree, aNbMaxSeg : Integer;
|
||||
Degree, Rational : Boolean)
|
||||
returns BSplineRestriction from ShapeCustom;
|
||||
---Purpose: Initializes with specified parameters of aproximation.
|
||||
|
||||
Create(anApproxSurfaceFlag, anApproxCurve3dFlag, anApproxCurve2dFlag: Boolean from Standard;
|
||||
aTol3d, aTol2d : Real;
|
||||
aContinuity3d, aContinuity2d : Shape from GeomAbs ;
|
||||
aMaxDegree, aNbMaxSeg : Integer;
|
||||
Degree, Rational : Boolean;
|
||||
aModes : RestrictionParameters from ShapeCustom)
|
||||
returns BSplineRestriction from ShapeCustom;
|
||||
---Purpose: Initializes with specified parameters of aproximation.
|
||||
|
||||
NewSurface(me: mutable; F : Face from TopoDS;
|
||||
S : out Surface from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol : out Real from Standard;
|
||||
RevWires : out Boolean from Standard;
|
||||
RevFace : out Boolean from Standard)
|
||||
|
||||
---Purpose: Returns Standard_True if the face <F> has been
|
||||
-- modified. In this case, <S> is the new geometric
|
||||
-- support of the face, <L> the new location,<Tol>
|
||||
-- the new tolerance.<RevWires> has to be set to
|
||||
-- Standard_True when the modification reverses the
|
||||
-- normal of the surface.(the wires have to be
|
||||
-- reversed). <RevFace> has to be set to
|
||||
-- Standard_True if the orientation of the modified
|
||||
-- face changes in the shells which contain it.
|
||||
--
|
||||
-- Otherwise, returns Standard_False, and <S>, <L>,
|
||||
-- <Tol> , <RevWires> ,<RevFace> are not significant.
|
||||
|
||||
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
NewCurve(me: mutable; E : Edge from TopoDS;
|
||||
C : out Curve from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard)
|
||||
|
||||
returns Boolean from Standard;
|
||||
|
||||
---Purpose: Returns Standard_True if curve from the edge <E> has been
|
||||
-- modified. In this case, <C> is the new geometric
|
||||
-- support of the edge, <L> the new location, <Tol>
|
||||
-- the new tolerance.
|
||||
-- Otherwise, returns Standard_True if Surface is modified or
|
||||
-- one of pcurves of edge is modified. In this case C is copy of
|
||||
-- geometric support of the edge.
|
||||
-- In other cases returns Standard_False, and <C>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewCurve2d(me: mutable; E : Edge from TopoDS;
|
||||
F : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF : Face from TopoDS;
|
||||
C : out Curve from Geom2d;
|
||||
Tol : out Real from Standard)
|
||||
|
||||
returns Boolean from Standard;
|
||||
|
||||
---Purpose: Returns Standard_True if the edge <E> has been modified.
|
||||
-- In this case,if curve on the surface is modified, <C>
|
||||
-- is the new geometric support of the edge, <L> the
|
||||
-- new location, <Tol> the new tolerance. If curve on the surface
|
||||
-- is not modified C is copy curve on surface from the edge <E>.
|
||||
--
|
||||
-- Otherwise, returns Standard_False, and <C>, <L>,
|
||||
-- <Tol> are not significant.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF>
|
||||
-- is the new face created from <F>. They may be usefull.
|
||||
|
||||
|
||||
ConvertSurface(me: mutable; aSurface : Surface from Geom; S : out Surface from Geom;
|
||||
UF,UL,VF,VL : Real from Standard;
|
||||
IsOf : Boolean from Standard = Standard_True)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the surface has been modified.
|
||||
-- if flag IsOf equals Standard_True Offset surfaces are aproximated to Offset
|
||||
-- if Standard_False to BSpline
|
||||
|
||||
ConvertCurve(me: mutable;aCurve : in out Curve from Geom; C : out Curve from Geom; IsConvert : Boolean;
|
||||
First, Last : Real; TolCur : in out Real;IsOf : Boolean from Standard = Standard_True)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the curve has been modified.
|
||||
-- if flag IsOf equals Standard_True Offset curves are aproximated to Offset
|
||||
-- if Standard_False to BSpline
|
||||
|
||||
ConvertCurve2d(me: mutable;aCurve : in out Curve from Geom2d; C : out Curve from Geom2d; IsConvert : Boolean;
|
||||
First, Last : Real; TolCur : in out Real;IsOf : Boolean from Standard = Standard_True)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the pcurve has been modified.
|
||||
-- if flag IsOf equals Standard_True Offset pcurves are aproximated to Offset
|
||||
-- if Standard_False to BSpline
|
||||
|
||||
-- Methods for setting and obtaining fields
|
||||
|
||||
SetTol3d(me: mutable; Tol3d : Real from Standard);
|
||||
---C++: inline
|
||||
---Purpose: Sets tolerance of aproximation for curve3d and surface
|
||||
|
||||
SetTol2d(me: mutable; Tol2d : Real from Standard);
|
||||
---C++: inline
|
||||
---Purpose: Sets tolerance of aproximation for curve2d
|
||||
|
||||
ModifyApproxSurfaceFlag(me : mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Returns (modifiable) the flag which defines whether the
|
||||
-- surface is aproximated.
|
||||
|
||||
ModifyApproxCurve3dFlag(me : mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Returns (modifiable) the flag which defines whether the
|
||||
-- curve3d is aproximated.
|
||||
|
||||
ModifyApproxCurve2dFlag(me : mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Returns (modifiable) the flag which defines whether the curve2d is aproximated.
|
||||
|
||||
SetContinuity3d(me : mutable; Continuity3d : Shape from GeomAbs);
|
||||
---C++: inline
|
||||
---Purpose: Sets continuity3d for aproximation curve3d and surface.
|
||||
|
||||
SetContinuity2d(me : mutable; Continuity2d : Shape from GeomAbs);
|
||||
---C++: inline
|
||||
---Purpose: Sets continuity3d for aproximation curve2d.
|
||||
|
||||
SetMaxDegree(me : mutable; MaxDegree : Integer from Standard);
|
||||
---C++: inline
|
||||
---Purpose: Sets max degree for aproximation.
|
||||
|
||||
SetMaxNbSegments(me : mutable; MaxNbSegments : Integer from Standard);
|
||||
---C++: inline
|
||||
---Purpose: Sets max number of segments for aproximation.
|
||||
|
||||
SetPriority(me : mutable; Degree : Boolean from Standard);
|
||||
---C++: inline
|
||||
---Purpose: Sets priority for aproximation curves and surface.
|
||||
-- If Degree is True approximation is made with degree less
|
||||
-- then specified MaxDegree at the expense of number of spanes.
|
||||
-- If Degree is False approximation is made with number of
|
||||
-- spans less then specified MaxNbSegment at the expense of
|
||||
-- specified MaxDegree.
|
||||
|
||||
SetConvRational(me : mutable; Rational : Boolean from Standard);
|
||||
---C++: inline
|
||||
---Purpose: Sets flag for define if rational BSpline or Bezier is
|
||||
-- converted to polynomial. If Rational is True approximation
|
||||
-- for rational BSpline and Bezier is made to polynomial even
|
||||
-- if degree is less then MaxDegree and number of spans is less
|
||||
-- then specified MaxNbSegment.
|
||||
|
||||
GetRestrictionParameters(me)
|
||||
returns RestrictionParameters from ShapeCustom;
|
||||
---C++: inline
|
||||
---Purpose: Returns the container of modes which defines
|
||||
-- what geometry should be converted to BSplines.
|
||||
|
||||
SetRestrictionParameters(me: mutable;
|
||||
aModes: RestrictionParameters from ShapeCustom);
|
||||
---C++: inline
|
||||
---Purpose: Sets the container of modes which defines
|
||||
-- what geometry should be converted to BSplines.
|
||||
|
||||
Curve3dError(me) returns Real;
|
||||
---C++: inline
|
||||
---Purpose:Returns error for aproximation curve3d.
|
||||
|
||||
Curve2dError(me) returns Real;
|
||||
---C++: inline
|
||||
---Purpose:Returns error for aproximation curve2d.
|
||||
|
||||
SurfaceError(me) returns Real;
|
||||
---C++: inline
|
||||
---Purpose:Returns error for aproximation surface.
|
||||
|
||||
NewPoint(me: mutable; V : Vertex from TopoDS;
|
||||
P : out Pnt from gp;
|
||||
Tol: out Real from Standard)
|
||||
|
||||
returns Boolean from Standard;
|
||||
|
||||
NewParameter(me: mutable; V : Vertex from TopoDS;
|
||||
E : Edge from TopoDS;
|
||||
P : out Real from Standard;
|
||||
Tol: out Real from Standard)
|
||||
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
|
||||
|
||||
Continuity(me: mutable; E : Edge from TopoDS;
|
||||
F1,F2 : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF1,NewF2: Face from TopoDS)
|
||||
|
||||
returns Shape from GeomAbs;
|
||||
|
||||
MaxErrors (me; aCurve3dErr, aCurve2dErr : out Real) returns Real from Standard;
|
||||
---Purpose:Returns error for aproximation surface, curve3d and curve2d.
|
||||
|
||||
NbOfSpan (me) returns Integer from Standard;
|
||||
---Purpose:Returns number for aproximation surface, curve3d and curve2d.
|
||||
|
||||
|
||||
fields
|
||||
myContinuity3d,
|
||||
myContinuity2d : Shape from GeomAbs;
|
||||
myMaxDegree,
|
||||
myNbMaxSeg : Integer from Standard;
|
||||
myTol3d,
|
||||
myTol2d,
|
||||
mySurfaceError,
|
||||
myCurve3dError,
|
||||
myCurve2dError : Real from Standard;
|
||||
myNbOfSpan : Integer from Standard;
|
||||
myApproxSurfaceFlag,
|
||||
myApproxCurve3dFlag,
|
||||
myApproxCurve2dFlag : Boolean from Standard;
|
||||
myDeg : Boolean from Standard;
|
||||
myConvert : Boolean from Standard;
|
||||
myRational : Boolean from Standard;
|
||||
|
||||
myParameters : RestrictionParameters from ShapeCustom;
|
||||
|
||||
|
||||
end BSplineRestriction;
|
@@ -14,67 +14,72 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeAnalysis_Curve.hxx>
|
||||
#include <ShapeCustom_BSplineRestriction.ixx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <GeomConvert_ApproxSurface.hxx>
|
||||
#include <Geom2dConvert_ApproxCurve.hxx>
|
||||
#include <GeomConvert_ApproxCurve.hxx>
|
||||
#include <BRepTools_Modifier.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_OffsetCurve.hxx>
|
||||
#include <Geom2d_OffsetCurve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <Geom_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRepTools_Modifier.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_Conic.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_OffsetCurve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dConvert.hxx>
|
||||
#include <Geom2dConvert_ApproxCurve.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_Conic.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_ElementarySurface.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_OffsetCurve.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <Geom_SweptSurface.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomConvert.hxx>
|
||||
#include <GeomConvert_ApproxCurve.hxx>
|
||||
#include <GeomConvert_ApproxSurface.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ShapeAnalysis.hxx>
|
||||
#include <ShapeAnalysis_Curve.hxx>
|
||||
#include <ShapeConstruct.hxx>
|
||||
#include <ShapeCustom_BSplineRestriction.hxx>
|
||||
#include <ShapeCustom_RestrictionParameters.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
#include <ShapeConstruct.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_Conic.hxx>
|
||||
#include <Geom2dConvert.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Conic.hxx>
|
||||
#include <GeomConvert.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <ShapeAnalysis.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Geom_ElementarySurface.hxx>
|
||||
#include <Geom_SweptSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
static GeomAbs_Shape IntegerToGeomAbsShape(const Standard_Integer i)
|
||||
{
|
||||
|
227
src/ShapeCustom/ShapeCustom_BSplineRestriction.hxx
Normal file
227
src/ShapeCustom/ShapeCustom_BSplineRestriction.hxx
Normal file
@@ -0,0 +1,227 @@
|
||||
// Created on: 1999-06-18
|
||||
// Created by: Galina Koulikova
|
||||
// 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 _ShapeCustom_BSplineRestriction_HeaderFile
|
||||
#define _ShapeCustom_BSplineRestriction_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <ShapeCustom_Modification.hxx>
|
||||
class ShapeCustom_RestrictionParameters;
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
class TopLoc_Location;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class Geom2d_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
|
||||
|
||||
class ShapeCustom_BSplineRestriction;
|
||||
DEFINE_STANDARD_HANDLE(ShapeCustom_BSplineRestriction, ShapeCustom_Modification)
|
||||
|
||||
//! this tool intended for aproximation surfaces, curves and pcurves with
|
||||
//! specified degree , max number of segments, tolerance 2d, tolerance 3d. Specified
|
||||
//! continuity can be reduced if approximation with specified continuity was not done.
|
||||
class ShapeCustom_BSplineRestriction : public ShapeCustom_Modification
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Empty constructor.
|
||||
Standard_EXPORT ShapeCustom_BSplineRestriction();
|
||||
|
||||
//! Initializes with specified parameters of aproximation.
|
||||
Standard_EXPORT ShapeCustom_BSplineRestriction(const Standard_Boolean anApproxSurfaceFlag, const Standard_Boolean anApproxCurve3dFlag, const Standard_Boolean anApproxCurve2dFlag, const Standard_Real aTol3d, const Standard_Real aTol2d, const GeomAbs_Shape aContinuity3d, const GeomAbs_Shape aContinuity2d, const Standard_Integer aMaxDegree, const Standard_Integer aNbMaxSeg, const Standard_Boolean Degree, const Standard_Boolean Rational);
|
||||
|
||||
//! Initializes with specified parameters of aproximation.
|
||||
Standard_EXPORT ShapeCustom_BSplineRestriction(const Standard_Boolean anApproxSurfaceFlag, const Standard_Boolean anApproxCurve3dFlag, const Standard_Boolean anApproxCurve2dFlag, const Standard_Real aTol3d, const Standard_Real aTol2d, const GeomAbs_Shape aContinuity3d, const GeomAbs_Shape aContinuity2d, const Standard_Integer aMaxDegree, const Standard_Integer aNbMaxSeg, const Standard_Boolean Degree, const Standard_Boolean Rational, const Handle(ShapeCustom_RestrictionParameters)& aModes);
|
||||
|
||||
//! Returns Standard_True if the face <F> has been
|
||||
//! modified. In this case, <S> is the new geometric
|
||||
//! support of the face, <L> the new location,<Tol>
|
||||
//! the new tolerance.<RevWires> has to be set to
|
||||
//! Standard_True when the modification reverses the
|
||||
//! normal of the surface.(the wires have to be
|
||||
//! reversed). <RevFace> has to be set to
|
||||
//! Standard_True if the orientation of the modified
|
||||
//! face changes in the shells which contain it.
|
||||
//!
|
||||
//! Otherwise, returns Standard_False, and <S>, <L>,
|
||||
//! <Tol> , <RevWires> ,<RevFace> are not significant.
|
||||
Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S, TopLoc_Location& L, Standard_Real& Tol, Standard_Boolean& RevWires, Standard_Boolean& RevFace);
|
||||
|
||||
//! Returns Standard_True if curve from the edge <E> has been
|
||||
//! modified. In this case, <C> is the new geometric
|
||||
//! support of the edge, <L> the new location, <Tol>
|
||||
//! the new tolerance.
|
||||
//! Otherwise, returns Standard_True if Surface is modified or
|
||||
//! one of pcurves of edge is modified. In this case C is copy of
|
||||
//! geometric support of the edge.
|
||||
//! In other cases returns Standard_False, and <C>, <L>, <Tol> are not
|
||||
//! significant.
|
||||
Standard_EXPORT Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C, TopLoc_Location& L, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the edge <E> has been modified.
|
||||
//! In this case,if curve on the surface is modified, <C>
|
||||
//! is the new geometric support of the edge, <L> the
|
||||
//! new location, <Tol> the new tolerance. If curve on the surface
|
||||
//! is not modified C is copy curve on surface from the edge <E>.
|
||||
//!
|
||||
//! Otherwise, returns Standard_False, and <C>, <L>,
|
||||
//! <Tol> are not significant.
|
||||
//!
|
||||
//! <NewE> is the new edge created from <E>. <NewF>
|
||||
//! is the new face created from <F>. They may be usefull.
|
||||
Standard_EXPORT Standard_Boolean NewCurve2d (const TopoDS_Edge& E, const TopoDS_Face& F, const TopoDS_Edge& NewE, const TopoDS_Face& NewF, Handle(Geom2d_Curve)& C, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the surface has been modified.
|
||||
//! if flag IsOf equals Standard_True Offset surfaces are aproximated to Offset
|
||||
//! if Standard_False to BSpline
|
||||
Standard_EXPORT Standard_Boolean ConvertSurface (const Handle(Geom_Surface)& aSurface, Handle(Geom_Surface)& S, const Standard_Real UF, const Standard_Real UL, const Standard_Real VF, const Standard_Real VL, const Standard_Boolean IsOf = Standard_True);
|
||||
|
||||
//! Returns Standard_True if the curve has been modified.
|
||||
//! if flag IsOf equals Standard_True Offset curves are aproximated to Offset
|
||||
//! if Standard_False to BSpline
|
||||
Standard_EXPORT Standard_Boolean ConvertCurve (Handle(Geom_Curve)& aCurve, Handle(Geom_Curve)& C, const Standard_Boolean IsConvert, const Standard_Real First, const Standard_Real Last, Standard_Real& TolCur, const Standard_Boolean IsOf = Standard_True);
|
||||
|
||||
//! Returns Standard_True if the pcurve has been modified.
|
||||
//! if flag IsOf equals Standard_True Offset pcurves are aproximated to Offset
|
||||
//! if Standard_False to BSpline
|
||||
Standard_EXPORT Standard_Boolean ConvertCurve2d (Handle(Geom2d_Curve)& aCurve, Handle(Geom2d_Curve)& C, const Standard_Boolean IsConvert, const Standard_Real First, const Standard_Real Last, Standard_Real& TolCur, const Standard_Boolean IsOf = Standard_True);
|
||||
|
||||
//! Sets tolerance of aproximation for curve3d and surface
|
||||
void SetTol3d (const Standard_Real Tol3d);
|
||||
|
||||
//! Sets tolerance of aproximation for curve2d
|
||||
void SetTol2d (const Standard_Real Tol2d);
|
||||
|
||||
//! Returns (modifiable) the flag which defines whether the
|
||||
//! surface is aproximated.
|
||||
Standard_Boolean& ModifyApproxSurfaceFlag();
|
||||
|
||||
//! Returns (modifiable) the flag which defines whether the
|
||||
//! curve3d is aproximated.
|
||||
Standard_Boolean& ModifyApproxCurve3dFlag();
|
||||
|
||||
//! Returns (modifiable) the flag which defines whether the curve2d is aproximated.
|
||||
Standard_Boolean& ModifyApproxCurve2dFlag();
|
||||
|
||||
//! Sets continuity3d for aproximation curve3d and surface.
|
||||
void SetContinuity3d (const GeomAbs_Shape Continuity3d);
|
||||
|
||||
//! Sets continuity3d for aproximation curve2d.
|
||||
void SetContinuity2d (const GeomAbs_Shape Continuity2d);
|
||||
|
||||
//! Sets max degree for aproximation.
|
||||
void SetMaxDegree (const Standard_Integer MaxDegree);
|
||||
|
||||
//! Sets max number of segments for aproximation.
|
||||
void SetMaxNbSegments (const Standard_Integer MaxNbSegments);
|
||||
|
||||
//! Sets priority for aproximation curves and surface.
|
||||
//! If Degree is True approximation is made with degree less
|
||||
//! then specified MaxDegree at the expense of number of spanes.
|
||||
//! If Degree is False approximation is made with number of
|
||||
//! spans less then specified MaxNbSegment at the expense of
|
||||
//! specified MaxDegree.
|
||||
void SetPriority (const Standard_Boolean Degree);
|
||||
|
||||
//! Sets flag for define if rational BSpline or Bezier is
|
||||
//! converted to polynomial. If Rational is True approximation
|
||||
//! for rational BSpline and Bezier is made to polynomial even
|
||||
//! if degree is less then MaxDegree and number of spans is less
|
||||
//! then specified MaxNbSegment.
|
||||
void SetConvRational (const Standard_Boolean Rational);
|
||||
|
||||
//! Returns the container of modes which defines
|
||||
//! what geometry should be converted to BSplines.
|
||||
Handle(ShapeCustom_RestrictionParameters) GetRestrictionParameters() const;
|
||||
|
||||
//! Sets the container of modes which defines
|
||||
//! what geometry should be converted to BSplines.
|
||||
void SetRestrictionParameters (const Handle(ShapeCustom_RestrictionParameters)& aModes);
|
||||
|
||||
//! Returns error for aproximation curve3d.
|
||||
Standard_Real Curve3dError() const;
|
||||
|
||||
//! Returns error for aproximation curve2d.
|
||||
Standard_Real Curve2dError() const;
|
||||
|
||||
//! Returns error for aproximation surface.
|
||||
Standard_Real SurfaceError() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P, Standard_Real& Tol);
|
||||
|
||||
Standard_EXPORT Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E, Standard_Real& P, Standard_Real& Tol);
|
||||
|
||||
Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2, const TopoDS_Edge& NewE, const TopoDS_Face& NewF1, const TopoDS_Face& NewF2);
|
||||
|
||||
//! Returns error for aproximation surface, curve3d and curve2d.
|
||||
Standard_EXPORT Standard_Real MaxErrors (Standard_Real& aCurve3dErr, Standard_Real& aCurve2dErr) const;
|
||||
|
||||
//! Returns number for aproximation surface, curve3d and curve2d.
|
||||
Standard_EXPORT Standard_Integer NbOfSpan() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeCustom_BSplineRestriction,ShapeCustom_Modification)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
GeomAbs_Shape myContinuity3d;
|
||||
GeomAbs_Shape myContinuity2d;
|
||||
Standard_Integer myMaxDegree;
|
||||
Standard_Integer myNbMaxSeg;
|
||||
Standard_Real myTol3d;
|
||||
Standard_Real myTol2d;
|
||||
Standard_Real mySurfaceError;
|
||||
Standard_Real myCurve3dError;
|
||||
Standard_Real myCurve2dError;
|
||||
Standard_Integer myNbOfSpan;
|
||||
Standard_Boolean myApproxSurfaceFlag;
|
||||
Standard_Boolean myApproxCurve3dFlag;
|
||||
Standard_Boolean myApproxCurve2dFlag;
|
||||
Standard_Boolean myDeg;
|
||||
Standard_Boolean myConvert;
|
||||
Standard_Boolean myRational;
|
||||
Handle(ShapeCustom_RestrictionParameters) myParameters;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <ShapeCustom_BSplineRestriction.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_BSplineRestriction_HeaderFile
|
@@ -1,141 +0,0 @@
|
||||
-- Created on: 1999-06-17
|
||||
-- Created by: data exchange team
|
||||
-- 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.
|
||||
|
||||
private class ConvertToBSpline from ShapeCustom inherits Modification from ShapeCustom
|
||||
|
||||
---Purpose: implement a modification for BRepTools
|
||||
-- Modifier algortihm. Converts Surface of
|
||||
-- Linear Exctrusion, Revolution and Offset
|
||||
-- surfaces into BSpline Surface according to
|
||||
-- flags.
|
||||
|
||||
uses
|
||||
|
||||
Face from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
Shape from GeomAbs,
|
||||
Surface from Geom,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
Pnt from gp,
|
||||
Location from TopLoc
|
||||
is
|
||||
|
||||
Create returns ConvertToBSpline from ShapeCustom;
|
||||
|
||||
SetExtrusionMode(me: mutable; extrMode: Boolean);
|
||||
---Purpose: Sets mode for convertion of Surfaces of Linear
|
||||
-- extrusion.
|
||||
|
||||
SetRevolutionMode(me: mutable; revolMode: Boolean);
|
||||
---Purpose: Sets mode for convertion of Surfaces of Revolution.
|
||||
|
||||
SetOffsetMode(me: mutable; offsetMode: Boolean);
|
||||
---Purpose: Sets mode for convertion of Offset surfaces.
|
||||
|
||||
SetPlaneMode(me: mutable; planeMode: Boolean);
|
||||
---Purpose: Sets mode for convertion of Plane surfaces.
|
||||
|
||||
NewSurface(me: mutable; F : Face from TopoDS;
|
||||
S : out Surface from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard;
|
||||
RevWires : out Boolean from Standard;
|
||||
RevFace : out Boolean from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the face <F> has been
|
||||
-- modified. In this case, <S> is the new geometric
|
||||
-- support of the face, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <S>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewCurve(me: mutable; E : Edge from TopoDS;
|
||||
C : out Curve from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has been
|
||||
-- modified. In this case, <C> is the new geometric
|
||||
-- support of the edge, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <C>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewPoint(me: mutable; V : Vertex from TopoDS;
|
||||
P : out Pnt from gp;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the vertex <V> has been
|
||||
-- modified. In this case, <P> is the new geometric
|
||||
-- support of the vertex, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
NewCurve2d(me: mutable; E : Edge from TopoDS;
|
||||
F : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF : Face from TopoDS;
|
||||
C : out Curve from Geom2d;
|
||||
Tol : out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has a new
|
||||
-- curve on surface on the face <F>.In this case, <C>
|
||||
-- is the new geometric support of the edge, <L> the
|
||||
-- new location, <Tol> the new tolerance.
|
||||
--
|
||||
-- Otherwise, returns Standard_False, and <C>, <L>,
|
||||
-- <Tol> are not significant.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF>
|
||||
-- is the new face created from <F>. They may be usefull.
|
||||
|
||||
NewParameter(me: mutable; V : Vertex from TopoDS;
|
||||
E : Edge from TopoDS;
|
||||
P : out Real from Standard;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the Vertex <V> has a new
|
||||
-- parameter on the edge <E>. In this case, <P> is
|
||||
-- the parameter, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
Continuity(me: mutable; E : Edge from TopoDS;
|
||||
F1,F2 : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF1,NewF2: Face from TopoDS)
|
||||
returns Shape from GeomAbs;
|
||||
---Purpose: Returns the continuity of <NewE> between <NewF1>
|
||||
-- and <NewF2>.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF1>
|
||||
-- (resp. <NewF2>) is the new face created from <F1>
|
||||
-- (resp. <F2>).
|
||||
|
||||
IsToConvert(me; S : Surface from Geom;
|
||||
SS:out Surface from Geom)
|
||||
returns Boolean is private;
|
||||
|
||||
fields
|
||||
|
||||
myExtrMode : Boolean;
|
||||
myRevolMode : Boolean;
|
||||
myOffsetMode: Boolean;
|
||||
myPlaneMode : Boolean;
|
||||
|
||||
end ConvertToBSpline;
|
@@ -14,29 +14,36 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeCustom_ConvertToBSpline.ixx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <ShapeConstruct.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ShapeConstruct.hxx>
|
||||
#include <ShapeCustom_ConvertToBSpline.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeCustom_ConvertToBSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeCustom_ConvertToBSpline::ShapeCustom_ConvertToBSpline():
|
||||
myExtrMode(Standard_True), myRevolMode(Standard_True),
|
||||
myOffsetMode(Standard_True), myPlaneMode(Standard_False)
|
||||
|
145
src/ShapeCustom/ShapeCustom_ConvertToBSpline.hxx
Normal file
145
src/ShapeCustom/ShapeCustom_ConvertToBSpline.hxx
Normal file
@@ -0,0 +1,145 @@
|
||||
// Created on: 1999-06-17
|
||||
// Created by: data exchange team
|
||||
// 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 _ShapeCustom_ConvertToBSpline_HeaderFile
|
||||
#define _ShapeCustom_ConvertToBSpline_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <ShapeCustom_Modification.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
class TopLoc_Location;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class Geom2d_Curve;
|
||||
|
||||
|
||||
class ShapeCustom_ConvertToBSpline;
|
||||
DEFINE_STANDARD_HANDLE(ShapeCustom_ConvertToBSpline, ShapeCustom_Modification)
|
||||
|
||||
//! implement a modification for BRepTools
|
||||
//! Modifier algortihm. Converts Surface of
|
||||
//! Linear Exctrusion, Revolution and Offset
|
||||
//! surfaces into BSpline Surface according to
|
||||
//! flags.
|
||||
class ShapeCustom_ConvertToBSpline : public ShapeCustom_Modification
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT ShapeCustom_ConvertToBSpline();
|
||||
|
||||
//! Sets mode for convertion of Surfaces of Linear
|
||||
//! extrusion.
|
||||
Standard_EXPORT void SetExtrusionMode (const Standard_Boolean extrMode);
|
||||
|
||||
//! Sets mode for convertion of Surfaces of Revolution.
|
||||
Standard_EXPORT void SetRevolutionMode (const Standard_Boolean revolMode);
|
||||
|
||||
//! Sets mode for convertion of Offset surfaces.
|
||||
Standard_EXPORT void SetOffsetMode (const Standard_Boolean offsetMode);
|
||||
|
||||
//! Sets mode for convertion of Plane surfaces.
|
||||
Standard_EXPORT void SetPlaneMode (const Standard_Boolean planeMode);
|
||||
|
||||
//! Returns Standard_True if the face <F> has been
|
||||
//! modified. In this case, <S> is the new geometric
|
||||
//! support of the face, <L> the new location, <Tol>
|
||||
//! the new tolerance. Otherwise, returns
|
||||
//! Standard_False, and <S>, <L>, <Tol> are not
|
||||
//! significant.
|
||||
Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S, TopLoc_Location& L, Standard_Real& Tol, Standard_Boolean& RevWires, Standard_Boolean& RevFace);
|
||||
|
||||
//! Returns Standard_True if the edge <E> has been
|
||||
//! modified. In this case, <C> is the new geometric
|
||||
//! support of the edge, <L> the new location, <Tol>
|
||||
//! the new tolerance. Otherwise, returns
|
||||
//! Standard_False, and <C>, <L>, <Tol> are not
|
||||
//! significant.
|
||||
Standard_EXPORT Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C, TopLoc_Location& L, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the vertex <V> has been
|
||||
//! modified. In this case, <P> is the new geometric
|
||||
//! support of the vertex, <Tol> the new tolerance.
|
||||
//! Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
//! are not significant.
|
||||
Standard_EXPORT Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the edge <E> has a new
|
||||
//! curve on surface on the face <F>.In this case, <C>
|
||||
//! is the new geometric support of the edge, <L> the
|
||||
//! new location, <Tol> the new tolerance.
|
||||
//!
|
||||
//! Otherwise, returns Standard_False, and <C>, <L>,
|
||||
//! <Tol> are not significant.
|
||||
//!
|
||||
//! <NewE> is the new edge created from <E>. <NewF>
|
||||
//! is the new face created from <F>. They may be usefull.
|
||||
Standard_EXPORT Standard_Boolean NewCurve2d (const TopoDS_Edge& E, const TopoDS_Face& F, const TopoDS_Edge& NewE, const TopoDS_Face& NewF, Handle(Geom2d_Curve)& C, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the Vertex <V> has a new
|
||||
//! parameter on the edge <E>. In this case, <P> is
|
||||
//! the parameter, <Tol> the new tolerance.
|
||||
//! Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
//! are not significant.
|
||||
Standard_EXPORT Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E, Standard_Real& P, Standard_Real& Tol);
|
||||
|
||||
//! Returns the continuity of <NewE> between <NewF1>
|
||||
//! and <NewF2>.
|
||||
//!
|
||||
//! <NewE> is the new edge created from <E>. <NewF1>
|
||||
//! (resp. <NewF2>) is the new face created from <F1>
|
||||
//! (resp. <F2>).
|
||||
Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2, const TopoDS_Edge& NewE, const TopoDS_Face& NewF1, const TopoDS_Face& NewF2);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeCustom_ConvertToBSpline,ShapeCustom_Modification)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsToConvert (const Handle(Geom_Surface)& S, Handle(Geom_Surface)& SS) const;
|
||||
|
||||
Standard_Boolean myExtrMode;
|
||||
Standard_Boolean myRevolMode;
|
||||
Standard_Boolean myOffsetMode;
|
||||
Standard_Boolean myPlaneMode;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_ConvertToBSpline_HeaderFile
|
@@ -1,117 +0,0 @@
|
||||
-- Created on: 1999-05-08
|
||||
-- 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.
|
||||
|
||||
private class ConvertToRevolution from ShapeCustom inherits Modification from ShapeCustom
|
||||
|
||||
---Purpose: implements a modification for the BRepTools
|
||||
-- Modifier algortihm. Converts all elementary
|
||||
-- surfaces into surfaces of revolution.
|
||||
|
||||
uses
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Location from TopLoc,
|
||||
|
||||
Shape from GeomAbs,
|
||||
|
||||
Pnt from gp,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
Surface from Geom
|
||||
|
||||
is
|
||||
|
||||
Create returns ConvertToRevolution from ShapeCustom;
|
||||
|
||||
NewSurface(me: mutable; F : Face from TopoDS;
|
||||
S : out Surface from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard;
|
||||
RevWires : out Boolean from Standard;
|
||||
RevFace : out Boolean from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the face <F> has been
|
||||
-- modified. In this case, <S> is the new geometric
|
||||
-- support of the face, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <S>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewCurve(me: mutable; E : Edge from TopoDS;
|
||||
C : out Curve from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has been
|
||||
-- modified. In this case, <C> is the new geometric
|
||||
-- support of the edge, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <C>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewPoint(me: mutable; V : Vertex from TopoDS;
|
||||
P : out Pnt from gp;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the vertex <V> has been
|
||||
-- modified. In this case, <P> is the new geometric
|
||||
-- support of the vertex, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
NewCurve2d(me: mutable; E : Edge from TopoDS;
|
||||
F : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF : Face from TopoDS;
|
||||
C : out Curve from Geom2d;
|
||||
Tol : out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has a new
|
||||
-- curve on surface on the face <F>.In this case, <C>
|
||||
-- is the new geometric support of the edge, <L> the
|
||||
-- new location, <Tol> the new tolerance.
|
||||
--
|
||||
-- Otherwise, returns Standard_False, and <C>, <L>,
|
||||
-- <Tol> are not significant.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF>
|
||||
-- is the new face created from <F>. They may be usefull.
|
||||
|
||||
NewParameter(me: mutable; V : Vertex from TopoDS;
|
||||
E : Edge from TopoDS;
|
||||
P : out Real from Standard;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the Vertex <V> has a new
|
||||
-- parameter on the edge <E>. In this case, <P> is
|
||||
-- the parameter, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
Continuity(me: mutable; E : Edge from TopoDS;
|
||||
F1,F2 : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF1,NewF2: Face from TopoDS)
|
||||
returns Shape from GeomAbs;
|
||||
---Purpose: Returns the continuity of <NewE> between <NewF1>
|
||||
-- and <NewF2>.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF1>
|
||||
-- (resp. <NewF2>) is the new face created from <F1>
|
||||
-- (resp. <F2>).
|
||||
|
||||
end ConvertToRevolution;
|
@@ -11,36 +11,42 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeCustom_ConvertToRevolution.ixx>
|
||||
#include <Geom_ElementarySurface.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_ElementarySurface.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ShapeCustom_ConvertToRevolution.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeCustom_ConvertToRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeCustom_ConvertToRevolution::ShapeCustom_ConvertToRevolution()
|
||||
{
|
||||
}
|
||||
|
124
src/ShapeCustom/ShapeCustom_ConvertToRevolution.hxx
Normal file
124
src/ShapeCustom/ShapeCustom_ConvertToRevolution.hxx
Normal file
@@ -0,0 +1,124 @@
|
||||
// Created on: 1999-05-08
|
||||
// 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 _ShapeCustom_ConvertToRevolution_HeaderFile
|
||||
#define _ShapeCustom_ConvertToRevolution_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <ShapeCustom_Modification.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
class TopLoc_Location;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class Geom2d_Curve;
|
||||
|
||||
|
||||
class ShapeCustom_ConvertToRevolution;
|
||||
DEFINE_STANDARD_HANDLE(ShapeCustom_ConvertToRevolution, ShapeCustom_Modification)
|
||||
|
||||
//! implements a modification for the BRepTools
|
||||
//! Modifier algortihm. Converts all elementary
|
||||
//! surfaces into surfaces of revolution.
|
||||
class ShapeCustom_ConvertToRevolution : public ShapeCustom_Modification
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT ShapeCustom_ConvertToRevolution();
|
||||
|
||||
//! Returns Standard_True if the face <F> has been
|
||||
//! modified. In this case, <S> is the new geometric
|
||||
//! support of the face, <L> the new location, <Tol>
|
||||
//! the new tolerance. Otherwise, returns
|
||||
//! Standard_False, and <S>, <L>, <Tol> are not
|
||||
//! significant.
|
||||
Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S, TopLoc_Location& L, Standard_Real& Tol, Standard_Boolean& RevWires, Standard_Boolean& RevFace);
|
||||
|
||||
//! Returns Standard_True if the edge <E> has been
|
||||
//! modified. In this case, <C> is the new geometric
|
||||
//! support of the edge, <L> the new location, <Tol>
|
||||
//! the new tolerance. Otherwise, returns
|
||||
//! Standard_False, and <C>, <L>, <Tol> are not
|
||||
//! significant.
|
||||
Standard_EXPORT Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C, TopLoc_Location& L, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the vertex <V> has been
|
||||
//! modified. In this case, <P> is the new geometric
|
||||
//! support of the vertex, <Tol> the new tolerance.
|
||||
//! Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
//! are not significant.
|
||||
Standard_EXPORT Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the edge <E> has a new
|
||||
//! curve on surface on the face <F>.In this case, <C>
|
||||
//! is the new geometric support of the edge, <L> the
|
||||
//! new location, <Tol> the new tolerance.
|
||||
//!
|
||||
//! Otherwise, returns Standard_False, and <C>, <L>,
|
||||
//! <Tol> are not significant.
|
||||
//!
|
||||
//! <NewE> is the new edge created from <E>. <NewF>
|
||||
//! is the new face created from <F>. They may be usefull.
|
||||
Standard_EXPORT Standard_Boolean NewCurve2d (const TopoDS_Edge& E, const TopoDS_Face& F, const TopoDS_Edge& NewE, const TopoDS_Face& NewF, Handle(Geom2d_Curve)& C, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the Vertex <V> has a new
|
||||
//! parameter on the edge <E>. In this case, <P> is
|
||||
//! the parameter, <Tol> the new tolerance.
|
||||
//! Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
//! are not significant.
|
||||
Standard_EXPORT Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E, Standard_Real& P, Standard_Real& Tol);
|
||||
|
||||
//! Returns the continuity of <NewE> between <NewF1>
|
||||
//! and <NewF2>.
|
||||
//!
|
||||
//! <NewE> is the new edge created from <E>. <NewF1>
|
||||
//! (resp. <NewF2>) is the new face created from <F1>
|
||||
//! (resp. <F2>).
|
||||
Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2, const TopoDS_Edge& NewE, const TopoDS_Face& NewF1, const TopoDS_Face& NewF2);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeCustom_ConvertToRevolution,ShapeCustom_Modification)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_ConvertToRevolution_HeaderFile
|
@@ -1,43 +0,0 @@
|
||||
-- Created on: 2001-08-28
|
||||
-- Created by: data exchange team
|
||||
-- Copyright (c) 2001-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 Curve from ShapeCustom
|
||||
|
||||
---Purpose: Converts BSpline curve to periodic
|
||||
|
||||
uses
|
||||
|
||||
Curve from Geom
|
||||
|
||||
is
|
||||
|
||||
Create returns Curve from ShapeCustom;
|
||||
|
||||
Create (C: Curve from Geom) returns Curve from ShapeCustom;
|
||||
|
||||
Init (me: in out; C: Curve from Geom);
|
||||
|
||||
ConvertToPeriodic (me: in out; substitute: Boolean; preci: Real = -1)
|
||||
returns Curve from Geom;
|
||||
---Purpose: Tries to convert the Curve to the Periodic form
|
||||
-- Returns the resulting curve
|
||||
-- Works only if the Curve is BSpline and is closed with
|
||||
-- Precision::Confusion()
|
||||
-- Else, or in case of failure, returns a Null Handle
|
||||
fields
|
||||
|
||||
myCurve: Curve from Geom;
|
||||
|
||||
end Curve;
|
@@ -11,13 +11,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeCustom_Curve.ixx>
|
||||
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <ShapeAnalysis_Curve.hxx>
|
||||
#include <ShapeCustom_Curve.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <ShapeAnalysis_Curve.hxx>
|
||||
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
ShapeCustom_Curve::ShapeCustom_Curve()
|
||||
{
|
||||
|
73
src/ShapeCustom/ShapeCustom_Curve.hxx
Normal file
73
src/ShapeCustom/ShapeCustom_Curve.hxx
Normal file
@@ -0,0 +1,73 @@
|
||||
// Created on: 2001-08-28
|
||||
// Created by: data exchange team
|
||||
// Copyright (c) 2001-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 _ShapeCustom_Curve_HeaderFile
|
||||
#define _ShapeCustom_Curve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class Geom_Curve;
|
||||
|
||||
|
||||
//! Converts BSpline curve to periodic
|
||||
class ShapeCustom_Curve
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT ShapeCustom_Curve();
|
||||
|
||||
Standard_EXPORT ShapeCustom_Curve(const Handle(Geom_Curve)& C);
|
||||
|
||||
Standard_EXPORT void Init (const Handle(Geom_Curve)& C);
|
||||
|
||||
//! Tries to convert the Curve to the Periodic form
|
||||
//! Returns the resulting curve
|
||||
//! Works only if the Curve is BSpline and is closed with
|
||||
//! Precision::Confusion()
|
||||
//! Else, or in case of failure, returns a Null Handle
|
||||
Standard_EXPORT Handle(Geom_Curve) ConvertToPeriodic (const Standard_Boolean substitute, const Standard_Real preci = -1);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom_Curve) myCurve;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_Curve_HeaderFile
|
@@ -1,56 +0,0 @@
|
||||
-- Created on: 2001-12-20
|
||||
-- Created by: Pavel TELKOV
|
||||
-- Copyright (c) 2001-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 Curve2d from ShapeCustom
|
||||
|
||||
---Purpose: Converts curve2d to analytical form with given
|
||||
-- precision or simpify curve2d.
|
||||
|
||||
uses
|
||||
Curve from Geom2d,
|
||||
Line from Geom2d,
|
||||
Array1OfPnt2d from TColgp,
|
||||
BSplineCurve from Geom2d
|
||||
is
|
||||
|
||||
-- static methods
|
||||
IsLinear (myclass; thePoles : Array1OfPnt2d from TColgp;
|
||||
theTolerance : Real from Standard;
|
||||
theDeviation : in out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Check if poleses is in the plane with given precision
|
||||
-- Returns false if no.
|
||||
|
||||
ConvertToLine2d (myclass; theCurve : Curve from Geom2d;
|
||||
theFirstIn, theLastIn : Real from Standard;
|
||||
theTolerance : Real from Standard;
|
||||
theNewFirst, theNewLast : in out Real from Standard;
|
||||
theDeviation: in out Real from Standard)
|
||||
returns Line from Geom2d;
|
||||
---Purpose: Try to convert BSpline2d or Bezier2d to line 2d
|
||||
-- only if it is linear. Recalculate first and last parameters.
|
||||
-- Returns line2d or null curve2d.
|
||||
|
||||
SimplifyBSpline2d (myclass; theBSpline2d : in out BSplineCurve from Geom2d;
|
||||
theTolerance : Real from Standard )
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Try to remove knots from bspline where local derivatives are the same.
|
||||
-- Remove knots with given precision.
|
||||
-- Returns false if Bsplien was not modified
|
||||
|
||||
--fields
|
||||
|
||||
|
||||
end Curve2d;
|
@@ -15,18 +15,18 @@
|
||||
|
||||
// Last modification:
|
||||
|
||||
#include <ShapeCustom_Curve2d.ixx>
|
||||
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
|
||||
#include <ShapeCustom_Curve2d.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetLine
|
||||
|
77
src/ShapeCustom/ShapeCustom_Curve2d.hxx
Normal file
77
src/ShapeCustom/ShapeCustom_Curve2d.hxx
Normal file
@@ -0,0 +1,77 @@
|
||||
// Created on: 2001-12-20
|
||||
// Created by: Pavel TELKOV
|
||||
// Copyright (c) 2001-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 _ShapeCustom_Curve2d_HeaderFile
|
||||
#define _ShapeCustom_Curve2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class Geom2d_Line;
|
||||
class Geom2d_Curve;
|
||||
class Geom2d_BSplineCurve;
|
||||
|
||||
|
||||
//! Converts curve2d to analytical form with given
|
||||
//! precision or simpify curve2d.
|
||||
class ShapeCustom_Curve2d
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Check if poleses is in the plane with given precision
|
||||
//! Returns false if no.
|
||||
Standard_EXPORT static Standard_Boolean IsLinear (const TColgp_Array1OfPnt2d& thePoles, const Standard_Real theTolerance, Standard_Real& theDeviation);
|
||||
|
||||
//! Try to convert BSpline2d or Bezier2d to line 2d
|
||||
//! only if it is linear. Recalculate first and last parameters.
|
||||
//! Returns line2d or null curve2d.
|
||||
Standard_EXPORT static Handle(Geom2d_Line) ConvertToLine2d (const Handle(Geom2d_Curve)& theCurve, const Standard_Real theFirstIn, const Standard_Real theLastIn, const Standard_Real theTolerance, Standard_Real& theNewFirst, Standard_Real& theNewLast, Standard_Real& theDeviation);
|
||||
|
||||
//! Try to remove knots from bspline where local derivatives are the same.
|
||||
//! Remove knots with given precision.
|
||||
//! Returns false if Bsplien was not modified
|
||||
Standard_EXPORT static Standard_Boolean SimplifyBSpline2d (Handle(Geom2d_BSplineCurve)& theBSpline2d, const Standard_Real theTolerance);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_Curve2d_HeaderFile
|
@@ -1,118 +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 DirectModification from ShapeCustom
|
||||
inherits Modification from ShapeCustom
|
||||
|
||||
---Purpose: implements a modification for the BRepTools
|
||||
-- Modifier algortihm. Will redress indirect
|
||||
-- surfaces.
|
||||
|
||||
uses
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Location from TopLoc,
|
||||
|
||||
Shape from GeomAbs,
|
||||
|
||||
Pnt from gp,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
Surface from Geom
|
||||
|
||||
is
|
||||
|
||||
Create returns DirectModification from ShapeCustom;
|
||||
|
||||
NewSurface(me: mutable; F : Face from TopoDS;
|
||||
S : out Surface from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard;
|
||||
RevWires : out Boolean from Standard;
|
||||
RevFace : out Boolean from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the face <F> has been
|
||||
-- modified. In this case, <S> is the new geometric
|
||||
-- support of the face, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <S>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewCurve(me: mutable; E : Edge from TopoDS;
|
||||
C : out Curve from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has been
|
||||
-- modified. In this case, <C> is the new geometric
|
||||
-- support of the edge, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <C>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewPoint(me: mutable; V : Vertex from TopoDS;
|
||||
P : out Pnt from gp;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the vertex <V> has been
|
||||
-- modified. In this case, <P> is the new geometric
|
||||
-- support of the vertex, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
NewCurve2d(me: mutable; E : Edge from TopoDS;
|
||||
F : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF : Face from TopoDS;
|
||||
C : out Curve from Geom2d;
|
||||
Tol : out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has a new
|
||||
-- curve on surface on the face <F>.In this case, <C>
|
||||
-- is the new geometric support of the edge, <L> the
|
||||
-- new location, <Tol> the new tolerance.
|
||||
--
|
||||
-- Otherwise, returns Standard_False, and <C>, <L>,
|
||||
-- <Tol> are not significant.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF>
|
||||
-- is the new face created from <F>. They may be usefull.
|
||||
|
||||
NewParameter(me: mutable; V : Vertex from TopoDS;
|
||||
E : Edge from TopoDS;
|
||||
P : out Real from Standard;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the Vertex <V> has a new
|
||||
-- parameter on the edge <E>. In this case, <P> is
|
||||
-- the parameter, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
Continuity(me: mutable; E : Edge from TopoDS;
|
||||
F1,F2 : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF1,NewF2: Face from TopoDS)
|
||||
returns Shape from GeomAbs;
|
||||
---Purpose: Returns the continuity of <NewE> between <NewF1>
|
||||
-- and <NewF2>.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF1>
|
||||
-- (resp. <NewF2>) is the new face created from <F1>
|
||||
-- (resp. <F2>).
|
||||
|
||||
end DirectModification;
|
@@ -17,30 +17,35 @@
|
||||
//S4181 pdn 20.04.99 Modification of indirect rectangular trimming surfaces and taking
|
||||
// locations into account
|
||||
//szv 03.01.01 PositiveCones merged in
|
||||
#include <ShapeCustom_DirectModification.ixx>
|
||||
|
||||
#include <gp_Mat.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_ElementarySurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_ElementarySurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <gp_Mat.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ShapeCustom_DirectModification.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeCustom_DirectModification
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeCustom_DirectModification::ShapeCustom_DirectModification()
|
||||
{
|
||||
}
|
||||
|
124
src/ShapeCustom/ShapeCustom_DirectModification.hxx
Normal file
124
src/ShapeCustom/ShapeCustom_DirectModification.hxx
Normal file
@@ -0,0 +1,124 @@
|
||||
// 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 _ShapeCustom_DirectModification_HeaderFile
|
||||
#define _ShapeCustom_DirectModification_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <ShapeCustom_Modification.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
class TopLoc_Location;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class Geom2d_Curve;
|
||||
|
||||
|
||||
class ShapeCustom_DirectModification;
|
||||
DEFINE_STANDARD_HANDLE(ShapeCustom_DirectModification, ShapeCustom_Modification)
|
||||
|
||||
//! implements a modification for the BRepTools
|
||||
//! Modifier algortihm. Will redress indirect
|
||||
//! surfaces.
|
||||
class ShapeCustom_DirectModification : public ShapeCustom_Modification
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT ShapeCustom_DirectModification();
|
||||
|
||||
//! Returns Standard_True if the face <F> has been
|
||||
//! modified. In this case, <S> is the new geometric
|
||||
//! support of the face, <L> the new location, <Tol>
|
||||
//! the new tolerance. Otherwise, returns
|
||||
//! Standard_False, and <S>, <L>, <Tol> are not
|
||||
//! significant.
|
||||
Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S, TopLoc_Location& L, Standard_Real& Tol, Standard_Boolean& RevWires, Standard_Boolean& RevFace);
|
||||
|
||||
//! Returns Standard_True if the edge <E> has been
|
||||
//! modified. In this case, <C> is the new geometric
|
||||
//! support of the edge, <L> the new location, <Tol>
|
||||
//! the new tolerance. Otherwise, returns
|
||||
//! Standard_False, and <C>, <L>, <Tol> are not
|
||||
//! significant.
|
||||
Standard_EXPORT Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C, TopLoc_Location& L, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the vertex <V> has been
|
||||
//! modified. In this case, <P> is the new geometric
|
||||
//! support of the vertex, <Tol> the new tolerance.
|
||||
//! Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
//! are not significant.
|
||||
Standard_EXPORT Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the edge <E> has a new
|
||||
//! curve on surface on the face <F>.In this case, <C>
|
||||
//! is the new geometric support of the edge, <L> the
|
||||
//! new location, <Tol> the new tolerance.
|
||||
//!
|
||||
//! Otherwise, returns Standard_False, and <C>, <L>,
|
||||
//! <Tol> are not significant.
|
||||
//!
|
||||
//! <NewE> is the new edge created from <E>. <NewF>
|
||||
//! is the new face created from <F>. They may be usefull.
|
||||
Standard_EXPORT Standard_Boolean NewCurve2d (const TopoDS_Edge& E, const TopoDS_Face& F, const TopoDS_Edge& NewE, const TopoDS_Face& NewF, Handle(Geom2d_Curve)& C, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the Vertex <V> has a new
|
||||
//! parameter on the edge <E>. In this case, <P> is
|
||||
//! the parameter, <Tol> the new tolerance.
|
||||
//! Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
//! are not significant.
|
||||
Standard_EXPORT Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E, Standard_Real& P, Standard_Real& Tol);
|
||||
|
||||
//! Returns the continuity of <NewE> between <NewF1>
|
||||
//! and <NewF2>.
|
||||
//!
|
||||
//! <NewE> is the new edge created from <E>. <NewF1>
|
||||
//! (resp. <NewF2>) is the new face created from <F1>
|
||||
//! (resp. <F2>).
|
||||
Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2, const TopoDS_Edge& NewE, const TopoDS_Face& NewF1, const TopoDS_Face& NewF2);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeCustom_DirectModification,ShapeCustom_Modification)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_DirectModification_HeaderFile
|
@@ -1,43 +0,0 @@
|
||||
-- Copyright (c) 2003-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 Modification from ShapeCustom inherits Modification from BRepTools
|
||||
|
||||
---Purpose: A base class of Modification's from ShapeCustom.
|
||||
-- Implements message sending mechanism.
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
Msg from Message,
|
||||
Gravity from Message,
|
||||
BasicMsgRegistrator from ShapeExtend
|
||||
|
||||
is
|
||||
|
||||
SetMsgRegistrator (me:mutable; msgreg: BasicMsgRegistrator from ShapeExtend) is virtual;
|
||||
---Purpose: Sets message registrator
|
||||
|
||||
MsgRegistrator (me) returns BasicMsgRegistrator from ShapeExtend;
|
||||
---Purpose: Returns message registrator
|
||||
|
||||
SendMsg (me; shape : Shape from TopoDS;
|
||||
message: Msg from Message;
|
||||
gravity: Gravity from Message = Message_Info);
|
||||
---Purpose: Sends a message to be attached to the shape.
|
||||
-- Calls corresponding message of message registrator.
|
||||
|
||||
fields
|
||||
|
||||
myMsgReg: BasicMsgRegistrator from ShapeExtend;
|
||||
|
||||
end SweptToElementary;
|
@@ -11,18 +11,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeCustom_Modification.ixx>
|
||||
|
||||
#include <Message_Gravity.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <ShapeCustom_Modification.hxx>
|
||||
#include <ShapeExtend_BasicMsgRegistrator.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMsgRegistrator
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ShapeCustom_Modification::SetMsgRegistrator(const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg)
|
||||
{
|
||||
myMsgReg = msgreg;
|
||||
|
72
src/ShapeCustom/ShapeCustom_Modification.hxx
Normal file
72
src/ShapeCustom/ShapeCustom_Modification.hxx
Normal file
@@ -0,0 +1,72 @@
|
||||
// Copyright (c) 2003-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 _ShapeCustom_Modification_HeaderFile
|
||||
#define _ShapeCustom_Modification_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <BRepTools_Modification.hxx>
|
||||
#include <Message_Gravity.hxx>
|
||||
class ShapeExtend_BasicMsgRegistrator;
|
||||
class TopoDS_Shape;
|
||||
class Message_Msg;
|
||||
|
||||
|
||||
class ShapeCustom_Modification;
|
||||
DEFINE_STANDARD_HANDLE(ShapeCustom_Modification, BRepTools_Modification)
|
||||
|
||||
//! A base class of Modification's from ShapeCustom.
|
||||
//! Implements message sending mechanism.
|
||||
class ShapeCustom_Modification : public BRepTools_Modification
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Sets message registrator
|
||||
Standard_EXPORT virtual void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg);
|
||||
|
||||
//! Returns message registrator
|
||||
Standard_EXPORT Handle(ShapeExtend_BasicMsgRegistrator) MsgRegistrator() const;
|
||||
|
||||
//! Sends a message to be attached to the shape.
|
||||
//! Calls corresponding message of message registrator.
|
||||
Standard_EXPORT void SendMsg (const TopoDS_Shape& shape, const Message_Msg& message, const Message_Gravity gravity = Message_Info) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeCustom_Modification,BRepTools_Modification)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(ShapeExtend_BasicMsgRegistrator) myMsgReg;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_Modification_HeaderFile
|
@@ -1,147 +0,0 @@
|
||||
-- Created on: 2000-05-22
|
||||
-- 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 RestrictionParameters from ShapeCustom inherits TShared from MMgt
|
||||
|
||||
---Purpose: This class is axuluary tool which contains parameters for
|
||||
-- BSplineRestriction class.
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create returns RestrictionParameters from ShapeCustom;
|
||||
---Purpose: Sets default parameters.
|
||||
|
||||
---Methods for modifying fields.
|
||||
|
||||
GMaxDegree(me: mutable) returns Integer;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Returns (modifiable) maximal degree of approximation.
|
||||
|
||||
GMaxSeg(me: mutable) returns Integer;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Returns (modifiable) maximal number of spans of
|
||||
-- approximation.
|
||||
|
||||
ConvertPlane (me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if Plane converted to BSpline surface.
|
||||
|
||||
ConvertBezierSurf(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if Bezier surface converted to BSpline
|
||||
-- surface.
|
||||
|
||||
ConvertRevolutionSurf(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if surface of Revolution converted to
|
||||
-- BSpline surface.
|
||||
|
||||
ConvertExtrusionSurf(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if surface of LinearExtrusion converted
|
||||
-- to BSpline surface.
|
||||
|
||||
ConvertOffsetSurf(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if Offset surface converted to BSpline
|
||||
-- surface.
|
||||
|
||||
ConvertCylindricalSurf(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if cylindrical surface converted to BSpline
|
||||
-- surface.
|
||||
ConvertConicalSurf(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if conical surface converted to BSpline
|
||||
-- surface.
|
||||
ConvertToroidalSurf(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if toroidal surface converted to BSpline
|
||||
-- surface.
|
||||
|
||||
ConvertSphericalSurf(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if spherical surface converted to BSpline
|
||||
-- surface.
|
||||
|
||||
-- ConvertElementarySurf(me: mutable) returns Boolean;
|
||||
-- ---C++: inline
|
||||
-- ---C++: return &
|
||||
-- ---Purpose: Sets flag for define if Offset surface converted to BSpline
|
||||
-- -- surface.
|
||||
|
||||
SegmentSurfaceMode(me: mutable)returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets Segment mode for surface. If Segment is True surface is
|
||||
-- approximated in the bondaries of face lying on this surface.
|
||||
|
||||
ConvertCurve3d(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if 3d curve converted to BSpline curve.
|
||||
|
||||
ConvertOffsetCurv3d(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Sets flag for define if Offset curve3d converted to BSpline
|
||||
-- surface.
|
||||
|
||||
ConvertCurve2d(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Returns (modifiable) flag for define if 2d curve converted
|
||||
-- to BSpline curve.
|
||||
|
||||
ConvertOffsetCurv2d(me: mutable) returns Boolean;
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
---Purpose: Returns (modifiable) flag for define if Offset curve2d
|
||||
-- converted to BSpline surface.
|
||||
|
||||
fields
|
||||
|
||||
myGMaxDegree: Integer from Standard;
|
||||
myGMaxSeg : Integer from Standard;
|
||||
|
||||
myConvPlane : Boolean;
|
||||
--myConvElementarySurf: Boolean;
|
||||
myConvConicalSurf : Boolean;
|
||||
myConvSphericalSurf : Boolean;
|
||||
myConvCylindricalSurf : Boolean;
|
||||
myConvToroidalSurf : Boolean;
|
||||
myConvBezierSurf : Boolean;
|
||||
myConvRevolSurf : Boolean;
|
||||
myConvExtrSurf : Boolean;
|
||||
myConvOffsetSurf : Boolean;
|
||||
mySegmentSurfaceMode: Boolean;
|
||||
myConvCurve3d : Boolean;
|
||||
myConvOffsetCurv3d : Boolean;
|
||||
myConvCurve2d : Boolean;
|
||||
myConvOffsetCurv2d : Boolean;
|
||||
|
||||
end RestrictionParameters;
|
@@ -13,13 +13,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeCustom_RestrictionParameters.ixx>
|
||||
|
||||
#include <ShapeCustom_RestrictionParameters.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeCustom_RestrictionParameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeCustom_RestrictionParameters::ShapeCustom_RestrictionParameters()
|
||||
{
|
||||
myGMaxSeg = 10000;
|
||||
|
142
src/ShapeCustom/ShapeCustom_RestrictionParameters.hxx
Normal file
142
src/ShapeCustom/ShapeCustom_RestrictionParameters.hxx
Normal file
@@ -0,0 +1,142 @@
|
||||
// Created on: 2000-05-22
|
||||
// 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 _ShapeCustom_RestrictionParameters_HeaderFile
|
||||
#define _ShapeCustom_RestrictionParameters_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
|
||||
|
||||
class ShapeCustom_RestrictionParameters;
|
||||
DEFINE_STANDARD_HANDLE(ShapeCustom_RestrictionParameters, MMgt_TShared)
|
||||
|
||||
//! This class is axuluary tool which contains parameters for
|
||||
//! BSplineRestriction class.
|
||||
class ShapeCustom_RestrictionParameters : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Sets default parameters.
|
||||
Standard_EXPORT ShapeCustom_RestrictionParameters();
|
||||
|
||||
//! Returns (modifiable) maximal degree of approximation.
|
||||
Standard_Integer& GMaxDegree();
|
||||
|
||||
//! Returns (modifiable) maximal number of spans of
|
||||
//! approximation.
|
||||
Standard_Integer& GMaxSeg();
|
||||
|
||||
//! Sets flag for define if Plane converted to BSpline surface.
|
||||
Standard_Boolean& ConvertPlane();
|
||||
|
||||
//! Sets flag for define if Bezier surface converted to BSpline
|
||||
//! surface.
|
||||
Standard_Boolean& ConvertBezierSurf();
|
||||
|
||||
//! Sets flag for define if surface of Revolution converted to
|
||||
//! BSpline surface.
|
||||
Standard_Boolean& ConvertRevolutionSurf();
|
||||
|
||||
//! Sets flag for define if surface of LinearExtrusion converted
|
||||
//! to BSpline surface.
|
||||
Standard_Boolean& ConvertExtrusionSurf();
|
||||
|
||||
//! Sets flag for define if Offset surface converted to BSpline
|
||||
//! surface.
|
||||
Standard_Boolean& ConvertOffsetSurf();
|
||||
|
||||
//! Sets flag for define if cylindrical surface converted to BSpline
|
||||
//! surface.
|
||||
Standard_Boolean& ConvertCylindricalSurf();
|
||||
|
||||
//! Sets flag for define if conical surface converted to BSpline
|
||||
//! surface.
|
||||
Standard_Boolean& ConvertConicalSurf();
|
||||
|
||||
//! Sets flag for define if toroidal surface converted to BSpline
|
||||
//! surface.
|
||||
Standard_Boolean& ConvertToroidalSurf();
|
||||
|
||||
//! Sets flag for define if spherical surface converted to BSpline
|
||||
//! surface.
|
||||
Standard_Boolean& ConvertSphericalSurf();
|
||||
|
||||
//! Sets Segment mode for surface. If Segment is True surface is
|
||||
//! approximated in the bondaries of face lying on this surface.
|
||||
Standard_Boolean& SegmentSurfaceMode();
|
||||
|
||||
//! Sets flag for define if 3d curve converted to BSpline curve.
|
||||
Standard_Boolean& ConvertCurve3d();
|
||||
|
||||
//! Sets flag for define if Offset curve3d converted to BSpline
|
||||
//! surface.
|
||||
Standard_Boolean& ConvertOffsetCurv3d();
|
||||
|
||||
//! Returns (modifiable) flag for define if 2d curve converted
|
||||
//! to BSpline curve.
|
||||
Standard_Boolean& ConvertCurve2d();
|
||||
|
||||
//! Returns (modifiable) flag for define if Offset curve2d
|
||||
//! converted to BSpline surface.
|
||||
Standard_Boolean& ConvertOffsetCurv2d();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeCustom_RestrictionParameters,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Integer myGMaxDegree;
|
||||
Standard_Integer myGMaxSeg;
|
||||
Standard_Boolean myConvPlane;
|
||||
Standard_Boolean myConvConicalSurf;
|
||||
Standard_Boolean myConvSphericalSurf;
|
||||
Standard_Boolean myConvCylindricalSurf;
|
||||
Standard_Boolean myConvToroidalSurf;
|
||||
Standard_Boolean myConvBezierSurf;
|
||||
Standard_Boolean myConvRevolSurf;
|
||||
Standard_Boolean myConvExtrSurf;
|
||||
Standard_Boolean myConvOffsetSurf;
|
||||
Standard_Boolean mySegmentSurfaceMode;
|
||||
Standard_Boolean myConvCurve3d;
|
||||
Standard_Boolean myConvOffsetCurv3d;
|
||||
Standard_Boolean myConvCurve2d;
|
||||
Standard_Boolean myConvOffsetCurv2d;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <ShapeCustom_RestrictionParameters.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_RestrictionParameters_HeaderFile
|
@@ -1,67 +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 Surface from ShapeCustom
|
||||
|
||||
---Purpose: Converts a surface to the analitical form with given
|
||||
-- precision. Conversion is done only the surface is bspline
|
||||
-- of bezier and this can be approximed by some analytical
|
||||
-- surface with that precision.
|
||||
|
||||
uses
|
||||
Surface from Geom
|
||||
|
||||
is
|
||||
|
||||
Create returns Surface from ShapeCustom;
|
||||
|
||||
Create (S: Surface from Geom) returns Surface from ShapeCustom;
|
||||
|
||||
Init (me: in out; S: Surface from Geom);
|
||||
|
||||
Gap (me) returns Real;
|
||||
---C++: inline
|
||||
---Purpose: Returns maximal deviation of converted surface from the original
|
||||
-- one computed by last call to ConvertToAnalytical
|
||||
|
||||
ConvertToAnalytical (me: in out; tol: Real;
|
||||
substitute: Boolean)
|
||||
returns Surface from Geom;
|
||||
---Purpose: Tries to convert the Surface to an Analytic form
|
||||
-- Returns the result
|
||||
-- Works only if the Surface is BSpline or Bezier.
|
||||
-- Else, or in case of failure, returns a Null Handle
|
||||
--
|
||||
-- If <substitute> is True, the new surface replaces the actual
|
||||
-- one in <me>
|
||||
--
|
||||
-- It works by analysing the case which can apply, creating the
|
||||
-- corresponding analytic surface, then checking coincidence
|
||||
-- Warning: Parameter laws are not kept, hence PCurves should be redone
|
||||
|
||||
ConvertToPeriodic (me: in out; substitute: Boolean; preci: Real = -1)
|
||||
returns Surface from Geom;
|
||||
---Purpose: Tries to convert the Surface to the Periodic form
|
||||
-- Returns the resulting surface
|
||||
-- Works only if the Surface is BSpline and is closed with
|
||||
-- Precision::Confusion()
|
||||
-- Else, or in case of failure, returns a Null Handle
|
||||
fields
|
||||
|
||||
mySurf: Surface from Geom;
|
||||
myGap : Real; -- maximal deviation of converted surface from original one
|
||||
|
||||
end Surface;
|
@@ -13,41 +13,38 @@
|
||||
|
||||
//abv 06.01.99 fix of misprint
|
||||
//:p6 abv 26.02.99: make ConvertToPeriodic() return Null if nothing done
|
||||
#include <ShapeCustom_Surface.ixx>
|
||||
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
|
||||
#include <ElSLib.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <ShapeAnalysis_Geom.hxx>
|
||||
#include <ShapeAnalysis_Surface.hxx>
|
||||
#include <ShapeCustom_Surface.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeCustom_Surface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeCustom_Surface::ShapeCustom_Surface() : myGap (0)
|
||||
{
|
||||
}
|
||||
|
96
src/ShapeCustom/ShapeCustom_Surface.hxx
Normal file
96
src/ShapeCustom/ShapeCustom_Surface.hxx
Normal file
@@ -0,0 +1,96 @@
|
||||
// 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 _ShapeCustom_Surface_HeaderFile
|
||||
#define _ShapeCustom_Surface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Geom_Surface;
|
||||
|
||||
|
||||
//! Converts a surface to the analitical form with given
|
||||
//! precision. Conversion is done only the surface is bspline
|
||||
//! of bezier and this can be approximed by some analytical
|
||||
//! surface with that precision.
|
||||
class ShapeCustom_Surface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT ShapeCustom_Surface();
|
||||
|
||||
Standard_EXPORT ShapeCustom_Surface(const Handle(Geom_Surface)& S);
|
||||
|
||||
Standard_EXPORT void Init (const Handle(Geom_Surface)& S);
|
||||
|
||||
//! Returns maximal deviation of converted surface from the original
|
||||
//! one computed by last call to ConvertToAnalytical
|
||||
Standard_Real Gap() const;
|
||||
|
||||
//! Tries to convert the Surface to an Analytic form
|
||||
//! Returns the result
|
||||
//! Works only if the Surface is BSpline or Bezier.
|
||||
//! Else, or in case of failure, returns a Null Handle
|
||||
//!
|
||||
//! If <substitute> is True, the new surface replaces the actual
|
||||
//! one in <me>
|
||||
//!
|
||||
//! It works by analysing the case which can apply, creating the
|
||||
//! corresponding analytic surface, then checking coincidence
|
||||
//! Warning: Parameter laws are not kept, hence PCurves should be redone
|
||||
Standard_EXPORT Handle(Geom_Surface) ConvertToAnalytical (const Standard_Real tol, const Standard_Boolean substitute);
|
||||
|
||||
//! Tries to convert the Surface to the Periodic form
|
||||
//! Returns the resulting surface
|
||||
//! Works only if the Surface is BSpline and is closed with
|
||||
//! Precision::Confusion()
|
||||
//! Else, or in case of failure, returns a Null Handle
|
||||
Standard_EXPORT Handle(Geom_Surface) ConvertToPeriodic (const Standard_Boolean substitute, const Standard_Real preci = -1);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom_Surface) mySurf;
|
||||
Standard_Real myGap;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <ShapeCustom_Surface.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_Surface_HeaderFile
|
@@ -1,116 +0,0 @@
|
||||
-- Created on: 2003-12-10
|
||||
-- Created by: Sergey KUUL
|
||||
-- Copyright (c) 2003-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.
|
||||
|
||||
private class SweptToElementary from ShapeCustom inherits Modification from ShapeCustom
|
||||
|
||||
---Purpose: implements a modification for the BRepTools
|
||||
-- Modifier algortihm. Converts all elementary
|
||||
-- surfaces into surfaces of revolution.
|
||||
|
||||
uses
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Location from TopLoc,
|
||||
|
||||
Shape from GeomAbs,
|
||||
|
||||
Pnt from gp,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
Surface from Geom
|
||||
|
||||
is
|
||||
|
||||
Create returns SweptToElementary from ShapeCustom;
|
||||
|
||||
NewSurface(me: mutable; F : Face from TopoDS;
|
||||
S : out Surface from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard;
|
||||
RevWires : out Boolean from Standard;
|
||||
RevFace : out Boolean from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the face <F> has been
|
||||
-- modified. In this case, <S> is the new geometric
|
||||
-- support of the face, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <S>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewCurve(me: mutable; E : Edge from TopoDS;
|
||||
C : out Curve from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has been
|
||||
-- modified. In this case, <C> is the new geometric
|
||||
-- support of the edge, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <C>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewPoint(me: mutable; V : Vertex from TopoDS;
|
||||
P : out Pnt from gp;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the vertex <V> has been
|
||||
-- modified. In this case, <P> is the new geometric
|
||||
-- support of the vertex, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
NewCurve2d(me: mutable; E : Edge from TopoDS;
|
||||
F : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF : Face from TopoDS;
|
||||
C : out Curve from Geom2d;
|
||||
Tol : out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has a new
|
||||
-- curve on surface on the face <F>.In this case, <C>
|
||||
-- is the new geometric support of the edge, <L> the
|
||||
-- new location, <Tol> the new tolerance.
|
||||
--
|
||||
-- Otherwise, returns Standard_False, and <C>, <L>,
|
||||
-- <Tol> are not significant.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF>
|
||||
-- is the new face created from <F>. They may be usefull.
|
||||
|
||||
NewParameter(me: mutable; V : Vertex from TopoDS;
|
||||
E : Edge from TopoDS;
|
||||
P : out Real from Standard;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the Vertex <V> has a new
|
||||
-- parameter on the edge <E>. In this case, <P> is
|
||||
-- the parameter, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
Continuity(me: mutable; E : Edge from TopoDS;
|
||||
F1,F2 : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF1,NewF2: Face from TopoDS)
|
||||
returns Shape from GeomAbs;
|
||||
---Purpose: Returns the continuity of <NewE> between <NewF1>
|
||||
-- and <NewF2>.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF1>
|
||||
-- (resp. <NewF2>) is the new face created from <F1>
|
||||
-- (resp. <F2>).
|
||||
|
||||
end SweptToElementary;
|
@@ -11,48 +11,48 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeCustom_SweptToElementary.ixx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
|
||||
#include <Geom_SweptSurface.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <Geom_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfaceOfRevolution.hxx>
|
||||
#include <Adaptor3d_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
|
||||
#include <ShapeAnalysis_Surface.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfaceOfRevolution.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <Geom_SweptSurface.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <ShapeAnalysis_Surface.hxx>
|
||||
#include <ShapeCustom_SweptToElementary.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeCustom_SweptToElementary
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeCustom_SweptToElementary::ShapeCustom_SweptToElementary()
|
||||
{
|
||||
}
|
||||
|
123
src/ShapeCustom/ShapeCustom_SweptToElementary.hxx
Normal file
123
src/ShapeCustom/ShapeCustom_SweptToElementary.hxx
Normal file
@@ -0,0 +1,123 @@
|
||||
// Created on: 2003-12-10
|
||||
// Created by: Sergey KUUL
|
||||
// Copyright (c) 2003-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 _ShapeCustom_SweptToElementary_HeaderFile
|
||||
#define _ShapeCustom_SweptToElementary_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <ShapeCustom_Modification.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
class TopLoc_Location;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class Geom2d_Curve;
|
||||
|
||||
|
||||
class ShapeCustom_SweptToElementary;
|
||||
DEFINE_STANDARD_HANDLE(ShapeCustom_SweptToElementary, ShapeCustom_Modification)
|
||||
|
||||
//! implements a modification for the BRepTools
|
||||
//! Modifier algortihm. Converts all elementary
|
||||
//! surfaces into surfaces of revolution.
|
||||
class ShapeCustom_SweptToElementary : public ShapeCustom_Modification
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT ShapeCustom_SweptToElementary();
|
||||
|
||||
//! Returns Standard_True if the face <F> has been
|
||||
//! modified. In this case, <S> is the new geometric
|
||||
//! support of the face, <L> the new location, <Tol>
|
||||
//! the new tolerance. Otherwise, returns
|
||||
//! Standard_False, and <S>, <L>, <Tol> are not
|
||||
//! significant.
|
||||
Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S, TopLoc_Location& L, Standard_Real& Tol, Standard_Boolean& RevWires, Standard_Boolean& RevFace);
|
||||
|
||||
//! Returns Standard_True if the edge <E> has been
|
||||
//! modified. In this case, <C> is the new geometric
|
||||
//! support of the edge, <L> the new location, <Tol>
|
||||
//! the new tolerance. Otherwise, returns
|
||||
//! Standard_False, and <C>, <L>, <Tol> are not
|
||||
//! significant.
|
||||
Standard_EXPORT Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C, TopLoc_Location& L, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the vertex <V> has been
|
||||
//! modified. In this case, <P> is the new geometric
|
||||
//! support of the vertex, <Tol> the new tolerance.
|
||||
//! Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
//! are not significant.
|
||||
Standard_EXPORT Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the edge <E> has a new
|
||||
//! curve on surface on the face <F>.In this case, <C>
|
||||
//! is the new geometric support of the edge, <L> the
|
||||
//! new location, <Tol> the new tolerance.
|
||||
//!
|
||||
//! Otherwise, returns Standard_False, and <C>, <L>,
|
||||
//! <Tol> are not significant.
|
||||
//!
|
||||
//! <NewE> is the new edge created from <E>. <NewF>
|
||||
//! is the new face created from <F>. They may be usefull.
|
||||
Standard_EXPORT Standard_Boolean NewCurve2d (const TopoDS_Edge& E, const TopoDS_Face& F, const TopoDS_Edge& NewE, const TopoDS_Face& NewF, Handle(Geom2d_Curve)& C, Standard_Real& Tol);
|
||||
|
||||
//! Returns Standard_True if the Vertex <V> has a new
|
||||
//! parameter on the edge <E>. In this case, <P> is
|
||||
//! the parameter, <Tol> the new tolerance.
|
||||
//! Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
//! are not significant.
|
||||
Standard_EXPORT Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E, Standard_Real& P, Standard_Real& Tol);
|
||||
|
||||
//! Returns the continuity of <NewE> between <NewF1>
|
||||
//! and <NewF2>.
|
||||
//!
|
||||
//! <NewE> is the new edge created from <E>. <NewF1>
|
||||
//! (resp. <NewF2>) is the new face created from <F1>
|
||||
//! (resp. <F2>).
|
||||
Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2, const TopoDS_Edge& NewE, const TopoDS_Face& NewF1, const TopoDS_Face& NewF2);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeCustom_SweptToElementary,ShapeCustom_Modification)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_SweptToElementary_HeaderFile
|
@@ -1,91 +0,0 @@
|
||||
-- Created on: 1999-03-09
|
||||
-- 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.
|
||||
|
||||
private class TrsfModification from ShapeCustom inherits TrsfModification from BRepTools
|
||||
|
||||
---Purpose: Complements BRepTools_TrsfModification to provide reversible
|
||||
-- scaling regarding tolerances.
|
||||
-- Uses actual tolerances (attached to the shapes) not ones
|
||||
-- returned by BRep_Tool::Tolerance to work with tolerances
|
||||
-- lower than Precision::Confusion.
|
||||
|
||||
uses
|
||||
Face from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
Location from TopLoc,
|
||||
Shape from GeomAbs,
|
||||
|
||||
Surface from Geom,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
|
||||
Trsf from gp,
|
||||
Pnt from gp
|
||||
|
||||
is
|
||||
Create (T: Trsf from gp) returns TrsfModification from ShapeCustom;
|
||||
---Purpose: Empty constructor
|
||||
|
||||
NewSurface (me: mutable; F : Face from TopoDS;
|
||||
S : out Surface from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol : out Real from Standard;
|
||||
RevWires: out Boolean from Standard;
|
||||
RevFace : out Boolean from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Calls inherited method.
|
||||
-- Sets <Tol> as actual tolerance of <F> multiplied with scale
|
||||
-- factor.
|
||||
|
||||
NewCurve (me: mutable; E : Edge from TopoDS;
|
||||
C : out Curve from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Calls inherited method.
|
||||
-- Sets <Tol> as actual tolerance of <E> multiplied with scale
|
||||
-- factor.
|
||||
|
||||
NewPoint (me: mutable; V : Vertex from TopoDS;
|
||||
P : out Pnt from gp;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Calls inherited method.
|
||||
-- Sets <Tol> as actual tolerance of <V> multiplied with scale
|
||||
-- factor.
|
||||
|
||||
NewCurve2d (me: mutable; E : Edge from TopoDS;
|
||||
F : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF : Face from TopoDS;
|
||||
C : out Curve from Geom2d;
|
||||
Tol : out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Calls inherited method.
|
||||
-- Sets <Tol> as actual tolerance of <E> multiplied with scale
|
||||
-- factor.
|
||||
|
||||
NewParameter (me: mutable; V : Vertex from TopoDS;
|
||||
E : Edge from TopoDS;
|
||||
P : out Real from Standard;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Calls inherited method.
|
||||
-- Sets <Tol> as actual tolerance of <V> multiplied with scale
|
||||
-- factor.
|
||||
|
||||
end TrsfModification;
|
@@ -14,16 +14,26 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <ShapeCustom_TrsfModification.ixx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_TFace.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <ShapeCustom_TrsfModification.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeCustom_TrsfModification
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
ShapeCustom_TrsfModification::ShapeCustom_TrsfModification(const gp_Trsf& T):
|
||||
BRepTools_TrsfModification(T)
|
||||
{
|
||||
|
102
src/ShapeCustom/ShapeCustom_TrsfModification.hxx
Normal file
102
src/ShapeCustom/ShapeCustom_TrsfModification.hxx
Normal file
@@ -0,0 +1,102 @@
|
||||
// Created on: 1999-03-09
|
||||
// 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 _ShapeCustom_TrsfModification_HeaderFile
|
||||
#define _ShapeCustom_TrsfModification_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <BRepTools_TrsfModification.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class gp_Trsf;
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
class TopLoc_Location;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class Geom2d_Curve;
|
||||
|
||||
|
||||
class ShapeCustom_TrsfModification;
|
||||
DEFINE_STANDARD_HANDLE(ShapeCustom_TrsfModification, BRepTools_TrsfModification)
|
||||
|
||||
//! Complements BRepTools_TrsfModification to provide reversible
|
||||
//! scaling regarding tolerances.
|
||||
//! Uses actual tolerances (attached to the shapes) not ones
|
||||
//! returned by BRep_Tool::Tolerance to work with tolerances
|
||||
//! lower than Precision::Confusion.
|
||||
class ShapeCustom_TrsfModification : public BRepTools_TrsfModification
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT ShapeCustom_TrsfModification(const gp_Trsf& T);
|
||||
|
||||
//! Calls inherited method.
|
||||
//! Sets <Tol> as actual tolerance of <F> multiplied with scale
|
||||
//! factor.
|
||||
Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S, TopLoc_Location& L, Standard_Real& Tol, Standard_Boolean& RevWires, Standard_Boolean& RevFace);
|
||||
|
||||
//! Calls inherited method.
|
||||
//! Sets <Tol> as actual tolerance of <E> multiplied with scale
|
||||
//! factor.
|
||||
Standard_EXPORT Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C, TopLoc_Location& L, Standard_Real& Tol);
|
||||
|
||||
//! Calls inherited method.
|
||||
//! Sets <Tol> as actual tolerance of <V> multiplied with scale
|
||||
//! factor.
|
||||
Standard_EXPORT Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P, Standard_Real& Tol);
|
||||
|
||||
//! Calls inherited method.
|
||||
//! Sets <Tol> as actual tolerance of <E> multiplied with scale
|
||||
//! factor.
|
||||
Standard_EXPORT Standard_Boolean NewCurve2d (const TopoDS_Edge& E, const TopoDS_Face& F, const TopoDS_Edge& NewE, const TopoDS_Face& NewF, Handle(Geom2d_Curve)& C, Standard_Real& Tol);
|
||||
|
||||
//! Calls inherited method.
|
||||
//! Sets <Tol> as actual tolerance of <V> multiplied with scale
|
||||
//! factor.
|
||||
Standard_EXPORT Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E, Standard_Real& P, Standard_Real& Tol);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(ShapeCustom_TrsfModification,BRepTools_TrsfModification)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _ShapeCustom_TrsfModification_HeaderFile
|
Reference in New Issue
Block a user