mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +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:
@@ -1,93 +0,0 @@
|
||||
// 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 _Adaptor3d_HSurfaceOfLinearExtrusion_HeaderFile
|
||||
#define _Adaptor3d_HSurfaceOfLinearExtrusion_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class Adaptor3d_SurfaceOfLinearExtrusion;
|
||||
class Adaptor3d_Surface;
|
||||
|
||||
|
||||
class Adaptor3d_HSurfaceOfLinearExtrusion;
|
||||
DEFINE_STANDARD_HANDLE(Adaptor3d_HSurfaceOfLinearExtrusion, Adaptor3d_HSurface)
|
||||
|
||||
|
||||
class Adaptor3d_HSurfaceOfLinearExtrusion : public Adaptor3d_HSurface
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an empty GenHSurface.
|
||||
Standard_EXPORT Adaptor3d_HSurfaceOfLinearExtrusion();
|
||||
|
||||
//! Creates a GenHSurface from a Surface.
|
||||
Standard_EXPORT Adaptor3d_HSurfaceOfLinearExtrusion(const Adaptor3d_SurfaceOfLinearExtrusion& S);
|
||||
|
||||
//! Sets the field of the GenHSurface.
|
||||
Standard_EXPORT void Set (const Adaptor3d_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.
|
||||
Adaptor3d_SurfaceOfLinearExtrusion& ChangeSurface();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Adaptor3d_HSurfaceOfLinearExtrusion,Adaptor3d_HSurface)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Adaptor3d_SurfaceOfLinearExtrusion mySurf;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheSurface Adaptor3d_SurfaceOfLinearExtrusion
|
||||
#define TheSurface_hxx <Adaptor3d_SurfaceOfLinearExtrusion.hxx>
|
||||
#define Adaptor3d_GenHSurface Adaptor3d_HSurfaceOfLinearExtrusion
|
||||
#define Adaptor3d_GenHSurface_hxx <Adaptor3d_HSurfaceOfLinearExtrusion.hxx>
|
||||
#define Handle_Adaptor3d_GenHSurface Handle(Adaptor3d_HSurfaceOfLinearExtrusion)
|
||||
|
||||
#include <Adaptor3d_GenHSurface.lxx>
|
||||
|
||||
#undef TheSurface
|
||||
#undef TheSurface_hxx
|
||||
#undef Adaptor3d_GenHSurface
|
||||
#undef Adaptor3d_GenHSurface_hxx
|
||||
#undef Handle_Adaptor3d_GenHSurface
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Adaptor3d_HSurfaceOfLinearExtrusion_HeaderFile
|
@@ -1,42 +0,0 @@
|
||||
// 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 <Adaptor3d_HSurfaceOfLinearExtrusion.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Adaptor3d_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheSurface Adaptor3d_SurfaceOfLinearExtrusion
|
||||
#define TheSurface_hxx <Adaptor3d_SurfaceOfLinearExtrusion.hxx>
|
||||
#define Adaptor3d_GenHSurface Adaptor3d_HSurfaceOfLinearExtrusion
|
||||
#define Adaptor3d_GenHSurface_hxx <Adaptor3d_HSurfaceOfLinearExtrusion.hxx>
|
||||
#define Handle_Adaptor3d_GenHSurface Handle(Adaptor3d_HSurfaceOfLinearExtrusion)
|
||||
#include <Adaptor3d_GenHSurface.gxx>
|
||||
|
@@ -1,93 +0,0 @@
|
||||
// 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 _Adaptor3d_HSurfaceOfRevolution_HeaderFile
|
||||
#define _Adaptor3d_HSurfaceOfRevolution_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Adaptor3d_SurfaceOfRevolution.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_DomainError;
|
||||
class Adaptor3d_SurfaceOfRevolution;
|
||||
class Adaptor3d_Surface;
|
||||
|
||||
|
||||
class Adaptor3d_HSurfaceOfRevolution;
|
||||
DEFINE_STANDARD_HANDLE(Adaptor3d_HSurfaceOfRevolution, Adaptor3d_HSurface)
|
||||
|
||||
|
||||
class Adaptor3d_HSurfaceOfRevolution : public Adaptor3d_HSurface
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an empty GenHSurface.
|
||||
Standard_EXPORT Adaptor3d_HSurfaceOfRevolution();
|
||||
|
||||
//! Creates a GenHSurface from a Surface.
|
||||
Standard_EXPORT Adaptor3d_HSurfaceOfRevolution(const Adaptor3d_SurfaceOfRevolution& S);
|
||||
|
||||
//! Sets the field of the GenHSurface.
|
||||
Standard_EXPORT void Set (const Adaptor3d_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.
|
||||
Adaptor3d_SurfaceOfRevolution& ChangeSurface();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Adaptor3d_HSurfaceOfRevolution,Adaptor3d_HSurface)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Adaptor3d_SurfaceOfRevolution mySurf;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheSurface Adaptor3d_SurfaceOfRevolution
|
||||
#define TheSurface_hxx <Adaptor3d_SurfaceOfRevolution.hxx>
|
||||
#define Adaptor3d_GenHSurface Adaptor3d_HSurfaceOfRevolution
|
||||
#define Adaptor3d_GenHSurface_hxx <Adaptor3d_HSurfaceOfRevolution.hxx>
|
||||
#define Handle_Adaptor3d_GenHSurface Handle(Adaptor3d_HSurfaceOfRevolution)
|
||||
|
||||
#include <Adaptor3d_GenHSurface.lxx>
|
||||
|
||||
#undef TheSurface
|
||||
#undef TheSurface_hxx
|
||||
#undef Adaptor3d_GenHSurface
|
||||
#undef Adaptor3d_GenHSurface_hxx
|
||||
#undef Handle_Adaptor3d_GenHSurface
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Adaptor3d_HSurfaceOfRevolution_HeaderFile
|
@@ -1,42 +0,0 @@
|
||||
// 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 <Adaptor3d_HSurfaceOfRevolution.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Adaptor3d_SurfaceOfRevolution.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheSurface Adaptor3d_SurfaceOfRevolution
|
||||
#define TheSurface_hxx <Adaptor3d_SurfaceOfRevolution.hxx>
|
||||
#define Adaptor3d_GenHSurface Adaptor3d_HSurfaceOfRevolution
|
||||
#define Adaptor3d_GenHSurface_hxx <Adaptor3d_HSurfaceOfRevolution.hxx>
|
||||
#define Handle_Adaptor3d_GenHSurface Handle(Adaptor3d_HSurfaceOfRevolution)
|
||||
#include <Adaptor3d_GenHSurface.gxx>
|
||||
|
@@ -15,7 +15,6 @@
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HIsoCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_HSurfaceOfRevolution.hxx>
|
||||
#include <Adaptor3d_IsoCurve.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
#include <BSplSLib.hxx>
|
||||
|
@@ -1,740 +0,0 @@
|
||||
// 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 <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_HSurfaceOfLinearExtrusion.hxx>
|
||||
#include <Adaptor3d_SurfaceOfLinearExtrusion.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfLinearExtrusion
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Adaptor3d_SurfaceOfLinearExtrusion::Adaptor3d_SurfaceOfLinearExtrusion()
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfLinearExtrusion
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfaceOfLinearExtrusion::Adaptor3d_SurfaceOfLinearExtrusion
|
||||
(const Handle(Adaptor3d_HCurve)& C)
|
||||
{
|
||||
Load( C);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfLinearExtrusion
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfaceOfLinearExtrusion::Adaptor3d_SurfaceOfLinearExtrusion
|
||||
(const Handle(Adaptor3d_HCurve)& C,
|
||||
const gp_Dir& V)
|
||||
{
|
||||
Load( C);
|
||||
Load( V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::Load( const Handle(Adaptor3d_HCurve)& C)
|
||||
{
|
||||
myBasisCurve = C;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::Load( const gp_Dir& V)
|
||||
{
|
||||
myDirection = V;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::FirstUParameter() const
|
||||
{
|
||||
return myBasisCurve->FirstParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::LastUParameter() const
|
||||
{
|
||||
return myBasisCurve->LastParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::FirstVParameter() const
|
||||
{
|
||||
return RealFirst();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::LastVParameter() const
|
||||
{
|
||||
return RealLast();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_SurfaceOfLinearExtrusion::UContinuity() const
|
||||
{
|
||||
return myBasisCurve->Continuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_SurfaceOfLinearExtrusion::VContinuity() const
|
||||
{
|
||||
return GeomAbs_CN;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbUIntervals
|
||||
(const GeomAbs_Shape S) const
|
||||
{
|
||||
return myBasisCurve->NbIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbVIntervals
|
||||
(const GeomAbs_Shape ) const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::UIntervals
|
||||
(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
|
||||
{
|
||||
myBasisCurve->Intervals(T,S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::VIntervals
|
||||
//(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
|
||||
(TColStd_Array1OfReal& T, const GeomAbs_Shape ) const
|
||||
{
|
||||
T(T.Lower()) = FirstVParameter() ;
|
||||
T(T.Lower() + 1) = LastVParameter() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_SurfaceOfLinearExtrusion::VTrim
|
||||
(const Standard_Real First ,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
Handle(Adaptor3d_HCurve) newBasisCurve =
|
||||
myBasisCurve->Trim(First, Last, Tol);
|
||||
|
||||
Adaptor3d_SurfaceOfLinearExtrusion * SurfacePtr =
|
||||
new Adaptor3d_SurfaceOfLinearExtrusion(newBasisCurve, myDirection) ;
|
||||
|
||||
return new Adaptor3d_HSurfaceOfLinearExtrusion(*SurfacePtr);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_SurfaceOfLinearExtrusion::UTrim
|
||||
//(const Standard_Real First ,
|
||||
// const Standard_Real Last,
|
||||
// const Standard_Real Tol) const
|
||||
(const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ) const
|
||||
{
|
||||
Adaptor3d_SurfaceOfLinearExtrusion * SurfacePtr =
|
||||
new Adaptor3d_SurfaceOfLinearExtrusion(myBasisCurve,myDirection);
|
||||
|
||||
return new Adaptor3d_HSurfaceOfLinearExtrusion(*SurfacePtr) ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsUClosed() const
|
||||
{
|
||||
return myBasisCurve->IsClosed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsVClosed() const
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsUPeriodic() const
|
||||
{
|
||||
return myBasisCurve->IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::UPeriod() const
|
||||
{
|
||||
return myBasisCurve->Period() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsVPeriodic() const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::VPeriod() const
|
||||
{
|
||||
Standard_DomainError::Raise("Adaptor3d_SurfaceOfLinearExtrusion::VPeriod");
|
||||
return 0.0e0 ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt Adaptor3d_SurfaceOfLinearExtrusion::Value(const Standard_Real U,
|
||||
const Standard_Real V)
|
||||
const
|
||||
{
|
||||
gp_Pnt P;
|
||||
P = myBasisCurve->Value(U);
|
||||
P.Translate( V * gp_Vec(myDirection));
|
||||
return P;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::D0(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P) const
|
||||
{
|
||||
myBasisCurve->D0(U,P);
|
||||
P.Translate( V * gp_Vec(myDirection));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::D1(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U,
|
||||
gp_Vec& D1V) const
|
||||
{
|
||||
myBasisCurve->D1(U,P,D1U);
|
||||
D0(U,V,P);
|
||||
D1V = gp_Vec(myDirection);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::D2(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U, gp_Vec& D1V,
|
||||
gp_Vec& D2U, gp_Vec& D2V,
|
||||
gp_Vec& D2UV) const
|
||||
{
|
||||
myBasisCurve->D2(U,P,D1U,D2U);
|
||||
D1V = gp_Vec(myDirection);
|
||||
D2V.SetCoord( 0., 0., 0.);
|
||||
D2UV.SetCoord( 0., 0., 0.);
|
||||
D0(U,V,P);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfLinearExtrusion::D3(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& D1U, gp_Vec& D1V,
|
||||
gp_Vec& D2U, gp_Vec& D2V,
|
||||
gp_Vec& D2UV,
|
||||
gp_Vec& D3U, gp_Vec& D3V,
|
||||
gp_Vec& D3UUV, gp_Vec& D3UVV) const
|
||||
{
|
||||
myBasisCurve->D3(U,P,D1U,D2U,D3U);
|
||||
D1V = gp_Vec(myDirection);
|
||||
D2V.SetCoord( 0., 0., 0.);
|
||||
D2UV.SetCoord( 0., 0., 0.);
|
||||
D3V.SetCoord( 0., 0., 0.);
|
||||
D3UUV.SetCoord( 0., 0., 0.);
|
||||
D3UVV.SetCoord( 0., 0., 0.);
|
||||
D0(U,V,P);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Vec Adaptor3d_SurfaceOfLinearExtrusion::DN
|
||||
(const Standard_Real U,
|
||||
// const Standard_Real V,
|
||||
const Standard_Real ,
|
||||
const Standard_Integer NU,
|
||||
const Standard_Integer NV) const
|
||||
{
|
||||
if ( (NU+NV)<1 || NU<0 || NV<0) {
|
||||
Standard_DomainError::Raise("Adaptor3d_SurfaceOfLinearExtrusion::DN");
|
||||
return gp_Vec();
|
||||
}
|
||||
else {
|
||||
if (NU == 0 && NV ==1) return gp_Vec( myDirection);
|
||||
else if (NV == 0) return myBasisCurve->DN(U,NU);
|
||||
else return gp_Vec( 0., 0., 0.);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::UResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return myBasisCurve->Resolution(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfLinearExtrusion::VResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return R3d;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_SurfaceType Adaptor3d_SurfaceOfLinearExtrusion::GetType() const
|
||||
{
|
||||
switch ( myBasisCurve->GetType()) {
|
||||
|
||||
case GeomAbs_Line:
|
||||
{
|
||||
gp_Dir D = myBasisCurve->Line().Direction();
|
||||
if (myDirection.IsParallel( D, Precision::Angular())) {
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
}
|
||||
|
||||
case GeomAbs_Circle:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Circle()).Axis().Direction();
|
||||
if ( myDirection.IsParallel( D, Precision::Angular())) {
|
||||
return GeomAbs_Cylinder;
|
||||
}
|
||||
// JAG 10.11.95
|
||||
else if (myDirection.IsNormal(D, Precision::Angular())) {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
}
|
||||
// JAG 10.11.95
|
||||
|
||||
case GeomAbs_Ellipse:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Ellipse()).Axis().Direction();
|
||||
if (myDirection.IsNormal(D, Precision::Angular())) {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
}
|
||||
|
||||
case GeomAbs_Parabola:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Parabola()).Axis().Direction();
|
||||
if (myDirection.IsNormal(D, Precision::Angular())) {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
}
|
||||
|
||||
case GeomAbs_Hyperbola:
|
||||
{
|
||||
gp_Dir D = (myBasisCurve->Hyperbola()).Axis().Direction();
|
||||
if (myDirection.IsNormal(D, Precision::Angular())) {
|
||||
return GeomAbs_Plane;
|
||||
}
|
||||
else {
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
return GeomAbs_SurfaceOfExtrusion;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Plane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pln Adaptor3d_SurfaceOfLinearExtrusion::Plane() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if (GetType() != GeomAbs_Plane,
|
||||
"Adaptor3d_SurfaceOfLinearExtrusion::Plane");
|
||||
/*
|
||||
gp_Pnt P;
|
||||
gp_Vec Ox, Oy;
|
||||
D1( 0., 0., P, Ox, Oy);
|
||||
gp_Ax3 Ax3(P,gp_Dir(Ox^Oy),gp_Dir(Ox));
|
||||
if (gp_Dir(Oy).Dot(Ax3.YDirection())<0.){
|
||||
Ax3.YReverse();
|
||||
}
|
||||
return gp_Pln(Ax3);
|
||||
*/
|
||||
|
||||
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 Adaptor3d_SurfaceOfLinearExtrusion::Cylinder() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Cylinder,
|
||||
"Adaptor3d_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 Adaptor3d_SurfaceOfLinearExtrusion::Cone() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Cone");
|
||||
return gp_Cone();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Sphere
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Sphere Adaptor3d_SurfaceOfLinearExtrusion::Sphere() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Sphere");
|
||||
return gp_Sphere();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Torus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Torus Adaptor3d_SurfaceOfLinearExtrusion::Torus() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Torus");
|
||||
return gp_Torus();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Axis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax1 Adaptor3d_SurfaceOfLinearExtrusion::AxeOfRevolution() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Axes");
|
||||
return gp_Ax1();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::UDegree() const
|
||||
{
|
||||
return myBasisCurve -> Degree();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbUPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbUPoles() const
|
||||
{
|
||||
return myBasisCurve->NbPoles();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : VDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::VDegree() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::VDegree");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbVPoles() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::NbVPoles");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbUKnots() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise
|
||||
("Adaptor3d_SurfaceOfLinearExtrusion::NbUKnots");
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbVKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfLinearExtrusion::NbVKnots() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::NbVKnots");
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsURational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsURational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise
|
||||
("Adaptor3d_SurfaceOfLinearExtrusion::IsURational");
|
||||
return Standard_False;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsVRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfLinearExtrusion::IsVRational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise
|
||||
("Adaptor3d_SurfaceOfLinearExtrusion::IsVRational");
|
||||
return Standard_False;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
Handle(Geom_BezierSurface) Adaptor3d_SurfaceOfLinearExtrusion::Bezier() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Axes");
|
||||
return Handle(Geom_BezierSurface)() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BSplineSurface) Adaptor3d_SurfaceOfLinearExtrusion::BSpline() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfLinearExtrusion::Axes");
|
||||
return Handle(Geom_BSplineSurface)() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Direction
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Dir Adaptor3d_SurfaceOfLinearExtrusion::Direction() const
|
||||
{
|
||||
return myDirection;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BasisCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HCurve) Adaptor3d_SurfaceOfLinearExtrusion::BasisCurve() const
|
||||
{
|
||||
return myBasisCurve;
|
||||
}
|
@@ -1,238 +0,0 @@
|
||||
// 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 _Adaptor3d_SurfaceOfLinearExtrusion_HeaderFile
|
||||
#define _Adaptor3d_SurfaceOfLinearExtrusion_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <GeomAbs_SurfaceType.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 Adaptor3d_SurfaceOfLinearExtrusion : public Adaptor3d_Surface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfaceOfLinearExtrusion();
|
||||
|
||||
//! The Curve is loaded.
|
||||
Standard_EXPORT Adaptor3d_SurfaceOfLinearExtrusion(const Handle(Adaptor3d_HCurve)& C);
|
||||
|
||||
//! Thew Curve and the Direction are loaded.
|
||||
Standard_EXPORT Adaptor3d_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;
|
||||
|
||||
//! Computes the point of parameters U,V on the surface.
|
||||
Standard_EXPORT gp_Pnt Value (const Standard_Real U, const Standard_Real V) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point of parameters U,V on the surface.
|
||||
Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point and the first derivatives on
|
||||
//! the surface.
|
||||
//! Raised if the continuity of the current
|
||||
//! intervals is not C1.
|
||||
Standard_EXPORT void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point, the first and second
|
||||
//! derivatives on the surface.
|
||||
//! Raised if the continuity of the current
|
||||
//! intervals is not C2.
|
||||
Standard_EXPORT void D2 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point, the first, second and third
|
||||
//! derivatives on the surface.
|
||||
//! Raised if the continuity of the current
|
||||
//! intervals is not C3.
|
||||
Standard_EXPORT void D3 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the derivative of order Nu in the direction U and Nv
|
||||
//! in the direction V at the point P(U, V).
|
||||
//! Raised if the current U interval is not not CNu
|
||||
//! and the current V interval is not CNv.
|
||||
//! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
|
||||
Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) 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_Integer VDegree() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbVPoles() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbUKnots() 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 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;
|
||||
gp_Dir myDirection;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Adaptor3d_SurfaceOfLinearExtrusion_HeaderFile
|
@@ -1,909 +0,0 @@
|
||||
// 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 <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_HSurfaceOfRevolution.hxx>
|
||||
#include <Adaptor3d_SurfaceOfRevolution.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Adaptor3d_SurfaceOfRevolution::Adaptor3d_SurfaceOfRevolution()
|
||||
:myHaveAxis(Standard_False)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfaceOfRevolution::Adaptor3d_SurfaceOfRevolution
|
||||
(const Handle(Adaptor3d_HCurve)& C)
|
||||
:myHaveAxis(Standard_False)
|
||||
{
|
||||
Load( C);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor3d_SurfaceOfRevolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor3d_SurfaceOfRevolution::Adaptor3d_SurfaceOfRevolution
|
||||
(const Handle(Adaptor3d_HCurve)& C,
|
||||
const gp_Ax1& V)
|
||||
:myHaveAxis(Standard_False)
|
||||
{
|
||||
Load( C);
|
||||
Load( V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::Load( const Handle(Adaptor3d_HCurve)& C)
|
||||
{
|
||||
myBasisCurve = C;
|
||||
if ( myHaveAxis) Load(myAxis); // to evaluate the new myAxeRev.
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::Load( const gp_Ax1& V)
|
||||
{
|
||||
myHaveAxis = Standard_True;
|
||||
myAxis = V;
|
||||
|
||||
// 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 Adaptor3d_SurfaceOfRevolution::AxeOfRevolution() const
|
||||
{
|
||||
return myAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::FirstUParameter() const
|
||||
{
|
||||
return 0.;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastUParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::LastUParameter() const
|
||||
{
|
||||
return 2*M_PI;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::FirstVParameter() const
|
||||
{
|
||||
return myBasisCurve->FirstParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastVParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::LastVParameter() const
|
||||
{
|
||||
return myBasisCurve->LastParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_SurfaceOfRevolution::UContinuity() const
|
||||
{
|
||||
return GeomAbs_CN;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VContinuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor3d_SurfaceOfRevolution::VContinuity() const
|
||||
{
|
||||
return myBasisCurve->Continuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbUIntervals
|
||||
//(const GeomAbs_Shape S) const
|
||||
(const GeomAbs_Shape ) const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbVIntervals
|
||||
( const GeomAbs_Shape S) const
|
||||
{
|
||||
return myBasisCurve->NbIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::UIntervals (TColStd_Array1OfReal& T,
|
||||
// const GeomAbs_Shape S) const
|
||||
const GeomAbs_Shape ) const
|
||||
{
|
||||
T(T.Lower() ) = 0.;
|
||||
T(T.Lower()+1) = 2*M_PI;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::VIntervals(TColStd_Array1OfReal& T,
|
||||
const GeomAbs_Shape S) const
|
||||
{
|
||||
myBasisCurve->Intervals(T,S);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_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,
|
||||
"Adaptor3d_SurfaceOfRevolution : UTrim : Parameters out of range");
|
||||
|
||||
Handle(Adaptor3d_HSurfaceOfRevolution) HR =
|
||||
new Adaptor3d_HSurfaceOfRevolution(*this);
|
||||
return HR;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : VTrim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HSurface) Adaptor3d_SurfaceOfRevolution::VTrim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
Handle(Adaptor3d_HSurfaceOfRevolution) HR =
|
||||
new Adaptor3d_HSurfaceOfRevolution(*this);
|
||||
Handle(Adaptor3d_HCurve) HC = BasisCurve()->Trim(First,Last,Tol);
|
||||
HR->ChangeSurface().
|
||||
Load(HC);
|
||||
return HR;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsUClosed() const
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsVClosed() const
|
||||
{
|
||||
return myBasisCurve->IsClosed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsUPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsUPeriodic() const
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::UPeriod() const
|
||||
{
|
||||
return 2*M_PI;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsVPeriodic() const
|
||||
{
|
||||
return myBasisCurve->IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VPeriod
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::VPeriod() const
|
||||
{
|
||||
return myBasisCurve->Period();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt Adaptor3d_SurfaceOfRevolution::Value(const Standard_Real U,
|
||||
const Standard_Real V) const
|
||||
{
|
||||
gp_Pnt P;
|
||||
myBasisCurve->D0(V,P);
|
||||
P.Rotate( myAxis, U);
|
||||
return P;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::D0(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P) const
|
||||
{
|
||||
myBasisCurve->D0(V,P);
|
||||
P.Rotate( myAxis, U);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::D1(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P, gp_Vec& D1U,
|
||||
gp_Vec& D1V) const
|
||||
{
|
||||
myBasisCurve->D1(V,P,D1V);
|
||||
Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
|
||||
|
||||
D0( U,V,P);
|
||||
D1V.Rotate( myAxis, U);
|
||||
D1U = R*(myAxeRev.YDirection());
|
||||
D1U.Rotate( myAxis, U);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::D2(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P, gp_Vec& D1U,
|
||||
gp_Vec& D1V,
|
||||
gp_Vec& D2U, gp_Vec& D2V,
|
||||
gp_Vec& D2UV) const
|
||||
{
|
||||
myBasisCurve->D2(V,P,D1V,D2V);
|
||||
|
||||
gp_Vec D1 = (myAxeRev.YDirection()).Rotated( myAxis, U);
|
||||
gp_Vec D2 = (myAxeRev.XDirection()).Rotated( myAxis, U);
|
||||
|
||||
Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
|
||||
Standard_Real D1R = D1V * myAxeRev.XDirection(); // D1R = dR/dV
|
||||
// et R=AP*XDirection
|
||||
|
||||
D0( U,V,P);
|
||||
D1V.Rotate( myAxis, U);
|
||||
D2V.Rotate( myAxis, U);
|
||||
D1U = R * D1;
|
||||
D2U = -R * D2;
|
||||
D2UV = D1R * D1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_SurfaceOfRevolution::D3(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
gp_Pnt& P,gp_Vec& D1U, gp_Vec& D1V,
|
||||
gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV,
|
||||
gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV,
|
||||
gp_Vec& D3UVV) const
|
||||
{
|
||||
myBasisCurve->D3(V,P,D1V,D2V,D3V);
|
||||
|
||||
gp_Vec D1 = (myAxeRev.YDirection()).Rotated( myAxis, U);
|
||||
gp_Vec D2 = (myAxeRev.XDirection()).Rotated( myAxis, U);
|
||||
|
||||
Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
|
||||
Standard_Real D1R = D1V * myAxeRev.XDirection(); // D1R = dR/dV et
|
||||
// R=AP*XDirection
|
||||
Standard_Real D2R = D2V * myAxeRev.XDirection();
|
||||
|
||||
D0( U,V,P);
|
||||
D1V.Rotate( myAxis, U);
|
||||
D2V.Rotate( myAxis, U);
|
||||
D3V.Rotate( myAxis, U);
|
||||
D1U = R * D1;
|
||||
D2U = -R * D2;
|
||||
D3U = -R * D1;
|
||||
D2UV = D1R * D1;
|
||||
D3UUV = -D1R * D2;
|
||||
D3UVV = D2R * D1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Vec Adaptor3d_SurfaceOfRevolution::DN(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
const Standard_Integer NU,
|
||||
const Standard_Integer NV) const
|
||||
{
|
||||
if ( (NU+NV)<1 || NU<0 || NV<0) {
|
||||
Standard_DomainError::Raise("Adaptor3d_SurfaceOfRevolution::DN");
|
||||
}
|
||||
else {
|
||||
gp_Vec DNv = myBasisCurve->DN( V, NV);
|
||||
if ( NU == 0) {
|
||||
return DNv.Rotated( myAxis, U);
|
||||
}
|
||||
else {
|
||||
Standard_Real DNR = DNv * myAxeRev.XDirection();
|
||||
gp_Vec DNu = ( myAxeRev.XDirection()).Rotated( myAxis, U + NU*M_PI/2);
|
||||
return ( DNR * DNu);
|
||||
}
|
||||
}
|
||||
// portage WNT
|
||||
return gp_Vec();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::UResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return Precision::Parametric(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VResolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor3d_SurfaceOfRevolution::VResolution
|
||||
(const Standard_Real R3d) const
|
||||
{
|
||||
return myBasisCurve->Resolution(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_SurfaceType Adaptor3d_SurfaceOfRevolution::GetType() const
|
||||
{
|
||||
Standard_Real TolConf, TolAng;
|
||||
GeomAbs_SurfaceType bRet;
|
||||
//
|
||||
bRet=GeomAbs_SurfaceOfRevolution;
|
||||
TolConf = Precision::Confusion();
|
||||
TolAng = Precision::Angular();
|
||||
//
|
||||
switch ( myBasisCurve->GetType()) {
|
||||
case GeomAbs_Line: {
|
||||
gp_Ax1 Axe = myBasisCurve->Line().Position();
|
||||
|
||||
if (myAxis.IsParallel(Axe, TolAng)) {
|
||||
bRet=GeomAbs_Cylinder;
|
||||
return bRet;
|
||||
}
|
||||
else if (myAxis.IsNormal( Axe, TolAng)) {
|
||||
bRet=GeomAbs_Plane;
|
||||
return bRet;
|
||||
}
|
||||
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) {
|
||||
bRet=GeomAbs_Cylinder;
|
||||
return bRet;
|
||||
}
|
||||
else if (projlen <= aTolConf) {
|
||||
bRet=GeomAbs_Plane;
|
||||
return bRet;
|
||||
}
|
||||
}
|
||||
gp_Vec V(myAxis.Location(),
|
||||
myBasisCurve->Line().Location());
|
||||
gp_Vec W(Axe.Direction());
|
||||
if (Abs(V.DotCross(myAxis.Direction(),W)) <= TolConf){
|
||||
bRet=GeomAbs_Cone;
|
||||
return bRet;
|
||||
}
|
||||
else {
|
||||
return bRet;
|
||||
}
|
||||
}
|
||||
}//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 bRet;
|
||||
}
|
||||
else if(aLin.Distance(aLC) <= TolConf) {
|
||||
bRet=GeomAbs_Sphere;
|
||||
return bRet;
|
||||
}
|
||||
else {
|
||||
MajorRadius = aLin.Distance(aLC);
|
||||
if(MajorRadius>aR) {
|
||||
//modified by NIZNHY-PKV Thu Feb 24 09:46:29 2011f
|
||||
Standard_Real aT, aDx, dX;
|
||||
gp_Pnt aPx;
|
||||
//
|
||||
aT=0.;
|
||||
aPx=ElCLib::Value(aT, C);
|
||||
aDx=aLin.Distance(aPx);
|
||||
dX=aDx-MajorRadius-aR;
|
||||
if (dX<0.) {
|
||||
dX=-dX;
|
||||
}
|
||||
if (dX<TolConf) {
|
||||
bRet=GeomAbs_Torus;
|
||||
}
|
||||
//bRet=GeomAbs_Torus;
|
||||
//return bRet;
|
||||
//modified by NIZNHY-PKV Thu Feb 24 09:52:29 2011t
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
}
|
||||
//
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Plane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pln Adaptor3d_SurfaceOfRevolution::Plane() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Plane, "Adaptor3d_SurfaceOfRevolution:Plane");
|
||||
|
||||
gp_Ax3 Axe = myAxeRev;
|
||||
gp_Pnt P;
|
||||
|
||||
// P = Projection du Point Debut de la generatrice sur l axe de rotation.
|
||||
P.SetXYZ((myAxis.Location()).XYZ() +
|
||||
(Value(0.,0.).XYZ()-(myAxis.Location()).XYZ()).
|
||||
Dot((myAxis.Direction()).XYZ())
|
||||
*(myAxis.Direction()).XYZ());
|
||||
Axe.SetLocation( P);
|
||||
//// modified by jgv, 8.01.03 for OCC1226 ////
|
||||
if (Axe.XDirection().
|
||||
Dot(myBasisCurve->Line().Direction()) >= -Precision::Confusion()) // > 0.
|
||||
Axe.XReverse();
|
||||
//////////////////////////////////////////////
|
||||
|
||||
return gp_Pln( Axe);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Cylinder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Cylinder Adaptor3d_SurfaceOfRevolution::Cylinder() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Cylinder, "Adaptor3d_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 Adaptor3d_SurfaceOfRevolution::Cone() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
( GetType() != GeomAbs_Cone, "Adaptor3d_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 Adaptor3d_SurfaceOfRevolution::Sphere() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
( GetType() != GeomAbs_Sphere, "Adaptor3d_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 Adaptor3d_SurfaceOfRevolution::Torus() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if
|
||||
(GetType() != GeomAbs_Torus, "Adaptor3d_SurfaceOfRevolution:Torus");
|
||||
|
||||
gp_Circ C = myBasisCurve->Circle();
|
||||
Standard_Real MajorRadius = gp_Lin(myAxis).Distance(C.Location());
|
||||
return gp_Torus( myAxeRev, MajorRadius, C.Radius());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::UDegree() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::UDegree");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbUPoles() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::NbUPoles");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VDegree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::VDegree() const
|
||||
{
|
||||
return myBasisCurve->Degree();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbVPoles() const
|
||||
{
|
||||
return myBasisCurve -> NbPoles();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbUKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbUKnots() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::NbUKnots");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbVKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor3d_SurfaceOfRevolution::NbVKnots() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::NbVKnots");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsURational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsURational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::IsURational");
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsVRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsVRational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("Adaptor3d_SurfaceOfRevolution::IsVRational");
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BezierSurface) Adaptor3d_SurfaceOfRevolution::Bezier() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("");
|
||||
Handle(Geom_BezierSurface) Dummy;
|
||||
return Dummy;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_BSplineSurface) Adaptor3d_SurfaceOfRevolution::BSpline() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("");
|
||||
Handle(Geom_BSplineSurface) Dummy;
|
||||
return Dummy;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Axis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Ax3 Adaptor3d_SurfaceOfRevolution::Axis() const
|
||||
{
|
||||
return myAxeRev;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Direction
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Dir Adaptor3d_SurfaceOfRevolution::Direction() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise("");
|
||||
return gp_Dir();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BasisCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor3d_HCurve) Adaptor3d_SurfaceOfRevolution::BasisCurve() const
|
||||
{
|
||||
return myBasisCurve;
|
||||
}
|
@@ -1,258 +0,0 @@
|
||||
// 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 _Adaptor3d_SurfaceOfRevolution_HeaderFile
|
||||
#define _Adaptor3d_SurfaceOfRevolution_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <GeomAbs_SurfaceType.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.
|
||||
//! Curve and Axis are coplanar.
|
||||
//! Curve doesn't intersect Axis.
|
||||
class Adaptor3d_SurfaceOfRevolution : public Adaptor3d_Surface
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Adaptor3d_SurfaceOfRevolution();
|
||||
|
||||
//! The Curve is loaded.
|
||||
Standard_EXPORT Adaptor3d_SurfaceOfRevolution(const Handle(Adaptor3d_HCurve)& C);
|
||||
|
||||
//! The Curve and the Direction are loaded.
|
||||
Standard_EXPORT Adaptor3d_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;
|
||||
|
||||
//! Computes the point of parameters U,V on the surface.
|
||||
Standard_EXPORT gp_Pnt Value (const Standard_Real U, const Standard_Real V) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point of parameters U,V on the surface.
|
||||
Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point and the first derivatives on
|
||||
//! the surface.
|
||||
//! Raised if the continuity of the current
|
||||
//! intervals is not C1.
|
||||
Standard_EXPORT void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point, the first and second
|
||||
//! derivatives on the surface.
|
||||
//! Raised if the continuity of the current
|
||||
//! intervals is not C2.
|
||||
Standard_EXPORT void D2 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the point, the first, second and third
|
||||
//! derivatives on the surface.
|
||||
//! Raised if the continuity of the current
|
||||
//! intervals is not C3.
|
||||
Standard_EXPORT void D3 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const Standard_OVERRIDE;
|
||||
|
||||
//! Computes the derivative of order Nu
|
||||
//! in the direction U and Nv in the direction V
|
||||
//! at the point P(U, V).
|
||||
//! Raised if the current U interval is not not CNu
|
||||
//! and the current V interval is not CNv.
|
||||
//! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
|
||||
Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) 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 UDegree() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbUPoles() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer VDegree() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbVPoles() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbUKnots() 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 gp_Ax3 Axis() const;
|
||||
|
||||
Standard_EXPORT gp_Dir Direction() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(Adaptor3d_HCurve) BasisCurve() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Adaptor3d_HCurve) myBasisCurve;
|
||||
gp_Ax1 myAxis;
|
||||
Standard_Boolean myHaveAxis;
|
||||
gp_Ax3 myAxeRev;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Adaptor3d_SurfaceOfRevolution_HeaderFile
|
@@ -18,10 +18,6 @@ Adaptor3d_HIsoCurve_0.cxx
|
||||
Adaptor3d_HSurface.cxx
|
||||
Adaptor3d_HSurface.hxx
|
||||
Adaptor3d_HSurface.lxx
|
||||
Adaptor3d_HSurfaceOfLinearExtrusion.hxx
|
||||
Adaptor3d_HSurfaceOfLinearExtrusion_0.cxx
|
||||
Adaptor3d_HSurfaceOfRevolution.hxx
|
||||
Adaptor3d_HSurfaceOfRevolution_0.cxx
|
||||
Adaptor3d_HSurfaceTool.cxx
|
||||
Adaptor3d_HSurfaceTool.hxx
|
||||
Adaptor3d_HSurfaceTool.lxx
|
||||
@@ -34,10 +30,6 @@ Adaptor3d_IsoCurve.hxx
|
||||
Adaptor3d_IsoCurve.lxx
|
||||
Adaptor3d_Surface.cxx
|
||||
Adaptor3d_Surface.hxx
|
||||
Adaptor3d_SurfaceOfLinearExtrusion.cxx
|
||||
Adaptor3d_SurfaceOfLinearExtrusion.hxx
|
||||
Adaptor3d_SurfaceOfRevolution.cxx
|
||||
Adaptor3d_SurfaceOfRevolution.hxx
|
||||
Adaptor3d_SurfacePtr.hxx
|
||||
Adaptor3d_TopolTool.cxx
|
||||
Adaptor3d_TopolTool.hxx
|
||||
|
Reference in New Issue
Block a user