修复更新OCCT为8.0后的类型错误问题
This commit is contained in:
parent
4d9d05d294
commit
eb256303d1
BIN
entry/libs/x86_64/libTKBO.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKBO.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKBRep.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKBRep.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKBin.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKBin.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKBinL.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKBinL.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKBinTObj.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKBinTObj.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKBinXCAF.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKBinXCAF.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKBool.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKBool.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKCAF.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKCAF.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKCDF.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKCDF.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKDE.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKDE.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKDECascade.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKDECascade.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKDEIGES.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKDEIGES.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKDEOBJ.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKDEOBJ.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKDEPLY.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKDEPLY.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKDESTEP.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKDESTEP.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKDESTL.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKDESTL.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKDEVRML.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKDEVRML.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKExpress.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKExpress.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKFeat.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKFeat.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKFillet.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKFillet.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKG2d.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKG2d.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKG3d.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKG3d.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKGeomAlgo.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKGeomAlgo.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKGeomBase.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKGeomBase.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKHLR.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKHLR.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKHelix.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKHelix.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKLCAF.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKLCAF.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKMath.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKMath.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKMesh.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKMesh.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKMeshVS.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKMeshVS.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKOffset.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKOffset.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKOpenGles.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKOpenGles.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKPrim.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKPrim.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKRWMesh.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKRWMesh.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKService.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKService.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKShHealing.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKShHealing.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKStd.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKStd.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKStdL.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKStdL.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKTObj.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKTObj.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKTopAlgo.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKTopAlgo.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKV3d.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKV3d.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKVCAF.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKVCAF.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKXCAF.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKXCAF.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKXMesh.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKXMesh.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKXSBase.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKXSBase.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKXml.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKXml.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKXmlL.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKXmlL.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKXmlTObj.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKXmlTObj.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKXmlXCAF.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKXmlXCAF.so.8.0
Normal file
Binary file not shown.
BIN
entry/libs/x86_64/libTKernel.so.8.0
Normal file
BIN
entry/libs/x86_64/libTKernel.so.8.0
Normal file
Binary file not shown.
@ -4,6 +4,7 @@ project(opencax)
|
||||
|
||||
set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_definitions(-DOHOS_PLATFORM)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
# 添加 NAPI 头文件
|
||||
include_directories(${NATIVERENDER_ROOT_PATH}
|
||||
|
||||
@ -71,13 +71,13 @@ bool Axis::InitAxisCube(Handle(AIS_InteractiveContext) & context) {
|
||||
axiViewCube->SetDrawAxes(false);
|
||||
axiViewCube->SetSize(60, true);
|
||||
axiViewCube->SetTransparency(0.3);
|
||||
axiViewCube->SetFixedAnimationLoop(Standard_True);
|
||||
axiViewCube->SetFixedAnimationLoop(true);
|
||||
axiViewCube->SetTextColor(Quantity_Color(Quantity_NOC_BLUE1));
|
||||
axiViewCube->SetFontHeight(100);
|
||||
axiViewCube->SetMaterial(Graphic3d_MaterialAspect(Graphic3d_NOM_ALUMINIUM));
|
||||
axiViewCube->SetTransformPersistence(
|
||||
new Graphic3d_TransformPers(Graphic3d_TMF_TriedronPers, Aspect_TOTP_RIGHT_UPPER, Graphic3d_Vec2i(100, 100)));
|
||||
context->Display(axiViewCube, Standard_True);
|
||||
new Graphic3d_TransformPers(Graphic3d_TMF_TriedronPers, Aspect_TOTP_RIGHT_UPPER, NCollection_Vec2<int>(100, 100)));
|
||||
context->Display(axiViewCube, true);
|
||||
HILOG_INFO(NATIVE_TAG, "Init Axi View Cube Done");
|
||||
return true;
|
||||
} catch (std::exception &e) {
|
||||
|
||||
@ -17,7 +17,7 @@ Context::~Context() {}
|
||||
bool Context::InitContext(Handle(V3d_Viewer)& viewer) {
|
||||
try {
|
||||
context = new AIS_InteractiveContext(viewer);
|
||||
context->SetDisplayMode(AIS_Shaded, Standard_False); // 默认使用着色模式
|
||||
context->SetDisplayMode(AIS_Shaded, true); // 默认使用着色模式
|
||||
HILOG_INFO(NATIVE_TAG, "InitCtx Done");
|
||||
return true;
|
||||
} catch (std::exception &e) {
|
||||
|
||||
@ -69,7 +69,7 @@ bool NativeRender::init(EGLCore &_eglCore) {
|
||||
bool NativeRender::loadModel(const std::string &filePath) {
|
||||
// 清除现有模型
|
||||
for (auto &shape : shapes_) {
|
||||
ctx->context->Remove(shape, Standard_False);
|
||||
ctx->context->Remove(shape, false);
|
||||
}
|
||||
shapes_.clear();
|
||||
|
||||
@ -90,7 +90,7 @@ bool NativeRender::loadModel(const std::string &filePath) {
|
||||
}
|
||||
|
||||
// 加载所有形状
|
||||
for (Standard_Integer i = 1; i <= numShapes; i++) {
|
||||
for (int i = 1; i <= numShapes; i++) {
|
||||
TopoDS_Shape shape = reader.Shape(i);
|
||||
Bnd_Box bbox;
|
||||
BRepBndLib::Add(shape, bbox);
|
||||
@ -144,16 +144,16 @@ bool NativeRender::loadModel(const std::string &filePath) {
|
||||
}
|
||||
shadingAspect->SetColor(color);
|
||||
shadingAspect->SetMaterial(Graphic3d_NOM_PLASTIC);
|
||||
drawer->SetFaceBoundaryDraw(Standard_True);
|
||||
drawer->SetFaceBoundaryDraw(true);
|
||||
drawer->SetWireAspect(aLineAspect);
|
||||
drawer->SetShadingAspect(shadingAspect);
|
||||
ctx->context->Display(aisShape, Standard_True);
|
||||
ctx->context->Display(aisShape, true);
|
||||
// ctx->context->SetDisplayMode(AIS_WireFrame, Standard_False);
|
||||
shapes_.push_back(aisShape);
|
||||
}
|
||||
}
|
||||
// 调整相机到合适位置
|
||||
vw->view->FitAll(0.5, Standard_True);
|
||||
vw->view->FitAll(0.5, true);
|
||||
vw->view->ZFitAll();
|
||||
vw->ResetView();
|
||||
OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "LoadModel",
|
||||
|
||||
@ -18,8 +18,8 @@ bool OpenGlGraphicDriver::InitOpenGlGraphicDriver(EGLCore& eglCore) {
|
||||
|
||||
try {
|
||||
displayConnection = new Aspect_DisplayConnection();
|
||||
graphicDriver = new OpenGl_GraphicDriver(displayConnection, Standard_False);
|
||||
graphicDriver->ChangeOptions().buffersNoSwap = Standard_True;
|
||||
graphicDriver = new OpenGl_GraphicDriver(displayConnection, false);
|
||||
graphicDriver->ChangeOptions().buffersNoSwap = true;
|
||||
graphicDriver->InitEglContext(eglGetCurrentDisplay(), eglGetCurrentContext(), eglCore.getConfig());
|
||||
HILOG_INFO(NATIVE_TAG, "InitGraphicDriver Done");
|
||||
return true;
|
||||
|
||||
@ -36,10 +36,10 @@ void View::SetViewOption() {
|
||||
// 设置背景渐变
|
||||
view->SetBgGradientColors(Quantity_Color(Quantity_NOC_GRAY), Quantity_Color(Quantity_NOC_BLACK),
|
||||
Aspect_GFM_VER, // 垂直渐变
|
||||
Standard_False);
|
||||
false);
|
||||
// 设置默认相机位置
|
||||
view->SetProj(V3d_XposYnegZpos);
|
||||
view->FitAll(0.05, Standard_False);
|
||||
view->FitAll(0.05, false);
|
||||
// 可选:显示坐标轴
|
||||
view->ZBufferTriedronSetup();
|
||||
// 调整相机视角
|
||||
@ -71,7 +71,7 @@ void View::Redraw() {
|
||||
void View::ResetView() {
|
||||
if (!view.IsNull()) {
|
||||
view->SetProj(V3d_XposYnegZpos);
|
||||
view->FitAll(0.05, Standard_False);
|
||||
view->FitAll(0.05, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ Window::Window():window(nullptr){
|
||||
Window::~Window(){
|
||||
|
||||
}
|
||||
bool Window::InitWindow(Standard_Integer& width, Standard_Integer& height){
|
||||
bool Window::InitWindow(int& width, int& height){
|
||||
if(window.IsNull()){
|
||||
window = new Aspect_NeutralWindow();
|
||||
window->SetSize(width, height);
|
||||
|
||||
@ -17,7 +17,7 @@ class Window {
|
||||
public:
|
||||
Window();
|
||||
~Window();
|
||||
bool InitWindow(Standard_Integer& width,Standard_Integer& height);
|
||||
bool InitWindow(int& width,int& height);
|
||||
void Resize(int w, int h);
|
||||
public:
|
||||
Handle(Aspect_NeutralWindow) window;
|
||||
|
||||
@ -0,0 +1,144 @@
|
||||
// Created on: 1997-04-22
|
||||
// Created by: Guest Design
|
||||
// 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_MultipleConnectedInteractive_HeaderFile
|
||||
#define _AIS_MultipleConnectedInteractive_HeaderFile
|
||||
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
|
||||
//! Defines an Interactive Object by gathering together
|
||||
//! several object presentations. This is done through a
|
||||
//! list of interactive objects. These can also be
|
||||
//! Connected objects. That way memory-costly
|
||||
//! calculations of presentation are avoided.
|
||||
class AIS_MultipleConnectedInteractive : public AIS_InteractiveObject
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_MultipleConnectedInteractive, AIS_InteractiveObject)
|
||||
public:
|
||||
//! Initializes the Interactive Object with multiple
|
||||
//! connections to AIS_Interactive objects.
|
||||
Standard_EXPORT AIS_MultipleConnectedInteractive();
|
||||
|
||||
//! Establishes the connection between the Connected Interactive Object, theInteractive, and its
|
||||
//! reference. Locates instance in theLocation and applies specified transformation persistence
|
||||
//! mode.
|
||||
//! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
|
||||
occ::handle<AIS_InteractiveObject> Connect(
|
||||
const occ::handle<AIS_InteractiveObject>& theAnotherObj,
|
||||
const occ::handle<TopLoc_Datum3D>& theLocation,
|
||||
const occ::handle<Graphic3d_TransformPers>& theTrsfPers)
|
||||
{
|
||||
return connect(theAnotherObj, theLocation, theTrsfPers);
|
||||
}
|
||||
|
||||
AIS_KindOfInteractive Type() const override { return AIS_KindOfInteractive_Object; }
|
||||
|
||||
int Signature() const override { return 1; }
|
||||
|
||||
//! Returns true if the object is connected to others.
|
||||
Standard_EXPORT bool HasConnection() const;
|
||||
|
||||
//! Removes the connection with theInteractive.
|
||||
Standard_EXPORT void Disconnect(const occ::handle<AIS_InteractiveObject>& theInteractive);
|
||||
|
||||
//! Clears all the connections to objects.
|
||||
Standard_EXPORT void DisconnectAll();
|
||||
|
||||
//! Informs the graphic context that the interactive Object
|
||||
//! may be decomposed into sub-shapes for dynamic selection.
|
||||
Standard_EXPORT bool AcceptShapeDecomposition() const override;
|
||||
|
||||
//! Returns common entity owner if the object is an assembly
|
||||
const occ::handle<SelectMgr_EntityOwner>& GetAssemblyOwner() const override
|
||||
{
|
||||
return myAssemblyOwner;
|
||||
}
|
||||
|
||||
//! Returns the owner of mode for selection of object as a whole
|
||||
occ::handle<SelectMgr_EntityOwner> GlobalSelOwner() const override { return myAssemblyOwner; }
|
||||
|
||||
//! Assigns interactive context.
|
||||
Standard_EXPORT void SetContext(const occ::handle<AIS_InteractiveContext>& theCtx) override;
|
||||
|
||||
public: // short aliases to Connect() method
|
||||
//! Establishes the connection between the Connected Interactive Object, theInteractive, and its
|
||||
//! reference. Copies local transformation and transformation persistence mode from
|
||||
//! theInteractive.
|
||||
//! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
|
||||
occ::handle<AIS_InteractiveObject> Connect(
|
||||
const occ::handle<AIS_InteractiveObject>& theAnotherObj)
|
||||
{
|
||||
return connect(theAnotherObj,
|
||||
theAnotherObj->LocalTransformationGeom(),
|
||||
theAnotherObj->TransformPersistence());
|
||||
}
|
||||
|
||||
//! Establishes the connection between the Connected Interactive Object, theInteractive, and its
|
||||
//! reference. Locates instance in theLocation and copies transformation persistence mode from
|
||||
//! theInteractive.
|
||||
//! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
|
||||
occ::handle<AIS_InteractiveObject> Connect(
|
||||
const occ::handle<AIS_InteractiveObject>& theAnotherObj,
|
||||
const gp_Trsf& theLocation)
|
||||
{
|
||||
return connect(theAnotherObj,
|
||||
new TopLoc_Datum3D(theLocation),
|
||||
theAnotherObj->TransformPersistence());
|
||||
}
|
||||
|
||||
//! Establishes the connection between the Connected Interactive Object, theInteractive, and its
|
||||
//! reference. Locates instance in theLocation and applies specified transformation persistence
|
||||
//! mode.
|
||||
//! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
|
||||
occ::handle<AIS_InteractiveObject> Connect(
|
||||
const occ::handle<AIS_InteractiveObject>& theAnotherObj,
|
||||
const gp_Trsf& theLocation,
|
||||
const occ::handle<Graphic3d_TransformPers>& theTrsfPers)
|
||||
{
|
||||
return connect(theAnotherObj, new TopLoc_Datum3D(theLocation), theTrsfPers);
|
||||
}
|
||||
|
||||
protected:
|
||||
//! 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 void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode) override;
|
||||
|
||||
//! Establishes the connection between the Connected Interactive Object, theInteractive, and its
|
||||
//! reference. Locates instance in theLocation and applies specified transformation persistence
|
||||
//! mode.
|
||||
//! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
|
||||
Standard_EXPORT virtual occ::handle<AIS_InteractiveObject> connect(
|
||||
const occ::handle<AIS_InteractiveObject>& theInteractive,
|
||||
const occ::handle<TopLoc_Datum3D>& theLocation,
|
||||
const occ::handle<Graphic3d_TransformPers>& theTrsfPers);
|
||||
|
||||
private:
|
||||
//! Computes the selection for whole subtree in scene hierarchy.
|
||||
Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& aSelection,
|
||||
const int aMode) override;
|
||||
|
||||
protected:
|
||||
occ::handle<SelectMgr_EntityOwner> myAssemblyOwner;
|
||||
};
|
||||
|
||||
#endif // _AIS_MultipleConnectedInteractive_HeaderFile
|
||||
@ -0,0 +1,30 @@
|
||||
// Copyright (c) 2017 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_SelectionModesConcurrency_HeaderFile
|
||||
#define _AIS_SelectionModesConcurrency_HeaderFile
|
||||
|
||||
//! The mode specifying how multiple active Selection Modes should be treated during activation of
|
||||
//! new one.
|
||||
enum AIS_SelectionModesConcurrency
|
||||
{
|
||||
AIS_SelectionModesConcurrency_Single, //!< only one selection mode can be activated at the same
|
||||
//!< moment - previously activated should be deactivated
|
||||
AIS_SelectionModesConcurrency_GlobalOrLocal, //!< either Global
|
||||
//!< (AIS_InteractiveObject::GlobalSelectionMode() or
|
||||
//!< Local (multiple) selection modes can be active
|
||||
//!< at the same moment
|
||||
AIS_SelectionModesConcurrency_Multiple, //!< any combination of selection modes can be activated
|
||||
};
|
||||
|
||||
#endif // _AIS_SelectionModesConcurrency_HeaderFile
|
||||
@ -0,0 +1,55 @@
|
||||
// Created on: 1998-07-08
|
||||
// Created by: Christian CAILLET
|
||||
// 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 _APIHeaderSection_EditHeader_HeaderFile
|
||||
#define _APIHeaderSection_EditHeader_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
|
||||
#include <IFSelect_Editor.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class TCollection_AsciiString;
|
||||
class IFSelect_EditForm;
|
||||
class TCollection_HAsciiString;
|
||||
class Standard_Transient;
|
||||
class Interface_InterfaceModel;
|
||||
|
||||
class APIHeaderSection_EditHeader : public IFSelect_Editor
|
||||
{
|
||||
|
||||
public:
|
||||
Standard_EXPORT APIHeaderSection_EditHeader();
|
||||
|
||||
Standard_EXPORT TCollection_AsciiString Label() const override;
|
||||
|
||||
Standard_EXPORT bool Recognize(const occ::handle<IFSelect_EditForm>& form) const override;
|
||||
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> StringValue(
|
||||
const occ::handle<IFSelect_EditForm>& form,
|
||||
const int num) const override;
|
||||
|
||||
Standard_EXPORT bool Apply(const occ::handle<IFSelect_EditForm>& form,
|
||||
const occ::handle<Standard_Transient>& ent,
|
||||
const occ::handle<Interface_InterfaceModel>& model) const override;
|
||||
|
||||
Standard_EXPORT bool Load(const occ::handle<IFSelect_EditForm>& form,
|
||||
const occ::handle<Standard_Transient>& ent,
|
||||
const occ::handle<Interface_InterfaceModel>& model) const override;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(APIHeaderSection_EditHeader, IFSelect_Editor)
|
||||
};
|
||||
|
||||
#endif // _APIHeaderSection_EditHeader_HeaderFile
|
||||
@ -0,0 +1,204 @@
|
||||
// Created on: 1993-08-12
|
||||
// Created by: Frederic MAUPAS
|
||||
// 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 _APIHeaderSection_MakeHeader_HeaderFile
|
||||
#define _APIHeaderSection_MakeHeader_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
class HeaderSection_FileName;
|
||||
class HeaderSection_FileSchema;
|
||||
class HeaderSection_FileDescription;
|
||||
class StepData_StepModel;
|
||||
class Interface_Protocol;
|
||||
class TCollection_HAsciiString;
|
||||
|
||||
//! This class allows to consult and prepare/edit data stored in
|
||||
//! a Step Model Header
|
||||
class APIHeaderSection_MakeHeader
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Prepares a new MakeHeader from scratch
|
||||
Standard_EXPORT APIHeaderSection_MakeHeader(const int shapetype = 0);
|
||||
|
||||
//! Prepares a MakeHeader from the content of a StepModel
|
||||
//! See IsDone to know if the Header is well defined
|
||||
Standard_EXPORT APIHeaderSection_MakeHeader(const occ::handle<StepData_StepModel>& model);
|
||||
|
||||
//! Cancels the former definition and gives a FileName
|
||||
//! To be used when a Model has no well defined Header
|
||||
Standard_EXPORT void Init(const char* const nameval);
|
||||
|
||||
//! Returns True if all data have been defined (see also
|
||||
//! HasFn, HasFs, HasFd)
|
||||
Standard_EXPORT bool IsDone() const;
|
||||
|
||||
//! Creates an empty header for a new
|
||||
//! STEP model and allows the header fields to be completed.
|
||||
Standard_EXPORT void Apply(const occ::handle<StepData_StepModel>& model) const;
|
||||
|
||||
//! Builds a Header, creates a new StepModel, then applies the
|
||||
//! Header to the StepModel
|
||||
//! The Schema Name is taken from the Protocol (if it inherits
|
||||
//! from StepData, else it is left in blanks)
|
||||
Standard_EXPORT occ::handle<StepData_StepModel> NewModel(
|
||||
const occ::handle<Interface_Protocol>& protocol) const;
|
||||
|
||||
//! Checks whether there is a
|
||||
//! file_name entity. Returns True if there is one.
|
||||
Standard_EXPORT bool HasFn() const;
|
||||
|
||||
//! Returns the file_name entity.
|
||||
//! Returns an empty entity if the file_name entity is not initialized.
|
||||
Standard_EXPORT occ::handle<HeaderSection_FileName> FnValue() const;
|
||||
|
||||
Standard_EXPORT void SetName(const occ::handle<TCollection_HAsciiString>& aName);
|
||||
|
||||
//! Returns the name attribute for the file_name entity.
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> Name() const;
|
||||
|
||||
Standard_EXPORT void SetTimeStamp(const occ::handle<TCollection_HAsciiString>& aTimeStamp);
|
||||
|
||||
//! Returns the value of the time_stamp attribute for the file_name entity.
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> TimeStamp() const;
|
||||
|
||||
Standard_EXPORT void SetAuthor(
|
||||
const occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>& aAuthor);
|
||||
|
||||
Standard_EXPORT void SetAuthorValue(const int num,
|
||||
const occ::handle<TCollection_HAsciiString>& aAuthor);
|
||||
|
||||
Standard_EXPORT occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>> Author()
|
||||
const;
|
||||
|
||||
//! Returns the value of the name attribute for the file_name entity.
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> AuthorValue(const int num) const;
|
||||
|
||||
//! Returns the number of values for the author attribute in the file_name entity.
|
||||
Standard_EXPORT int NbAuthor() const;
|
||||
|
||||
Standard_EXPORT void SetOrganization(
|
||||
const occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>& aOrganization);
|
||||
|
||||
Standard_EXPORT void SetOrganizationValue(
|
||||
const int num,
|
||||
const occ::handle<TCollection_HAsciiString>& aOrganization);
|
||||
|
||||
Standard_EXPORT occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>
|
||||
Organization() const;
|
||||
|
||||
//! Returns the value of attribute
|
||||
//! organization for the file_name entity.
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> OrganizationValue(const int num) const;
|
||||
|
||||
//! Returns the number of values for
|
||||
//! the organization attribute in the file_name entity.
|
||||
Standard_EXPORT int NbOrganization() const;
|
||||
|
||||
Standard_EXPORT void SetPreprocessorVersion(
|
||||
const occ::handle<TCollection_HAsciiString>& aPreprocessorVersion);
|
||||
|
||||
//! Returns the name of the preprocessor_version for the file_name entity.
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> PreprocessorVersion() const;
|
||||
|
||||
Standard_EXPORT void SetOriginatingSystem(
|
||||
const occ::handle<TCollection_HAsciiString>& aOriginatingSystem);
|
||||
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> OriginatingSystem() const;
|
||||
|
||||
Standard_EXPORT void SetAuthorisation(
|
||||
const occ::handle<TCollection_HAsciiString>& aAuthorisation);
|
||||
|
||||
//! Returns the value of the authorization attribute for the file_name entity.
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> Authorisation() const;
|
||||
|
||||
//! Checks whether there is a file_schema entity. Returns True if there is one.
|
||||
Standard_EXPORT bool HasFs() const;
|
||||
|
||||
//! Returns the file_schema entity. Returns an empty entity if the file_schema entity is not
|
||||
//! initialized.
|
||||
Standard_EXPORT occ::handle<HeaderSection_FileSchema> FsValue() const;
|
||||
|
||||
Standard_EXPORT void SetSchemaIdentifiers(
|
||||
const occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>&
|
||||
aSchemaIdentifiers);
|
||||
|
||||
Standard_EXPORT void SetSchemaIdentifiersValue(
|
||||
const int num,
|
||||
const occ::handle<TCollection_HAsciiString>& aSchemaIdentifier);
|
||||
|
||||
Standard_EXPORT occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>
|
||||
SchemaIdentifiers() const;
|
||||
|
||||
//! Returns the value of the schema_identifier attribute for the file_schema entity.
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> SchemaIdentifiersValue(const int num) const;
|
||||
|
||||
//! Returns the number of values for the schema_identifier attribute in the file_schema entity.
|
||||
Standard_EXPORT int NbSchemaIdentifiers() const;
|
||||
|
||||
//! Add a subname of schema (if not yet in the list)
|
||||
Standard_EXPORT void AddSchemaIdentifier(
|
||||
const occ::handle<TCollection_HAsciiString>& aSchemaIdentifier);
|
||||
|
||||
//! Checks whether there is a file_description entity. Returns True if there is one.
|
||||
Standard_EXPORT bool HasFd() const;
|
||||
|
||||
//! Returns the file_description
|
||||
//! entity. Returns an empty entity if the file_description entity is not initialized.
|
||||
Standard_EXPORT occ::handle<HeaderSection_FileDescription> FdValue() const;
|
||||
|
||||
Standard_EXPORT void SetDescription(
|
||||
const occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>& aDescription);
|
||||
|
||||
Standard_EXPORT void SetDescriptionValue(
|
||||
const int num,
|
||||
const occ::handle<TCollection_HAsciiString>& aDescription);
|
||||
|
||||
Standard_EXPORT occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>
|
||||
Description() const;
|
||||
|
||||
//! Returns the value of the
|
||||
//! description attribute for the file_description entity.
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> DescriptionValue(const int num) const;
|
||||
|
||||
//! Returns the number of values for
|
||||
//! the file_description entity in the STEP file header.
|
||||
Standard_EXPORT int NbDescription() const;
|
||||
|
||||
Standard_EXPORT void SetImplementationLevel(
|
||||
const occ::handle<TCollection_HAsciiString>& aImplementationLevel);
|
||||
|
||||
//! Returns the value of the
|
||||
//! implementation_level attribute for the file_description entity.
|
||||
Standard_EXPORT occ::handle<TCollection_HAsciiString> ImplementationLevel() const;
|
||||
|
||||
private:
|
||||
bool done;
|
||||
occ::handle<HeaderSection_FileName> fn;
|
||||
occ::handle<HeaderSection_FileSchema> fs;
|
||||
occ::handle<HeaderSection_FileDescription> fd;
|
||||
};
|
||||
|
||||
#endif // _APIHeaderSection_MakeHeader_HeaderFile
|
||||
@ -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_CriterionRepartition_HeaderFile
|
||||
#define _AdvApp2Var_CriterionRepartition_HeaderFile
|
||||
|
||||
//! way of cutting process//! all new cutting points at each step of cutting
|
||||
//! process : (a+i(b-a)/N)i at step N,
|
||||
//! (a+i(b-a)/(N+1))i at step N+1,...
|
||||
//! where (a,b) is the global interval//! add one new cutting point at each step
|
||||
//! of cutting process
|
||||
enum AdvApp2Var_CriterionRepartition
|
||||
{
|
||||
AdvApp2Var_Regular,
|
||||
AdvApp2Var_Incremental
|
||||
};
|
||||
|
||||
#endif // _AdvApp2Var_CriterionRepartition_HeaderFile
|
||||
@ -0,0 +1,93 @@
|
||||
// Created on: 1996-04-18
|
||||
// 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_EvaluatorFunc2Var_HeaderFile
|
||||
#define AdvApp2Var_EvaluatorFunc2Var_HeaderFile
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
#include <Standard_Character.hxx>
|
||||
|
||||
#include <Standard_ExtCharacter.hxx>
|
||||
|
||||
#include <Standard_CString.hxx>
|
||||
|
||||
// History - the C function pointer converted to a virtual class
|
||||
// in order to get rid of usage of static functions and static data
|
||||
class AdvApp2Var_EvaluatorFunc2Var
|
||||
{
|
||||
public:
|
||||
//! Empty constructor
|
||||
AdvApp2Var_EvaluatorFunc2Var() = default;
|
||||
|
||||
//! Destructor should be declared as virtual
|
||||
virtual ~AdvApp2Var_EvaluatorFunc2Var() = default;
|
||||
|
||||
//! Function evaluation method to be defined by descendant
|
||||
virtual void Evaluate(int* theDimension,
|
||||
double* theUStartEnd, //!< First and last parameters in U
|
||||
double* theVStartEnd, //!< First and last parameters in V
|
||||
int* theFavorIso, //!< Choice of constante, 1 for U, 2 for V
|
||||
double* theConstParam, //!< Value of constant parameter
|
||||
int* theNbParams, //!< Number of parameters N
|
||||
double* theParameters, //!< Values of parameters,
|
||||
int* theUOrder, //!< Derivative Request in U
|
||||
int* theVOrder, //!< Derivative Request in V
|
||||
double* theResult, //!< Result[Dimension,N]
|
||||
int* theErrorCode) const = 0;
|
||||
|
||||
//! Shortcut for function-call style usage
|
||||
void operator()(int* theDimension,
|
||||
double* theUStartEnd,
|
||||
double* theVStartEnd,
|
||||
int* theFavorIso,
|
||||
double* theConstParam,
|
||||
int* theNbParams,
|
||||
double* theParameters,
|
||||
int* theUOrder,
|
||||
int* theVOrder,
|
||||
double* theResult,
|
||||
int* theErrorCode) const
|
||||
{
|
||||
Evaluate(theDimension,
|
||||
theUStartEnd,
|
||||
theVStartEnd,
|
||||
theFavorIso,
|
||||
theConstParam,
|
||||
theNbParams,
|
||||
theParameters,
|
||||
theUOrder,
|
||||
theVOrder,
|
||||
theResult,
|
||||
theErrorCode);
|
||||
}
|
||||
|
||||
private:
|
||||
AdvApp2Var_EvaluatorFunc2Var(const AdvApp2Var_EvaluatorFunc2Var&) = delete;
|
||||
AdvApp2Var_EvaluatorFunc2Var& operator=(const AdvApp2Var_EvaluatorFunc2Var&) = delete;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,79 @@
|
||||
// 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_EvaluatorFunction_HeaderFile
|
||||
#define _AdvApprox_EvaluatorFunction_HeaderFile
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
#include <Standard_Character.hxx>
|
||||
|
||||
#include <Standard_ExtCharacter.hxx>
|
||||
|
||||
#include <Standard_CString.hxx>
|
||||
|
||||
// abv 01.04.2009: the C function pointer converted to a virtual class
|
||||
// in order to get rid of usage of static functions and static data
|
||||
|
||||
//! Interface for a class implementing a function to be approximated
|
||||
//! by AdvApprox_ApproxAFunction
|
||||
class AdvApprox_EvaluatorFunction
|
||||
{
|
||||
public:
|
||||
//! Empty constructor
|
||||
AdvApprox_EvaluatorFunction() = default;
|
||||
|
||||
//! Destructor should be declared as virtual
|
||||
virtual ~AdvApprox_EvaluatorFunction() = default;
|
||||
|
||||
//! Function evaluation method to be defined by descendant
|
||||
virtual void Evaluate(int* Dimension,
|
||||
double StartEnd[2],
|
||||
double* Parameter,
|
||||
int* DerivativeRequest,
|
||||
double* Result, // [Dimension]
|
||||
int* ErrorCode) = 0;
|
||||
|
||||
//! Shortcut for function-call style usage
|
||||
void operator()(int* Dimension,
|
||||
double StartEnd[2],
|
||||
double* Parameter,
|
||||
int* DerivativeRequest,
|
||||
double* Result, // [Dimension]
|
||||
int* ErrorCode)
|
||||
{
|
||||
Evaluate(Dimension, StartEnd, Parameter, DerivativeRequest, Result, ErrorCode);
|
||||
}
|
||||
|
||||
private:
|
||||
//! Copy constructor is declared private to forbid copying
|
||||
AdvApprox_EvaluatorFunction(const AdvApprox_EvaluatorFunction&) = default;
|
||||
|
||||
//! Assignment operator is declared private to forbid copying
|
||||
void operator=(const AdvApprox_EvaluatorFunction&) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppDef_Array1OfMultiPointConstraint.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_Array1<AppDef_MultiPointConstraint> directly instead.
|
||||
|
||||
#ifndef _AppDef_Array1OfMultiPointConstraint_hxx
|
||||
#define _AppDef_Array1OfMultiPointConstraint_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppDef_MultiPointConstraint.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppDef_Array1OfMultiPointConstraint.hxx is deprecated since OCCT "
|
||||
"8.0.0. Use NCollection_Array1<AppDef_MultiPointConstraint> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppDef_Array1OfMultiPointConstraint is deprecated, use "
|
||||
"NCollection_Array1<AppDef_MultiPointConstraint> directly")
|
||||
typedef NCollection_Array1<AppDef_MultiPointConstraint> AppDef_Array1OfMultiPointConstraint;
|
||||
|
||||
#endif // _AppDef_Array1OfMultiPointConstraint_hxx
|
||||
@ -0,0 +1,53 @@
|
||||
// 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_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_HeaderFile
|
||||
#define _AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <math_BFGS.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppDef_MyBSplGradientOfBSplineCompute;
|
||||
class AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute;
|
||||
class AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute;
|
||||
class math_MultipleVarFunctionWithGradient;
|
||||
|
||||
class AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute : public math_BFGS
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute(
|
||||
math_MultipleVarFunctionWithGradient& F,
|
||||
const math_Vector& StartingPoint,
|
||||
const double Tolerance3d,
|
||||
const double Tolerance2d,
|
||||
const double Eps,
|
||||
const int NbIterations = 200);
|
||||
|
||||
Standard_EXPORT bool IsSolutionReached(math_MultipleVarFunctionWithGradient& F) const override;
|
||||
|
||||
private:
|
||||
double myTol3d;
|
||||
double myTol2d;
|
||||
};
|
||||
|
||||
#endif // _AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_HeaderFile
|
||||
@ -0,0 +1,156 @@
|
||||
// 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_BSpParFunctionOfMyBSplGradientOfBSplineCompute_HeaderFile
|
||||
#define _AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppDef_MultiLine.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <math_MultipleVarFunctionWithGradient.hxx>
|
||||
#include <math_IntegerVector.hxx>
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute;
|
||||
class AppParCurves_MultiBSpCurve;
|
||||
class math_Matrix;
|
||||
|
||||
class AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute
|
||||
: public math_MultipleVarFunctionWithGradient
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! initializes the fields of the function. The approximating
|
||||
//! curve has <NbPol> control points.
|
||||
Standard_EXPORT AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const math_Vector& Parameters,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int NbPol);
|
||||
|
||||
//! returns the number of variables of the function. It
|
||||
//! corresponds to the number of MultiPoints.
|
||||
Standard_EXPORT int NbVariables() const override;
|
||||
|
||||
//! this method computes the new approximation of the
|
||||
//! MultiLine
|
||||
//! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
|
||||
//! point of the MultiLine.
|
||||
Standard_EXPORT bool Value(const math_Vector& X, double& F) override;
|
||||
|
||||
//! returns the gradient G of the sum above for the
|
||||
//! parameters Xi.
|
||||
Standard_EXPORT bool Gradient(const math_Vector& X, math_Vector& G) override;
|
||||
|
||||
//! returns the value F=sum(||Pui - Bi*Pi||)2.
|
||||
//! returns the value G = grad(F) for the parameters Xi.
|
||||
Standard_EXPORT bool Values(const math_Vector& X, double& F, math_Vector& G) override;
|
||||
|
||||
//! returns the new parameters of the MultiLine.
|
||||
Standard_EXPORT const math_Vector& NewParameters() const;
|
||||
|
||||
//! returns the MultiBSpCurve approximating the set after
|
||||
//! computing the value F or Grad(F).
|
||||
Standard_EXPORT AppParCurves_MultiBSpCurve CurveValue();
|
||||
|
||||
//! returns the distance between the MultiPoint of range
|
||||
//! IPoint and the curve CurveIndex.
|
||||
Standard_EXPORT double Error(const int IPoint, const int CurveIndex);
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiBSpCurve.
|
||||
Standard_EXPORT double MaxError3d() const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiBSpCurve.
|
||||
Standard_EXPORT double MaxError2d() const;
|
||||
|
||||
//! returns the function matrix used to approximate the
|
||||
//! multiline.
|
||||
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
|
||||
|
||||
//! returns the derivative function matrix used to approximate the
|
||||
//! multiline.
|
||||
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() 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& Index() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint FirstConstraint(
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const int FirstPoint) const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint LastConstraint(
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const int LastPoint) const;
|
||||
|
||||
Standard_EXPORT void SetFirstLambda(const double l1);
|
||||
|
||||
Standard_EXPORT void SetLastLambda(const double l2);
|
||||
|
||||
protected:
|
||||
//! this method is used each time Value or Gradient is
|
||||
//! needed.
|
||||
Standard_EXPORT void Perform(const math_Vector& X);
|
||||
|
||||
private:
|
||||
bool Done;
|
||||
AppDef_MultiLine MyMultiLine;
|
||||
AppParCurves_MultiBSpCurve MyMultiBSpCurve;
|
||||
int nbpoles;
|
||||
math_Vector myParameters;
|
||||
double FVal;
|
||||
math_Vector ValGrad_F;
|
||||
math_Matrix MyF;
|
||||
math_Matrix PTLX;
|
||||
math_Matrix PTLY;
|
||||
math_Matrix PTLZ;
|
||||
math_Matrix A;
|
||||
math_Matrix DA;
|
||||
AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute MyLeastSquare;
|
||||
bool Contraintes;
|
||||
int NbP;
|
||||
int NbCu;
|
||||
int Adeb;
|
||||
int Afin;
|
||||
occ::handle<NCollection_HArray1<int>> tabdim;
|
||||
double ERR3d;
|
||||
double ERR2d;
|
||||
int FirstP;
|
||||
int LastP;
|
||||
occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>> myConstraints;
|
||||
double mylambda1;
|
||||
double mylambda2;
|
||||
};
|
||||
|
||||
#endif // _AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute_HeaderFile
|
||||
@ -0,0 +1,277 @@
|
||||
// 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_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute_HeaderFile
|
||||
#define _AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_IntegerVector.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_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute
|
||||
{
|
||||
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_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const math_Vector& Parameters,
|
||||
const int NbPol);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
Standard_EXPORT AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const int 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_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const math_Vector& Parameters,
|
||||
const int NbPol);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
Standard_EXPORT AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const int 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 double l1, const double 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 double l1,
|
||||
const double 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 double l1,
|
||||
const double l2);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT bool 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, double& F, double& MaxE3d, double& 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(double& F, double& MaxE3d, double& MaxE2d);
|
||||
|
||||
//! returns the value (P2 - P1)/ V1 if the first point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT double FirstLambda() const;
|
||||
|
||||
//! returns the value (PN - PN-1)/ VN if the last point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT double 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 int FirstPoint, const int LastPoint);
|
||||
|
||||
//! returns the number of second member columns.
|
||||
//! Is used internally to initialize the fields.
|
||||
Standard_EXPORT int NbBColumns(const AppDef_MultiLine& SSP) const;
|
||||
|
||||
//! returns the first point being fitted.
|
||||
Standard_EXPORT int TheFirstPoint(const AppParCurves_Constraint FirstCons,
|
||||
const int FirstPoint) const;
|
||||
|
||||
//! returns the last point being fitted.
|
||||
Standard_EXPORT int TheLastPoint(const AppParCurves_Constraint LastCons,
|
||||
const int LastPoint) const;
|
||||
|
||||
//! Affects the fields in the case of a constraint point.
|
||||
Standard_EXPORT void Affect(const AppDef_MultiLine& SSP,
|
||||
const int 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;
|
||||
occ::handle<NCollection_HArray1<double>> myknots;
|
||||
occ::handle<NCollection_HArray1<int>> 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;
|
||||
double lambda1;
|
||||
double lambda2;
|
||||
int FirstP;
|
||||
int LastP;
|
||||
int Nlignes;
|
||||
int Ninc;
|
||||
int NA;
|
||||
int myfirstp;
|
||||
int mylastp;
|
||||
int resinit;
|
||||
int resfin;
|
||||
int nbP2d;
|
||||
int nbP;
|
||||
int nbpoles;
|
||||
int deg;
|
||||
bool done;
|
||||
bool iscalculated;
|
||||
bool isready;
|
||||
};
|
||||
|
||||
#endif // _AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute_HeaderFile
|
||||
@ -0,0 +1,53 @@
|
||||
// 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_Gradient_BFGSOfMyGradientOfCompute_HeaderFile
|
||||
#define _AppDef_Gradient_BFGSOfMyGradientOfCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <math_BFGS.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppDef_MyGradientOfCompute;
|
||||
class AppDef_ParLeastSquareOfMyGradientOfCompute;
|
||||
class AppDef_ResConstraintOfMyGradientOfCompute;
|
||||
class AppDef_ParFunctionOfMyGradientOfCompute;
|
||||
class math_MultipleVarFunctionWithGradient;
|
||||
|
||||
class AppDef_Gradient_BFGSOfMyGradientOfCompute : public math_BFGS
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT AppDef_Gradient_BFGSOfMyGradientOfCompute(math_MultipleVarFunctionWithGradient& F,
|
||||
const math_Vector& StartingPoint,
|
||||
const double Tolerance3d,
|
||||
const double Tolerance2d,
|
||||
const double Eps,
|
||||
const int NbIterations = 200);
|
||||
|
||||
Standard_EXPORT bool IsSolutionReached(math_MultipleVarFunctionWithGradient& F) const override;
|
||||
|
||||
private:
|
||||
double myTol3d;
|
||||
double myTol2d;
|
||||
};
|
||||
|
||||
#endif // _AppDef_Gradient_BFGSOfMyGradientOfCompute_HeaderFile
|
||||
@ -0,0 +1,54 @@
|
||||
// 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_Gradient_BFGSOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
#define _AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <math_BFGS.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppDef_MyGradientbisOfBSplineCompute;
|
||||
class AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute;
|
||||
class AppDef_ResConstraintOfMyGradientbisOfBSplineCompute;
|
||||
class AppDef_ParFunctionOfMyGradientbisOfBSplineCompute;
|
||||
class math_MultipleVarFunctionWithGradient;
|
||||
|
||||
class AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute : public math_BFGS
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute(
|
||||
math_MultipleVarFunctionWithGradient& F,
|
||||
const math_Vector& StartingPoint,
|
||||
const double Tolerance3d,
|
||||
const double Tolerance2d,
|
||||
const double Eps,
|
||||
const int NbIterations = 200);
|
||||
|
||||
Standard_EXPORT bool IsSolutionReached(math_MultipleVarFunctionWithGradient& F) const override;
|
||||
|
||||
private:
|
||||
double myTol3d;
|
||||
double myTol2d;
|
||||
};
|
||||
|
||||
#endif // _AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
@ -0,0 +1,53 @@
|
||||
// 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_Gradient_BFGSOfTheGradient_HeaderFile
|
||||
#define _AppDef_Gradient_BFGSOfTheGradient_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <math_BFGS.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppDef_TheGradient;
|
||||
class AppDef_ParLeastSquareOfTheGradient;
|
||||
class AppDef_ResConstraintOfTheGradient;
|
||||
class AppDef_ParFunctionOfTheGradient;
|
||||
class math_MultipleVarFunctionWithGradient;
|
||||
|
||||
class AppDef_Gradient_BFGSOfTheGradient : public math_BFGS
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT AppDef_Gradient_BFGSOfTheGradient(math_MultipleVarFunctionWithGradient& F,
|
||||
const math_Vector& StartingPoint,
|
||||
const double Tolerance3d,
|
||||
const double Tolerance2d,
|
||||
const double Eps,
|
||||
const int NbIterations = 200);
|
||||
|
||||
Standard_EXPORT bool IsSolutionReached(math_MultipleVarFunctionWithGradient& F) const override;
|
||||
|
||||
private:
|
||||
double myTol3d;
|
||||
double myTol2d;
|
||||
};
|
||||
|
||||
#endif // _AppDef_Gradient_BFGSOfTheGradient_HeaderFile
|
||||
@ -0,0 +1,34 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppDef_HArray1OfMultiPointConstraint.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_HArray1<AppDef_MultiPointConstraint> directly instead.
|
||||
|
||||
#ifndef _AppDef_HArray1OfMultiPointConstraint_hxx
|
||||
#define _AppDef_HArray1OfMultiPointConstraint_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppDef_MultiPointConstraint.hxx>
|
||||
#include <AppDef_Array1OfMultiPointConstraint.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppDef_HArray1OfMultiPointConstraint.hxx is deprecated since OCCT "
|
||||
"8.0.0. Use NCollection_HArray1<AppDef_MultiPointConstraint> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppDef_HArray1OfMultiPointConstraint is deprecated, use "
|
||||
"NCollection_HArray1<AppDef_MultiPointConstraint> directly")
|
||||
typedef NCollection_HArray1<AppDef_MultiPointConstraint> AppDef_HArray1OfMultiPointConstraint;
|
||||
|
||||
#endif // _AppDef_HArray1OfMultiPointConstraint_hxx
|
||||
@ -0,0 +1,199 @@
|
||||
// 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_MultiPointConstraint_HeaderFile
|
||||
#define _AppDef_MultiPointConstraint_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_MultiPoint.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
|
||||
class gp_Vec;
|
||||
class gp_Vec2d;
|
||||
|
||||
//! Describes a MultiPointConstraint used in a
|
||||
//! Multiline. MultiPointConstraints are composed
|
||||
//! of several two or three-dimensional points.
|
||||
//! The purpose is to define the corresponding
|
||||
//! points that share a common constraint in order
|
||||
//! to compute the approximation of several lines in parallel.
|
||||
//! Notes:
|
||||
//! - The order of points of a MultiPointConstraints is very important.
|
||||
//! Users must give 3D points first, and then 2D points.
|
||||
//! - The constraints for the points included in a
|
||||
//! MultiPointConstraint are always identical for
|
||||
//! all points, including the parameter.
|
||||
//! - If a MultiPointConstraint is a "tangency"
|
||||
//! point, the point is also a "passing" point.
|
||||
class AppDef_MultiPointConstraint : public AppParCurves_MultiPoint
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! creates an undefined MultiPointConstraint.
|
||||
Standard_EXPORT AppDef_MultiPointConstraint();
|
||||
|
||||
//! 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.
|
||||
Standard_EXPORT AppDef_MultiPointConstraint(const int NbPoints, const int NbPoints2d);
|
||||
|
||||
//! creates a MultiPoint only composed of 3D points.
|
||||
Standard_EXPORT AppDef_MultiPointConstraint(const NCollection_Array1<gp_Pnt>& tabP);
|
||||
|
||||
//! creates a MultiPoint only composed of 2D points.
|
||||
Standard_EXPORT AppDef_MultiPointConstraint(const NCollection_Array1<gp_Pnt2d>& tabP);
|
||||
|
||||
//! 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.
|
||||
Standard_EXPORT AppDef_MultiPointConstraint(const NCollection_Array1<gp_Pnt>& tabP,
|
||||
const NCollection_Array1<gp_Pnt2d>& tabP2d);
|
||||
|
||||
//! creates a MultiPointConstraint with a constraint of
|
||||
//! Curvature.
|
||||
//! An exception is raised if
|
||||
//! (length of <tabP> + length of <tabP2d> ) is different
|
||||
//! from (length of <tabVec> + length of <tabVec2d> ) or
|
||||
//! from (length of <tabCur> + length of <tabCur2d> )
|
||||
Standard_EXPORT AppDef_MultiPointConstraint(const NCollection_Array1<gp_Pnt>& tabP,
|
||||
const NCollection_Array1<gp_Pnt2d>& tabP2d,
|
||||
const NCollection_Array1<gp_Vec>& tabVec,
|
||||
const NCollection_Array1<gp_Vec2d>& tabVec2d,
|
||||
const NCollection_Array1<gp_Vec>& tabCur,
|
||||
const NCollection_Array1<gp_Vec2d>& tabCur2d);
|
||||
|
||||
//! creates a MultiPointConstraint with a constraint of
|
||||
//! Tangency.
|
||||
//! An exception is raised if
|
||||
//! (length of <tabP> + length of <tabP2d> ) is different
|
||||
//! from (length of <tabVec> + length of <tabVec2d> )
|
||||
Standard_EXPORT AppDef_MultiPointConstraint(const NCollection_Array1<gp_Pnt>& tabP,
|
||||
const NCollection_Array1<gp_Pnt2d>& tabP2d,
|
||||
const NCollection_Array1<gp_Vec>& tabVec,
|
||||
const NCollection_Array1<gp_Vec2d>& tabVec2d);
|
||||
|
||||
//! creates a MultiPointConstraint only composed of 3d points
|
||||
//! with constraints of curvature.
|
||||
//! An exception is raised if the length of tabP is different
|
||||
//! from the length of tabVec or from tabCur.
|
||||
Standard_EXPORT AppDef_MultiPointConstraint(const NCollection_Array1<gp_Pnt>& tabP,
|
||||
const NCollection_Array1<gp_Vec>& tabVec,
|
||||
const NCollection_Array1<gp_Vec>& tabCur);
|
||||
|
||||
//! creates a MultiPointConstraint only composed of 3d points
|
||||
//! with constraints of tangency.
|
||||
//! An exception is raised if the length of tabP is different
|
||||
//! from the length of tabVec.
|
||||
Standard_EXPORT AppDef_MultiPointConstraint(const NCollection_Array1<gp_Pnt>& tabP,
|
||||
const NCollection_Array1<gp_Vec>& tabVec);
|
||||
|
||||
//! creates a MultiPointConstraint only composed of 2d points
|
||||
//! with constraints of tangency.
|
||||
//! An exception is raised if the length of tabP is different
|
||||
//! from the length of tabVec2d.
|
||||
Standard_EXPORT AppDef_MultiPointConstraint(const NCollection_Array1<gp_Pnt2d>& tabP2d,
|
||||
const NCollection_Array1<gp_Vec2d>& tabVec2d);
|
||||
|
||||
//! creates a MultiPointConstraint only composed of 2d points
|
||||
//! with constraints of curvature.
|
||||
//! An exception is raised if the length of tabP is different
|
||||
//! from the length of tabVec2d or from tabCur2d.
|
||||
Standard_EXPORT AppDef_MultiPointConstraint(const NCollection_Array1<gp_Pnt2d>& tabP2d,
|
||||
const NCollection_Array1<gp_Vec2d>& tabVec2d,
|
||||
const NCollection_Array1<gp_Vec2d>& tabCur2d);
|
||||
|
||||
//! sets the value of the tangency of the point of range
|
||||
//! Index.
|
||||
//! An exception is raised if Index <0 or if Index > number
|
||||
//! of 3d points.
|
||||
//! An exception is raised if Tang has an incorrect number of
|
||||
//! dimensions.
|
||||
Standard_EXPORT void SetTang(const int Index, const gp_Vec& Tang);
|
||||
|
||||
//! returns the tangency value of the point of range Index.
|
||||
//! An exception is raised if Index < 0 or if Index > number
|
||||
//! of 3d points.
|
||||
Standard_EXPORT gp_Vec Tang(const int Index) const;
|
||||
|
||||
//! sets the value of the tangency of the point of range
|
||||
//! Index.
|
||||
//! An exception is raised if Index <number of 3d points or if
|
||||
//! Index > total number of Points
|
||||
//! An exception is raised if Tang has an incorrect number of
|
||||
//! dimensions.
|
||||
Standard_EXPORT void SetTang2d(const int Index, const gp_Vec2d& Tang2d);
|
||||
|
||||
//! returns the tangency value of the point of range Index.
|
||||
//! An exception is raised if Index < number of 3d points or
|
||||
//! if Index > total number of points.
|
||||
Standard_EXPORT gp_Vec2d Tang2d(const int Index) const;
|
||||
|
||||
//! Vec sets the value of the normal vector at the
|
||||
//! point of index Index. The norm of the normal
|
||||
//! vector at the point of position Index is set to the normal curvature.
|
||||
//! An exception is raised if Index <0 or if Index > number
|
||||
//! of 3d points.
|
||||
//! An exception is raised if Curv has an incorrect number of
|
||||
//! dimensions.
|
||||
Standard_EXPORT void SetCurv(const int Index, const gp_Vec& Curv);
|
||||
|
||||
//! returns the normal vector at the point of range Index.
|
||||
//! An exception is raised if Index < 0 or if Index > number
|
||||
//! of 3d points.
|
||||
Standard_EXPORT gp_Vec Curv(const int Index) const;
|
||||
|
||||
//! Vec sets the value of the normal vector at the
|
||||
//! point of index Index. The norm of the normal
|
||||
//! vector at the point of position Index is set to the normal curvature.
|
||||
//! An exception is raised if Index <0 or if Index > number
|
||||
//! of 3d points.
|
||||
//! An exception is raised if Curv has an incorrect number of
|
||||
//! dimensions.
|
||||
Standard_EXPORT void SetCurv2d(const int Index, const gp_Vec2d& Curv2d);
|
||||
|
||||
//! returns the normal vector at the point of range Index.
|
||||
//! An exception is raised if Index < 0 or if Index > number
|
||||
//! of 3d points.
|
||||
Standard_EXPORT gp_Vec2d Curv2d(const int Index) const;
|
||||
|
||||
//! returns True if the MultiPoint has a tangency value.
|
||||
Standard_EXPORT bool IsTangencyPoint() const;
|
||||
|
||||
//! returns True if the MultiPoint has a curvature value.
|
||||
Standard_EXPORT bool IsCurvaturePoint() const;
|
||||
|
||||
//! Prints on the stream o information on the current
|
||||
//! state of the object.
|
||||
//! Is used to redefine the operator <<.
|
||||
Standard_EXPORT void Dump(Standard_OStream& o) const override;
|
||||
|
||||
private:
|
||||
occ::handle<NCollection_HArray1<gp_Vec>> tabTang;
|
||||
occ::handle<NCollection_HArray1<gp_Vec>> tabCurv;
|
||||
occ::handle<NCollection_HArray1<gp_Vec2d>> tabTang2d;
|
||||
occ::handle<NCollection_HArray1<gp_Vec2d>> tabCurv2d;
|
||||
};
|
||||
|
||||
#endif // _AppDef_MultiPointConstraint_HeaderFile
|
||||
@ -0,0 +1,136 @@
|
||||
// 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_MyBSplGradientOfBSplineCompute_HeaderFile
|
||||
#define _AppDef_MyBSplGradientOfBSplineCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class StdFail_NotDone;
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute;
|
||||
class AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute;
|
||||
class AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute;
|
||||
class AppParCurves_MultiBSpCurve;
|
||||
|
||||
class AppDef_MyBSplGradientOfBSplineCompute
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Tries to minimize the sum (square(||Qui - Bi*Pi||))
|
||||
//! where Pui describe the approximating BSpline curves'Poles
|
||||
//! and Qi the MultiLine points with a parameter ui.
|
||||
//! In this algorithm, the parameters ui are the unknowns.
|
||||
//! The tolerance required on this sum is given by Tol.
|
||||
//! The desired degree of the resulting curve is Deg.
|
||||
Standard_EXPORT AppDef_MyBSplGradientOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
math_Vector& Parameters,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int Deg,
|
||||
const double Tol3d,
|
||||
const double Tol2d,
|
||||
const int NbIterations = 1);
|
||||
|
||||
//! Tries to minimize the sum (square(||Qui - Bi*Pi||))
|
||||
//! where Pui describe the approximating BSpline curves'Poles
|
||||
//! and Qi the MultiLine points with a parameter ui.
|
||||
//! In this algorithm, the parameters ui are the unknowns.
|
||||
//! The tolerance required on this sum is given by Tol.
|
||||
//! The desired degree of the resulting curve is Deg.
|
||||
Standard_EXPORT AppDef_MyBSplGradientOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
math_Vector& Parameters,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int Deg,
|
||||
const double Tol3d,
|
||||
const double Tol2d,
|
||||
const int NbIterations,
|
||||
const double lambda1,
|
||||
const double lambda2);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT bool IsDone() const;
|
||||
|
||||
//! returns all the BSpline curves approximating the
|
||||
//! MultiLine SSP after minimization of the parameter.
|
||||
Standard_EXPORT AppParCurves_MultiBSpCurve Value() const;
|
||||
|
||||
//! returns the difference between the old and the new
|
||||
//! approximation.
|
||||
//! An exception is raised if NotDone.
|
||||
//! An exception is raised if Index<1 or Index>NbParameters.
|
||||
Standard_EXPORT double Error(const int Index) const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT double MaxError3d() const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT double MaxError2d() const;
|
||||
|
||||
//! returns the average error between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT double AverageError() const;
|
||||
|
||||
protected:
|
||||
Standard_EXPORT void Perform(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
math_Vector& Parameters,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int Deg,
|
||||
const double Tol3d,
|
||||
const double Tol2d,
|
||||
const int NbIterations = 200);
|
||||
|
||||
private:
|
||||
AppParCurves_MultiBSpCurve SCU;
|
||||
math_Vector ParError;
|
||||
double AvError;
|
||||
double MError3d;
|
||||
double MError2d;
|
||||
double mylambda1;
|
||||
double mylambda2;
|
||||
bool myIsLambdaDefined;
|
||||
bool Done;
|
||||
};
|
||||
|
||||
#endif // _AppDef_MyBSplGradientOfBSplineCompute_HeaderFile
|
||||
@ -0,0 +1,97 @@
|
||||
// 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_MyGradientbisOfBSplineCompute_HeaderFile
|
||||
#define _AppDef_MyGradientbisOfBSplineCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class StdFail_NotDone;
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute;
|
||||
class AppDef_ResConstraintOfMyGradientbisOfBSplineCompute;
|
||||
class AppDef_ParFunctionOfMyGradientbisOfBSplineCompute;
|
||||
class AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute;
|
||||
class AppParCurves_MultiCurve;
|
||||
|
||||
class AppDef_MyGradientbisOfBSplineCompute
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Tries to minimize the sum (square(||Qui - Bi*Pi||))
|
||||
//! where Pui describe the approximating Bezier curves'Poles
|
||||
//! and Qi the MultiLine points with a parameter ui.
|
||||
//! In this algorithm, the parameters ui are the unknowns.
|
||||
//! The tolerance required on this sum is given by Tol.
|
||||
//! The desired degree of the resulting curve is Deg.
|
||||
Standard_EXPORT AppDef_MyGradientbisOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
math_Vector& Parameters,
|
||||
const int Deg,
|
||||
const double Tol3d,
|
||||
const double Tol2d,
|
||||
const int NbIterations = 200);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT bool IsDone() const;
|
||||
|
||||
//! returns all the Bezier curves approximating the
|
||||
//! MultiLine SSP after minimization of the parameter.
|
||||
Standard_EXPORT AppParCurves_MultiCurve Value() const;
|
||||
|
||||
//! returns the difference between the old and the new
|
||||
//! approximation.
|
||||
//! An exception is raised if NotDone.
|
||||
//! An exception is raised if Index<1 or Index>NbParameters.
|
||||
Standard_EXPORT double Error(const int Index) const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT double MaxError3d() const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT double MaxError2d() const;
|
||||
|
||||
//! returns the average error between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT double AverageError() const;
|
||||
|
||||
private:
|
||||
AppParCurves_MultiCurve SCU;
|
||||
math_Vector ParError;
|
||||
double AvError;
|
||||
double MError3d;
|
||||
double MError2d;
|
||||
bool Done;
|
||||
};
|
||||
|
||||
#endif // _AppDef_MyGradientbisOfBSplineCompute_HeaderFile
|
||||
@ -0,0 +1,132 @@
|
||||
// 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_ParFunctionOfMyGradientOfCompute_HeaderFile
|
||||
#define _AppDef_ParFunctionOfMyGradientOfCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppDef_MultiLine.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <math_MultipleVarFunctionWithGradient.hxx>
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppDef_ParLeastSquareOfMyGradientOfCompute;
|
||||
class AppDef_ResConstraintOfMyGradientOfCompute;
|
||||
class AppParCurves_MultiCurve;
|
||||
|
||||
class AppDef_ParFunctionOfMyGradientOfCompute : public math_MultipleVarFunctionWithGradient
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! initializes the fields of the function. The approximating
|
||||
//! curve has the desired degree Deg.
|
||||
Standard_EXPORT AppDef_ParFunctionOfMyGradientOfCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const math_Vector& Parameters,
|
||||
const int Deg);
|
||||
|
||||
//! returns the number of variables of the function. It
|
||||
//! corresponds to the number of MultiPoints.
|
||||
Standard_EXPORT int NbVariables() const override;
|
||||
|
||||
//! this method computes the new approximation of the
|
||||
//! MultiLine
|
||||
//! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
|
||||
//! point of the MultiLine.
|
||||
Standard_EXPORT bool Value(const math_Vector& X, double& F) override;
|
||||
|
||||
//! returns the gradient G of the sum above for the
|
||||
//! parameters Xi.
|
||||
Standard_EXPORT bool Gradient(const math_Vector& X, math_Vector& G) override;
|
||||
|
||||
//! returns the value F=sum(||Pui - Bi*Pi||)2.
|
||||
//! returns the value G = grad(F) for the parameters Xi.
|
||||
Standard_EXPORT bool Values(const math_Vector& X, double& F, math_Vector& G) override;
|
||||
|
||||
//! returns the new parameters of the MultiLine.
|
||||
Standard_EXPORT const math_Vector& NewParameters() const;
|
||||
|
||||
//! returns the MultiCurve approximating the set after
|
||||
//! computing the value F or Grad(F).
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
|
||||
|
||||
//! returns the distance between the MultiPoint of range
|
||||
//! IPoint and the curve CurveIndex.
|
||||
Standard_EXPORT double Error(const int IPoint, const int CurveIndex) const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT double MaxError3d() const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT double MaxError2d() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint FirstConstraint(
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const int FirstPoint) const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint LastConstraint(
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const int LastPoint) const;
|
||||
|
||||
protected:
|
||||
//! this method is used each time Value or Gradient is
|
||||
//! needed.
|
||||
Standard_EXPORT void Perform(const math_Vector& X);
|
||||
|
||||
private:
|
||||
bool Done;
|
||||
AppDef_MultiLine MyMultiLine;
|
||||
AppParCurves_MultiCurve MyMultiCurve;
|
||||
int Degre;
|
||||
math_Vector myParameters;
|
||||
double FVal;
|
||||
math_Vector ValGrad_F;
|
||||
math_Matrix MyF;
|
||||
math_Matrix PTLX;
|
||||
math_Matrix PTLY;
|
||||
math_Matrix PTLZ;
|
||||
math_Matrix A;
|
||||
math_Matrix DA;
|
||||
AppDef_ParLeastSquareOfMyGradientOfCompute MyLeastSquare;
|
||||
bool Contraintes;
|
||||
int NbP;
|
||||
int NbCu;
|
||||
int Adeb;
|
||||
int Afin;
|
||||
occ::handle<NCollection_HArray1<int>> tabdim;
|
||||
double ERR3d;
|
||||
double ERR2d;
|
||||
int FirstP;
|
||||
int LastP;
|
||||
occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>> myConstraints;
|
||||
};
|
||||
|
||||
#endif // _AppDef_ParFunctionOfMyGradientOfCompute_HeaderFile
|
||||
@ -0,0 +1,133 @@
|
||||
// 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_ParFunctionOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
#define _AppDef_ParFunctionOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppDef_MultiLine.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <math_MultipleVarFunctionWithGradient.hxx>
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute;
|
||||
class AppDef_ResConstraintOfMyGradientbisOfBSplineCompute;
|
||||
class AppParCurves_MultiCurve;
|
||||
|
||||
class AppDef_ParFunctionOfMyGradientbisOfBSplineCompute
|
||||
: public math_MultipleVarFunctionWithGradient
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! initializes the fields of the function. The approximating
|
||||
//! curve has the desired degree Deg.
|
||||
Standard_EXPORT AppDef_ParFunctionOfMyGradientbisOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const math_Vector& Parameters,
|
||||
const int Deg);
|
||||
|
||||
//! returns the number of variables of the function. It
|
||||
//! corresponds to the number of MultiPoints.
|
||||
Standard_EXPORT int NbVariables() const override;
|
||||
|
||||
//! this method computes the new approximation of the
|
||||
//! MultiLine
|
||||
//! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
|
||||
//! point of the MultiLine.
|
||||
Standard_EXPORT bool Value(const math_Vector& X, double& F) override;
|
||||
|
||||
//! returns the gradient G of the sum above for the
|
||||
//! parameters Xi.
|
||||
Standard_EXPORT bool Gradient(const math_Vector& X, math_Vector& G) override;
|
||||
|
||||
//! returns the value F=sum(||Pui - Bi*Pi||)2.
|
||||
//! returns the value G = grad(F) for the parameters Xi.
|
||||
Standard_EXPORT bool Values(const math_Vector& X, double& F, math_Vector& G) override;
|
||||
|
||||
//! returns the new parameters of the MultiLine.
|
||||
Standard_EXPORT const math_Vector& NewParameters() const;
|
||||
|
||||
//! returns the MultiCurve approximating the set after
|
||||
//! computing the value F or Grad(F).
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
|
||||
|
||||
//! returns the distance between the MultiPoint of range
|
||||
//! IPoint and the curve CurveIndex.
|
||||
Standard_EXPORT double Error(const int IPoint, const int CurveIndex) const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT double MaxError3d() const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT double MaxError2d() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint FirstConstraint(
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const int FirstPoint) const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint LastConstraint(
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const int LastPoint) const;
|
||||
|
||||
protected:
|
||||
//! this method is used each time Value or Gradient is
|
||||
//! needed.
|
||||
Standard_EXPORT void Perform(const math_Vector& X);
|
||||
|
||||
private:
|
||||
bool Done;
|
||||
AppDef_MultiLine MyMultiLine;
|
||||
AppParCurves_MultiCurve MyMultiCurve;
|
||||
int Degre;
|
||||
math_Vector myParameters;
|
||||
double FVal;
|
||||
math_Vector ValGrad_F;
|
||||
math_Matrix MyF;
|
||||
math_Matrix PTLX;
|
||||
math_Matrix PTLY;
|
||||
math_Matrix PTLZ;
|
||||
math_Matrix A;
|
||||
math_Matrix DA;
|
||||
AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute MyLeastSquare;
|
||||
bool Contraintes;
|
||||
int NbP;
|
||||
int NbCu;
|
||||
int Adeb;
|
||||
int Afin;
|
||||
occ::handle<NCollection_HArray1<int>> tabdim;
|
||||
double ERR3d;
|
||||
double ERR2d;
|
||||
int FirstP;
|
||||
int LastP;
|
||||
occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>> myConstraints;
|
||||
};
|
||||
|
||||
#endif // _AppDef_ParFunctionOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
@ -0,0 +1,132 @@
|
||||
// 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_ParFunctionOfTheGradient_HeaderFile
|
||||
#define _AppDef_ParFunctionOfTheGradient_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppDef_MultiLine.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <AppDef_ParLeastSquareOfTheGradient.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <math_MultipleVarFunctionWithGradient.hxx>
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppDef_ParLeastSquareOfTheGradient;
|
||||
class AppDef_ResConstraintOfTheGradient;
|
||||
class AppParCurves_MultiCurve;
|
||||
|
||||
class AppDef_ParFunctionOfTheGradient : public math_MultipleVarFunctionWithGradient
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! initializes the fields of the function. The approximating
|
||||
//! curve has the desired degree Deg.
|
||||
Standard_EXPORT AppDef_ParFunctionOfTheGradient(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const math_Vector& Parameters,
|
||||
const int Deg);
|
||||
|
||||
//! returns the number of variables of the function. It
|
||||
//! corresponds to the number of MultiPoints.
|
||||
Standard_EXPORT int NbVariables() const override;
|
||||
|
||||
//! this method computes the new approximation of the
|
||||
//! MultiLine
|
||||
//! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
|
||||
//! point of the MultiLine.
|
||||
Standard_EXPORT bool Value(const math_Vector& X, double& F) override;
|
||||
|
||||
//! returns the gradient G of the sum above for the
|
||||
//! parameters Xi.
|
||||
Standard_EXPORT bool Gradient(const math_Vector& X, math_Vector& G) override;
|
||||
|
||||
//! returns the value F=sum(||Pui - Bi*Pi||)2.
|
||||
//! returns the value G = grad(F) for the parameters Xi.
|
||||
Standard_EXPORT bool Values(const math_Vector& X, double& F, math_Vector& G) override;
|
||||
|
||||
//! returns the new parameters of the MultiLine.
|
||||
Standard_EXPORT const math_Vector& NewParameters() const;
|
||||
|
||||
//! returns the MultiCurve approximating the set after
|
||||
//! computing the value F or Grad(F).
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
|
||||
|
||||
//! returns the distance between the MultiPoint of range
|
||||
//! IPoint and the curve CurveIndex.
|
||||
Standard_EXPORT double Error(const int IPoint, const int CurveIndex) const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT double MaxError3d() const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT double MaxError2d() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint FirstConstraint(
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const int FirstPoint) const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint LastConstraint(
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints,
|
||||
const int LastPoint) const;
|
||||
|
||||
protected:
|
||||
//! this method is used each time Value or Gradient is
|
||||
//! needed.
|
||||
Standard_EXPORT void Perform(const math_Vector& X);
|
||||
|
||||
private:
|
||||
bool Done;
|
||||
AppDef_MultiLine MyMultiLine;
|
||||
AppParCurves_MultiCurve MyMultiCurve;
|
||||
int Degre;
|
||||
math_Vector myParameters;
|
||||
double FVal;
|
||||
math_Vector ValGrad_F;
|
||||
math_Matrix MyF;
|
||||
math_Matrix PTLX;
|
||||
math_Matrix PTLY;
|
||||
math_Matrix PTLZ;
|
||||
math_Matrix A;
|
||||
math_Matrix DA;
|
||||
AppDef_ParLeastSquareOfTheGradient MyLeastSquare;
|
||||
bool Contraintes;
|
||||
int NbP;
|
||||
int NbCu;
|
||||
int Adeb;
|
||||
int Afin;
|
||||
occ::handle<NCollection_HArray1<int>> tabdim;
|
||||
double ERR3d;
|
||||
double ERR2d;
|
||||
int FirstP;
|
||||
int LastP;
|
||||
occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>> myConstraints;
|
||||
};
|
||||
|
||||
#endif // _AppDef_ParFunctionOfTheGradient_HeaderFile
|
||||
@ -0,0 +1,278 @@
|
||||
// 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_ParLeastSquareOfMyGradientOfCompute_HeaderFile
|
||||
#define _AppDef_ParLeastSquareOfMyGradientOfCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_IntegerVector.hxx>
|
||||
#include <Standard_Real.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_ParLeastSquareOfMyGradientOfCompute
|
||||
{
|
||||
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_ParLeastSquareOfMyGradientOfCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const math_Vector& Parameters,
|
||||
const int NbPol);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientOfCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const int 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_ParLeastSquareOfMyGradientOfCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const math_Vector& Parameters,
|
||||
const int NbPol);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientOfCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const int 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 double l1, const double 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 double l1,
|
||||
const double 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 double l1,
|
||||
const double l2);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT bool 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, double& F, double& MaxE3d, double& 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(double& F, double& MaxE3d, double& MaxE2d);
|
||||
|
||||
//! returns the value (P2 - P1)/ V1 if the first point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT double FirstLambda() const;
|
||||
|
||||
//! returns the value (PN - PN-1)/ VN if the last point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT double 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 int FirstPoint, const int LastPoint);
|
||||
|
||||
//! returns the number of second member columns.
|
||||
//! Is used internally to initialize the fields.
|
||||
Standard_EXPORT int NbBColumns(const AppDef_MultiLine& SSP) const;
|
||||
|
||||
//! returns the first point being fitted.
|
||||
Standard_EXPORT int TheFirstPoint(const AppParCurves_Constraint FirstCons,
|
||||
const int FirstPoint) const;
|
||||
|
||||
//! returns the last point being fitted.
|
||||
Standard_EXPORT int TheLastPoint(const AppParCurves_Constraint LastCons,
|
||||
const int LastPoint) const;
|
||||
|
||||
//! Affects the fields in the case of a constraint point.
|
||||
Standard_EXPORT void Affect(const AppDef_MultiLine& SSP,
|
||||
const int 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;
|
||||
occ::handle<NCollection_HArray1<double>> myknots;
|
||||
occ::handle<NCollection_HArray1<int>> 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;
|
||||
double lambda1;
|
||||
double lambda2;
|
||||
int FirstP;
|
||||
int LastP;
|
||||
int Nlignes;
|
||||
int Ninc;
|
||||
int NA;
|
||||
int myfirstp;
|
||||
int mylastp;
|
||||
int resinit;
|
||||
int resfin;
|
||||
int nbP2d;
|
||||
int nbP;
|
||||
int nbpoles;
|
||||
int deg;
|
||||
bool done;
|
||||
bool iscalculated;
|
||||
bool isready;
|
||||
};
|
||||
|
||||
#endif // _AppDef_ParLeastSquareOfMyGradientOfCompute_HeaderFile
|
||||
@ -0,0 +1,278 @@
|
||||
// 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_ParLeastSquareOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
#define _AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_IntegerVector.hxx>
|
||||
#include <Standard_Real.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_ParLeastSquareOfMyGradientbisOfBSplineCompute
|
||||
{
|
||||
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_ParLeastSquareOfMyGradientbisOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const math_Vector& Parameters,
|
||||
const int NbPol);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const int 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_ParLeastSquareOfMyGradientbisOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const math_Vector& Parameters,
|
||||
const int NbPol);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const int 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 double l1, const double 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 double l1,
|
||||
const double 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 double l1,
|
||||
const double l2);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT bool 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, double& F, double& MaxE3d, double& 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(double& F, double& MaxE3d, double& MaxE2d);
|
||||
|
||||
//! returns the value (P2 - P1)/ V1 if the first point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT double FirstLambda() const;
|
||||
|
||||
//! returns the value (PN - PN-1)/ VN if the last point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT double 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 int FirstPoint, const int LastPoint);
|
||||
|
||||
//! returns the number of second member columns.
|
||||
//! Is used internally to initialize the fields.
|
||||
Standard_EXPORT int NbBColumns(const AppDef_MultiLine& SSP) const;
|
||||
|
||||
//! returns the first point being fitted.
|
||||
Standard_EXPORT int TheFirstPoint(const AppParCurves_Constraint FirstCons,
|
||||
const int FirstPoint) const;
|
||||
|
||||
//! returns the last point being fitted.
|
||||
Standard_EXPORT int TheLastPoint(const AppParCurves_Constraint LastCons,
|
||||
const int LastPoint) const;
|
||||
|
||||
//! Affects the fields in the case of a constraint point.
|
||||
Standard_EXPORT void Affect(const AppDef_MultiLine& SSP,
|
||||
const int 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;
|
||||
occ::handle<NCollection_HArray1<double>> myknots;
|
||||
occ::handle<NCollection_HArray1<int>> 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;
|
||||
double lambda1;
|
||||
double lambda2;
|
||||
int FirstP;
|
||||
int LastP;
|
||||
int Nlignes;
|
||||
int Ninc;
|
||||
int NA;
|
||||
int myfirstp;
|
||||
int mylastp;
|
||||
int resinit;
|
||||
int resfin;
|
||||
int nbP2d;
|
||||
int nbP;
|
||||
int nbpoles;
|
||||
int deg;
|
||||
bool done;
|
||||
bool iscalculated;
|
||||
bool isready;
|
||||
};
|
||||
|
||||
#endif // _AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
@ -0,0 +1,274 @@
|
||||
// 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_ParLeastSquareOfTheGradient_HeaderFile
|
||||
#define _AppDef_ParLeastSquareOfTheGradient_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_IntegerVector.hxx>
|
||||
#include <Standard_Real.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_ParLeastSquareOfTheGradient
|
||||
{
|
||||
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_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const math_Vector& Parameters,
|
||||
const int NbPol);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
Standard_EXPORT AppDef_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const int 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_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const math_Vector& Parameters,
|
||||
const int NbPol);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
Standard_EXPORT AppDef_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP,
|
||||
const NCollection_Array1<double>& Knots,
|
||||
const NCollection_Array1<int>& Mults,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const int 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 double l1, const double 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 double l1,
|
||||
const double 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 double l1,
|
||||
const double l2);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT bool 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, double& F, double& MaxE3d, double& 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(double& F, double& MaxE3d, double& MaxE2d);
|
||||
|
||||
//! returns the value (P2 - P1)/ V1 if the first point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT double FirstLambda() const;
|
||||
|
||||
//! returns the value (PN - PN-1)/ VN if the last point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT double 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 int FirstPoint, const int LastPoint);
|
||||
|
||||
//! returns the number of second member columns.
|
||||
//! Is used internally to initialize the fields.
|
||||
Standard_EXPORT int NbBColumns(const AppDef_MultiLine& SSP) const;
|
||||
|
||||
//! returns the first point being fitted.
|
||||
Standard_EXPORT int TheFirstPoint(const AppParCurves_Constraint FirstCons,
|
||||
const int FirstPoint) const;
|
||||
|
||||
//! returns the last point being fitted.
|
||||
Standard_EXPORT int TheLastPoint(const AppParCurves_Constraint LastCons,
|
||||
const int LastPoint) const;
|
||||
|
||||
//! Affects the fields in the case of a constraint point.
|
||||
Standard_EXPORT void Affect(const AppDef_MultiLine& SSP,
|
||||
const int 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;
|
||||
occ::handle<NCollection_HArray1<double>> myknots;
|
||||
occ::handle<NCollection_HArray1<int>> 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;
|
||||
double lambda1;
|
||||
double lambda2;
|
||||
int FirstP;
|
||||
int LastP;
|
||||
int Nlignes;
|
||||
int Ninc;
|
||||
int NA;
|
||||
int myfirstp;
|
||||
int mylastp;
|
||||
int resinit;
|
||||
int resfin;
|
||||
int nbP2d;
|
||||
int nbP;
|
||||
int nbpoles;
|
||||
int deg;
|
||||
bool done;
|
||||
bool iscalculated;
|
||||
bool isready;
|
||||
};
|
||||
|
||||
#endif // _AppDef_ParLeastSquareOfTheGradient_HeaderFile
|
||||
@ -0,0 +1,111 @@
|
||||
// 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_ResConstraintOfMyGradientOfCompute_HeaderFile
|
||||
#define _AppDef_ResConstraintOfMyGradientOfCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppParCurves_MultiCurve;
|
||||
class math_Matrix;
|
||||
|
||||
class AppDef_ResConstraintOfMyGradientOfCompute
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Given a MultiLine SSP with constraints points, this
|
||||
//! algorithm finds the best curve solution to approximate it.
|
||||
//! The poles from SCurv issued for example from the least
|
||||
//! squares are used as a guess solution for the uzawa
|
||||
//! algorithm. The tolerance used in the Uzawa algorithms
|
||||
//! is Tolerance.
|
||||
//! A is the Bernstein matrix associated to the MultiLine
|
||||
//! and DA is the derivative bernstein matrix.(They can come
|
||||
//! from an approximation with ParLeastSquare.)
|
||||
//! The MultiCurve is modified. New MultiPoles are given.
|
||||
Standard_EXPORT AppDef_ResConstraintOfMyGradientOfCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
AppParCurves_MultiCurve& SCurv,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& Constraints,
|
||||
const math_Matrix& Bern,
|
||||
const math_Matrix& DerivativeBern,
|
||||
const double Tolerance = 1.0e-10);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT bool IsDone() const;
|
||||
|
||||
//! returns the maximum difference value between the curve
|
||||
//! and the given points.
|
||||
Standard_EXPORT double Error() const;
|
||||
|
||||
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
|
||||
|
||||
//! returns the duale variables of the system.
|
||||
Standard_EXPORT const math_Vector& Duale() const;
|
||||
|
||||
//! Returns the derivative of the constraint matrix.
|
||||
Standard_EXPORT const math_Matrix& ConstraintDerivative(const AppDef_MultiLine& SSP,
|
||||
const math_Vector& Parameters,
|
||||
const int Deg,
|
||||
const math_Matrix& DA);
|
||||
|
||||
//! returns the Inverse of Cont*Transposed(Cont), where
|
||||
//! Cont is the constraint matrix for the algorithm.
|
||||
Standard_EXPORT const math_Matrix& InverseMatrix() const;
|
||||
|
||||
protected:
|
||||
//! is used internally to create the fields.
|
||||
Standard_EXPORT int NbConstraints(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints) const;
|
||||
|
||||
//! is internally used for the fields creation.
|
||||
Standard_EXPORT int NbColumns(const AppDef_MultiLine& SSP, const int Deg) const;
|
||||
|
||||
private:
|
||||
bool Done;
|
||||
double Err;
|
||||
math_Matrix Cont;
|
||||
math_Matrix DeCont;
|
||||
math_Vector Secont;
|
||||
math_Matrix CTCinv;
|
||||
math_Vector Vardua;
|
||||
int IncPass;
|
||||
int IncTan;
|
||||
int IncCurv;
|
||||
NCollection_Array1<int> IPas;
|
||||
NCollection_Array1<int> ITan;
|
||||
NCollection_Array1<int> ICurv;
|
||||
};
|
||||
|
||||
#endif // _AppDef_ResConstraintOfMyGradientOfCompute_HeaderFile
|
||||
@ -0,0 +1,111 @@
|
||||
// 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_ResConstraintOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
#define _AppDef_ResConstraintOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppParCurves_MultiCurve;
|
||||
class math_Matrix;
|
||||
|
||||
class AppDef_ResConstraintOfMyGradientbisOfBSplineCompute
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Given a MultiLine SSP with constraints points, this
|
||||
//! algorithm finds the best curve solution to approximate it.
|
||||
//! The poles from SCurv issued for example from the least
|
||||
//! squares are used as a guess solution for the uzawa
|
||||
//! algorithm. The tolerance used in the Uzawa algorithms
|
||||
//! is Tolerance.
|
||||
//! A is the Bernstein matrix associated to the MultiLine
|
||||
//! and DA is the derivative bernstein matrix.(They can come
|
||||
//! from an approximation with ParLeastSquare.)
|
||||
//! The MultiCurve is modified. New MultiPoles are given.
|
||||
Standard_EXPORT AppDef_ResConstraintOfMyGradientbisOfBSplineCompute(
|
||||
const AppDef_MultiLine& SSP,
|
||||
AppParCurves_MultiCurve& SCurv,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& Constraints,
|
||||
const math_Matrix& Bern,
|
||||
const math_Matrix& DerivativeBern,
|
||||
const double Tolerance = 1.0e-10);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT bool IsDone() const;
|
||||
|
||||
//! returns the maximum difference value between the curve
|
||||
//! and the given points.
|
||||
Standard_EXPORT double Error() const;
|
||||
|
||||
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
|
||||
|
||||
//! returns the duale variables of the system.
|
||||
Standard_EXPORT const math_Vector& Duale() const;
|
||||
|
||||
//! Returns the derivative of the constraint matrix.
|
||||
Standard_EXPORT const math_Matrix& ConstraintDerivative(const AppDef_MultiLine& SSP,
|
||||
const math_Vector& Parameters,
|
||||
const int Deg,
|
||||
const math_Matrix& DA);
|
||||
|
||||
//! returns the Inverse of Cont*Transposed(Cont), where
|
||||
//! Cont is the constraint matrix for the algorithm.
|
||||
Standard_EXPORT const math_Matrix& InverseMatrix() const;
|
||||
|
||||
protected:
|
||||
//! is used internally to create the fields.
|
||||
Standard_EXPORT int NbConstraints(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints) const;
|
||||
|
||||
//! is internally used for the fields creation.
|
||||
Standard_EXPORT int NbColumns(const AppDef_MultiLine& SSP, const int Deg) const;
|
||||
|
||||
private:
|
||||
bool Done;
|
||||
double Err;
|
||||
math_Matrix Cont;
|
||||
math_Matrix DeCont;
|
||||
math_Vector Secont;
|
||||
math_Matrix CTCinv;
|
||||
math_Vector Vardua;
|
||||
int IncPass;
|
||||
int IncTan;
|
||||
int IncCurv;
|
||||
NCollection_Array1<int> IPas;
|
||||
NCollection_Array1<int> ITan;
|
||||
NCollection_Array1<int> ICurv;
|
||||
};
|
||||
|
||||
#endif // _AppDef_ResConstraintOfMyGradientbisOfBSplineCompute_HeaderFile
|
||||
@ -0,0 +1,111 @@
|
||||
// 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_ResConstraintOfTheGradient_HeaderFile
|
||||
#define _AppDef_ResConstraintOfTheGradient_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class AppDef_MultiLine;
|
||||
class AppDef_MyLineTool;
|
||||
class AppParCurves_MultiCurve;
|
||||
class math_Matrix;
|
||||
|
||||
class AppDef_ResConstraintOfTheGradient
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Given a MultiLine SSP with constraints points, this
|
||||
//! algorithm finds the best curve solution to approximate it.
|
||||
//! The poles from SCurv issued for example from the least
|
||||
//! squares are used as a guess solution for the uzawa
|
||||
//! algorithm. The tolerance used in the Uzawa algorithms
|
||||
//! is Tolerance.
|
||||
//! A is the Bernstein matrix associated to the MultiLine
|
||||
//! and DA is the derivative bernstein matrix.(They can come
|
||||
//! from an approximation with ParLeastSquare.)
|
||||
//! The MultiCurve is modified. New MultiPoles are given.
|
||||
Standard_EXPORT AppDef_ResConstraintOfTheGradient(
|
||||
const AppDef_MultiLine& SSP,
|
||||
AppParCurves_MultiCurve& SCurv,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& Constraints,
|
||||
const math_Matrix& Bern,
|
||||
const math_Matrix& DerivativeBern,
|
||||
const double Tolerance = 1.0e-10);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT bool IsDone() const;
|
||||
|
||||
//! returns the maximum difference value between the curve
|
||||
//! and the given points.
|
||||
Standard_EXPORT double Error() const;
|
||||
|
||||
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
|
||||
|
||||
//! returns the duale variables of the system.
|
||||
Standard_EXPORT const math_Vector& Duale() const;
|
||||
|
||||
//! Returns the derivative of the constraint matrix.
|
||||
Standard_EXPORT const math_Matrix& ConstraintDerivative(const AppDef_MultiLine& SSP,
|
||||
const math_Vector& Parameters,
|
||||
const int Deg,
|
||||
const math_Matrix& DA);
|
||||
|
||||
//! returns the Inverse of Cont*Transposed(Cont), where
|
||||
//! Cont is the constraint matrix for the algorithm.
|
||||
Standard_EXPORT const math_Matrix& InverseMatrix() const;
|
||||
|
||||
protected:
|
||||
//! is used internally to create the fields.
|
||||
Standard_EXPORT int NbConstraints(
|
||||
const AppDef_MultiLine& SSP,
|
||||
const int FirstPoint,
|
||||
const int LastPoint,
|
||||
const occ::handle<NCollection_HArray1<AppParCurves_ConstraintCouple>>& TheConstraints) const;
|
||||
|
||||
//! is internally used for the fields creation.
|
||||
Standard_EXPORT int NbColumns(const AppDef_MultiLine& SSP, const int Deg) const;
|
||||
|
||||
private:
|
||||
bool Done;
|
||||
double Err;
|
||||
math_Matrix Cont;
|
||||
math_Matrix DeCont;
|
||||
math_Vector Secont;
|
||||
math_Matrix CTCinv;
|
||||
math_Vector Vardua;
|
||||
int IncPass;
|
||||
int IncTan;
|
||||
int IncCurv;
|
||||
NCollection_Array1<int> IPas;
|
||||
NCollection_Array1<int> ITan;
|
||||
NCollection_Array1<int> ICurv;
|
||||
};
|
||||
|
||||
#endif // _AppDef_ResConstraintOfTheGradient_HeaderFile
|
||||
@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppParCurves_Array1OfConstraintCouple.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_Array1<AppParCurves_ConstraintCouple> directly instead.
|
||||
|
||||
#ifndef _AppParCurves_Array1OfConstraintCouple_hxx
|
||||
#define _AppParCurves_Array1OfConstraintCouple_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppParCurves_ConstraintCouple.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppParCurves_Array1OfConstraintCouple.hxx is deprecated since OCCT "
|
||||
"8.0.0. Use NCollection_Array1<AppParCurves_ConstraintCouple> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppParCurves_Array1OfConstraintCouple is deprecated, use "
|
||||
"NCollection_Array1<AppParCurves_ConstraintCouple> directly")
|
||||
typedef NCollection_Array1<AppParCurves_ConstraintCouple> AppParCurves_Array1OfConstraintCouple;
|
||||
|
||||
#endif // _AppParCurves_Array1OfConstraintCouple_hxx
|
||||
@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppParCurves_Array1OfMultiBSpCurve.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_Array1<AppParCurves_MultiBSpCurve> directly instead.
|
||||
|
||||
#ifndef _AppParCurves_Array1OfMultiBSpCurve_hxx
|
||||
#define _AppParCurves_Array1OfMultiBSpCurve_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppParCurves_Array1OfMultiBSpCurve.hxx is deprecated since OCCT 8.0.0. "
|
||||
"Use NCollection_Array1<AppParCurves_MultiBSpCurve> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppParCurves_Array1OfMultiBSpCurve is deprecated, use "
|
||||
"NCollection_Array1<AppParCurves_MultiBSpCurve> directly")
|
||||
typedef NCollection_Array1<AppParCurves_MultiBSpCurve> AppParCurves_Array1OfMultiBSpCurve;
|
||||
|
||||
#endif // _AppParCurves_Array1OfMultiBSpCurve_hxx
|
||||
@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppParCurves_Array1OfMultiCurve.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_Array1<AppParCurves_MultiCurve> directly instead.
|
||||
|
||||
#ifndef _AppParCurves_Array1OfMultiCurve_hxx
|
||||
#define _AppParCurves_Array1OfMultiCurve_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppParCurves_Array1OfMultiCurve.hxx is deprecated since OCCT 8.0.0. "
|
||||
"Use NCollection_Array1<AppParCurves_MultiCurve> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppParCurves_Array1OfMultiCurve is deprecated, use "
|
||||
"NCollection_Array1<AppParCurves_MultiCurve> directly")
|
||||
typedef NCollection_Array1<AppParCurves_MultiCurve> AppParCurves_Array1OfMultiCurve;
|
||||
|
||||
#endif // _AppParCurves_Array1OfMultiCurve_hxx
|
||||
@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppParCurves_Array1OfMultiPoint.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_Array1<AppParCurves_MultiPoint> directly instead.
|
||||
|
||||
#ifndef _AppParCurves_Array1OfMultiPoint_hxx
|
||||
#define _AppParCurves_Array1OfMultiPoint_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppParCurves_MultiPoint.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppParCurves_Array1OfMultiPoint.hxx is deprecated since OCCT 8.0.0. "
|
||||
"Use NCollection_Array1<AppParCurves_MultiPoint> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppParCurves_Array1OfMultiPoint is deprecated, use "
|
||||
"NCollection_Array1<AppParCurves_MultiPoint> directly")
|
||||
typedef NCollection_Array1<AppParCurves_MultiPoint> AppParCurves_Array1OfMultiPoint;
|
||||
|
||||
#endif // _AppParCurves_Array1OfMultiPoint_hxx
|
||||
@ -0,0 +1,58 @@
|
||||
// Created on: 1993-02-24
|
||||
// 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 _AppParCurves_ConstraintCouple_HeaderFile
|
||||
#define _AppParCurves_ConstraintCouple_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
|
||||
//! associates an index and a constraint for an object.
|
||||
//! This couple is used by AppDef_TheVariational when performing approximations.
|
||||
class AppParCurves_ConstraintCouple
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! returns an indefinite ConstraintCouple.
|
||||
Standard_EXPORT AppParCurves_ConstraintCouple();
|
||||
|
||||
//! Create a couple the object <Index> will have the
|
||||
//! constraint <Cons>.
|
||||
Standard_EXPORT AppParCurves_ConstraintCouple(const int TheIndex,
|
||||
const AppParCurves_Constraint Cons);
|
||||
|
||||
//! returns the index of the constraint object.
|
||||
Standard_EXPORT int Index() const;
|
||||
|
||||
//! returns the constraint of the object.
|
||||
Standard_EXPORT AppParCurves_Constraint Constraint() const;
|
||||
|
||||
//! Changes the index of the constraint object.
|
||||
Standard_EXPORT void SetIndex(const int TheIndex);
|
||||
|
||||
//! Changes the constraint of the object.
|
||||
Standard_EXPORT void SetConstraint(const AppParCurves_Constraint Cons);
|
||||
|
||||
private:
|
||||
int myIndex;
|
||||
AppParCurves_Constraint myConstraint;
|
||||
};
|
||||
|
||||
#endif // _AppParCurves_ConstraintCouple_HeaderFile
|
||||
@ -0,0 +1,34 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppParCurves_HArray1OfConstraintCouple.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_HArray1<AppParCurves_ConstraintCouple> directly instead.
|
||||
|
||||
#ifndef _AppParCurves_HArray1OfConstraintCouple_hxx
|
||||
#define _AppParCurves_HArray1OfConstraintCouple_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppParCurves_Array1OfConstraintCouple.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED(
|
||||
"AppParCurves_HArray1OfConstraintCouple.hxx is deprecated since OCCT 8.0.0. Use "
|
||||
"NCollection_HArray1<AppParCurves_ConstraintCouple> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppParCurves_HArray1OfConstraintCouple is deprecated, use "
|
||||
"NCollection_HArray1<AppParCurves_ConstraintCouple> directly")
|
||||
typedef NCollection_HArray1<AppParCurves_ConstraintCouple> AppParCurves_HArray1OfConstraintCouple;
|
||||
|
||||
#endif // _AppParCurves_HArray1OfConstraintCouple_hxx
|
||||
@ -0,0 +1,34 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppParCurves_HArray1OfMultiBSpCurve.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_HArray1<AppParCurves_MultiBSpCurve> directly instead.
|
||||
|
||||
#ifndef _AppParCurves_HArray1OfMultiBSpCurve_hxx
|
||||
#define _AppParCurves_HArray1OfMultiBSpCurve_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <AppParCurves_Array1OfMultiBSpCurve.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppParCurves_HArray1OfMultiBSpCurve.hxx is deprecated since OCCT "
|
||||
"8.0.0. Use NCollection_HArray1<AppParCurves_MultiBSpCurve> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppParCurves_HArray1OfMultiBSpCurve is deprecated, use "
|
||||
"NCollection_HArray1<AppParCurves_MultiBSpCurve> directly")
|
||||
typedef NCollection_HArray1<AppParCurves_MultiBSpCurve> AppParCurves_HArray1OfMultiBSpCurve;
|
||||
|
||||
#endif // _AppParCurves_HArray1OfMultiBSpCurve_hxx
|
||||
@ -0,0 +1,34 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppParCurves_HArray1OfMultiCurve.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_HArray1<AppParCurves_MultiCurve> directly instead.
|
||||
|
||||
#ifndef _AppParCurves_HArray1OfMultiCurve_hxx
|
||||
#define _AppParCurves_HArray1OfMultiCurve_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <AppParCurves_Array1OfMultiCurve.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppParCurves_HArray1OfMultiCurve.hxx is deprecated since OCCT 8.0.0. "
|
||||
"Use NCollection_HArray1<AppParCurves_MultiCurve> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppParCurves_HArray1OfMultiCurve is deprecated, use "
|
||||
"NCollection_HArray1<AppParCurves_MultiCurve> directly")
|
||||
typedef NCollection_HArray1<AppParCurves_MultiCurve> AppParCurves_HArray1OfMultiCurve;
|
||||
|
||||
#endif // _AppParCurves_HArray1OfMultiCurve_hxx
|
||||
@ -0,0 +1,34 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppParCurves_HArray1OfMultiPoint.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_HArray1<AppParCurves_MultiPoint> directly instead.
|
||||
|
||||
#ifndef _AppParCurves_HArray1OfMultiPoint_hxx
|
||||
#define _AppParCurves_HArray1OfMultiPoint_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppParCurves_MultiPoint.hxx>
|
||||
#include <AppParCurves_Array1OfMultiPoint.hxx>
|
||||
#include <NCollection_HArray1.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppParCurves_HArray1OfMultiPoint.hxx is deprecated since OCCT 8.0.0. "
|
||||
"Use NCollection_HArray1<AppParCurves_MultiPoint> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppParCurves_HArray1OfMultiPoint is deprecated, use "
|
||||
"NCollection_HArray1<AppParCurves_MultiPoint> directly")
|
||||
typedef NCollection_HArray1<AppParCurves_MultiPoint> AppParCurves_HArray1OfMultiPoint;
|
||||
|
||||
#endif // _AppParCurves_HArray1OfMultiPoint_hxx
|
||||
@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppParCurves_SequenceOfMultiBSpCurve.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_Sequence<AppParCurves_MultiBSpCurve> directly instead.
|
||||
|
||||
#ifndef _AppParCurves_SequenceOfMultiBSpCurve_hxx
|
||||
#define _AppParCurves_SequenceOfMultiBSpCurve_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppParCurves_MultiBSpCurve.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppParCurves_SequenceOfMultiBSpCurve.hxx is deprecated since OCCT "
|
||||
"8.0.0. Use NCollection_Sequence<AppParCurves_MultiBSpCurve> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppParCurves_SequenceOfMultiBSpCurve is deprecated, use "
|
||||
"NCollection_Sequence<AppParCurves_MultiBSpCurve> directly")
|
||||
typedef NCollection_Sequence<AppParCurves_MultiBSpCurve> AppParCurves_SequenceOfMultiBSpCurve;
|
||||
|
||||
#endif // _AppParCurves_SequenceOfMultiBSpCurve_hxx
|
||||
@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file AppParCurves_SequenceOfMultiCurve.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_Sequence<AppParCurves_MultiCurve> directly instead.
|
||||
|
||||
#ifndef _AppParCurves_SequenceOfMultiCurve_hxx
|
||||
#define _AppParCurves_SequenceOfMultiCurve_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AppParCurves_MultiCurve.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED("AppParCurves_SequenceOfMultiCurve.hxx is deprecated since OCCT 8.0.0. "
|
||||
"Use NCollection_Sequence<AppParCurves_MultiCurve> directly.")
|
||||
|
||||
Standard_DEPRECATED("AppParCurves_SequenceOfMultiCurve is deprecated, use "
|
||||
"NCollection_Sequence<AppParCurves_MultiCurve> directly")
|
||||
typedef NCollection_Sequence<AppParCurves_MultiCurve> AppParCurves_SequenceOfMultiCurve;
|
||||
|
||||
#endif // _AppParCurves_SequenceOfMultiCurve_hxx
|
||||
@ -0,0 +1,113 @@
|
||||
// Created on: 1997-08-22
|
||||
// Created by: Jeannine PANCIATICI, Sergey SOKOLOV
|
||||
// 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_CurvilinearParameter_HeaderFile
|
||||
#define _Approx_CurvilinearParameter_HeaderFile
|
||||
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
|
||||
//! Approximation of a Curve to make its parameter be its curvilinear abscissa.
|
||||
//! If the curve is a curve on a surface S, C2D is the corresponding Pcurve,
|
||||
//! we consider the curve is given by its representation
|
||||
//! @code
|
||||
//! S(C2D(u))
|
||||
//! @endcode
|
||||
//! If the curve is a curve on 2 surfaces S1 and S2 and C2D1 C2D2 are the two corresponding Pcurve,
|
||||
//! we consider the curve is given by its representation
|
||||
//! @code
|
||||
//! 1/2(S1(C2D1(u) + S2(C2D2(u)))
|
||||
//! @endcode
|
||||
class Approx_CurvilinearParameter
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! case of a free 3D curve
|
||||
Standard_EXPORT Approx_CurvilinearParameter(const occ::handle<Adaptor3d_Curve>& C3D,
|
||||
const double Tol,
|
||||
const GeomAbs_Shape Order,
|
||||
const int MaxDegree,
|
||||
const int MaxSegments);
|
||||
|
||||
//! case of a curve on one surface
|
||||
Standard_EXPORT Approx_CurvilinearParameter(const occ::handle<Adaptor2d_Curve2d>& C2D,
|
||||
const occ::handle<Adaptor3d_Surface>& Surf,
|
||||
const double Tol,
|
||||
const GeomAbs_Shape Order,
|
||||
const int MaxDegree,
|
||||
const int MaxSegments);
|
||||
|
||||
//! case of a curve on two surfaces
|
||||
Standard_EXPORT Approx_CurvilinearParameter(const occ::handle<Adaptor2d_Curve2d>& C2D1,
|
||||
const occ::handle<Adaptor3d_Surface>& Surf1,
|
||||
const occ::handle<Adaptor2d_Curve2d>& C2D2,
|
||||
const occ::handle<Adaptor3d_Surface>& Surf2,
|
||||
const double Tol,
|
||||
const GeomAbs_Shape Order,
|
||||
const int MaxDegree,
|
||||
const int MaxSegments);
|
||||
|
||||
Standard_EXPORT bool IsDone() const;
|
||||
|
||||
Standard_EXPORT bool HasResult() const;
|
||||
|
||||
//! returns the Bspline curve corresponding to the reparametrized 3D curve
|
||||
Standard_EXPORT occ::handle<Geom_BSplineCurve> Curve3d() const;
|
||||
|
||||
//! returns the maximum error on the reparametrized 3D curve
|
||||
Standard_EXPORT double MaxError3d() const;
|
||||
|
||||
//! returns the BsplineCurve representing the reparametrized 2D curve on the
|
||||
//! first surface (case of a curve on one or two surfaces)
|
||||
Standard_EXPORT occ::handle<Geom2d_BSplineCurve> Curve2d1() const;
|
||||
|
||||
//! returns the maximum error on the first reparametrized 2D curve
|
||||
Standard_EXPORT double MaxError2d1() const;
|
||||
|
||||
//! returns the BsplineCurve representing the reparametrized 2D curve on the
|
||||
//! second surface (case of a curve on two surfaces)
|
||||
Standard_EXPORT occ::handle<Geom2d_BSplineCurve> Curve2d2() const;
|
||||
|
||||
//! returns the maximum error on the second reparametrized 2D curve
|
||||
Standard_EXPORT double MaxError2d2() const;
|
||||
|
||||
//! print the maximum errors(s)
|
||||
Standard_EXPORT void Dump(Standard_OStream& o) const;
|
||||
|
||||
private:
|
||||
Standard_EXPORT static void ToleranceComputation(const occ::handle<Adaptor2d_Curve2d>& C2D,
|
||||
const occ::handle<Adaptor3d_Surface>& S,
|
||||
const int MaxNumber,
|
||||
const double Tol,
|
||||
double& TolV,
|
||||
double& TolW);
|
||||
|
||||
private:
|
||||
int myCase;
|
||||
bool myDone;
|
||||
bool myHasResult;
|
||||
occ::handle<Geom_BSplineCurve> myCurve3d;
|
||||
double myMaxError3d;
|
||||
occ::handle<Geom2d_BSplineCurve> myCurve2d1;
|
||||
double myMaxError2d1;
|
||||
occ::handle<Geom2d_BSplineCurve> myCurve2d2;
|
||||
double myMaxError2d2;
|
||||
};
|
||||
|
||||
#endif // _Approx_CurvilinearParameter_HeaderFile
|
||||
@ -0,0 +1,28 @@
|
||||
// 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_ParametrizationType_HeaderFile
|
||||
#define _Approx_ParametrizationType_HeaderFile
|
||||
|
||||
enum Approx_ParametrizationType
|
||||
{
|
||||
Approx_ChordLength, //!< parameters of points are proportionate to distances between them
|
||||
Approx_Centripetal, //!< parameters of points are proportionate to square roots of distances
|
||||
//!< between them
|
||||
Approx_IsoParametric //!< parameters of points are distributed uniformly
|
||||
};
|
||||
|
||||
#endif // _Approx_ParametrizationType_HeaderFile
|
||||
@ -0,0 +1,36 @@
|
||||
// Copyright (c) 2025 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.
|
||||
|
||||
//! @file Approx_SequenceOfHArray1OfReal.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_Sequence<opencascade::handle<TColStd_HArray1OfReal>> directly
|
||||
//! instead.
|
||||
|
||||
#ifndef _Approx_SequenceOfHArray1OfReal_hxx
|
||||
#define _Approx_SequenceOfHArray1OfReal_hxx
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED(
|
||||
"Approx_SequenceOfHArray1OfReal.hxx is deprecated since OCCT 8.0.0. Use "
|
||||
"NCollection_Sequence<opencascade::handle<TColStd_HArray1OfReal>> directly.")
|
||||
|
||||
Standard_DEPRECATED("Approx_SequenceOfHArray1OfReal is deprecated, use "
|
||||
"NCollection_Sequence<opencascade::handle<TColStd_HArray1OfReal>> directly")
|
||||
typedef NCollection_Sequence<opencascade::handle<TColStd_HArray1OfReal>>
|
||||
Approx_SequenceOfHArray1OfReal;
|
||||
|
||||
#endif // _Approx_SequenceOfHArray1OfReal_hxx
|
||||
@ -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_AspectFillAreaDefinitionError_HeaderFile
|
||||
#define _Aspect_AspectFillAreaDefinitionError_HeaderFile
|
||||
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
#if !defined No_Exception && !defined No_Aspect_AspectFillAreaDefinitionError
|
||||
#define Aspect_AspectFillAreaDefinitionError_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) \
|
||||
throw Aspect_AspectFillAreaDefinitionError(MESSAGE);
|
||||
#else
|
||||
#define Aspect_AspectFillAreaDefinitionError_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Aspect_AspectFillAreaDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#endif // _Aspect_AspectFillAreaDefinitionError_HeaderFile
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user