增加OCCT库并增加OpenGL ES的OCCT渲染实现

This commit is contained in:
JackLee 2026-02-18 21:49:58 +08:00
parent 9f5ba8d068
commit 191ccdd759
1184 changed files with 99793 additions and 1214 deletions

View File

@ -11,7 +11,6 @@
"arguments": "", "arguments": "",
"cppFlags": "", "cppFlags": "",
"abiFilters": [ "abiFilters": [
"arm64-v8a",
"x86_64" "x86_64"
] ]
} }

View File

@ -6,13 +6,13 @@
"lockfileVersion": 3, "lockfileVersion": 3,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": { "specifiers": {
"libentry.so@src/main/cpp/types/libentry": "libentry.so@src/main/cpp/types/libentry" "libocct.so@src/main/cpp/types/libocct": "libocct.so@src/main/cpp/types/libocct"
}, },
"packages": { "packages": {
"libentry.so@src/main/cpp/types/libentry": { "libocct.so@src/main/cpp/types/libocct": {
"name": "libentry.so", "name": "libocct.so",
"version": "1.0.0", "version": "1.0.0",
"resolved": "src/main/cpp/types/libentry", "resolved": "src/main/cpp/types/libocct",
"registryType": "local" "registryType": "local"
} }
} }

View File

@ -6,6 +6,6 @@
"author": "", "author": "",
"license": "", "license": "",
"dependencies": { "dependencies": {
"libentry.so": "file:./src/main/cpp/types/libentry" "libocct.so": "file:./src/main/cpp/types/libocct"
} }
} }

View File

@ -0,0 +1,49 @@
// Copyright (c) 2023 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 _AIS_AnimationAxisRotation_HeaderFile
#define _AIS_AnimationAxisRotation_HeaderFile
#include "AIS_BaseAnimationObject.hxx"
#include "gp_TrsfNLerp.hxx"
//! Animation defining object transformation.
class AIS_AnimationAxisRotation : public AIS_BaseAnimationObject
{
DEFINE_STANDARD_RTTIEXT(AIS_AnimationAxisRotation, AIS_BaseAnimationObject)
public:
//! Constructor with initialization.
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply rotation
//! @param[in] theAxis rotation axis
//! @param[in] theAngleStart rotation angle at the start of animation
//! @param[in] theAngleEnd rotation angle at the end of animation
Standard_EXPORT AIS_AnimationAxisRotation(const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject,
const gp_Ax1& theAxis,
const Standard_Real theAngleStart,
const Standard_Real theAngleEnd);
protected:
//! Update the progress.
Standard_EXPORT virtual void update(const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
private:
gp_Ax1 myRotAxis; //!< rotation axis
Standard_Real myAngleStart; //!< start angle for rotation
Standard_Real myAngleEnd; //!< end angle for rotation
};
#endif // _AIS_AnimationAxisRotation_HeaderFile

View File

@ -0,0 +1,45 @@
// Copyright (c) 2023 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 _AIS_BaseAnimationObject_HeaderFile
#define _AIS_BaseAnimationObject_HeaderFile
#include "AIS_Animation.hxx"
#include "AIS_InteractiveContext.hxx"
//! Animation defining object transformation.
class AIS_BaseAnimationObject : public AIS_Animation
{
DEFINE_STANDARD_RTTIEXT(AIS_BaseAnimationObject, AIS_Animation)
protected:
//! Constructor with initialization.
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply local transformation
Standard_EXPORT AIS_BaseAnimationObject(const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject);
//! Update the transformation.
Standard_EXPORT void updateTrsf(const gp_Trsf& theTrsf);
private:
//! Invalidate the viewer for proper update.
Standard_EXPORT void invalidateViewer();
protected:
Handle(AIS_InteractiveContext) myContext; //!< context where object is displayed
Handle(AIS_InteractiveObject) myObject; //!< presentation object to set location
};
#endif // _AIS_BaseAnimationObject_HeaderFile

View File

@ -0,0 +1,50 @@
// Created on: 1998-02-04
// Created by: Julia GERASIMOVA
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_C0RegularityFilter_HeaderFile
#define _AIS_C0RegularityFilter_HeaderFile
#include "Standard.hxx"
#include "TopTools_MapOfShape.hxx"
#include "SelectMgr_Filter.hxx"
#include "TopAbs_ShapeEnum.hxx"
class TopoDS_Shape;
class SelectMgr_EntityOwner;
class AIS_C0RegularityFilter;
DEFINE_STANDARD_HANDLE(AIS_C0RegularityFilter, SelectMgr_Filter)
class AIS_C0RegularityFilter : public SelectMgr_Filter
{
public:
Standard_EXPORT AIS_C0RegularityFilter(const TopoDS_Shape& aShape);
Standard_EXPORT virtual Standard_Boolean ActsOn(const TopAbs_ShapeEnum aType) const
Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& EO) const
Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(AIS_C0RegularityFilter, SelectMgr_Filter)
protected:
private:
TopTools_MapOfShape myMapOfEdges;
};
#endif // _AIS_C0RegularityFilter_HeaderFile

View File

@ -0,0 +1,22 @@
// Copyright (c) 2020 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 _AIS_ConcentricRelation_HeaderFile
#define _AIS_ConcentricRelation_HeaderFile
#include "PrsDim_ConcentricRelation.hxx"
Standard_DEPRECATED("Alias to moved class")
typedef PrsDim_ConcentricRelation AIS_ConcentricRelation;
#endif // _AIS_ConcentricRelation_HeaderFile

View File

@ -0,0 +1,149 @@
// Created on: 1997-01-08
// Created by: Robert COUBLANC
// Copyright (c) 1997-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 _AIS_ConnectedInteractive_HeaderFile
#define _AIS_ConnectedInteractive_HeaderFile
#include "AIS_InteractiveObject.hxx"
#include "AIS_KindOfInteractive.hxx"
#include "TopoDS_Shape.hxx"
//! Creates an arbitrary located instance of another Interactive Object,
//! which serves as a reference.
//! This allows you to use the Connected Interactive
//! Object without having to recalculate presentation,
//! selection or graphic structure. These are deduced
//! from your reference object.
//! The relation between the connected interactive object
//! and its source is generally one of geometric transformation.
//! AIS_ConnectedInteractive class supports selection mode 0 for any InteractiveObject and
//! all standard modes if its reference based on AIS_Shape.
//! Descendants may redefine ComputeSelection() though.
//! Also ConnectedInteractive will handle HLR if its reference based on AIS_Shape.
class AIS_ConnectedInteractive : public AIS_InteractiveObject
{
DEFINE_STANDARD_RTTIEXT(AIS_ConnectedInteractive, AIS_InteractiveObject)
public:
//! Disconnects the previous view and sets highlight
//! mode to 0. This highlights the wireframe presentation
//! aTypeOfPresentation3d.
//! Top_AllView deactivates hidden line removal.
Standard_EXPORT AIS_ConnectedInteractive(
const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
//! Returns KOI_Object
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE
{
return AIS_KindOfInteractive_Object;
}
//! Returns 0
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 0; }
//! Establishes the connection between the Connected
//! Interactive Object, anotherIobj, and its reference.
void Connect(const Handle(AIS_InteractiveObject)& theAnotherObj)
{
connect(theAnotherObj, Handle(TopLoc_Datum3D)());
}
//! Establishes the connection between the Connected
//! Interactive Object, anotherIobj, and its reference.
//! Locates instance in aLocation.
void Connect(const Handle(AIS_InteractiveObject)& theAnotherObj, const gp_Trsf& theLocation)
{
connect(theAnotherObj, new TopLoc_Datum3D(theLocation));
}
//! Establishes the connection between the Connected
//! Interactive Object, anotherIobj, and its reference.
//! Locates instance in aLocation.
void Connect(const Handle(AIS_InteractiveObject)& theAnotherObj,
const Handle(TopLoc_Datum3D)& theLocation)
{
connect(theAnotherObj, theLocation);
}
//! Returns true if there is a connection established
//! between the presentation and its source reference.
Standard_Boolean HasConnection() const { return !myReference.IsNull(); }
//! Returns the connection with the reference Interactive Object.
const Handle(AIS_InteractiveObject)& ConnectedTo() const { return myReference; }
//! Clears the connection with a source reference. The
//! presentation will no longer be displayed.
//! Warning Must be done before deleting the presentation.
Standard_EXPORT void Disconnect();
//! Informs the graphic context that the interactive Object
//! may be decomposed into sub-shapes for dynamic selection.
virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE
{
return !myReference.IsNull() && myReference->AcceptShapeDecomposition();
}
//! Return true if reference presentation accepts specified display mode.
virtual Standard_Boolean AcceptDisplayMode(const Standard_Integer theMode) const Standard_OVERRIDE
{
return myReference.IsNull() || myReference->AcceptDisplayMode(theMode);
}
protected:
//! Calculates the view aPresentation and its updates.
//! The latter are managed by aPresentationManager.
//! The display mode aMode is 0 by default.
//! this method is redefined virtual;
//! when the instance is connected to another
//! InteractiveObject,this method doesn't
//! compute anything, but just uses the
//! presentation of this last object, with
//! a transformation if there's one stored.
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& theprs,
const Standard_Integer theMode) Standard_OVERRIDE;
//! Computes the presentation according to a point of view.
Standard_EXPORT virtual void computeHLR(const Handle(Graphic3d_Camera)& theProjector,
const Handle(TopLoc_Datum3D)& theTrsf,
const Handle(Prs3d_Presentation)& thePrs)
Standard_OVERRIDE;
//! Generates sensitive entities by copying
//! them from myReference selection, creates and sets an entity
//! owner for this entities and adds them to theSelection
Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode) Standard_OVERRIDE;
//! Generates sensitive entities by copying
//! them from myReference sub shapes selection, creates and sets an entity
//! owner for this entities and adds them to theSelection
Standard_EXPORT void computeSubShapeSelection(const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode);
Standard_EXPORT void updateShape(const Standard_Boolean WithLocation = Standard_True);
Standard_EXPORT void connect(const Handle(AIS_InteractiveObject)& theAnotherObj,
const Handle(TopLoc_Datum3D)& theLocation);
protected:
Handle(AIS_InteractiveObject) myReference;
TopoDS_Shape myShape;
};
DEFINE_STANDARD_HANDLE(AIS_ConnectedInteractive, AIS_InteractiveObject)
#endif // _AIS_ConnectedInteractive_HeaderFile

View File

@ -0,0 +1,24 @@
// Copyright (c) 2016 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 _AIS_DataMapOfShapeDrawer_HeaderFile
#define _AIS_DataMapOfShapeDrawer_HeaderFile
#include "AIS_ColoredDrawer.hxx"
#include "NCollection_DataMap.hxx"
#include "TopTools_ShapeMapHasher.hxx"
typedef NCollection_DataMap<TopoDS_Shape, Handle(AIS_ColoredDrawer), TopTools_ShapeMapHasher>
AIS_DataMapOfShapeDrawer;
#endif // _AIS_DataMapOfShapeDrawer_HeaderFile

View File

@ -0,0 +1,22 @@
// Copyright (c) 2020 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 _AIS_EqualDistanceRelation_HeaderFile
#define _AIS_EqualDistanceRelation_HeaderFile
#include "PrsDim_EqualDistanceRelation.hxx"
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_EqualDistanceRelation AIS_EqualDistanceRelation;
#endif // _AIS_EqualDistanceRelation_HeaderFile

View File

@ -0,0 +1,22 @@
// Copyright (c) 2020 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 _AIS_EqualRadiusRelation_HeaderFile
#define _AIS_EqualRadiusRelation_HeaderFile
#include "PrsDim_EqualRadiusRelation.hxx"
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_EqualRadiusRelation AIS_EqualRadiusRelation;
#endif // _AIS_EqualRadiusRelation_HeaderFile

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
// Copyright (c) 2020 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 _AIS_MaxRadiusDimension_HeaderFile
#define _AIS_MaxRadiusDimension_HeaderFile
#include "PrsDim_MaxRadiusDimension.hxx"
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_MaxRadiusDimension AIS_MaxRadiusDimension;
#endif // _AIS_MaxRadiusDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// Copyright (c) 2020 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 _AIS_MinRadiusDimension_HeaderFile
#define _AIS_MinRadiusDimension_HeaderFile
#include "PrsDim_MinRadiusDimension.hxx"
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_MinRadiusDimension AIS_MinRadiusDimension;
#endif // _AIS_MinRadiusDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// Copyright (c) 2020 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 _AIS_NArray1OfEntityOwner_HeaderFile
#define _AIS_NArray1OfEntityOwner_HeaderFile
#include "NCollection_Array1.hxx"
#include "SelectMgr_EntityOwner.hxx"
typedef NCollection_Array1<Handle(SelectMgr_EntityOwner)> AIS_NArray1OfEntityOwner;
#endif // _AIS_NArray1OfEntityOwner_HeaderFile

View File

@ -0,0 +1,24 @@
// Created on: 2003-05-04
// Created by: Alexander Grigoriev (a-grigoriev@opencascade.com)
// Copyright (c) 2003-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_NListTransient_HeaderFile
#define _AIS_NListTransient_HeaderFile
#include "SelectMgr_EntityOwner.hxx"
#include "NCollection_List.hxx"
typedef NCollection_List<Handle(SelectMgr_EntityOwner)> AIS_NListOfEntityOwner;
#endif

View File

@ -0,0 +1,22 @@
// Copyright (c) 2020 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 _AIS_PerpendicularRelation_HeaderFile
#define _AIS_PerpendicularRelation_HeaderFile
#include "PrsDim_PerpendicularRelation.hxx"
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_PerpendicularRelation AIS_PerpendicularRelation;
#endif // _AIS_PerpendicularRelation_HeaderFile

View File

@ -0,0 +1,219 @@
// Created on: 1993-02-22
// Created by: Modelistation
// 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_CurveOnSurface_HeaderFile
#define _Adaptor3d_CurveOnSurface_HeaderFile
#include "Adaptor2d_Curve2d.hxx"
#include "Adaptor3d_Surface.hxx"
#include "GeomAbs_CurveType.hxx"
#include "GeomAbs_Shape.hxx"
#include "TColStd_Array1OfReal.hxx"
#include "TColStd_HSequenceOfReal.hxx"
DEFINE_STANDARD_HANDLE(Adaptor3d_CurveOnSurface, Adaptor3d_Curve)
//! An interface between the services provided by a curve
//! lying on a surface from the package Geom and those
//! required of the curve by algorithms which use it. The
//! curve is defined as a 2D curve from the Geom2d
//! package, in the parametric space of the surface.
class Adaptor3d_CurveOnSurface : public Adaptor3d_Curve
{
DEFINE_STANDARD_RTTIEXT(Adaptor3d_CurveOnSurface, Adaptor3d_Curve)
public:
Standard_EXPORT Adaptor3d_CurveOnSurface();
Standard_EXPORT Adaptor3d_CurveOnSurface(const Handle(Adaptor3d_Surface)& S);
//! Creates a CurveOnSurface from the 2d curve <C> and
//! the surface <S>.
Standard_EXPORT Adaptor3d_CurveOnSurface(const Handle(Adaptor2d_Curve2d)& C,
const Handle(Adaptor3d_Surface)& S);
//! Shallow copy of adaptor
Standard_EXPORT virtual Handle(Adaptor3d_Curve) ShallowCopy() const Standard_OVERRIDE;
//! Changes the surface.
Standard_EXPORT void Load(const Handle(Adaptor3d_Surface)& S);
//! Changes the 2d curve.
Standard_EXPORT void Load(const Handle(Adaptor2d_Curve2d)& C);
//! Load both curve and surface.
Standard_EXPORT void Load(const Handle(Adaptor2d_Curve2d)& C, const Handle(Adaptor3d_Surface)& S);
Standard_EXPORT const Handle(Adaptor2d_Curve2d)& GetCurve() const;
Standard_EXPORT const Handle(Adaptor3d_Surface)& GetSurface() const;
Standard_EXPORT Handle(Adaptor2d_Curve2d)& ChangeCurve();
Standard_EXPORT Handle(Adaptor3d_Surface)& ChangeSurface();
Standard_EXPORT Standard_Real FirstParameter() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real LastParameter() const Standard_OVERRIDE;
Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(me) >= <S>
Standard_EXPORT Standard_Integer NbIntervals(const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//!
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT void Intervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Returns a curve equivalent of <me> between
//! parameters <First> and <Last>. <Tol> is used to
//! test for 3d points confusion.
//! If <First> >= <Last>
Standard_EXPORT Handle(Adaptor3d_Curve) Trim(const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol) const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve.
Standard_EXPORT gp_Pnt Value(const Standard_Real U) const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve.
Standard_EXPORT void D0(const Standard_Real U, gp_Pnt& P) const Standard_OVERRIDE;
//! Computes the point of parameter U on the curve with its
//! first derivative.
//! Raised if the continuity of the current interval
//! is not C1.
Standard_EXPORT void D1(const Standard_Real U, gp_Pnt& P, gp_Vec& V) const Standard_OVERRIDE;
//! Returns the point P of parameter U, the first and second
//! derivatives V1 and V2.
//! Raised if the continuity of the current interval
//! is not C2.
Standard_EXPORT void D2(const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2) const Standard_OVERRIDE;
//! Returns the point P of parameter U, the first, the second
//! and the third derivative.
//! Raised if the continuity of the current interval
//! is not C3.
Standard_EXPORT void D3(const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2,
gp_Vec& V3) const Standard_OVERRIDE;
//! The returned vector gives the value of the derivative for the
//! order of derivation N.
//! Raised if the continuity of the current interval
//! is not CN.
//! Raised if N < 1.
Standard_EXPORT gp_Vec DN(const Standard_Real U,
const Standard_Integer N) const Standard_OVERRIDE;
//! Returns the parametric resolution corresponding
//! to the real space resolution <R3d>.
Standard_EXPORT Standard_Real Resolution(const Standard_Real R3d) const Standard_OVERRIDE;
//! Returns the type of the curve in the current
//! interval : Line, Circle, Ellipse, Hyperbola,
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
Standard_EXPORT GeomAbs_CurveType GetType() const Standard_OVERRIDE;
Standard_EXPORT gp_Lin Line() const Standard_OVERRIDE;
Standard_EXPORT gp_Circ Circle() const Standard_OVERRIDE;
Standard_EXPORT gp_Elips Ellipse() const Standard_OVERRIDE;
Standard_EXPORT gp_Hypr Hyperbola() const Standard_OVERRIDE;
Standard_EXPORT gp_Parab Parabola() const Standard_OVERRIDE;
Standard_EXPORT Standard_Integer Degree() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
Standard_EXPORT Standard_Integer NbPoles() const Standard_OVERRIDE;
Standard_EXPORT Standard_Integer NbKnots() const Standard_OVERRIDE;
Standard_EXPORT Handle(Geom_BezierCurve) Bezier() const Standard_OVERRIDE;
Standard_EXPORT Handle(Geom_BSplineCurve) BSpline() const Standard_OVERRIDE;
private:
Standard_EXPORT void EvalKPart();
//! Evaluates myFirstSurf and myLastSurf
//! for trimming the curve on surface.
//! Following methods output left-bottom and right-top points
//! of located part on surface
//! for trimming the curve on surface.
Standard_EXPORT void EvalFirstLastSurf();
Standard_EXPORT void LocatePart(const gp_Pnt2d& UV,
const gp_Vec2d& DUV,
const Handle(Adaptor3d_Surface)& S,
gp_Pnt2d& LeftBot,
gp_Pnt2d& RightTop) const;
Standard_EXPORT Standard_Boolean LocatePart_RevExt(const gp_Pnt2d& UV,
const gp_Vec2d& DUV,
const Handle(Adaptor3d_Surface)& S,
gp_Pnt2d& LeftBot,
gp_Pnt2d& RightTop) const;
Standard_EXPORT Standard_Boolean LocatePart_Offset(const gp_Pnt2d& UV,
const gp_Vec2d& DUV,
const Handle(Adaptor3d_Surface)& S,
gp_Pnt2d& LeftBot,
gp_Pnt2d& RightTop) const;
//! Extracts the numbers of knots which equal
//! the point and checks derivative components
//! by zero equivalence.
Standard_EXPORT void FindBounds(const TColStd_Array1OfReal& Arr,
const Standard_Real XYComp,
const Standard_Real DUVComp,
Standard_Integer& Bnd1,
Standard_Integer& Bnd2,
Standard_Boolean& DerIsNull) const;
private:
Handle(Adaptor3d_Surface) mySurface;
Handle(Adaptor2d_Curve2d) myCurve;
GeomAbs_CurveType myType;
gp_Circ myCirc;
gp_Lin myLin;
Handle(Adaptor3d_Surface) myFirstSurf;
Handle(Adaptor3d_Surface) myLastSurf;
Handle(TColStd_HSequenceOfReal) myIntervals;
GeomAbs_Shape myIntCont;
};
#endif // _Adaptor3d_CurveOnSurface_HeaderFile

View File

@ -0,0 +1,294 @@
// Created on: 1993-07-02
// Created by: Laurent BUCHARD
// 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_HSurfaceTool_HeaderFile
#define _Adaptor3d_HSurfaceTool_HeaderFile
#include "Adaptor3d_Surface.hxx"
#include "Adaptor3d_Curve.hxx"
#include "Geom_BezierSurface.hxx"
#include "Geom_BSplineSurface.hxx"
#include "GeomAbs_Shape.hxx"
#include "GeomAbs_SurfaceType.hxx"
#include "gp_Ax1.hxx"
#include "gp_Dir.hxx"
#include "gp_Cylinder.hxx"
#include "gp_Cone.hxx"
#include "gp_Pln.hxx"
#include "gp_Pnt.hxx"
#include "gp_Sphere.hxx"
#include "gp_Torus.hxx"
#include "gp_Vec.hxx"
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "TColStd_Array1OfReal.hxx"
class Adaptor3d_HSurfaceTool
{
public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstUParameter(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->FirstUParameter();
}
static Standard_Real FirstVParameter(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->FirstVParameter();
}
static Standard_Real LastUParameter(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->LastUParameter();
}
static Standard_Real LastVParameter(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->LastVParameter();
}
static Standard_Integer NbUIntervals(const Handle(Adaptor3d_Surface)& theSurf,
const GeomAbs_Shape theSh)
{
return theSurf->NbUIntervals(theSh);
}
static Standard_Integer NbVIntervals(const Handle(Adaptor3d_Surface)& theSurf,
const GeomAbs_Shape theSh)
{
return theSurf->NbVIntervals(theSh);
}
static void UIntervals(const Handle(Adaptor3d_Surface)& theSurf,
TColStd_Array1OfReal& theTab,
const GeomAbs_Shape theSh)
{
theSurf->UIntervals(theTab, theSh);
}
static void VIntervals(const Handle(Adaptor3d_Surface)& theSurf,
TColStd_Array1OfReal& theTab,
const GeomAbs_Shape theSh)
{
theSurf->VIntervals(theTab, theSh);
}
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) UTrim(const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Real theFirst,
const Standard_Real theLast,
const Standard_Real theTol)
{
return theSurf->UTrim(theFirst, theLast, theTol);
}
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) VTrim(const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Real theFirst,
const Standard_Real theLast,
const Standard_Real theTol)
{
return theSurf->VTrim(theFirst, theLast, theTol);
}
static Standard_Boolean IsUClosed(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->IsUClosed();
}
static Standard_Boolean IsVClosed(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->IsVClosed();
}
static Standard_Boolean IsUPeriodic(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->IsUPeriodic();
}
static Standard_Real UPeriod(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->UPeriod();
}
static Standard_Boolean IsVPeriodic(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->IsVPeriodic();
}
static Standard_Real VPeriod(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->VPeriod();
}
static gp_Pnt Value(const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Real theU,
const Standard_Real theV)
{
return theSurf->Value(theU, theV);
}
static void D0(const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Real theU,
const Standard_Real theV,
gp_Pnt& thePnt)
{
theSurf->D0(theU, theV, thePnt);
}
static void D1(const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Real theU,
const Standard_Real theV,
gp_Pnt& thePnt,
gp_Vec& theD1U,
gp_Vec& theD1V)
{
theSurf->D1(theU, theV, thePnt, theD1U, theD1V);
}
static void D2(const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Real theU,
const Standard_Real theV,
gp_Pnt& thePnt,
gp_Vec& theD1U,
gp_Vec& theD1V,
gp_Vec& theD2U,
gp_Vec& theD2V,
gp_Vec& theD2UV)
{
theSurf->D2(theU, theV, thePnt, theD1U, theD1V, theD2U, theD2V, theD2UV);
}
static void D3(const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Real theU,
const Standard_Real theV,
gp_Pnt& thePnt,
gp_Vec& theD1U,
gp_Vec& theD1V,
gp_Vec& theD2U,
gp_Vec& theD2V,
gp_Vec& theD2UV,
gp_Vec& theD3U,
gp_Vec& theD3V,
gp_Vec& theD3UUV,
gp_Vec& theD3UVV)
{
theSurf->D3(theU,
theV,
thePnt,
theD1U,
theD1V,
theD2U,
theD2V,
theD2UV,
theD3U,
theD3V,
theD3UUV,
theD3UVV);
}
static gp_Vec DN(const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Real theU,
const Standard_Real theV,
const Standard_Integer theNU,
const Standard_Integer theNV)
{
return theSurf->DN(theU, theV, theNU, theNV);
}
static Standard_Real UResolution(const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Real theR3d)
{
return theSurf->UResolution(theR3d);
}
static Standard_Real VResolution(const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Real theR3d)
{
return theSurf->VResolution(theR3d);
}
static GeomAbs_SurfaceType GetType(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->GetType();
}
static gp_Pln Plane(const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Plane(); }
static gp_Cylinder Cylinder(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->Cylinder();
}
static gp_Cone Cone(const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Cone(); }
static gp_Torus Torus(const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Torus(); }
static gp_Sphere Sphere(const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Sphere(); }
static Handle(Geom_BezierSurface) Bezier(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->Bezier();
}
static Handle(Geom_BSplineSurface) BSpline(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->BSpline();
}
static gp_Ax1 AxeOfRevolution(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->AxeOfRevolution();
}
static gp_Dir Direction(const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->Direction(); }
static Handle(Adaptor3d_Curve) BasisCurve(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->BasisCurve();
}
static Handle(Adaptor3d_Surface) BasisSurface(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->BasisSurface();
}
static Standard_Real OffsetValue(const Handle(Adaptor3d_Surface)& theSurf)
{
return theSurf->OffsetValue();
}
Standard_EXPORT static Standard_Boolean IsSurfG1(
const Handle(Adaptor3d_Surface)& theSurf,
const Standard_Boolean theAlongU,
const Standard_Real theAngTol = Precision::Angular());
Standard_EXPORT static Standard_Integer NbSamplesU(const Handle(Adaptor3d_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesV(const Handle(Adaptor3d_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesU(const Handle(Adaptor3d_Surface)& S,
const Standard_Real u1,
const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesV(const Handle(Adaptor3d_Surface)&,
const Standard_Real v1,
const Standard_Real v2);
};
#endif // _Adaptor3d_HSurfaceTool_HeaderFile

View File

@ -0,0 +1,208 @@
// 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.
// AdvApp2Var_ApproxF2var.hxx
/*---------------------------------------------------------------
| description de la macro et du prototype des routines
| de l'approximation a deux variables
| a utiliser dans AdvApp2Var
|--------------------------------------------------------------*/
#ifndef AdvApp2Var_ApproxF2var_HeaderFile
#define AdvApp2Var_ApproxF2var_HeaderFile
#include "Standard_Macro.hxx"
#include "AdvApp2Var_Data_f2c.hxx"
#include "AdvApp2Var_EvaluatorFunc2Var.hxx"
//
class AdvApp2Var_ApproxF2var
{
public:
Standard_EXPORT static int mma2fnc_(integer* ndimen,
integer* nbsesp,
integer* ndimse,
doublereal* uvfonc,
const AdvApp2Var_EvaluatorFunc2Var& foncnp,
doublereal* tconst,
integer* isofav,
integer* nbroot,
doublereal* rootlg,
integer* iordre,
integer* ideriv,
integer* ndgjac,
integer* nbcrmx,
integer* ncflim,
doublereal* epsapr,
integer* ncoeff,
doublereal* courbe,
integer* nbcrbe,
doublereal* somtab,
doublereal* diftab,
doublereal* contr1,
doublereal* contr2,
doublereal* tabdec,
doublereal* errmax,
doublereal* errmoy,
integer* iercod);
Standard_EXPORT static int mma2roo_(integer* nbpntu,
integer* nbpntv,
doublereal* urootl,
doublereal* vrootl);
Standard_EXPORT static int mma2jmx_(integer* ndgjac, integer* iordre, doublereal* xjacmx);
Standard_EXPORT static int mmapptt_(const integer*,
const integer*,
const integer*,
doublereal*,
integer*);
Standard_EXPORT static int mma2cdi_(integer* ndimen,
integer* nbpntu,
doublereal* urootl,
integer* nbpntv,
doublereal* vrootl,
integer* iordru,
integer* iordrv,
doublereal* contr1,
doublereal* contr2,
doublereal* contr3,
doublereal* contr4,
doublereal* sotbu1,
doublereal* sotbu2,
doublereal* ditbu1,
doublereal* ditbu2,
doublereal* sotbv1,
doublereal* sotbv2,
doublereal* ditbv1,
doublereal* ditbv2,
doublereal* sosotb,
doublereal* soditb,
doublereal* disotb,
doublereal* diditb,
integer* iercod);
Standard_EXPORT static int mma2ds1_(integer* ndimen,
doublereal* uintfn,
doublereal* vintfn,
const AdvApp2Var_EvaluatorFunc2Var& foncnp,
integer* nbpntu,
integer* nbpntv,
doublereal* urootb,
doublereal* vrootb,
integer* isofav,
doublereal* sosotb,
doublereal* disotb,
doublereal* soditb,
doublereal* diditb,
doublereal* fpntab,
doublereal* ttable,
integer* iercod);
Standard_EXPORT static int mma2ce1_(integer* numdec,
integer* ndimen,
integer* nbsesp,
integer* ndimse,
integer* ndminu,
integer* ndminv,
integer* ndguli,
integer* ndgvli,
integer* ndjacu,
integer* ndjacv,
integer* iordru,
integer* iordrv,
integer* nbpntu,
integer* nbpntv,
doublereal* epsapr,
doublereal* sosotb,
doublereal* disotb,
doublereal* soditb,
doublereal* diditb,
doublereal* patjac,
doublereal* errmax,
doublereal* errmoy,
integer* ndegpu,
integer* ndegpv,
integer* itydec,
integer* iercod);
Standard_EXPORT static int mma2can_(const integer*,
const integer*,
const integer*,
const integer*,
const integer*,
const integer*,
const integer*,
const doublereal*,
doublereal*,
doublereal*,
integer*);
Standard_EXPORT static int mma1her_(const integer*, doublereal*, integer*);
Standard_EXPORT static int mma2ac2_(const integer*,
const integer*,
const integer*,
const integer*,
const integer*,
const integer*,
const doublereal*,
const integer*,
const doublereal*,
const doublereal*,
doublereal*);
Standard_EXPORT static int mma2ac3_(const integer*,
const integer*,
const integer*,
const integer*,
const integer*,
const integer*,
const doublereal*,
const integer*,
const doublereal*,
const doublereal*,
doublereal*);
Standard_EXPORT static int mma2ac1_(const integer*,
const integer*,
const integer*,
const integer*,
const integer*,
const doublereal*,
const doublereal*,
const doublereal*,
const doublereal*,
const doublereal*,
const doublereal*,
doublereal*);
Standard_EXPORT static int mma2fx6_(integer* ncfmxu,
integer* ncfmxv,
integer* ndimen,
integer* nbsesp,
integer* ndimse,
integer* nbupat,
integer* nbvpat,
integer* iordru,
integer* iordrv,
doublereal* epsapr,
doublereal* epsfro,
doublereal* patcan,
doublereal* errmax,
integer* ncoefu,
integer* ncoefv);
};
#endif

View File

@ -0,0 +1,31 @@
// Created on: 1996-03-05
// Created by: Joelle CHAUVET
// Copyright (c) 1996-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 _AdvApp2Var_CriterionType_HeaderFile
#define _AdvApp2Var_CriterionType_HeaderFile
//! influence of the criterion on cutting process
//! cutting when criterion is not satisfied
//! deactivation of the compute of the error max
//! cutting when error max is not good or if error
//! max is good and criterion is not satisfied
enum AdvApp2Var_CriterionType
{
AdvApp2Var_Absolute,
AdvApp2Var_Relative
};
#endif // _AdvApp2Var_CriterionType_HeaderFile

View File

@ -0,0 +1,25 @@
// Created on: 1996-03-05
// Created by: Joelle CHAUVET
// Copyright (c) 1996-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 AdvApp2Var_SequenceOfNode_HeaderFile
#define AdvApp2Var_SequenceOfNode_HeaderFile
#include "AdvApp2Var_Node.hxx"
#include "NCollection_Sequence.hxx"
typedef NCollection_Sequence<Handle(AdvApp2Var_Node)> AdvApp2Var_SequenceOfNode;
#endif

View File

@ -0,0 +1,200 @@
// Created on: 1995-05-29
// Created by: Xavier BENVENISTE
// Copyright (c) 1995-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 _AdvApprox_ApproxAFunction_HeaderFile
#define _AdvApprox_ApproxAFunction_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "Standard_Integer.hxx"
#include "TColStd_HArray1OfReal.hxx"
#include "Standard_Real.hxx"
#include "GeomAbs_Shape.hxx"
#include "Standard_Boolean.hxx"
#include "TColStd_HArray2OfReal.hxx"
#include "TColgp_HArray2OfPnt2d.hxx"
#include "TColgp_HArray2OfPnt.hxx"
#include "TColStd_HArray1OfInteger.hxx"
#include "AdvApprox_EvaluatorFunction.hxx"
#include "TColStd_Array1OfInteger.hxx"
#include "TColStd_Array1OfReal.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "TColgp_Array1OfPnt.hxx"
#include "Standard_OStream.hxx"
class AdvApprox_Cutting;
//! this approximate a given function
class AdvApprox_ApproxAFunction
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs approximator tool.
//!
//! Warning:
//! the Func should be valid reference to object of type
//! inherited from class EvaluatorFunction from Approx
//! with life time longer than that of the approximator tool;
//!
//! the result should be formatted in the following way :
//! <--Num1DSS--> <--2 * Num2DSS--> <--3 * Num3DSS-->
//! R[0] .... R[Num1DSS]..... R[Dimension-1]
//!
//! the order in which each Subspace appears should be consistent
//! with the tolerances given in the create function and the
//! results will be given in that order as well that is :
//! Curve2d(n) will correspond to the nth entry
//! described by Num2DSS, Curve(n) will correspond to
//! the nth entry described by Num3DSS
//! The same type of schema applies to the Poles1d, Poles2d and
//! Poles.
Standard_EXPORT AdvApprox_ApproxAFunction(const Standard_Integer Num1DSS,
const Standard_Integer Num2DSS,
const Standard_Integer Num3DSS,
const Handle(TColStd_HArray1OfReal)& OneDTol,
const Handle(TColStd_HArray1OfReal)& TwoDTol,
const Handle(TColStd_HArray1OfReal)& ThreeDTol,
const Standard_Real First,
const Standard_Real Last,
const GeomAbs_Shape Continuity,
const Standard_Integer MaxDeg,
const Standard_Integer MaxSeg,
const AdvApprox_EvaluatorFunction& Func);
//! Approximation with user methode of cutting
Standard_EXPORT AdvApprox_ApproxAFunction(const Standard_Integer Num1DSS,
const Standard_Integer Num2DSS,
const Standard_Integer Num3DSS,
const Handle(TColStd_HArray1OfReal)& OneDTol,
const Handle(TColStd_HArray1OfReal)& TwoDTol,
const Handle(TColStd_HArray1OfReal)& ThreeDTol,
const Standard_Real First,
const Standard_Real Last,
const GeomAbs_Shape Continuity,
const Standard_Integer MaxDeg,
const Standard_Integer MaxSeg,
const AdvApprox_EvaluatorFunction& Func,
const AdvApprox_Cutting& CutTool);
Standard_EXPORT static void Approximation(const Standard_Integer TotalDimension,
const Standard_Integer TotalNumSS,
const TColStd_Array1OfInteger& LocalDimension,
const Standard_Real First,
const Standard_Real Last,
AdvApprox_EvaluatorFunction& Evaluator,
const AdvApprox_Cutting& CutTool,
const Standard_Integer ContinuityOrder,
const Standard_Integer NumMaxCoeffs,
const Standard_Integer MaxSegments,
const TColStd_Array1OfReal& TolerancesArray,
const Standard_Integer code_precis,
Standard_Integer& NumCurves,
TColStd_Array1OfInteger& NumCoeffPerCurveArray,
TColStd_Array1OfReal& LocalCoefficientArray,
TColStd_Array1OfReal& IntervalsArray,
TColStd_Array1OfReal& ErrorMaxArray,
TColStd_Array1OfReal& AverageErrorArray,
Standard_Integer& ErrorCode);
Standard_Boolean IsDone() const;
Standard_Boolean HasResult() const;
//! returns the poles from the algorithms as is
Handle(TColStd_HArray2OfReal) Poles1d() const;
//! returns the poles from the algorithms as is
Handle(TColgp_HArray2OfPnt2d) Poles2d() const;
//! -- returns the poles from the algorithms as is
Handle(TColgp_HArray2OfPnt) Poles() const;
//! as the name says
Standard_EXPORT Standard_Integer NbPoles() const;
//! returns the poles at Index from the 1d subspace
Standard_EXPORT void Poles1d(const Standard_Integer Index, TColStd_Array1OfReal& P) const;
//! returns the poles at Index from the 2d subspace
Standard_EXPORT void Poles2d(const Standard_Integer Index, TColgp_Array1OfPnt2d& P) const;
//! returns the poles at Index from the 3d subspace
Standard_EXPORT void Poles(const Standard_Integer Index, TColgp_Array1OfPnt& P) const;
Standard_Integer Degree() const;
Standard_Integer NbKnots() const;
Standard_Integer NumSubSpaces(const Standard_Integer Dimension) const;
Handle(TColStd_HArray1OfReal) Knots() const;
Handle(TColStd_HArray1OfInteger) Multiplicities() const;
//! returns the error as is in the algorithms
Standard_EXPORT Handle(TColStd_HArray1OfReal) MaxError(const Standard_Integer Dimension) const;
//! returns the error as is in the algorithms
Standard_EXPORT Handle(TColStd_HArray1OfReal) AverageError(
const Standard_Integer Dimension) const;
Standard_EXPORT Standard_Real MaxError(const Standard_Integer Dimension,
const Standard_Integer Index) const;
Standard_EXPORT Standard_Real AverageError(const Standard_Integer Dimension,
const Standard_Integer Index) const;
//! display information on approximation.
Standard_EXPORT void Dump(Standard_OStream& o) const;
protected:
private:
Standard_EXPORT void Perform(const Standard_Integer Num1DSS,
const Standard_Integer Num2DSS,
const Standard_Integer Num3DSS,
const AdvApprox_Cutting& CutTool);
Standard_Integer myNumSubSpaces[3];
Handle(TColStd_HArray1OfReal) my1DTolerances;
Handle(TColStd_HArray1OfReal) my2DTolerances;
Handle(TColStd_HArray1OfReal) my3DTolerances;
Standard_Real myFirst;
Standard_Real myLast;
GeomAbs_Shape myContinuity;
Standard_Integer myMaxDegree;
Standard_Integer myMaxSegments;
Standard_Boolean myDone;
Standard_Boolean myHasResult;
Handle(TColStd_HArray2OfReal) my1DPoles;
Handle(TColgp_HArray2OfPnt2d) my2DPoles;
Handle(TColgp_HArray2OfPnt) my3DPoles;
Handle(TColStd_HArray1OfReal) myKnots;
Handle(TColStd_HArray1OfInteger) myMults;
Standard_Integer myDegree;
Standard_Address myEvaluator;
Handle(TColStd_HArray1OfReal) my1DMaxError;
Handle(TColStd_HArray1OfReal) my1DAverageError;
Handle(TColStd_HArray1OfReal) my2DMaxError;
Handle(TColStd_HArray1OfReal) my2DAverageError;
Handle(TColStd_HArray1OfReal) my3DMaxError;
Handle(TColStd_HArray1OfReal) my3DAverageError;
};
#include "AdvApprox_ApproxAFunction.lxx"
#endif // _AdvApprox_ApproxAFunction_HeaderFile

View File

@ -0,0 +1,121 @@
// Created on: 1995-05-31
// Created by: Xavier BENVENISTE
// Copyright (c) 1995-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 "Standard_ConstructionError.hxx"
#include "TColStd_HArray1OfReal.hxx"
#include "TColStd_HArray1OfInteger.hxx"
//=======================================================================
// function : IsDone
// purpose :
//=======================================================================
inline Standard_Boolean AdvApprox_ApproxAFunction::HasResult() const
{
return myHasResult;
}
//=======================================================================
// function : IsDone
// purpose :
//=======================================================================
inline Standard_Boolean AdvApprox_ApproxAFunction::IsDone() const
{
return myDone;
}
//=======================================================================
// function : Poles1d
// purpose :
//=======================================================================
inline Handle(TColStd_HArray2OfReal) AdvApprox_ApproxAFunction::Poles1d() const
{
return my1DPoles;
}
//=======================================================================
// function : Poles2d
// purpose :
//=======================================================================
inline Handle(TColgp_HArray2OfPnt2d) AdvApprox_ApproxAFunction::Poles2d() const
{
return my2DPoles;
}
//=======================================================================
// function : Poles
// purpose :
//=======================================================================
inline Handle(TColgp_HArray2OfPnt) AdvApprox_ApproxAFunction::Poles() const
{
return my3DPoles;
}
//=======================================================================
// function : Degree
// purpose :
//=======================================================================
inline Standard_Integer AdvApprox_ApproxAFunction::Degree() const
{
return myDegree;
}
//=======================================================================
// function : NbKnots
// purpose :
//=======================================================================
inline Standard_Integer AdvApprox_ApproxAFunction::NbKnots() const
{
return myKnots->Length();
}
//=======================================================================
// function : Knots
// purpose :
//=======================================================================
inline Handle(TColStd_HArray1OfReal) AdvApprox_ApproxAFunction::Knots() const
{
return myKnots;
}
//=======================================================================
// function : Multiplicities
// purpose :
//=======================================================================
inline Handle(TColStd_HArray1OfInteger) AdvApprox_ApproxAFunction::Multiplicities() const
{
return myMults;
}
//=======================================================================
// function : NumSubSpaces
// purpose :
//=======================================================================
inline Standard_Integer AdvApprox_ApproxAFunction::NumSubSpaces(
const Standard_Integer Dimension) const
{
if (Dimension < 1 || Dimension > 3)
throw Standard_ConstructionError();
return myNumSubSpaces[Dimension - 1];
}

View File

@ -0,0 +1,45 @@
// Created on: 1996-04-05
// Created by: Joelle CHAUVET
// Copyright (c) 1996-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 _AdvApprox_DichoCutting_HeaderFile
#define _AdvApprox_DichoCutting_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "AdvApprox_Cutting.hxx"
#include "Standard_Boolean.hxx"
#include "Standard_Real.hxx"
//! if Cutting is necessary in [a,b], we cut at (a+b) / 2.
class AdvApprox_DichoCutting : public AdvApprox_Cutting
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AdvApprox_DichoCutting();
Standard_EXPORT virtual Standard_Boolean Value(const Standard_Real a,
const Standard_Real b,
Standard_Real& cuttingvalue) const
Standard_OVERRIDE;
protected:
private:
};
#endif // _AdvApprox_DichoCutting_HeaderFile

View File

@ -0,0 +1,110 @@
// Created on: 1996-10-14
// Created by: Jeannine PANTIATICI
// Copyright (c) 1996-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 _AdvApprox_SimpleApprox_HeaderFile
#define _AdvApprox_SimpleApprox_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "Standard_Integer.hxx"
#include "TColStd_HArray1OfReal.hxx"
#include "TColStd_HArray2OfReal.hxx"
#include "GeomAbs_Shape.hxx"
#include "AdvApprox_EvaluatorFunction.hxx"
#include "TColStd_Array1OfInteger.hxx"
#include "TColStd_Array1OfReal.hxx"
#include "Standard_OStream.hxx"
class PLib_JacobiPolynomial;
//! Approximate a function on an interval [First,Last]
//! The result is a simple polynomial whose degree is as low as
//! possible to satisfy the required tolerance and the
//! maximum degree. The maximum error and the averrage error
//! resulting from approximating the function by the polynomial are computed
class AdvApprox_SimpleApprox
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AdvApprox_SimpleApprox(const Standard_Integer TotalDimension,
const Standard_Integer TotalNumSS,
const GeomAbs_Shape Continuity,
const Standard_Integer WorkDegree,
const Standard_Integer NbGaussPoints,
const Handle(PLib_JacobiPolynomial)& JacobiBase,
const AdvApprox_EvaluatorFunction& Func);
//! Constructs approximator tool.
//!
//! Warning:
//! the Func should be valid reference to object of type
//! inherited from class EvaluatorFunction from Approx
//! with life time longer than that of the approximator tool;
Standard_EXPORT void Perform(const TColStd_Array1OfInteger& LocalDimension,
const TColStd_Array1OfReal& LocalTolerancesArray,
const Standard_Real First,
const Standard_Real Last,
const Standard_Integer MaxDegree);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT Standard_Integer Degree() const;
//! returns the coefficients in the Jacobi Base
Standard_EXPORT Handle(TColStd_HArray1OfReal) Coefficients() const;
//! returns the constraints at First
Standard_EXPORT Handle(TColStd_HArray2OfReal) FirstConstr() const;
//! returns the constraints at Last
Standard_EXPORT Handle(TColStd_HArray2OfReal) LastConstr() const;
Standard_EXPORT Handle(TColStd_HArray1OfReal) SomTab() const;
Standard_EXPORT Handle(TColStd_HArray1OfReal) DifTab() const;
Standard_EXPORT Standard_Real MaxError(const Standard_Integer Index) const;
Standard_EXPORT Standard_Real AverageError(const Standard_Integer Index) const;
//! display information on approximation
Standard_EXPORT void Dump(Standard_OStream& o) const;
protected:
private:
Standard_Integer myTotalNumSS;
Standard_Integer myTotalDimension;
Standard_Integer myNbGaussPoints;
Standard_Integer myWorkDegree;
Standard_Integer myNivConstr;
Handle(PLib_JacobiPolynomial) myJacPol;
Handle(TColStd_HArray1OfReal) myTabPoints;
Handle(TColStd_HArray2OfReal) myTabWeights;
Standard_Address myEvaluator;
Standard_Integer myDegree;
Handle(TColStd_HArray1OfReal) myCoeff;
Handle(TColStd_HArray2OfReal) myFirstConstr;
Handle(TColStd_HArray2OfReal) myLastConstr;
Handle(TColStd_HArray1OfReal) mySomTab;
Handle(TColStd_HArray1OfReal) myDifTab;
Handle(TColStd_HArray1OfReal) myMaxError;
Handle(TColStd_HArray1OfReal) myAverageError;
Standard_Boolean done;
};
#endif // _AdvApprox_SimpleApprox_HeaderFile

View File

@ -0,0 +1,102 @@
// Created on: 1997-09-11
// Created by: Philippe MANGIN
// Copyright (c) 1997-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 _AppDef_SmoothCriterion_HeaderFile
#define _AppDef_SmoothCriterion_HeaderFile
#include "Standard.hxx"
#include "Standard_Transient.hxx"
#include "TColStd_HArray1OfReal.hxx"
#include "Standard_Real.hxx"
#include "FEmTool_HAssemblyTable.hxx"
#include "TColStd_HArray2OfInteger.hxx"
#include "Standard_Integer.hxx"
#include "math_Vector.hxx"
#include "TColStd_Array1OfReal.hxx"
class FEmTool_Curve;
class math_Matrix;
class AppDef_SmoothCriterion;
DEFINE_STANDARD_HANDLE(AppDef_SmoothCriterion, Standard_Transient)
//! defined criterion to smooth points in curve
class AppDef_SmoothCriterion : public Standard_Transient
{
public:
Standard_EXPORT virtual void SetParameters(const Handle(TColStd_HArray1OfReal)& Parameters) = 0;
Standard_EXPORT virtual void SetCurve(const Handle(FEmTool_Curve)& C) = 0;
Standard_EXPORT virtual void GetCurve(Handle(FEmTool_Curve)& C) const = 0;
Standard_EXPORT virtual void SetEstimation(const Standard_Real E1,
const Standard_Real E2,
const Standard_Real E3) = 0;
Standard_EXPORT virtual Standard_Real& EstLength() = 0;
Standard_EXPORT virtual void GetEstimation(Standard_Real& E1,
Standard_Real& E2,
Standard_Real& E3) const = 0;
Standard_EXPORT virtual Handle(FEmTool_HAssemblyTable) AssemblyTable() const = 0;
Standard_EXPORT virtual Handle(TColStd_HArray2OfInteger) DependenceTable() const = 0;
Standard_EXPORT virtual Standard_Integer QualityValues(const Standard_Real J1min,
const Standard_Real J2min,
const Standard_Real J3min,
Standard_Real& J1,
Standard_Real& J2,
Standard_Real& J3) = 0;
Standard_EXPORT virtual void ErrorValues(Standard_Real& MaxError,
Standard_Real& QuadraticError,
Standard_Real& AverageError) = 0;
Standard_EXPORT virtual void Hessian(const Standard_Integer Element,
const Standard_Integer Dimension1,
const Standard_Integer Dimension2,
math_Matrix& H) = 0;
Standard_EXPORT virtual void Gradient(const Standard_Integer Element,
const Standard_Integer Dimension,
math_Vector& G) = 0;
//! Convert the assembly Vector in an Curve;
Standard_EXPORT virtual void InputVector(const math_Vector& X,
const Handle(FEmTool_HAssemblyTable)& AssTable) = 0;
Standard_EXPORT virtual void SetWeight(const Standard_Real QuadraticWeight,
const Standard_Real QualityWeight,
const Standard_Real percentJ1,
const Standard_Real percentJ2,
const Standard_Real percentJ3) = 0;
Standard_EXPORT virtual void GetWeight(Standard_Real& QuadraticWeight,
Standard_Real& QualityWeight) const = 0;
Standard_EXPORT virtual void SetWeight(const TColStd_Array1OfReal& Weight) = 0;
DEFINE_STANDARD_RTTIEXT(AppDef_SmoothCriterion, Standard_Transient)
protected:
private:
};
#endif // _AppDef_SmoothCriterion_HeaderFile

View File

@ -0,0 +1,283 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-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 _AppDef_TheLeastSquares_HeaderFile
#define _AppDef_TheLeastSquares_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "AppParCurves_Constraint.hxx"
#include "AppParCurves_MultiBSpCurve.hxx"
#include "TColStd_HArray1OfReal.hxx"
#include "TColStd_HArray1OfInteger.hxx"
#include "math_Matrix.hxx"
#include "math_Vector.hxx"
#include "math_IntegerVector.hxx"
#include "Standard_Real.hxx"
#include "Standard_Integer.hxx"
#include "TColStd_Array1OfReal.hxx"
#include "TColStd_Array1OfInteger.hxx"
class StdFail_NotDone;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_NoSuchObject;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class AppDef_TheLeastSquares
{
public:
DEFINE_STANDARD_ALLOC
//! given a MultiLine, this algorithm computes the least
//! square resolution using the Householder-QR method.
//! If the first and/or the last point is a constraint
//! point, the value of the tangency or curvature is
//! computed in the resolution.
//! NbPol is the number of control points wanted
//! for the approximating curves.
//! The system to solve is the following:
//! A X = B.
//! Where A is the Bernstein matrix computed with the
//! parameters, B the points coordinates and X the poles
//! solutions.
//! The matrix A is the same for each coordinate x, y and z
//! and is also the same for each MultiLine point because
//! they are approximated in parallel(so with the same
//! parameter, only the vector B changes).
Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP,
const Standard_Integer FirstPoint,
const Standard_Integer LastPoint,
const AppParCurves_Constraint FirstCons,
const AppParCurves_Constraint LastCons,
const math_Vector& Parameters,
const Standard_Integer NbPol);
//! Initializes the fields of the object.
Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP,
const Standard_Integer FirstPoint,
const Standard_Integer LastPoint,
const AppParCurves_Constraint FirstCons,
const AppParCurves_Constraint LastCons,
const Standard_Integer NbPol);
//! given a MultiLine, this algorithm computes the least
//! square resolution using the Householder-QR method.
//! If the first and/or the last point is a constraint
//! point, the value of the tangency or curvature is
//! computed in the resolution.
//! Deg is the degree wanted for the approximating curves.
//! The system to solve is the following:
//! A X = B.
//! Where A is the BSpline functions matrix computed with
//! <parameters>, B the points coordinates and X the poles
//! solutions.
//! The matrix A is the same for each coordinate x, y and z
//! and is also the same for each MultiLine point because
//! they are approximated in parallel(so with the same
//! parameter, only the vector B changes).
Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
const Standard_Integer FirstPoint,
const Standard_Integer LastPoint,
const AppParCurves_Constraint FirstCons,
const AppParCurves_Constraint LastCons,
const math_Vector& Parameters,
const Standard_Integer NbPol);
//! Initializes the fields of the object.
Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
const Standard_Integer FirstPoint,
const Standard_Integer LastPoint,
const AppParCurves_Constraint FirstCons,
const AppParCurves_Constraint LastCons,
const Standard_Integer NbPol);
//! Is used after having initialized the fields.
//! The case "CurvaturePoint" is not treated in this method.
Standard_EXPORT void Perform(const math_Vector& Parameters);
//! Is used after having initialized the fields.
Standard_EXPORT void Perform(const math_Vector& Parameters,
const Standard_Real l1,
const Standard_Real l2);
//! Is used after having initialized the fields.
//! <V1t> is the tangent vector at the first point.
//! <V2t> is the tangent vector at the last point.
Standard_EXPORT void Perform(const math_Vector& Parameters,
const math_Vector& V1t,
const math_Vector& V2t,
const Standard_Real l1,
const Standard_Real l2);
//! Is used after having initialized the fields.
//! <V1t> is the tangent vector at the first point.
//! <V2t> is the tangent vector at the last point.
//! <V1c> is the tangent vector at the first point.
//! <V2c> is the tangent vector at the last point.
Standard_EXPORT void Perform(const math_Vector& Parameters,
const math_Vector& V1t,
const math_Vector& V2t,
const math_Vector& V1c,
const math_Vector& V2c,
const Standard_Real l1,
const Standard_Real l2);
//! returns True if all has been correctly done.
Standard_EXPORT Standard_Boolean IsDone() const;
//! returns the result of the approximation, i.e. all the
//! Curves.
//! An exception is raised if NotDone.
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
//! returns the result of the approximation, i.e. all the
//! Curves.
//! An exception is raised if NotDone.
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
//! returns the function matrix used to approximate the
//! set.
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
//! returns the derivative function matrix used
//! to approximate the set.
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
//! returns the maximum errors between the MultiLine
//! and the approximation curves. F is the sum of the square
//! distances. Grad is the derivative vector of the
//! function F.
Standard_EXPORT void ErrorGradient(math_Vector& Grad,
Standard_Real& F,
Standard_Real& MaxE3d,
Standard_Real& MaxE2d);
//! returns the distances between the points of the
//! multiline and the approximation curves.
Standard_EXPORT const math_Matrix& Distance();
//! returns the maximum errors between the MultiLine
//! and the approximation curves. F is the sum of the square
//! distances.
Standard_EXPORT void Error(Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
//! returns the value (P2 - P1)/ V1 if the first point
//! was a tangency point.
Standard_EXPORT Standard_Real FirstLambda() const;
//! returns the value (PN - PN-1)/ VN if the last point
//! was a tangency point.
Standard_EXPORT Standard_Real LastLambda() const;
//! returns the matrix of points value.
Standard_EXPORT const math_Matrix& Points() const;
//! returns the matrix of resulting control points value.
Standard_EXPORT const math_Matrix& Poles() const;
//! Returns the indexes of the first non null values of
//! A and DA.
//! The values are non null from Index(ieme point) +1
//! to Index(ieme point) + degree +1.
Standard_EXPORT const math_IntegerVector& KIndex() const;
protected:
//! is used by the constructors above.
Standard_EXPORT void Init(const AppDef_MultiLine& SSP,
const Standard_Integer FirstPoint,
const Standard_Integer LastPoint);
//! returns the number of second member columns.
//! Is used internally to initialize the fields.
Standard_EXPORT Standard_Integer NbBColumns(const AppDef_MultiLine& SSP) const;
//! returns the first point being fitted.
Standard_EXPORT Standard_Integer TheFirstPoint(const AppParCurves_Constraint FirstCons,
const Standard_Integer FirstPoint) const;
//! returns the last point being fitted.
Standard_EXPORT Standard_Integer TheLastPoint(const AppParCurves_Constraint LastCons,
const Standard_Integer LastPoint) const;
//! Affects the fields in the case of a constraint point.
Standard_EXPORT void Affect(const AppDef_MultiLine& SSP,
const Standard_Integer Index,
AppParCurves_Constraint& Cons,
math_Vector& Vt,
math_Vector& Vc);
Standard_EXPORT void ComputeFunction(const math_Vector& Parameters);
Standard_EXPORT void SearchIndex(math_IntegerVector& Index);
//! computes internal matrixes for the resolution
Standard_EXPORT void MakeTAA(math_Vector& TheA, math_Vector& TheB);
//! computes internal matrixes for the resolution
Standard_EXPORT void MakeTAA(math_Vector& TheA);
//! computes internal matrixes for the resolution
Standard_EXPORT void MakeTAA(math_Vector& TheA, math_Matrix& TheB);
private:
AppParCurves_Constraint FirstConstraint;
AppParCurves_Constraint LastConstraint;
AppParCurves_MultiBSpCurve SCU;
Handle(TColStd_HArray1OfReal) myknots;
Handle(TColStd_HArray1OfInteger) mymults;
math_Matrix mypoles;
math_Matrix A;
math_Matrix DA;
math_Matrix B2;
math_Matrix mypoints;
math_Vector Vflatknots;
math_Vector Vec1t;
math_Vector Vec1c;
math_Vector Vec2t;
math_Vector Vec2c;
math_Matrix theError;
math_IntegerVector myindex;
Standard_Real lambda1;
Standard_Real lambda2;
Standard_Integer FirstP;
Standard_Integer LastP;
Standard_Integer Nlignes;
Standard_Integer Ninc;
Standard_Integer NA;
Standard_Integer myfirstp;
Standard_Integer mylastp;
Standard_Integer resinit;
Standard_Integer resfin;
Standard_Integer nbP2d;
Standard_Integer nbP;
Standard_Integer nbpoles;
Standard_Integer deg;
Standard_Boolean done;
Standard_Boolean iscalculated;
Standard_Boolean isready;
};
#endif // _AppDef_TheLeastSquares_HeaderFile

View File

@ -0,0 +1,32 @@
// Created on: 1991-04-11
// Created by: Laurent PAINNOT
// Copyright (c) 1991-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 _AppParCurves_Constraint_HeaderFile
#define _AppParCurves_Constraint_HeaderFile
//! - NoConstraint: this point has no constraints.
//! - PassPoint: the approximation curve passes through this point.
//! - TangencyPoint: this point has a tangency constraint.
//! - CurvaturePoint: this point has a curvature constraint.
enum AppParCurves_Constraint
{
AppParCurves_NoConstraint,
AppParCurves_PassPoint,
AppParCurves_TangencyPoint,
AppParCurves_CurvaturePoint
};
#endif // _AppParCurves_Constraint_HeaderFile

View File

@ -0,0 +1,213 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-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 _AppParCurves_MultiCurve_HeaderFile
#define _AppParCurves_MultiCurve_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "AppParCurves_HArray1OfMultiPoint.hxx"
#include "Standard_Integer.hxx"
#include "AppParCurves_Array1OfMultiPoint.hxx"
#include "TColgp_Array1OfPnt.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "Standard_Real.hxx"
#include "Standard_OStream.hxx"
class AppParCurves_MultiPoint;
class gp_Pnt;
class gp_Pnt2d;
class gp_Vec;
class gp_Vec2d;
//! This class describes a MultiCurve approximating a Multiline.
//! As a Multiline is a set of n lines, a MultiCurve is a set
//! of n curves. These curves are Bezier curves.
//! A MultiCurve is composed of m MultiPoint.
//! The approximating degree of these n curves is the same for
//! each one.
//!
//! Example of a MultiCurve composed of MultiPoints:
//!
//! P1______P2_____P3______P4________........_____PNbMPoints
//!
//! Q1______Q2_____Q3______Q4________........_____QNbMPoints
//! . .
//! . .
//! . .
//! R1______R2_____R3______R4________........_____RNbMPoints
//!
//! Pi, Qi, ..., Ri are points of dimension 2 or 3.
//!
//! (Pi, Qi, ...Ri), i= 1,...NbPoles are MultiPoints.
//! each MultiPoint has got NbPol Poles.
class AppParCurves_MultiCurve
{
public:
DEFINE_STANDARD_ALLOC
//! returns an indefinite MultiCurve.
Standard_EXPORT AppParCurves_MultiCurve();
//! creates a MultiCurve, describing Bezier curves all
//! containing the same number of MultiPoint.
//! An exception is raised if Degree < 0.
Standard_EXPORT AppParCurves_MultiCurve(const Standard_Integer NbPol);
//! creates a MultiCurve, describing Bezier curves all
//! containing the same number of MultiPoint.
//! Each MultiPoint must have NbCurves Poles.
Standard_EXPORT AppParCurves_MultiCurve(const AppParCurves_Array1OfMultiPoint& tabMU);
Standard_EXPORT virtual ~AppParCurves_MultiCurve();
//! The number of poles of the MultiCurve
//! will be set to <nbPoles>.
Standard_EXPORT void SetNbPoles(const Standard_Integer nbPoles);
//! sets the MultiPoint of range Index to the value
//! <MPoint>.
//! An exception is raised if Index <0 or Index >NbMPoint.
Standard_EXPORT void SetValue(const Standard_Integer Index,
const AppParCurves_MultiPoint& MPoint);
//! Returns the number of curves resulting from the
//! approximation of a MultiLine.
Standard_EXPORT Standard_Integer NbCurves() const;
//! Returns the number of poles on curves resulting from the approximation of a MultiLine.
Standard_EXPORT virtual Standard_Integer NbPoles() const;
//! returns the degree of the curves.
Standard_EXPORT virtual Standard_Integer Degree() const;
//! returns the dimension of the CuIndex curve.
//! An exception is raised if CuIndex<0 or CuIndex>NbCurves.
Standard_EXPORT Standard_Integer Dimension(const Standard_Integer CuIndex) const;
//! returns the Pole array of the curve of range CuIndex.
//! An exception is raised if the dimension of the curve
//! is 2d.
Standard_EXPORT void Curve(const Standard_Integer CuIndex, TColgp_Array1OfPnt& TabPnt) const;
//! returns the Pole array of the curve of range CuIndex.
//! An exception is raised if the dimension of the curve
//! is 3d.
Standard_EXPORT void Curve(const Standard_Integer CuIndex, TColgp_Array1OfPnt2d& TabPnt) const;
//! returns the Index MultiPoint.
//! An exception is raised if Index <0 or Index >Degree+1.
Standard_EXPORT const AppParCurves_MultiPoint& Value(const Standard_Integer Index) const;
//! returns the Nieme pole of the CuIndex curve.
//! the curve must be a 3D curve.
Standard_EXPORT const gp_Pnt& Pole(const Standard_Integer CuIndex,
const Standard_Integer Nieme) const;
//! returns the Nieme pole of the CuIndex curve.
//! the curve must be a 2D curve.
Standard_EXPORT const gp_Pnt2d& Pole2d(const Standard_Integer CuIndex,
const Standard_Integer Nieme) const;
//! Applies a transformation to the curve of range
//! <CuIndex>.
//! newx = x + dx*oldx
//! newy = y + dy*oldy for all points of the curve.
//! newz = z + dz*oldz
Standard_EXPORT void Transform(const Standard_Integer CuIndex,
const Standard_Real x,
const Standard_Real dx,
const Standard_Real y,
const Standard_Real dy,
const Standard_Real z,
const Standard_Real dz);
//! Applies a transformation to the Curve of range
//! <CuIndex>.
//! newx = x + dx*oldx
//! newy = y + dy*oldy for all points of the curve.
Standard_EXPORT void Transform2d(const Standard_Integer CuIndex,
const Standard_Real x,
const Standard_Real dx,
const Standard_Real y,
const Standard_Real dy);
//! returns the value of the point with a parameter U
//! on the Bezier curve number CuIndex.
//! An exception is raised if CuIndex <0 or > NbCurves.
//! An exception is raised if the curve dimension is 2d.
Standard_EXPORT virtual void Value(const Standard_Integer CuIndex,
const Standard_Real U,
gp_Pnt& Pt) const;
//! returns the value of the point with a parameter U
//! on the Bezier curve number CuIndex.
//! An exception is raised if CuIndex <0 or > NbCurves.
//! An exception is raised if the curve dimension is 3d.
Standard_EXPORT virtual void Value(const Standard_Integer CuIndex,
const Standard_Real U,
gp_Pnt2d& Pt) const;
//! returns the value of the point with a parameter U
//! on the Bezier curve number CuIndex.
//! An exception is raised if CuIndex <0 or > NbCurves.
//! An exception is raised if the curve dimension is 3d.
Standard_EXPORT virtual void D1(const Standard_Integer CuIndex,
const Standard_Real U,
gp_Pnt& Pt,
gp_Vec& V1) const;
//! returns the value of the point with a parameter U
//! on the Bezier curve number CuIndex.
//! An exception is raised if CuIndex <0 or > NbCurves.
//! An exception is raised if the curve dimension is 2d.
Standard_EXPORT virtual void D1(const Standard_Integer CuIndex,
const Standard_Real U,
gp_Pnt2d& Pt,
gp_Vec2d& V1) const;
//! returns the value of the point with a parameter U
//! on the Bezier curve number CuIndex.
//! An exception is raised if CuIndex <0 or > NbCurves.
//! An exception is raised if the curve dimension is 3d.
Standard_EXPORT virtual void D2(const Standard_Integer CuIndex,
const Standard_Real U,
gp_Pnt& Pt,
gp_Vec& V1,
gp_Vec& V2) const;
//! returns the value of the point with a parameter U
//! on the Bezier curve number CuIndex.
//! An exception is raised if CuIndex <0 or > NbCurves.
//! An exception is raised if the curve dimension is 2d.
Standard_EXPORT virtual void D2(const Standard_Integer CuIndex,
const Standard_Real U,
gp_Pnt2d& Pt,
gp_Vec2d& V1,
gp_Vec2d& V2) const;
//! Prints on the stream o information on the current
//! state of the object.
//! Is used to redefine the operator <<.
Standard_EXPORT virtual void Dump(Standard_OStream& o) const;
protected:
Handle(AppParCurves_HArray1OfMultiPoint) tabPoint;
private:
};
#endif // _AppParCurves_MultiCurve_HeaderFile

View File

@ -0,0 +1,141 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-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 _AppParCurves_MultiPoint_HeaderFile
#define _AppParCurves_MultiPoint_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "Standard_Integer.hxx"
#include "TColgp_Array1OfPnt.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "Standard_Real.hxx"
#include "Standard_OStream.hxx"
class Standard_Transient;
class gp_Pnt;
class gp_Pnt2d;
//! This class describes Points composing a MultiPoint.
//! These points can be 2D or 3D. The user must first give the
//! 3D Points and then the 2D Points.
//! They are Poles of a Bezier Curve.
//! This class is used either to define data input or
//! results when performing the approximation of several lines in parallel.
class AppParCurves_MultiPoint
{
public:
DEFINE_STANDARD_ALLOC
//! creates an indefinite MultiPoint.
Standard_EXPORT AppParCurves_MultiPoint();
//! constructs a set of Points used to approximate a
//! Multiline.
//! These Points can be of 2 or 3 dimensions.
//! Points will be initialized with SetPoint and SetPoint2d.
//! NbPoints is the number of 3D Points.
//! NbPoints2d is the number of 2D Points.
Standard_EXPORT AppParCurves_MultiPoint(const Standard_Integer NbPoints,
const Standard_Integer NbPoints2d);
//! creates a MultiPoint only composed of 3D points.
Standard_EXPORT AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP);
//! creates a MultiPoint only composed of 2D points.
Standard_EXPORT AppParCurves_MultiPoint(const TColgp_Array1OfPnt2d& tabP2d);
//! constructs a set of Points used to approximate a
//! Multiline.
//! These Points can be of 2 or 3 dimensions.
//! Points will be initialized with SetPoint and SetPoint2d.
//! NbPoints is the total number of Points.
Standard_EXPORT AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP,
const TColgp_Array1OfPnt2d& tabP2d);
Standard_EXPORT virtual ~AppParCurves_MultiPoint();
//! the 3d Point of range Index of this MultiPoint is
//! set to <Point>.
//! An exception is raised if Index < 0 or
//! Index > number of 3d Points.
Standard_EXPORT void SetPoint(const Standard_Integer Index, const gp_Pnt& Point);
//! returns the 3d Point of range Index.
//! An exception is raised if Index < 0 or
//! Index < number of 3d Points.
Standard_EXPORT const gp_Pnt& Point(const Standard_Integer Index) const;
//! The 2d Point of range Index is set to <Point>.
//! An exception is raised if Index > 3d Points or
//! Index > total number of Points.
Standard_EXPORT void SetPoint2d(const Standard_Integer Index, const gp_Pnt2d& Point);
//! returns the 2d Point of range Index.
//! An exception is raised if index <= number of
//! 3d Points or Index > total number of Points.
Standard_EXPORT const gp_Pnt2d& Point2d(const Standard_Integer Index) const;
//! returns the dimension of the point of range Index.
//! An exception is raised if Index <0 or Index > NbCurves.
Standard_Integer Dimension(const Standard_Integer Index) const;
//! returns the number of points of dimension 3D.
Standard_Integer NbPoints() const;
//! returns the number of points of dimension 2D.
Standard_Integer NbPoints2d() const;
//! Applies a transformation to the curve of range
//! <CuIndex>.
//! newx = x + dx*oldx
//! newy = y + dy*oldy for all points of the curve.
//! newz = z + dz*oldz
Standard_EXPORT void Transform(const Standard_Integer CuIndex,
const Standard_Real x,
const Standard_Real dx,
const Standard_Real y,
const Standard_Real dy,
const Standard_Real z,
const Standard_Real dz);
//! Applies a transformation to the Curve of range
//! <CuIndex>.
//! newx = x + dx*oldx
//! newy = y + dy*oldy for all points of the curve.
Standard_EXPORT void Transform2d(const Standard_Integer CuIndex,
const Standard_Real x,
const Standard_Real dx,
const Standard_Real y,
const Standard_Real dy);
//! Prints on the stream o information on the current
//! state of the object.
//! Is used to redefine the operator <<.
Standard_EXPORT virtual void Dump(Standard_OStream& o) const;
protected:
Handle(Standard_Transient) ttabPoint;
Handle(Standard_Transient) ttabPoint2d;
Standard_Integer nbP;
Standard_Integer nbP2d;
private:
};
#include "AppParCurves_MultiPoint.lxx"
#endif // _AppParCurves_MultiPoint_HeaderFile

View File

@ -0,0 +1,49 @@
// Copyright (c) 1995-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 "Standard_OutOfRange.hxx"
#include "gp_Pnt.hxx"
#include "gp_Pnt2d.hxx"
inline Standard_OStream& operator<<(Standard_OStream& o, const AppParCurves_MultiPoint& M)
{
M.Dump(o);
return o;
}
inline Standard_Integer AppParCurves_MultiPoint::NbPoints() const
{
return nbP;
}
inline Standard_Integer AppParCurves_MultiPoint::NbPoints2d() const
{
return nbP2d;
}
inline Standard_Integer AppParCurves_MultiPoint::Dimension(const Standard_Integer Index) const
{
if (Index < 0 || Index > (nbP + nbP2d))
{
throw Standard_OutOfRange();
}
if (Index <= nbP)
{
return 3;
}
else
{
return 2;
}
}

View File

@ -0,0 +1,185 @@
// Created on: 1993-03-30
// Created by: Laurent BUCHARD
// 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 TheMultiLine_hxx
#include "TColgp_Array1OfPnt.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "TColgp_Array1OfVec.hxx"
#include "TColgp_Array1OfVec2d.hxx"
#include "Approx_Status.hxx"
//=================================================================================================
inline Standard_Integer ApproxInt_MultiLineTool::NbP2d(const TheMultiLine& ML)
{
return (ML.NbP2d());
}
//=================================================================================================
inline Standard_Integer ApproxInt_MultiLineTool::NbP3d(const TheMultiLine& ML)
{
return (ML.NbP3d());
}
//=================================================================================================
inline Standard_Integer ApproxInt_MultiLineTool::FirstPoint(const TheMultiLine& ML)
{
return (ML.FirstPoint());
}
//=================================================================================================
inline Standard_Integer ApproxInt_MultiLineTool::LastPoint(const TheMultiLine& ML)
{
return (ML.LastPoint());
}
//=================================================================================================
inline void ApproxInt_MultiLineTool::Value(const TheMultiLine& ML,
const Standard_Integer Index,
TColgp_Array1OfPnt& TabPnt)
{
ML.Value(Index, TabPnt);
}
//=================================================================================================
inline void ApproxInt_MultiLineTool::Value(const TheMultiLine& ML,
const Standard_Integer Index,
TColgp_Array1OfPnt2d& TabPnt2d)
{
ML.Value(Index, TabPnt2d);
}
//=================================================================================================
inline void ApproxInt_MultiLineTool::Value(const TheMultiLine& ML,
const Standard_Integer Index,
TColgp_Array1OfPnt& TabPnt,
TColgp_Array1OfPnt2d& TabPnt2d)
{
ML.Value(Index, TabPnt, TabPnt2d);
}
//=================================================================================================
inline Standard_Boolean ApproxInt_MultiLineTool::Tangency(const TheMultiLine& ML,
const Standard_Integer Index,
TColgp_Array1OfVec& TabVec)
{
return (ML.Tangency(Index, TabVec));
}
//=================================================================================================
inline Standard_Boolean ApproxInt_MultiLineTool::Tangency(const TheMultiLine& ML,
const Standard_Integer Index,
TColgp_Array1OfVec2d& TabVec2d)
{
return (ML.Tangency(Index, TabVec2d));
}
//=================================================================================================
inline Standard_Boolean ApproxInt_MultiLineTool::Tangency(const TheMultiLine& ML,
const Standard_Integer Index,
TColgp_Array1OfVec& TabVec,
TColgp_Array1OfVec2d& TabVec2d)
{
return (ML.Tangency(Index, TabVec, TabVec2d));
}
//=================================================================================================
inline Standard_Boolean ApproxInt_MultiLineTool::Curvature(const TheMultiLine& // ML
,
const Standard_Integer // Index
,
TColgp_Array1OfVec&)
{ // TabVec
return Standard_False;
}
//=================================================================================================
inline Standard_Boolean ApproxInt_MultiLineTool::Curvature(const TheMultiLine& // ML
,
const Standard_Integer // Index
,
TColgp_Array1OfVec2d&)
{ // TabVec2d
return Standard_False;
}
//=================================================================================================
inline Standard_Boolean ApproxInt_MultiLineTool::Curvature(const TheMultiLine& // ML
,
const Standard_Integer // Index
,
TColgp_Array1OfVec& // TabVec
,
TColgp_Array1OfVec2d&)
{ // TabVec2d
return Standard_False;
}
//=================================================================================================
inline Approx_Status ApproxInt_MultiLineTool::WhatStatus(const TheMultiLine& ML,
const Standard_Integer,
const Standard_Integer)
{
//-- PointsAdded,
//-- NoPointsAdded,
//-- NoApproximation
//-- Approx_PointsAdded
return (ML.WhatStatus());
}
//=================================================================================================
inline TheMultiLine ApproxInt_MultiLineTool::MakeMLBetween(const TheMultiLine& ML,
const Standard_Integer I1,
const Standard_Integer I2,
const Standard_Integer NbPMin)
{
return (ML.MakeMLBetween(I1, I2, NbPMin));
}
//=================================================================================================
inline Standard_Boolean ApproxInt_MultiLineTool::MakeMLOneMorePoint(const TheMultiLine& ML,
const Standard_Integer I1,
const Standard_Integer I2,
const Standard_Integer indbad,
TheMultiLine& OtherLine)
{
return (ML.MakeMLOneMorePoint(I1, I2, indbad, OtherLine));
}
inline void ApproxInt_MultiLineTool::Dump(const TheMultiLine& ML)
{
ML.Dump();
}
//=================================================================================================

View File

@ -0,0 +1,25 @@
// Created on: 1993-01-26
// Created by: Laurent PAINNOT
// 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 Approx_Array1OfAdHSurface_HeaderFile
#define Approx_Array1OfAdHSurface_HeaderFile
#include "Adaptor3d_Surface.hxx"
#include "NCollection_Array1.hxx"
typedef NCollection_Array1<Handle(Adaptor3d_Surface)> Approx_Array1OfAdHSurface;
#endif

View File

@ -0,0 +1,25 @@
// Created on: 1993-01-26
// Created by: Laurent PAINNOT
// 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 Approx_Array1OfGTrsf2d_HeaderFile
#define Approx_Array1OfGTrsf2d_HeaderFile
#include "NCollection_Array1.hxx"
#include "gp_GTrsf2d.hxx"
typedef NCollection_Array1<gp_GTrsf2d> Approx_Array1OfGTrsf2d;
#endif

View File

@ -0,0 +1,25 @@
// Created on: 1993-01-26
// Created by: Laurent PAINNOT
// 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 Approx_HArray1OfGTrsf2d_HeaderFile
#define Approx_HArray1OfGTrsf2d_HeaderFile
#include "Approx_Array1OfGTrsf2d.hxx"
#include "NCollection_DefineHArray1.hxx"
DEFINE_HARRAY1(Approx_HArray1OfGTrsf2d, Approx_Array1OfGTrsf2d)
#endif

View File

@ -0,0 +1,55 @@
// Created on: 1994-02-21
// Created by: Laurent PAINNOT
// Copyright (c) 1994-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 _Approx_MCurvesToBSpCurve_HeaderFile
#define _Approx_MCurvesToBSpCurve_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "AppParCurves_MultiBSpCurve.hxx"
#include "AppParCurves_SequenceOfMultiCurve.hxx"
class AppParCurves_MultiCurve;
class Approx_MCurvesToBSpCurve
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT Approx_MCurvesToBSpCurve();
Standard_EXPORT void Reset();
Standard_EXPORT void Append(const AppParCurves_MultiCurve& MC);
Standard_EXPORT void Perform();
Standard_EXPORT void Perform(const AppParCurves_SequenceOfMultiCurve& TheSeq);
//! return the composite MultiCurves as a MultiBSpCurve.
Standard_EXPORT const AppParCurves_MultiBSpCurve& Value() const;
//! return the composite MultiCurves as a MultiBSpCurve.
Standard_EXPORT const AppParCurves_MultiBSpCurve& ChangeValue();
protected:
private:
AppParCurves_MultiBSpCurve mySpline;
Standard_Boolean myDone;
AppParCurves_SequenceOfMultiCurve myCurves;
};
#endif // _Approx_MCurvesToBSpCurve_HeaderFile

View File

@ -0,0 +1,240 @@
// Created on: 1997-06-24
// Created by: Philippe MANGIN
// Copyright (c) 1997-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 _Approx_SweepApproximation_HeaderFile
#define _Approx_SweepApproximation_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "AdvApprox_EvaluatorFunction.hxx"
#include "Approx_HArray1OfGTrsf2d.hxx"
#include "GeomAbs_Shape.hxx"
#include "Standard_Integer.hxx"
#include "Standard_OStream.hxx"
#include "TColStd_Array1OfInteger.hxx"
#include "TColStd_Array1OfReal.hxx"
#include "TColStd_Array2OfReal.hxx"
#include "TColStd_HArray1OfInteger.hxx"
#include "TColStd_HArray1OfReal.hxx"
#include "TColStd_HArray2OfReal.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "TColgp_Array2OfPnt.hxx"
#include "TColgp_HArray1OfPnt.hxx"
#include "TColgp_HArray1OfPnt2d.hxx"
#include "TColgp_HArray1OfVec.hxx"
#include "TColgp_HArray1OfVec2d.hxx"
#include "TColgp_HArray2OfPnt.hxx"
#include "TColgp_SequenceOfArray1OfPnt2d.hxx"
#include "gp_Vec.hxx"
class Approx_SweepFunction;
class AdvApprox_Cutting;
//! Approximation of an Surface S(u,v)
//! (and eventually associate 2d Curves) defined
//! by section's law.
//!
//! This surface is defined by a function F(u, v)
//! where Ft(u) = F(u, t) is a bspline curve.
//! To use this algorithme, you have to implement Ft(u)
//! as a derivative class of Approx_SweepFunction.
//! This algorithm can be used by blending, sweeping...
class Approx_SweepApproximation
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT Approx_SweepApproximation(const Handle(Approx_SweepFunction)& Func);
//! Perform the Approximation
//! [First, Last] : Approx_SweepApproximation.cdl
//! Tol3d : Tolerance to surface approximation
//! Tol2d : Tolerance used to perform curve approximation
//! Normally the 2d curve are approximated with a
//! tolerance given by the resolution on support surfaces,
//! but if this tolerance is too large Tol2d is used.
//! TolAngular : Tolerance (in radian) to control the angle
//! between tangents on the section law and
//! tangent of iso-v on approximated surface
//! Continuity : The continuity in v waiting on the surface
//! Degmax : The maximum degree in v required on the surface
//! Segmax : The maximum number of span in v required on
//! the surface
//! Warning : The continuity ci can be obtained only if Ft is Ci
Standard_EXPORT void Perform(const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol3d,
const Standard_Real BoundTol,
const Standard_Real Tol2d,
const Standard_Real TolAngular,
const GeomAbs_Shape Continuity = GeomAbs_C0,
const Standard_Integer Degmax = 11,
const Standard_Integer Segmax = 50);
//! The EvaluatorFunction from AdvApprox;
Standard_EXPORT Standard_Integer Eval(const Standard_Real Parameter,
const Standard_Integer DerivativeRequest,
const Standard_Real First,
const Standard_Real Last,
Standard_Real& Result);
//! returns if we have an result
Standard_Boolean IsDone() const;
Standard_EXPORT void SurfShape(Standard_Integer& UDegree,
Standard_Integer& VDegree,
Standard_Integer& NbUPoles,
Standard_Integer& NbVPoles,
Standard_Integer& NbUKnots,
Standard_Integer& NbVKnots) const;
Standard_EXPORT void Surface(TColgp_Array2OfPnt& TPoles,
TColStd_Array2OfReal& TWeights,
TColStd_Array1OfReal& TUKnots,
TColStd_Array1OfReal& TVKnots,
TColStd_Array1OfInteger& TUMults,
TColStd_Array1OfInteger& TVMults) const;
Standard_Integer UDegree() const;
Standard_Integer VDegree() const;
const TColgp_Array2OfPnt& SurfPoles() const;
const TColStd_Array2OfReal& SurfWeights() const;
const TColStd_Array1OfReal& SurfUKnots() const;
const TColStd_Array1OfReal& SurfVKnots() const;
const TColStd_Array1OfInteger& SurfUMults() const;
const TColStd_Array1OfInteger& SurfVMults() const;
//! returns the maximum error in the surface approximation.
Standard_EXPORT Standard_Real MaxErrorOnSurf() const;
//! returns the average error in the surface approximation.
Standard_EXPORT Standard_Real AverageErrorOnSurf() const;
Standard_Integer NbCurves2d() const;
Standard_EXPORT void Curves2dShape(Standard_Integer& Degree,
Standard_Integer& NbPoles,
Standard_Integer& NbKnots) const;
Standard_EXPORT void Curve2d(const Standard_Integer Index,
TColgp_Array1OfPnt2d& TPoles,
TColStd_Array1OfReal& TKnots,
TColStd_Array1OfInteger& TMults) const;
Standard_Integer Curves2dDegree() const;
const TColgp_Array1OfPnt2d& Curve2dPoles(const Standard_Integer Index) const;
const TColStd_Array1OfReal& Curves2dKnots() const;
const TColStd_Array1OfInteger& Curves2dMults() const;
//! returns the maximum error of the <Index>
//! 2d curve approximation.
Standard_EXPORT Standard_Real Max2dError(const Standard_Integer Index) const;
//! returns the average error of the <Index>
//! 2d curve approximation.
Standard_EXPORT Standard_Real Average2dError(const Standard_Integer Index) const;
//! returns the maximum 3d error of the <Index>
//! 2d curve approximation on the Surface.
Standard_EXPORT Standard_Real TolCurveOnSurf(const Standard_Integer Index) const;
//! display information on approximation.
Standard_EXPORT void Dump(Standard_OStream& o) const;
protected:
private:
Standard_EXPORT void Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol,
const Handle(TColStd_HArray1OfReal)& TwoDTol,
const Handle(TColStd_HArray1OfReal)& ThreeDTol,
const Standard_Real BounTol,
const Standard_Real First,
const Standard_Real Last,
const GeomAbs_Shape Continuity,
const Standard_Integer Degmax,
const Standard_Integer Segmax,
const AdvApprox_EvaluatorFunction& TheApproxFunction,
const AdvApprox_Cutting& TheCuttingTool);
Standard_EXPORT Standard_Boolean D0(const Standard_Real Param,
const Standard_Real First,
const Standard_Real Last,
Standard_Real& Result);
Standard_EXPORT Standard_Boolean D1(const Standard_Real Param,
const Standard_Real First,
const Standard_Real Last,
Standard_Real& Result);
Standard_EXPORT Standard_Boolean D2(const Standard_Real Param,
const Standard_Real First,
const Standard_Real Last,
Standard_Real& Result);
Handle(Approx_SweepFunction) myFunc;
Standard_Boolean done;
Standard_Integer Num1DSS;
Standard_Integer Num2DSS;
Standard_Integer Num3DSS;
Standard_Integer udeg;
Standard_Integer vdeg;
Standard_Integer deg2d;
Handle(TColgp_HArray2OfPnt) tabPoles;
Handle(TColStd_HArray2OfReal) tabWeights;
Handle(TColStd_HArray1OfReal) tabUKnots;
Handle(TColStd_HArray1OfReal) tabVKnots;
Handle(TColStd_HArray1OfReal) tab2dKnots;
Handle(TColStd_HArray1OfInteger) tabUMults;
Handle(TColStd_HArray1OfInteger) tabVMults;
Handle(TColStd_HArray1OfInteger) tab2dMults;
TColgp_SequenceOfArray1OfPnt2d seqPoles2d;
Handle(TColStd_HArray1OfReal) MError1d;
Handle(TColStd_HArray1OfReal) tab2dError;
Handle(TColStd_HArray1OfReal) MError3d;
Handle(TColStd_HArray1OfReal) AError1d;
Handle(TColStd_HArray1OfReal) Ave2dError;
Handle(TColStd_HArray1OfReal) AError3d;
Handle(Approx_HArray1OfGTrsf2d) AAffin;
Handle(TColStd_HArray1OfReal) COnSurfErr;
gp_Vec Translation;
Handle(TColgp_HArray1OfPnt) myPoles;
Handle(TColgp_HArray1OfPnt2d) myPoles2d;
Handle(TColStd_HArray1OfReal) myWeigths;
Handle(TColgp_HArray1OfVec) myDPoles;
Handle(TColgp_HArray1OfVec) myD2Poles;
Handle(TColgp_HArray1OfVec2d) myDPoles2d;
Handle(TColgp_HArray1OfVec2d) myD2Poles2d;
Handle(TColStd_HArray1OfReal) myDWeigths;
Handle(TColStd_HArray1OfReal) myD2Weigths;
Standard_Integer myOrder;
Standard_Real myParam;
Standard_Real first;
Standard_Real last;
};
#include "Approx_SweepApproximation.lxx"
#endif // _Approx_SweepApproximation_HeaderFile

View File

@ -0,0 +1,167 @@
// Created on: 1997-06-26
// Created by: Philippe MANGIN
// Copyright (c) 1997-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 "StdFail_NotDone.hxx"
#include "TColStd_HArray1OfInteger.hxx"
#include "TColStd_HArray1OfReal.hxx"
#include "TColStd_HArray2OfReal.hxx"
#include "TColgp_HArray1OfPnt2d.hxx"
#include "TColgp_HArray2OfPnt.hxx"
inline Standard_Boolean Approx_SweepApproximation::IsDone() const
{
return done;
}
inline Standard_Integer Approx_SweepApproximation::UDegree() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
return udeg;
}
inline Standard_Integer Approx_SweepApproximation::VDegree() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
return vdeg;
}
inline const TColgp_Array2OfPnt& Approx_SweepApproximation::SurfPoles() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
return tabPoles->Array2();
}
inline const TColStd_Array2OfReal& Approx_SweepApproximation::SurfWeights() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
return tabWeights->Array2();
}
inline const TColStd_Array1OfReal& Approx_SweepApproximation::SurfUKnots() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
return tabUKnots->Array1();
}
inline const TColStd_Array1OfReal& Approx_SweepApproximation::SurfVKnots() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
return tabVKnots->Array1();
}
inline const TColStd_Array1OfInteger& Approx_SweepApproximation::SurfUMults() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
return tabUMults->Array1();
}
inline const TColStd_Array1OfInteger& Approx_SweepApproximation::SurfVMults() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
return tabVMults->Array1();
}
inline Standard_Integer Approx_SweepApproximation::NbCurves2d() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
return Num2DSS;
}
inline Standard_Integer Approx_SweepApproximation::Curves2dDegree() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
if (seqPoles2d.Length() == 0)
{
throw Standard_DomainError();
}
return deg2d;
}
inline const TColgp_Array1OfPnt2d& Approx_SweepApproximation::Curve2dPoles(
const Standard_Integer Index) const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
if (seqPoles2d.Length() == 0)
{
throw Standard_DomainError();
}
return seqPoles2d(Index)->Array1();
}
inline const TColStd_Array1OfReal& Approx_SweepApproximation::Curves2dKnots() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
if (seqPoles2d.Length() == 0)
{
throw Standard_DomainError();
}
return tab2dKnots->Array1();
}
inline const TColStd_Array1OfInteger& Approx_SweepApproximation::Curves2dMults() const
{
if (!done)
{
throw StdFail_NotDone(" Approx_SweepApproximation");
}
if (seqPoles2d.Length() == 0)
{
throw Standard_DomainError();
}
return tab2dMults->Array1();
}
/*
inline void Approx_SweepApproximation::TolReached(Standard_Real& Tol3d,Standard_Real& Tol2d) const
{
}*/

View File

@ -0,0 +1,132 @@
// Copyright (c) 2013-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 Aspect_DisplayConnection_HeaderFile
#define Aspect_DisplayConnection_HeaderFile
#include "Standard_Transient.hxx"
#include "Aspect_XAtom.hxx"
#include "Aspect_FBConfig.hxx"
#include "TCollection_AsciiString.hxx"
#include "NCollection_DataMap.hxx"
struct Aspect_XDisplay;
struct Aspect_XVisualInfo;
//! This class creates and provides connection with X server.
//! Raises exception if can not connect to X server.
//! On Windows and Mac OS X (in case when Cocoa used) platforms this class does nothing.
//! WARNING: Do not close display connection manually!
class Aspect_DisplayConnection : public Standard_Transient
{
DEFINE_STANDARD_RTTIEXT(Aspect_DisplayConnection, Standard_Transient)
public:
//! Default constructor. Creates connection with display name taken from "DISPLAY" environment
//! variable
Standard_EXPORT Aspect_DisplayConnection();
//! Destructor. Close opened connection.
Standard_EXPORT virtual ~Aspect_DisplayConnection();
//! Constructor. Creates connection with display specified in theDisplayName.
//! Display name should be in format "hostname:number" or "hostname:number.screen_number", where:
//! hostname - Specifies the name of the host machine on which the display is physically
//! attached. number - Specifies the number of the display server on that host machine.
//! screen_number - Specifies the screen to be used on that server. Optional variable.
Standard_EXPORT Aspect_DisplayConnection(const TCollection_AsciiString& theDisplayName);
//! Constructor wrapping existing Display instance.
//! WARNING! it is a responsibility of application to keep this pointer
//! valid while Aspect_DisplayConnection is alive and to close Display when it is no more needed.
Standard_EXPORT Aspect_DisplayConnection(Aspect_XDisplay* theDisplay);
//! @return pointer to Display structure that serves as the connection to the X server.
Aspect_XDisplay* GetDisplayAspect() { return myDisplay; }
//! @return TRUE if X Display has been allocated by this class
Standard_Boolean IsOwnDisplay() const { return myIsOwnDisplay; }
//! @return identifier(atom) for custom named property associated with windows that use current
//! connection to X server.
uint64_t GetAtom(const Aspect_XAtom theAtom) const { return myAtoms.Find(theAtom); }
//! @return display name for this connection.
const TCollection_AsciiString& GetDisplayName() { return myDisplayName; }
//! Open connection with display specified in myDisplayName class field
//! or takes theDisplay parameter when it is not NULL.
//! WARNING! When external Display is specified, it is a responsibility of application
//! to keep this pointer valid while Aspect_DisplayConnection is alive
//! and to close Display when it is no more needed.
//! @param theDisplay external pointer to allocated Display, or NULL if new connection should be
//! created
Standard_EXPORT void Init(Aspect_XDisplay* theDisplay);
//! Return default window visual or NULL when undefined.
Aspect_XVisualInfo* GetDefaultVisualInfo() const { return myDefVisualInfo; }
//! @return native Window FB config (GLXFBConfig on Xlib)
Aspect_FBConfig GetDefaultFBConfig() const { return myDefFBConfig; }
//! Set default window visual; the visual will be deallocated using XFree().
Standard_EXPORT void SetDefaultVisualInfo(Aspect_XVisualInfo* theVisual,
Aspect_FBConfig theFBConfig);
#ifdef X_PROTOCOL
//! Constructor wrapping existing Display instance.
//! WARNING! it is a responsibility of application to keep this pointer
//! valid while Aspect_DisplayConnection is alive and to close Display when it is no more needed.
Aspect_DisplayConnection(Display* theDisplay)
: Aspect_DisplayConnection((Aspect_XDisplay*)theDisplay)
{
}
//! @return pointer to Display structure that serves as the connection to the X server.
Display* GetDisplay() { return (Display*)myDisplay; }
//! Return default window visual or NULL when undefined.
XVisualInfo* GetDefaultVisualInfoX() const { return (XVisualInfo*)myDefVisualInfo; }
//! Set default window visual; the visual will be deallocated using XFree().
void SetDefaultVisualInfo(XVisualInfo* theVisual, Aspect_FBConfig theFBConfig)
{
SetDefaultVisualInfo((Aspect_XVisualInfo*)theVisual, theFBConfig);
}
//! @return identifier(atom) for custom named property associated with windows that use current
//! connection to X server.
Atom GetAtomX(const Aspect_XAtom theAtom) const { return (Atom)GetAtom(theAtom); }
//! Open connection with display specified in myDisplayName class field
//! or takes theDisplay parameter when it is not NULL.
void Init(Display* theDisplay) { Init((Aspect_XDisplay*)theDisplay); }
#endif
private:
Aspect_XDisplay* myDisplay;
Aspect_XVisualInfo* myDefVisualInfo;
Aspect_FBConfig myDefFBConfig;
NCollection_DataMap<Aspect_XAtom, uint64_t> myAtoms;
TCollection_AsciiString myDisplayName;
Standard_Boolean myIsOwnDisplay;
private:
//! To protect the connection from closing copying allowed only through the handles.
Aspect_DisplayConnection(const Aspect_DisplayConnection&);
Aspect_DisplayConnection& operator=(const Aspect_DisplayConnection&);
};
DEFINE_STANDARD_HANDLE(Aspect_DisplayConnection, Standard_Transient)
#endif // _Aspect_DisplayConnection_H__

View File

@ -0,0 +1,59 @@
// Created on: 2010-05-21
// Created by: PAUL SUPRYATKIN
// Copyright (c) 2010-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 _Aspect_GradientBackground_HeaderFile
#define _Aspect_GradientBackground_HeaderFile
#include "Aspect_GradientFillMethod.hxx"
#include "Aspect_Background.hxx"
//! This class allows the definition of a window gradient background.
class Aspect_GradientBackground : public Aspect_Background
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a window gradient background.
//! Default color is Quantity_NOC_BLACK.
//! Default fill method is Aspect_GradientFillMethod_None.
Standard_EXPORT Aspect_GradientBackground();
//! Creates a window gradient background with two colours.
Standard_EXPORT Aspect_GradientBackground(
const Quantity_Color& theColor1,
const Quantity_Color& theColor2,
const Aspect_GradientFillMethod theMethod = Aspect_GradientFillMethod_Horizontal);
//! Modifies the colours of the window gradient background.
Standard_EXPORT void SetColors(
const Quantity_Color& theColor1,
const Quantity_Color& theColor2,
const Aspect_GradientFillMethod theMethod = Aspect_GradientFillMethod_Horizontal);
//! Returns colours of the window gradient background.
Standard_EXPORT void Colors(Quantity_Color& theColor1, Quantity_Color& theColor2) const;
//! Returns the current gradient background fill mode.
Standard_EXPORT Aspect_GradientFillMethod BgGradientFillMethod() const;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:
Quantity_Color MyColor2;
Aspect_GradientFillMethod MyGradientMethod;
};
#endif // _Aspect_GradientBackground_HeaderFile

View File

@ -0,0 +1,48 @@
// Created by: NW,JPB,CAL
// Copyright (c) 1991-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 _Aspect_GradientFillMethod_HeaderFile
#define _Aspect_GradientFillMethod_HeaderFile
//! Defines the fill methods to write gradient background in a window.
enum Aspect_GradientFillMethod
{
Aspect_GradientFillMethod_None, //!< fill method not specified
Aspect_GradientFillMethod_Horizontal, //!< gradient directed from left (Color1) to right (Color2)
Aspect_GradientFillMethod_Vertical, //!< gradient directed from top (Color1) to bottom (Color2)
Aspect_GradientFillMethod_Diagonal1, //!< gradient directed from upper left corner (Color1) to
//!< lower right (Color2)
Aspect_GradientFillMethod_Diagonal2, //!< gradient directed from upper right corner (Color1) to
//!< lower left (Color2)
Aspect_GradientFillMethod_Corner1, //!< highlights upper left corner with Color1
Aspect_GradientFillMethod_Corner2, //!< highlights upper right corner with Color1
Aspect_GradientFillMethod_Corner3, //!< highlights lower right corner with Color1
Aspect_GradientFillMethod_Corner4, //!< highlights lower left corner with Color1
Aspect_GradientFillMethod_Elliptical, //!< gradient directed from center (Color1) in all
//!< directions forming an elliptic shape (Color2)
// obsolete aliases
Aspect_GFM_NONE = Aspect_GradientFillMethod_None,
Aspect_GFM_HOR = Aspect_GradientFillMethod_Horizontal,
Aspect_GFM_VER = Aspect_GradientFillMethod_Vertical,
Aspect_GFM_DIAG1 = Aspect_GradientFillMethod_Diagonal1,
Aspect_GFM_DIAG2 = Aspect_GradientFillMethod_Diagonal2,
Aspect_GFM_CORNER1 = Aspect_GradientFillMethod_Corner1,
Aspect_GFM_CORNER2 = Aspect_GradientFillMethod_Corner2,
Aspect_GFM_CORNER3 = Aspect_GradientFillMethod_Corner3,
Aspect_GFM_CORNER4 = Aspect_GradientFillMethod_Corner4
};
#endif // _Aspect_GradientFillMethod_HeaderFile

View File

@ -0,0 +1,24 @@
// Copyright (c) 2020 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 _Aspect_GraphicsLibrary_HeaderFile
#define _Aspect_GraphicsLibrary_HeaderFile
//! Graphics API enumeration.
enum Aspect_GraphicsLibrary
{
Aspect_GraphicsLibrary_OpenGL,
Aspect_GraphicsLibrary_OpenGLES,
};
#endif // _Aspect_GraphicsLibrary_HeaderFile

View File

@ -0,0 +1,32 @@
// Created on: 2004-03-22
// Created by: Sergey ANIKIN
// 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 Aspect_PolygonOffsetMode_HeaderFile
#define Aspect_PolygonOffsetMode_HeaderFile
// Enumeration for polygon offset modes
typedef enum
{
Aspect_POM_Off = 0x00, /* all polygon offset modes disabled */
Aspect_POM_Fill = 0x01, /* GL_POLYGON_OFFSET_FILL enabled (shaded polygons) */
Aspect_POM_Line = 0x02, /* GL_POLYGON_OFFSET_LINE enabled (polygons as outlines) */
Aspect_POM_Point = 0x04, /* GL_POLYGON_OFFSET_POINT enabled (polygons as vertices)*/
Aspect_POM_All = Aspect_POM_Fill | Aspect_POM_Line | Aspect_POM_Point,
Aspect_POM_None = 0x08, /* do not change current polygon offset mode */
Aspect_POM_Mask = Aspect_POM_All | Aspect_POM_None
} Aspect_PolygonOffsetMode;
#endif

View File

@ -0,0 +1,100 @@
// Created on: 1995-03-02
// Created by: Jean-Louis Frenkel
// Copyright (c) 1995-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 _Aspect_RectangularGrid_HeaderFile
#define _Aspect_RectangularGrid_HeaderFile
#include "Standard.hxx"
#include "Aspect_Grid.hxx"
class Aspect_RectangularGrid : public Aspect_Grid
{
DEFINE_STANDARD_RTTIEXT(Aspect_RectangularGrid, Aspect_Grid)
public:
//! creates a new grid. By default this grid is not
//! active.
//! The first angle is given relatively to the horizontal.
//! The second angle is given relatively to the vertical.
Standard_EXPORT Aspect_RectangularGrid(const Standard_Real aXStep,
const Standard_Real aYStep,
const Standard_Real anXOrigin = 0,
const Standard_Real anYOrigin = 0,
const Standard_Real aFirstAngle = 0,
const Standard_Real aSecondAngle = 0,
const Standard_Real aRotationAngle = 0);
//! defines the x step of the grid.
Standard_EXPORT void SetXStep(const Standard_Real aStep);
//! defines the y step of the grid.
Standard_EXPORT void SetYStep(const Standard_Real aStep);
//! defines the angle of the second network
//! the fist angle is given relatively to the horizontal.
//! the second angle is given relatively to the vertical.
Standard_EXPORT void SetAngle(const Standard_Real anAngle1, const Standard_Real anAngle2);
Standard_EXPORT void SetGridValues(const Standard_Real XOrigin,
const Standard_Real YOrigin,
const Standard_Real XStep,
const Standard_Real YStep,
const Standard_Real RotationAngle);
//! returns the point of the grid the closest to the point X,Y
Standard_EXPORT virtual void Compute(const Standard_Real X,
const Standard_Real Y,
Standard_Real& gridX,
Standard_Real& gridY) const Standard_OVERRIDE;
//! returns the x step of the grid.
Standard_EXPORT Standard_Real XStep() const;
//! returns the x step of the grid.
Standard_EXPORT Standard_Real YStep() const;
//! returns the x Angle of the grid, relatively to the horizontal.
Standard_EXPORT Standard_Real FirstAngle() const;
//! returns the y Angle of the grid, relatively to the vertical.
Standard_EXPORT Standard_Real SecondAngle() const;
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:
Standard_EXPORT Standard_Boolean CheckAngle(const Standard_Real alpha,
const Standard_Real beta) const;
private:
Standard_Real myXStep;
Standard_Real myYStep;
Standard_Real myFirstAngle;
Standard_Real mySecondAngle;
Standard_Real a1;
Standard_Real b1;
Standard_Real c1;
Standard_Real a2;
Standard_Real b2;
Standard_Real c2;
};
DEFINE_STANDARD_HANDLE(Aspect_RectangularGrid, Aspect_Grid)
#endif // _Aspect_RectangularGrid_HeaderFile

View File

@ -0,0 +1,49 @@
// 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.
/*============================================================================*/
/*==== Title: Aspect_RenderingContext.hxx */
/*==== Role: The header file of primitive type "RenderingContext" from package*/
/*==== "V3d" */
/*==== Implementation: This is a primitive type implemented with typedef */
/*============================================================================*/
// To manage 2D or 3D graphic context
#ifndef _Aspect_RenderingContext_HeaderFile
#define _Aspect_RenderingContext_HeaderFile
#include "Standard_Macro.hxx"
#if defined(__APPLE__) && !defined(HAVE_XLIB)
#import <TargetConditionals.h>
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#ifdef __OBJC__
@class EAGLContext;
#else
struct EAGLContext;
#endif
typedef EAGLContext* Aspect_RenderingContext;
#else
#ifdef __OBJC__
@class NSOpenGLContext;
#else
struct NSOpenGLContext;
#endif
Standard_DISABLE_DEPRECATION_WARNINGS typedef NSOpenGLContext* Aspect_RenderingContext;
Standard_ENABLE_DEPRECATION_WARNINGS
#endif
#else
typedef void* Aspect_RenderingContext; // GLXContext under UNIX
#endif
#endif /* _Aspect_RenderingContext_HeaderFile */

View File

@ -0,0 +1,24 @@
// Created by: NW,JPB,CAL
// Copyright (c) 1991-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 Aspect_SequenceOfColor_HeaderFile
#define Aspect_SequenceOfColor_HeaderFile
#include "Quantity_Color.hxx"
#include "NCollection_Sequence.hxx"
typedef NCollection_Sequence<Quantity_Color> Aspect_SequenceOfColor;
#endif

View File

@ -0,0 +1,103 @@
// Created on: 2021-10-14
// Created by: Artem CHESNOKOV
// Copyright (c) 2021 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 _Aspect_SkydomeBackground_Header
#define _Aspect_SkydomeBackground_Header
#include "gp_Dir.hxx"
#include "Graphic3d_Vec3.hxx"
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
//! This class allows the definition of a window skydome background.
class Aspect_SkydomeBackground
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a window skydome background.
//! By default skydome is initialized with sun at its zenith (0.0, 1.0, 0.0),
//! average clody (0.2), zero time parameter, zero fogginess, 512x512 texture size.
Standard_EXPORT Aspect_SkydomeBackground();
//! Creates a window skydome background with given parameters.
//! @param[in] theSunDirection direction to the sun (moon). Sun direction with negative Y
//! component
//! represents moon with (-X, -Y, -Z) direction.
//! @param[in] theCloudiness cloud intensity, 0.0 means no clouds at all and 1.0 - high clody.
//! @param[in] theTime time parameter of simulation. Might be tweaked to slightly change
//! appearance.
//! @param[in] theFogginess fog intensity, 0.0 means no fog and 1.0 - high fogginess
//! @param[in] theSize size of cubemap side in pixels.
Standard_EXPORT Aspect_SkydomeBackground(const gp_Dir& theSunDirection,
Standard_ShortReal theCloudiness,
Standard_ShortReal theTime,
Standard_ShortReal theFogginess,
Standard_Integer theSize);
//! Destructor.
Standard_EXPORT ~Aspect_SkydomeBackground();
//! Get sun direction. By default this value is (0, 1, 0)
//! Sun direction with negative Y component represents moon with (-X, -Y, -Z) direction.
const gp_Dir& SunDirection() const { return mySunDirection; }
//! Get cloud intensity. By default this value is 0.2
//! 0.0 means no clouds at all and 1.0 - high clody.
Standard_ShortReal Cloudiness() const { return myCloudiness; }
//! Get time of cloud simulation. By default this value is 0.0
//! This value might be tweaked to slightly change appearance of clouds.
Standard_ShortReal TimeParameter() const { return myTime; }
//! Get fog intensity. By default this value is 0.0
//! 0.0 means no fog and 1.0 - high fogginess
Standard_ShortReal Fogginess() const { return myFogginess; }
//! Get size of cubemap. By default this value is 512
Standard_Integer Size() const { return mySize; }
//! Set sun direction. By default this value is (0, 1, 0)
//! Sun direction with negative Y component represents moon with (-X, -Y, -Z) direction.
void SetSunDirection(const gp_Dir& theSunDirection) { mySunDirection = theSunDirection; }
//! Set cloud intensity. By default this value is 0.2
//! 0.0 means no clouds at all and 1.0 - high clody.
Standard_EXPORT void SetCloudiness(Standard_ShortReal theCloudiness);
//! Set time of cloud simulation. By default this value is 0.0
//! This value might be tweaked to slightly change appearance of clouds.
void SetTimeParameter(Standard_ShortReal theTime) { myTime = theTime; }
//! Set fog intensity. By default this value is 0.0
//! 0.0 means no fog and 1.0 - high fogginess
Standard_EXPORT void SetFogginess(Standard_ShortReal theFogginess);
//! Set size of cubemap. By default this value is 512
Standard_EXPORT void SetSize(Standard_Integer theSize);
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:
gp_Dir mySunDirection; //!< Sun (moon) light direction.
Standard_ShortReal myCloudiness; //!< Cloud intensity.
Standard_ShortReal myTime; //!< Simulation time parameter.
Standard_ShortReal myFogginess; //!< Fog intensity
Standard_Integer mySize; //!< Size of cubemap in pixels
};
#endif // _Aspect_SkydomeBackground_Header

View File

@ -0,0 +1,40 @@
// Copyright (c) 2020 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 _Aspect_TrackedDevicePose_HeaderFile
#define _Aspect_TrackedDevicePose_HeaderFile
#include "gp_Trsf.hxx"
#include "NCollection_Array1.hxx"
//! Describes a single pose for a tracked object (for XR).
struct Aspect_TrackedDevicePose
{
gp_Trsf Orientation; //!< device to absolute transformation
gp_Vec Velocity; //!< velocity in tracker space in m/s
gp_Vec AngularVelocity; //!< angular velocity in radians/s
bool IsValidPose; //!< indicates valid pose
bool IsConnectedDevice; //!< indicates connected state
//! Empty constructor.
Aspect_TrackedDevicePose()
: IsValidPose(false),
IsConnectedDevice(false)
{
}
};
//! Array of tracked poses.
typedef NCollection_Array1<Aspect_TrackedDevicePose> Aspect_TrackedDevicePoseArray;
#endif // _Aspect_TrackedDevicePose_HeaderFile

View File

@ -0,0 +1,28 @@
// Created by: NW,JPB,CAL
// Copyright (c) 1991-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 _Aspect_TypeOfDeflection_HeaderFile
#define _Aspect_TypeOfDeflection_HeaderFile
//! Defines if the maximal chordial deflection used when
//! drawing an object is absolute or relative to the size
//! of the object.
enum Aspect_TypeOfDeflection
{
Aspect_TOD_RELATIVE,
Aspect_TOD_ABSOLUTE
};
#endif // _Aspect_TypeOfDeflection_HeaderFile

View File

@ -0,0 +1,30 @@
// Created by: NW,JPB,CAL
// Copyright (c) 1991-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 _Aspect_TypeOfDisplayText_HeaderFile
#define _Aspect_TypeOfDisplayText_HeaderFile
//! Define the display type of the text.
enum Aspect_TypeOfDisplayText
{
Aspect_TODT_NORMAL, //!< default display, text only
Aspect_TODT_SUBTITLE, //!< there is a subtitle under the text
Aspect_TODT_DEKALE, //!< the text is displayed with a 3D style
Aspect_TODT_BLEND, //!< the text is displayed in XOR
Aspect_TODT_DIMENSION, //!< dimension line under text will be invisible
Aspect_TODT_SHADOW //!< the text will have a shadow at the right-bottom corner
};
#endif // _Aspect_TypeOfDisplayText_HeaderFile

View File

@ -0,0 +1,26 @@
// Created by: NW,JPB,CAL
// Copyright (c) 1991-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 _Aspect_TypeOfFacingModel_HeaderFile
#define _Aspect_TypeOfFacingModel_HeaderFile
enum Aspect_TypeOfFacingModel
{
Aspect_TOFM_BOTH_SIDE,
Aspect_TOFM_BACK_SIDE,
Aspect_TOFM_FRONT_SIDE
};
#endif // _Aspect_TypeOfFacingModel_HeaderFile

View File

@ -0,0 +1,32 @@
// Created by: NW,JPB,CAL
// Copyright (c) 1991-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 _Aspect_TypeOfStyleText_HeaderFile
#define _Aspect_TypeOfStyleText_HeaderFile
//! Define the style of the text.
//!
//! TOST_NORMAL Default text. The text is displayed like any other graphic object.
//! This text can be hidden by another object that is nearest from the
//! point of view.
//! TOST_ANNOTATION The text is always visible. The texte is displayed
//! over the other object according to the priority.
enum Aspect_TypeOfStyleText
{
Aspect_TOST_NORMAL,
Aspect_TOST_ANNOTATION
};
#endif // _Aspect_TypeOfStyleText_HeaderFile

View File

@ -0,0 +1,42 @@
// Copyright (c) 2020 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 _Aspect_XRAnalogActionData_HeaderFile
#define _Aspect_XRAnalogActionData_HeaderFile
#include "NCollection_Vec3.hxx"
//! Analog input XR action data.
struct Aspect_XRAnalogActionData
{
uint64_t ActiveOrigin; //!< The origin that caused this action's current state
// clang-format off
float UpdateTime; //!< Time relative to now when this event happened. Will be negative to indicate a past time
NCollection_Vec3<float> VecXYZ; //!< the current state of this action
NCollection_Vec3<float> DeltaXYZ; //!< deltas since the previous update
bool IsActive; //!< whether or not this action is currently available to be bound in the active action set
// clang-format on
//! Return TRUE if delta is non-zero.
bool IsChanged() { return !DeltaXYZ.IsEqual(NCollection_Vec3<float>(0.0f, 0.0f, 0.0f)); }
//! Empty constructor.
Aspect_XRAnalogActionData()
: ActiveOrigin(0),
UpdateTime(0.0f),
IsActive(false)
{
}
};
#endif // _Aspect_XRAnalogActionData_HeaderFile

View File

@ -0,0 +1,45 @@
// Copyright (c) 2020 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 _Aspect_XRGenericAction_HeaderFile
#define _Aspect_XRGenericAction_HeaderFile
//! Generic XR action.
enum Aspect_XRGenericAction
{
Aspect_XRGenericAction_IsHeadsetOn, //!< headset is on/off head
Aspect_XRGenericAction_InputAppMenu, //!< application menu button pressed/released
Aspect_XRGenericAction_InputSysMenu, //!< system menu button pressed/released
Aspect_XRGenericAction_InputTriggerPull, //!< trigger squeezing [0..1], 1 to click
Aspect_XRGenericAction_InputTriggerClick, //!< trigger clicked/released
Aspect_XRGenericAction_InputGripClick, //!< grip state on/off
Aspect_XRGenericAction_InputTrackPadPosition, //!< trackpad 2D position [-1,+1] with X and Y axes
Aspect_XRGenericAction_InputTrackPadTouch, //!< trackpad touched/untouched
Aspect_XRGenericAction_InputTrackPadClick, //!< trackpad clicked/released
Aspect_XRGenericAction_InputThumbstickPosition, //!< thumbstick 2D position [-1,+1] with X and Y
//!< axes
Aspect_XRGenericAction_InputThumbstickTouch, //!< thumbstick touched/untouched
Aspect_XRGenericAction_InputThumbstickClick, //!< thumbstick clicked/released
Aspect_XRGenericAction_InputPoseBase, //!< base position of hand
Aspect_XRGenericAction_InputPoseFront, //!< front position of hand
Aspect_XRGenericAction_InputPoseHandGrip, //!< position of main handgrip
Aspect_XRGenericAction_InputPoseFingerTip, //!< position of main fingertip
Aspect_XRGenericAction_OutputHaptic //!< haptic output (vibration)
};
enum
{
Aspect_XRGenericAction_NB = Aspect_XRGenericAction_OutputHaptic + 1
};
#endif // _Aspect_XRGenericAction_HeaderFile

View File

@ -0,0 +1,41 @@
// Copyright (c) 2020 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 _Aspect_XRHapticActionData_HeaderFile
#define _Aspect_XRHapticActionData_HeaderFile
//! Haptic output XR action data.
struct Aspect_XRHapticActionData
{
float Delay; //!< delay in seconds before start
float Duration; //!< duration in seconds
float Frequency; //!< vibration frequency
float Amplitude; //!< vibration amplitude
//! Return TRUE if data is not empty.
bool IsValid() const
{
return Duration > 0.0f && Amplitude > 0.0f && Frequency > 0.0f && Delay >= 0.0f;
}
//! Empty constructor.
Aspect_XRHapticActionData()
: Delay(0.0f),
Duration(0.0f),
Frequency(0.0f),
Amplitude(0.0f)
{
}
};
#endif // _Aspect_XRHapticActionData_HeaderFile

View File

@ -0,0 +1,37 @@
// Copyright (c) 2020 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 _Aspect_XRPoseActionData_HeaderFile
#define _Aspect_XRPoseActionData_HeaderFile
#include "Aspect_TrackedDevicePose.hxx"
#include "Standard_TypeDef.hxx"
//! Pose input XR action data.
struct Aspect_XRPoseActionData
{
Aspect_TrackedDevicePose Pose; //!< pose state
uint64_t ActiveOrigin; //!< The origin that caused this action's current state
// clang-format off
bool IsActive; //!< whether or not this action is currently available to be bound in the active action set
// clang-format on
//! Empty constructor.
Aspect_XRPoseActionData()
: ActiveOrigin(0),
IsActive(false)
{
}
};
#endif // _Aspect_XRPoseActionData_HeaderFile

View File

@ -0,0 +1,147 @@
// Created on: 2004-09-03
// Created by: Oleg FEDYAEV
// Copyright (c) 2004-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 _BOPAlgo_ArgumentAnalyzer_HeaderFile
#define _BOPAlgo_ArgumentAnalyzer_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "TopoDS_Shape.hxx"
#include "BOPAlgo_Algo.hxx"
#include "BOPAlgo_Operation.hxx"
#include "BOPAlgo_ListOfCheckResult.hxx"
#include "TopAbs_ShapeEnum.hxx"
//! check the validity of argument(s) for Boolean Operations
class BOPAlgo_ArgumentAnalyzer : public BOPAlgo_Algo
{
public:
DEFINE_STANDARD_ALLOC
//! empty constructor
Standard_EXPORT BOPAlgo_ArgumentAnalyzer();
Standard_EXPORT virtual ~BOPAlgo_ArgumentAnalyzer();
//! sets object shape
Standard_EXPORT void SetShape1(const TopoDS_Shape& TheShape);
//! sets tool shape
Standard_EXPORT void SetShape2(const TopoDS_Shape& TheShape);
//! returns object shape;
Standard_EXPORT const TopoDS_Shape& GetShape1() const;
//! returns tool shape
Standard_EXPORT const TopoDS_Shape& GetShape2() const;
//! returns ref
Standard_EXPORT BOPAlgo_Operation& OperationType();
//! returns ref
Standard_EXPORT Standard_Boolean& StopOnFirstFaulty();
//! Returns (modifiable) mode
//! that means checking types of shapes.
Standard_Boolean& ArgumentTypeMode();
//! Returns (modifiable) mode that means
//! checking of self-intersection of shapes.
Standard_Boolean& SelfInterMode();
//! Returns (modifiable) mode that means
//! checking of small edges.
Standard_Boolean& SmallEdgeMode();
//! Returns (modifiable) mode that means
//! checking of possibility to split or rebuild faces.
Standard_Boolean& RebuildFaceMode();
//! Returns (modifiable) mode that means
//! checking of tangency between subshapes.
Standard_Boolean& TangentMode();
//! Returns (modifiable) mode that means
//! checking of problem of merging vertices.
Standard_Boolean& MergeVertexMode();
//! Returns (modifiable) mode that means
//! checking of problem of merging edges.
Standard_Boolean& MergeEdgeMode();
//! Returns (modifiable) mode that means
//! checking of problem of continuity of the shape.
Standard_Boolean& ContinuityMode();
//! Returns (modifiable) mode that means
//! checking of problem of invalid curve on surface.
Standard_Boolean& CurveOnSurfaceMode();
//! performs analysis
Standard_EXPORT void Perform(const Message_ProgressRange& theRange = Message_ProgressRange());
//! result of test
Standard_EXPORT Standard_Boolean HasFaulty() const;
//! returns a result of test
Standard_EXPORT const BOPAlgo_ListOfCheckResult& GetCheckResult() const;
protected:
//! Prepares data;
Standard_EXPORT void Prepare();
Standard_EXPORT void TestTypes();
Standard_EXPORT void TestSelfInterferences(const Message_ProgressRange& theRange);
Standard_EXPORT void TestSmallEdge();
Standard_EXPORT void TestRebuildFace();
Standard_EXPORT void TestTangent();
Standard_EXPORT void TestMergeSubShapes(const TopAbs_ShapeEnum theType);
Standard_EXPORT void TestMergeVertex();
Standard_EXPORT void TestMergeEdge();
Standard_EXPORT void TestContinuity();
Standard_EXPORT void TestCurveOnSurface();
private:
TopoDS_Shape myShape1;
TopoDS_Shape myShape2;
Standard_Boolean myStopOnFirst;
BOPAlgo_Operation myOperation;
Standard_Boolean myArgumentTypeMode;
Standard_Boolean mySelfInterMode;
Standard_Boolean mySmallEdgeMode;
Standard_Boolean myRebuildFaceMode;
Standard_Boolean myTangentMode;
Standard_Boolean myMergeVertexMode;
Standard_Boolean myMergeEdgeMode;
Standard_Boolean myContinuityMode;
Standard_Boolean myCurveOnSurfaceMode;
Standard_Boolean myEmpty1;
Standard_Boolean myEmpty2;
BOPAlgo_ListOfCheckResult myResult;
};
#include "BOPAlgo_ArgumentAnalyzer.lxx"
#endif // _BOPAlgo_ArgumentAnalyzer_HeaderFile

View File

@ -0,0 +1,62 @@
// 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.
inline Standard_Boolean& BOPAlgo_ArgumentAnalyzer::ArgumentTypeMode()
{
return myArgumentTypeMode;
}
inline Standard_Boolean& BOPAlgo_ArgumentAnalyzer::SelfInterMode()
{
return mySelfInterMode;
}
inline Standard_Boolean& BOPAlgo_ArgumentAnalyzer::SmallEdgeMode()
{
return mySmallEdgeMode;
}
inline Standard_Boolean& BOPAlgo_ArgumentAnalyzer::RebuildFaceMode()
{
return myRebuildFaceMode;
}
inline Standard_Boolean& BOPAlgo_ArgumentAnalyzer::TangentMode()
{
return myTangentMode;
}
inline Standard_Boolean& BOPAlgo_ArgumentAnalyzer::MergeVertexMode()
{
return myMergeVertexMode;
}
inline Standard_Boolean& BOPAlgo_ArgumentAnalyzer::MergeEdgeMode()
{
return myMergeEdgeMode;
}
inline Standard_Boolean& BOPAlgo_ArgumentAnalyzer::ContinuityMode()
{
return myContinuityMode;
}
inline Standard_Boolean& BOPAlgo_ArgumentAnalyzer::CurveOnSurfaceMode()
{
return myCurveOnSurfaceMode;
}
// inline Standard_Boolean& BOPAlgo_ArgumentAnalyzer::MergeFaceMode()
// {
// return myMergeFaceMode;
// }

View File

@ -0,0 +1,22 @@
// Copyright (c) 20010-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 BOPAlgo_ListOfCheckResult_HeaderFile
#define BOPAlgo_ListOfCheckResult_HeaderFile
#include "BOPAlgo_CheckResult.hxx"
typedef NCollection_List<BOPAlgo_CheckResult> BOPAlgo_ListOfCheckResult;
typedef BOPAlgo_ListOfCheckResult::Iterator BOPAlgo_ListIteratorOfListOfCheckResult;
#endif

View File

@ -0,0 +1,21 @@
// Created by: Peter KURNEV
// 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 _BOPAlgo_PArgumentAnalyzer_HeaderFile
#define _BOPAlgo_PArgumentAnalyzer_HeaderFile
class BOPAlgo_ArgumentAnalyzer;
typedef BOPAlgo_ArgumentAnalyzer* BOPAlgo_PArgumentAnalyzer;
#endif // _BOPAlgo_PArgumentAnalyzer_HeaderFile

View File

@ -0,0 +1,264 @@
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 2018 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 _BOPAlgo_RemoveFeatures_HeaderFile
#define _BOPAlgo_RemoveFeatures_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "BOPAlgo_BuilderShape.hxx"
#include "BRepTools_History.hxx"
#include "TopoDS_Shape.hxx"
#include "TopTools_IndexedDataMapOfShapeListOfShape.hxx"
#include "TopTools_IndexedMapOfShape.hxx"
#include "TopTools_ListOfShape.hxx"
#include "TopTools_MapOfShape.hxx"
//! The RemoveFeatures algorithm is intended for reconstruction of
//! the shape by removal of the unwanted parts from it. These parts can
//! be holes, protrusions, spikes, fillets etc.
//! The shape itself is not modified, the new shape is built in
//! the result.
//!
//! Currently, only the shapes of type SOLID, COMPSOLID, and
//! COMPOUND of Solids are supported. And only the FACEs can be
//! removed from the shape.
//!
//! On the input the algorithm accepts the shape itself and the
//! faces which have to be removed. It does not matter how the faces
//! are given. It could be the separate faces or the collections of faces.
//! The faces should belong to the initial shape, and those that
//! do not belong will be ignored.
//! Before reconstructing the shape, the algorithm will sort all
//! the given faces on the connected blocks (features).
//!
//! The features will be removed from the shape one by one.
//! It will allow removing all possible features even if there
//! were problems with the removal of some of them.
//!
//! The removed feature is filled by the extension of the faces adjacent
//! to the feature. In general, the algorithm of removing of the single
//! feature from the shape looks as follows:
//! - Find the faces adjacent to the feature;
//! - Extend the adjacent faces to cover the feature;
//! - Trim the extended faces by the bounds of original face
//! (except for bounds common with the feature), so it will cover
//! the feature only;
//! - Rebuild the solids with reconstructed adjacent faces
//! avoiding the faces from the feature.
//!
//! If the removal is successful, the result is overwritten with the
//! new shape and the next feature is treated. Otherwise, the warning
//! will be given.
//!
//! The algorithm has the following options:
//! - History support;
//!
//! and the options available from base class:
//! - Error/Warning reporting system;
//! - Parallel processing mode.
//!
//! Please note that the other options of the base class are not supported
//! here and will have no effect.
//!
//! <b>History support</b> allows tracking modification of the input shape
//! in terms of Modified, IsDeleted and Generated. The history is
//! available through the methods of the history tool *BRepTools_History*,
//! which can be accessed here through the method *History()*.
//! By default, the history is collected, but it is possible to disable it
//! using the method *SetToFillHistory(false)*;
//!
//! <b>Error/Warning reporting system</b> - allows obtaining the extended overview
//! of the Errors/Warnings occurred during the operation. As soon as any error
//! appears the algorithm stops working. The warnings allow continuing the job,
//! informing the user that something went wrong.
//! The algorithm returns the following errors/warnings:
//! - *BOPAlgo_AlertTooFewArguments* - the error alert is given if the input
//! shape does not contain any solids;
//! - *BOPAlgo_AlertUnsupportedType* - the warning alert is given if the input
//! shape contains not only solids, but also other shapes;
//! - *BOPAlgo_AlertNoFacesToRemove* - the error alert is given in case
//! there are no faces to remove from the shape (nothing to do);
//! - *BOPAlgo_AlertUnableToRemoveTheFeature* - the warning alert is given to
//! inform the user the removal of the feature is not possible. The algorithm
//! will still try to remove the other features;
//! - *BOPAlgo_AlertRemoveFeaturesFailed* - the error alert is given in case if
//! the operation was aborted by the unknown reason.
//!
//! <b>Parallel processing mode</b> - allows running the algorithm in parallel mode
//! obtaining the result faster.
//!
//! The algorithm has certain limitations:
//! - Intersection of the connected faces adjacent to the feature should not be empty.
//! It means, that such faces should not be tangent to each other.
//! If the intersection of the adjacent faces will be empty, the algorithm will
//! be unable to trim the faces correctly and, most likely, the feature will not be removed.
//! - The algorithm does not process the INTERNAL parts of the solids, they are simply
//! removed during reconstruction.
//!
//! Note that for successful removal of the feature, the extended faces adjacent
//! to the feature should cover the feature completely, otherwise the solids will
//! not be rebuild.
//!
//! Here is the example of usage of the algorithm:
//! ~~~~
//! TopoDS_Shape aSolid = ...; // Input shape to remove the features from
//! TopTools_ListOfShape aFaces = ...; // Faces to remove from the shape
//! Standard_Boolean bRunParallel = ...; // Parallel processing mode
//! Standard_Boolean isHistoryNeeded = ...; // History support
//!
//! BOPAlgo_RemoveFeatures aRF; // Feature removal algorithm
//! aRF.SetShape(aSolid); // Set the shape
//! aRF.AddFacesToRemove(aFaces); // Add faces to remove
//! aRF.SetRunParallel(bRunParallel); // Define the processing mode (parallel or single)
//! aRF.SetToFillHistory(isHistoryNeeded); // Define whether to track the shapes modifications
//! aRF.Perform(); // Perform the operation
//! if (aRF.HasErrors()) // Check for the errors
//! {
//! // error treatment
//! return;
//! }
//! if (aRF.HasWarnings()) // Check for the warnings
//! {
//! // warnings treatment
//! }
//! const TopoDS_Shape& aResult = aRF.Shape(); // Result shape
//! ~~~~
//!
//! The algorithm preserves the type of the input shape in the result shape. Thus,
//! if the input shape is a COMPSOLID, the resulting solids will also be put into a COMPSOLID.
//!
//! When all possible features are removed, the shape is simplified by
//! removing extra edges and vertices, created during operation, from the result shape.
//!
class BOPAlgo_RemoveFeatures : public BOPAlgo_BuilderShape
{
public:
DEFINE_STANDARD_ALLOC
public: //! @name Constructors
//! Empty constructor
BOPAlgo_RemoveFeatures()
: BOPAlgo_BuilderShape()
{
}
public: //! @name Setting input data for the algorithm
//! Sets the shape for processing.
//! @param[in] theShape The shape to remove the faces from.
//! It should either be the SOLID, COMPSOLID or COMPOUND of Solids.
void SetShape(const TopoDS_Shape& theShape) { myInputShape = theShape; }
//! Returns the input shape
const TopoDS_Shape& InputShape() const { return myInputShape; }
//! Adds the face to remove from the input shape.
//! @param[in] theFace The shape to extract the faces for removal.
void AddFaceToRemove(const TopoDS_Shape& theFace) { myFacesToRemove.Append(theFace); }
//! Adds the faces to remove from the input shape.
//! @param[in] theFaces The list of shapes to extract the faces for removal.
void AddFacesToRemove(const TopTools_ListOfShape& theFaces)
{
TopTools_ListIteratorOfListOfShape it(theFaces);
for (; it.More(); it.Next())
myFacesToRemove.Append(it.Value());
}
//! Returns the list of faces which have been requested for removal
//! from the input shape.
const TopTools_ListOfShape& FacesToRemove() const { return myFacesToRemove; }
public: //! @name Performing the operation
//! Performs the operation
Standard_EXPORT virtual void Perform(
const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
public: //! @name Clearing the contents of the algorithm
//! Clears the contents of the algorithm from previous run,
//! allowing reusing it for following removals.
virtual void Clear() Standard_OVERRIDE
{
BOPAlgo_BuilderShape::Clear();
myInputShape.Nullify();
myShape.Nullify();
myFacesToRemove.Clear();
myFeatures.Clear();
myInputsMap.Clear();
}
protected: //! @name Protected methods performing the removal
//! Checks the input data on validity for the algorithm:
//! - The input shape must be either a SOLID, COMPSOLID or COMPOUND of Solids.
//! If the input shape is not a solid, the method looks for the solids
//! in <myInputShape> and uses only them. All other shapes are simply removed.
//! If no solids were found, the Error of unsupported type is returned.
Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
//! Prepares the faces to remove:
//! - Gets only faces contained in the input solids;
//! - Builds connected blocks of faces creating separate features to remove.
Standard_EXPORT void PrepareFeatures(const Message_ProgressRange& theRange);
//! Removes the features and fills the created gaps by extension of the adjacent faces.
//! Processes each feature separately.
Standard_EXPORT void RemoveFeatures(const Message_ProgressRange& theRange);
//! Remove the single feature from the shape.
//! @param[in] theFeature The feature to remove;
//! @param[in] theSolids The solids to be reconstructed after feature removal;
//! @param[in] theFeatureFacesMap The map of feature faces;
//! @param[in] theHasAdjacentFaces Shows whether the adjacent faces have been
//! found for the feature or not;
//! @param[in] theAdjFaces The reconstructed adjacent faces covering the feature;
//! @param[in] theAdjFacesHistory The history of the adjacent faces reconstruction;
//! @param[in] theSolidsHistoryNeeded Defines whether the history of solids
//! modifications should be tracked or not.
Standard_EXPORT void RemoveFeature(const TopoDS_Shape& theFeature,
const TopTools_IndexedMapOfShape& theSolids,
const TopTools_MapOfShape& theFeatureFacesMap,
const Standard_Boolean theHasAdjacentFaces,
const TopTools_IndexedDataMapOfShapeListOfShape& theAdjFaces,
const Handle(BRepTools_History)& theAdjFacesHistory,
const Standard_Boolean theSolidsHistoryNeeded,
const Message_ProgressRange& theRange);
//! Updates history with the removed features
Standard_EXPORT void UpdateHistory(const Message_ProgressRange& theRange);
//! Simplifies the result by removing extra edges and vertices created
//! during removal of the features.
Standard_EXPORT void SimplifyResult(const Message_ProgressRange& theRange);
//! Post treatment - restore the type of the initial shape
Standard_EXPORT void PostTreat();
//! Filling steps for constant operations
Standard_EXPORT void fillPIConstants(const Standard_Real theWhole,
BOPAlgo_PISteps& theSteps) const Standard_OVERRIDE;
protected: //! @name Fields
// Inputs
TopoDS_Shape myInputShape; //!< Input shape
TopTools_ListOfShape myFacesToRemove; //!< Faces to remove
// Intermediate
TopTools_ListOfShape myFeatures; //!< List of not connected features to remove
//! (each feature is a compound of faces)
TopTools_IndexedMapOfShape myInputsMap; //!< Map of all sub-shapes of the input shape
};
#endif // _BOPAlgo_RemoveFeatures_HeaderFile

View File

@ -0,0 +1,67 @@
// Created on: 2002-03-04
// Created by: Michael KLOKOV
// Copyright (c) 2002-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 _BOPAlgo_SectionAttribute_HeaderFile
#define _BOPAlgo_SectionAttribute_HeaderFile
//! Class is a container of the flags used
//! by intersection algorithm
class BOPAlgo_SectionAttribute
{
public:
//! Default constructor
BOPAlgo_SectionAttribute()
: myApproximation(Standard_True),
myPCurve1(Standard_True),
myPCurve2(Standard_True)
{
}
//! Constructor
BOPAlgo_SectionAttribute(const Standard_Boolean theAproximation,
const Standard_Boolean thePCurveOnS1,
const Standard_Boolean thePCurveOnS2)
: myApproximation(theAproximation),
myPCurve1(thePCurveOnS1),
myPCurve2(thePCurveOnS2)
{
}
//! Sets the Approximation flag
void Approximation(const Standard_Boolean theApprox) { myApproximation = theApprox; }
//! Sets the PCurveOnS1 flag
void PCurveOnS1(const Standard_Boolean thePCurveOnS1) { myPCurve1 = thePCurveOnS1; }
//! Sets the PCurveOnS2 flag
void PCurveOnS2(const Standard_Boolean thePCurveOnS2) { myPCurve2 = thePCurveOnS2; }
//! Returns the Approximation flag
Standard_Boolean Approximation() const { return myApproximation; }
//! Returns the PCurveOnS1 flag
Standard_Boolean PCurveOnS1() const { return myPCurve1; }
//! Returns the PCurveOnS2 flag
Standard_Boolean PCurveOnS2() const { return myPCurve2; }
protected:
private:
Standard_Boolean myApproximation;
Standard_Boolean myPCurve1;
Standard_Boolean myPCurve2;
};
#endif // _BOPAlgo_SectionAttribute_HeaderFile

View File

@ -0,0 +1,176 @@
// Created by: Peter KURNEV
// 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 BOPDS_CoupleOfPaveBlocks_HeaderFile
#define BOPDS_CoupleOfPaveBlocks_HeaderFile
#include "BOPDS_PaveBlock.hxx"
/**
* The Class BOPDS_CoupleOfPaveBlocks is to store
* the information about two pave blocks
* and some satellite information
*
*/
//=======================================================================
// class : BOPDS_CoupleOfPaveBlocks
// purpose :
//=======================================================================
class BOPDS_CoupleOfPaveBlocks
{
public:
/**
* Constructor
*/
BOPDS_CoupleOfPaveBlocks()
: myIndexInterf(-1),
myIndex(-1),
myTolerance(0)
{
}
//
/**
* Constructor
* @param thePB1
* first pave block
* @param thePB2
* secondt pave block
*/
BOPDS_CoupleOfPaveBlocks(const Handle(BOPDS_PaveBlock)& thePB1,
const Handle(BOPDS_PaveBlock)& thePB2)
: myIndexInterf(-1),
myIndex(-1),
myTolerance(0)
{
SetPaveBlocks(thePB1, thePB2);
}
//
/**
* Destructor
*/
~BOPDS_CoupleOfPaveBlocks() {}
//
/**
* Sets an index
* @param theIndex
* index
*/
void SetIndex(const Standard_Integer theIndex) { myIndex = theIndex; }
//
/**
* Returns the index
* @return
* index
*/
Standard_Integer Index() const { return myIndex; }
//
/**
* Sets an index of an interference
* @param theIndex
* index of an interference
*/
void SetIndexInterf(const Standard_Integer theIndex) { myIndexInterf = theIndex; }
//
/**
* Returns the index of an interference
* @return
* index of an interference
*/
Standard_Integer IndexInterf() const { return myIndexInterf; }
//
/**
* Sets pave blocks
* @param thePB1
* first pave block
* @param thePB2
* secondt pave block
*/
void SetPaveBlocks(const Handle(BOPDS_PaveBlock)& thePB1, const Handle(BOPDS_PaveBlock)& thePB2)
{
myPB[0] = thePB1;
myPB[1] = thePB2;
}
//
/**
* Returns pave blocks
* @param thePB1
* the first pave block
* @param thePB2
* the second pave block
*/
void PaveBlocks(Handle(BOPDS_PaveBlock)& thePB1, Handle(BOPDS_PaveBlock)& thePB2) const
{
thePB1 = myPB[0];
thePB2 = myPB[1];
}
//
/**
* Sets the first pave block
* @param thePB
* the first pave block
*/
void SetPaveBlock1(const Handle(BOPDS_PaveBlock)& thePB) { myPB[0] = thePB; }
/**
* Returns the first pave block
* @return
* the first pave block
*/
const Handle(BOPDS_PaveBlock)& PaveBlock1() const { return myPB[0]; }
//
/**
* Sets the second pave block
* @param thePB
* the second pave block
*/
void SetPaveBlock2(const Handle(BOPDS_PaveBlock)& thePB) { myPB[1] = thePB; }
//
/**
* Returns the second pave block
* @return
* the second pave block
*/
const Handle(BOPDS_PaveBlock)& PaveBlock2() const { return myPB[1]; }
/**
* Sets the tolerance associated with this couple
*/
void SetTolerance(const Standard_Real theTol) { myTolerance = theTol; }
//
/**
* Returns the tolerance associated with this couple
*/
Standard_Real Tolerance() const { return myTolerance; }
protected:
Standard_Integer myIndexInterf;
Standard_Integer myIndex;
Handle(BOPDS_PaveBlock) myPB[2];
Standard_Real myTolerance;
};
//
#endif

View File

@ -0,0 +1,24 @@
// Created by: Peter KURNEV
// 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 BOPDS_MapOfCommonBlock_HeaderFile
#define BOPDS_MapOfCommonBlock_HeaderFile
#include "NCollection_Map.hxx"
#include "BOPDS_CommonBlock.hxx"
typedef NCollection_Map<Handle(BOPDS_CommonBlock)> BOPDS_MapOfCommonBlock;
typedef BOPDS_MapOfCommonBlock::Iterator BOPDS_MapIteratorOfMapOfCommonBlock;
#endif

View File

@ -0,0 +1,23 @@
// Created by: Peter KURNEV
// 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 BOPDS_VectorOfFaceInfo_HeaderFile
#define BOPDS_VectorOfFaceInfo_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_FaceInfo.hxx"
typedef NCollection_Vector<BOPDS_FaceInfo> BOPDS_VectorOfFaceInfo;
#endif

View File

@ -0,0 +1,23 @@
// Created by: Peter KURNEV
// 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 BOPDS_VectorOfIndexRange_HeaderFile
#define BOPDS_VectorOfIndexRange_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_IndexRange.hxx"
typedef NCollection_Vector<BOPDS_IndexRange> BOPDS_VectorOfIndexRange;
#endif

View File

@ -0,0 +1,23 @@
// Created by: Peter KURNEV
// 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 BOPDS_VectorOfInterfEE_HeaderFile
#define BOPDS_VectorOfInterfEE_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_Interf.hxx"
typedef NCollection_Vector<BOPDS_InterfEE> BOPDS_VectorOfInterfEE;
#endif

View File

@ -0,0 +1,23 @@
// Created by: Peter KURNEV
// 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 BOPDS_VectorOfInterfEF_HeaderFile
#define BOPDS_VectorOfInterfEF_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_Interf.hxx"
typedef NCollection_Vector<BOPDS_InterfEF> BOPDS_VectorOfInterfEF;
#endif

View File

@ -0,0 +1,24 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-2012 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 BOPDS_VectorOfInterfEZ_HeaderFile
#define BOPDS_VectorOfInterfEZ_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_Interf.hxx"
typedef NCollection_Vector<BOPDS_InterfEZ> BOPDS_VectorOfInterfEZ;
#endif

View File

@ -0,0 +1,23 @@
// Created by: Peter KURNEV
// 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 BOPDS_VectorOfInterfFF_HeaderFile
#define BOPDS_VectorOfInterfFF_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_Interf.hxx"
typedef NCollection_Vector<BOPDS_InterfFF> BOPDS_VectorOfInterfFF;
#endif

View File

@ -0,0 +1,24 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-2012 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 BOPDS_VectorOfInterfFZ_HeaderFile
#define BOPDS_VectorOfInterfFZ_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_Interf.hxx"
typedef NCollection_Vector<BOPDS_InterfFZ> BOPDS_VectorOfInterfFZ;
#endif

View File

@ -0,0 +1,23 @@
// Created by: Peter KURNEV
// 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 BOPDS_VectorOfInterfVE_HeaderFile
#define BOPDS_VectorOfInterfVE_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_Interf.hxx"
typedef NCollection_Vector<BOPDS_InterfVE> BOPDS_VectorOfInterfVE;
#endif

View File

@ -0,0 +1,23 @@
// Created by: Peter KURNEV
// 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 BOPDS_VectorOfInterfVF_HeaderFile
#define BOPDS_VectorOfInterfVF_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_Interf.hxx"
typedef NCollection_Vector<BOPDS_InterfVF> BOPDS_VectorOfInterfVF;
#endif

View File

@ -0,0 +1,23 @@
// Created by: Peter KURNEV
// 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 BOPDS_VectorOfInterfVV_HeaderFile
#define BOPDS_VectorOfInterfVV_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_Interf.hxx"
typedef NCollection_Vector<BOPDS_InterfVV> BOPDS_VectorOfInterfVV;
#endif

View File

@ -0,0 +1,24 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-2012 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 BOPDS_VectorOfInterfVZ_HeaderFile
#define BOPDS_VectorOfInterfVZ_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_Interf.hxx"
typedef NCollection_Vector<BOPDS_InterfVZ> BOPDS_VectorOfInterfVZ;
#endif

View File

@ -0,0 +1,24 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-2012 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 BOPDS_VectorOfInterfZZ_HeaderFile
#define BOPDS_VectorOfInterfZZ_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_Interf.hxx"
typedef NCollection_Vector<BOPDS_InterfZZ> BOPDS_VectorOfInterfZZ;
#endif

View File

@ -0,0 +1,23 @@
// Created by: Peter KURNEV
// 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 BOPDS_VectorOfShapeInfo_HeaderFile
#define BOPDS_VectorOfShapeInfo_HeaderFile
#include "NCollection_Vector.hxx"
#include "BOPDS_ShapeInfo.hxx"
typedef NCollection_Vector<BOPDS_ShapeInfo> BOPDS_VectorOfShapeInfo;
#endif

View File

@ -0,0 +1,66 @@
// Created by: Peter KURNEV
// 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 BOPTools_ConnexityBlock_HeaderFile
#define BOPTools_ConnexityBlock_HeaderFile
#include "NCollection_BaseAllocator.hxx"
#include "TopTools_ListOfShape.hxx"
//=======================================================================
// class : ConnexityBlock
// purpose :
//=======================================================================
class BOPTools_ConnexityBlock
{
public:
BOPTools_ConnexityBlock()
: myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
myRegular(Standard_True),
myShapes(myAllocator),
myLoops(myAllocator) {};
//
BOPTools_ConnexityBlock(const Handle(NCollection_BaseAllocator)& theAllocator)
: myAllocator(theAllocator),
myRegular(Standard_True),
myShapes(myAllocator),
myLoops(myAllocator) {};
//
const TopTools_ListOfShape& Shapes() const { return myShapes; };
//
TopTools_ListOfShape& ChangeShapes() { return myShapes; };
//
void SetRegular(const Standard_Boolean theFlag) { myRegular = theFlag; }
//
Standard_Boolean IsRegular() const { return myRegular; }
//
const TopTools_ListOfShape& Loops() const { return myLoops; };
//
TopTools_ListOfShape& ChangeLoops() { return myLoops; };
//
protected:
Handle(NCollection_BaseAllocator) myAllocator;
Standard_Boolean myRegular;
TopTools_ListOfShape myShapes;
TopTools_ListOfShape myLoops;
};
#endif

View File

@ -0,0 +1,49 @@
// Created by: Peter KURNEV
// 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 BOPTools_CoupleOfShape_HeaderFile
#define BOPTools_CoupleOfShape_HeaderFile
#include "TopoDS_Shape.hxx"
//=======================================================================
// class :
// purpose :
//=======================================================================
class BOPTools_CoupleOfShape
{
public:
BOPTools_CoupleOfShape() {};
//
~BOPTools_CoupleOfShape() {};
//
void SetShape1(const TopoDS_Shape& theShape) { myShape1 = theShape; }
//
const TopoDS_Shape& Shape1() const { return myShape1; }
//
void SetShape2(const TopoDS_Shape& theShape) { myShape2 = theShape; }
//
const TopoDS_Shape& Shape2() const { return myShape2; }
//
protected:
TopoDS_Shape myShape1;
TopoDS_Shape myShape2;
};
#endif

View File

@ -0,0 +1,25 @@
// Created on: 1993-02-19
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BRepAdaptor_Array1OfCurve_HeaderFile
#define BRepAdaptor_Array1OfCurve_HeaderFile
#include "BRepAdaptor_Curve.hxx"
#include "NCollection_Array1.hxx"
typedef NCollection_Array1<BRepAdaptor_Curve> BRepAdaptor_Array1OfCurve;
#endif

View File

@ -0,0 +1,233 @@
// Created by: Peter KURNEV
// Copyright (c) 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 _BRepAlgoAPI_BuilderAlgo_HeaderFile
#define _BRepAlgoAPI_BuilderAlgo_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "BOPAlgo_GlueEnum.hxx"
#include "BOPAlgo_PPaveFiller.hxx"
#include "BOPAlgo_PBuilder.hxx"
#include "BRepAlgoAPI_Algo.hxx"
#include "BRepTools_History.hxx"
#include "Precision.hxx"
#include "Standard_Real.hxx"
#include "TopTools_ListOfShape.hxx"
//! The class contains API level of the General Fuse algorithm.<br>
//!
//! Additionally to the options defined in the base class, the algorithm has
//! the following options:<br>
//! - *Safe processing mode* - allows to avoid modification of the input
//! shapes during the operation (by default it is off);
//! - *Gluing options* - allows to speed up the calculation of the intersections
//! on the special cases, in which some sub-shapes are coinciding.
//! - *Disabling the check for inverted solids* - Disables/Enables the check of the input solids
//! for inverted status (holes in the space). The default value is TRUE,
//! i.e. the check is performed. Setting this flag to FALSE for inverted
//! solids, most likely will lead to incorrect results.
//! - *Disabling history collection* - allows disabling the collection of the history
//! of shapes modifications during the operation.
//!
//! It returns the following Error statuses:<br>
//! - 0 - in case of success;<br>
//! - *BOPAlgo_AlertTooFewArguments* - in case there are no enough arguments to perform the
//! operation;<br>
//! - *BOPAlgo_AlertIntersectionFailed* - in case the intersection of the arguments has failed;<br>
//! - *BOPAlgo_AlertBuilderFailed* - in case building of the result shape has failed.<br>
//!
//! Warnings statuses from underlying DS Filler and Builder algorithms
//! are collected in the report.
//!
//! The class provides possibility to simplify the resulting shape by unification
//! of the tangential edges and faces. It is performed by the method *SimplifyResult*.
//! See description of this method for more details.
//!
class BRepAlgoAPI_BuilderAlgo : public BRepAlgoAPI_Algo
{
public:
DEFINE_STANDARD_ALLOC
public: //! @name Constructors
//! Empty constructor
Standard_EXPORT BRepAlgoAPI_BuilderAlgo();
Standard_EXPORT virtual ~BRepAlgoAPI_BuilderAlgo();
//! Constructor with prepared Filler object
Standard_EXPORT BRepAlgoAPI_BuilderAlgo(const BOPAlgo_PaveFiller& thePF);
public: //! @name Setting/Getting data for the algorithm
//! Sets the arguments
void SetArguments(const TopTools_ListOfShape& theLS) { myArguments = theLS; }
//! Gets the arguments
const TopTools_ListOfShape& Arguments() const { return myArguments; }
public: //! @name Setting options
//! Sets the flag that defines the mode of treatment.
//! In non-destructive mode the argument shapes are not modified. Instead
//! a copy of a sub-shape is created in the result if it is needed to be updated.
void SetNonDestructive(const Standard_Boolean theFlag) { myNonDestructive = theFlag; }
//! Returns the flag that defines the mode of treatment.
//! In non-destructive mode the argument shapes are not modified. Instead
//! a copy of a sub-shape is created in the result if it is needed to be updated.
Standard_Boolean NonDestructive() const { return myNonDestructive; }
//! Sets the glue option for the algorithm,
//! which allows increasing performance of the intersection
//! of the input shapes.
void SetGlue(const BOPAlgo_GlueEnum theGlue) { myGlue = theGlue; }
//! Returns the glue option of the algorithm
BOPAlgo_GlueEnum Glue() const { return myGlue; }
//! Enables/Disables the check of the input solids for inverted status
void SetCheckInverted(const Standard_Boolean theCheck) { myCheckInverted = theCheck; }
//! Returns the flag defining whether the check for input solids on inverted status
//! should be performed or not.
Standard_Boolean CheckInverted() const { return myCheckInverted; }
public: //! @name Performing the operation
//! Performs the algorithm
Standard_EXPORT virtual void Build(
const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
public: //! @name Result simplification
//! Simplification of the result shape is performed by the means of
//! *ShapeUpgrade_UnifySameDomain* algorithm. The result of the operation will
//! be overwritten with the simplified result.
//!
//! The simplification is performed without creation of the Internal shapes,
//! i.e. shapes connections will never be broken.
//!
//! Simplification is performed on the whole result shape. Thus, if the input
//! shapes contained connected tangent edges or faces unmodified during the operation
//! they will also be unified.
//!
//! After simplification, the History of result simplification is merged into the main
//! history of operation. So, it is taken into account when asking for Modified,
//! Generated and Deleted shapes.
//!
//! Some options of the main operation are passed into the Unifier:
//! - Fuzzy tolerance of the operation is given to the Unifier as the linear tolerance.
//! - Non destructive mode here controls the safe input mode in Unifier.
//!
//! @param theUnifyEdges Controls the edges unification. TRUE by default.
//! @param theUnifyFaces Controls the faces unification. TRUE by default.
//! @param theAngularTol Angular criteria for tangency of edges and faces.
//! Precision::Angular() by default.
Standard_EXPORT void SimplifyResult(const Standard_Boolean theUnifyEdges = Standard_True,
const Standard_Boolean theUnifyFaces = Standard_True,
const Standard_Real theAngularTol = Precision::Angular());
public: //! @name History support
//! Returns the shapes modified from the shape <theS>.
//! If any, the list will contain only those splits of the
//! given shape, contained in the result.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS)
Standard_OVERRIDE;
//! Returns the list of shapes generated from the shape <theS>.
//! In frames of Boolean Operations algorithms only Edges and Faces
//! could have Generated elements, as only they produce new elements
//! during intersection:
//! - Edges can generate new vertices;
//! - Faces can generate new edges and vertices.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS)
Standard_OVERRIDE;
//! Checks if the shape <theS> has been completely removed from the result,
//! i.e. the result does not contain the shape itself and any of its splits.
//! Returns TRUE if the shape has been deleted.
Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& aS) Standard_OVERRIDE;
//! Returns true if any of the input shapes has been modified during operation.
Standard_EXPORT virtual Standard_Boolean HasModified() const;
//! Returns true if any of the input shapes has generated shapes during operation.
Standard_EXPORT virtual Standard_Boolean HasGenerated() const;
//! Returns true if any of the input shapes has been deleted during operation.
//! Normally, General Fuse operation should not have Deleted elements,
//! but all derived operation can have.
Standard_EXPORT virtual Standard_Boolean HasDeleted() const;
public: //! @name Enabling/Disabling the history collection.
//! Allows disabling the history collection
void SetToFillHistory(const Standard_Boolean theHistFlag) { myFillHistory = theHistFlag; }
//! Returns flag of history availability
Standard_Boolean HasHistory() const { return myFillHistory; }
public: //! @name Getting the section edges
//! Returns a list of section edges.
//! The edges represent the result of intersection between arguments of operation.
Standard_EXPORT const TopTools_ListOfShape& SectionEdges();
public: //! @name Getting tools performing the job
//! Returns the Intersection tool
const BOPAlgo_PPaveFiller& DSFiller() const { return myDSFiller; }
//! Returns the Building tool
const BOPAlgo_PBuilder& Builder() const { return myBuilder; }
//! History tool
Handle(BRepTools_History) History() const { return myFillHistory ? myHistory : NULL; }
protected: //! @name Setting options to the Intersection tool
//! Sets options (available in child classes) for the intersection tool.
//! Here it does nothing.
virtual void SetAttributes() {}
protected: //! @name Protected methods for shapes intersection and building result
//! Intersects the given shapes with the intersection tool
Standard_EXPORT void IntersectShapes(const TopTools_ListOfShape& theArgs,
const Message_ProgressRange& theRange);
//! Builds the resulting shape
Standard_EXPORT void BuildResult(const Message_ProgressRange& theRange = Message_ProgressRange());
protected: //! @name Clearing the contents of the algorithm
//! Clears the algorithm from previous runs
Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
protected: //! @name Fields
// Inputs
TopTools_ListOfShape myArguments; //!< Arguments of the operation
// Options
Standard_Boolean myNonDestructive; //!< Non-destructive mode management
BOPAlgo_GlueEnum myGlue; //!< Gluing mode management
Standard_Boolean myCheckInverted; //!< Check for inverted solids management
Standard_Boolean myFillHistory; //!< Controls the history collection
// Tools
Standard_Boolean myIsIntersectionNeeded; //!< Flag to control whether the intersection
//! of arguments should be performed or not
BOPAlgo_PPaveFiller myDSFiller; //!< Intersection tool performs intersection of the
//! argument shapes.
BOPAlgo_PBuilder myBuilder; //!< Building tool performs construction of the result
//! basing on the results of intersection
Handle(BRepTools_History) myHistory; //!< General History tool, containing all History of
//! shapes modifications during the operation
//! (including result simplification)
Handle(BRepTools_History) mySimplifierHistory; //!< History of result shape simplification
};
#endif // _BRepAlgoAPI_BuilderAlgo_HeaderFile

View File

@ -0,0 +1,191 @@
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 2018 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 _BRepAlgoAPI_Defeaturing_HeaderFile
#define _BRepAlgoAPI_Defeaturing_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "BOPAlgo_RemoveFeatures.hxx"
#include "BRepAlgoAPI_Algo.hxx"
//! The BRepAlgoAPI_Defeaturing algorithm is the API algorithm intended for
//! removal of the unwanted parts from the shape. The unwanted parts
//! (or features) can be holes, protrusions, gaps, chamfers, fillets etc.
//! The shape itself is not modified, the new shape is built as the result.
//!
//! The actual removal of the features from the shape is performed by
//! the low-level *BOPAlgo_RemoveFeatures* tool. So the defeaturing algorithm
//! has the same options, input data requirements, limitations as the
//! low-level algorithm.
//!
//! <b>Input data</b>
//!
//! Currently, only the shapes of type SOLID, COMPSOLID, and COMPOUND of Solids
//! are supported. And only the FACEs can be removed from the shape.
//!
//! On the input the algorithm accepts the shape itself and the
//! features which have to be removed. It does not matter how the features
//! are given. It could be the separate faces or the collections
//! of faces. The faces should belong to the initial shape, and those that
//! do not belong will be ignored.
//!
//! <b>Options</b>
//!
//! The algorithm has the following options:
//! - History support;
//!
//! and the options available from base class:
//! - Error/Warning reporting system;
//! - Parallel processing mode.
//!
//! Please note that the other options of the base class are not supported
//! here and will have no effect.
//!
//! For the details on the available options please refer to the description
//! of *BOPAlgo_RemoveFeatures* algorithm.
//!
//! <b>Limitations</b>
//!
//! The defeaturing algorithm has the same limitations as *BOPAlgo_RemoveFeatures*
//! algorithm.
//!
//! <b>Example</b>
//!
//! Here is the example of usage of the algorithm:
//! ~~~~
//! TopoDS_Shape aSolid = ...; // Input shape to remove the features from
//! TopTools_ListOfShape aFeatures = ...; // Features to remove from the shape
//! Standard_Boolean bRunParallel = ...; // Parallel processing mode
//! Standard_Boolean isHistoryNeeded = ...; // History support
//!
//! BRepAlgoAPI_Defeaturing aDF; // De-Featuring algorithm
//! aDF.SetShape(aSolid); // Set the shape
//! aDF.AddFacesToRemove(aFaces); // Add faces to remove
//! aDF.SetRunParallel(bRunParallel); // Define the processing mode (parallel or single)
//! aDF.SetToFillHistory(isHistoryNeeded); // Define whether to track the shapes modifications
//! aDF.Build(); // Perform the operation
//! if (!aDF.IsDone()) // Check for the errors
//! {
//! // error treatment
//! Standard_SStream aSStream;
//! aDF.DumpErrors(aSStream);
//! return;
//! }
//! if (aDF.HasWarnings()) // Check for the warnings
//! {
//! // warnings treatment
//! Standard_SStream aSStream;
//! aDF.DumpWarnings(aSStream);
//! }
//! const TopoDS_Shape& aResult = aDF.Shape(); // Result shape
//! ~~~~
//!
//! The algorithm preserves the type of the input shape in the result shape. Thus,
//! if the input shape is a COMPSOLID, the resulting solids will also be put into a COMPSOLID.
//!
class BRepAlgoAPI_Defeaturing : public BRepAlgoAPI_Algo
{
public:
DEFINE_STANDARD_ALLOC
public: //! @name Constructors
//! Empty constructor
BRepAlgoAPI_Defeaturing()
: BRepAlgoAPI_Algo(),
myFillHistory(Standard_True)
{
}
public: //! @name Setting input data for the algorithm
//! Sets the shape for processing.
//! @param[in] theShape The shape to remove the features from.
//! It should either be the SOLID, COMPSOLID or COMPOUND of Solids.
void SetShape(const TopoDS_Shape& theShape) { myInputShape = theShape; }
//! Returns the input shape
const TopoDS_Shape& InputShape() const { return myInputShape; }
//! Adds the features to remove from the input shape.
//! @param[in] theFace The shape to extract the faces for removal.
void AddFaceToRemove(const TopoDS_Shape& theFace) { myFacesToRemove.Append(theFace); }
//! Adds the faces to remove from the input shape.
//! @param[in] theFaces The list of shapes to extract the faces for removal.
void AddFacesToRemove(const TopTools_ListOfShape& theFaces)
{
TopTools_ListIteratorOfListOfShape it(theFaces);
for (; it.More(); it.Next())
myFacesToRemove.Append(it.Value());
}
//! Returns the list of faces which have been requested for removal
//! from the input shape.
const TopTools_ListOfShape& FacesToRemove() const { return myFacesToRemove; }
public: //! @name Performing the operation
//! Performs the operation
Standard_EXPORT virtual void Build(
const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
public: //! @name History Methods
//! Defines whether to track the modification of the shapes or not.
void SetToFillHistory(const Standard_Boolean theFlag) { myFillHistory = theFlag; }
//! Returns whether the history was requested or not.
Standard_Boolean HasHistory() const { return myFillHistory; }
//! Returns the list of shapes modified from the shape <theS> during the operation.
Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS)
Standard_OVERRIDE;
//! Returns the list of shapes generated from the shape <theS> during the operation.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS)
Standard_OVERRIDE;
//! Returns true if the shape <theS> has been deleted during the operation.
//! It means that the shape has no any trace in the result.
//! Otherwise it returns false.
Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS) Standard_OVERRIDE;
//! Returns true if any of the input shapes has been modified during operation.
Standard_EXPORT virtual Standard_Boolean HasModified() const;
//! Returns true if any of the input shapes has generated shapes during operation.
Standard_EXPORT virtual Standard_Boolean HasGenerated() const;
//! Returns true if any of the input shapes has been deleted during operation.
Standard_EXPORT virtual Standard_Boolean HasDeleted() const;
//! Returns the History of shapes modifications
Handle(BRepTools_History) History() { return myFeatureRemovalTool.History(); }
protected: //! @name Setting the algorithm into default state
virtual void Clear() Standard_OVERRIDE
{
BRepAlgoAPI_Algo::Clear();
myFeatureRemovalTool.Clear();
}
protected: //! @name Fields
TopoDS_Shape myInputShape; //!< Input shape to remove the features from
TopTools_ListOfShape myFacesToRemove; //!< Features to remove from the shape
Standard_Boolean myFillHistory; //!< Defines whether to track the history of
//! shapes modifications or not (true by default)
BOPAlgo_RemoveFeatures myFeatureRemovalTool; //!< Tool for the features removal
};
#endif // _BRepAlgoAPI_Defeaturing_HeaderFile

View File

@ -0,0 +1,90 @@
// Created on: 1995-09-01
// Created by: Yves FRICAUD
// Copyright (c) 1995-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 _BRepAlgo_FaceRestrictor_HeaderFile
#define _BRepAlgo_FaceRestrictor_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "TopoDS_Face.hxx"
#include "TopTools_DataMapOfShapeListOfShape.hxx"
class TopoDS_Wire;
//! Builds all the faces limited with a set of non
//! jointing and planars wires. if
//! <ControlOrientation> is false The Wires must have
//! correct orientations. Sinon orientation des wires
//! de telle sorte que les faces ne soient pas infinies
//! et qu'elles soient disjointes.
class BRepAlgo_FaceRestrictor
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepAlgo_FaceRestrictor();
//! the surface of <F> will be the surface of each new
//! faces built.
//! <Proj> is used to update pcurves on edges if necessary.
//! See Add().
Standard_EXPORT void Init(const TopoDS_Face& F,
const Standard_Boolean Proj = Standard_False,
const Standard_Boolean ControlOrientation = Standard_False);
//! Add the wire <W> to the set of wires.
//!
//! Warning:
//! The Wires must be closed.
//!
//! The edges of <W> can be modified if they don't have
//! pcurves on the surface <S> of <F>. In this case
//! if <Proj> is false the first pcurve of the edge
//! is positioned on <S>.
//! if <Proj> is True, the Pcurve On <S> is the
//! projection of the curve 3d on <F>.
Standard_EXPORT void Add(TopoDS_Wire& W);
//! Removes all the Wires
Standard_EXPORT void Clear();
//! Evaluate all the faces limited by the set of Wires.
Standard_EXPORT void Perform();
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT Standard_Boolean More() const;
Standard_EXPORT void Next();
Standard_EXPORT TopoDS_Face Current() const;
protected:
private:
//! Evaluate all the faces limited by the set of Wires.
Standard_EXPORT void PerformWithCorrection();
Standard_Boolean myDone;
Standard_Boolean modeProj;
TopoDS_Face myFace;
TopTools_ListOfShape wires;
TopTools_ListOfShape faces;
Standard_Boolean myCorrection;
TopTools_DataMapOfShapeListOfShape keyIsIn;
TopTools_DataMapOfShapeListOfShape keyContains;
};
#endif // _BRepAlgo_FaceRestrictor_HeaderFile

View File

@ -0,0 +1,121 @@
// Created on: 1997-10-13
// Created by: Roman BORISOV
// Copyright (c) 1997-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 _BRepAlgo_NormalProjection_HeaderFile
#define _BRepAlgo_NormalProjection_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "TopoDS_Shape.hxx"
#include "GeomAbs_Shape.hxx"
#include "Standard_Integer.hxx"
#include "TopTools_DataMapOfShapeShape.hxx"
#include "TopTools_DataMapOfShapeListOfShape.hxx"
#include "TopTools_ListOfShape.hxx"
class TopoDS_Edge;
class Adaptor3d_Curve;
//! This class makes the projection of a wire on a
//! shape.
class BRepAlgo_NormalProjection
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepAlgo_NormalProjection();
Standard_EXPORT BRepAlgo_NormalProjection(const TopoDS_Shape& S);
Standard_EXPORT void Init(const TopoDS_Shape& S);
//! Add an edge or a wire to the list of shape to project
Standard_EXPORT void Add(const TopoDS_Shape& ToProj);
//! Set the parameters used for computation
//! Tol3d is the required tolerance between the 3d projected
//! curve and its 2d representation
//! InternalContinuity is the order of constraints
//! used for approximation.
//! MaxDeg and MaxSeg are the maximum degree and the maximum
//! number of segment for BSpline resulting of an approximation.
Standard_EXPORT void SetParams(const Standard_Real Tol3D,
const Standard_Real Tol2D,
const GeomAbs_Shape InternalContinuity,
const Standard_Integer MaxDegree,
const Standard_Integer MaxSeg);
//! Set the parameters used for computation
//! in their default values
Standard_EXPORT void SetDefaultParams();
//! Sets the maximum distance between target shape and
//! shape to project. If this condition is not satisfied then
//! corresponding part of solution is discarded.
//! if MaxDist < 0 then this method does not affect the algorithm
Standard_EXPORT void SetMaxDistance(const Standard_Real MaxDist);
//! if With3d = Standard_False the 3dcurve is not computed
//! the initial 3dcurve is kept to build the resulting edges.
Standard_EXPORT void Compute3d(const Standard_Boolean With3d = Standard_True);
//! Manage limitation of projected edges.
Standard_EXPORT void SetLimit(const Standard_Boolean FaceBoundaries = Standard_True);
//! Builds the result as a compound.
Standard_EXPORT void Build();
Standard_EXPORT Standard_Boolean IsDone() const;
//! returns the result
Standard_EXPORT const TopoDS_Shape& Projection() const;
//! For a resulting edge, returns the corresponding initial edge.
Standard_EXPORT const TopoDS_Shape& Ancestor(const TopoDS_Edge& E) const;
//! For a projected edge, returns the corresponding initial face.
Standard_EXPORT const TopoDS_Shape& Couple(const TopoDS_Edge& E) const;
//! Returns the list of shapes generated from the
//! shape <S>.
Standard_EXPORT const TopTools_ListOfShape& Generated(const TopoDS_Shape& S);
Standard_EXPORT Standard_Boolean IsElementary(const Adaptor3d_Curve& C) const;
//! build the result as a list of wire if possible in --
//! a first returns a wire only if there is only a wire.
Standard_EXPORT Standard_Boolean BuildWire(TopTools_ListOfShape& Liste) const;
protected:
private:
TopoDS_Shape myShape;
Standard_Boolean myIsDone;
Standard_Real myTol3d;
Standard_Real myTol2d;
Standard_Real myMaxDist;
Standard_Boolean myWith3d;
GeomAbs_Shape myContinuity;
Standard_Integer myMaxDegree;
Standard_Integer myMaxSeg;
Standard_Boolean myFaceBounds;
TopoDS_Shape myToProj;
TopTools_DataMapOfShapeShape myAncestorMap;
TopTools_DataMapOfShapeShape myCorresp;
TopTools_DataMapOfShapeListOfShape myDescendants;
TopoDS_Shape myRes;
};
#endif // _BRepAlgo_NormalProjection_HeaderFile

View File

@ -0,0 +1,174 @@
// Created on: 1995-07-20
// Created by: Modelistation
// Copyright (c) 1995-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 _BRepApprox_SurfaceTool_HeaderFile
#define _BRepApprox_SurfaceTool_HeaderFile
#include "BRepAdaptor_Surface.hxx"
#include "GeomAbs_Shape.hxx"
#include "TColStd_Array1OfReal.hxx"
#include "gp_Pnt.hxx"
#include "gp_Vec.hxx"
#include "GeomAbs_SurfaceType.hxx"
#include "gp_Pln.hxx"
#include "gp_Cylinder.hxx"
#include "gp_Cone.hxx"
#include "gp_Torus.hxx"
#include "gp_Sphere.hxx"
#include "gp_Ax1.hxx"
#include "gp_Dir.hxx"
class Geom_BezierSurface;
class Geom_BSplineSurface;
class BRepApprox_SurfaceTool
{
public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstUParameter(const BRepAdaptor_Surface& S);
static Standard_Real FirstVParameter(const BRepAdaptor_Surface& S);
static Standard_Real LastUParameter(const BRepAdaptor_Surface& S);
static Standard_Real LastVParameter(const BRepAdaptor_Surface& S);
static Standard_Integer NbUIntervals(const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals(const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static void UIntervals(const BRepAdaptor_Surface& S,
TColStd_Array1OfReal& T,
const GeomAbs_Shape Sh);
static void VIntervals(const BRepAdaptor_Surface& S,
TColStd_Array1OfReal& T,
const GeomAbs_Shape Sh);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) UTrim(const BRepAdaptor_Surface& S,
const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) VTrim(const BRepAdaptor_Surface& S,
const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol);
static Standard_Boolean IsUClosed(const BRepAdaptor_Surface& S);
static Standard_Boolean IsVClosed(const BRepAdaptor_Surface& S);
static Standard_Boolean IsUPeriodic(const BRepAdaptor_Surface& S);
static Standard_Real UPeriod(const BRepAdaptor_Surface& S);
static Standard_Boolean IsVPeriodic(const BRepAdaptor_Surface& S);
static Standard_Real VPeriod(const BRepAdaptor_Surface& S);
static gp_Pnt Value(const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v);
static void D0(const BRepAdaptor_Surface& S,
const Standard_Real u,
const Standard_Real v,
gp_Pnt& P);
static void D1(const BRepAdaptor_Surface& S,
const Standard_Real u,
const Standard_Real v,
gp_Pnt& P,
gp_Vec& D1u,
gp_Vec& D1v);
static void D2(const BRepAdaptor_Surface& S,
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);
static void D3(const BRepAdaptor_Surface& S,
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);
static gp_Vec DN(const BRepAdaptor_Surface& S,
const Standard_Real u,
const Standard_Real v,
const Standard_Integer Nu,
const Standard_Integer Nv);
static Standard_Real UResolution(const BRepAdaptor_Surface& S, const Standard_Real R3d);
static Standard_Real VResolution(const BRepAdaptor_Surface& S, const Standard_Real R3d);
static GeomAbs_SurfaceType GetType(const BRepAdaptor_Surface& S);
static gp_Pln Plane(const BRepAdaptor_Surface& S);
static gp_Cylinder Cylinder(const BRepAdaptor_Surface& S);
static gp_Cone Cone(const BRepAdaptor_Surface& S);
static gp_Torus Torus(const BRepAdaptor_Surface& S);
static gp_Sphere Sphere(const BRepAdaptor_Surface& S);
static Handle(Geom_BezierSurface) Bezier(const BRepAdaptor_Surface& S);
static Handle(Geom_BSplineSurface) BSpline(const BRepAdaptor_Surface& S);
static gp_Ax1 AxeOfRevolution(const BRepAdaptor_Surface& S);
static gp_Dir Direction(const BRepAdaptor_Surface& S);
static Handle(Adaptor3d_Curve) BasisCurve(const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesU(const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesV(const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesU(const BRepAdaptor_Surface& S,
const Standard_Real u1,
const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesV(const BRepAdaptor_Surface& S,
const Standard_Real v1,
const Standard_Real v2);
protected:
private:
};
#include "BRepApprox_SurfaceTool.lxx"
#endif // _BRepApprox_SurfaceTool_HeaderFile

View File

@ -0,0 +1,252 @@
// Created on: 1995-07-20
// Created by: Modelistation
// Copyright (c) 1995-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 "gp_Pnt.hxx"
#include "gp_Vec.hxx"
#include "gp_Pln.hxx"
#include "gp_Cylinder.hxx"
#include "gp_Cone.hxx"
#include "gp_Torus.hxx"
#include "gp_Sphere.hxx"
#include "gp_Ax1.hxx"
#include "gp_Dir.hxx"
#include "Geom_BezierSurface.hxx"
#include "Geom_BSplineSurface.hxx"
#include "Adaptor3d_Surface.hxx"
#include "Adaptor3d_Curve.hxx"
inline Standard_Real BRepApprox_SurfaceTool::FirstUParameter(const BRepAdaptor_Surface& Surf)
{
return Surf.FirstUParameter();
}
inline Standard_Real BRepApprox_SurfaceTool::FirstVParameter(const BRepAdaptor_Surface& Surf)
{
return Surf.FirstVParameter();
}
inline Standard_Real BRepApprox_SurfaceTool::LastUParameter(const BRepAdaptor_Surface& Surf)
{
return Surf.LastUParameter();
}
inline Standard_Real BRepApprox_SurfaceTool::LastVParameter(const BRepAdaptor_Surface& Surf)
{
return Surf.LastVParameter();
}
inline Standard_Integer BRepApprox_SurfaceTool::NbUIntervals(const BRepAdaptor_Surface& Surf,
const GeomAbs_Shape S)
{
return Surf.NbUIntervals(S);
}
inline Standard_Integer BRepApprox_SurfaceTool::NbVIntervals(const BRepAdaptor_Surface& Surf,
const GeomAbs_Shape S)
{
return Surf.NbVIntervals(S);
}
inline void BRepApprox_SurfaceTool::UIntervals(const BRepAdaptor_Surface& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S)
{
Surf.UIntervals(Tab, S);
}
inline void BRepApprox_SurfaceTool::VIntervals(const BRepAdaptor_Surface& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S)
{
Surf.VIntervals(Tab, S);
}
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::UTrim(const BRepAdaptor_Surface& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol)
{
return Surf.UTrim(F, L, Tol);
}
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::VTrim(const BRepAdaptor_Surface& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol)
{
return Surf.VTrim(F, L, Tol);
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsUClosed(const BRepAdaptor_Surface& S)
{
return S.IsUClosed();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsVClosed(const BRepAdaptor_Surface& S)
{
return S.IsVClosed();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S)
{
return S.IsUPeriodic();
}
inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const BRepAdaptor_Surface& S)
{
return S.UPeriod();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S)
{
return S.IsVPeriodic();
}
inline Standard_Real BRepApprox_SurfaceTool::VPeriod(const BRepAdaptor_Surface& S)
{
return S.VPeriod();
}
inline gp_Pnt BRepApprox_SurfaceTool::Value(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V)
{
return S.Value(U, V);
}
inline void BRepApprox_SurfaceTool::D0(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P)
{
S.D0(U, V, P);
}
inline void BRepApprox_SurfaceTool::D1(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V)
{
S.D1(U, V, P, D1U, D1V);
}
inline void BRepApprox_SurfaceTool::D2(const BRepAdaptor_Surface& S,
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)
{
S.D2(U, V, P, D1U, D1V, D2U, D2V, D2UV);
}
inline void BRepApprox_SurfaceTool::D3(const BRepAdaptor_Surface& S,
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)
{
S.D3(U, V, P, D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV);
}
inline gp_Vec BRepApprox_SurfaceTool::DN(const BRepAdaptor_Surface& S,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv)
{
return S.DN(U, V, Nu, Nv);
}
inline Standard_Real BRepApprox_SurfaceTool::UResolution(const BRepAdaptor_Surface& S,
const Standard_Real R3d)
{
return S.UResolution(R3d);
}
inline Standard_Real BRepApprox_SurfaceTool::VResolution(const BRepAdaptor_Surface& S,
const Standard_Real R3d)
{
return S.VResolution(R3d);
}
inline GeomAbs_SurfaceType BRepApprox_SurfaceTool::GetType(const BRepAdaptor_Surface& S)
{
return S.GetType();
}
inline gp_Pln BRepApprox_SurfaceTool::Plane(const BRepAdaptor_Surface& S)
{
return S.Plane();
}
inline gp_Cylinder BRepApprox_SurfaceTool::Cylinder(const BRepAdaptor_Surface& S)
{
return S.Cylinder();
}
inline gp_Cone BRepApprox_SurfaceTool::Cone(const BRepAdaptor_Surface& S)
{
return S.Cone();
}
inline gp_Sphere BRepApprox_SurfaceTool::Sphere(const BRepAdaptor_Surface& S)
{
return S.Sphere();
}
inline gp_Torus BRepApprox_SurfaceTool::Torus(const BRepAdaptor_Surface& S)
{
return S.Torus();
}
inline Handle(Geom_BezierSurface) BRepApprox_SurfaceTool::Bezier(const BRepAdaptor_Surface& S)
{
return (S.Bezier());
}
inline Handle(Geom_BSplineSurface) BRepApprox_SurfaceTool::BSpline(const BRepAdaptor_Surface& S)
{
return (S.BSpline());
}
inline gp_Ax1 BRepApprox_SurfaceTool::AxeOfRevolution(const BRepAdaptor_Surface& S)
{
return (S.AxeOfRevolution());
}
inline gp_Dir BRepApprox_SurfaceTool::Direction(const BRepAdaptor_Surface& S)
{
return (S.Direction());
}
inline Handle(Adaptor3d_Curve) BRepApprox_SurfaceTool::BasisCurve(const BRepAdaptor_Surface& S)
{
return (S.BasisCurve());
}

View File

@ -0,0 +1,56 @@
// Created on: 1998-05-12
// Created by: Philippe NOUAILLE
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBlend_AppFuncRstRst_HeaderFile
#define _BRepBlend_AppFuncRstRst_HeaderFile
#include "Standard.hxx"
#include "Standard_Type.hxx"
#include "BRepBlend_AppFuncRoot.hxx"
#include "math_Vector.hxx"
class BRepBlend_Line;
class Blend_RstRstFunction;
class Blend_AppFunction;
class Blend_Point;
class BRepBlend_AppFuncRstRst;
DEFINE_STANDARD_HANDLE(BRepBlend_AppFuncRstRst, BRepBlend_AppFuncRoot)
//! Function to approximate by AppSurface for Edge/Face (Curve/Curve contact).
class BRepBlend_AppFuncRstRst : public BRepBlend_AppFuncRoot
{
public:
Standard_EXPORT BRepBlend_AppFuncRstRst(Handle(BRepBlend_Line)& Line,
Blend_RstRstFunction& Func,
const Standard_Real Tol3d,
const Standard_Real Tol2d);
Standard_EXPORT void Point(const Blend_AppFunction& Func,
const Standard_Real Param,
const math_Vector& Sol,
Blend_Point& Pnt) const Standard_OVERRIDE;
Standard_EXPORT void Vec(math_Vector& Sol, const Blend_Point& Pnt) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BRepBlend_AppFuncRstRst, BRepBlend_AppFuncRoot)
protected:
private:
};
#endif // _BRepBlend_AppFuncRstRst_HeaderFile

View File

@ -0,0 +1,22 @@
// Created by: Julia GERASIMOVA
// Copyright (c) 2015 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 _BRepBlend_ConstThroatInv_HeaderFile
#define _BRepBlend_ConstThroatInv_HeaderFile
#include "BlendFunc_ConstThroatInv.hxx"
typedef BlendFunc_ConstThroatInv BRepBlend_ConstThroatInv;
#endif // _BRepBlend_ConstThroatInv_HeaderFile

View File

@ -0,0 +1,98 @@
// Created on: 1997-02-12
// Created by: Laurent BOURESCHE
// Copyright (c) 1997-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 _BRepBlend_CurvPointRadInv_HeaderFile
#define _BRepBlend_CurvPointRadInv_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "gp_Pnt.hxx"
#include "Standard_Integer.hxx"
#include "Blend_CurvPointFuncInv.hxx"
#include "math_Vector.hxx"
class math_Matrix;
//! Function of reframing between a point and a curve.
//! valid in cases of constant and progressive radius.
//! This function is used to find a solution on a done
//! point of the curve 1 when using RstRstConsRad or
//! CSConstRad...
//! The vector <X> used in Value, Values and Derivatives
//! methods has to be the vector of the parametric
//! coordinates w, U where w is the parameter on the
//! guide line, U are the parametric coordinates of a
//! point on the partner curve 2.
class BRepBlend_CurvPointRadInv : public Blend_CurvPointFuncInv
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepBlend_CurvPointRadInv(const Handle(Adaptor3d_Curve)& C1,
const Handle(Adaptor3d_Curve)& C2);
Standard_EXPORT void Set(const Standard_Integer Choix);
//! returns 2.
Standard_EXPORT Standard_Integer NbEquations() const;
//! computes the values <F> of the Functions for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Value(const math_Vector& X, math_Vector& F);
//! returns the values <D> of the derivatives for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Derivatives(const math_Vector& X, math_Matrix& D);
//! returns the values <F> of the functions and the derivatives
//! <D> for the variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Values(const math_Vector& X, math_Vector& F, math_Matrix& D);
//! Set the Point on which a solution has to be found.
Standard_EXPORT void Set(const gp_Pnt& P);
//! Returns in the vector Tolerance the parametric tolerance
//! for each of the 3 variables;
//! Tol is the tolerance used in 3d space.
Standard_EXPORT void GetTolerance(math_Vector& Tolerance, const Standard_Real Tol) const;
//! Returns in the vector InfBound the lowest values allowed
//! for each of the 3 variables.
//! Returns in the vector SupBound the greatest values allowed
//! for each of the 3 variables.
Standard_EXPORT void GetBounds(math_Vector& InfBound, math_Vector& SupBound) const;
//! Returns Standard_True if Sol is a zero of the function.
//! Tol is the tolerance used in 3d space.
Standard_EXPORT Standard_Boolean IsSolution(const math_Vector& Sol, const Standard_Real Tol);
protected:
private:
Handle(Adaptor3d_Curve) curv1;
Handle(Adaptor3d_Curve) curv2;
gp_Pnt point;
Standard_Integer choix;
};
#endif // _BRepBlend_CurvPointRadInv_HeaderFile

View File

@ -0,0 +1,140 @@
// Created on: 1995-07-17
// Created by: Laurent BUCHARD
// Copyright (c) 1995-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 _BRepBlend_HCurve2dTool_HeaderFile
#define _BRepBlend_HCurve2dTool_HeaderFile
#include "Adaptor2d_Curve2d.hxx"
#include "GeomAbs_CurveType.hxx"
#include "GeomAbs_Shape.hxx"
#include "gp_Lin2d.hxx"
#include "gp_Circ2d.hxx"
#include "gp_Elips2d.hxx"
#include "gp_Parab2d.hxx"
#include "gp_Pnt2d.hxx"
#include "gp_Vec2d.hxx"
#include "gp_Hypr2d.hxx"
#include "TColStd_Array1OfReal.hxx"
class BRepBlend_HCurve2dTool
{
public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstParameter(const Handle(Adaptor2d_Curve2d)& C);
static Standard_Real LastParameter(const Handle(Adaptor2d_Curve2d)& C);
static GeomAbs_Shape Continuity(const Handle(Adaptor2d_Curve2d)& C);
//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(myclass) >= <S>
static Standard_Integer NbIntervals(const Handle(Adaptor2d_Curve2d)& C, const GeomAbs_Shape S);
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//!
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
static void Intervals(const Handle(Adaptor2d_Curve2d)& C,
TColStd_Array1OfReal& T,
const GeomAbs_Shape S);
static Standard_Boolean IsClosed(const Handle(Adaptor2d_Curve2d)& C);
static Standard_Boolean IsPeriodic(const Handle(Adaptor2d_Curve2d)& C);
static Standard_Real Period(const Handle(Adaptor2d_Curve2d)& C);
//! Computes the point of parameter U on the curve.
static gp_Pnt2d Value(const Handle(Adaptor2d_Curve2d)& C, const Standard_Real U);
//! Computes the point of parameter U on the curve.
static void D0(const Handle(Adaptor2d_Curve2d)& C, const Standard_Real U, gp_Pnt2d& P);
//! Computes the point of parameter U on the curve with its
//! first derivative.
//! Raised if the continuity of the current interval
//! is not C1.
static void D1(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V);
//! Returns the point P of parameter U, the first and second
//! derivatives V1 and V2.
//! Raised if the continuity of the current interval
//! is not C2.
static void D2(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2);
//! Returns the point P of parameter U, the first, the second
//! and the third derivative.
//! Raised if the continuity of the current interval
//! is not C3.
static void D3(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3);
//! The returned vector gives the value of the derivative for the
//! order of derivation N.
//! Raised if the continuity of the current interval
//! is not CN.
//! Raised if N < 1.
static gp_Vec2d DN(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U,
const Standard_Integer N);
//! Returns the parametric resolution corresponding
//! to the real space resolution <R3d>.
static Standard_Real Resolution(const Handle(Adaptor2d_Curve2d)& C, const Standard_Real R3d);
//! Returns the type of the curve in the current
//! interval : Line, Circle, Ellipse, Hyperbola,
//! Parabola, BezierCurve, BSplineCurve, OtherCurve.
static GeomAbs_CurveType GetType(const Handle(Adaptor2d_Curve2d)& C);
static gp_Lin2d Line(const Handle(Adaptor2d_Curve2d)& C);
static gp_Circ2d Circle(const Handle(Adaptor2d_Curve2d)& C);
static gp_Elips2d Ellipse(const Handle(Adaptor2d_Curve2d)& C);
static gp_Hypr2d Hyperbola(const Handle(Adaptor2d_Curve2d)& C);
static gp_Parab2d Parabola(const Handle(Adaptor2d_Curve2d)& C);
static Handle(Geom2d_BezierCurve) Bezier(const Handle(Adaptor2d_Curve2d)& C);
static Handle(Geom2d_BSplineCurve) BSpline(const Handle(Adaptor2d_Curve2d)& C);
Standard_EXPORT static Standard_Integer NbSamples(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U0,
const Standard_Real U1);
protected:
private:
};
#include "BRepBlend_HCurve2dTool.lxx"
#endif // _BRepBlend_HCurve2dTool_HeaderFile

View File

@ -0,0 +1,195 @@
// Created on: 1992-10-22
// Created by: Laurent BUCHARD
// 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 "GeomAbs_CurveType.hxx"
#include "GeomAbs_Shape.hxx"
#include "gp_Vec2d.hxx"
#include "gp_Lin2d.hxx"
#include "gp_Circ2d.hxx"
#include "gp_Elips2d.hxx"
#include "gp_Parab2d.hxx"
#include "gp_Hypr2d.hxx"
#include "Geom2d_BezierCurve.hxx"
#include "Geom2d_BSplineCurve.hxx"
#include "TColStd_Array1OfReal.hxx"
//============================================================
inline Standard_Real BRepBlend_HCurve2dTool::FirstParameter(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->FirstParameter());
}
//============================================================
inline Standard_Real BRepBlend_HCurve2dTool::LastParameter(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->LastParameter());
}
//============================================================
inline GeomAbs_Shape BRepBlend_HCurve2dTool::Continuity(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->Continuity());
}
//============================================================
inline Standard_Integer BRepBlend_HCurve2dTool::NbIntervals(const Handle(Adaptor2d_Curve2d)& C,
const GeomAbs_Shape Sh)
{
return (C->NbIntervals(Sh));
}
//============================================================
inline void BRepBlend_HCurve2dTool::Intervals(const Handle(Adaptor2d_Curve2d)& C,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape Sh)
{
C->Intervals(Tab, Sh);
}
//============================================================
inline Standard_Boolean BRepBlend_HCurve2dTool::IsClosed(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->IsClosed());
}
//============================================================
inline Standard_Boolean BRepBlend_HCurve2dTool::IsPeriodic(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->IsPeriodic());
}
//============================================================
inline Standard_Real BRepBlend_HCurve2dTool::Period(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->Period());
}
//============================================================
inline gp_Pnt2d BRepBlend_HCurve2dTool::Value(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U)
{
return (C->Value(U));
}
//============================================================
inline void BRepBlend_HCurve2dTool::D0(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U,
gp_Pnt2d& P)
{
C->D0(U, P);
}
//============================================================
inline void BRepBlend_HCurve2dTool::D1(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& T)
{
C->D1(U, P, T);
}
//============================================================
inline void BRepBlend_HCurve2dTool::D2(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& T,
gp_Vec2d& N)
{
C->D2(U, P, T, N);
}
//============================================================
inline void BRepBlend_HCurve2dTool::D3(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3)
{
C->D3(U, P, V1, V2, V3);
}
//============================================================
inline gp_Vec2d BRepBlend_HCurve2dTool::DN(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real U,
const Standard_Integer N)
{
return (C->DN(U, N));
}
//============================================================
inline Standard_Real BRepBlend_HCurve2dTool::Resolution(const Handle(Adaptor2d_Curve2d)& C,
const Standard_Real R3d)
{
return (C->Resolution(R3d));
}
//============================================================
inline GeomAbs_CurveType BRepBlend_HCurve2dTool::GetType(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->GetType());
}
//============================================================
inline gp_Lin2d BRepBlend_HCurve2dTool::Line(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->Line());
}
//============================================================
inline gp_Circ2d BRepBlend_HCurve2dTool::Circle(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->Circle());
}
//============================================================
inline gp_Elips2d BRepBlend_HCurve2dTool::Ellipse(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->Ellipse());
}
//============================================================
inline gp_Parab2d BRepBlend_HCurve2dTool::Parabola(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->Parabola());
}
//============================================================
inline gp_Hypr2d BRepBlend_HCurve2dTool::Hyperbola(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->Hyperbola());
}
//============================================================
inline Handle(Geom2d_BezierCurve) BRepBlend_HCurve2dTool::Bezier(const Handle(Adaptor2d_Curve2d)& C)
{
return (C->Bezier());
}
//============================================================
inline Handle(Geom2d_BSplineCurve) BRepBlend_HCurve2dTool::BSpline(
const Handle(Adaptor2d_Curve2d)& C)
{
return (C->BSpline());
}
//============================================================

View File

@ -0,0 +1,279 @@
// Created on: 1997-02-06
// Created by: Laurent BOURESCHE
// Copyright (c) 1997-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 _BRepBlend_RstRstConstRad_HeaderFile
#define _BRepBlend_RstRstConstRad_HeaderFile
#include "Adaptor3d_Surface.hxx"
#include "Adaptor3d_CurveOnSurface.hxx"
#include "gp_Pnt.hxx"
#include "gp_Pnt2d.hxx"
#include "gp_Vec.hxx"
#include "gp_Vec2d.hxx"
#include "BlendFunc_SectionShape.hxx"
#include "Convert_ParameterisationType.hxx"
#include "Blend_RstRstFunction.hxx"
#include "math_Vector.hxx"
#include "Blend_DecrochStatus.hxx"
#include "TColStd_Array1OfReal.hxx"
#include "GeomAbs_Shape.hxx"
#include "TColStd_Array1OfInteger.hxx"
#include "TColgp_Array1OfPnt.hxx"
#include "TColgp_Array1OfVec.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "TColgp_Array1OfVec2d.hxx"
class math_Matrix;
class gp_Circ;
class Blend_Point;
//! Copy of CSConstRad with a pcurve on surface
//! as support.
class BRepBlend_RstRstConstRad : public Blend_RstRstFunction
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepBlend_RstRstConstRad(const Handle(Adaptor3d_Surface)& Surf1,
const Handle(Adaptor2d_Curve2d)& Rst1,
const Handle(Adaptor3d_Surface)& Surf2,
const Handle(Adaptor2d_Curve2d)& Rst2,
const Handle(Adaptor3d_Curve)& CGuide);
//! Returns 2.
Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE;
//! Returns 2.
Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
//! computes the values <F> of the Functions for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Value(const math_Vector& X, math_Vector& F) Standard_OVERRIDE;
//! returns the values <D> of the derivatives for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Derivatives(const math_Vector& X,
math_Matrix& D) Standard_OVERRIDE;
//! returns the values <F> of the functions and the derivatives
//! <D> for the variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Values(const math_Vector& X,
math_Vector& F,
math_Matrix& D) Standard_OVERRIDE;
Standard_EXPORT void Set(const Handle(Adaptor3d_Surface)& SurfRef1,
const Handle(Adaptor2d_Curve2d)& RstRef1,
const Handle(Adaptor3d_Surface)& SurfRef2,
const Handle(Adaptor2d_Curve2d)& RstRef2);
Standard_EXPORT void Set(const Standard_Real Param) Standard_OVERRIDE;
//! Sets the bounds of the parametric interval on
//! the guide line.
//! This determines the derivatives in these values if the
//! function is not Cn.
Standard_EXPORT void Set(const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
Standard_EXPORT void GetTolerance(math_Vector& Tolerance,
const Standard_Real Tol) const Standard_OVERRIDE;
Standard_EXPORT void GetBounds(math_Vector& InfBound,
math_Vector& SupBound) const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsSolution(const math_Vector& Sol,
const Standard_Real Tol) Standard_OVERRIDE;
//! Returns the minimal Distance between two
//! extremities of calculated sections.
Standard_EXPORT virtual Standard_Real GetMinimalDistance() const Standard_OVERRIDE;
Standard_EXPORT const gp_Pnt& PointOnRst1() const Standard_OVERRIDE;
Standard_EXPORT const gp_Pnt& PointOnRst2() const Standard_OVERRIDE;
//! Returns U,V coordinates of the point on the surface.
Standard_EXPORT const gp_Pnt2d& Pnt2dOnRst1() const Standard_OVERRIDE;
//! Returns U,V coordinates of the point on the curve on
//! surface.
Standard_EXPORT const gp_Pnt2d& Pnt2dOnRst2() const Standard_OVERRIDE;
//! Returns parameter of the point on the curve.
Standard_EXPORT Standard_Real ParameterOnRst1() const Standard_OVERRIDE;
//! Returns parameter of the point on the curve.
Standard_EXPORT Standard_Real ParameterOnRst2() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec& TangentOnRst1() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec2d& Tangent2dOnRst1() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec& TangentOnRst2() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec2d& Tangent2dOnRst2() const Standard_OVERRIDE;
//! Permet d ' implementer un critere de decrochage
//! specifique a la fonction.
Standard_EXPORT Blend_DecrochStatus Decroch(const math_Vector& Sol,
gp_Vec& NRst1,
gp_Vec& TgRst1,
gp_Vec& NRst2,
gp_Vec& TgRst2) const Standard_OVERRIDE;
Standard_EXPORT void Set(const Standard_Real Radius, const Standard_Integer Choix);
//! Sets the type of section generation for the
//! approximations.
Standard_EXPORT void Set(const BlendFunc_SectionShape TypeSection);
//! Give the center of circle define by PtRst1, PtRst2 and
//! radius ray.
Standard_EXPORT Standard_Boolean CenterCircleRst1Rst2(const gp_Pnt& PtRst1,
const gp_Pnt& PtRst2,
const gp_Vec& np,
gp_Pnt& Center,
gp_Vec& VdMed) const;
Standard_EXPORT void Section(const Standard_Real Param,
const Standard_Real U,
const Standard_Real V,
Standard_Real& Pdeb,
Standard_Real& Pfin,
gp_Circ& C);
//! Returns if the section is rational
Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
//! Returns the length of the maximum section
Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE;
//! Compute the minimal value of weight for each poles
//! of all sections.
Standard_EXPORT void GetMinimalWeight(TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(me) >= <S>
Standard_EXPORT Standard_Integer NbIntervals(const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT void Intervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const Standard_OVERRIDE;
Standard_EXPORT void GetShape(Standard_Integer& NbPoles,
Standard_Integer& NbKnots,
Standard_Integer& Degree,
Standard_Integer& NbPoles2d) Standard_OVERRIDE;
//! Returns the tolerance to reach in approximation
//! to respect
//! BoundTol error at the Boundary
//! AngleTol tangent error at the Boundary
//! SurfTol error inside the surface.
Standard_EXPORT void GetTolerance(const Standard_Real BoundTol,
const Standard_Real SurfTol,
const Standard_Real AngleTol,
math_Vector& Tol3d,
math_Vector& Tol1D) const Standard_OVERRIDE;
Standard_EXPORT void Knots(TColStd_Array1OfReal& TKnots) Standard_OVERRIDE;
Standard_EXPORT void Mults(TColStd_Array1OfInteger& TMults) Standard_OVERRIDE;
//! Used for the first and last section
Standard_EXPORT Standard_Boolean Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
Standard_EXPORT void Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
//! Used for the first and last section
//! The method returns Standard_True if the derivatives
//! are computed, otherwise it returns Standard_False.
Standard_EXPORT Standard_Boolean Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfVec& D2Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColgp_Array1OfVec2d& D2Poles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths,
TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;
Standard_EXPORT void Resolution(const Standard_Integer IC2d,
const Standard_Real Tol,
Standard_Real& TolU,
Standard_Real& TolV) const Standard_OVERRIDE;
protected:
private:
Handle(Adaptor3d_Surface) surf1;
Handle(Adaptor3d_Surface) surf2;
Handle(Adaptor2d_Curve2d) rst1;
Handle(Adaptor2d_Curve2d) rst2;
Adaptor3d_CurveOnSurface cons1;
Adaptor3d_CurveOnSurface cons2;
Handle(Adaptor3d_Curve) guide;
Handle(Adaptor3d_Curve) tguide;
gp_Pnt ptrst1;
gp_Pnt ptrst2;
gp_Pnt2d pt2drst1;
gp_Pnt2d pt2drst2;
Standard_Real prmrst1;
Standard_Real prmrst2;
Standard_Boolean istangent;
gp_Vec tgrst1;
gp_Vec2d tg2drst1;
gp_Vec tgrst2;
gp_Vec2d tg2drst2;
Standard_Real ray;
Standard_Integer choix;
gp_Pnt ptgui;
gp_Vec d1gui;
gp_Vec d2gui;
gp_Vec nplan;
Standard_Real normtg;
Standard_Real theD;
Handle(Adaptor3d_Surface) surfref1;
Handle(Adaptor2d_Curve2d) rstref1;
Handle(Adaptor3d_Surface) surfref2;
Handle(Adaptor2d_Curve2d) rstref2;
Standard_Real maxang;
Standard_Real minang;
Standard_Real distmin;
BlendFunc_SectionShape mySShape;
Convert_ParameterisationType myTConv;
};
#endif // _BRepBlend_RstRstConstRad_HeaderFile

View File

@ -0,0 +1,284 @@
// Created on: 1997-02-06
// Created by: Laurent BOURESCHE
// Copyright (c) 1997-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 _BRepBlend_RstRstEvolRad_HeaderFile
#define _BRepBlend_RstRstEvolRad_HeaderFile
#include "Adaptor3d_CurveOnSurface.hxx"
#include "Adaptor3d_Surface.hxx"
#include "gp_Pnt.hxx"
#include "gp_Pnt2d.hxx"
#include "gp_Vec.hxx"
#include "gp_Vec2d.hxx"
#include "BlendFunc_SectionShape.hxx"
#include "Convert_ParameterisationType.hxx"
#include "Blend_RstRstFunction.hxx"
#include "math_Vector.hxx"
#include "Blend_DecrochStatus.hxx"
#include "TColStd_Array1OfReal.hxx"
#include "GeomAbs_Shape.hxx"
#include "TColStd_Array1OfInteger.hxx"
#include "TColgp_Array1OfPnt.hxx"
#include "TColgp_Array1OfVec.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "TColgp_Array1OfVec2d.hxx"
class Law_Function;
class math_Matrix;
class gp_Circ;
class Blend_Point;
//! Function to approximate by AppSurface for
//! Edge/Edge and evolutif radius
class BRepBlend_RstRstEvolRad : public Blend_RstRstFunction
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepBlend_RstRstEvolRad(const Handle(Adaptor3d_Surface)& Surf1,
const Handle(Adaptor2d_Curve2d)& Rst1,
const Handle(Adaptor3d_Surface)& Surf2,
const Handle(Adaptor2d_Curve2d)& Rst2,
const Handle(Adaptor3d_Curve)& CGuide,
const Handle(Law_Function)& Evol);
//! Returns 2.
Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE;
//! Returns 2.
Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
//! computes the values <F> of the Functions for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Value(const math_Vector& X, math_Vector& F) Standard_OVERRIDE;
//! returns the values <D> of the derivatives for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Derivatives(const math_Vector& X,
math_Matrix& D) Standard_OVERRIDE;
//! returns the values <F> of the functions and the derivatives
//! <D> for the variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Values(const math_Vector& X,
math_Vector& F,
math_Matrix& D) Standard_OVERRIDE;
Standard_EXPORT void Set(const Handle(Adaptor3d_Surface)& SurfRef1,
const Handle(Adaptor2d_Curve2d)& RstRef1,
const Handle(Adaptor3d_Surface)& SurfRef2,
const Handle(Adaptor2d_Curve2d)& RstRef2);
Standard_EXPORT void Set(const Standard_Real Param) Standard_OVERRIDE;
//! Sets the bounds of the parametric interval on
//! the guide line.
//! This determines the derivatives in these values if the
//! function is not Cn.
Standard_EXPORT void Set(const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
Standard_EXPORT void GetTolerance(math_Vector& Tolerance,
const Standard_Real Tol) const Standard_OVERRIDE;
Standard_EXPORT void GetBounds(math_Vector& InfBound,
math_Vector& SupBound) const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsSolution(const math_Vector& Sol,
const Standard_Real Tol) Standard_OVERRIDE;
//! Returns the minimal Distance between two
//! extremities of calculated sections.
Standard_EXPORT virtual Standard_Real GetMinimalDistance() const Standard_OVERRIDE;
Standard_EXPORT const gp_Pnt& PointOnRst1() const Standard_OVERRIDE;
Standard_EXPORT const gp_Pnt& PointOnRst2() const Standard_OVERRIDE;
//! Returns U,V coordinates of the point on the surface.
Standard_EXPORT const gp_Pnt2d& Pnt2dOnRst1() const Standard_OVERRIDE;
//! Returns U,V coordinates of the point on the curve on
//! surface.
Standard_EXPORT const gp_Pnt2d& Pnt2dOnRst2() const Standard_OVERRIDE;
//! Returns parameter of the point on the curve.
Standard_EXPORT Standard_Real ParameterOnRst1() const Standard_OVERRIDE;
//! Returns parameter of the point on the curve.
Standard_EXPORT Standard_Real ParameterOnRst2() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec& TangentOnRst1() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec2d& Tangent2dOnRst1() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec& TangentOnRst2() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec2d& Tangent2dOnRst2() const Standard_OVERRIDE;
//! Enables implementation of a criterion of decrochage
//! specific to the function.
Standard_EXPORT Blend_DecrochStatus Decroch(const math_Vector& Sol,
gp_Vec& NRst1,
gp_Vec& TgRst1,
gp_Vec& NRst2,
gp_Vec& TgRst2) const Standard_OVERRIDE;
Standard_EXPORT void Set(const Standard_Integer Choix);
//! Sets the type of section generation for the
//! approximations.
Standard_EXPORT void Set(const BlendFunc_SectionShape TypeSection);
//! Gives the center of circle defined by PtRst1, PtRst2 and
//! radius ray.
Standard_EXPORT Standard_Boolean CenterCircleRst1Rst2(const gp_Pnt& PtRst1,
const gp_Pnt& PtRst2,
const gp_Vec& np,
gp_Pnt& Center,
gp_Vec& VdMed) const;
Standard_EXPORT void Section(const Standard_Real Param,
const Standard_Real U,
const Standard_Real V,
Standard_Real& Pdeb,
Standard_Real& Pfin,
gp_Circ& C);
//! Returns if the section is rational
Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
//! Returns the length of the maximum section
Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE;
//! Compute the minimal value of weight for each poles
//! of all sections.
Standard_EXPORT void GetMinimalWeight(TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(me) >= <S>
Standard_EXPORT Standard_Integer NbIntervals(const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT void Intervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const Standard_OVERRIDE;
Standard_EXPORT void GetShape(Standard_Integer& NbPoles,
Standard_Integer& NbKnots,
Standard_Integer& Degree,
Standard_Integer& NbPoles2d) Standard_OVERRIDE;
//! Returns the tolerance to reach in approximation
//! to respect
//! BoundTol error at the Boundary
//! AngleTol tangent error at the Boundary
//! SurfTol error inside the surface.
Standard_EXPORT void GetTolerance(const Standard_Real BoundTol,
const Standard_Real SurfTol,
const Standard_Real AngleTol,
math_Vector& Tol3d,
math_Vector& Tol1D) const Standard_OVERRIDE;
Standard_EXPORT void Knots(TColStd_Array1OfReal& TKnots) Standard_OVERRIDE;
Standard_EXPORT void Mults(TColStd_Array1OfInteger& TMults) Standard_OVERRIDE;
//! Used for the first and last section
Standard_EXPORT Standard_Boolean Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
Standard_EXPORT void Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
//! Used for the first and last section
//! The method returns Standard_True if the derivatives
//! are computed, otherwise it returns Standard_False.
Standard_EXPORT Standard_Boolean Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfVec& D2Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColgp_Array1OfVec2d& D2Poles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths,
TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;
Standard_EXPORT void Resolution(const Standard_Integer IC2d,
const Standard_Real Tol,
Standard_Real& TolU,
Standard_Real& TolV) const Standard_OVERRIDE;
protected:
private:
Handle(Adaptor3d_Surface) surf1;
Handle(Adaptor3d_Surface) surf2;
Handle(Adaptor2d_Curve2d) rst1;
Handle(Adaptor2d_Curve2d) rst2;
Adaptor3d_CurveOnSurface cons1;
Adaptor3d_CurveOnSurface cons2;
Handle(Adaptor3d_Curve) guide;
Handle(Adaptor3d_Curve) tguide;
gp_Pnt ptrst1;
gp_Pnt ptrst2;
gp_Pnt2d pt2drst1;
gp_Pnt2d pt2drst2;
Standard_Real prmrst1;
Standard_Real prmrst2;
Standard_Boolean istangent;
gp_Vec tgrst1;
gp_Vec2d tg2drst1;
gp_Vec tgrst2;
gp_Vec2d tg2drst2;
Standard_Real ray;
Standard_Real dray;
Standard_Integer choix;
gp_Pnt ptgui;
gp_Vec d1gui;
gp_Vec d2gui;
gp_Vec nplan;
Standard_Real normtg;
Standard_Real theD;
Handle(Adaptor3d_Surface) surfref1;
Handle(Adaptor2d_Curve2d) rstref1;
Handle(Adaptor3d_Surface) surfref2;
Handle(Adaptor2d_Curve2d) rstref2;
Standard_Real maxang;
Standard_Real minang;
Standard_Real distmin;
BlendFunc_SectionShape mySShape;
Convert_ParameterisationType myTConv;
Handle(Law_Function) tevol;
Handle(Law_Function) fevol;
};
#endif // _BRepBlend_RstRstEvolRad_HeaderFile

View File

@ -0,0 +1,25 @@
// Created on: 1993-12-06
// Created by: Jacques GOUSSARD
// 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 BRepBlend_SequenceOfLine_HeaderFile
#define BRepBlend_SequenceOfLine_HeaderFile
#include "BRepBlend_Line.hxx"
#include "NCollection_Sequence.hxx"
typedef NCollection_Sequence<Handle(BRepBlend_Line)> BRepBlend_SequenceOfLine;
#endif

View File

@ -0,0 +1,260 @@
// Created on: 1997-02-06
// Created by: Laurent BOURESCHE
// Copyright (c) 1997-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 _BRepBlend_SurfRstConstRad_HeaderFile
#define _BRepBlend_SurfRstConstRad_HeaderFile
#include "Adaptor3d_Surface.hxx"
#include "Adaptor3d_CurveOnSurface.hxx"
#include "gp_Pnt.hxx"
#include "gp_Pnt2d.hxx"
#include "gp_Vec.hxx"
#include "gp_Vec2d.hxx"
#include "BlendFunc_SectionShape.hxx"
#include "Convert_ParameterisationType.hxx"
#include "Blend_SurfRstFunction.hxx"
#include "math_Vector.hxx"
#include "TColStd_Array1OfReal.hxx"
#include "GeomAbs_Shape.hxx"
#include "TColStd_Array1OfInteger.hxx"
#include "TColgp_Array1OfPnt.hxx"
#include "TColgp_Array1OfVec.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "TColgp_Array1OfVec2d.hxx"
class math_Matrix;
class gp_Circ;
class Blend_Point;
//! Copy of CSConstRad with pcurve on surface
//! as support.
class BRepBlend_SurfRstConstRad : public Blend_SurfRstFunction
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepBlend_SurfRstConstRad(const Handle(Adaptor3d_Surface)& Surf,
const Handle(Adaptor3d_Surface)& SurfRst,
const Handle(Adaptor2d_Curve2d)& Rst,
const Handle(Adaptor3d_Curve)& CGuide);
//! Returns 3.
Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE;
//! Returns 3.
Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
//! computes the values <F> of the Functions for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Value(const math_Vector& X, math_Vector& F) Standard_OVERRIDE;
//! returns the values <D> of the derivatives for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Derivatives(const math_Vector& X,
math_Matrix& D) Standard_OVERRIDE;
//! returns the values <F> of the functions and the derivatives
//! <D> for the variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Values(const math_Vector& X,
math_Vector& F,
math_Matrix& D) Standard_OVERRIDE;
Standard_EXPORT void Set(const Handle(Adaptor3d_Surface)& SurfRef,
const Handle(Adaptor2d_Curve2d)& RstRef);
Standard_EXPORT void Set(const Standard_Real Param) Standard_OVERRIDE;
//! Sets the bounds of the parametric interval on
//! the guide line.
//! This determines the derivatives in these values if the
//! function is not Cn.
Standard_EXPORT void Set(const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
Standard_EXPORT void GetTolerance(math_Vector& Tolerance,
const Standard_Real Tol) const Standard_OVERRIDE;
Standard_EXPORT void GetBounds(math_Vector& InfBound,
math_Vector& SupBound) const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsSolution(const math_Vector& Sol,
const Standard_Real Tol) Standard_OVERRIDE;
//! Returns the minimal Distance between two
//! extremities of calculated sections.
Standard_EXPORT virtual Standard_Real GetMinimalDistance() const Standard_OVERRIDE;
Standard_EXPORT const gp_Pnt& PointOnS() const Standard_OVERRIDE;
Standard_EXPORT const gp_Pnt& PointOnRst() const Standard_OVERRIDE;
//! Returns U,V coordinates of the point on the surface.
Standard_EXPORT const gp_Pnt2d& Pnt2dOnS() const Standard_OVERRIDE;
//! Returns U,V coordinates of the point on the curve on
//! surface.
Standard_EXPORT const gp_Pnt2d& Pnt2dOnRst() const Standard_OVERRIDE;
//! Returns parameter of the point on the curve.
Standard_EXPORT Standard_Real ParameterOnRst() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec& TangentOnS() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec2d& Tangent2dOnS() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec& TangentOnRst() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec2d& Tangent2dOnRst() const Standard_OVERRIDE;
//! Enables implementation of a criterion of decrochage
//! specific to the function.
//! Warning: Can be called without previous call of issolution
//! but the values calculated can be senseless.
Standard_EXPORT Standard_Boolean Decroch(const math_Vector& Sol,
gp_Vec& NS,
gp_Vec& TgS) const Standard_OVERRIDE;
Standard_EXPORT void Set(const Standard_Real Radius, const Standard_Integer Choix);
//! Sets the type of section generation for the
//! approximations.
Standard_EXPORT void Set(const BlendFunc_SectionShape TypeSection);
Standard_EXPORT void Section(const Standard_Real Param,
const Standard_Real U,
const Standard_Real V,
const Standard_Real W,
Standard_Real& Pdeb,
Standard_Real& Pfin,
gp_Circ& C);
//! Returns if the section is rational
Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
//! Returns the length of the maximum section
Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE;
//! Compute the minimal value of weight for each poles
//! of all sections.
Standard_EXPORT void GetMinimalWeight(TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(me) >= <S>
Standard_EXPORT Standard_Integer NbIntervals(const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT void Intervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const Standard_OVERRIDE;
Standard_EXPORT void GetShape(Standard_Integer& NbPoles,
Standard_Integer& NbKnots,
Standard_Integer& Degree,
Standard_Integer& NbPoles2d) Standard_OVERRIDE;
//! Returns the tolerance to reach in approximation
//! to respect
//! BoundTol error at the Boundary
//! AngleTol tangent error at the Boundary
//! SurfTol error inside the surface.
Standard_EXPORT void GetTolerance(const Standard_Real BoundTol,
const Standard_Real SurfTol,
const Standard_Real AngleTol,
math_Vector& Tol3d,
math_Vector& Tol1D) const Standard_OVERRIDE;
Standard_EXPORT void Knots(TColStd_Array1OfReal& TKnots) Standard_OVERRIDE;
Standard_EXPORT void Mults(TColStd_Array1OfInteger& TMults) Standard_OVERRIDE;
//! Used for the first and last section
Standard_EXPORT Standard_Boolean Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
//! Used for the first and last section
//! The method returns Standard_True if the derivatives
//! are computed, otherwise it returns Standard_False.
Standard_EXPORT Standard_Boolean Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfVec& D2Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColgp_Array1OfVec2d& D2Poles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths,
TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;
Standard_EXPORT void Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
Standard_EXPORT void Resolution(const Standard_Integer IC2d,
const Standard_Real Tol,
Standard_Real& TolU,
Standard_Real& TolV) const Standard_OVERRIDE;
protected:
private:
Handle(Adaptor3d_Surface) surf;
Handle(Adaptor3d_Surface) surfrst;
Handle(Adaptor2d_Curve2d) rst;
Adaptor3d_CurveOnSurface cons;
Handle(Adaptor3d_Curve) guide;
Handle(Adaptor3d_Curve) tguide;
gp_Pnt pts;
gp_Pnt ptrst;
gp_Pnt2d pt2ds;
gp_Pnt2d pt2drst;
Standard_Real prmrst;
Standard_Boolean istangent;
gp_Vec tgs;
gp_Vec2d tg2ds;
gp_Vec tgrst;
gp_Vec2d tg2drst;
Standard_Real ray;
Standard_Integer choix;
gp_Pnt ptgui;
gp_Vec d1gui;
gp_Vec d2gui;
gp_Vec nplan;
Standard_Real normtg;
Standard_Real theD;
Handle(Adaptor3d_Surface) surfref;
Handle(Adaptor2d_Curve2d) rstref;
Standard_Real maxang;
Standard_Real minang;
Standard_Real distmin;
BlendFunc_SectionShape mySShape;
Convert_ParameterisationType myTConv;
};
#endif // _BRepBlend_SurfRstConstRad_HeaderFile

View File

@ -0,0 +1,264 @@
// Created on: 1997-07-28
// Created by: Jerome LEMONIER
// Copyright (c) 1997-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 _BRepBlend_SurfRstEvolRad_HeaderFile
#define _BRepBlend_SurfRstEvolRad_HeaderFile
#include "Adaptor3d_CurveOnSurface.hxx"
#include "Adaptor3d_Surface.hxx"
#include "gp_Pnt.hxx"
#include "gp_Pnt2d.hxx"
#include "gp_Vec.hxx"
#include "gp_Vec2d.hxx"
#include "BlendFunc_SectionShape.hxx"
#include "Convert_ParameterisationType.hxx"
#include "Blend_SurfRstFunction.hxx"
#include "math_Vector.hxx"
#include "TColStd_Array1OfReal.hxx"
#include "GeomAbs_Shape.hxx"
#include "TColStd_Array1OfInteger.hxx"
#include "TColgp_Array1OfPnt.hxx"
#include "TColgp_Array1OfVec.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "TColgp_Array1OfVec2d.hxx"
class Law_Function;
class math_Matrix;
class gp_Circ;
class Blend_Point;
//! Function to approximate by AppSurface for
//! Edge/Face and evolutif radius
class BRepBlend_SurfRstEvolRad : public Blend_SurfRstFunction
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepBlend_SurfRstEvolRad(const Handle(Adaptor3d_Surface)& Surf,
const Handle(Adaptor3d_Surface)& SurfRst,
const Handle(Adaptor2d_Curve2d)& Rst,
const Handle(Adaptor3d_Curve)& CGuide,
const Handle(Law_Function)& Evol);
//! Returns 3.
Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE;
//! Returns 3.
Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
//! computes the values <F> of the Functions for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Value(const math_Vector& X, math_Vector& F) Standard_OVERRIDE;
//! returns the values <D> of the derivatives for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Derivatives(const math_Vector& X,
math_Matrix& D) Standard_OVERRIDE;
//! returns the values <F> of the functions and the derivatives
//! <D> for the variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT Standard_Boolean Values(const math_Vector& X,
math_Vector& F,
math_Matrix& D) Standard_OVERRIDE;
Standard_EXPORT void Set(const Handle(Adaptor3d_Surface)& SurfRef,
const Handle(Adaptor2d_Curve2d)& RstRef);
Standard_EXPORT void Set(const Standard_Real Param) Standard_OVERRIDE;
//! Sets the bounds of the parametric interval on
//! the guide line.
//! This determines the derivatives in these values if the
//! function is not Cn.
Standard_EXPORT void Set(const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
Standard_EXPORT void GetTolerance(math_Vector& Tolerance,
const Standard_Real Tol) const Standard_OVERRIDE;
Standard_EXPORT void GetBounds(math_Vector& InfBound,
math_Vector& SupBound) const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsSolution(const math_Vector& Sol,
const Standard_Real Tol) Standard_OVERRIDE;
//! Returns the minimal Distance between two
//! extremities of calculated sections.
Standard_EXPORT virtual Standard_Real GetMinimalDistance() const Standard_OVERRIDE;
Standard_EXPORT const gp_Pnt& PointOnS() const Standard_OVERRIDE;
Standard_EXPORT const gp_Pnt& PointOnRst() const Standard_OVERRIDE;
//! Returns U,V coordinates of the point on the surface.
Standard_EXPORT const gp_Pnt2d& Pnt2dOnS() const Standard_OVERRIDE;
//! Returns U,V coordinates of the point on the curve on
//! surface.
Standard_EXPORT const gp_Pnt2d& Pnt2dOnRst() const Standard_OVERRIDE;
//! Returns parameter of the point on the curve.
Standard_EXPORT Standard_Real ParameterOnRst() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec& TangentOnS() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec2d& Tangent2dOnS() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec& TangentOnRst() const Standard_OVERRIDE;
Standard_EXPORT const gp_Vec2d& Tangent2dOnRst() const Standard_OVERRIDE;
//! Permet d ' implementer un critere de decrochage
//! specifique a la fonction.
Standard_EXPORT Standard_Boolean Decroch(const math_Vector& Sol,
gp_Vec& NS,
gp_Vec& TgS) const Standard_OVERRIDE;
Standard_EXPORT void Set(const Standard_Integer Choix);
//! Sets the type of section generation for the
//! approximations.
Standard_EXPORT void Set(const BlendFunc_SectionShape TypeSection);
Standard_EXPORT void Section(const Standard_Real Param,
const Standard_Real U,
const Standard_Real V,
const Standard_Real W,
Standard_Real& Pdeb,
Standard_Real& Pfin,
gp_Circ& C);
//! Returns if the section is rational
Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
//! Returns the length of the maximum section
Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE;
//! Compute the minimal value of weight for each poles
//! of all sections.
Standard_EXPORT void GetMinimalWeight(TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(me) >= <S>
Standard_EXPORT Standard_Integer NbIntervals(const GeomAbs_Shape S) const Standard_OVERRIDE;
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT void Intervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const Standard_OVERRIDE;
Standard_EXPORT void GetShape(Standard_Integer& NbPoles,
Standard_Integer& NbKnots,
Standard_Integer& Degree,
Standard_Integer& NbPoles2d) Standard_OVERRIDE;
//! Returns the tolerance to reach in approximation
//! to respect
//! BoundTol error at the Boundary
//! AngleTol tangent error at the Boundary
//! SurfTol error inside the surface.
Standard_EXPORT void GetTolerance(const Standard_Real BoundTol,
const Standard_Real SurfTol,
const Standard_Real AngleTol,
math_Vector& Tol3d,
math_Vector& Tol1D) const Standard_OVERRIDE;
Standard_EXPORT void Knots(TColStd_Array1OfReal& TKnots) Standard_OVERRIDE;
Standard_EXPORT void Mults(TColStd_Array1OfInteger& TMults) Standard_OVERRIDE;
//! Used for the first and last section
Standard_EXPORT Standard_Boolean Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
//! Used for the first and last section
//! The method returns Standard_True if the derivatives
//! are computed, otherwise it returns Standard_False.
Standard_EXPORT Standard_Boolean Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfVec& D2Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColgp_Array1OfVec2d& D2Poles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths,
TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;
Standard_EXPORT void Section(const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
Standard_EXPORT void Resolution(const Standard_Integer IC2d,
const Standard_Real Tol,
Standard_Real& TolU,
Standard_Real& TolV) const Standard_OVERRIDE;
protected:
private:
Handle(Adaptor3d_Surface) surf;
Handle(Adaptor3d_Surface) surfrst;
Handle(Adaptor2d_Curve2d) rst;
Adaptor3d_CurveOnSurface cons;
Handle(Adaptor3d_Curve) guide;
Handle(Adaptor3d_Curve) tguide;
gp_Pnt pts;
gp_Pnt ptrst;
gp_Pnt2d pt2ds;
gp_Pnt2d pt2drst;
Standard_Real prmrst;
Standard_Boolean istangent;
gp_Vec tgs;
gp_Vec2d tg2ds;
gp_Vec tgrst;
gp_Vec2d tg2drst;
Standard_Real ray;
Standard_Real dray;
Standard_Integer choix;
gp_Pnt ptgui;
gp_Vec d1gui;
gp_Vec d2gui;
gp_Vec nplan;
Standard_Real normtg;
Standard_Real theD;
Handle(Adaptor3d_Surface) surfref;
Handle(Adaptor2d_Curve2d) rstref;
Standard_Real maxang;
Standard_Real minang;
Standard_Real distmin;
BlendFunc_SectionShape mySShape;
Convert_ParameterisationType myTConv;
Handle(Law_Function) tevol;
Handle(Law_Function) fevol;
Standard_Real sg1;
};
#endif // _BRepBlend_SurfRstEvolRad_HeaderFile

View File

@ -0,0 +1,23 @@
// Created on: 2011-11-24
// Created by: ANNA MASALSKAYA
// Copyright (c) 2011-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 _BRepBuilderAPI_CellFilter_HeaderFile
#define _BRepBuilderAPI_CellFilter_HeaderFile
#include "BRepBuilderAPI_VertexInspector.hxx"
typedef NCollection_CellFilter<BRepBuilderAPI_VertexInspector> BRepBuilderAPI_CellFilter;
#endif

View File

@ -0,0 +1,56 @@
// Created on: 1996-04-09
// Created by: Yves FRICAUD
// Copyright (c) 1996-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 _BRepBuilderAPI_Collect_HeaderFile
#define _BRepBuilderAPI_Collect_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "TopoDS_Shape.hxx"
#include "TopTools_MapOfShape.hxx"
#include "TopTools_DataMapOfShapeListOfShape.hxx"
class BRepBuilderAPI_MakeShape;
class BRepBuilderAPI_Collect
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepBuilderAPI_Collect();
Standard_EXPORT void Add(const TopoDS_Shape& SI, BRepBuilderAPI_MakeShape& MKS);
Standard_EXPORT void AddGenerated(const TopoDS_Shape& S, const TopoDS_Shape& Gen);
Standard_EXPORT void AddModif(const TopoDS_Shape& S, const TopoDS_Shape& Mod);
Standard_EXPORT void Filter(const TopoDS_Shape& SF);
Standard_EXPORT const TopTools_DataMapOfShapeListOfShape& Modification() const;
Standard_EXPORT const TopTools_DataMapOfShapeListOfShape& Generated() const;
protected:
private:
TopoDS_Shape myInitialShape;
TopTools_MapOfShape myDeleted;
TopTools_DataMapOfShapeListOfShape myMod;
TopTools_DataMapOfShapeListOfShape myGen;
};
#endif // _BRepBuilderAPI_Collect_HeaderFile

View File

@ -0,0 +1,61 @@
// Created on: 1993-07-21
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_Command_HeaderFile
#define _BRepBuilderAPI_Command_HeaderFile
#include "Standard.hxx"
#include "Standard_DefineAlloc.hxx"
#include "Standard_Handle.hxx"
#include "Standard_Boolean.hxx"
//! Root class for all commands in BRepBuilderAPI.
//!
//! Provides :
//!
//! * Managements of the notDone flag.
//!
//! * Catching of exceptions (not implemented).
//!
//! * Logging (not implemented).
class BRepBuilderAPI_Command
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT virtual ~BRepBuilderAPI_Command();
Standard_EXPORT virtual Standard_Boolean IsDone() const;
//! Raises NotDone if done is false.
Standard_EXPORT void Check() const;
protected:
//! Set done to False.
Standard_EXPORT BRepBuilderAPI_Command();
//! Set done to true.
Standard_EXPORT void Done();
//! Set done to false.
Standard_EXPORT void NotDone();
private:
Standard_Boolean myDone;
};
#endif // _BRepBuilderAPI_Command_HeaderFile

Some files were not shown because too many files have changed in this diff Show More