1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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,8 +1,28 @@
TFunction_DataMapOfGUIDDriver.hxx
TFunction_DataMapIteratorOfDataMapOfGUIDDriver.hxx
TFunction_Array1OfDataMapOfGUIDDriver.hxx
TFunction_HArray1OfDataMapOfGUIDDriver.hxx
TFunction_DataMapOfLabelListOfLabel.hxx
TFunction_DataMapIteratorOfDataMapOfGUIDDriver.hxx
TFunction_DataMapIteratorOfDataMapOfLabelListOfLabel.hxx
TFunction_DoubleMapOfIntegerLabel.hxx
TFunction_DataMapOfGUIDDriver.hxx
TFunction_DataMapOfLabelListOfLabel.hxx
TFunction_DoubleMapIteratorOfDoubleMapOfIntegerLabel.hxx
TFunction_DoubleMapOfIntegerLabel.hxx
TFunction_Driver.cxx
TFunction_Driver.hxx
TFunction_Driver.lxx
TFunction_DriverTable.cxx
TFunction_DriverTable.hxx
TFunction_ExecutionStatus.hxx
TFunction_Function.cxx
TFunction_Function.hxx
TFunction_Function.lxx
TFunction_GraphNode.cxx
TFunction_GraphNode.hxx
TFunction_HArray1OfDataMapOfGUIDDriver.hxx
TFunction_IFunction.cxx
TFunction_IFunction.hxx
TFunction_Iterator.cxx
TFunction_Iterator.hxx
TFunction_Logbook.cxx
TFunction_Logbook.hxx
TFunction_Logbook.lxx
TFunction_Scope.cxx
TFunction_Scope.hxx

View File

@@ -1,62 +0,0 @@
-- Created on: 1999-06-10
-- Created by: Vladislav ROMASHKO
-- Copyright (c) 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.
package TFunction
--- Purpose: Function attributes separate data from
-- algorithms. Each function contains the ID of a function driver.
uses
Standard,
TCollection,
TColStd,
TDF,
TDataStd
is
enumeration ExecutionStatus is
ES_WrongDefinition,
ES_NotExecuted,
ES_Executing,
ES_Succeeded,
ES_Failed;
deferred class Driver;
class DriverTable;
class Logbook;
imported DataMapOfGUIDDriver;
imported DataMapIteratorOfDataMapOfGUIDDriver;
imported Array1OfDataMapOfGUIDDriver;
imported transient class HArray1OfDataMapOfGUIDDriver;
class Function;
class GraphNode;
class Scope;
class IFunction;
class Iterator;
imported DataMapOfLabelListOfLabel;
imported DataMapIteratorOfDataMapOfLabelListOfLabel;
imported DoubleMapOfIntegerLabel;
imported DoubleMapIteratorOfDoubleMapOfIntegerLabel;
end TFunction;

View File

@@ -1,94 +0,0 @@
-- Created on: 1999-07-19
-- Created by: Denis PASCAL
-- Copyright (c) 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.
deferred class Driver from TFunction inherits TShared from MMgt
---Purpose: This driver class provide services around function
-- execution. One instance of this class is built for
-- the whole session. The driver is bound to the
-- DriverGUID in the DriverTable class.
-- It allows you to create classes which inherit from
-- this abstract class.
-- These subclasses identify the various algorithms
-- which can be applied to the data contained in the
-- attributes of sub-labels of a model.
-- A single instance of this class and each of its
-- subclasses is built for the whole session.
uses
Logbook from TFunction,
Label from TDF,
LabelList from TDF
is
Initialize returns Driver from TFunction;
---Purpose: initialisation of the driver
-- ============================
Init(me : mutable; L : Label from TDF);
---Purpose: Initializes the label L for this function prior to its execution.
Label(me) returns Label from TDF;
---C++: inline
---Purpose: Returns the label of the driver for this function.
Validate(me; log : in out Logbook from TFunction)
is virtual;
---Purpose: Validates labels of a function in <log>.
-- This function is the one initialized in this function driver.
-- Warning
-- In regeneration mode, the solver must call this
-- method even if the function is not executed.
---Purpose: execution of function
-- =====================
MustExecute (me; log : Logbook from TFunction)
---Purpose: Analyzes the labels in the logbook log.
-- Returns true if attributes have been modified.
-- If the function label itself has been modified, the function must be executed.
returns Boolean from Standard
is virtual;
Execute (me; log : in out Logbook from TFunction)
---Purpose: Executes the function in this function driver and
-- puts the impacted labels in the logbook log.
returns Integer from Standard
is deferred;
---Purpose: arguments & results of functions
-- ================================
Arguments (me; args : out LabelList from TDF)
---Purpose: The method fills-in the list by labels,
-- where the arguments of the function are located.
is virtual;
Results (me; res : out LabelList from TDF)
---Purpose: The method fills-in the list by labels,
-- where the results of the function are located.
is virtual;
fields
myLabel : Label from TDF;
end Driver;

View File

@@ -14,17 +14,17 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TFunction_Driver.ixx>
#include <Standard_Type.hxx>
#include <TDF_Label.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
#include <TFunction_Driver.hxx>
#include <TFunction_Logbook.hxx>
//=======================================================================
//function : TFunction_Driver
//purpose : Constructor
//=======================================================================
TFunction_Driver::TFunction_Driver()
{

View File

@@ -0,0 +1,115 @@
// Created on: 1999-07-19
// Created by: Denis PASCAL
// Copyright (c) 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 _TFunction_Driver_HeaderFile
#define _TFunction_Driver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TDF_Label.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <TDF_LabelList.hxx>
class TDF_Label;
class TFunction_Logbook;
class TFunction_Driver;
DEFINE_STANDARD_HANDLE(TFunction_Driver, MMgt_TShared)
//! This driver class provide services around function
//! execution. One instance of this class is built for
//! the whole session. The driver is bound to the
//! DriverGUID in the DriverTable class.
//! It allows you to create classes which inherit from
//! this abstract class.
//! These subclasses identify the various algorithms
//! which can be applied to the data contained in the
//! attributes of sub-labels of a model.
//! A single instance of this class and each of its
//! subclasses is built for the whole session.
class TFunction_Driver : public MMgt_TShared
{
public:
//! Initializes the label L for this function prior to its execution.
Standard_EXPORT void Init (const TDF_Label& L);
//! Returns the label of the driver for this function.
TDF_Label Label() const;
//! Validates labels of a function in <log>.
//! This function is the one initialized in this function driver.
//! Warning
//! In regeneration mode, the solver must call this
//! method even if the function is not executed.
//! execution of function
//! =====================
Standard_EXPORT virtual void Validate (TFunction_Logbook& log) const;
//! Analyzes the labels in the logbook log.
//! Returns true if attributes have been modified.
//! If the function label itself has been modified, the function must be executed.
Standard_EXPORT virtual Standard_Boolean MustExecute (const TFunction_Logbook& log) const;
//! Executes the function in this function driver and
//! puts the impacted labels in the logbook log.
//! arguments & results of functions
//! ================================
Standard_EXPORT virtual Standard_Integer Execute (TFunction_Logbook& log) const = 0;
//! The method fills-in the list by labels,
//! where the arguments of the function are located.
Standard_EXPORT virtual void Arguments (TDF_LabelList& args) const;
//! The method fills-in the list by labels,
//! where the results of the function are located.
Standard_EXPORT virtual void Results (TDF_LabelList& res) const;
DEFINE_STANDARD_RTTI(TFunction_Driver,MMgt_TShared)
protected:
//! initialisation of the driver
//! ============================
Standard_EXPORT TFunction_Driver();
private:
TDF_Label myLabel;
};
#include <TFunction_Driver.lxx>
#endif // _TFunction_Driver_HeaderFile

View File

@@ -1,75 +0,0 @@
-- Created on: 1999-06-11
-- Created by: Vladislav ROMASHKO
-- Copyright (c) 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.
class DriverTable from TFunction inherits TShared from MMgt
---Purpose: A container for instances of drivers.
-- You create a new instance of TFunction_Driver
-- and use the method AddDriver to load it into the driver table.
uses
DataMapOfGUIDDriver from TFunction,
Driver from TFunction,
GUID from Standard,
OStream from Standard,
DataMapOfGUIDDriver from TFunction,
HArray1OfDataMapOfGUIDDriver from TFunction
is
Get (myclass)
---Purpose: Returns the driver table. If a driver does not exist, creates it.
returns DriverTable from TFunction;
Create returns DriverTable from TFunction;
---Purpose: Default constructor
AddDriver(me : mutable; guid : GUID from Standard;
driver : Driver from TFunction;
thread : Integer from Standard = 0)
---Purpose: Returns true if the driver has been added successfully to the driver table.
returns Boolean from Standard;
HasDriver (me; guid : GUID from Standard;
thread : Integer from Standard = 0)
---Purpose: Returns true if the driver exists in the driver table.
returns Boolean from Standard;
FindDriver(me; guid : GUID from Standard;
driver : out Driver from TFunction;
thread : Integer from Standard = 0)
---Purpose: Returns true if the driver was found.
returns Boolean from Standard;
Dump(me; anOS : in out OStream from Standard)
---C++: alias operator <<
---C++: return &
returns OStream from Standard;
RemoveDriver (me : mutable; guid : GUID from Standard;
thread : Integer from Standard = 0)
---Purpose: Removes a driver with the given GUID.
-- Returns true if the driver has been removed successfully.
returns Boolean from Standard;
Clear (me : mutable);
---Purpose: Removes all drivers. Returns true if the driver has been removed successfully.
fields
myDrivers : DataMapOfGUIDDriver from TFunction;
myThreadDrivers : HArray1OfDataMapOfGUIDDriver from TFunction;
end DriverTable;

View File

@@ -14,14 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TFunction_DriverTable.ixx>
#include <TFunction_DataMapOfGUIDDriver.hxx>
#include <TFunction_DataMapIteratorOfDataMapOfGUIDDriver.hxx>
#include <TFunction_Driver.hxx>
#include <Standard_GUID.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TDF.hxx>
#include <TFunction_DataMapIteratorOfDataMapOfGUIDDriver.hxx>
#include <TFunction_DataMapOfGUIDDriver.hxx>
#include <TFunction_Driver.hxx>
#include <TFunction_DriverTable.hxx>
static Handle(TFunction_DriverTable) DT;

View File

@@ -0,0 +1,98 @@
// Created on: 1999-06-11
// Created by: Vladislav ROMASHKO
// Copyright (c) 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 _TFunction_DriverTable_HeaderFile
#define _TFunction_DriverTable_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TFunction_DataMapOfGUIDDriver.hxx>
#include <TFunction_HArray1OfDataMapOfGUIDDriver.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_OStream.hxx>
class Standard_GUID;
class TFunction_Driver;
class TFunction_DriverTable;
DEFINE_STANDARD_HANDLE(TFunction_DriverTable, MMgt_TShared)
//! A container for instances of drivers.
//! You create a new instance of TFunction_Driver
//! and use the method AddDriver to load it into the driver table.
class TFunction_DriverTable : public MMgt_TShared
{
public:
//! Returns the driver table. If a driver does not exist, creates it.
Standard_EXPORT static Handle(TFunction_DriverTable) Get();
//! Default constructor
Standard_EXPORT TFunction_DriverTable();
//! Returns true if the driver has been added successfully to the driver table.
Standard_EXPORT Standard_Boolean AddDriver (const Standard_GUID& guid, const Handle(TFunction_Driver)& driver, const Standard_Integer thread = 0);
//! Returns true if the driver exists in the driver table.
Standard_EXPORT Standard_Boolean HasDriver (const Standard_GUID& guid, const Standard_Integer thread = 0) const;
//! Returns true if the driver was found.
Standard_EXPORT Standard_Boolean FindDriver (const Standard_GUID& guid, Handle(TFunction_Driver)& driver, const Standard_Integer thread = 0) const;
Standard_EXPORT Standard_OStream& Dump (Standard_OStream& anOS) const;
Standard_OStream& operator << (Standard_OStream& anOS) const
{
return Dump(anOS);
}
//! Removes a driver with the given GUID.
//! Returns true if the driver has been removed successfully.
Standard_EXPORT Standard_Boolean RemoveDriver (const Standard_GUID& guid, const Standard_Integer thread = 0);
//! Removes all drivers. Returns true if the driver has been removed successfully.
Standard_EXPORT void Clear();
DEFINE_STANDARD_RTTI(TFunction_DriverTable,MMgt_TShared)
protected:
private:
TFunction_DataMapOfGUIDDriver myDrivers;
Handle(TFunction_HArray1OfDataMapOfGUIDDriver) myThreadDrivers;
};
#endif // _TFunction_DriverTable_HeaderFile

View File

@@ -0,0 +1,30 @@
// Created on: 1999-06-10
// Created by: Vladislav ROMASHKO
// Copyright (c) 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 _TFunction_ExecutionStatus_HeaderFile
#define _TFunction_ExecutionStatus_HeaderFile
enum TFunction_ExecutionStatus
{
TFunction_ES_WrongDefinition,
TFunction_ES_NotExecuted,
TFunction_ES_Executing,
TFunction_ES_Succeeded,
TFunction_ES_Failed
};
#endif // _TFunction_ExecutionStatus_HeaderFile

View File

@@ -1,124 +0,0 @@
-- Created on: 1999-06-10
-- Created by: Vladislav ROMASHKO
-- Copyright (c) 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.
class Function from TFunction inherits Attribute from TDF
---Purpose: Provides the following two services
-- - a link to an evaluation driver
-- - the means of providing a link between a
-- function and an evaluation driver.
uses
GUID from Standard,
OStream from Standard,
Attribute from TDF,
RelocationTable from TDF,
DataSet from TDF,
Label from TDF
is
---Purpose: Static methods:
-- ==============
Set (myclass; L : Label from TDF)
---Purpose: Finds or Creates a function attribute on the label <L>.
-- Returns the function attribute.
returns Function from TFunction;
Set(myclass; L : Label from TDF;
DriverID : GUID from Standard)
---Purpose: Finds or Creates a function attribute on the label <L>.
-- Sets a driver ID to the function.
-- Returns the function attribute.
returns Function from TFunction;
GetID(myclass)
---Purpose: Returns the GUID for functions.
---C++: return const &
returns GUID from Standard;
--Find(myclass; L : Label from TDF;
-- F : out Function from TFunction)
---Purpose: Returns a function found on the label.
--returns Boolean from Standard;
---Purpose: Instance methods:
-- ================
Create returns Function from TFunction;
GetDriverGUID (me)
---Purpose: Returns the GUID for this function's driver.
---C++: inline
---C++: return const &
returns GUID from Standard;
SetDriverGUID(me : mutable; guid : GUID from Standard);
---Purpose: Sets the driver for this function as that
-- indentified by the GUID guid.
Failed (me)
---Purpose: Returns true if the execution failed
---C++: inline
returns Boolean from Standard;
SetFailure (me : mutable; mode : Integer from Standard = 0);
---Purpose: Sets the failed index.
GetFailure (me)
---Purpose:
-- Returns an index of failure if the execution of this function failed.
-- If this integer value is 0, no failure has occurred.
---C++: inline
returns Integer from Standard;
---Purpose: Implementation of Attribute methods:
-- ===================================
ID (me)
---C++: return const &
returns GUID from Standard;
Restore (me: mutable; with : Attribute from TDF)
is virtual;
Paste (me; into : Attribute from TDF;
RT : RelocationTable from TDF)
is virtual;
NewEmpty(me)
returns Attribute from TDF
is redefined;
References(me;
aDataSet : DataSet from TDF)
is redefined;
Dump(me; anOS : in out OStream from Standard)
returns OStream from Standard
is redefined;
---C++: return &
fields
myDriverGUID : GUID from Standard;
myFailure : Integer from Standard;
end Function;

View File

@@ -14,19 +14,22 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TFunction_Function.ixx>
#include <Standard_DomainError.hxx>
#include <Standard_GUID.hxx>
#include <Standard_Type.hxx>
#include <TDF_Attribute.hxx>
#include <TDF_DataSet.hxx>
#include <TDF_Label.hxx>
#include <TDF_RelocationTable.hxx>
#include <TFunction_Function.hxx>
#include <TFunction_GraphNode.hxx>
#include <TFunction_Scope.hxx>
#include <TDF_Label.hxx>
#include <Standard_DomainError.hxx>
//=======================================================================
//function : GetID
//purpose : Static method to get an ID
//=======================================================================
const Standard_GUID& TFunction_Function::GetID()
{
static Standard_GUID TFunction_FunctionID("5b35ca00-5b78-11d1-8940-080009dc3333");

View File

@@ -0,0 +1,125 @@
// Created on: 1999-06-10
// Created by: Vladislav ROMASHKO
// Copyright (c) 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 _TFunction_Function_HeaderFile
#define _TFunction_Function_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_GUID.hxx>
#include <Standard_Integer.hxx>
#include <TDF_Attribute.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_OStream.hxx>
class TDF_Label;
class Standard_GUID;
class TDF_Attribute;
class TDF_RelocationTable;
class TDF_DataSet;
class TFunction_Function;
DEFINE_STANDARD_HANDLE(TFunction_Function, TDF_Attribute)
//! Provides the following two services
//! - a link to an evaluation driver
//! - the means of providing a link between a
//! function and an evaluation driver.
class TFunction_Function : public TDF_Attribute
{
public:
//! Static methods:
//! ==============
//! Finds or Creates a function attribute on the label <L>.
//! Returns the function attribute.
Standard_EXPORT static Handle(TFunction_Function) Set (const TDF_Label& L);
//! Finds or Creates a function attribute on the label <L>.
//! Sets a driver ID to the function.
//! Returns the function attribute.
Standard_EXPORT static Handle(TFunction_Function) Set (const TDF_Label& L, const Standard_GUID& DriverID);
//! Returns the GUID for functions.
//! Returns a function found on the label.
//! Instance methods:
//! ================
Standard_EXPORT static const Standard_GUID& GetID();
Standard_EXPORT TFunction_Function();
//! Returns the GUID for this function's driver.
const Standard_GUID& GetDriverGUID() const;
//! Sets the driver for this function as that
//! indentified by the GUID guid.
Standard_EXPORT void SetDriverGUID (const Standard_GUID& guid);
//! Returns true if the execution failed
Standard_Boolean Failed() const;
//! Sets the failed index.
Standard_EXPORT void SetFailure (const Standard_Integer mode = 0);
//! Returns an index of failure if the execution of this function failed.
//! If this integer value is 0, no failure has occurred.
//! Implementation of Attribute methods:
//! ===================================
Standard_Integer GetFailure() const;
Standard_EXPORT const Standard_GUID& ID() const;
Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& with);
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const;
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(TFunction_Function,TDF_Attribute)
protected:
private:
Standard_GUID myDriverGUID;
Standard_Integer myFailure;
};
#include <TFunction_Function.lxx>
#endif // _TFunction_Function_HeaderFile

View File

@@ -1,156 +0,0 @@
-- Created on: 2008-06-21
-- Created by: Vladislav ROMASHKO
-- Copyright (c) 2008-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 GraphNode from TFunction inherits Attribute from TDF
---Purpose: Provides links between functions.
uses
GUID from Standard,
OStream from Standard,
Attribute from TDF,
RelocationTable from TDF,
DataSet from TDF,
Label from TDF,
MapOfInteger from TColStd,
ExecutionStatus from TFunction
is
---Purpose: Static methods
-- ==============
Set (myclass; L : Label from TDF)
---Purpose: Finds or Creates a graph node attribute at the label <L>.
-- Returns the attribute.
returns GraphNode from TFunction;
GetID (myclass)
---Purpose: Returns the GUID for GraphNode attribute.
---C++: return const &
returns GUID from Standard;
---Purpose: Instant methods
-- ===============
Create
---Purpose: Constructor (empty).
returns GraphNode from TFunction;
AddPrevious (me : mutable;
funcID : Integer from Standard)
---Purpose: Defines a reference to the function as a previous one.
returns Boolean from Standard;
AddPrevious (me : mutable;
func : Label from TDF)
---Purpose: Defines a reference to the function as a previous one.
returns Boolean from Standard;
RemovePrevious (me : mutable;
funcID : Integer from Standard)
---Purpose: Removes a reference to the function as a previous one.
returns Boolean from Standard;
RemovePrevious (me : mutable;
func : Label from TDF)
---Purpose: Removes a reference to the function as a previous one.
returns Boolean from Standard;
GetPrevious (me)
---C++: return const &
---Purpose: Returns a map of previous functions.
returns MapOfInteger from TColStd;
RemoveAllPrevious (me : mutable);
---Purpose: Clears a map of previous functions.
AddNext (me : mutable;
funcID : Integer from Standard)
---Purpose: Defines a reference to the function as a next one.
returns Boolean from Standard;
AddNext (me : mutable;
func : Label from TDF)
---Purpose: Defines a reference to the function as a next one.
returns Boolean from Standard;
RemoveNext (me : mutable;
funcID : Integer from Standard)
---Purpose: Removes a reference to the function as a next one.
returns Boolean from Standard;
RemoveNext (me : mutable;
func : Label from TDF)
---Purpose: Removes a reference to the function as a next one.
returns Boolean from Standard;
GetNext (me)
---C++: return const &
---Purpose: Returns a map of next functions.
returns MapOfInteger from TColStd;
RemoveAllNext (me : mutable);
---Purpose: Clears a map of next functions.
GetStatus (me)
---Purpose: Returns the execution status of the function.
returns ExecutionStatus from TFunction;
SetStatus (me : mutable;
status : ExecutionStatus from TFunction);
---Purpose: Defines an execution status for a function.
---Purpose: Implementation of Attribute methods
-- ===================================
ID (me)
---C++: return const &
returns GUID from Standard;
Restore (me: mutable; with : Attribute from TDF)
is virtual;
Paste (me; into : Attribute from TDF;
RT : RelocationTable from TDF)
is virtual;
NewEmpty (me)
returns Attribute from TDF
is redefined;
References (me;
aDataSet : DataSet from TDF)
is redefined;
Dump (me; anOS : in out OStream from Standard)
---C++: return &
returns OStream from Standard
is redefined;
fields
myPrevious : MapOfInteger from TColStd;
myNext : MapOfInteger from TColStd;
myStatus : ExecutionStatus from TFunction;
end GraphNode;

View File

@@ -13,14 +13,20 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TFunction_GraphNode.ixx>
#include <Standard_GUID.hxx>
#include <Standard_Type.hxx>
#include <TDF_Attribute.hxx>
#include <TDF_DataSet.hxx>
#include <TDF_Label.hxx>
#include <TDF_RelocationTable.hxx>
#include <TFunction_GraphNode.hxx>
#include <TFunction_Scope.hxx>
//=======================================================================
//function : GetID
//purpose : Static method to get an ID
//=======================================================================
const Standard_GUID& TFunction_GraphNode::GetID()
{
static Standard_GUID TFunction_GraphNodeID("DD51FA86-E171-41a4-A2C1-3A0FBF286798");

View File

@@ -0,0 +1,141 @@
// Created on: 2008-06-21
// Created by: Vladislav ROMASHKO
// Copyright (c) 2008-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 _TFunction_GraphNode_HeaderFile
#define _TFunction_GraphNode_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TFunction_ExecutionStatus.hxx>
#include <TDF_Attribute.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_OStream.hxx>
class TDF_Label;
class Standard_GUID;
class TDF_Attribute;
class TDF_RelocationTable;
class TDF_DataSet;
class TFunction_GraphNode;
DEFINE_STANDARD_HANDLE(TFunction_GraphNode, TDF_Attribute)
//! Provides links between functions.
class TFunction_GraphNode : public TDF_Attribute
{
public:
//! Static methods
//! ==============
//! Finds or Creates a graph node attribute at the label <L>.
//! Returns the attribute.
Standard_EXPORT static Handle(TFunction_GraphNode) Set (const TDF_Label& L);
//! Returns the GUID for GraphNode attribute.
//! Instant methods
//! ===============
//! Constructor (empty).
Standard_EXPORT static const Standard_GUID& GetID();
Standard_EXPORT TFunction_GraphNode();
//! Defines a reference to the function as a previous one.
Standard_EXPORT Standard_Boolean AddPrevious (const Standard_Integer funcID);
//! Defines a reference to the function as a previous one.
Standard_EXPORT Standard_Boolean AddPrevious (const TDF_Label& func);
//! Removes a reference to the function as a previous one.
Standard_EXPORT Standard_Boolean RemovePrevious (const Standard_Integer funcID);
//! Removes a reference to the function as a previous one.
Standard_EXPORT Standard_Boolean RemovePrevious (const TDF_Label& func);
//! Returns a map of previous functions.
Standard_EXPORT const TColStd_MapOfInteger& GetPrevious() const;
//! Clears a map of previous functions.
Standard_EXPORT void RemoveAllPrevious();
//! Defines a reference to the function as a next one.
Standard_EXPORT Standard_Boolean AddNext (const Standard_Integer funcID);
//! Defines a reference to the function as a next one.
Standard_EXPORT Standard_Boolean AddNext (const TDF_Label& func);
//! Removes a reference to the function as a next one.
Standard_EXPORT Standard_Boolean RemoveNext (const Standard_Integer funcID);
//! Removes a reference to the function as a next one.
Standard_EXPORT Standard_Boolean RemoveNext (const TDF_Label& func);
//! Returns a map of next functions.
Standard_EXPORT const TColStd_MapOfInteger& GetNext() const;
//! Clears a map of next functions.
Standard_EXPORT void RemoveAllNext();
//! Returns the execution status of the function.
Standard_EXPORT TFunction_ExecutionStatus GetStatus() const;
//! Defines an execution status for a function.
//! Implementation of Attribute methods
//! ===================================
Standard_EXPORT void SetStatus (const TFunction_ExecutionStatus status);
Standard_EXPORT const Standard_GUID& ID() const;
Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& with);
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const;
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(TFunction_GraphNode,TDF_Attribute)
protected:
private:
TColStd_MapOfInteger myPrevious;
TColStd_MapOfInteger myNext;
TFunction_ExecutionStatus myStatus;
};
#endif // _TFunction_GraphNode_HeaderFile

View File

@@ -1,147 +0,0 @@
-- Created on: 2008-01-21
-- Created by: Vladislav ROMASHKO
-- Copyright (c) 2008-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 IFunction from TFunction
---Purpose: Interface class for usage of Function Mechanism
uses
Label from TDF,
GUID from Standard,
ExecutionStatus from TFunction,
Driver from TFunction,
GraphNode from TFunction,
Logbook from TFunction,
LabelList from TDF,
DoubleMapOfIntegerLabel from TFunction
is
---Category: Static methods
-- ==============
NewFunction (myclass;
L : Label from TDF;
ID : GUID from Standard)
---Purpose: Sets a new function attached to a label <L> with <ID>.
-- It creates a new TFunction_Function attribute initialized by the <ID>,
-- a new TFunction_GraphNode with an empty list of dependencies and
-- the status equal to TFunction_ES_WrongDefinition.
-- It registers the function in the scope of functions for this document.
returns Boolean from Standard;
DeleteFunction (myclass;
L : Label from TDF)
---Purpose: Deletes a function attached to a label <L>.
-- It deletes a TFunction_Function attribute and a TFunction_GraphNode.
-- It deletes the functions from the scope of function of this document.
returns Boolean from Standard;
UpdateDependencies (myclass;
Access : Label from TDF)
---Purpose: Updates dependencies for all functions of the scope.
-- It returns false in case of an error.
returns Boolean from Standard;
---Category: Instant methods
-- ===============
Create
---Purpose: An empty constructor.
returns IFunction from TFunction;
Create (L : Label from TDF)
---Purpose: A constructor.
-- Initializes the interface by the label of function.
returns IFunction from TFunction;
Init (me : in out;
L : Label from TDF);
---Purpose: Initializes the interface by the label of function.
Label (me)
---C++: return const &
---Purpose: Returns a label of the function.
returns Label from TDF;
UpdateDependencies (me)
---Purpose: Updates the dependencies of this function only.
returns Boolean from Standard;
---Category: Driver methods
-- ==============
Arguments (me; args : out LabelList from TDF);
---Purpose: The method fills-in the list by labels,
-- where the arguments of the function are located.
Results (me; res : out LabelList from TDF);
---Purpose: The method fills-in the list by labels,
-- where the results of the function are located.
---Category: Graph node methods
-- ==================
GetPrevious (me; prev : out LabelList from TDF);
---Purpose: Returns a list of previous functions.
GetNext (me; prev : out LabelList from TDF);
---Purpose: Returns a list of next functions.
GetStatus (me)
---Purpose: Returns the execution status of the function.
returns ExecutionStatus from TFunction;
SetStatus (me; status : ExecutionStatus from TFunction);
---Purpose: Defines an execution status for a function.
---Category: Scope methods
-- =============
GetAllFunctions (me)
---Purpose: Returns the scope of all functions.
---C++: return const &
returns DoubleMapOfIntegerLabel from TFunction;
GetLogbook (me)
---Purpose: Returns the Logbook - keeper of modifications.
---C++: return &
returns Logbook from TFunction;
---Categery: Internal methods (direct access)
-- ================================
GetDriver (me; thread : Integer from Standard = 0)
---Purpose: Returns a driver of the function.
returns Driver from TFunction;
GetGraphNode (me)
---Purpose: Returns a graph node of the function.
returns GraphNode from TFunction;
fields
myLabel : Label from TDF;
end IFunction;

View File

@@ -13,27 +13,29 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TFunction_IFunction.ixx>
#include <TFunction_Function.hxx>
#include <TFunction_GraphNode.hxx>
#include <TFunction_DriverTable.hxx>
#include <TFunction_Scope.hxx>
#include <TFunction_DataMapOfLabelListOfLabel.hxx>
#include <TFunction_DataMapIteratorOfDataMapOfLabelListOfLabel.hxx>
#include <TFunction_DoubleMapIteratorOfDoubleMapOfIntegerLabel.hxx>
#include <Standard_GUID.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TDF_Label.hxx>
#include <TDF_LabelList.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
#include <TDF_MapIteratorOfLabelMap.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TFunction_DataMapIteratorOfDataMapOfLabelListOfLabel.hxx>
#include <TFunction_DataMapOfLabelListOfLabel.hxx>
#include <TFunction_DoubleMapIteratorOfDoubleMapOfIntegerLabel.hxx>
#include <TFunction_Driver.hxx>
#include <TFunction_DriverTable.hxx>
#include <TFunction_Function.hxx>
#include <TFunction_GraphNode.hxx>
#include <TFunction_IFunction.hxx>
#include <TFunction_Logbook.hxx>
#include <TFunction_Scope.hxx>
//=======================================================================
//function : NewFunction
//purpose : Static method to create a new function.
//=======================================================================
Standard_Boolean TFunction_IFunction::NewFunction(const TDF_Label& L, const Standard_GUID& ID)
{
// Set Function (ID, code of failure)

View File

@@ -0,0 +1,132 @@
// Created on: 2008-01-21
// Created by: Vladislav ROMASHKO
// Copyright (c) 2008-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 _TFunction_IFunction_HeaderFile
#define _TFunction_IFunction_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TDF_Label.hxx>
#include <Standard_Boolean.hxx>
#include <TDF_LabelList.hxx>
#include <TFunction_ExecutionStatus.hxx>
#include <TFunction_DoubleMapOfIntegerLabel.hxx>
#include <Standard_Integer.hxx>
class TDF_Label;
class Standard_GUID;
class TFunction_Logbook;
class TFunction_Driver;
class TFunction_GraphNode;
//! Interface class for usage of Function Mechanism
class TFunction_IFunction
{
public:
DEFINE_STANDARD_ALLOC
//! Sets a new function attached to a label <L> with <ID>.
//! It creates a new TFunction_Function attribute initialized by the <ID>,
//! a new TFunction_GraphNode with an empty list of dependencies and
//! the status equal to TFunction_ES_WrongDefinition.
//! It registers the function in the scope of functions for this document.
Standard_EXPORT static Standard_Boolean NewFunction (const TDF_Label& L, const Standard_GUID& ID);
//! Deletes a function attached to a label <L>.
//! It deletes a TFunction_Function attribute and a TFunction_GraphNode.
//! It deletes the functions from the scope of function of this document.
Standard_EXPORT static Standard_Boolean DeleteFunction (const TDF_Label& L);
//! Updates dependencies for all functions of the scope.
//! It returns false in case of an error.
//! An empty constructor.
Standard_EXPORT static Standard_Boolean UpdateDependencies (const TDF_Label& Access);
Standard_EXPORT TFunction_IFunction();
//! A constructor.
//! Initializes the interface by the label of function.
Standard_EXPORT TFunction_IFunction(const TDF_Label& L);
//! Initializes the interface by the label of function.
Standard_EXPORT void Init (const TDF_Label& L);
//! Returns a label of the function.
Standard_EXPORT const TDF_Label& Label() const;
//! Updates the dependencies of this function only.
Standard_EXPORT Standard_Boolean UpdateDependencies() const;
//! The method fills-in the list by labels,
//! where the arguments of the function are located.
Standard_EXPORT void Arguments (TDF_LabelList& args) const;
//! The method fills-in the list by labels,
//! where the results of the function are located.
Standard_EXPORT void Results (TDF_LabelList& res) const;
//! Returns a list of previous functions.
Standard_EXPORT void GetPrevious (TDF_LabelList& prev) const;
//! Returns a list of next functions.
Standard_EXPORT void GetNext (TDF_LabelList& prev) const;
//! Returns the execution status of the function.
Standard_EXPORT TFunction_ExecutionStatus GetStatus() const;
//! Defines an execution status for a function.
Standard_EXPORT void SetStatus (const TFunction_ExecutionStatus status) const;
//! Returns the scope of all functions.
Standard_EXPORT const TFunction_DoubleMapOfIntegerLabel& GetAllFunctions() const;
//! Returns the Logbook - keeper of modifications.
Standard_EXPORT TFunction_Logbook& GetLogbook() const;
//! Returns a driver of the function.
Standard_EXPORT Handle(TFunction_Driver) GetDriver (const Standard_Integer thread = 0) const;
//! Returns a graph node of the function.
Standard_EXPORT Handle(TFunction_GraphNode) GetGraphNode() const;
protected:
private:
TDF_Label myLabel;
};
#endif // _TFunction_IFunction_HeaderFile

View File

@@ -1,107 +0,0 @@
-- Created on: 2008-01-22
-- Created by: Vladislav ROMASHKO
-- Copyright (c) 2008-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 Iterator from TFunction
---Purpose: Iterator of the graph of functions
uses
Label from TDF,
GUID from Standard,
LabelList from TDF,
LabelMap from TDF,
ExecutionStatus from TFunction,
Scope from TFunction
is
Create
---Purpose: An empty constructor.
returns Iterator from TFunction;
Create (Access : Label from TDF)
---Purpose: A constructor.
-- Initializes the iterator.
returns Iterator from TFunction;
Init (me : in out;
Access : Label from TDF)
---Purpose: Initializes the Iterator.
is virtual;
SetUsageOfExecutionStatus (me : in out;
usage : Boolean from Standard);
---Purpose: Defines the mode of iteration - usage or not of the execution status.
-- If the iterator takes into account the execution status,
-- the method ::Current() returns only "not executed" functions
-- while their status is not changed.
-- If the iterator ignores the execution status,
-- the method ::Current() returns the functions
-- following their dependencies and ignoring the execution status.
GetUsageOfExecutionStatus (me)
---Purpose: Returns usage of execution status by the iterator.
returns Boolean from Standard;
GetMaxNbThreads (me)
---Purpose: Analyses the graph of dependencies and returns
-- maximum number of threads may be used to calculate the model.
returns Integer from Standard
is virtual;
Current (me)
---Purpose: Returns the current list of functions.
-- If the iterator uses the execution status,
-- the returned list contains only the functions
-- with "not executed" status.
---C++: return const &
returns LabelList from TDF
is virtual;
More (me)
---Purpose: Returns false if the graph of functions is fully iterated.
returns Boolean from Standard
is virtual;
Next (me : in out)
---Purpose: Switches the iterator to the next list of current functions.
is virtual;
GetStatus (me;
func : Label from TDF)
---Purpose: A help-function aimed to help the user to check the status of retrurned function.
-- It calls TFunction_GraphNode::GetStatus() inside.
returns ExecutionStatus from TFunction;
SetStatus (me;
func : Label from TDF;
status : ExecutionStatus from TFunction);
---Purpose: A help-function aimed to help the user to change the execution status of a function.
-- It calls TFunction_GraphNode::SetStatus() inside.
Dump (me;
OS : in out OStream from Standard)
---C++: return &
returns OStream from Standard;
fields
myCurrent : LabelList from TDF;
myUsageOfExecutionStatus : Boolean from Standard;
myPassedFunctions : LabelMap from TDF; -- an internal field.
myScope : Scope from TFunction; -- an internal field.
end Iterator;

View File

@@ -13,26 +13,25 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TFunction_Iterator.ixx>
#include <TFunction_IFunction.hxx>
#include <TFunction_GraphNode.hxx>
#include <TFunction_DoubleMapIteratorOfDoubleMapOfIntegerLabel.hxx>
#include <TDF_LabelMap.hxx>
#include <TDF_MapIteratorOfLabelMap.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
#include <TDF_LabelIntegerMap.hxx>
#include <TDF_DataMapIteratorOfLabelIntegerMap.hxx>
#include <TDataStd_Name.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TDataStd_Name.hxx>
#include <TDF_DataMapIteratorOfLabelIntegerMap.hxx>
#include <TDF_Label.hxx>
#include <TDF_LabelIntegerMap.hxx>
#include <TDF_LabelMap.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
#include <TDF_MapIteratorOfLabelMap.hxx>
#include <TFunction_DoubleMapIteratorOfDoubleMapOfIntegerLabel.hxx>
#include <TFunction_GraphNode.hxx>
#include <TFunction_IFunction.hxx>
#include <TFunction_Iterator.hxx>
#include <TFunction_Scope.hxx>
//=======================================================================
//function : Create
//purpose : Constructor
//=======================================================================
TFunction_Iterator::TFunction_Iterator():myUsageOfExecutionStatus(Standard_False)
{

View File

@@ -0,0 +1,116 @@
// Created on: 2008-01-22
// Created by: Vladislav ROMASHKO
// Copyright (c) 2008-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 _TFunction_Iterator_HeaderFile
#define _TFunction_Iterator_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TDF_LabelList.hxx>
#include <Standard_Boolean.hxx>
#include <TDF_LabelMap.hxx>
#include <Standard_Integer.hxx>
#include <TFunction_ExecutionStatus.hxx>
#include <Standard_OStream.hxx>
class TFunction_Scope;
class TDF_Label;
//! Iterator of the graph of functions
class TFunction_Iterator
{
public:
DEFINE_STANDARD_ALLOC
//! An empty constructor.
Standard_EXPORT TFunction_Iterator();
//! A constructor.
//! Initializes the iterator.
Standard_EXPORT TFunction_Iterator(const TDF_Label& Access);
//! Initializes the Iterator.
Standard_EXPORT virtual void Init (const TDF_Label& Access);
//! Defines the mode of iteration - usage or not of the execution status.
//! If the iterator takes into account the execution status,
//! the method ::Current() returns only "not executed" functions
//! while their status is not changed.
//! If the iterator ignores the execution status,
//! the method ::Current() returns the functions
//! following their dependencies and ignoring the execution status.
Standard_EXPORT void SetUsageOfExecutionStatus (const Standard_Boolean usage);
//! Returns usage of execution status by the iterator.
Standard_EXPORT Standard_Boolean GetUsageOfExecutionStatus() const;
//! Analyses the graph of dependencies and returns
//! maximum number of threads may be used to calculate the model.
Standard_EXPORT virtual Standard_Integer GetMaxNbThreads() const;
//! Returns the current list of functions.
//! If the iterator uses the execution status,
//! the returned list contains only the functions
//! with "not executed" status.
Standard_EXPORT virtual const TDF_LabelList& Current() const;
//! Returns false if the graph of functions is fully iterated.
Standard_EXPORT virtual Standard_Boolean More() const;
//! Switches the iterator to the next list of current functions.
Standard_EXPORT virtual void Next();
//! A help-function aimed to help the user to check the status of retrurned function.
//! It calls TFunction_GraphNode::GetStatus() inside.
Standard_EXPORT TFunction_ExecutionStatus GetStatus (const TDF_Label& func) const;
//! A help-function aimed to help the user to change the execution status of a function.
//! It calls TFunction_GraphNode::SetStatus() inside.
Standard_EXPORT void SetStatus (const TDF_Label& func, const TFunction_ExecutionStatus status) const;
Standard_EXPORT Standard_OStream& Dump (Standard_OStream& OS) const;
protected:
private:
TDF_LabelList myCurrent;
Standard_Boolean myUsageOfExecutionStatus;
TDF_LabelMap myPassedFunctions;
Handle(TFunction_Scope) myScope;
};
#endif // _TFunction_Iterator_HeaderFile

View File

@@ -1,114 +0,0 @@
-- Created on: 1999-07-19
-- Created by: Denis PASCAL
-- Copyright (c) 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.
class Logbook from TFunction
---Purpose: This class contains information which is written and
-- read during the solving process. Information is divided
-- in three groups.
--
-- * Touched Labels (modified by the end user),
-- * Impacted Labels (modified during execution of the function),
-- * Valid Labels (within the valid label scope).
uses Label from TDF,
LabelMap from TDF,
Logbook from TFunction
is
---Purpose: next methods are solving declaration
-- ===================================
Create returns Logbook from TFunction;
Clear (me : in out);
---Purpose: Clears this logbook to its default, empty state.
IsEmpty (me)
returns Boolean from Standard;
SetTouched (me : in out; L : Label from TDF);
---C++ : inline
---Purpose: Sets the label L as a touched label in this logbook.
-- In other words, L is understood to have been modified by the end user.
SetImpacted (me : in out; L : Label from TDF;
WithChildren : Boolean from Standard = Standard_False);
---Purpose: Sets the label L as an impacted label in this logbook.
-- This method is called by execution of the function driver.
SetValid (me : in out; L : Label from TDF;
WithChildren : Boolean from Standard = Standard_False);
---Purpose: Sets the label L as a valid label in this logbook.
ChangeValid (me : in out)
---C++: return &
---C++ : inline
returns LabelMap from TDF;
IsModified (me; L : Label from TDF;
WithChildren : Boolean from Standard = Standard_False)
---Purpose: Returns True if the label L is touched or impacted. This method
-- is called by <TFunction_FunctionDriver::MustExecute>.
-- If <WithChildren> is set to true, the method checks
-- all the sublabels of <L> too.
returns Boolean from Standard;
---Purpose: next method to consult solving result
-- =====================================
GetTouched (me)
---C++: return const &
---C++: inline
---Purpose:
-- Returns the map of touched labels in this logbook.
-- A touched label is the one modified by the end user.
returns LabelMap from TDF;
GetImpacted (me)
---C++: return const &
---C++: inline
---Purpose:
-- Returns the map of impacted labels contained in this logbook.
returns LabelMap from TDF;
GetValid (me)
---C++: return const &
---C++: inline
---Purpose: Returns the map of valid labels in this logbook.
returns LabelMap from TDF;
Done (me : in out; status : Boolean from Standard);
---Purpose: Sets if the execution failed
---C++: inline
IsDone (me)
returns Boolean from Standard;
---C++: inline
Dump(me; stream : in out OStream from Standard)
---C++: return &
returns OStream from Standard;
fields
myTouched : LabelMap from TDF;
myImpacted : LabelMap from TDF;
myValid : LabelMap from TDF;
isDone : Boolean from Standard;
end Logbook;

View File

@@ -14,24 +14,20 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TFunction_Logbook.ixx>
#include <TDF_Tool.hxx>
#include <Standard_OStream.hxx>
#include <TCollection_AsciiString.hxx>
#include <TDF_ChildIterator.hxx>
#include <TDF_Label.hxx>
#include <TDF_LabelMap.hxx>
#include <TDF_MapIteratorOfLabelMap.hxx>
#include <TDF_ChildIterator.hxx>
#include <TCollection_AsciiString.hxx>
#include <Standard_OStream.hxx>
#include <TDF_Tool.hxx>
#include <TFunction_Logbook.hxx>
//=======================================================================
//function : TFunction_Logbook
//purpose : A Logbook creation
//=======================================================================
TFunction_Logbook::TFunction_Logbook():isDone(Standard_False)
{}

View File

@@ -0,0 +1,121 @@
// Created on: 1999-07-19
// Created by: Denis PASCAL
// Copyright (c) 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 _TFunction_Logbook_HeaderFile
#define _TFunction_Logbook_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TDF_LabelMap.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_OStream.hxx>
class TDF_Label;
//! This class contains information which is written and
//! read during the solving process. Information is divided
//! in three groups.
//!
//! * Touched Labels (modified by the end user),
//! * Impacted Labels (modified during execution of the function),
//! * Valid Labels (within the valid label scope).
class TFunction_Logbook
{
public:
DEFINE_STANDARD_ALLOC
//! next methods are solving declaration
//! ===================================
Standard_EXPORT TFunction_Logbook();
//! Clears this logbook to its default, empty state.
Standard_EXPORT void Clear();
Standard_EXPORT Standard_Boolean IsEmpty() const;
//! Sets the label L as a touched label in this logbook.
//! In other words, L is understood to have been modified by the end user.
void SetTouched (const TDF_Label& L);
//! Sets the label L as an impacted label in this logbook.
//! This method is called by execution of the function driver.
Standard_EXPORT void SetImpacted (const TDF_Label& L, const Standard_Boolean WithChildren = Standard_False);
//! Sets the label L as a valid label in this logbook.
Standard_EXPORT void SetValid (const TDF_Label& L, const Standard_Boolean WithChildren = Standard_False);
TDF_LabelMap& ChangeValid();
//! Returns True if the label L is touched or impacted. This method
//! is called by <TFunction_FunctionDriver::MustExecute>.
//! If <WithChildren> is set to true, the method checks
//! all the sublabels of <L> too.
//! next method to consult solving result
//! =====================================
Standard_EXPORT Standard_Boolean IsModified (const TDF_Label& L, const Standard_Boolean WithChildren = Standard_False) const;
//! Returns the map of touched labels in this logbook.
//! A touched label is the one modified by the end user.
const TDF_LabelMap& GetTouched() const;
//! Returns the map of impacted labels contained in this logbook.
const TDF_LabelMap& GetImpacted() const;
//! Returns the map of valid labels in this logbook.
const TDF_LabelMap& GetValid() const;
//! Sets if the execution failed
void Done (const Standard_Boolean status);
Standard_Boolean IsDone() const;
Standard_EXPORT Standard_OStream& Dump (Standard_OStream& stream) const;
protected:
private:
TDF_LabelMap myTouched;
TDF_LabelMap myImpacted;
TDF_LabelMap myValid;
Standard_Boolean isDone;
};
#include <TFunction_Logbook.lxx>
#endif // _TFunction_Logbook_HeaderFile

View File

@@ -1,159 +0,0 @@
-- Created on: 2008-06-22
-- Created by: Vladislav ROMASHKO
-- Copyright (c) 2008-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 Scope from TFunction inherits Attribute from TDF
---Purpose: Keeps a scope of functions.
uses
GUID from Standard,
OStream from Standard,
Attribute from TDF,
RelocationTable from TDF,
DataSet from TDF,
Label from TDF,
Logbook from TFunction,
DoubleMapOfIntegerLabel from TFunction
is
---Purpose: Static methods
-- ==============
Set (myclass; Access : Label from TDF)
---Purpose: Finds or Creates a TFunction_Scope attribute at the root label accessed by <Access>.
-- Returns the attribute.
returns Scope from TFunction;
GetID (myclass)
---Purpose: Returns the GUID for Scope attribute.
---C++: return const &
returns GUID from Standard;
---Purpose: Instant methods
-- ===============
Create
---Purpose: Constructor (empty).
returns Scope from TFunction;
AddFunction (me : mutable;
L : Label from TDF)
---Purpose: Adds a function to the scope of functions.
returns Boolean from Standard;
RemoveFunction (me : mutable;
L : Label from TDF)
---Purpose: Removes a function from the scope of functions.
returns Boolean from Standard;
RemoveFunction (me : mutable;
ID : Integer from Standard)
---Purpose: Removes a function from the scope of functions.
returns Boolean from Standard;
RemoveAllFunctions (me : mutable);
---Purpose: Removes all functions from the scope of functions.
---Category: Access to the functions and their IDs
-- =====================================
HasFunction (me;
ID : Integer from Standard)
---Purpose: Returns true if the function exists with such an ID.
returns Boolean from Standard;
HasFunction (me;
L : Label from TDF)
---Purpose: Returns true if the label contains a function of this scope.
returns Boolean from Standard;
GetFunction (me;
L : Label from TDF)
---Purpose: Returns an ID of the function.
returns Integer from Standard;
GetFunction (me;
ID : Integer from Standard)
---Purpose: Returns the label of the function with this ID.
---C++: return const &
returns Label from TDF;
---Category: Logbook
-- =======
GetLogbook (me : mutable)
---Purpose: Returns the Logbook used in TFunction_Driver methods.
---C++: return &
returns Logbook from TFunction;
---Purpose: Implementation of Attribute methods
-- ===================================
ID (me)
---C++: return const &
returns GUID from Standard;
Restore (me: mutable; with : Attribute from TDF)
is virtual;
Paste (me; into : Attribute from TDF;
RT : RelocationTable from TDF)
is virtual;
NewEmpty (me)
returns Attribute from TDF
is redefined;
Dump (me; anOS : in out OStream from Standard)
---C++: return &
returns OStream from Standard
is redefined;
---Category: Private methods
-- ===============
GetFunctions (me)
---Purpose: Returns the scope of functions.
---C++: return const &
returns DoubleMapOfIntegerLabel from TFunction;
ChangeFunctions (me : mutable)
---Purpose: Returns the scope of functions for modification.
-- Warning: Don't use this method if You are not sure what You do!
---C++: return &
returns DoubleMapOfIntegerLabel from TFunction;
SetFreeID (me : mutable;
ID : Integer from Standard);
GetFreeID (me)
returns Integer from Standard;
fields
myFunctions : DoubleMapOfIntegerLabel from TFunction;
myLogbook : Logbook from TFunction;
myFreeID : Integer from Standard;
end Scope;

View File

@@ -13,14 +13,20 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TFunction_Scope.ixx>
#include <Standard_GUID.hxx>
#include <Standard_Type.hxx>
#include <TDF_Attribute.hxx>
#include <TDF_Label.hxx>
#include <TDF_MapIteratorOfLabelMap.hxx>
#include <TDF_RelocationTable.hxx>
#include <TFunction_Logbook.hxx>
#include <TFunction_Scope.hxx>
//=======================================================================
//function : GetID
//purpose : Static method to get an ID
//=======================================================================
const Standard_GUID& TFunction_Scope::GetID()
{
static Standard_GUID TFunction_ScopeID("F2DE4EFF-7FE8-40a3-AAD5-5B6DDEA83469");

View File

@@ -0,0 +1,135 @@
// Created on: 2008-06-22
// Created by: Vladislav ROMASHKO
// Copyright (c) 2008-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 _TFunction_Scope_HeaderFile
#define _TFunction_Scope_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TFunction_DoubleMapOfIntegerLabel.hxx>
#include <TFunction_Logbook.hxx>
#include <Standard_Integer.hxx>
#include <TDF_Attribute.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_OStream.hxx>
class TDF_Label;
class Standard_GUID;
class TFunction_Logbook;
class TDF_Attribute;
class TDF_RelocationTable;
class TFunction_Scope;
DEFINE_STANDARD_HANDLE(TFunction_Scope, TDF_Attribute)
//! Keeps a scope of functions.
class TFunction_Scope : public TDF_Attribute
{
public:
//! Static methods
//! ==============
//! Finds or Creates a TFunction_Scope attribute at the root label accessed by <Access>.
//! Returns the attribute.
Standard_EXPORT static Handle(TFunction_Scope) Set (const TDF_Label& Access);
//! Returns the GUID for Scope attribute.
//! Instant methods
//! ===============
//! Constructor (empty).
Standard_EXPORT static const Standard_GUID& GetID();
Standard_EXPORT TFunction_Scope();
//! Adds a function to the scope of functions.
Standard_EXPORT Standard_Boolean AddFunction (const TDF_Label& L);
//! Removes a function from the scope of functions.
Standard_EXPORT Standard_Boolean RemoveFunction (const TDF_Label& L);
//! Removes a function from the scope of functions.
Standard_EXPORT Standard_Boolean RemoveFunction (const Standard_Integer ID);
//! Removes all functions from the scope of functions.
Standard_EXPORT void RemoveAllFunctions();
//! Returns true if the function exists with such an ID.
Standard_EXPORT Standard_Boolean HasFunction (const Standard_Integer ID) const;
//! Returns true if the label contains a function of this scope.
Standard_EXPORT Standard_Boolean HasFunction (const TDF_Label& L) const;
//! Returns an ID of the function.
Standard_EXPORT Standard_Integer GetFunction (const TDF_Label& L) const;
//! Returns the label of the function with this ID.
Standard_EXPORT const TDF_Label& GetFunction (const Standard_Integer ID) const;
//! Returns the Logbook used in TFunction_Driver methods.
//! Implementation of Attribute methods
//! ===================================
Standard_EXPORT TFunction_Logbook& GetLogbook();
Standard_EXPORT const Standard_GUID& ID() const;
Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& with);
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const;
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
//! Returns the scope of functions.
Standard_EXPORT const TFunction_DoubleMapOfIntegerLabel& GetFunctions() const;
//! Returns the scope of functions for modification.
//! Warning: Don't use this method if You are not sure what You do!
Standard_EXPORT TFunction_DoubleMapOfIntegerLabel& ChangeFunctions();
Standard_EXPORT void SetFreeID (const Standard_Integer ID);
Standard_EXPORT Standard_Integer GetFreeID() const;
DEFINE_STANDARD_RTTI(TFunction_Scope,TDF_Attribute)
protected:
private:
TFunction_DoubleMapOfIntegerLabel myFunctions;
TFunction_Logbook myLogbook;
Standard_Integer myFreeID;
};
#endif // _TFunction_Scope_HeaderFile