mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0026252: GeomAdaptor_Surface should use inner adaptor to calculate values of complex surfaces
* Implement GeomEvaluator package * Inject evaluators to GeomAdaptor_Surface to calculate values of complex surfaces * Inject evaluators to Geom_Surface classes to calculate values for offset surfaces, surfaces of revolution and surfaces of extrusion * Move Adaptor3d_SurfaceOfLinearExtrusion and Adaptor3d_SurfaceOfRevolution to GeomAdaptor and unify calculation of their values and derivatives * Code optimizations * Update test cases Update of test-cases according to the new behavior
This commit is contained in:
@@ -13,6 +13,14 @@ GeomAdaptor_HCurve.lxx
|
||||
GeomAdaptor_HSurface.cxx
|
||||
GeomAdaptor_HSurface.hxx
|
||||
GeomAdaptor_HSurface.lxx
|
||||
GeomAdaptor_HSurfaceOfLinearExtrusion_0.cxx
|
||||
GeomAdaptor_HSurfaceOfLinearExtrusion.hxx
|
||||
GeomAdaptor_HSurfaceOfRevolution_0.cxx
|
||||
GeomAdaptor_HSurfaceOfRevolution.hxx
|
||||
GeomAdaptor_Surface.cxx
|
||||
GeomAdaptor_Surface.hxx
|
||||
GeomAdaptor_Surface.lxx
|
||||
GeomAdaptor_SurfaceOfLinearExtrusion.cxx
|
||||
GeomAdaptor_SurfaceOfLinearExtrusion.hxx
|
||||
GeomAdaptor_SurfaceOfRevolution.cxx
|
||||
GeomAdaptor_SurfaceOfRevolution.hxx
|
||||
|
93
src/GeomAdaptor/GeomAdaptor_HSurfaceOfLinearExtrusion.hxx
Normal file
93
src/GeomAdaptor/GeomAdaptor_HSurfaceOfLinearExtrusion.hxx
Normal file
@@ -0,0 +1,93 @@
|
||||
// Created on: 1992-10-08
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1992-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 _GeomAdaptor_HSurfaceOfLinearExtrusion_HeaderFile
|
||||
#define _GeomAdaptor_HSurfaceOfLinearExtrusion_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <GeomAdaptor_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class GeomAdaptor_SurfaceOfLinearExtrusion;
|
||||
class Adaptor3d_Surface;
|
||||
|
||||
|
||||
class GeomAdaptor_HSurfaceOfLinearExtrusion;
|
||||
DEFINE_STANDARD_HANDLE(GeomAdaptor_HSurfaceOfLinearExtrusion, Adaptor3d_HSurface)
|
||||
|
||||
|
||||
class GeomAdaptor_HSurfaceOfLinearExtrusion : public Adaptor3d_HSurface
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an empty GenHSurface.
|
||||
Standard_EXPORT GeomAdaptor_HSurfaceOfLinearExtrusion();
|
||||
|
||||
//! Creates a GenHSurface from a Surface.
|
||||
Standard_EXPORT GeomAdaptor_HSurfaceOfLinearExtrusion(const GeomAdaptor_SurfaceOfLinearExtrusion& S);
|
||||
|
||||
//! Sets the field of the GenHSurface.
|
||||
Standard_EXPORT void Set (const GeomAdaptor_SurfaceOfLinearExtrusion& S);
|
||||
|
||||
//! Returns a reference to the Surface inside the HSurface.
|
||||
//! This is redefined from HSurface, cannot be inline.
|
||||
Standard_EXPORT const Adaptor3d_Surface& Surface() const;
|
||||
|
||||
//! Returns the surface used to create the GenHSurface.
|
||||
GeomAdaptor_SurfaceOfLinearExtrusion& ChangeSurface();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(GeomAdaptor_HSurfaceOfLinearExtrusion,Adaptor3d_HSurface)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
GeomAdaptor_SurfaceOfLinearExtrusion mySurf;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheSurface GeomAdaptor_SurfaceOfLinearExtrusion
|
||||
#define TheSurface_hxx <GeomAdaptor_SurfaceOfLinearExtrusion.hxx>
|
||||
#define Adaptor3d_GenHSurface GeomAdaptor_HSurfaceOfLinearExtrusion
|
||||
#define Adaptor3d_GenHSurface_hxx <GeomAdaptor_HSurfaceOfLinearExtrusion.hxx>
|
||||
#define Handle_Adaptor3d_GenHSurface Handle(GeomAdaptor_HSurfaceOfLinearExtrusion)
|
||||
|
||||
#include <Adaptor3d_GenHSurface.lxx>
|
||||
|
||||
#undef TheSurface
|
||||
#undef TheSurface_hxx
|
||||
#undef Adaptor3d_GenHSurface
|
||||
#undef Adaptor3d_GenHSurface_hxx
|
||||
#undef Handle_Adaptor3d_GenHSurface
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAdaptor_HSurfaceOfLinearExtrusion_HeaderFile
|
35
src/GeomAdaptor/GeomAdaptor_HSurfaceOfLinearExtrusion_0.cxx
Normal file
35
src/GeomAdaptor/GeomAdaptor_HSurfaceOfLinearExtrusion_0.cxx
Normal file
@@ -0,0 +1,35 @@
|
||||
// Created on: 1992-10-08
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1992-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.
|
||||
|
||||
#include <GeomAdaptor_HSurfaceOfLinearExtrusion.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <GeomAdaptor_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
|
||||
|
||||
|
||||
#define TheSurface GeomAdaptor_SurfaceOfLinearExtrusion
|
||||
#define TheSurface_hxx <GeomAdaptor_SurfaceOfLinearExtrusion.hxx>
|
||||
#define Adaptor3d_GenHSurface GeomAdaptor_HSurfaceOfLinearExtrusion
|
||||
#define Adaptor3d_GenHSurface_hxx <GeomAdaptor_HSurfaceOfLinearExtrusion.hxx>
|
||||
#define Handle_Adaptor3d_GenHSurface Handle(GeomAdaptor_HSurfaceOfLinearExtrusion)
|
||||
#include <Adaptor3d_GenHSurface.gxx>
|
||||
|
93
src/GeomAdaptor/GeomAdaptor_HSurfaceOfRevolution.hxx
Normal file
93
src/GeomAdaptor/GeomAdaptor_HSurfaceOfRevolution.hxx
Normal file
@@ -0,0 +1,93 @@
|
||||
// Created on: 1992-10-08
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1992-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 _GeomAdaptor_HSurfaceOfRevolution_HeaderFile
|
||||
#define _GeomAdaptor_HSurfaceOfRevolution_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <GeomAdaptor_SurfaceOfRevolution.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class GeomAdaptor_SurfaceOfRevolution;
|
||||
class Adaptor3d_Surface;
|
||||
|
||||
|
||||
class GeomAdaptor_HSurfaceOfRevolution;
|
||||
DEFINE_STANDARD_HANDLE(GeomAdaptor_HSurfaceOfRevolution, Adaptor3d_HSurface)
|
||||
|
||||
|
||||
class GeomAdaptor_HSurfaceOfRevolution : public Adaptor3d_HSurface
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an empty GenHSurface.
|
||||
Standard_EXPORT GeomAdaptor_HSurfaceOfRevolution();
|
||||
|
||||
//! Creates a GenHSurface from a Surface.
|
||||
Standard_EXPORT GeomAdaptor_HSurfaceOfRevolution(const GeomAdaptor_SurfaceOfRevolution& S);
|
||||
|
||||
//! Sets the field of the GenHSurface.
|
||||
Standard_EXPORT void Set (const GeomAdaptor_SurfaceOfRevolution& S);
|
||||
|
||||
//! Returns a reference to the Surface inside the HSurface.
|
||||
//! This is redefined from HSurface, cannot be inline.
|
||||
Standard_EXPORT const Adaptor3d_Surface& Surface() const;
|
||||
|
||||
//! Returns the surface used to create the GenHSurface.
|
||||
GeomAdaptor_SurfaceOfRevolution& ChangeSurface();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(GeomAdaptor_HSurfaceOfRevolution,Adaptor3d_HSurface)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
GeomAdaptor_SurfaceOfRevolution mySurf;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheSurface GeomAdaptor_SurfaceOfRevolution
|
||||
#define TheSurface_hxx <GeomAdaptor_SurfaceOfRevolution.hxx>
|
||||
#define Adaptor3d_GenHSurface GeomAdaptor_HSurfaceOfRevolution
|
||||
#define Adaptor3d_GenHSurface_hxx <GeomAdaptor_HSurfaceOfRevolution.hxx>
|
||||
#define Handle_Adaptor3d_GenHSurface Handle(GeomAdaptor_HSurfaceOfRevolution)
|
||||
|
||||
#include <Adaptor3d_GenHSurface.lxx>
|
||||
|
||||
#undef TheSurface
|
||||
#undef TheSurface_hxx
|
||||
#undef Adaptor3d_GenHSurface
|
||||
#undef Adaptor3d_GenHSurface_hxx
|
||||
#undef Handle_Adaptor3d_GenHSurface
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAdaptor_HSurfaceOfRevolution_HeaderFile
|
35
src/GeomAdaptor/GeomAdaptor_HSurfaceOfRevolution_0.cxx
Normal file
35
src/GeomAdaptor/GeomAdaptor_HSurfaceOfRevolution_0.cxx
Normal file
@@ -0,0 +1,35 @@
|
||||
// Created on: 1992-10-08
|
||||
// Created by: Isabelle GRIGNON
|
||||
// Copyright (c) 1992-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.
|
||||
|
||||
#include <GeomAdaptor_HSurfaceOfRevolution.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <GeomAdaptor_SurfaceOfRevolution.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
|
||||
|
||||
|
||||
#define TheSurface GeomAdaptor_SurfaceOfRevolution
|
||||
#define TheSurface_hxx <GeomAdaptor_SurfaceOfRevolution.hxx>
|
||||
#define Adaptor3d_GenHSurface GeomAdaptor_HSurfaceOfRevolution
|
||||
#define Adaptor3d_GenHSurface_hxx <GeomAdaptor_HSurfaceOfRevolution.hxx>
|
||||
#define Handle_Adaptor3d_GenHSurface Handle(GeomAdaptor_HSurfaceOfRevolution)
|
||||
#include <Adaptor3d_GenHSurface.gxx>
|
||||
|
@@ -45,6 +45,9 @@
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomEvaluator_OffsetSurface.hxx>
|
||||
#include <GeomEvaluator_SurfaceOfExtrusion.hxx>
|
||||
#include <GeomEvaluator_SurfaceOfRevolution.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
@@ -67,12 +70,6 @@
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
|
||||
//#include <GeomConvert_BSplineSurfaceKnotSplitting.hxx>
|
||||
#define myBspl Handle(Geom_BSplineSurface)::DownCast (mySurface)
|
||||
#define myExtSurf Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)
|
||||
#define myRevSurf Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)
|
||||
#define myOffSurf Handle(Geom_OffsetSurface)::DownCast (mySurface)
|
||||
|
||||
//=======================================================================
|
||||
//function : LocalContinuity
|
||||
//purpose :
|
||||
@@ -138,7 +135,9 @@ void GeomAdaptor_Surface::load(const Handle(Geom_Surface)& S,
|
||||
|
||||
if ( mySurface != S) {
|
||||
mySurface = S;
|
||||
|
||||
mySurfaceCache = Handle(BSplSLib_Cache)();
|
||||
myNestedEvaluator = Handle(GeomEvaluator_Surface)();
|
||||
|
||||
const Handle(Standard_Type)& TheType = S->DynamicType();
|
||||
if ( TheType == STANDARD_TYPE(Geom_BezierSurface))
|
||||
mySurfaceType = GeomAbs_BezierSurface;
|
||||
@@ -156,21 +155,51 @@ void GeomAdaptor_Surface::load(const Handle(Geom_Surface)& S,
|
||||
mySurfaceType = GeomAbs_Sphere;
|
||||
else if ( TheType == STANDARD_TYPE(Geom_ToroidalSurface))
|
||||
mySurfaceType = GeomAbs_Torus;
|
||||
else if ( TheType == STANDARD_TYPE(Geom_SurfaceOfRevolution))
|
||||
else if (TheType == STANDARD_TYPE(Geom_SurfaceOfRevolution))
|
||||
{
|
||||
mySurfaceType = GeomAbs_SurfaceOfRevolution;
|
||||
else if ( TheType == STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))
|
||||
Handle(Geom_SurfaceOfRevolution) myRevSurf =
|
||||
Handle(Geom_SurfaceOfRevolution)::DownCast(mySurface);
|
||||
// Create nested adaptor for base curve
|
||||
Handle(Geom_Curve) aBaseCurve = myRevSurf->BasisCurve();
|
||||
Handle(GeomAdaptor_HCurve) aBaseAdaptor = new GeomAdaptor_HCurve(aBaseCurve);
|
||||
// Create corresponding evaluator
|
||||
myNestedEvaluator = new GeomEvaluator_SurfaceOfRevolution(
|
||||
Handle(Adaptor3d_HCurve)::DownCast(aBaseAdaptor),
|
||||
myRevSurf->Direction(), myRevSurf->Location());
|
||||
}
|
||||
else if (TheType == STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))
|
||||
{
|
||||
mySurfaceType = GeomAbs_SurfaceOfExtrusion;
|
||||
Handle(Geom_SurfaceOfLinearExtrusion) myExtSurf =
|
||||
Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(mySurface);
|
||||
// Create nested adaptor for base curve
|
||||
Handle(Geom_Curve) aBaseCurve = myExtSurf->BasisCurve();
|
||||
Handle(GeomAdaptor_HCurve) aBaseAdaptor = new GeomAdaptor_HCurve(aBaseCurve);
|
||||
// Create corresponding evaluator
|
||||
myNestedEvaluator = new GeomEvaluator_SurfaceOfExtrusion(
|
||||
Handle(Adaptor3d_HCurve)::DownCast(aBaseAdaptor), myExtSurf->Direction());
|
||||
}
|
||||
else if ( TheType == STANDARD_TYPE(Geom_BSplineSurface)) {
|
||||
mySurfaceType = GeomAbs_BSplineSurface;
|
||||
myBspl = Handle(Geom_BSplineSurface)::DownCast (mySurface);
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
// Create cache for B-spline
|
||||
mySurfaceCache = new BSplSLib_Cache(
|
||||
mySurfaceCache = new BSplSLib_Cache(
|
||||
myBspl->UDegree(), myBspl->IsUPeriodic(), myBspl->UKnotSequence(),
|
||||
myBspl->VDegree(), myBspl->IsVPeriodic(), myBspl->VKnotSequence(),
|
||||
myBspl->Poles(), myBspl->Weights());
|
||||
}
|
||||
else if ( TheType == STANDARD_TYPE(Geom_OffsetSurface))
|
||||
else if (TheType == STANDARD_TYPE(Geom_OffsetSurface))
|
||||
{
|
||||
mySurfaceType = GeomAbs_OffsetSurface;
|
||||
Handle(Geom_OffsetSurface) myOffSurf = Handle(Geom_OffsetSurface)::DownCast(mySurface);
|
||||
// Create nested adaptor for base surface
|
||||
Handle(Geom_Surface) aBaseSurf = myOffSurf->BasisSurface();
|
||||
Handle(GeomAdaptor_HSurface) aBaseAdaptor =
|
||||
new GeomAdaptor_HSurface(aBaseSurf, myUFirst, myULast, myVFirst, myVLast, myTolU, myTolV);
|
||||
myNestedEvaluator = new GeomEvaluator_OffsetSurface(
|
||||
aBaseAdaptor, myOffSurf->Offset(), myOffSurf->OsculatingSurface());
|
||||
}
|
||||
else
|
||||
mySurfaceType = GeomAbs_OtherSurface;
|
||||
}
|
||||
@@ -192,6 +221,7 @@ GeomAbs_Shape GeomAdaptor_Surface::UContinuity() const
|
||||
{
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
const Standard_Integer N = myBspl->NbUKnots();
|
||||
TColStd_Array1OfReal TK(1,N);
|
||||
TColStd_Array1OfInteger TM(1,N);
|
||||
@@ -217,8 +247,9 @@ GeomAbs_Shape GeomAdaptor_Surface::UContinuity() const
|
||||
}
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
{
|
||||
GeomAdaptor_Curve GC
|
||||
(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
|
||||
Handle(Geom_SurfaceOfLinearExtrusion) myExtSurf =
|
||||
Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(mySurface);
|
||||
GeomAdaptor_Curve GC(myExtSurf->BasisCurve(), myUFirst, myULast);
|
||||
return GC.Continuity();
|
||||
}
|
||||
case GeomAbs_OtherSurface:
|
||||
@@ -245,6 +276,7 @@ GeomAbs_Shape GeomAdaptor_Surface::VContinuity() const
|
||||
{
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
const Standard_Integer N = myBspl->NbVKnots();
|
||||
TColStd_Array1OfReal TK(1,N);
|
||||
TColStd_Array1OfInteger TM(1,N);
|
||||
@@ -270,8 +302,9 @@ GeomAbs_Shape GeomAdaptor_Surface::VContinuity() const
|
||||
}
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
{
|
||||
GeomAdaptor_Curve GC
|
||||
(Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myVFirst,myVLast);
|
||||
Handle(Geom_SurfaceOfRevolution) myRevSurf =
|
||||
Handle(Geom_SurfaceOfRevolution)::DownCast(mySurface);
|
||||
GeomAdaptor_Curve GC(myRevSurf->BasisCurve(), myVFirst, myVLast);
|
||||
return GC.Continuity();
|
||||
}
|
||||
case GeomAbs_OtherSurface:
|
||||
@@ -298,15 +331,17 @@ Standard_Integer GeomAdaptor_Surface::NbUIntervals(const GeomAbs_Shape S) const
|
||||
{
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
GeomAdaptor_Curve myBasisCurve
|
||||
(myBspl->VIso(myBspl->VKnot(myBspl->FirstVKnotIndex())),myUFirst,myULast);
|
||||
return myBasisCurve.NbIntervals(S);
|
||||
}
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
{
|
||||
GeomAdaptor_Curve myBasisCurve
|
||||
(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
|
||||
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
|
||||
Handle(Geom_SurfaceOfLinearExtrusion) myExtSurf =
|
||||
Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(mySurface);
|
||||
GeomAdaptor_Curve myBasisCurve(myExtSurf->BasisCurve(), myUFirst, myULast);
|
||||
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
|
||||
return myBasisCurve.NbIntervals(S);
|
||||
break;
|
||||
}
|
||||
@@ -323,7 +358,8 @@ Standard_Integer GeomAdaptor_Surface::NbUIntervals(const GeomAbs_Shape S) const
|
||||
case GeomAbs_C3:
|
||||
case GeomAbs_CN: break;
|
||||
}
|
||||
GeomAdaptor_Surface Sur(Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface());
|
||||
Handle(Geom_OffsetSurface) myOffSurf = Handle(Geom_OffsetSurface)::DownCast(mySurface);
|
||||
GeomAdaptor_Surface Sur(myOffSurf->BasisSurface());
|
||||
return Sur.NbUIntervals(BaseS);
|
||||
}
|
||||
case GeomAbs_Plane:
|
||||
@@ -349,19 +385,21 @@ Standard_Integer GeomAdaptor_Surface::NbVIntervals(const GeomAbs_Shape S) const
|
||||
{
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
GeomAdaptor_Curve myBasisCurve
|
||||
(myBspl->UIso(myBspl->UKnot(myBspl->FirstUKnotIndex())),myVFirst,myVLast);
|
||||
return myBasisCurve.NbIntervals(S);
|
||||
}
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
{
|
||||
GeomAdaptor_Curve myBasisCurve
|
||||
(Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myVFirst,myVLast);
|
||||
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
|
||||
Handle(Geom_SurfaceOfRevolution) myRevSurf =
|
||||
Handle(Geom_SurfaceOfRevolution)::DownCast(mySurface);
|
||||
GeomAdaptor_Curve myBasisCurve(myRevSurf->BasisCurve(), myVFirst, myVLast);
|
||||
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
|
||||
return myBasisCurve.NbIntervals(S);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_OffsetSurface:
|
||||
case GeomAbs_OffsetSurface:
|
||||
{
|
||||
GeomAbs_Shape BaseS = GeomAbs_CN;
|
||||
switch(S)
|
||||
@@ -374,9 +412,10 @@ Standard_Integer GeomAdaptor_Surface::NbVIntervals(const GeomAbs_Shape S) const
|
||||
case GeomAbs_C3:
|
||||
case GeomAbs_CN: break;
|
||||
}
|
||||
GeomAdaptor_Surface Sur(Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface());
|
||||
Handle(Geom_OffsetSurface) myOffSurf = Handle(Geom_OffsetSurface)::DownCast(mySurface);
|
||||
GeomAdaptor_Surface Sur(myOffSurf->BasisSurface());
|
||||
return Sur.NbVIntervals(BaseS);
|
||||
}
|
||||
}
|
||||
case GeomAbs_Plane:
|
||||
case GeomAbs_Cylinder:
|
||||
case GeomAbs_Cone:
|
||||
@@ -402,13 +441,14 @@ void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
|
||||
{
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
GeomAdaptor_Curve myBasisCurve
|
||||
(myBspl->VIso(myBspl->VKnot(myBspl->FirstVKnotIndex())),myUFirst,myULast);
|
||||
myNbUIntervals = myBasisCurve.NbIntervals(S);
|
||||
myBasisCurve.Intervals(T,S);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
{
|
||||
GeomAdaptor_Curve myBasisCurve
|
||||
(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
|
||||
@@ -419,7 +459,7 @@ void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GeomAbs_OffsetSurface:
|
||||
case GeomAbs_OffsetSurface:
|
||||
{
|
||||
GeomAbs_Shape BaseS = GeomAbs_CN;
|
||||
switch(S)
|
||||
@@ -432,7 +472,8 @@ void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
|
||||
case GeomAbs_C3:
|
||||
case GeomAbs_CN: break;
|
||||
}
|
||||
GeomAdaptor_Surface Sur(Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface());
|
||||
Handle(Geom_OffsetSurface) myOffSurf = Handle(Geom_OffsetSurface)::DownCast(mySurface);
|
||||
GeomAdaptor_Surface Sur(myOffSurf->BasisSurface());
|
||||
myNbUIntervals = Sur.NbUIntervals(BaseS);
|
||||
Sur.UIntervals(T, BaseS);
|
||||
}
|
||||
@@ -463,16 +504,18 @@ void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
|
||||
{
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
GeomAdaptor_Curve myBasisCurve
|
||||
(myBspl->UIso(myBspl->UKnot(myBspl->FirstUKnotIndex())),myVFirst,myVLast);
|
||||
myNbVIntervals = myBasisCurve.NbIntervals(S);
|
||||
myBasisCurve.Intervals(T,S);
|
||||
break;
|
||||
}
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
{
|
||||
GeomAdaptor_Curve myBasisCurve
|
||||
(Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myVFirst,myVLast);
|
||||
Handle(Geom_SurfaceOfRevolution) myRevSurf =
|
||||
Handle(Geom_SurfaceOfRevolution)::DownCast(mySurface);
|
||||
GeomAdaptor_Curve myBasisCurve(myRevSurf->BasisCurve(), myVFirst, myVLast);
|
||||
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
|
||||
{
|
||||
myNbVIntervals = myBasisCurve.NbIntervals(S);
|
||||
@@ -480,7 +523,7 @@ void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GeomAbs_OffsetSurface:
|
||||
case GeomAbs_OffsetSurface:
|
||||
{
|
||||
GeomAbs_Shape BaseS = GeomAbs_CN;
|
||||
switch(S)
|
||||
@@ -493,7 +536,8 @@ void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
|
||||
case GeomAbs_C3:
|
||||
case GeomAbs_CN: break;
|
||||
}
|
||||
GeomAdaptor_Surface Sur(Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface());
|
||||
Handle(Geom_OffsetSurface) myOffSurf = Handle(Geom_OffsetSurface)::DownCast(mySurface);
|
||||
GeomAdaptor_Surface Sur(myOffSurf->BasisSurface());
|
||||
myNbVIntervals = Sur.NbVIntervals(BaseS);
|
||||
Sur.VIntervals(T, BaseS);
|
||||
}
|
||||
@@ -624,7 +668,8 @@ Standard_Real GeomAdaptor_Surface::VPeriod() const
|
||||
void GeomAdaptor_Surface::RebuildCache(const Standard_Real theU,
|
||||
const Standard_Real theV) const
|
||||
{
|
||||
mySurfaceCache->BuildCache(theU, theV,
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
mySurfaceCache->BuildCache(theU, theV,
|
||||
myBspl->UDegree(), myBspl->IsUPeriodic(), myBspl->UKnotSequence(),
|
||||
myBspl->VDegree(), myBspl->IsVPeriodic(), myBspl->VKnotSequence(),
|
||||
myBspl->Poles(), myBspl->Weights());
|
||||
@@ -638,16 +683,9 @@ void GeomAdaptor_Surface::RebuildCache(const Standard_Real theU,
|
||||
gp_Pnt GeomAdaptor_Surface::Value(const Standard_Real U,
|
||||
const Standard_Real V) const
|
||||
{
|
||||
if (mySurfaceType == GeomAbs_BSplineSurface && !mySurfaceCache.IsNull())
|
||||
{
|
||||
if (!mySurfaceCache->IsCacheValid(U, V))
|
||||
RebuildCache(U, V);
|
||||
gp_Pnt P;
|
||||
mySurfaceCache->D0(U, V, P);
|
||||
return P;
|
||||
}
|
||||
|
||||
return mySurface->Value(U,V);
|
||||
gp_Pnt aValue;
|
||||
D0(U, V, aValue);
|
||||
return aValue;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -658,15 +696,30 @@ gp_Pnt GeomAdaptor_Surface::Value(const Standard_Real U,
|
||||
void GeomAdaptor_Surface::D0(const Standard_Real U,
|
||||
const Standard_Real V, gp_Pnt& P) const
|
||||
{
|
||||
if (mySurfaceType == GeomAbs_BSplineSurface && !mySurfaceCache.IsNull())
|
||||
switch (mySurfaceType)
|
||||
{
|
||||
if (!mySurfaceCache->IsCacheValid(U, V))
|
||||
RebuildCache(U, V);
|
||||
mySurfaceCache->D0(U, V, P);
|
||||
return;
|
||||
}
|
||||
case GeomAbs_BSplineSurface:
|
||||
if (!mySurfaceCache.IsNull())
|
||||
{
|
||||
if (!mySurfaceCache->IsCacheValid(U, V))
|
||||
RebuildCache(U, V);
|
||||
mySurfaceCache->D0(U, V, P);
|
||||
}
|
||||
else
|
||||
mySurface->D0(U, V, P);
|
||||
break;
|
||||
|
||||
mySurface->D0(U,V,P);
|
||||
case GeomAbs_OffsetSurface:
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
Standard_NoSuchObject_Raise_if(myNestedEvaluator.IsNull(),
|
||||
"GeomAdaptor_Surface::D0: evaluator is not initialized");
|
||||
myNestedEvaluator->D0(U, V, P);
|
||||
break;
|
||||
|
||||
default:
|
||||
mySurface->D0(U, V, P);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -689,8 +742,9 @@ void GeomAdaptor_Surface::D1(const Standard_Real U,
|
||||
else if (Abs(V-myVLast) <= myTolV) {VSide= -1; v = myVLast;}
|
||||
|
||||
switch(mySurfaceType) {
|
||||
case GeomAbs_BSplineSurface:
|
||||
if ((USide != 0 || VSide != 0) &&
|
||||
case GeomAbs_BSplineSurface: {
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
if ((USide != 0 || VSide != 0) &&
|
||||
IfUVBound(u, v, Ideb, Ifin, IVdeb, IVfin, USide, VSide))
|
||||
myBspl->LocalD1(u, v, Ideb, Ifin, IVdeb, IVfin, P, D1U, D1V);
|
||||
else if (!mySurfaceCache.IsNull())
|
||||
@@ -702,27 +756,16 @@ void GeomAdaptor_Surface::D1(const Standard_Real U,
|
||||
else
|
||||
myBspl->D1(u, v, P, D1U, D1V);
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
if (USide==0)
|
||||
myExtSurf->D1(u, v, P, D1U, D1V);
|
||||
else
|
||||
myExtSurf->LocalD1(u, v, USide, P, D1U, D1V);
|
||||
break;
|
||||
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
if (VSide==0)
|
||||
myRevSurf->D1(u, v, P, D1U, D1V);
|
||||
else
|
||||
myRevSurf->LocalD1(u, v, VSide, P, D1U, D1V);
|
||||
case GeomAbs_OffsetSurface:
|
||||
Standard_NoSuchObject_Raise_if(myNestedEvaluator.IsNull(),
|
||||
"GeomAdaptor_Surface::D1: evaluator is not initialized");
|
||||
myNestedEvaluator->D1(u, v, P, D1U, D1V);
|
||||
break;
|
||||
|
||||
case GeomAbs_OffsetSurface:
|
||||
if (USide==0 && VSide==0)
|
||||
myOffSurf->D1(u, v, P, D1U, D1V);
|
||||
else
|
||||
myOffSurf->LocalD1(u, v, USide, VSide, P, D1U, D1V);
|
||||
break;
|
||||
default:
|
||||
mySurface->D1(u, v, P, D1U, D1V);
|
||||
}
|
||||
@@ -750,9 +793,10 @@ void GeomAdaptor_Surface::D2(const Standard_Real U,
|
||||
else if (Abs(V-myVLast) <= myTolV) {VSide= -1; v = myVLast;}
|
||||
|
||||
switch(mySurfaceType) {
|
||||
case GeomAbs_BSplineSurface:
|
||||
if((USide != 0 || VSide != 0) &&
|
||||
IfUVBound(u, v, Ideb, Ifin, IVdeb, IVfin, USide, VSide))
|
||||
case GeomAbs_BSplineSurface: {
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
if ((USide != 0 || VSide != 0) &&
|
||||
IfUVBound(u, v, Ideb, Ifin, IVdeb, IVfin, USide, VSide))
|
||||
myBspl->LocalD2(u, v, Ideb, Ifin, IVdeb, IVfin, P, D1U, D1V, D2U, D2V, D2UV);
|
||||
else if (!mySurfaceCache.IsNull())
|
||||
{
|
||||
@@ -760,28 +804,19 @@ void GeomAdaptor_Surface::D2(const Standard_Real U,
|
||||
RebuildCache(U, V);
|
||||
mySurfaceCache->D2(U, V, P, D1U, D1V, D2U, D2V, D2UV);
|
||||
}
|
||||
else myBspl->D2(u,v,P,D1U,D1V,D2U,D2V,D2UV);
|
||||
break;
|
||||
|
||||
case GeomAbs_SurfaceOfExtrusion :
|
||||
|
||||
if(USide==0) myExtSurf->D2(u,v,P,D1U,D1V,D2U,D2V,D2UV);
|
||||
else myExtSurf->LocalD2(u,v,USide,P,D1U,D1V,D2U,D2V,D2UV);
|
||||
break;
|
||||
|
||||
case GeomAbs_SurfaceOfRevolution :
|
||||
|
||||
if(VSide==0) myRevSurf->D2 (u, v, P,D1U,D1V,D2U,D2V,D2UV );
|
||||
else myRevSurf->LocalD2 (u, v, VSide, P,D1U,D1V,D2U,D2V,D2UV );
|
||||
else myBspl->D2(u, v, P, D1U, D1V, D2U, D2V, D2UV);
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
case GeomAbs_OffsetSurface :
|
||||
{
|
||||
if((USide==0)&&(VSide==0)) myOffSurf->D2 (u, v,P,D1U,D1V,D2U,D2V,D2UV );
|
||||
else myOffSurf->LocalD2 (u, v, USide, VSide ,P,D1U,D1V,D2U,D2V,D2UV );
|
||||
break;
|
||||
}
|
||||
default : { mySurface->D2(u,v,P,D1U,D1V,D2U,D2V,D2UV);
|
||||
Standard_NoSuchObject_Raise_if(myNestedEvaluator.IsNull(),
|
||||
"GeomAdaptor_Surface::D2: evaluator is not initialized");
|
||||
myNestedEvaluator->D2(u, v, P, D1U, D1V, D2U, D2V, D2UV);
|
||||
break;
|
||||
|
||||
default: { mySurface->D2(u, v, P, D1U, D1V, D2U, D2V, D2UV);
|
||||
break;}
|
||||
}
|
||||
}
|
||||
@@ -806,43 +841,29 @@ void GeomAdaptor_Surface::D3(const Standard_Real U, const Standard_Real V,
|
||||
else if (Abs(V-myVLast) <= myTolV) {VSide= -1; v = myVLast;}
|
||||
|
||||
switch(mySurfaceType) {
|
||||
case GeomAbs_BSplineSurface:
|
||||
|
||||
if((USide==0)&&(VSide==0))
|
||||
myBspl->D3(u,v,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
|
||||
else {
|
||||
if(IfUVBound(u,v,Ideb,Ifin,IVdeb,IVfin,USide,VSide))
|
||||
myBspl-> LocalD3 (u, v, Ideb, Ifin,IVdeb ,IVfin ,
|
||||
P ,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
|
||||
else
|
||||
myBspl->D3(u,v,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
|
||||
}
|
||||
break;
|
||||
|
||||
case GeomAbs_SurfaceOfExtrusion :
|
||||
|
||||
if(USide==0) myExtSurf->D3(u,v,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
|
||||
else myExtSurf->LocalD3(u,v,USide,P,D1U,D1V,D2U,D2V,D2UV,
|
||||
D3U,D3V,D3UUV,D3UVV);
|
||||
break;
|
||||
|
||||
case GeomAbs_SurfaceOfRevolution :
|
||||
|
||||
if(VSide==0) myRevSurf->D3 (u, v, P ,D1U,D1V,D2U,D2V,D2UV,
|
||||
D3U,D3V,D3UUV,D3UVV);
|
||||
else myRevSurf->LocalD3 (u, v, VSide, P,D1U,D1V,D2U,D2V,D2UV,
|
||||
D3U,D3V,D3UUV,D3UVV );
|
||||
break;
|
||||
|
||||
case GeomAbs_OffsetSurface :
|
||||
{
|
||||
if((USide==0)&&(VSide==0)) myOffSurf->D3 (u, v,P ,D1U,D1V,D2U,D2V,D2UV,
|
||||
D3U,D3V,D3UUV,D3UVV);
|
||||
else myOffSurf->LocalD3 (u, v, USide, VSide ,P ,D1U,D1V,D2U,D2V,D2UV,
|
||||
D3U,D3V,D3UUV,D3UVV);
|
||||
break;
|
||||
case GeomAbs_BSplineSurface: {
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
if ((USide == 0) && (VSide == 0))
|
||||
myBspl->D3(u, v, P, D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV);
|
||||
else {
|
||||
if (IfUVBound(u, v, Ideb, Ifin, IVdeb, IVfin, USide, VSide))
|
||||
myBspl->LocalD3(u, v, Ideb, Ifin, IVdeb, IVfin,
|
||||
P, D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV);
|
||||
else
|
||||
myBspl->D3(u, v, P, D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV);
|
||||
}
|
||||
default : { mySurface->D3(u,v,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
case GeomAbs_OffsetSurface:
|
||||
Standard_NoSuchObject_Raise_if(myNestedEvaluator.IsNull(),
|
||||
"GeomAdaptor_Surface::D3: evaluator is not initialized");
|
||||
myNestedEvaluator->D3(u, v, P, D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV);
|
||||
break;
|
||||
|
||||
default : { mySurface->D3(u,v,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
|
||||
break;}
|
||||
}
|
||||
}
|
||||
@@ -866,30 +887,24 @@ gp_Vec GeomAdaptor_Surface::DN(const Standard_Real U,
|
||||
|
||||
switch(mySurfaceType)
|
||||
{
|
||||
case GeomAbs_BSplineSurface:
|
||||
|
||||
if((USide==0)&&(VSide==0)) return myBspl->DN(u,v,Nu,Nv);
|
||||
case GeomAbs_BSplineSurface: {
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
if ((USide == 0) && (VSide == 0))
|
||||
return myBspl->DN(u, v, Nu, Nv);
|
||||
else {
|
||||
if(IfUVBound(u,v,Ideb,Ifin,IVdeb,IVfin,USide,VSide))
|
||||
return myBspl->LocalDN (u, v, Ideb, Ifin,IVdeb ,IVfin ,Nu,Nv );
|
||||
if (IfUVBound(u, v, Ideb, Ifin, IVdeb, IVfin, USide, VSide))
|
||||
return myBspl->LocalDN(u, v, Ideb, Ifin, IVdeb, IVfin, Nu, Nv);
|
||||
else
|
||||
return myBspl->DN(u,v,Nu,Nv);
|
||||
return myBspl->DN(u, v, Nu, Nv);
|
||||
}
|
||||
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
|
||||
if(USide==0) return myExtSurf-> DN (u, v,Nu,Nv );
|
||||
else return myExtSurf->LocalDN (u, v, USide,Nu,Nv );
|
||||
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
}
|
||||
|
||||
if(VSide==0) return myRevSurf->DN (u, v, Nu, Nv );
|
||||
else return myRevSurf->LocalDN (u, v,VSide, Nu, Nv );
|
||||
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
case GeomAbs_OffsetSurface:
|
||||
|
||||
if((USide==0)&&(VSide==0)) return myOffSurf->DN (u, v, Nu, Nv );
|
||||
else return myOffSurf->LocalDN (u, v, USide, VSide, Nu, Nv );
|
||||
Standard_NoSuchObject_Raise_if(myNestedEvaluator.IsNull(),
|
||||
"GeomAdaptor_Surface::DN: evaluator is not initialized");
|
||||
return myNestedEvaluator->DN(u, v, Nu, Nv);
|
||||
|
||||
case GeomAbs_Plane:
|
||||
case GeomAbs_Cylinder:
|
||||
@@ -1370,7 +1385,8 @@ Standard_Boolean GeomAdaptor_Surface::IfUVBound(const Standard_Real U,
|
||||
const Standard_Integer VSide) const
|
||||
{
|
||||
Standard_Integer Ideb,Ifin;
|
||||
Standard_Integer anUFKIndx = myBspl->FirstUKnotIndex(),
|
||||
Handle(Geom_BSplineSurface) myBspl = Handle(Geom_BSplineSurface)::DownCast(mySurface);
|
||||
Standard_Integer anUFKIndx = myBspl->FirstUKnotIndex(),
|
||||
anULKIndx = myBspl->LastUKnotIndex(),
|
||||
aVFKIndx = myBspl->FirstVKnotIndex(), aVLKIndx = myBspl->LastVKnotIndex();
|
||||
myBspl->LocateU(U, PosTol, Ideb, Ifin, Standard_False);
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <GeomEvaluator_Surface.hxx>
|
||||
class Geom_Surface;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_OutOfRange;
|
||||
@@ -259,16 +260,17 @@ private:
|
||||
|
||||
|
||||
Handle(Geom_Surface) mySurface;
|
||||
GeomAbs_SurfaceType mySurfaceType;
|
||||
Standard_Real myUFirst;
|
||||
Standard_Real myULast;
|
||||
Standard_Real myVFirst;
|
||||
Standard_Real myVLast;
|
||||
Standard_Real myTolU;
|
||||
Standard_Real myTolV;
|
||||
Handle(BSplSLib_Cache) mySurfaceCache;
|
||||
|
||||
Handle(BSplSLib_Cache) mySurfaceCache; ///< Cached data for B-spline surface
|
||||
|
||||
protected:
|
||||
GeomAbs_SurfaceType mySurfaceType;
|
||||
Handle(GeomEvaluator_Surface) myNestedEvaluator; ///< Calculates values of nested complex surfaces (offset surface, surface of extrusion or revolution)
|
||||
};
|
||||
|
||||
|
||||
|
@@ -24,13 +24,13 @@
|
||||
//=======================================================================
|
||||
|
||||
inline GeomAdaptor_Surface::GeomAdaptor_Surface()
|
||||
: mySurfaceType(GeomAbs_OtherSurface),
|
||||
myUFirst(0.),
|
||||
: myUFirst(0.),
|
||||
myULast(0.),
|
||||
myVFirst(0.),
|
||||
myVLast (0.),
|
||||
myTolU(0.),
|
||||
myTolV(0.)
|
||||
myTolV(0.),
|
||||
mySurfaceType(GeomAbs_OtherSurface)
|
||||
{
|
||||
}
|
||||
|
||||
|
547
src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.cxx
Normal file
547
src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.cxx
Normal file
@@ -0,0 +1,547 @@
|
||||
// Created on: 1993-04-21
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAdaptor_SurfaceOfLinearExtrusion.hxx>
|
||||
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurfaceOfLinearExtrusion.hxx>
|
||||
#include <GeomEvaluator_SurfaceOfExtrusion.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAdaptor_SurfaceOfLinearExtrusion
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GeomAdaptor_SurfaceOfLinearExtrusion::GeomAdaptor_SurfaceOfLinearExtrusion()
|
||||
: myHaveDir(Standard_False)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAdaptor_SurfaceOfLinearExtrusion
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAdaptor_SurfaceOfLinearExtrusion::GeomAdaptor_SurfaceOfLinearExtrusion
|
||||
(const Handle(Adaptor3d_HCurve)& C)
|
||||
: myHaveDir(Standard_False)
|
||||
{
|
||||
Load(C);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAdaptor_SurfaceOfLinearExtrusion
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAdaptor_SurfaceOfLinearExtrusion::GeomAdaptor_SurfaceOfLinearExtrusion
|
||||
(const Handle(Adaptor3d_HCurve)& C,
|
||||
const gp_Dir& V)
|
||||
: myHaveDir(Standard_False)
|
||||
{
|
||||
Load(C);
|
||||
Load(V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomAdaptor_SurfaceOfLinearExtrusion::Load(const Handle(Adaptor3d_HCurve)& C)
|
||||
{
|
||||
myBasisCurve = C;
|
||||
if (myHaveDir)
|
||||
Load(myDirection);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomAdaptor_SurfaceOfLinearExtrusion::Load(const gp_Dir& V)
|
||||
{
|
||||
myHaveDir = Standard_True;
|
||||
myDirection = V;
|
||||
|
||||
mySurfaceType = GeomAbs_SurfaceOfExtrusion;
|
||||
myNestedEvaluator = new GeomEvaluator_SurfaceOfExtrusion(myBasisCurve, myDirection);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfLinearExtrusion::FirstUParameter() const
|
||||
{
|
||||
return myBasisCurve->FirstParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfLinearExtrusion::LastUParameter() const
|
||||
{
|
||||
return myBasisCurve->LastParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfLinearExtrusion::FirstVParameter() const
|
||||
{
|
||||
return RealFirst();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfLinearExtrusion::LastVParameter() const
|
||||
{
|
||||
return RealLast();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape GeomAdaptor_SurfaceOfLinearExtrusion::UContinuity() const
|
||||
{
|
||||
return myBasisCurve->Continuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape GeomAdaptor_SurfaceOfLinearExtrusion::VContinuity() const
|
||||
{
|
||||
return GeomAbs_CN;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer GeomAdaptor_SurfaceOfLinearExtrusion::NbUIntervals
|
||||
(const GeomAbs_Shape S) const
|
||||
{
|
||||
return myBasisCurve->NbIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer GeomAdaptor_SurfaceOfLinearExtrusion::NbVIntervals
|
||||
(const GeomAbs_Shape ) const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomAdaptor_SurfaceOfLinearExtrusion::UIntervals
|
||||
(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
|
||||
{
|
||||
myBasisCurve->Intervals(T,S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomAdaptor_SurfaceOfLinearExtrusion::VIntervals
|
||||
(TColStd_Array1OfReal& T, const GeomAbs_Shape ) const
|
||||
{
|
||||
T(T.Lower()) = FirstVParameter() ;
|
||||
T(T.Lower() + 1) = LastVParameter() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) GeomAdaptor_SurfaceOfLinearExtrusion::VTrim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
Handle(Adaptor3d_HCurve) HC = BasisCurve()->Trim(First,Last,Tol);
|
||||
Handle(GeomAdaptor_HSurfaceOfLinearExtrusion) HR = new GeomAdaptor_HSurfaceOfLinearExtrusion(
|
||||
GeomAdaptor_SurfaceOfLinearExtrusion(HC, myDirection));
|
||||
return HR;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) GeomAdaptor_SurfaceOfLinearExtrusion::UTrim
|
||||
(const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ) const
|
||||
{
|
||||
Handle(GeomAdaptor_HSurfaceOfLinearExtrusion) HR = new GeomAdaptor_HSurfaceOfLinearExtrusion(
|
||||
GeomAdaptor_SurfaceOfLinearExtrusion(myBasisCurve, myDirection));
|
||||
return HR;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsUClosed() const
|
||||
{
|
||||
return myBasisCurve->IsClosed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsVClosed() const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsUPeriodic() const
|
||||
{
|
||||
return myBasisCurve->IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfLinearExtrusion::UPeriod() const
|
||||
{
|
||||
return myBasisCurve->Period() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsVPeriodic() const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfLinearExtrusion::VPeriod() const
|
||||
{
|
||||
Standard_DomainError::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::VPeriod");
|
||||
return 0.0e0 ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfLinearExtrusion::UResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return myBasisCurve->Resolution(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfLinearExtrusion::VResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return R3d;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_SurfaceType GeomAdaptor_SurfaceOfLinearExtrusion::GetType() const
|
||||
{
|
||||
switch ( myBasisCurve->GetType()) {
|
||||
|
||||
case GeomAbs_Line:
|
||||
{
|
||||
gp_Dir D = myBasisCurve->Line().Direction();
|
||||
if (!myDirection.IsParallel( D, Precision::Angular()))
|
||||
return GeomAbs_Plane;
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_Circle:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Circle()).Axis().Direction();
|
||||
if ( myDirection.IsParallel( D, Precision::Angular()))
|
||||
return GeomAbs_Cylinder;
|
||||
else if (myDirection.IsNormal(D, Precision::Angular()))
|
||||
return GeomAbs_Plane;
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_Ellipse:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Ellipse()).Axis().Direction();
|
||||
if (myDirection.IsNormal(D, Precision::Angular()))
|
||||
return GeomAbs_Plane;
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_Parabola:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Parabola()).Axis().Direction();
|
||||
if (myDirection.IsNormal(D, Precision::Angular()))
|
||||
return GeomAbs_Plane;
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_Hyperbola:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Hyperbola()).Axis().Direction();
|
||||
if (myDirection.IsNormal(D, Precision::Angular()))
|
||||
return GeomAbs_Plane;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Plane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pln GeomAdaptor_SurfaceOfLinearExtrusion::Plane() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if (GetType() != GeomAbs_Plane,
|
||||
"GeomAdaptor_SurfaceOfLinearExtrusion::Plane");
|
||||
|
||||
gp_Pnt P;
|
||||
gp_Vec D1u, newZ;
|
||||
Standard_Real UFirst = myBasisCurve->FirstParameter();
|
||||
Standard_Real ULast = myBasisCurve->LastParameter();
|
||||
if (Precision::IsNegativeInfinite(UFirst) &&
|
||||
Precision::IsPositiveInfinite(ULast)) {
|
||||
UFirst = -100.;
|
||||
ULast = 100.;
|
||||
}
|
||||
else if (Precision::IsNegativeInfinite(UFirst)) {
|
||||
UFirst = ULast - 200.;
|
||||
}
|
||||
else if (Precision::IsPositiveInfinite(ULast)) {
|
||||
ULast = UFirst + 200.;
|
||||
}
|
||||
Standard_Real deltau = (ULast-UFirst)/20.;
|
||||
for (Standard_Integer i =1; i<=21; i++) {
|
||||
Standard_Real prm = UFirst + (i-1)*deltau;
|
||||
myBasisCurve->D1(prm,P,D1u);
|
||||
newZ = D1u.Normalized().Crossed(myDirection);
|
||||
if (newZ.Magnitude() > 1.e-12) break;
|
||||
}
|
||||
gp_Ax3 Ax3(P,gp_Dir(newZ),gp_Dir(D1u));
|
||||
if (myDirection.Dot(Ax3.YDirection())<0.){
|
||||
Ax3.YReverse();
|
||||
}
|
||||
return gp_Pln(Ax3);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Cylinder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cylinder GeomAdaptor_SurfaceOfLinearExtrusion::Cylinder() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Cylinder,
|
||||
"GeomAdaptor_SurfaceOfLinearExtrusion::Cylinder");
|
||||
|
||||
gp_Circ C = myBasisCurve->Circle() ;
|
||||
gp_Ax3 Ax3(C.Position());
|
||||
if(myDirection.Dot((C.Axis()).Direction())<0.){
|
||||
Ax3.ZReverse();
|
||||
}
|
||||
return gp_Cylinder(Ax3,C.Radius());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Cone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cone GeomAdaptor_SurfaceOfLinearExtrusion::Cone() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::Cone");
|
||||
return gp_Cone();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Sphere
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Sphere GeomAdaptor_SurfaceOfLinearExtrusion::Sphere() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::Sphere");
|
||||
return gp_Sphere();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Torus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Torus GeomAdaptor_SurfaceOfLinearExtrusion::Torus() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::Torus");
|
||||
return gp_Torus();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Axis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax1 GeomAdaptor_SurfaceOfLinearExtrusion::AxeOfRevolution() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::Axes");
|
||||
return gp_Ax1();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer GeomAdaptor_SurfaceOfLinearExtrusion::UDegree() const
|
||||
{
|
||||
return myBasisCurve->Degree();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbUPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer GeomAdaptor_SurfaceOfLinearExtrusion::NbUPoles() const
|
||||
{
|
||||
return myBasisCurve->NbPoles();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsURational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsURational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise
|
||||
("GeomAdaptor_SurfaceOfLinearExtrusion::IsURational");
|
||||
return Standard_False;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsVRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsVRational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise
|
||||
("GeomAdaptor_SurfaceOfLinearExtrusion::IsVRational");
|
||||
return Standard_False;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
Handle(Geom_BezierSurface) GeomAdaptor_SurfaceOfLinearExtrusion::Bezier() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::Bezier");
|
||||
return Handle(Geom_BezierSurface)() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BSplineSurface) GeomAdaptor_SurfaceOfLinearExtrusion::BSpline() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::BSpline");
|
||||
return Handle(Geom_BSplineSurface)() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Direction
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Dir GeomAdaptor_SurfaceOfLinearExtrusion::Direction() const
|
||||
{
|
||||
return myDirection;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BasisCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HCurve) GeomAdaptor_SurfaceOfLinearExtrusion::BasisCurve() const
|
||||
{
|
||||
return myBasisCurve;
|
||||
}
|
190
src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.hxx
Normal file
190
src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.hxx
Normal file
@@ -0,0 +1,190 @@
|
||||
// Created on: 1993-04-21
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _GeomAdaptor_SurfaceOfLinearExtrusion_HeaderFile
|
||||
#define _GeomAdaptor_SurfaceOfLinearExtrusion_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <gp_Dir.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
|
||||
class Adaptor3d_HCurve;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class gp_Dir;
|
||||
class Adaptor3d_HSurface;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
class gp_Pln;
|
||||
class gp_Cylinder;
|
||||
class gp_Cone;
|
||||
class gp_Sphere;
|
||||
class gp_Torus;
|
||||
class Geom_BezierSurface;
|
||||
class Geom_BSplineSurface;
|
||||
class gp_Ax1;
|
||||
|
||||
|
||||
//! Generalised cylinder. This surface is obtained by sweeping a curve in a given
|
||||
//! direction. The parametrization range for the parameter U is defined
|
||||
//! with referenced the curve.
|
||||
//! The parametrization range for the parameter V is ]-infinite,+infinite[
|
||||
//! The position of the curve gives the origin for the
|
||||
//! parameter V.
|
||||
//! The continuity of the surface is CN in the V direction.
|
||||
class GeomAdaptor_SurfaceOfLinearExtrusion : public GeomAdaptor_Surface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT GeomAdaptor_SurfaceOfLinearExtrusion();
|
||||
|
||||
//! The Curve is loaded.
|
||||
Standard_EXPORT GeomAdaptor_SurfaceOfLinearExtrusion(const Handle(Adaptor3d_HCurve)& C);
|
||||
|
||||
//! Thew Curve and the Direction are loaded.
|
||||
Standard_EXPORT GeomAdaptor_SurfaceOfLinearExtrusion(const Handle(Adaptor3d_HCurve)& C, const gp_Dir& V);
|
||||
|
||||
//! Changes the Curve
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_HCurve)& C);
|
||||
|
||||
//! Changes the Direction
|
||||
Standard_EXPORT void Load (const gp_Dir& V);
|
||||
|
||||
Standard_EXPORT Standard_Real FirstUParameter() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real LastUParameter() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real FirstVParameter() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real LastVParameter() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT GeomAbs_Shape UContinuity() const Standard_OVERRIDE;
|
||||
|
||||
//! Return CN.
|
||||
Standard_EXPORT GeomAbs_Shape VContinuity() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the number of U intervals for continuity
|
||||
//! <S>. May be one if UContinuity(me) >= <S>
|
||||
Standard_EXPORT Standard_Integer NbUIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the number of V intervals for continuity
|
||||
//! <S>. May be one if VContinuity(me) >= <S>
|
||||
Standard_EXPORT Standard_Integer NbVIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the intervals with the requested continuity
|
||||
//! in the U direction.
|
||||
Standard_EXPORT void UIntervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the intervals with the requested continuity
|
||||
//! in the V direction.
|
||||
Standard_EXPORT void VIntervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns a surface trimmed in the U direction
|
||||
//! equivalent of <me> between
|
||||
//! parameters <First> and <Last>. <Tol> is used to
|
||||
//! test for 3d points confusion.
|
||||
//! If <First> >= <Last>
|
||||
Standard_EXPORT Handle(Adaptor3d_HSurface) UTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns a surface trimmed in the V direction between
|
||||
//! parameters <First> and <Last>. <Tol> is used to
|
||||
//! test for 3d points confusion.
|
||||
//! If <First> >= <Last>
|
||||
Standard_EXPORT Handle(Adaptor3d_HSurface) VTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsUClosed() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real UPeriod() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real VPeriod() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the parametric U resolution corresponding
|
||||
//! to the real space resolution <R3d>.
|
||||
Standard_EXPORT Standard_Real UResolution (const Standard_Real R3d) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the parametric V resolution corresponding
|
||||
//! to the real space resolution <R3d>.
|
||||
Standard_EXPORT Standard_Real VResolution (const Standard_Real R3d) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the type of the surface : Plane, Cylinder,
|
||||
//! Cone, Sphere, Torus, BezierSurface,
|
||||
//! BSplineSurface, SurfaceOfRevolution,
|
||||
//! SurfaceOfExtrusion, OtherSurface
|
||||
Standard_EXPORT GeomAbs_SurfaceType GetType() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Pln Plane() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Cylinder Cylinder() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Cone Cone() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Sphere Sphere() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Torus Torus() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer UDegree() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbUPoles() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsURational() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsVRational() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Geom_BezierSurface) Bezier() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Geom_BSplineSurface) BSpline() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Ax1 AxeOfRevolution() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Dir Direction() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Adaptor3d_HCurve) BasisCurve() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
Handle(Adaptor3d_HCurve) myBasisCurve; ///< extruded curve
|
||||
gp_Dir myDirection; ///< direction of extrusion
|
||||
Standard_Boolean myHaveDir; ///< whether the direction of extrusion is initialized
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAdaptor_SurfaceOfLinearExtrusion_HeaderFile
|
675
src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx
Normal file
675
src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx
Normal file
@@ -0,0 +1,675 @@
|
||||
// Created on: 1993-04-21
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GeomAdaptor_SurfaceOfRevolution.hxx>
|
||||
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <GeomAdaptor_HSurfaceOfRevolution.hxx>
|
||||
#include <GeomEvaluator_SurfaceOfRevolution.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAdaptor_SurfaceOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GeomAdaptor_SurfaceOfRevolution::GeomAdaptor_SurfaceOfRevolution()
|
||||
: myHaveAxis(Standard_False)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAdaptor_SurfaceOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAdaptor_SurfaceOfRevolution::GeomAdaptor_SurfaceOfRevolution(
|
||||
const Handle(Adaptor3d_HCurve)& C)
|
||||
: myHaveAxis(Standard_False)
|
||||
{
|
||||
Load(C);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomAdaptor_SurfaceOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAdaptor_SurfaceOfRevolution::GeomAdaptor_SurfaceOfRevolution(
|
||||
const Handle(Adaptor3d_HCurve)& C,
|
||||
const gp_Ax1& V)
|
||||
: myHaveAxis(Standard_False)
|
||||
{
|
||||
Load(C);
|
||||
Load(V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomAdaptor_SurfaceOfRevolution::Load(const Handle(Adaptor3d_HCurve)& C)
|
||||
{
|
||||
myBasisCurve = C;
|
||||
if (myHaveAxis)
|
||||
Load(myAxis); // to evaluate the new myAxeRev.
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomAdaptor_SurfaceOfRevolution::Load(const gp_Ax1& V)
|
||||
{
|
||||
myHaveAxis = Standard_True;
|
||||
myAxis = V;
|
||||
|
||||
mySurfaceType = GeomAbs_SurfaceOfRevolution;
|
||||
myNestedEvaluator = new GeomEvaluator_SurfaceOfRevolution(myBasisCurve,
|
||||
myAxis.Direction(), myAxis.Location());
|
||||
|
||||
// Eval myAxeRev : axe of revolution ( Determination de Ox).
|
||||
gp_Pnt P,Q;
|
||||
gp_Pnt O = myAxis.Location();
|
||||
gp_Dir Ox;
|
||||
gp_Dir Oz = myAxis.Direction();
|
||||
Standard_Boolean yrev = Standard_False;
|
||||
if (myBasisCurve->GetType() == GeomAbs_Line) {
|
||||
if((myBasisCurve->Line().Direction()).Dot(Oz) < 0.){
|
||||
yrev = Standard_True;
|
||||
Oz.Reverse();
|
||||
}
|
||||
}
|
||||
|
||||
if (myBasisCurve->GetType() == GeomAbs_Circle) {
|
||||
Q = P = (myBasisCurve->Circle()).Location();
|
||||
}
|
||||
else {
|
||||
Standard_Real First = myBasisCurve->FirstParameter();
|
||||
P = Value( 0., 0.);// ce qui ne veut pas dire grand chose
|
||||
if ( GetType() == GeomAbs_Cone) {
|
||||
if ( gp_Lin(myAxis).Distance(P) <= Precision::Confusion())
|
||||
Q = ElCLib::Value(1.,myBasisCurve->Line());
|
||||
else
|
||||
Q = P;
|
||||
}
|
||||
else if (Precision::IsInfinite(First))
|
||||
Q = P;
|
||||
else
|
||||
Q = Value( 0., First);
|
||||
}
|
||||
|
||||
gp_Dir DZ = myAxis.Direction();
|
||||
O.SetXYZ( O.XYZ() + ( gp_Vec(O,P) * DZ) * DZ.XYZ());
|
||||
if ( gp_Lin(myAxis).Distance(Q) > Precision::Confusion()) {
|
||||
Ox = gp_Dir(Q.XYZ() - O.XYZ());
|
||||
}
|
||||
else {
|
||||
Standard_Real First = myBasisCurve->FirstParameter();
|
||||
Standard_Real Last = myBasisCurve->LastParameter();
|
||||
Standard_Integer Ratio = 1;
|
||||
Standard_Real Dist;
|
||||
gp_Pnt PP;
|
||||
do {
|
||||
PP = myBasisCurve->Value(First+(Last-First)/Ratio);
|
||||
Dist = gp_Lin(myAxis).Distance(PP);
|
||||
Ratio++;
|
||||
}
|
||||
while ( Dist < Precision::Confusion() && Ratio < 100);
|
||||
|
||||
if ( Ratio >= 100 ) {
|
||||
Standard_ConstructionError::Raise("Adaptor3d_SurfaceOfRevolution : Axe and meridian are confused");
|
||||
}
|
||||
Ox = ( (Oz^gp_Vec(PP.XYZ()-O.XYZ()))^Oz);
|
||||
}
|
||||
|
||||
myAxeRev = gp_Ax3(O,Oz,Ox);
|
||||
|
||||
if (yrev) {
|
||||
myAxeRev.YReverse();
|
||||
}
|
||||
else if (myBasisCurve->GetType() == GeomAbs_Circle) {
|
||||
gp_Dir DC = (myBasisCurve->Circle()).Axis().Direction();
|
||||
if ((Ox.Crossed(Oz)).Dot(DC) < 0.) myAxeRev.ZReverse();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AxeOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax1 GeomAdaptor_SurfaceOfRevolution::AxeOfRevolution() const
|
||||
{
|
||||
return myAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfRevolution::FirstUParameter() const
|
||||
{
|
||||
return 0.;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfRevolution::LastUParameter() const
|
||||
{
|
||||
return 2*M_PI;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfRevolution::FirstVParameter() const
|
||||
{
|
||||
return myBasisCurve->FirstParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfRevolution::LastVParameter() const
|
||||
{
|
||||
return myBasisCurve->LastParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape GeomAdaptor_SurfaceOfRevolution::UContinuity() const
|
||||
{
|
||||
return GeomAbs_CN;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape GeomAdaptor_SurfaceOfRevolution::VContinuity() const
|
||||
{
|
||||
return myBasisCurve->Continuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer GeomAdaptor_SurfaceOfRevolution::NbUIntervals(const GeomAbs_Shape ) const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer GeomAdaptor_SurfaceOfRevolution::NbVIntervals(const GeomAbs_Shape S) const
|
||||
{
|
||||
return myBasisCurve->NbIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomAdaptor_SurfaceOfRevolution::UIntervals(TColStd_Array1OfReal& T,
|
||||
const GeomAbs_Shape ) const
|
||||
{
|
||||
T(T.Lower() ) = 0.;
|
||||
T(T.Lower()+1) = 2*M_PI;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomAdaptor_SurfaceOfRevolution::VIntervals(TColStd_Array1OfReal& T,
|
||||
const GeomAbs_Shape S) const
|
||||
{
|
||||
myBasisCurve->Intervals(T,S);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) GeomAdaptor_SurfaceOfRevolution::UTrim
|
||||
(const Standard_Real
|
||||
#ifndef No_Exception
|
||||
First
|
||||
#endif
|
||||
,const Standard_Real
|
||||
#ifndef No_Exception
|
||||
Last
|
||||
#endif
|
||||
,const Standard_Real
|
||||
) const
|
||||
{
|
||||
#ifndef No_Exception
|
||||
Standard_Real Eps = Precision::PConfusion();
|
||||
#endif
|
||||
Standard_OutOfRange_Raise_if
|
||||
( Abs(First) > Eps || Abs(Last - 2.*M_PI) > Eps,
|
||||
"GeomAdaptor_SurfaceOfRevolution : UTrim : Parameters out of range");
|
||||
|
||||
Handle(GeomAdaptor_HSurfaceOfRevolution) HR = new GeomAdaptor_HSurfaceOfRevolution(
|
||||
GeomAdaptor_SurfaceOfRevolution(myBasisCurve, myAxis));
|
||||
return HR;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) GeomAdaptor_SurfaceOfRevolution::VTrim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
Handle(Adaptor3d_HCurve) HC = BasisCurve()->Trim(First,Last,Tol);
|
||||
Handle(GeomAdaptor_HSurfaceOfRevolution) HR = new GeomAdaptor_HSurfaceOfRevolution(
|
||||
GeomAdaptor_SurfaceOfRevolution(HC, myAxis));
|
||||
return HR;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsUClosed() const
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsVClosed() const
|
||||
{
|
||||
return myBasisCurve->IsClosed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsUPeriodic() const
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfRevolution::UPeriod() const
|
||||
{
|
||||
return 2*M_PI;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsVPeriodic() const
|
||||
{
|
||||
return myBasisCurve->IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfRevolution::VPeriod() const
|
||||
{
|
||||
return myBasisCurve->Period();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfRevolution::UResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return Precision::Parametric(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real GeomAdaptor_SurfaceOfRevolution::VResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return myBasisCurve->Resolution(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_SurfaceType GeomAdaptor_SurfaceOfRevolution::GetType() const
|
||||
{
|
||||
Standard_Real TolConf = Precision::Confusion();
|
||||
Standard_Real TolAng = Precision::Angular();
|
||||
|
||||
switch (myBasisCurve->GetType()) {
|
||||
case GeomAbs_Line: {
|
||||
gp_Ax1 Axe = myBasisCurve->Line().Position();
|
||||
|
||||
if (myAxis.IsParallel(Axe, TolAng))
|
||||
return GeomAbs_Cylinder;
|
||||
else if (myAxis.IsNormal(Axe, TolAng))
|
||||
return GeomAbs_Plane;
|
||||
else
|
||||
{
|
||||
Standard_Real uf = myBasisCurve->FirstParameter();
|
||||
Standard_Real ul = myBasisCurve->LastParameter();
|
||||
Standard_Boolean istrim = (!Precision::IsInfinite(uf) &&
|
||||
!Precision::IsInfinite(ul));
|
||||
if(istrim)
|
||||
{
|
||||
gp_Pnt pf = myBasisCurve->Value(uf);
|
||||
gp_Pnt pl = myBasisCurve->Value(ul);
|
||||
Standard_Real len = pf.Distance(pl);
|
||||
//on calcule la distance projetee sur l axe.
|
||||
gp_Vec vlin(pf,pl);
|
||||
gp_Vec vaxe(myAxis.Direction());
|
||||
Standard_Real projlen = Abs(vaxe.Dot(vlin));
|
||||
Standard_Real aTolConf = len*TolAng;
|
||||
if ((len - projlen) <= aTolConf)
|
||||
return GeomAbs_Cylinder;
|
||||
else if (projlen <= aTolConf)
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
gp_Vec V(myAxis.Location(), myBasisCurve->Line().Location());
|
||||
gp_Vec W(Axe.Direction());
|
||||
if (Abs(V.DotCross(myAxis.Direction(), W)) <= TolConf)
|
||||
return GeomAbs_Cone;
|
||||
}
|
||||
break;
|
||||
}//case GeomAbs_Line:
|
||||
//
|
||||
case GeomAbs_Circle: {
|
||||
Standard_Real MajorRadius, aR;
|
||||
gp_Lin aLin(myAxis);
|
||||
//
|
||||
gp_Circ C = myBasisCurve->Circle();
|
||||
const gp_Pnt& aLC = C.Location();
|
||||
aR=C.Radius();
|
||||
//
|
||||
|
||||
if (!C.Position().IsCoplanar(myAxis, TolConf, TolAng))
|
||||
return GeomAbs_SurfaceOfRevolution;
|
||||
else if(aLin.Distance(aLC) <= TolConf)
|
||||
return GeomAbs_Sphere;
|
||||
else
|
||||
{
|
||||
MajorRadius = aLin.Distance(aLC);
|
||||
if(MajorRadius > aR)
|
||||
{
|
||||
Standard_Real aT = 0., aDx, dX;
|
||||
gp_Pnt aPx;
|
||||
|
||||
aPx = ElCLib::Value(aT, C);
|
||||
aDx = aLin.Distance(aPx);
|
||||
dX = aDx - MajorRadius - aR;
|
||||
if (dX < 0.)
|
||||
dX = -dX;
|
||||
if (dX < TolConf)
|
||||
return GeomAbs_Torus;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
//
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return GeomAbs_SurfaceOfRevolution;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Plane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pln GeomAdaptor_SurfaceOfRevolution::Plane() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Plane, "GeomAdaptor_SurfaceOfRevolution:Plane");
|
||||
|
||||
gp_Ax3 Axe = myAxeRev;
|
||||
gp_Pnt aPonCurve = Value(0., 0.);
|
||||
Standard_Real aDot = (aPonCurve.XYZ() - myAxis.Location().XYZ()).Dot(myAxis.Direction().XYZ());
|
||||
|
||||
gp_Pnt P(myAxis.Location().XYZ() + aDot * myAxis.Direction().XYZ());
|
||||
Axe.SetLocation(P);
|
||||
if (Axe.XDirection().Dot(myBasisCurve->Line().Direction()) >= -Precision::Confusion())
|
||||
Axe.XReverse();
|
||||
|
||||
return gp_Pln( Axe);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Cylinder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cylinder GeomAdaptor_SurfaceOfRevolution::Cylinder() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Cylinder, "GeomAdaptor_SurfaceOfRevolution::Cylinder");
|
||||
|
||||
gp_Pnt P = Value(0., 0.);
|
||||
Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
|
||||
return gp_Cylinder(myAxeRev, R);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Cone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cone GeomAdaptor_SurfaceOfRevolution::Cone() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
( GetType() != GeomAbs_Cone, "GeomAdaptor_SurfaceOfRevolution:Cone");
|
||||
|
||||
gp_Ax3 Axe = myAxeRev;
|
||||
gp_Dir ldir = (myBasisCurve->Line()).Direction();
|
||||
Standard_Real Angle = (Axe.Direction()).Angle(ldir);
|
||||
gp_Pnt P0 = Value(0., 0.);
|
||||
Standard_Real R = (Axe.Location()).Distance(P0);
|
||||
if ( R >= Precision::Confusion()) {
|
||||
gp_Pnt O = Axe.Location();
|
||||
gp_Vec OP0(O,P0);
|
||||
Standard_Real t = OP0.Dot(Axe.XDirection());
|
||||
t /= ldir.Dot(Axe.XDirection());
|
||||
OP0.Add(-t * gp_Vec(ldir));
|
||||
if ( OP0.Dot(Axe.Direction()) > 0.) Angle = -Angle;
|
||||
}
|
||||
return gp_Cone( Axe, Angle, R);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Sphere
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Sphere GeomAdaptor_SurfaceOfRevolution::Sphere() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
( GetType() != GeomAbs_Sphere, "GeomAdaptor_SurfaceOfRevolution:Sphere");
|
||||
|
||||
gp_Circ C = myBasisCurve->Circle();
|
||||
gp_Ax3 Axe = myAxeRev;
|
||||
Axe.SetLocation(C.Location());
|
||||
return gp_Sphere(Axe, C.Radius());
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Torus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Torus GeomAdaptor_SurfaceOfRevolution::Torus() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Torus, "GeomAdaptor_SurfaceOfRevolution:Torus");
|
||||
|
||||
gp_Circ C = myBasisCurve->Circle();
|
||||
Standard_Real MajorRadius = gp_Lin(myAxis).Distance(C.Location());
|
||||
return gp_Torus(myAxeRev, MajorRadius, C.Radius());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer GeomAdaptor_SurfaceOfRevolution::VDegree() const
|
||||
{
|
||||
return myBasisCurve->Degree();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer GeomAdaptor_SurfaceOfRevolution::NbVPoles() const
|
||||
{
|
||||
return myBasisCurve->NbPoles();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer GeomAdaptor_SurfaceOfRevolution::NbVKnots() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfRevolution::NbVKnots");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsURational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsURational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfRevolution::IsURational");
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsVRational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfRevolution::IsVRational");
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BezierSurface) GeomAdaptor_SurfaceOfRevolution::Bezier() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfRevolution::Bezier");
|
||||
return Handle(Geom_BezierSurface)();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BSplineSurface) GeomAdaptor_SurfaceOfRevolution::BSpline() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfRevolution::BSpline");
|
||||
return Handle(Geom_BSplineSurface)();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Axis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const gp_Ax3& GeomAdaptor_SurfaceOfRevolution::Axis() const
|
||||
{
|
||||
return myAxeRev;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BasisCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HCurve) GeomAdaptor_SurfaceOfRevolution::BasisCurve() const
|
||||
{
|
||||
return myBasisCurve;
|
||||
}
|
206
src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.hxx
Normal file
206
src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.hxx
Normal file
@@ -0,0 +1,206 @@
|
||||
// Created on: 1993-04-21
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _GeomAdaptor_SurfaceOfRevolution_HeaderFile
|
||||
#define _GeomAdaptor_SurfaceOfRevolution_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
|
||||
class Adaptor3d_HCurve;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class gp_Ax1;
|
||||
class Adaptor3d_HSurface;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
class gp_Pln;
|
||||
class gp_Cylinder;
|
||||
class gp_Cone;
|
||||
class gp_Sphere;
|
||||
class gp_Torus;
|
||||
class Geom_BezierSurface;
|
||||
class Geom_BSplineSurface;
|
||||
class gp_Ax3;
|
||||
class gp_Dir;
|
||||
|
||||
|
||||
//! This class defines a complete surface of revolution.
|
||||
//! The surface is obtained by rotating a curve a complete revolution
|
||||
//! about an axis. The curve and the axis must be in the same plane.
|
||||
//! If the curve and the axis are not in the same plane it is always
|
||||
//! possible to be in the previous case after a cylindrical projection
|
||||
//! of the curve in a referenced plane.
|
||||
//! For a complete surface of revolution the parametric range is
|
||||
//! 0 <= U <= 2*PI. --
|
||||
//! The parametric range for V is defined with the revolved curve.
|
||||
//! The origin of the U parametrization is given by the position
|
||||
//! of the revolved curve (reference). The direction of the revolution
|
||||
//! axis defines the positive sense of rotation (trigonometric sense)
|
||||
//! corresponding to the increasing of the parametric value U.
|
||||
//! The derivatives are always defined for the u direction.
|
||||
//! For the v direction the definition of the derivatives depends on
|
||||
//! the degree of continuity of the referenced curve.
|
||||
class GeomAdaptor_SurfaceOfRevolution : public GeomAdaptor_Surface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT GeomAdaptor_SurfaceOfRevolution();
|
||||
|
||||
//! The Curve is loaded.
|
||||
Standard_EXPORT GeomAdaptor_SurfaceOfRevolution(const Handle(Adaptor3d_HCurve)& C);
|
||||
|
||||
//! The Curve and the Direction are loaded.
|
||||
Standard_EXPORT GeomAdaptor_SurfaceOfRevolution(const Handle(Adaptor3d_HCurve)& C, const gp_Ax1& V);
|
||||
|
||||
//! Changes the Curve
|
||||
Standard_EXPORT void Load (const Handle(Adaptor3d_HCurve)& C);
|
||||
|
||||
//! Changes the Direction
|
||||
Standard_EXPORT void Load (const gp_Ax1& V);
|
||||
|
||||
Standard_EXPORT gp_Ax1 AxeOfRevolution() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real FirstUParameter() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real LastUParameter() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real FirstVParameter() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real LastVParameter() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT GeomAbs_Shape UContinuity() const Standard_OVERRIDE;
|
||||
|
||||
//! Return CN.
|
||||
Standard_EXPORT GeomAbs_Shape VContinuity() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the number of U intervals for continuity
|
||||
//! <S>. May be one if UContinuity(me) >= <S>
|
||||
Standard_EXPORT Standard_Integer NbUIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the number of V intervals for continuity
|
||||
//! <S>. May be one if VContinuity(me) >= <S>
|
||||
Standard_EXPORT Standard_Integer NbVIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the intervals with the requested continuity
|
||||
//! in the U direction.
|
||||
Standard_EXPORT void UIntervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the intervals with the requested continuity
|
||||
//! in the V direction.
|
||||
Standard_EXPORT void VIntervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns a surface trimmed in the U direction
|
||||
//! equivalent of <me> between
|
||||
//! parameters <First> and <Last>. <Tol> is used to
|
||||
//! test for 3d points confusion.
|
||||
//! If <First> >= <Last>
|
||||
Standard_EXPORT Handle(Adaptor3d_HSurface) UTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns a surface trimmed in the V direction between
|
||||
//! parameters <First> and <Last>. <Tol> is used to
|
||||
//! test for 3d points confusion.
|
||||
//! If <First> >= <Last>
|
||||
Standard_EXPORT Handle(Adaptor3d_HSurface) VTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsUClosed() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real UPeriod() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Real VPeriod() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the parametric U resolution corresponding
|
||||
//! to the real space resolution <R3d>.
|
||||
Standard_EXPORT Standard_Real UResolution (const Standard_Real R3d) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the parametric V resolution corresponding
|
||||
//! to the real space resolution <R3d>.
|
||||
Standard_EXPORT Standard_Real VResolution (const Standard_Real R3d) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the type of the surface : Plane, Cylinder,
|
||||
//! Cone, Sphere, Torus, BezierSurface,
|
||||
//! BSplineSurface, SurfaceOfRevolution,
|
||||
//! SurfaceOfExtrusion, OtherSurface
|
||||
Standard_EXPORT GeomAbs_SurfaceType GetType() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Pln Plane() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Cylinder Cylinder() const Standard_OVERRIDE;
|
||||
|
||||
//! Apex of the Cone = Cone.Position().Location()
|
||||
//! ==> ReferenceRadius = 0.
|
||||
Standard_EXPORT gp_Cone Cone() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Sphere Sphere() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT gp_Torus Torus() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer VDegree() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbVPoles() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbVKnots() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsURational() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsVRational() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Geom_BezierSurface) Bezier() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Geom_BSplineSurface) BSpline() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT const gp_Ax3& Axis() const;
|
||||
|
||||
Standard_EXPORT Handle(Adaptor3d_HCurve) BasisCurve() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
Handle(Adaptor3d_HCurve) myBasisCurve; ///< revolved curve
|
||||
gp_Ax1 myAxis; ///< axis of revolution
|
||||
Standard_Boolean myHaveAxis; ///< whether axis of revolution is initialized
|
||||
gp_Ax3 myAxeRev; ///< auxiliary trihedron according to the curve position
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomAdaptor_SurfaceOfRevolution_HeaderFile
|
Reference in New Issue
Block a user