1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,2 +1,19 @@
ShapeProcess.cxx
ShapeProcess.hxx
ShapeProcess_Context.cxx
ShapeProcess_Context.hxx
ShapeProcess_DictionaryOfOperator.hxx
ShapeProcess_DictionaryOfOperator_0.cxx
ShapeProcess_IteratorOfDictionaryOfOperator.hxx
ShapeProcess_IteratorOfDictionaryOfOperator_0.cxx
ShapeProcess_Operator.cxx
ShapeProcess_Operator.hxx
ShapeProcess_OperFunc.hxx
ShapeProcess_OperLibrary.cxx
ShapeProcess_OperLibrary.hxx
ShapeProcess_ShapeContext.cxx
ShapeProcess_ShapeContext.hxx
ShapeProcess_StackItemOfDictionaryOfOperator.hxx
ShapeProcess_StackItemOfDictionaryOfOperator_0.cxx
ShapeProcess_UOperator.cxx
ShapeProcess_UOperator.hxx

View File

@@ -1,70 +0,0 @@
-- Created on: 2000-08-21
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
package ShapeProcess
---Purpose: Shape Processing module
-- allows to define and apply general Shape Processing as a
-- customizable sequence of Shape Healing operators. The
-- customization is implemented via user-editable resource
-- file which defines sequence of operators to be executed
-- and their parameters.
uses
Dico,
Resource,
TCollection,
TColStd,
GeomAbs,
TopAbs,
TopoDS,
TopTools,
BRepTools,
Message,
ShapeExtend,
ShapeBuild
is
class Context;
class ShapeContext;
deferred class Operator;
primitive OperFunc;
class UOperator;
class OperLibrary;
class DictionaryOfOperator instantiates
Dictionary from Dico (Operator from ShapeProcess);
RegisterOperator (name: CString; op: Operator from ShapeProcess)
returns Boolean;
---Purpose: Registers operator to make it visible for Performer
FindOperator (name: CString; op: out Operator from ShapeProcess)
returns Boolean;
---Purpose: Finds operator by its name
Perform (context: Context from ShapeProcess; seq: CString)
returns Boolean;
---Purpose: Performs a specified sequence of operators on Context
-- Resource file and other data should be already loaded
-- to Context (including description of sequence seq)
end ShapeProcess;

View File

@@ -13,19 +13,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ShapeProcess.ixx>
#include <Message_Messenger.hxx>
#include <Message_Msg.hxx>
#include <ShapeProcess.hxx>
#include <ShapeProcess_Context.hxx>
#include <ShapeProcess_DictionaryOfOperator.hxx>
#include <ShapeProcess_Operator.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <Message_Msg.hxx>
#include <Message_Messenger.hxx>
#include <ShapeProcess_Operator.hxx>
#include <ShapeProcess_DictionaryOfOperator.hxx>
static Handle(ShapeProcess_DictionaryOfOperator) dic;
//=======================================================================

View File

@@ -0,0 +1,92 @@
// Created on: 2000-08-21
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ShapeProcess_HeaderFile
#define _ShapeProcess_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
class ShapeProcess_Operator;
class ShapeProcess_Context;
class ShapeProcess_Context;
class ShapeProcess_ShapeContext;
class ShapeProcess_Operator;
class ShapeProcess_UOperator;
class ShapeProcess_OperLibrary;
class ShapeProcess_DictionaryOfOperator;
class ShapeProcess_IteratorOfDictionaryOfOperator;
class ShapeProcess_StackItemOfDictionaryOfOperator;
//! Shape Processing module
//! allows to define and apply general Shape Processing as a
//! customizable sequence of Shape Healing operators. The
//! customization is implemented via user-editable resource
//! file which defines sequence of operators to be executed
//! and their parameters.
class ShapeProcess
{
public:
DEFINE_STANDARD_ALLOC
//! Registers operator to make it visible for Performer
Standard_EXPORT static Standard_Boolean RegisterOperator (const Standard_CString name, const Handle(ShapeProcess_Operator)& op);
//! Finds operator by its name
Standard_EXPORT static Standard_Boolean FindOperator (const Standard_CString name, Handle(ShapeProcess_Operator)& op);
//! Performs a specified sequence of operators on Context
//! Resource file and other data should be already loaded
//! to Context (including description of sequence seq)
Standard_EXPORT static Standard_Boolean Perform (const Handle(ShapeProcess_Context)& context, const Standard_CString seq);
protected:
private:
friend class ShapeProcess_Context;
friend class ShapeProcess_ShapeContext;
friend class ShapeProcess_Operator;
friend class ShapeProcess_UOperator;
friend class ShapeProcess_OperLibrary;
friend class ShapeProcess_DictionaryOfOperator;
friend class ShapeProcess_IteratorOfDictionaryOfOperator;
friend class ShapeProcess_StackItemOfDictionaryOfOperator;
};
#endif // _ShapeProcess_HeaderFile

View File

@@ -1,113 +0,0 @@
-- Created on: 2000-08-21
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Context from ShapeProcess inherits TShared from MMgt
---Purpose: Provides convenient interface to resource file
-- Allows to load resource file and get values of
-- attributes starting from some scope, for example
-- if scope is defined as "ToV4" and requested parameter
-- is "exec.op", value of "ToV4.exec.op" parameter from
-- the resource file will be returned
uses
Manager from Resource,
AsciiString from TCollection,
HSequenceOfHAsciiString from TColStd,
Messenger from Message,
ProgressIndicator from Message
is
Create;
---Purpose: Creates an empty tool
Create (file: CString; scope: CString = "");
---Purpose: Creates a new tool and initialises by name of
-- resource file and (if specified) starting scope
-- Calls method Init()
Init (me: mutable; file: CString; scope: CString = "")
returns Boolean;
---Purpose: Initialises a tool by loading resource file and
-- (if specified) sets starting scope
-- Returns False if resource file not found
LoadResourceManager(me: mutable; file: CString) returns Manager from Resource;
---Purpose: Loading Resource_Manager object if this object not
-- equal internal static Resource_Manager object or
-- internal static Resource_Manager object is null
ResourceManager (me) returns Manager from Resource;
---Purpose: Returns internal Resource_Manager object
---C++: return const &
SetScope (me: mutable; scope: CString);
---Purpose: Set a new (sub)scope
UnSetScope (me: mutable);
---Purpose: Go out of current scope
IsParamSet (me; param: CString) returns Boolean;
---Purpose: Returns True if parameter is defined in the resource file
GetReal (me; param: CString; val: out Real ) returns Boolean;
GetInteger (me; param: CString; val: out Integer) returns Boolean;
GetBoolean (me; param: CString; val: out Boolean) returns Boolean;
GetString (me; param: CString; val: out AsciiString from TCollection) returns Boolean;
---Purpose: Get value of parameter as being of specific type
-- Returns False if parameter is not defined or has a wrong type
RealVal (me; param: CString; def: Real ) returns Real;
IntegerVal (me; param: CString; def: Integer) returns Integer;
BooleanVal (me; param: CString; def: Boolean) returns Boolean;
StringVal (me; param: CString; def: CString) returns CString;
---Purpose: Get value of parameter as being of specific type
-- If parameter is not defined or does not have expected
-- type, returns default value as specified
SetMessenger (me: mutable; messenger: Messenger from Message);
---Purpose : Sets Messenger used for outputting messages.
Messenger (me) returns Messenger from Message;
---Purpose : Returns Messenger used for outputting messages.
SetProgress (me: mutable; theProgress: ProgressIndicator from Message);
---Purpose : Sets Progress Indicator.
Progress (me) returns ProgressIndicator from Message;
---Purpose : Returns Progress Indicator.
SetTraceLevel (me: mutable; tracelev: Integer);
---Purpose : Sets trace level used for outputting messages
-- - 0: no trace at all
-- - 1: errors
-- - 2: errors and warnings
-- - 3: all messages
-- Default is 1 : Errors traced
TraceLevel (me) returns Integer;
---Purpose : Returns trace level used for outputting messages.
fields
myRC: Manager from Resource;
myScope: HSequenceOfHAsciiString from TColStd;
myMessenger: Messenger from Message;
myProgress: ProgressIndicator from Message;
myTraceLev: Integer;
end Context;

View File

@@ -13,20 +13,23 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ShapeProcess_Context.ixx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Resource_Manager.hxx>
#include <ShapeProcess_Context.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <Message_Messenger.hxx>
#include <Message.hxx>
#include <sys/stat.h>
#include <sys/stat.h>
//=======================================================================
//function : ShapeProcess_Context
//purpose :
//=======================================================================
ShapeProcess_Context::ShapeProcess_Context()
{
myMessenger = Message::DefaultMessenger();
@@ -434,4 +437,4 @@ void ShapeProcess_Context::SetTraceLevel (const Standard_Integer tracelev)
Standard_Integer ShapeProcess_Context::TraceLevel () const
{
return myTraceLev;
}
}

View File

@@ -0,0 +1,151 @@
// Created on: 2000-08-21
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ShapeProcess_Context_HeaderFile
#define _ShapeProcess_Context_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <Standard_Integer.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_CString.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
class Resource_Manager;
class Message_Messenger;
class Message_ProgressIndicator;
class TCollection_AsciiString;
class ShapeProcess_Context;
DEFINE_STANDARD_HANDLE(ShapeProcess_Context, MMgt_TShared)
//! Provides convenient interface to resource file
//! Allows to load resource file and get values of
//! attributes starting from some scope, for example
//! if scope is defined as "ToV4" and requested parameter
//! is "exec.op", value of "ToV4.exec.op" parameter from
//! the resource file will be returned
class ShapeProcess_Context : public MMgt_TShared
{
public:
//! Creates an empty tool
Standard_EXPORT ShapeProcess_Context();
//! Creates a new tool and initialises by name of
//! resource file and (if specified) starting scope
//! Calls method Init()
Standard_EXPORT ShapeProcess_Context(const Standard_CString file, const Standard_CString scope = "");
//! Initialises a tool by loading resource file and
//! (if specified) sets starting scope
//! Returns False if resource file not found
Standard_EXPORT Standard_Boolean Init (const Standard_CString file, const Standard_CString scope = "");
//! Loading Resource_Manager object if this object not
//! equal internal static Resource_Manager object or
//! internal static Resource_Manager object is null
Standard_EXPORT Handle(Resource_Manager) LoadResourceManager (const Standard_CString file);
//! Returns internal Resource_Manager object
Standard_EXPORT const Handle(Resource_Manager)& ResourceManager() const;
//! Set a new (sub)scope
Standard_EXPORT void SetScope (const Standard_CString scope);
//! Go out of current scope
Standard_EXPORT void UnSetScope();
//! Returns True if parameter is defined in the resource file
Standard_EXPORT Standard_Boolean IsParamSet (const Standard_CString param) const;
Standard_EXPORT Standard_Boolean GetReal (const Standard_CString param, Standard_Real& val) const;
Standard_EXPORT Standard_Boolean GetInteger (const Standard_CString param, Standard_Integer& val) const;
Standard_EXPORT Standard_Boolean GetBoolean (const Standard_CString param, Standard_Boolean& val) const;
//! Get value of parameter as being of specific type
//! Returns False if parameter is not defined or has a wrong type
Standard_EXPORT Standard_Boolean GetString (const Standard_CString param, TCollection_AsciiString& val) const;
Standard_EXPORT Standard_Real RealVal (const Standard_CString param, const Standard_Real def) const;
Standard_EXPORT Standard_Integer IntegerVal (const Standard_CString param, const Standard_Integer def) const;
Standard_EXPORT Standard_Boolean BooleanVal (const Standard_CString param, const Standard_Boolean def) const;
//! Get value of parameter as being of specific type
//! If parameter is not defined or does not have expected
//! type, returns default value as specified
Standard_EXPORT Standard_CString StringVal (const Standard_CString param, const Standard_CString def) const;
//! Sets Messenger used for outputting messages.
Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger);
//! Returns Messenger used for outputting messages.
Standard_EXPORT Handle(Message_Messenger) Messenger() const;
//! Sets Progress Indicator.
Standard_EXPORT void SetProgress (const Handle(Message_ProgressIndicator)& theProgress);
//! Returns Progress Indicator.
Standard_EXPORT Handle(Message_ProgressIndicator) Progress() const;
//! Sets trace level used for outputting messages
//! - 0: no trace at all
//! - 1: errors
//! - 2: errors and warnings
//! - 3: all messages
//! Default is 1 : Errors traced
Standard_EXPORT void SetTraceLevel (const Standard_Integer tracelev);
//! Returns trace level used for outputting messages.
Standard_EXPORT Standard_Integer TraceLevel() const;
DEFINE_STANDARD_RTTI(ShapeProcess_Context,MMgt_TShared)
protected:
private:
Handle(Resource_Manager) myRC;
Handle(TColStd_HSequenceOfHAsciiString) myScope;
Handle(Message_Messenger) myMessenger;
Handle(Message_ProgressIndicator) myProgress;
Standard_Integer myTraceLev;
};
#endif // _ShapeProcess_Context_HeaderFile

View File

@@ -0,0 +1,143 @@
// Created on: 2000-08-21
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ShapeProcess_DictionaryOfOperator_HeaderFile
#define _ShapeProcess_DictionaryOfOperator_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Character.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <Standard_Size.hxx>
#include <Standard_Integer.hxx>
class ShapeProcess_Operator;
class Standard_NoSuchObject;
class ShapeProcess_IteratorOfDictionaryOfOperator;
class ShapeProcess_StackItemOfDictionaryOfOperator;
class TCollection_AsciiString;
class ShapeProcess_DictionaryOfOperator;
DEFINE_STANDARD_HANDLE(ShapeProcess_DictionaryOfOperator, MMgt_TShared)
class ShapeProcess_DictionaryOfOperator : public MMgt_TShared
{
public:
Standard_EXPORT ShapeProcess_DictionaryOfOperator();
Standard_EXPORT Standard_Boolean HasItem (const Standard_CString name, const Standard_Boolean exact = Standard_False) const;
Standard_EXPORT Standard_Boolean HasItem (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const;
Standard_EXPORT const Handle(ShapeProcess_Operator)& Item (const Standard_CString name, const Standard_Boolean exact = Standard_True) const;
Standard_EXPORT const Handle(ShapeProcess_Operator)& Item (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const;
Standard_EXPORT Standard_Boolean GetItem (const Standard_CString name, Handle(ShapeProcess_Operator)& anitem, const Standard_Boolean exact = Standard_True) const;
Standard_EXPORT Standard_Boolean GetItem (const TCollection_AsciiString& name, Handle(ShapeProcess_Operator)& anitem, const Standard_Boolean exact = Standard_True) const;
Standard_EXPORT void SetItem (const Standard_CString name, const Handle(ShapeProcess_Operator)& anitem, const Standard_Boolean exact = Standard_True);
Standard_EXPORT void SetItem (const TCollection_AsciiString& name, const Handle(ShapeProcess_Operator)& anitem, const Standard_Boolean exact = Standard_True);
Standard_EXPORT Handle(ShapeProcess_Operator)& NewItem (const Standard_CString name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True);
Standard_EXPORT Handle(ShapeProcess_Operator)& NewItem (const TCollection_AsciiString& name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True);
Standard_EXPORT Standard_Boolean RemoveItem (const Standard_CString name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True);
Standard_EXPORT Standard_Boolean RemoveItem (const TCollection_AsciiString& name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True);
Standard_EXPORT void Clean();
Standard_EXPORT Standard_Boolean IsEmpty() const;
Standard_EXPORT void Clear();
Standard_EXPORT Handle(ShapeProcess_DictionaryOfOperator) Copy() const;
Standard_EXPORT Standard_Boolean Complete (Handle(ShapeProcess_DictionaryOfOperator)& acell) const;
friend class ShapeProcess_IteratorOfDictionaryOfOperator;
DEFINE_STANDARD_RTTI(ShapeProcess_DictionaryOfOperator,MMgt_TShared)
protected:
private:
Standard_EXPORT void SetChar (const Standard_Character car);
Standard_EXPORT Standard_Boolean HasSub() const;
Standard_EXPORT Handle(ShapeProcess_DictionaryOfOperator) Sub() const;
Standard_EXPORT Standard_Boolean HasNext() const;
Standard_EXPORT Handle(ShapeProcess_DictionaryOfOperator) Next() const;
Standard_EXPORT void SetSub (const Handle(ShapeProcess_DictionaryOfOperator)& acell);
Standard_EXPORT void SetNext (const Handle(ShapeProcess_DictionaryOfOperator)& acell);
Standard_EXPORT void SearchCell (const Standard_CString name, const Standard_Size lmax, const Standard_Character car, const Standard_Size level, Handle(ShapeProcess_DictionaryOfOperator)& acell, Standard_Size& reslev, Standard_Integer& stat) const;
Standard_EXPORT void NewCell (const Standard_CString name, const Standard_Size namlen, Handle(ShapeProcess_DictionaryOfOperator)& acell, const Standard_Size reslev, const Standard_Integer stat);
Standard_EXPORT Standard_Boolean HasIt() const;
Standard_EXPORT const Handle(ShapeProcess_Operator)& It() const;
Standard_EXPORT Handle(ShapeProcess_Operator)& ItAdr();
Standard_EXPORT void SetIt (const Handle(ShapeProcess_Operator)& anitem);
Standard_EXPORT void DeclIt();
Standard_EXPORT void RemoveIt();
Standard_EXPORT Standard_Character CellChar() const;
Standard_EXPORT void GetCopied (const Handle(ShapeProcess_DictionaryOfOperator)& fromcell);
Standard_Character thecars[4];
Handle(ShapeProcess_DictionaryOfOperator) thesub;
Handle(ShapeProcess_DictionaryOfOperator) thenext;
Handle(ShapeProcess_Operator) theitem;
};
#endif // _ShapeProcess_DictionaryOfOperator_HeaderFile

View File

@@ -0,0 +1,47 @@
// Created on: 2000-08-21
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ShapeProcess_DictionaryOfOperator.hxx>
#include <Standard_Type.hxx>
#include <ShapeProcess_DictionaryOfOperator.hxx>
#include <ShapeProcess_Operator.hxx>
#include <Standard_NoSuchObject.hxx>
#include <ShapeProcess_IteratorOfDictionaryOfOperator.hxx>
#include <ShapeProcess_StackItemOfDictionaryOfOperator.hxx>
#include <TCollection_AsciiString.hxx>
#define TheItem Handle(ShapeProcess_Operator)
#define TheItem_hxx <ShapeProcess_Operator.hxx>
#define Dico_Iterator ShapeProcess_IteratorOfDictionaryOfOperator
#define Dico_Iterator_hxx <ShapeProcess_IteratorOfDictionaryOfOperator.hxx>
#define Dico_StackItem ShapeProcess_StackItemOfDictionaryOfOperator
#define Dico_StackItem_hxx <ShapeProcess_StackItemOfDictionaryOfOperator.hxx>
#define Handle_Dico_StackItem Handle(ShapeProcess_StackItemOfDictionaryOfOperator)
#define Dico_Dictionary ShapeProcess_DictionaryOfOperator
#define Dico_Dictionary_hxx <ShapeProcess_DictionaryOfOperator.hxx>
#define Handle_Dico_Dictionary Handle(ShapeProcess_DictionaryOfOperator)
#include <Dico_Dictionary.gxx>

View File

@@ -0,0 +1,90 @@
// Created on: 2000-08-21
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ShapeProcess_IteratorOfDictionaryOfOperator_HeaderFile
#define _ShapeProcess_IteratorOfDictionaryOfOperator_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TCollection_AsciiString.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
class ShapeProcess_DictionaryOfOperator;
class ShapeProcess_StackItemOfDictionaryOfOperator;
class Standard_NoSuchObject;
class ShapeProcess_Operator;
class TCollection_AsciiString;
class ShapeProcess_IteratorOfDictionaryOfOperator
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT ShapeProcess_IteratorOfDictionaryOfOperator(const Handle(ShapeProcess_DictionaryOfOperator)& acell);
Standard_EXPORT ShapeProcess_IteratorOfDictionaryOfOperator(const Handle(ShapeProcess_DictionaryOfOperator)& acell, const Standard_CString basename);
Standard_EXPORT ShapeProcess_IteratorOfDictionaryOfOperator(const Handle(ShapeProcess_DictionaryOfOperator)& acell, const TCollection_AsciiString& basename);
Standard_EXPORT void Start();
Standard_EXPORT Standard_Boolean More();
Standard_EXPORT void Next();
Standard_EXPORT const Handle(ShapeProcess_Operator)& Value() const;
Standard_EXPORT TCollection_AsciiString Name() const;
protected:
private:
Standard_EXPORT void AppendStack (const Handle(ShapeProcess_DictionaryOfOperator)& val);
Handle(ShapeProcess_DictionaryOfOperator) thebase;
TCollection_AsciiString thename;
Handle(ShapeProcess_StackItemOfDictionaryOfOperator) thelast;
Standard_Integer thenb;
Standard_Boolean themore;
Standard_Boolean theinit;
Standard_Boolean thenext;
};
#endif // _ShapeProcess_IteratorOfDictionaryOfOperator_HeaderFile

View File

@@ -0,0 +1,36 @@
// Created on: 2000-08-21
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ShapeProcess_IteratorOfDictionaryOfOperator.hxx>
#include <ShapeProcess_DictionaryOfOperator.hxx>
#include <ShapeProcess_StackItemOfDictionaryOfOperator.hxx>
#include <Standard_NoSuchObject.hxx>
#include <ShapeProcess_Operator.hxx>
#include <TCollection_AsciiString.hxx>
#define TheItem Handle(ShapeProcess_Operator)
#define TheItem_hxx <ShapeProcess_Operator.hxx>
#define Dico_Iterator ShapeProcess_IteratorOfDictionaryOfOperator
#define Dico_Iterator_hxx <ShapeProcess_IteratorOfDictionaryOfOperator.hxx>
#define Dico_StackItem ShapeProcess_StackItemOfDictionaryOfOperator
#define Dico_StackItem_hxx <ShapeProcess_StackItemOfDictionaryOfOperator.hxx>
#define Handle_Dico_StackItem Handle(ShapeProcess_StackItemOfDictionaryOfOperator)
#define Dico_Dictionary ShapeProcess_DictionaryOfOperator
#define Dico_Dictionary_hxx <ShapeProcess_DictionaryOfOperator.hxx>
#define Handle_Dico_Dictionary Handle(ShapeProcess_DictionaryOfOperator)
#include <Dico_Iterator.gxx>

View File

@@ -1,60 +0,0 @@
-- Created on: 2000-08-31
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class OperLibrary from ShapeProcess
---Purpose: Provides a set of following operators
--
-- DirectFaces
-- FixShape
-- SameParameter
-- SetTolerance
-- SplitAngle
-- BSplineRestriction
-- ElementaryToRevolution
-- SurfaceToBSpline
-- ToBezier
-- SplitContinuity
-- SplitClosedFaces
-- FixWireGaps
-- FixFaceSize
-- DropSmallEdges
-- FixShape
-- SplitClosedEdges
uses
Shape from TopoDS,
UOperator from ShapeProcess,
ShapeContext from ShapeProcess,
Modification from BRepTools,
DataMapOfShapeShape from TopTools,
MsgRegistrator from ShapeExtend
is
Init (myclass);
---Purpose: Registers all the operators
ApplyModifier (myclass; S: Shape from TopoDS;
context: ShapeContext from ShapeProcess;
M: Modification from BRepTools;
map: in out DataMapOfShapeShape from TopTools;
msg : MsgRegistrator from ShapeExtend=0)
---Purpose: Applies BRepTools_Modification to a shape,
-- taking into account sharing of components of compounds.
returns Shape from TopoDS;
end OperLibrary;

View File

@@ -13,57 +13,50 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ShapeProcess_OperLibrary.ixx>
#include <Precision.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <BRep_Builder.hxx>
#include <BRepLib.hxx>
#include <BRepTools_Modification.hxx>
#include <BRepTools_Modifier.hxx>
#include <Message_MsgFile.hxx>
#include <Message_ProgressIndicator.hxx>
#include <ShapeExtend_MsgRegistrator.hxx>
#include <ShapeProcess.hxx>
#include <ShapeProcess_UOperator.hxx>
#include <ShapeProcess_ShapeContext.hxx>
#include <BRepTools_Modifier.hxx>
#include <BRepTools_Modification.hxx>
#include <Precision.hxx>
#include <ShapeBuild_ReShape.hxx>
#include <ShapeCustom_BSplineRestriction.hxx>
#include <ShapeCustom_ConvertToBSpline.hxx>
#include <ShapeCustom_ConvertToRevolution.hxx>
#include <ShapeCustom_DirectModification.hxx>
#include <ShapeCustom_RestrictionParameters.hxx>
#include <ShapeCustom_BSplineRestriction.hxx>
#include <ShapeCustom_ConvertToRevolution.hxx>
#include <ShapeCustom_SweptToElementary.hxx>
#include <ShapeCustom_ConvertToBSpline.hxx>
#include <ShapeExtend.hxx>
#include <ShapeBuild_ReShape.hxx>
#include <ShapeUpgrade_ShapeDivideAngle.hxx>
#include <ShapeUpgrade_ShapeConvertToBezier.hxx>
#include <ShapeUpgrade_ShapeDivideContinuity.hxx>
#include <ShapeUpgrade_ShapeDivideClosed.hxx>
#include <ShapeUpgrade_ShapeDivideClosedEdges.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <ShapeFix_Shape.hxx>
#include <ShapeExtend_MsgRegistrator.hxx>
#include <ShapeFix.hxx>
#include <ShapeFix_Face.hxx>
#include <ShapeFix_Wire.hxx>
#include <ShapeFix_FixSmallFace.hxx>
#include <ShapeFix_FixSmallSolid.hxx>
#include <ShapeFix_Wireframe.hxx>
#include <ShapeFix.hxx>
#include <ShapeFix_Shape.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <ShapeFix_SplitCommonVertex.hxx>
#include <ShapeFix_Wire.hxx>
#include <ShapeFix_Wireframe.hxx>
#include <ShapeProcess.hxx>
#include <ShapeProcess_OperLibrary.hxx>
#include <ShapeProcess_ShapeContext.hxx>
#include <ShapeProcess_UOperator.hxx>
#include <ShapeUpgrade_ShapeConvertToBezier.hxx>
#include <ShapeUpgrade_ShapeDivideAngle.hxx>
#include <ShapeUpgrade_ShapeDivideClosed.hxx>
#include <ShapeUpgrade_ShapeDivideClosedEdges.hxx>
#include <ShapeUpgrade_ShapeDivideContinuity.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : ApplyModifier
//purpose : Applies BRepTools_Modification to a shape,
// taking into account sharing of components of compounds
//=======================================================================
TopoDS_Shape ShapeProcess_OperLibrary::ApplyModifier (const TopoDS_Shape &S,
const Handle(ShapeProcess_ShapeContext)& context,
const Handle(BRepTools_Modification) &M,

View File

@@ -0,0 +1,85 @@
// Created on: 2000-08-31
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ShapeProcess_OperLibrary_HeaderFile
#define _ShapeProcess_OperLibrary_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
class TopoDS_Shape;
class ShapeProcess_ShapeContext;
class BRepTools_Modification;
class ShapeExtend_MsgRegistrator;
//! Provides a set of following operators
//!
//! DirectFaces
//! FixShape
//! SameParameter
//! SetTolerance
//! SplitAngle
//! BSplineRestriction
//! ElementaryToRevolution
//! SurfaceToBSpline
//! ToBezier
//! SplitContinuity
//! SplitClosedFaces
//! FixWireGaps
//! FixFaceSize
//! DropSmallEdges
//! FixShape
//! SplitClosedEdges
class ShapeProcess_OperLibrary
{
public:
DEFINE_STANDARD_ALLOC
//! Registers all the operators
Standard_EXPORT static void Init();
//! Applies BRepTools_Modification to a shape,
//! taking into account sharing of components of compounds.
Standard_EXPORT static TopoDS_Shape ApplyModifier (const TopoDS_Shape& S, const Handle(ShapeProcess_ShapeContext)& context, const Handle(BRepTools_Modification)& M, TopTools_DataMapOfShapeShape& map, const Handle(ShapeExtend_MsgRegistrator)& msg = 0);
protected:
private:
};
#endif // _ShapeProcess_OperLibrary_HeaderFile

View File

@@ -1,32 +0,0 @@
-- Created on: 2000-08-22
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
deferred class Operator from ShapeProcess inherits TShared from MMgt
---Purpose: Abstract Operator class providing a tool to
-- perform an operation on Context
uses
Context from ShapeProcess
is
Perform (me: mutable; context: Context from ShapeProcess)
returns Boolean is deferred;
---Purpose: Performs operation and eventually records
-- changes in the context
end Operator;

View File

@@ -13,4 +13,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ShapeProcess_Operator.ixx>
#include <ShapeProcess_Context.hxx>
#include <ShapeProcess_Operator.hxx>
#include <Standard_Type.hxx>

View File

@@ -0,0 +1,65 @@
// Created on: 2000-08-22
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ShapeProcess_Operator_HeaderFile
#define _ShapeProcess_Operator_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Boolean.hxx>
class ShapeProcess_Context;
class ShapeProcess_Operator;
DEFINE_STANDARD_HANDLE(ShapeProcess_Operator, MMgt_TShared)
//! Abstract Operator class providing a tool to
//! perform an operation on Context
class ShapeProcess_Operator : public MMgt_TShared
{
public:
//! Performs operation and eventually records
//! changes in the context
Standard_EXPORT virtual Standard_Boolean Perform (const Handle(ShapeProcess_Context)& context) = 0;
DEFINE_STANDARD_RTTI(ShapeProcess_Operator,MMgt_TShared)
protected:
private:
};
#endif // _ShapeProcess_Operator_HeaderFile

View File

@@ -1,135 +0,0 @@
-- Created on: 2000-08-22
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class ShapeContext from ShapeProcess inherits Context from ShapeProcess
---Purpose: Extends Context to handle shapes
-- Contains map of shape-shape, and messages
-- attached to shapes
uses
Shape from GeomAbs,
Shape from TopoDS,
ShapeEnum from TopAbs,
DataMapOfShapeShape from TopTools,
Modifier from BRepTools,
ReShape from ShapeBuild,
Msg from Message,
Gravity from Message,
MsgRegistrator from ShapeExtend,
Printer from Message
is
Create (file: CString; seq: CString = "");
Create (S: Shape from TopoDS; file: CString; seq: CString = "");
---Purpose: Initializes a tool by resource file and shape
-- to be processed
Init (me: mutable; S: Shape from TopoDS);
---Purpose: Initializes tool by a new shape and clears all results
Shape (me) returns Shape from TopoDS;
---Purpose: Returns shape being processed
---C++: return const &
Result (me) returns Shape from TopoDS;
---Purpose: Returns current result
---C++: return const &
Map (me) returns DataMapOfShapeShape from TopTools;
---Purpose: Returns map of replacements shape -> shape
-- This map is not recursive
---C++: return const &
Messages (me) returns MsgRegistrator from ShapeExtend;
---C++: return const &
Messages (me: mutable) returns MsgRegistrator from ShapeExtend;
---C++: return &
---Purpose: Returns messages recorded during shape processing
-- It can be nullified before processing in order to
-- avoid recording messages
SetDetalisation (me: mutable; level: ShapeEnum from TopAbs);
GetDetalisation (me) returns ShapeEnum from TopAbs;
---Purpose: Set and get value for detalisation level
-- Only shapes of types from TopoDS_COMPOUND and until
-- specified detalisation level will be recorded in maps
-- To cancel mapping, use TopAbs_SHAPE
-- To force full mapping, use TopAbs_VERTEX
-- The default level is TopAbs_FACE
SetResult (me: mutable; S: Shape from TopoDS);
---Purpose: Sets a new result shape
-- NOTE: this method should be used very carefully
-- to keep consistency of modifications
-- It is recommended to use RecordModification() methods
-- with explicit definition of mapping from current
-- result to a new one
RecordModification (me: mutable; repl: DataMapOfShapeShape from TopTools;
msg : MsgRegistrator from ShapeExtend=0);
RecordModification (me: mutable; repl: ReShape from ShapeBuild;
msg : MsgRegistrator from ShapeExtend);
RecordModification (me: mutable; repl: ReShape from ShapeBuild);
RecordModification (me: mutable; sh : Shape from TopoDS;
repl: Modifier from BRepTools;
msg : MsgRegistrator from ShapeExtend=0);
---Purpose: Records modifications and resets result accordingly
-- NOTE: modification of resulting shape should be explicitly
-- defined in the maps along with modifications of subshapes
--
-- In the last function, sh is the shape on which Modifier
-- was run. It can be different from the whole shape,
-- but in that case result as a whole should be reset later
-- either by call to SetResult(), or by another call to
-- RecordModification() which contains mapping of current
-- result to a new one explicitly
AddMessage (me: mutable; S: Shape from TopoDS; msg: Msg from Message;
gravity: Gravity from Message = Message_Warning);
---Purpose: Record a message for shape S
-- Shape S should be one of subshapes of original shape
-- (or whole one), but not one of intermediate shapes
-- Records only if Message() is not Null
GetContinuity (me; param: CString; val: out Shape from GeomAbs)
returns Boolean;
---Purpose: Get value of parameter as being of the type GeomAbs_Shape
-- Returns False if parameter is not defined or has a wrong type
ContinuityVal (me; param: CString; def: Shape from GeomAbs)
returns Shape from GeomAbs;
---Purpose: Get value of parameter as being of the type GeomAbs_Shape
-- If parameter is not defined or does not have expected
-- type, returns default value as specified
PrintStatistics (me);
---Purpose: Prints statistics on Shape Processing onto the current Messenger.
---Remark: At the moment outputs information only on shells and faces.
fields
myShape : Shape from TopoDS;
myResult: Shape from TopoDS;
myMap : DataMapOfShapeShape from TopTools;
myMsg : MsgRegistrator from ShapeExtend;
myUntil : ShapeEnum from TopAbs;
end ShapeContext;

View File

@@ -13,25 +13,27 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ShapeProcess_ShapeContext.ixx>
#include <BRep_Builder.hxx>
#include <BRepTools_Modifier.hxx>
#include <Message_ListIteratorOfListOfMsg.hxx>
#include <Message_ListOfMsg.hxx>
#include <Message_Messenger.hxx>
#include <Message_Msg.hxx>
#include <ShapeBuild_ReShape.hxx>
#include <ShapeExtend_DataMapOfShapeListOfMsg.hxx>
#include <ShapeExtend_MsgRegistrator.hxx>
#include <ShapeProcess_ShapeContext.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
#include <BRep_Builder.hxx>
#include <Message_Msg.hxx>
#include <Message_Messenger.hxx>
#include <Message_ListOfMsg.hxx>
#include <Message_ListIteratorOfListOfMsg.hxx>
#include <ShapeExtend_MsgRegistrator.hxx>
#include <ShapeExtend_DataMapOfShapeListOfMsg.hxx>
//=======================================================================
//function : ShapeProcess_ShapeContext
//purpose :
//=======================================================================
ShapeProcess_ShapeContext::ShapeProcess_ShapeContext (const Standard_CString file,
const Standard_CString seq)
: ShapeProcess_Context ( file, seq ), myUntil(TopAbs_FACE)

View File

@@ -0,0 +1,157 @@
// Created on: 2000-08-22
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ShapeProcess_ShapeContext_HeaderFile
#define _ShapeProcess_ShapeContext_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <ShapeProcess_Context.hxx>
#include <Standard_CString.hxx>
#include <Message_Gravity.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_Shape.hxx>
class ShapeExtend_MsgRegistrator;
class TopoDS_Shape;
class ShapeBuild_ReShape;
class BRepTools_Modifier;
class Message_Msg;
class ShapeProcess_ShapeContext;
DEFINE_STANDARD_HANDLE(ShapeProcess_ShapeContext, ShapeProcess_Context)
//! Extends Context to handle shapes
//! Contains map of shape-shape, and messages
//! attached to shapes
class ShapeProcess_ShapeContext : public ShapeProcess_Context
{
public:
Standard_EXPORT ShapeProcess_ShapeContext(const Standard_CString file, const Standard_CString seq = "");
//! Initializes a tool by resource file and shape
//! to be processed
Standard_EXPORT ShapeProcess_ShapeContext(const TopoDS_Shape& S, const Standard_CString file, const Standard_CString seq = "");
//! Initializes tool by a new shape and clears all results
Standard_EXPORT void Init (const TopoDS_Shape& S);
//! Returns shape being processed
Standard_EXPORT const TopoDS_Shape& Shape() const;
//! Returns current result
Standard_EXPORT const TopoDS_Shape& Result() const;
//! Returns map of replacements shape -> shape
//! This map is not recursive
Standard_EXPORT const TopTools_DataMapOfShapeShape& Map() const;
Standard_EXPORT const Handle(ShapeExtend_MsgRegistrator)& Messages() const;
//! Returns messages recorded during shape processing
//! It can be nullified before processing in order to
//! avoid recording messages
Standard_EXPORT Handle(ShapeExtend_MsgRegistrator)& Messages();
Standard_EXPORT void SetDetalisation (const TopAbs_ShapeEnum level);
//! Set and get value for detalisation level
//! Only shapes of types from TopoDS_COMPOUND and until
//! specified detalisation level will be recorded in maps
//! To cancel mapping, use TopAbs_SHAPE
//! To force full mapping, use TopAbs_VERTEX
//! The default level is TopAbs_FACE
Standard_EXPORT TopAbs_ShapeEnum GetDetalisation() const;
//! Sets a new result shape
//! NOTE: this method should be used very carefully
//! to keep consistency of modifications
//! It is recommended to use RecordModification() methods
//! with explicit definition of mapping from current
//! result to a new one
Standard_EXPORT void SetResult (const TopoDS_Shape& S);
Standard_EXPORT void RecordModification (const TopTools_DataMapOfShapeShape& repl, const Handle(ShapeExtend_MsgRegistrator)& msg = 0);
Standard_EXPORT void RecordModification (const Handle(ShapeBuild_ReShape)& repl, const Handle(ShapeExtend_MsgRegistrator)& msg);
Standard_EXPORT void RecordModification (const Handle(ShapeBuild_ReShape)& repl);
//! Records modifications and resets result accordingly
//! NOTE: modification of resulting shape should be explicitly
//! defined in the maps along with modifications of subshapes
//!
//! In the last function, sh is the shape on which Modifier
//! was run. It can be different from the whole shape,
//! but in that case result as a whole should be reset later
//! either by call to SetResult(), or by another call to
//! RecordModification() which contains mapping of current
//! result to a new one explicitly
Standard_EXPORT void RecordModification (const TopoDS_Shape& sh, const BRepTools_Modifier& repl, const Handle(ShapeExtend_MsgRegistrator)& msg = 0);
//! Record a message for shape S
//! Shape S should be one of subshapes of original shape
//! (or whole one), but not one of intermediate shapes
//! Records only if Message() is not Null
Standard_EXPORT void AddMessage (const TopoDS_Shape& S, const Message_Msg& msg, const Message_Gravity gravity = Message_Warning);
//! Get value of parameter as being of the type GeomAbs_Shape
//! Returns False if parameter is not defined or has a wrong type
Standard_EXPORT Standard_Boolean GetContinuity (const Standard_CString param, GeomAbs_Shape& val) const;
//! Get value of parameter as being of the type GeomAbs_Shape
//! If parameter is not defined or does not have expected
//! type, returns default value as specified
Standard_EXPORT GeomAbs_Shape ContinuityVal (const Standard_CString param, const GeomAbs_Shape def) const;
//! Prints statistics on Shape Processing onto the current Messenger.
Standard_EXPORT void PrintStatistics() const;
DEFINE_STANDARD_RTTI(ShapeProcess_ShapeContext,ShapeProcess_Context)
protected:
private:
TopoDS_Shape myShape;
TopoDS_Shape myResult;
TopTools_DataMapOfShapeShape myMap;
Handle(ShapeExtend_MsgRegistrator) myMsg;
TopAbs_ShapeEnum myUntil;
};
#endif // _ShapeProcess_ShapeContext_HeaderFile

View File

@@ -0,0 +1,73 @@
// Created on: 2000-08-21
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ShapeProcess_StackItemOfDictionaryOfOperator_HeaderFile
#define _ShapeProcess_StackItemOfDictionaryOfOperator_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <MMgt_TShared.hxx>
class ShapeProcess_DictionaryOfOperator;
class ShapeProcess_Operator;
class ShapeProcess_IteratorOfDictionaryOfOperator;
class ShapeProcess_StackItemOfDictionaryOfOperator;
DEFINE_STANDARD_HANDLE(ShapeProcess_StackItemOfDictionaryOfOperator, MMgt_TShared)
class ShapeProcess_StackItemOfDictionaryOfOperator : public MMgt_TShared
{
public:
Standard_EXPORT ShapeProcess_StackItemOfDictionaryOfOperator();
Standard_EXPORT ShapeProcess_StackItemOfDictionaryOfOperator(const Handle(ShapeProcess_StackItemOfDictionaryOfOperator)& previous);
Standard_EXPORT Handle(ShapeProcess_StackItemOfDictionaryOfOperator) Previous() const;
Standard_EXPORT Handle(ShapeProcess_DictionaryOfOperator) Value() const;
Standard_EXPORT void SetValue (const Handle(ShapeProcess_DictionaryOfOperator)& cval);
DEFINE_STANDARD_RTTI(ShapeProcess_StackItemOfDictionaryOfOperator,MMgt_TShared)
protected:
private:
Handle(ShapeProcess_DictionaryOfOperator) thevalue;
Handle(ShapeProcess_StackItemOfDictionaryOfOperator) theprev;
};
#endif // _ShapeProcess_StackItemOfDictionaryOfOperator_HeaderFile

View File

@@ -0,0 +1,45 @@
// Created on: 2000-08-21
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ShapeProcess_StackItemOfDictionaryOfOperator.hxx>
#include <Standard_Type.hxx>
#include <ShapeProcess_DictionaryOfOperator.hxx>
#include <ShapeProcess_StackItemOfDictionaryOfOperator.hxx>
#include <ShapeProcess_Operator.hxx>
#include <ShapeProcess_IteratorOfDictionaryOfOperator.hxx>
#define TheItem Handle(ShapeProcess_Operator)
#define TheItem_hxx <ShapeProcess_Operator.hxx>
#define Dico_Iterator ShapeProcess_IteratorOfDictionaryOfOperator
#define Dico_Iterator_hxx <ShapeProcess_IteratorOfDictionaryOfOperator.hxx>
#define Dico_StackItem ShapeProcess_StackItemOfDictionaryOfOperator
#define Dico_StackItem_hxx <ShapeProcess_StackItemOfDictionaryOfOperator.hxx>
#define Handle_Dico_StackItem Handle(ShapeProcess_StackItemOfDictionaryOfOperator)
#define Dico_Dictionary ShapeProcess_DictionaryOfOperator
#define Dico_Dictionary_hxx <ShapeProcess_DictionaryOfOperator.hxx>
#define Handle_Dico_Dictionary Handle(ShapeProcess_DictionaryOfOperator)
#include <Dico_StackItem.gxx>

View File

@@ -1,41 +0,0 @@
-- Created on: 2000-08-22
-- Created by: Andrey BETENEV
-- Copyright (c) 2000-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class UOperator from ShapeProcess inherits Operator from ShapeProcess
---Purpose: Defines operator as container for static function
-- OperFunc. This allows user to create new operators
-- without creation of new classes
uses
OperFunc from ShapeProcess,
Context from ShapeProcess
is
Create (func: OperFunc from ShapeProcess);
---Purpose: Creates operator with implementation defined as
-- OperFunc (static function)
Perform (me: mutable; context: Context from ShapeProcess)
returns Boolean is redefined;
---Purpose: Performs operation and records changes in the context
fields
myFunc: OperFunc from ShapeProcess;
end UOperator;

View File

@@ -13,13 +13,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ShapeProcess_UOperator.ixx>
#include <ShapeProcess_Context.hxx>
#include <ShapeProcess_UOperator.hxx>
#include <Standard_Type.hxx>
//=======================================================================
//function : ShapeProcess_UOperator
//purpose :
//=======================================================================
ShapeProcess_UOperator::ShapeProcess_UOperator (const ShapeProcess_OperFunc func) : myFunc(func)
{
}

View File

@@ -0,0 +1,71 @@
// Created on: 2000-08-22
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _ShapeProcess_UOperator_HeaderFile
#define _ShapeProcess_UOperator_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <ShapeProcess_OperFunc.hxx>
#include <ShapeProcess_Operator.hxx>
#include <Standard_Boolean.hxx>
class ShapeProcess_Context;
class ShapeProcess_UOperator;
DEFINE_STANDARD_HANDLE(ShapeProcess_UOperator, ShapeProcess_Operator)
//! Defines operator as container for static function
//! OperFunc. This allows user to create new operators
//! without creation of new classes
class ShapeProcess_UOperator : public ShapeProcess_Operator
{
public:
//! Creates operator with implementation defined as
//! OperFunc (static function)
Standard_EXPORT ShapeProcess_UOperator(const ShapeProcess_OperFunc func);
//! Performs operation and records changes in the context
Standard_EXPORT virtual Standard_Boolean Perform (const Handle(ShapeProcess_Context)& context) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(ShapeProcess_UOperator,ShapeProcess_Operator)
protected:
private:
ShapeProcess_OperFunc myFunc;
};
#endif // _ShapeProcess_UOperator_HeaderFile