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:
@@ -1,17 +1,116 @@
|
||||
Interface_Array1OfFileParameter.hxx
|
||||
Interface_Array1OfHAsciiString.hxx
|
||||
Interface_BitMap.cxx
|
||||
Interface_BitMap.hxx
|
||||
Interface_Category.cxx
|
||||
Interface_Category.hxx
|
||||
Interface_Check.cxx
|
||||
Interface_Check.hxx
|
||||
Interface_CheckFailure.hxx
|
||||
Interface_CheckIterator.cxx
|
||||
Interface_CheckIterator.hxx
|
||||
Interface_CheckStatus.hxx
|
||||
Interface_CheckTool.cxx
|
||||
Interface_CheckTool.hxx
|
||||
Interface_CopyControl.cxx
|
||||
Interface_CopyControl.hxx
|
||||
Interface_CopyMap.cxx
|
||||
Interface_CopyMap.hxx
|
||||
Interface_CopyTool.cxx
|
||||
Interface_CopyTool.hxx
|
||||
Interface_DataMapIteratorOfDataMapOfTransientInteger.hxx
|
||||
Interface_DataMapOfTransientInteger.hxx
|
||||
Interface_DataState.hxx
|
||||
Interface_EntityCluster.cxx
|
||||
Interface_EntityCluster.hxx
|
||||
Interface_EntityIterator.cxx
|
||||
Interface_EntityIterator.hxx
|
||||
Interface_EntityList.cxx
|
||||
Interface_EntityList.hxx
|
||||
Interface_FileParameter.cxx
|
||||
Interface_FileParameter.hxx
|
||||
Interface_FileReaderData.cxx
|
||||
Interface_FileReaderData.hxx
|
||||
Interface_FileReaderTool.cxx
|
||||
Interface_FileReaderTool.hxx
|
||||
Interface_FloatWriter.cxx
|
||||
Interface_FloatWriter.hxx
|
||||
Interface_GeneralLib.hxx
|
||||
Interface_GeneralLib_0.cxx
|
||||
Interface_GeneralModule.cxx
|
||||
Interface_GeneralModule.hxx
|
||||
Interface_GlobalNodeOfGeneralLib.hxx
|
||||
Interface_GlobalNodeOfGeneralLib_0.cxx
|
||||
Interface_GlobalNodeOfReaderLib.hxx
|
||||
Interface_GlobalNodeOfReaderLib_0.cxx
|
||||
Interface_Graph.cxx
|
||||
Interface_Graph.hxx
|
||||
Interface_GraphContent.cxx
|
||||
Interface_GraphContent.hxx
|
||||
Interface_GTool.cxx
|
||||
Interface_GTool.hxx
|
||||
Interface_HArray1OfHAsciiString.hxx
|
||||
Interface_HGraph.cxx
|
||||
Interface_HGraph.hxx
|
||||
Interface_HSequenceOfCheck.hxx
|
||||
Interface_IndexedMapOfAsciiString.hxx
|
||||
Interface_InterfaceError.hxx
|
||||
Interface_InterfaceMismatch.hxx
|
||||
Interface_InterfaceModel.cxx
|
||||
Interface_InterfaceModel.hxx
|
||||
Interface_IntList.cxx
|
||||
Interface_IntList.hxx
|
||||
Interface_IntVal.cxx
|
||||
Interface_IntVal.hxx
|
||||
Interface_JaggedArray.gxx
|
||||
Interface_LineBuffer.cxx
|
||||
Interface_LineBuffer.hxx
|
||||
Interface_Macros.hxx
|
||||
Interface_MapAsciiStringHasher.cxx
|
||||
Interface_MapAsciiStringHasher.hxx
|
||||
Interface_MSG.cxx
|
||||
Interface_MSG.hxx
|
||||
Interface_NodeOfGeneralLib.hxx
|
||||
Interface_NodeOfGeneralLib_0.cxx
|
||||
Interface_NodeOfReaderLib.hxx
|
||||
Interface_NodeOfReaderLib_0.cxx
|
||||
Interface_ParamList.cxx
|
||||
Interface_ParamList.hxx
|
||||
Interface_ParamList.lxx
|
||||
Interface_ParamSet.cxx
|
||||
Interface_ParamSet.hxx
|
||||
Interface_ParamType.hxx
|
||||
Interface_Protocol.cxx
|
||||
Interface_Protocol.hxx
|
||||
Interface_ReaderLib.hxx
|
||||
Interface_ReaderLib_0.cxx
|
||||
Interface_ReaderModule.cxx
|
||||
Interface_ReaderModule.hxx
|
||||
Interface_Recognizer.gxx
|
||||
Interface_ReportEntity.cxx
|
||||
Interface_ReportEntity.hxx
|
||||
Interface_SequenceOfCheck.hxx
|
||||
Interface_ShareFlags.cxx
|
||||
Interface_ShareFlags.hxx
|
||||
Interface_ShareTool.cxx
|
||||
Interface_ShareTool.hxx
|
||||
Interface_SignLabel.cxx
|
||||
Interface_SignLabel.hxx
|
||||
Interface_SignType.cxx
|
||||
Interface_SignType.hxx
|
||||
Interface_STAT.cxx
|
||||
Interface_STAT.hxx
|
||||
Interface_Static.cxx
|
||||
Interface_Static.hxx
|
||||
Interface_Statics.hxx
|
||||
Interface_StaticSatisfies.hxx
|
||||
Interface_StaticStandards.cxx
|
||||
Interface_Translates.hxx
|
||||
Interface_TypedValue.cxx
|
||||
Interface_TypedValue.hxx
|
||||
Interface_UndefinedContent.cxx
|
||||
Interface_UndefinedContent.hxx
|
||||
Interface_ValueInterpret.hxx
|
||||
Interface_ValueSatisfies.hxx
|
||||
Interface_Translates.hxx
|
||||
Interface_StaticStandards.cxx
|
||||
Interface_Version.hxx
|
||||
Interface_VectorOfFileParameter.hxx
|
||||
Interface_SequenceOfCheck.hxx
|
||||
Interface_HSequenceOfCheck.hxx
|
||||
Interface_Array1OfFileParameter.hxx
|
||||
Interface_DataMapOfTransientInteger.hxx
|
||||
Interface_DataMapIteratorOfDataMapOfTransientInteger.hxx
|
||||
Interface_Array1OfHAsciiString.hxx
|
||||
Interface_HArray1OfHAsciiString.hxx
|
||||
Interface_IndexedMapOfAsciiString.hxx
|
||||
Interface_Version.hxx
|
||||
|
@@ -1,153 +0,0 @@
|
||||
-- Created on: 1992-02-03
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
package Interface
|
||||
|
||||
---Purpose : defines a general frame for interface data
|
||||
-- used to manipulate results of normalized Interface outputs
|
||||
-- (i.e. files), also as a basis to define transfer operations
|
||||
-- (in other packages : see package Transfer)
|
||||
|
||||
uses LibCtl, TCollection, TColStd, MMgt, Standard, Dico, MoniTool, Message
|
||||
|
||||
is
|
||||
|
||||
deferred class InterfaceModel;
|
||||
|
||||
-- -- Data Definitions -- --
|
||||
|
||||
class UndefinedContent;
|
||||
class ReportEntity;
|
||||
|
||||
class EntityList; -- for an (ordered) little list of Entities
|
||||
private class EntityCluster; -- ancillary class for the former
|
||||
generic class JaggedArray; -- to turn arround limitation on Array(Array)
|
||||
|
||||
-- -- Auxiliary Classes (results, working data) -- --
|
||||
|
||||
class IntVal;
|
||||
class EntityIterator;
|
||||
|
||||
class Graph;
|
||||
class GraphContent;
|
||||
class HGraph;
|
||||
class IntList;
|
||||
class BitMap;
|
||||
|
||||
class Check;
|
||||
class CheckIterator;
|
||||
|
||||
-- -- General Services -- --
|
||||
|
||||
deferred class Protocol; -- manages also Active Protocol
|
||||
deferred class GeneralModule; -- (Shareds,Check,Copy,Trace)
|
||||
class GeneralLib instantiates Library from LibCtl
|
||||
(Transient, GeneralModule, Protocol from Interface);
|
||||
|
||||
class GTool;
|
||||
|
||||
class ShareTool;
|
||||
class ShareFlags;
|
||||
class CheckTool;
|
||||
|
||||
class CopyTool;
|
||||
deferred class CopyControl;
|
||||
class CopyMap;
|
||||
|
||||
class Category;
|
||||
deferred class SignType;
|
||||
class SignLabel;
|
||||
|
||||
class TypedValue;
|
||||
class Static;
|
||||
imported ValueSatisfies;
|
||||
-- (val : HAsciiString) returns Boolean, see Satisfies from TypedValue
|
||||
imported ValueInterpret;
|
||||
-- (typval : TypedValue; hval : HAsciiString; native : Boolean)
|
||||
-- returns HAsciiString, see Interpret from TypedValue
|
||||
imported StaticSatisfies;
|
||||
-- Function to be added to a Static for specific Satisfies
|
||||
|
||||
deferred generic class Recognizer; -- aimed to create Interface Entities
|
||||
|
||||
-- -- File Access (Read & Write) -- --
|
||||
|
||||
deferred class ReaderModule;
|
||||
class ReaderLib instantiates Library from LibCtl
|
||||
(Transient, ReaderModule, Protocol from Interface);
|
||||
|
||||
imported VectorOfFileParameter;
|
||||
class FileParameter;
|
||||
class ParamSet; -- see also ParamList
|
||||
class ParamList;
|
||||
deferred class FileReaderData;
|
||||
deferred class FileReaderTool;
|
||||
|
||||
class LineBuffer;
|
||||
class FloatWriter;
|
||||
|
||||
class MSG;
|
||||
class STAT;
|
||||
|
||||
-- -- Enumerations -- --
|
||||
|
||||
enumeration ParamType is
|
||||
ParamMisc, ParamInteger, ParamReal, ParamIdent, ParamVoid, ParamText,
|
||||
ParamEnum, ParamLogical, ParamSub, ParamHexa, ParamBinary;
|
||||
|
||||
enumeration DataState is
|
||||
StateOK, LoadWarning, LoadFail, DataWarning, DataFail,
|
||||
StateUnloaded, StateUnknown;
|
||||
---Purpose : validity state of anentity's content (see InterfaceModel)
|
||||
|
||||
enumeration CheckStatus is
|
||||
CheckOK, CheckWarning, CheckFail, CheckAny, CheckMessage, CheckNoFail;
|
||||
---Purpose : Classifies checks
|
||||
-- OK : check is empty Warning : Warning, no Fail Fail : Fail
|
||||
-- Others to query :
|
||||
-- Any : any status Message : Warning/Fail NoFail : Warning/OK
|
||||
|
||||
-- -- Exceptions -- --
|
||||
|
||||
exception InterfaceError inherits Failure;
|
||||
exception InterfaceMismatch inherits InterfaceError;
|
||||
exception CheckFailure inherits InterfaceError;
|
||||
|
||||
-- -- Instantiations -- --
|
||||
|
||||
imported SequenceOfCheck;
|
||||
imported transient class HSequenceOfCheck;
|
||||
|
||||
imported Array1OfFileParameter;
|
||||
|
||||
-- Useful Instantiations to define Data
|
||||
|
||||
imported DataMapOfTransientInteger;
|
||||
|
||||
imported DataMapIteratorOfDataMapOfTransientInteger;
|
||||
|
||||
imported Array1OfHAsciiString;
|
||||
|
||||
imported transient class HArray1OfHAsciiString;
|
||||
|
||||
-- ==============IndexedMapOfAsciiString===================
|
||||
class MapAsciiStringHasher; -- instantiates MapHasher from TCollection;
|
||||
|
||||
imported IndexedMapOfAsciiString;
|
||||
|
||||
-- ==================================
|
||||
|
||||
end Interface;
|
@@ -1,144 +0,0 @@
|
||||
-- Created on: 1995-09-01
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class BitMap from Interface
|
||||
|
||||
---Purpose : A bit map simply allows to associate a boolean flag to each
|
||||
-- item of a list, such as a list of entities, etc... numbered
|
||||
-- between 1 and a positive count nbitems
|
||||
--
|
||||
-- The BitMap class allows to associate several binary flags,
|
||||
-- each of one is identified by a number from 0 to a count
|
||||
-- which can remain at zero or be positive : nbflags
|
||||
--
|
||||
-- Flags lists over than numflag=0 are added after creation
|
||||
-- Each of one can be named, hence the user can identify it
|
||||
-- either by its flag number or by a name which gives a flag n0
|
||||
-- (flag n0 0 has no name)
|
||||
|
||||
uses CString, HSequenceOfAsciiString from TColStd,
|
||||
HArray1OfInteger from TColStd
|
||||
|
||||
is
|
||||
|
||||
Create returns BitMap;
|
||||
---Purpose : Creates a empty BitMap
|
||||
|
||||
Create (nbitems : Integer; resflags : Integer = 0) returns BitMap;
|
||||
---Purpose : Creates a BitMap for <nbitems> items
|
||||
-- One flag is defined, n0 0
|
||||
-- <resflags> prepares allocation for <resflags> more flags
|
||||
-- Flags values start at false
|
||||
|
||||
Initialize(me : in out; nbitems : Integer; resflags : Integer = 0);
|
||||
---Purpose : Initialize empty bit by <nbitems> items
|
||||
-- One flag is defined, n0 0
|
||||
-- <resflags> prepares allocation for <resflags> more flags
|
||||
-- Flags values start at false
|
||||
|
||||
Create (other : BitMap; copied : Boolean = Standard_False) returns BitMap;
|
||||
---Purpose : Creates a BitMap from another one
|
||||
-- if <copied> is True, copies data
|
||||
-- else, data are not copied, only the header object is
|
||||
|
||||
Initialize(me : in out; other : BitMap; copied : Boolean = Standard_False);
|
||||
---Purpose : Initialize a BitMap from another one
|
||||
|
||||
Internals (me; nbitems , nbwords, nbflags : out Integer;
|
||||
flags : out HArray1OfInteger;
|
||||
names : out HSequenceOfAsciiString);
|
||||
---Purpose : Returns internal values, used for copying
|
||||
-- Flags values start at false
|
||||
|
||||
Reservate (me : in out; moreflags : Integer);
|
||||
---Purpose : Reservates for a count of more flags
|
||||
|
||||
SetLength (me : in out; nbitems : Integer);
|
||||
---Purpose : Sets for a new count of items, which can be either less or
|
||||
-- greater than the former one
|
||||
-- For new items, their flags start at false
|
||||
|
||||
AddFlag (me : in out; name : CString = "") returns Integer;
|
||||
---Purpose : Adds a flag, a name can be attached to it
|
||||
-- Returns its flag number
|
||||
-- Makes required reservation
|
||||
|
||||
AddSomeFlags (me : in out; more : Integer) returns Integer;
|
||||
---Purpose : Adds several flags (<more>) with no name
|
||||
-- Returns the number of last added flag
|
||||
|
||||
RemoveFlag (me : in out; num : Integer) returns Boolean;
|
||||
---Purpose : Removes a flag given its number.
|
||||
-- Returns True if done, false if num is out of range
|
||||
|
||||
SetFlagName (me : in out; num : Integer; name : CString) returns Boolean;
|
||||
---Purpose : Sets a name for a flag, given its number
|
||||
-- name can be empty (to erase the name of a flag)
|
||||
-- Returns True if done, false if : num is out of range, or
|
||||
-- name non-empty already set to another flag
|
||||
|
||||
NbFlags (me) returns Integer;
|
||||
---Purpose : Returns the count of flags (flag 0 not included)
|
||||
|
||||
Length (me) returns Integer;
|
||||
---Purpose : Returns the count of items (i.e. the length of the bitmap)
|
||||
|
||||
FlagName (me; num : Integer) returns CString;
|
||||
---Purpose : Returns the name recorded for a flag, or an empty string
|
||||
|
||||
FlagNumber (me; name : CString) returns Integer;
|
||||
---Purpose : Returns the number or a flag given its name, or zero
|
||||
|
||||
-- Access to flag values --
|
||||
|
||||
Value (me; item : Integer; flag : Integer = 0) returns Boolean;
|
||||
---Purpose : Returns the value (true/false) of a flag, from :
|
||||
-- - the number of the item
|
||||
-- - the flag number, by default 0
|
||||
|
||||
SetValue (me; item : Integer; val : Boolean; flag : Integer = 0);
|
||||
---Purpose : Sets a new value for a flag
|
||||
|
||||
SetTrue (me; item : Integer; flag : Integer = 0);
|
||||
---Purpose : Sets a flag to True
|
||||
|
||||
SetFalse (me; item : Integer; flag : Integer = 0);
|
||||
---Purpose : Sets a flag to False
|
||||
|
||||
CTrue (me; item : Integer; flag : Integer = 0) returns Boolean;
|
||||
---Purpose : Returns the former value for a flag and sets it to True
|
||||
-- (before : value returned; after : True)
|
||||
|
||||
CFalse (me; item : Integer; flag : Integer = 0) returns Boolean;
|
||||
---Purpose : Returns the former value for a flag and sets it to False
|
||||
-- (before : value returned; after : False)
|
||||
|
||||
Init (me; val : Boolean; flag : Integer = 0);
|
||||
---Purpose : Initialises all the values of Flag Number <flag> to a given
|
||||
-- value <val>
|
||||
|
||||
Clear(me: in out);
|
||||
---Purpose : Clear all field of bit map
|
||||
|
||||
fields
|
||||
|
||||
thenbitems : Integer;
|
||||
thenbwords : Integer;
|
||||
thenbflags : Integer;
|
||||
theflags : HArray1OfInteger;
|
||||
thenames : HSequenceOfAsciiString;
|
||||
|
||||
end BitMap;
|
@@ -11,9 +11,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_BitMap.ixx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
#include <Interface_BitMap.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Interface_BitMap::Interface_BitMap()
|
||||
{
|
||||
|
173
src/Interface/Interface_BitMap.hxx
Normal file
173
src/Interface/Interface_BitMap.hxx
Normal file
@@ -0,0 +1,173 @@
|
||||
// Created on: 1995-09-01
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_BitMap_HeaderFile
|
||||
#define _Interface_BitMap_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HSequenceOfAsciiString.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
|
||||
|
||||
//! A bit map simply allows to associate a boolean flag to each
|
||||
//! item of a list, such as a list of entities, etc... numbered
|
||||
//! between 1 and a positive count nbitems
|
||||
//!
|
||||
//! The BitMap class allows to associate several binary flags,
|
||||
//! each of one is identified by a number from 0 to a count
|
||||
//! which can remain at zero or be positive : nbflags
|
||||
//!
|
||||
//! Flags lists over than numflag=0 are added after creation
|
||||
//! Each of one can be named, hence the user can identify it
|
||||
//! either by its flag number or by a name which gives a flag n0
|
||||
//! (flag n0 0 has no name)
|
||||
class Interface_BitMap
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a empty BitMap
|
||||
Standard_EXPORT Interface_BitMap();
|
||||
|
||||
//! Creates a BitMap for <nbitems> items
|
||||
//! One flag is defined, n0 0
|
||||
//! <resflags> prepares allocation for <resflags> more flags
|
||||
//! Flags values start at false
|
||||
Standard_EXPORT Interface_BitMap(const Standard_Integer nbitems, const Standard_Integer resflags = 0);
|
||||
|
||||
//! Initialize empty bit by <nbitems> items
|
||||
//! One flag is defined, n0 0
|
||||
//! <resflags> prepares allocation for <resflags> more flags
|
||||
//! Flags values start at false
|
||||
Standard_EXPORT void Initialize (const Standard_Integer nbitems, const Standard_Integer resflags = 0);
|
||||
|
||||
//! Creates a BitMap from another one
|
||||
//! if <copied> is True, copies data
|
||||
//! else, data are not copied, only the header object is
|
||||
Standard_EXPORT Interface_BitMap(const Interface_BitMap& other, const Standard_Boolean copied = Standard_False);
|
||||
|
||||
//! Initialize a BitMap from another one
|
||||
Standard_EXPORT void Initialize (const Interface_BitMap& other, const Standard_Boolean copied = Standard_False);
|
||||
|
||||
//! Returns internal values, used for copying
|
||||
//! Flags values start at false
|
||||
Standard_EXPORT void Internals (Standard_Integer& nbitems, Standard_Integer& nbwords, Standard_Integer& nbflags, Handle(TColStd_HArray1OfInteger)& flags, Handle(TColStd_HSequenceOfAsciiString)& names) const;
|
||||
|
||||
//! Reservates for a count of more flags
|
||||
Standard_EXPORT void Reservate (const Standard_Integer moreflags);
|
||||
|
||||
//! Sets for a new count of items, which can be either less or
|
||||
//! greater than the former one
|
||||
//! For new items, their flags start at false
|
||||
Standard_EXPORT void SetLength (const Standard_Integer nbitems);
|
||||
|
||||
//! Adds a flag, a name can be attached to it
|
||||
//! Returns its flag number
|
||||
//! Makes required reservation
|
||||
Standard_EXPORT Standard_Integer AddFlag (const Standard_CString name = "");
|
||||
|
||||
//! Adds several flags (<more>) with no name
|
||||
//! Returns the number of last added flag
|
||||
Standard_EXPORT Standard_Integer AddSomeFlags (const Standard_Integer more);
|
||||
|
||||
//! Removes a flag given its number.
|
||||
//! Returns True if done, false if num is out of range
|
||||
Standard_EXPORT Standard_Boolean RemoveFlag (const Standard_Integer num);
|
||||
|
||||
//! Sets a name for a flag, given its number
|
||||
//! name can be empty (to erase the name of a flag)
|
||||
//! Returns True if done, false if : num is out of range, or
|
||||
//! name non-empty already set to another flag
|
||||
Standard_EXPORT Standard_Boolean SetFlagName (const Standard_Integer num, const Standard_CString name);
|
||||
|
||||
//! Returns the count of flags (flag 0 not included)
|
||||
Standard_EXPORT Standard_Integer NbFlags() const;
|
||||
|
||||
//! Returns the count of items (i.e. the length of the bitmap)
|
||||
Standard_EXPORT Standard_Integer Length() const;
|
||||
|
||||
//! Returns the name recorded for a flag, or an empty string
|
||||
Standard_EXPORT Standard_CString FlagName (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the number or a flag given its name, or zero
|
||||
Standard_EXPORT Standard_Integer FlagNumber (const Standard_CString name) const;
|
||||
|
||||
//! Returns the value (true/false) of a flag, from :
|
||||
//! - the number of the item
|
||||
//! - the flag number, by default 0
|
||||
Standard_EXPORT Standard_Boolean Value (const Standard_Integer item, const Standard_Integer flag = 0) const;
|
||||
|
||||
//! Sets a new value for a flag
|
||||
Standard_EXPORT void SetValue (const Standard_Integer item, const Standard_Boolean val, const Standard_Integer flag = 0) const;
|
||||
|
||||
//! Sets a flag to True
|
||||
Standard_EXPORT void SetTrue (const Standard_Integer item, const Standard_Integer flag = 0) const;
|
||||
|
||||
//! Sets a flag to False
|
||||
Standard_EXPORT void SetFalse (const Standard_Integer item, const Standard_Integer flag = 0) const;
|
||||
|
||||
//! Returns the former value for a flag and sets it to True
|
||||
//! (before : value returned; after : True)
|
||||
Standard_EXPORT Standard_Boolean CTrue (const Standard_Integer item, const Standard_Integer flag = 0) const;
|
||||
|
||||
//! Returns the former value for a flag and sets it to False
|
||||
//! (before : value returned; after : False)
|
||||
Standard_EXPORT Standard_Boolean CFalse (const Standard_Integer item, const Standard_Integer flag = 0) const;
|
||||
|
||||
//! Initialises all the values of Flag Number <flag> to a given
|
||||
//! value <val>
|
||||
Standard_EXPORT void Init (const Standard_Boolean val, const Standard_Integer flag = 0) const;
|
||||
|
||||
//! Clear all field of bit map
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Integer thenbitems;
|
||||
Standard_Integer thenbwords;
|
||||
Standard_Integer thenbflags;
|
||||
Handle(TColStd_HArray1OfInteger) theflags;
|
||||
Handle(TColStd_HSequenceOfAsciiString) thenames;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_BitMap_HeaderFile
|
@@ -1,99 +0,0 @@
|
||||
-- Created on: 1995-11-08
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Category from Interface
|
||||
|
||||
---Purpose : This class manages categories
|
||||
-- A category is defined by a name and a number, and can be
|
||||
-- seen as a way of rough classification, i.e. less precise than
|
||||
-- a cdl type.
|
||||
-- Hence, it is possible to dispatch every entity in about
|
||||
-- a dozen of categories, twenty is a reasonable maximum.
|
||||
--
|
||||
-- Basically, the system provides the following categories :
|
||||
-- Shape (Geometry, BRep, CSG, Features, etc...)
|
||||
-- Drawing (Drawing, Views, Annotations, Pictures, Scketches ...)
|
||||
-- Structure (Component & Part, Groups & Patterns ...)
|
||||
-- Description (Meta-Data : Relations, Properties, Product ...)
|
||||
-- Auxiliary (those which do not enter in the above list)
|
||||
-- and some dedicated categories
|
||||
-- FEA , Kinematics , Piping , etc...
|
||||
-- plus Professional for other dedicated non-classed categories
|
||||
--
|
||||
-- In addition, this class provides a way to compute then quickly
|
||||
-- query category numbers for an entire model.
|
||||
-- Values are just recorded as a list of numbers, control must
|
||||
-- then be done in a wider context (which must provide a Graph)
|
||||
|
||||
uses Integer, CString, Transient, HArray1OfInteger from TColStd,
|
||||
Protocol, GTool, InterfaceModel, ShareTool
|
||||
|
||||
is
|
||||
|
||||
Create returns Category;
|
||||
---Purpose : Creates a Category, with no protocol yet
|
||||
|
||||
Create (proto : Protocol) returns Category;
|
||||
---Purpose : Creates a Category with a given protocol
|
||||
|
||||
Create (gtool : GTool) returns Category;
|
||||
---Purpose : Creates a Category with a given GTool
|
||||
|
||||
SetProtocol (me : in out; proto : Protocol);
|
||||
---Purpose : Sets/Changes Protocol
|
||||
|
||||
CatNum (me : in out; ent : Transient; shares : ShareTool) returns Integer;
|
||||
---Purpose : Determines the Category Number for an entity in its context,
|
||||
-- by using general service CategoryNumber
|
||||
|
||||
ClearNums (me : in out);
|
||||
---Purpose : Clears the recorded list of category numbers for a Model
|
||||
|
||||
Compute (me : in out; model : InterfaceModel; shares : ShareTool);
|
||||
---Purpose : Computes the Category Number for each entity and records it,
|
||||
-- in an array (ent.number -> category number)
|
||||
-- Hence, it can be queried by the method Num.
|
||||
-- The Model itself is not recorded, this method is intended to
|
||||
-- be used in a wider context (which detains also a Graph, etc)
|
||||
|
||||
Num (me; nument : Integer) returns Integer;
|
||||
---Purpose : Returns the category number recorded for an entity number
|
||||
-- Returns 0 if out of range
|
||||
|
||||
AddCategory (myclass; name : CString) returns Integer;
|
||||
---Purpose : Records a new Category defined by its names, produces a number
|
||||
-- New if not yet recorded
|
||||
|
||||
NbCategories (myclass) returns Integer;
|
||||
---Purpose : Returns the count of recorded categories
|
||||
|
||||
Name (myclass; num : Integer) returns CString;
|
||||
---Purpose : Returns the name of a category, according to its number
|
||||
|
||||
Number (myclass; name : CString) returns Integer;
|
||||
---Purpose : Returns the number of a category, according to its name
|
||||
|
||||
|
||||
Init (myclass);
|
||||
---Purpose : Default initialisation
|
||||
-- (protected against several calls : passes only once)
|
||||
|
||||
fields
|
||||
|
||||
thegtool : GTool;
|
||||
thenum : HArray1OfInteger;
|
||||
|
||||
end Category;
|
@@ -11,10 +11,16 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_Category.ixx>
|
||||
|
||||
#include <Interface_Category.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_GTool.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_ShareTool.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColStd_SequenceOfAsciiString.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
|
||||
static int init = 0;
|
||||
static Standard_CString unspec = "unspecified";
|
||||
|
134
src/Interface/Interface_Category.hxx
Normal file
134
src/Interface/Interface_Category.hxx
Normal file
@@ -0,0 +1,134 @@
|
||||
// Created on: 1995-11-08
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_Category_HeaderFile
|
||||
#define _Interface_Category_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
class Interface_GTool;
|
||||
class Interface_Protocol;
|
||||
class Standard_Transient;
|
||||
class Interface_ShareTool;
|
||||
class Interface_InterfaceModel;
|
||||
|
||||
|
||||
//! This class manages categories
|
||||
//! A category is defined by a name and a number, and can be
|
||||
//! seen as a way of rough classification, i.e. less precise than
|
||||
//! a cdl type.
|
||||
//! Hence, it is possible to dispatch every entity in about
|
||||
//! a dozen of categories, twenty is a reasonable maximum.
|
||||
//!
|
||||
//! Basically, the system provides the following categories :
|
||||
//! Shape (Geometry, BRep, CSG, Features, etc...)
|
||||
//! Drawing (Drawing, Views, Annotations, Pictures, Scketches ...)
|
||||
//! Structure (Component & Part, Groups & Patterns ...)
|
||||
//! Description (Meta-Data : Relations, Properties, Product ...)
|
||||
//! Auxiliary (those which do not enter in the above list)
|
||||
//! and some dedicated categories
|
||||
//! FEA , Kinematics , Piping , etc...
|
||||
//! plus Professional for other dedicated non-classed categories
|
||||
//!
|
||||
//! In addition, this class provides a way to compute then quickly
|
||||
//! query category numbers for an entire model.
|
||||
//! Values are just recorded as a list of numbers, control must
|
||||
//! then be done in a wider context (which must provide a Graph)
|
||||
class Interface_Category
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a Category, with no protocol yet
|
||||
Standard_EXPORT Interface_Category();
|
||||
|
||||
//! Creates a Category with a given protocol
|
||||
Standard_EXPORT Interface_Category(const Handle(Interface_Protocol)& proto);
|
||||
|
||||
//! Creates a Category with a given GTool
|
||||
Standard_EXPORT Interface_Category(const Handle(Interface_GTool)& gtool);
|
||||
|
||||
//! Sets/Changes Protocol
|
||||
Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& proto);
|
||||
|
||||
//! Determines the Category Number for an entity in its context,
|
||||
//! by using general service CategoryNumber
|
||||
Standard_EXPORT Standard_Integer CatNum (const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares);
|
||||
|
||||
//! Clears the recorded list of category numbers for a Model
|
||||
Standard_EXPORT void ClearNums();
|
||||
|
||||
//! Computes the Category Number for each entity and records it,
|
||||
//! in an array (ent.number -> category number)
|
||||
//! Hence, it can be queried by the method Num.
|
||||
//! The Model itself is not recorded, this method is intended to
|
||||
//! be used in a wider context (which detains also a Graph, etc)
|
||||
Standard_EXPORT void Compute (const Handle(Interface_InterfaceModel)& model, const Interface_ShareTool& shares);
|
||||
|
||||
//! Returns the category number recorded for an entity number
|
||||
//! Returns 0 if out of range
|
||||
Standard_EXPORT Standard_Integer Num (const Standard_Integer nument) const;
|
||||
|
||||
//! Records a new Category defined by its names, produces a number
|
||||
//! New if not yet recorded
|
||||
Standard_EXPORT static Standard_Integer AddCategory (const Standard_CString name);
|
||||
|
||||
//! Returns the count of recorded categories
|
||||
Standard_EXPORT static Standard_Integer NbCategories();
|
||||
|
||||
//! Returns the name of a category, according to its number
|
||||
Standard_EXPORT static Standard_CString Name (const Standard_Integer num);
|
||||
|
||||
//! Returns the number of a category, according to its name
|
||||
Standard_EXPORT static Standard_Integer Number (const Standard_CString name);
|
||||
|
||||
//! Default initialisation
|
||||
//! (protected against several calls : passes only once)
|
||||
Standard_EXPORT static void Init();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Interface_GTool) thegtool;
|
||||
Handle(TColStd_HArray1OfInteger) thenum;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_Category_HeaderFile
|
@@ -1,265 +0,0 @@
|
||||
-- Created on: 1992-02-03
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Check from Interface inherits TShared
|
||||
|
||||
---Purpose : Defines a Check, as a list of Fail or Warning Messages under
|
||||
-- a literal form, which can be empty. A Check can also bring an
|
||||
-- Entity, which is the Entity to which the messages apply
|
||||
-- (this Entity may be any Transient Object).
|
||||
--
|
||||
-- Messages can be stored in two forms : the definitive form
|
||||
-- (the only one by default), and another form, the original
|
||||
-- form, which can be different if it contains values to be
|
||||
-- inserted (integers, reals, strings)
|
||||
-- The original form can be more suitable for some operations
|
||||
-- such as counting messages
|
||||
|
||||
uses Integer, Boolean, Transient from Standard,
|
||||
CString, HAsciiString from TCollection,
|
||||
HSequenceOfHAsciiString from TColStd,
|
||||
Msg from Message,
|
||||
Messenger from Message,
|
||||
CheckStatus from Interface
|
||||
|
||||
raises OutOfRange
|
||||
|
||||
is
|
||||
|
||||
Create returns Check;
|
||||
---Purpose : Allows definition of a Sequence. Used also for Global Check
|
||||
-- of an InterfaceModel (which stores global messages for file)
|
||||
|
||||
Create (anentity : Transient) returns Check;
|
||||
---Purpose : Defines a Check on an Entity
|
||||
|
||||
|
||||
SendFail (me : mutable; amsg : Msg from Message);
|
||||
---Purpose : New name for AddFail (Msg)
|
||||
|
||||
AddFail (me : mutable; amess : HAsciiString from TCollection) is static;
|
||||
---Purpose : Records a new Fail message
|
||||
|
||||
AddFail (me : mutable; amess,orig : HAsciiString from TCollection) is static;
|
||||
---Purpose : Records a new Fail message under two forms : final,original
|
||||
|
||||
AddFail (me : mutable; amess : CString; orig : CString = "") is static;
|
||||
---Purpose : Records a new Fail message given as "error text" directly
|
||||
-- If <orig> is given, a distinct original form is recorded
|
||||
-- else (D), the original form equates <amess>
|
||||
|
||||
AddFail (me : mutable; amsg : Msg from Message);
|
||||
---Purpose : Records a new Fail from the definition of a Msg (Original+Value)
|
||||
|
||||
HasFailed (me) returns Boolean is static;
|
||||
---Purpose : Returns True if Check brings at least one Fail Message
|
||||
|
||||
NbFails (me) returns Integer is static;
|
||||
---Purpose : Returns count of recorded Fails
|
||||
|
||||
Fail (me; num : Integer; final : Boolean = Standard_True)
|
||||
returns HAsciiString from TCollection
|
||||
---Purpose : Returns Fail Message as a String
|
||||
-- Final form by default, Original form if <final> is False
|
||||
raises OutOfRange is static;
|
||||
-- Error if <num> is out of range
|
||||
---C++ : return const &
|
||||
|
||||
CFail (me; num : Integer; final : Boolean = Standard_True) returns CString
|
||||
---Purpose : Same as above, but returns a CString (to be printed ...)
|
||||
-- Final form by default, Original form if <final> is False
|
||||
raises OutOfRange is static;
|
||||
|
||||
Fails (me; final : Boolean = Standard_True) returns HSequenceOfHAsciiString
|
||||
is static;
|
||||
---Purpose : Returns the list of Fails, for a frontal-engine logic
|
||||
-- Final forms by default, Original forms if <final> is False
|
||||
-- Can be empty
|
||||
|
||||
|
||||
SendWarning (me : mutable; amsg : Msg from Message);
|
||||
---Purpose : New name for AddWarning
|
||||
|
||||
AddWarning (me : mutable; amess : HAsciiString from TCollection) is static;
|
||||
---Purpose : Records a new Warning message
|
||||
|
||||
AddWarning (me : mutable; amess,orig : HAsciiString from TCollection) is static;
|
||||
---Purpose : Records a new Warning message under two forms : final,original
|
||||
|
||||
AddWarning (me : mutable; amess : CString; orig : CString = "") is static;
|
||||
---Purpose : Records a Warning message given as "warning message" directly
|
||||
-- If <orig> is given, a distinct original form is recorded
|
||||
-- else (D), the original form equates <amess>
|
||||
|
||||
AddWarning (me : mutable; amsg : Msg from Message);
|
||||
---Purpose : Records a new Warning from the definition of a Msg (Original+Value)
|
||||
|
||||
HasWarnings (me) returns Boolean is static;
|
||||
---Purpose : Returns True if Check brings at least one Warning Message
|
||||
|
||||
NbWarnings (me) returns Integer is static;
|
||||
---Purpose : Returns count of recorded Warning messages
|
||||
|
||||
Warning (me; num : Integer; final : Boolean = Standard_True)
|
||||
returns HAsciiString from TCollection
|
||||
---Purpose : Returns Warning message as a String
|
||||
-- Final form by default, Original form if <final> is False
|
||||
raises OutOfRange is static;
|
||||
-- Error if <num> is out of range
|
||||
---C++ : return const &
|
||||
|
||||
CWarning (me; num : Integer; final : Boolean = Standard_True) returns CString
|
||||
raises OutOfRange is static;
|
||||
---Purpose : Same as above, but returns a CString (to be printed ...)
|
||||
-- Final form by default, Original form if <final> is False
|
||||
|
||||
Warnings (me; final : Boolean = Standard_True) returns HSequenceOfHAsciiString
|
||||
is static;
|
||||
---Purpose : Returns the list of Warnings, for a frontal-engine logic
|
||||
-- Final forms by default, Original forms if <final> is False
|
||||
-- Can be empty
|
||||
|
||||
SendMsg (me : mutable; amsg : Msg from Message);
|
||||
---Purpose : Records an information message
|
||||
-- This does not change the status of the Check
|
||||
|
||||
NbInfoMsgs (me) returns Integer;
|
||||
---Purpose : Returns the count of recorded information messages
|
||||
|
||||
InfoMsg (me; num : Integer; final : Boolean = Standard_True)
|
||||
returns HAsciiString from TCollection;
|
||||
---Purpose : Returns information message as a String
|
||||
---C++: return const &
|
||||
|
||||
CInfoMsg (me; num : Integer; final : Boolean = Standard_True) returns CString
|
||||
raises OutOfRange is static;
|
||||
---Purpose : Same as above, but returns a CString (to be printed ...)
|
||||
-- Final form by default, Original form if <final> is False
|
||||
|
||||
InfoMsgs(me; final : Boolean = Standard_True) returns HSequenceOfHAsciiString;
|
||||
---Purpose : Returns the list of Info Msg, for a frontal-engine logic
|
||||
-- Final forms by default, Original forms if <final> is False
|
||||
-- Can be empty
|
||||
|
||||
|
||||
Status (me) returns CheckStatus is static;
|
||||
---Purpose : Returns the Check Status : OK, Warning or Fail
|
||||
|
||||
Complies (me; status : CheckStatus) returns Boolean is static;
|
||||
---Purpose : Tells if Check Status complies with a given one
|
||||
-- (i.e. also status for query)
|
||||
|
||||
Complies (me; mess : HAsciiString; incl : Integer; status : CheckStatus)
|
||||
returns Boolean is static;
|
||||
---Purpose : Tells if a message is brought by a Check, as follows :
|
||||
-- <incl> = 0 : <mess> exactly matches one of the messages
|
||||
-- <incl> < 0 : <mess> is contained by one of the messages
|
||||
-- <incl> > 0 : <mess> contains one of the messages
|
||||
-- For <status> : for CheckWarning and CheckFail, considers only
|
||||
-- resp. Warning or Check messages. for CheckAny, considers all
|
||||
-- other values are ignored (answer will be false)
|
||||
|
||||
HasEntity (me) returns Boolean is static;
|
||||
---Purpose : Returns True if a Check is devoted to an entity; else, it is
|
||||
-- global (for InterfaceModel's storing of global error messages)
|
||||
|
||||
Entity (me) returns any Transient is static;
|
||||
---Purpose : Returns the entity on which the Check has been defined
|
||||
---C++ : return const &
|
||||
|
||||
|
||||
Clear (me : mutable) is static;
|
||||
---Purpose : Clears a check, in order to receive informations from transfer
|
||||
-- (Messages and Entity)
|
||||
|
||||
ClearFails (me : mutable) is static;
|
||||
---Purpose : Clears the Fail Messages (for instance to keep only Warnings)
|
||||
|
||||
ClearWarnings (me : mutable) is static;
|
||||
---Purpose : Clears the Warning Messages (for instance to keep only Fails)
|
||||
|
||||
ClearInfoMsgs (me : mutable) is static;
|
||||
---Purpose : Clears the Info Messages
|
||||
|
||||
Remove (me : mutable; mess : HAsciiString;
|
||||
incl : Integer; status : CheckStatus)
|
||||
returns Boolean is static;
|
||||
---Purpose : Removes the messages which comply with <mess>, as follows :
|
||||
-- <incl> = 0 : <mess> exactly matches one of the messages
|
||||
-- <incl> < 0 : <mess> is contained by one of the messages
|
||||
-- <incl> > 0 : <mess> contains one of the messages
|
||||
-- For <status> : for CheckWarning and CheckFail, considers only
|
||||
-- resp. Warning or Check messages. for CheckAny, considers all
|
||||
-- other values are ignored (nothing is done)
|
||||
-- Returns True if at least one message has been removed, False else
|
||||
|
||||
Mend (me : mutable; pref : CString; num : Integer = 0)
|
||||
returns Boolean is static;
|
||||
---Purpose : Mends messages, according <pref> and <num>
|
||||
-- According to <num>, works on the whole list of Fails if = 0(D)
|
||||
-- or only one Fail message, given its rank
|
||||
-- If <pref> is empty, converts Fail(s) to Warning(s)
|
||||
-- Else, does the conversion but prefixes the new Warning(s) but
|
||||
-- <pref> followed by a semi-column
|
||||
-- Some reserved values of <pref> are :
|
||||
-- "FM" : standard prefix "Mended" (can be translated)
|
||||
-- "CF" : clears Fail(s)
|
||||
-- "CW" : clears Warning(s) : here, <num> refers to Warning list
|
||||
-- "CA" : clears all messages : here, <num> is ignored
|
||||
|
||||
SetEntity (me : mutable; anentity : any Transient) is static;
|
||||
---Purpose : Receives an entity result of a Transfer
|
||||
|
||||
GetEntity (me : mutable; anentity : any Transient) is static;
|
||||
---Purpose : same as SetEntity (old form kept for compatibility)
|
||||
-- Warning : Does nothing if Entity field is not yet clear
|
||||
|
||||
GetMessages (me : mutable; other : Check) is static;
|
||||
---Purpose : Copies messages stored in another Check, cumulating
|
||||
-- Does not regard other's Entity. Used to cumulate messages
|
||||
|
||||
GetAsWarning (me : mutable; other : Check; failsonly : Boolean) is static;
|
||||
---Purpose : Copies messages converted into Warning messages
|
||||
-- If failsonly is true, only Fails are taken, and converted
|
||||
-- else, Warnings are taken too. Does not regard Entity
|
||||
-- Used to keep Fail messages as Warning, after a recovery
|
||||
|
||||
|
||||
Print (me; S: Messenger from Message; level : Integer; final : Integer = 1);
|
||||
---Purpose : Prints the messages of the check to an Messenger
|
||||
-- <level> = 1 : only fails
|
||||
-- <level> = 2 : fails and warnings
|
||||
-- <level> = 3 : all (fails, warnings, info msg)
|
||||
-- <final> : if positive (D) prints final values of messages
|
||||
-- if negative, prints originals
|
||||
-- if null, prints both forms
|
||||
|
||||
Trace (me; level : Integer = -1; final : Integer = 1);
|
||||
---Purpose : Prints the messages of the check to the default trace file
|
||||
-- By default, according to the default standard level
|
||||
-- Else, according level (see method Print)
|
||||
|
||||
fields
|
||||
|
||||
thefails : HSequenceOfHAsciiString;
|
||||
thefailo : HSequenceOfHAsciiString;
|
||||
thewarns : HSequenceOfHAsciiString;
|
||||
thewarno : HSequenceOfHAsciiString;
|
||||
theinfos : HSequenceOfHAsciiString;
|
||||
theinfoo : HSequenceOfHAsciiString;
|
||||
theent : Transient; -- the checked entity
|
||||
|
||||
end Check;
|
@@ -11,20 +11,22 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_Check.ixx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Message.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
// Un Check est cree au depart sans liste de message : celle ci est creee
|
||||
// seulement si au moins une erreur doit y etre enregitree (Fail-Warning)
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Interface_Check
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Interface_Check::Interface_Check()
|
||||
{
|
||||
} // construit a vide
|
||||
|
274
src/Interface/Interface_Check.hxx
Normal file
274
src/Interface/Interface_Check.hxx
Normal file
@@ -0,0 +1,274 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_Check_HeaderFile
|
||||
#define _Interface_Check_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TColStd_HSequenceOfHAsciiString.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Interface_CheckStatus.hxx>
|
||||
class Standard_Transient;
|
||||
class Standard_OutOfRange;
|
||||
class Message_Msg;
|
||||
class TCollection_HAsciiString;
|
||||
class Message_Messenger;
|
||||
|
||||
|
||||
class Interface_Check;
|
||||
DEFINE_STANDARD_HANDLE(Interface_Check, MMgt_TShared)
|
||||
|
||||
//! Defines a Check, as a list of Fail or Warning Messages under
|
||||
//! a literal form, which can be empty. A Check can also bring an
|
||||
//! Entity, which is the Entity to which the messages apply
|
||||
//! (this Entity may be any Transient Object).
|
||||
//!
|
||||
//! Messages can be stored in two forms : the definitive form
|
||||
//! (the only one by default), and another form, the original
|
||||
//! form, which can be different if it contains values to be
|
||||
//! inserted (integers, reals, strings)
|
||||
//! The original form can be more suitable for some operations
|
||||
//! such as counting messages
|
||||
class Interface_Check : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Allows definition of a Sequence. Used also for Global Check
|
||||
//! of an InterfaceModel (which stores global messages for file)
|
||||
Standard_EXPORT Interface_Check();
|
||||
|
||||
//! Defines a Check on an Entity
|
||||
Standard_EXPORT Interface_Check(const Handle(Standard_Transient)& anentity);
|
||||
|
||||
//! New name for AddFail (Msg)
|
||||
Standard_EXPORT void SendFail (const Message_Msg& amsg);
|
||||
|
||||
//! Records a new Fail message
|
||||
Standard_EXPORT void AddFail (const Handle(TCollection_HAsciiString)& amess);
|
||||
|
||||
//! Records a new Fail message under two forms : final,original
|
||||
Standard_EXPORT void AddFail (const Handle(TCollection_HAsciiString)& amess, const Handle(TCollection_HAsciiString)& orig);
|
||||
|
||||
//! Records a new Fail message given as "error text" directly
|
||||
//! If <orig> is given, a distinct original form is recorded
|
||||
//! else (D), the original form equates <amess>
|
||||
Standard_EXPORT void AddFail (const Standard_CString amess, const Standard_CString orig = "");
|
||||
|
||||
//! Records a new Fail from the definition of a Msg (Original+Value)
|
||||
Standard_EXPORT void AddFail (const Message_Msg& amsg);
|
||||
|
||||
//! Returns True if Check brings at least one Fail Message
|
||||
Standard_EXPORT Standard_Boolean HasFailed() const;
|
||||
|
||||
//! Returns count of recorded Fails
|
||||
Standard_EXPORT Standard_Integer NbFails() const;
|
||||
|
||||
//! Returns Fail Message as a String
|
||||
//! Final form by default, Original form if <final> is False
|
||||
Standard_EXPORT const Handle(TCollection_HAsciiString)& Fail (const Standard_Integer num, const Standard_Boolean final = Standard_True) const;
|
||||
|
||||
//! Same as above, but returns a CString (to be printed ...)
|
||||
//! Final form by default, Original form if <final> is False
|
||||
Standard_EXPORT Standard_CString CFail (const Standard_Integer num, const Standard_Boolean final = Standard_True) const;
|
||||
|
||||
//! Returns the list of Fails, for a frontal-engine logic
|
||||
//! Final forms by default, Original forms if <final> is False
|
||||
//! Can be empty
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) Fails (const Standard_Boolean final = Standard_True) const;
|
||||
|
||||
//! New name for AddWarning
|
||||
Standard_EXPORT void SendWarning (const Message_Msg& amsg);
|
||||
|
||||
//! Records a new Warning message
|
||||
Standard_EXPORT void AddWarning (const Handle(TCollection_HAsciiString)& amess);
|
||||
|
||||
//! Records a new Warning message under two forms : final,original
|
||||
Standard_EXPORT void AddWarning (const Handle(TCollection_HAsciiString)& amess, const Handle(TCollection_HAsciiString)& orig);
|
||||
|
||||
//! Records a Warning message given as "warning message" directly
|
||||
//! If <orig> is given, a distinct original form is recorded
|
||||
//! else (D), the original form equates <amess>
|
||||
Standard_EXPORT void AddWarning (const Standard_CString amess, const Standard_CString orig = "");
|
||||
|
||||
//! Records a new Warning from the definition of a Msg (Original+Value)
|
||||
Standard_EXPORT void AddWarning (const Message_Msg& amsg);
|
||||
|
||||
//! Returns True if Check brings at least one Warning Message
|
||||
Standard_EXPORT Standard_Boolean HasWarnings() const;
|
||||
|
||||
//! Returns count of recorded Warning messages
|
||||
Standard_EXPORT Standard_Integer NbWarnings() const;
|
||||
|
||||
//! Returns Warning message as a String
|
||||
//! Final form by default, Original form if <final> is False
|
||||
Standard_EXPORT const Handle(TCollection_HAsciiString)& Warning (const Standard_Integer num, const Standard_Boolean final = Standard_True) const;
|
||||
|
||||
//! Same as above, but returns a CString (to be printed ...)
|
||||
//! Final form by default, Original form if <final> is False
|
||||
Standard_EXPORT Standard_CString CWarning (const Standard_Integer num, const Standard_Boolean final = Standard_True) const;
|
||||
|
||||
//! Returns the list of Warnings, for a frontal-engine logic
|
||||
//! Final forms by default, Original forms if <final> is False
|
||||
//! Can be empty
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) Warnings (const Standard_Boolean final = Standard_True) const;
|
||||
|
||||
//! Records an information message
|
||||
//! This does not change the status of the Check
|
||||
Standard_EXPORT void SendMsg (const Message_Msg& amsg);
|
||||
|
||||
//! Returns the count of recorded information messages
|
||||
Standard_EXPORT Standard_Integer NbInfoMsgs() const;
|
||||
|
||||
//! Returns information message as a String
|
||||
Standard_EXPORT const Handle(TCollection_HAsciiString)& InfoMsg (const Standard_Integer num, const Standard_Boolean final = Standard_True) const;
|
||||
|
||||
//! Same as above, but returns a CString (to be printed ...)
|
||||
//! Final form by default, Original form if <final> is False
|
||||
Standard_EXPORT Standard_CString CInfoMsg (const Standard_Integer num, const Standard_Boolean final = Standard_True) const;
|
||||
|
||||
//! Returns the list of Info Msg, for a frontal-engine logic
|
||||
//! Final forms by default, Original forms if <final> is False
|
||||
//! Can be empty
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) InfoMsgs (const Standard_Boolean final = Standard_True) const;
|
||||
|
||||
//! Returns the Check Status : OK, Warning or Fail
|
||||
Standard_EXPORT Interface_CheckStatus Status() const;
|
||||
|
||||
//! Tells if Check Status complies with a given one
|
||||
//! (i.e. also status for query)
|
||||
Standard_EXPORT Standard_Boolean Complies (const Interface_CheckStatus status) const;
|
||||
|
||||
//! Tells if a message is brought by a Check, as follows :
|
||||
//! <incl> = 0 : <mess> exactly matches one of the messages
|
||||
//! <incl> < 0 : <mess> is contained by one of the messages
|
||||
//! <incl> > 0 : <mess> contains one of the messages
|
||||
//! For <status> : for CheckWarning and CheckFail, considers only
|
||||
//! resp. Warning or Check messages. for CheckAny, considers all
|
||||
//! other values are ignored (answer will be false)
|
||||
Standard_EXPORT Standard_Boolean Complies (const Handle(TCollection_HAsciiString)& mess, const Standard_Integer incl, const Interface_CheckStatus status) const;
|
||||
|
||||
//! Returns True if a Check is devoted to an entity; else, it is
|
||||
//! global (for InterfaceModel's storing of global error messages)
|
||||
Standard_EXPORT Standard_Boolean HasEntity() const;
|
||||
|
||||
//! Returns the entity on which the Check has been defined
|
||||
Standard_EXPORT const Handle(Standard_Transient)& Entity() const;
|
||||
|
||||
//! Clears a check, in order to receive informations from transfer
|
||||
//! (Messages and Entity)
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Clears the Fail Messages (for instance to keep only Warnings)
|
||||
Standard_EXPORT void ClearFails();
|
||||
|
||||
//! Clears the Warning Messages (for instance to keep only Fails)
|
||||
Standard_EXPORT void ClearWarnings();
|
||||
|
||||
//! Clears the Info Messages
|
||||
Standard_EXPORT void ClearInfoMsgs();
|
||||
|
||||
//! Removes the messages which comply with <mess>, as follows :
|
||||
//! <incl> = 0 : <mess> exactly matches one of the messages
|
||||
//! <incl> < 0 : <mess> is contained by one of the messages
|
||||
//! <incl> > 0 : <mess> contains one of the messages
|
||||
//! For <status> : for CheckWarning and CheckFail, considers only
|
||||
//! resp. Warning or Check messages. for CheckAny, considers all
|
||||
//! other values are ignored (nothing is done)
|
||||
//! Returns True if at least one message has been removed, False else
|
||||
Standard_EXPORT Standard_Boolean Remove (const Handle(TCollection_HAsciiString)& mess, const Standard_Integer incl, const Interface_CheckStatus status);
|
||||
|
||||
//! Mends messages, according <pref> and <num>
|
||||
//! According to <num>, works on the whole list of Fails if = 0(D)
|
||||
//! or only one Fail message, given its rank
|
||||
//! If <pref> is empty, converts Fail(s) to Warning(s)
|
||||
//! Else, does the conversion but prefixes the new Warning(s) but
|
||||
//! <pref> followed by a semi-column
|
||||
//! Some reserved values of <pref> are :
|
||||
//! "FM" : standard prefix "Mended" (can be translated)
|
||||
//! "CF" : clears Fail(s)
|
||||
//! "CW" : clears Warning(s) : here, <num> refers to Warning list
|
||||
//! "CA" : clears all messages : here, <num> is ignored
|
||||
Standard_EXPORT Standard_Boolean Mend (const Standard_CString pref, const Standard_Integer num = 0);
|
||||
|
||||
//! Receives an entity result of a Transfer
|
||||
Standard_EXPORT void SetEntity (const Handle(Standard_Transient)& anentity);
|
||||
|
||||
//! same as SetEntity (old form kept for compatibility)
|
||||
//! Warning : Does nothing if Entity field is not yet clear
|
||||
Standard_EXPORT void GetEntity (const Handle(Standard_Transient)& anentity);
|
||||
|
||||
//! Copies messages stored in another Check, cumulating
|
||||
//! Does not regard other's Entity. Used to cumulate messages
|
||||
Standard_EXPORT void GetMessages (const Handle(Interface_Check)& other);
|
||||
|
||||
//! Copies messages converted into Warning messages
|
||||
//! If failsonly is true, only Fails are taken, and converted
|
||||
//! else, Warnings are taken too. Does not regard Entity
|
||||
//! Used to keep Fail messages as Warning, after a recovery
|
||||
Standard_EXPORT void GetAsWarning (const Handle(Interface_Check)& other, const Standard_Boolean failsonly);
|
||||
|
||||
//! Prints the messages of the check to an Messenger
|
||||
//! <level> = 1 : only fails
|
||||
//! <level> = 2 : fails and warnings
|
||||
//! <level> = 3 : all (fails, warnings, info msg)
|
||||
//! <final> : if positive (D) prints final values of messages
|
||||
//! if negative, prints originals
|
||||
//! if null, prints both forms
|
||||
Standard_EXPORT void Print (const Handle(Message_Messenger)& S, const Standard_Integer level, const Standard_Integer final = 1) const;
|
||||
|
||||
//! Prints the messages of the check to the default trace file
|
||||
//! By default, according to the default standard level
|
||||
//! Else, according level (see method Print)
|
||||
Standard_EXPORT void Trace (const Standard_Integer level = -1, const Standard_Integer final = 1) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_Check,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(TColStd_HSequenceOfHAsciiString) thefails;
|
||||
Handle(TColStd_HSequenceOfHAsciiString) thefailo;
|
||||
Handle(TColStd_HSequenceOfHAsciiString) thewarns;
|
||||
Handle(TColStd_HSequenceOfHAsciiString) thewarno;
|
||||
Handle(TColStd_HSequenceOfHAsciiString) theinfos;
|
||||
Handle(TColStd_HSequenceOfHAsciiString) theinfoo;
|
||||
Handle(Standard_Transient) theent;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_Check_HeaderFile
|
37
src/Interface/Interface_CheckFailure.hxx
Normal file
37
src/Interface/Interface_CheckFailure.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_CheckFailure_HeaderFile
|
||||
#define _Interface_CheckFailure_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Interface_InterfaceError.hxx>
|
||||
|
||||
class Interface_CheckFailure;
|
||||
DEFINE_STANDARD_HANDLE(Interface_CheckFailure, Interface_InterfaceError)
|
||||
|
||||
#if !defined No_Exception && !defined No_Interface_CheckFailure
|
||||
#define Interface_CheckFailure_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Interface_CheckFailure::Raise(MESSAGE);
|
||||
#else
|
||||
#define Interface_CheckFailure_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Interface_CheckFailure, Interface_InterfaceError)
|
||||
|
||||
#endif // _Interface_CheckFailure_HeaderFile
|
@@ -1,197 +0,0 @@
|
||||
-- Created on: 1992-10-28
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class CheckIterator from Interface
|
||||
|
||||
---Purpose : Result of a Check operation (especially from InterfaceModel)
|
||||
|
||||
uses Integer, CString, AsciiString from TCollection,
|
||||
Messenger from Message,
|
||||
HSequenceOfInteger from TColStd, HSequenceOfTransient from TColStd,
|
||||
IntVal, Check, HSequenceOfCheck, InterfaceModel, CheckStatus
|
||||
|
||||
raises NoSuchObject
|
||||
|
||||
is
|
||||
|
||||
Create returns CheckIterator;
|
||||
---Purpose : Creates an empty CheckIterator
|
||||
|
||||
Create (name : CString) returns CheckIterator;
|
||||
---Purpose : Creates a CheckIterator with a name (displayed by Print as a
|
||||
-- title)
|
||||
|
||||
SetName (me : in out; name : CString);
|
||||
---Purpose : Sets / Changes the name
|
||||
|
||||
Name (me) returns CString;
|
||||
---Purpose : Returns the recorded name (can be empty)
|
||||
|
||||
SetModel (me : in out; model : InterfaceModel);
|
||||
---Purpose : Defines a Model, used to locate entities (not required, if it
|
||||
-- is absent, entities are simply less documented)
|
||||
|
||||
Model (me) returns InterfaceModel;
|
||||
---Purpose : Returns the stored model (can be a null handle)
|
||||
|
||||
Clear (me : in out) is static;
|
||||
---Purpose : Clears the list of checks
|
||||
|
||||
Merge (me : in out; other : in out CheckIterator) is static;
|
||||
---Purpose : Merges another CheckIterator into <me>, i.e. adds each of its
|
||||
-- Checks. Content of <other> remains unchanged.
|
||||
-- Takes also the Model but not the Name
|
||||
|
||||
Add (me : in out; ach : Check; num : Integer = 0) is static;
|
||||
---Purpose : Adds a Check to the list to be iterated
|
||||
-- This Check is Accompanied by Entity Number in the Model
|
||||
-- (0 for Global Check or Entity unknown in the Model), if 0 and
|
||||
-- Model is recorded in <me>, it is computed
|
||||
|
||||
Check (me; num : Integer) returns Check is static;
|
||||
---Purpose : Returns the Check which was attached to an Entity given its
|
||||
-- Number in the Model. <num>=0 is for the Global Check.
|
||||
-- If no Check was recorded for this Number, returns an empty
|
||||
-- Check.
|
||||
-- Remark : Works apart from the iteration methods (no interference)
|
||||
---C++ : return const &
|
||||
|
||||
Check (me; ent : Transient) returns Check is static;
|
||||
---Purpose : Returns the Check attached to an Entity
|
||||
-- If no Check was recorded for this Entity, returns an empty
|
||||
-- Check.
|
||||
-- Remark : Works apart from the iteration methods (no interference)
|
||||
---C++ : return const &
|
||||
|
||||
CCheck (me : in out; num : Integer) returns Check is static;
|
||||
---Purpose : Returns the Check bound to an Entity Number (0 : Global)
|
||||
-- in order to be consulted or completed on the spot
|
||||
-- I.e. returns the Check if is already exists, or adds it then
|
||||
-- returns the new empty Check
|
||||
---C++ : return &
|
||||
|
||||
CCheck (me : in out; ent : Transient) returns Check is static;
|
||||
---Purpose : Returns the Check bound to an Entity, in order to be consulted
|
||||
-- or completed on the spot
|
||||
-- I.e. returns the Check if is already exists, or adds it then
|
||||
-- returns the new empty Check
|
||||
---C++ : return &
|
||||
|
||||
|
||||
IsEmpty (me; failsonly : Boolean) returns Boolean is static;
|
||||
---Purpose : Returns True if : no Fail has been recorded if <failsonly> is
|
||||
-- True, no Check at all if <failsonly> is False
|
||||
|
||||
Status (me) returns CheckStatus;
|
||||
---Purpose : Returns worst status among : OK, Warning, Fail
|
||||
|
||||
Complies (me; status : CheckStatus) returns Boolean;
|
||||
---Purpose : Tells if this check list complies with a given status :
|
||||
-- OK (i.e. empty), Warning (at least one Warning, but no Fail),
|
||||
-- Fail (at least one), Message (not OK), NoFail, Any
|
||||
|
||||
Extract (me; status : CheckStatus) returns CheckIterator;
|
||||
---Purpose : Returns a CheckIterator which contains the checks which comply
|
||||
-- with a given status
|
||||
-- Each check is added completely (no split Warning/Fail)
|
||||
|
||||
Extract (me; mess : CString; incl : Integer; status : CheckStatus)
|
||||
returns CheckIterator;
|
||||
---Purpose : Returns a CheckIterator which contains the check which comply
|
||||
-- with a message, plus some conditions as follows :
|
||||
-- <incl> = 0 : <mess> exactly matches one of the messages
|
||||
-- <incl> < 0 : <mess> is contained by one of the messages
|
||||
-- <incl> > 0 : <mess> contains one of the messages
|
||||
-- For <status> : for CheckWarning and CheckFail, considers only
|
||||
-- resp. Warning or Check messages. for CheckAny, considers all
|
||||
-- other values are ignored (answer will be false)
|
||||
-- Each Check which complies is entirely taken
|
||||
|
||||
Remove (me : in out; mess : CString; incl : Integer; status : CheckStatus)
|
||||
returns Boolean;
|
||||
---Purpose : Removes the messages of all Checks, under these conditions :
|
||||
-- <incl> = 0 : <mess> exactly matches one of the messages
|
||||
-- <incl> < 0 : <mess> is contained by one of the messages
|
||||
-- <incl> > 0 : <mess> contains one of the messages
|
||||
-- For <status> : for CheckWarning and CheckFail, considers only
|
||||
-- resp. Warning or Check messages. for CheckAny, considers all
|
||||
-- other values are ignored (nothing is done)
|
||||
-- Returns True if at least one message has been removed, False else
|
||||
|
||||
Checkeds (me; failsonly : Boolean; global : Boolean) returns
|
||||
HSequenceOfTransient;
|
||||
---Purpose : Returns the list of entities concerned by a Check
|
||||
-- Only fails if <failsonly> is True, else all non-empty checks
|
||||
-- If <global> is true, adds the model for a global check
|
||||
-- Else, global check is ignored
|
||||
---Warning : if the model has not yet been defined, returns a Null Handle
|
||||
|
||||
|
||||
Start (me) is static;
|
||||
---Purpose : Starts Iteration. Thus, it is possible to restart it
|
||||
-- Remark : an iteration may be done with a const Iterator
|
||||
-- While its content is modified (through a pointer), this allows
|
||||
-- to give it as a const argument to a function
|
||||
|
||||
More (me) returns Boolean is static;
|
||||
---Purpose : Returns True if there are more Checks to get
|
||||
|
||||
Next (me) is static;
|
||||
---Purpose : Sets Iteration to next Item
|
||||
|
||||
Value (me) returns Check
|
||||
---Purpose : Returns Check currently Iterated
|
||||
-- It brings all other informations (status, messages, ...)
|
||||
-- The Number of the Entity in the Model is given by Number below
|
||||
raises NoSuchObject is static;
|
||||
-- Error if Iteration has ended
|
||||
---C++ : return const &
|
||||
|
||||
Number (me) returns Integer
|
||||
---Purpose : Returns Number of Entity for the Check currently iterated
|
||||
-- or 0 for GlobalCheck
|
||||
raises NoSuchObject is static;
|
||||
-- Error if Iteration has ended
|
||||
|
||||
Print (me; S : Messenger from Message; failsonly : Boolean; final : Integer = 0);
|
||||
---Purpose : Prints the list of Checks with their attached Numbers
|
||||
-- If <failsonly> is True, prints only Fail messages
|
||||
-- If <failsonly> is False, prints all messages
|
||||
-- If <final> = 0 (D), prints also original messages if different
|
||||
-- If <final> < 0, prints only original messages
|
||||
-- If <final> > 0, prints only final messages
|
||||
-- It uses the recorded Model if it is defined
|
||||
-- Remark : Works apart from the iteration methods (no interference)
|
||||
|
||||
Print (me; S : Messenger from Message; model : InterfaceModel;
|
||||
failsonly : Boolean; final : Integer = 0);
|
||||
---Purpose : Works as Print without a model, but for entities which have
|
||||
-- no attached number (Number not positive), tries to compute
|
||||
-- this Number from <model> and displays "original" or "computed"
|
||||
|
||||
Destroy (me : in out);
|
||||
---Purpose : Clears data of iteration
|
||||
---C++ : alias ~
|
||||
|
||||
fields
|
||||
|
||||
thelist : HSequenceOfCheck;
|
||||
thenums : HSequenceOfInteger from TColStd;
|
||||
themod : InterfaceModel;
|
||||
thename : AsciiString;
|
||||
thecurr : IntVal;
|
||||
|
||||
end CheckIterator;
|
@@ -11,10 +11,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_CheckIterator.ixx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_CheckIterator.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_IntVal.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
static const Handle(Interface_Check)& nulcheck ()
|
||||
{
|
||||
|
222
src/Interface/Interface_CheckIterator.hxx
Normal file
222
src/Interface/Interface_CheckIterator.hxx
Normal file
@@ -0,0 +1,222 @@
|
||||
// Created on: 1992-10-28
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_CheckIterator_HeaderFile
|
||||
#define _Interface_CheckIterator_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_HSequenceOfCheck.hxx>
|
||||
#include <TColStd_HSequenceOfInteger.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Interface_CheckStatus.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
class Interface_InterfaceModel;
|
||||
class Interface_IntVal;
|
||||
class Standard_NoSuchObject;
|
||||
class Interface_Check;
|
||||
class Standard_Transient;
|
||||
class Message_Messenger;
|
||||
|
||||
|
||||
//! Result of a Check operation (especially from InterfaceModel)
|
||||
class Interface_CheckIterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an empty CheckIterator
|
||||
Standard_EXPORT Interface_CheckIterator();
|
||||
|
||||
//! Creates a CheckIterator with a name (displayed by Print as a
|
||||
//! title)
|
||||
Standard_EXPORT Interface_CheckIterator(const Standard_CString name);
|
||||
|
||||
//! Sets / Changes the name
|
||||
Standard_EXPORT void SetName (const Standard_CString name);
|
||||
|
||||
//! Returns the recorded name (can be empty)
|
||||
Standard_EXPORT Standard_CString Name() const;
|
||||
|
||||
//! Defines a Model, used to locate entities (not required, if it
|
||||
//! is absent, entities are simply less documented)
|
||||
Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model);
|
||||
|
||||
//! Returns the stored model (can be a null handle)
|
||||
Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
|
||||
|
||||
//! Clears the list of checks
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Merges another CheckIterator into <me>, i.e. adds each of its
|
||||
//! Checks. Content of <other> remains unchanged.
|
||||
//! Takes also the Model but not the Name
|
||||
Standard_EXPORT void Merge (Interface_CheckIterator& other);
|
||||
|
||||
//! Adds a Check to the list to be iterated
|
||||
//! This Check is Accompanied by Entity Number in the Model
|
||||
//! (0 for Global Check or Entity unknown in the Model), if 0 and
|
||||
//! Model is recorded in <me>, it is computed
|
||||
Standard_EXPORT void Add (const Handle(Interface_Check)& ach, const Standard_Integer num = 0);
|
||||
|
||||
//! Returns the Check which was attached to an Entity given its
|
||||
//! Number in the Model. <num>=0 is for the Global Check.
|
||||
//! If no Check was recorded for this Number, returns an empty
|
||||
//! Check.
|
||||
//! Remark : Works apart from the iteration methods (no interference)
|
||||
Standard_EXPORT const Handle(Interface_Check)& Check (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the Check attached to an Entity
|
||||
//! If no Check was recorded for this Entity, returns an empty
|
||||
//! Check.
|
||||
//! Remark : Works apart from the iteration methods (no interference)
|
||||
Standard_EXPORT const Handle(Interface_Check)& Check (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns the Check bound to an Entity Number (0 : Global)
|
||||
//! in order to be consulted or completed on the spot
|
||||
//! I.e. returns the Check if is already exists, or adds it then
|
||||
//! returns the new empty Check
|
||||
Standard_EXPORT Handle(Interface_Check)& CCheck (const Standard_Integer num);
|
||||
|
||||
//! Returns the Check bound to an Entity, in order to be consulted
|
||||
//! or completed on the spot
|
||||
//! I.e. returns the Check if is already exists, or adds it then
|
||||
//! returns the new empty Check
|
||||
Standard_EXPORT Handle(Interface_Check)& CCheck (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Returns True if : no Fail has been recorded if <failsonly> is
|
||||
//! True, no Check at all if <failsonly> is False
|
||||
Standard_EXPORT Standard_Boolean IsEmpty (const Standard_Boolean failsonly) const;
|
||||
|
||||
//! Returns worst status among : OK, Warning, Fail
|
||||
Standard_EXPORT Interface_CheckStatus Status() const;
|
||||
|
||||
//! Tells if this check list complies with a given status :
|
||||
//! OK (i.e. empty), Warning (at least one Warning, but no Fail),
|
||||
//! Fail (at least one), Message (not OK), NoFail, Any
|
||||
Standard_EXPORT Standard_Boolean Complies (const Interface_CheckStatus status) const;
|
||||
|
||||
//! Returns a CheckIterator which contains the checks which comply
|
||||
//! with a given status
|
||||
//! Each check is added completely (no split Warning/Fail)
|
||||
Standard_EXPORT Interface_CheckIterator Extract (const Interface_CheckStatus status) const;
|
||||
|
||||
//! Returns a CheckIterator which contains the check which comply
|
||||
//! with a message, plus some conditions as follows :
|
||||
//! <incl> = 0 : <mess> exactly matches one of the messages
|
||||
//! <incl> < 0 : <mess> is contained by one of the messages
|
||||
//! <incl> > 0 : <mess> contains one of the messages
|
||||
//! For <status> : for CheckWarning and CheckFail, considers only
|
||||
//! resp. Warning or Check messages. for CheckAny, considers all
|
||||
//! other values are ignored (answer will be false)
|
||||
//! Each Check which complies is entirely taken
|
||||
Standard_EXPORT Interface_CheckIterator Extract (const Standard_CString mess, const Standard_Integer incl, const Interface_CheckStatus status) const;
|
||||
|
||||
//! Removes the messages of all Checks, under these conditions :
|
||||
//! <incl> = 0 : <mess> exactly matches one of the messages
|
||||
//! <incl> < 0 : <mess> is contained by one of the messages
|
||||
//! <incl> > 0 : <mess> contains one of the messages
|
||||
//! For <status> : for CheckWarning and CheckFail, considers only
|
||||
//! resp. Warning or Check messages. for CheckAny, considers all
|
||||
//! other values are ignored (nothing is done)
|
||||
//! Returns True if at least one message has been removed, False else
|
||||
Standard_EXPORT Standard_Boolean Remove (const Standard_CString mess, const Standard_Integer incl, const Interface_CheckStatus status);
|
||||
|
||||
//! Returns the list of entities concerned by a Check
|
||||
//! Only fails if <failsonly> is True, else all non-empty checks
|
||||
//! If <global> is true, adds the model for a global check
|
||||
//! Else, global check is ignored
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Checkeds (const Standard_Boolean failsonly, const Standard_Boolean global) const;
|
||||
|
||||
//! Starts Iteration. Thus, it is possible to restart it
|
||||
//! Remark : an iteration may be done with a const Iterator
|
||||
//! While its content is modified (through a pointer), this allows
|
||||
//! to give it as a const argument to a function
|
||||
Standard_EXPORT void Start() const;
|
||||
|
||||
//! Returns True if there are more Checks to get
|
||||
Standard_EXPORT Standard_Boolean More() const;
|
||||
|
||||
//! Sets Iteration to next Item
|
||||
Standard_EXPORT void Next() const;
|
||||
|
||||
//! Returns Check currently Iterated
|
||||
//! It brings all other informations (status, messages, ...)
|
||||
//! The Number of the Entity in the Model is given by Number below
|
||||
Standard_EXPORT const Handle(Interface_Check)& Value() const;
|
||||
|
||||
//! Returns Number of Entity for the Check currently iterated
|
||||
//! or 0 for GlobalCheck
|
||||
Standard_EXPORT Standard_Integer Number() const;
|
||||
|
||||
//! Prints the list of Checks with their attached Numbers
|
||||
//! If <failsonly> is True, prints only Fail messages
|
||||
//! If <failsonly> is False, prints all messages
|
||||
//! If <final> = 0 (D), prints also original messages if different
|
||||
//! If <final> < 0, prints only original messages
|
||||
//! If <final> > 0, prints only final messages
|
||||
//! It uses the recorded Model if it is defined
|
||||
//! Remark : Works apart from the iteration methods (no interference)
|
||||
Standard_EXPORT void Print (const Handle(Message_Messenger)& S, const Standard_Boolean failsonly, const Standard_Integer final = 0) const;
|
||||
|
||||
//! Works as Print without a model, but for entities which have
|
||||
//! no attached number (Number not positive), tries to compute
|
||||
//! this Number from <model> and displays "original" or "computed"
|
||||
Standard_EXPORT void Print (const Handle(Message_Messenger)& S, const Handle(Interface_InterfaceModel)& model, const Standard_Boolean failsonly, const Standard_Integer final = 0) const;
|
||||
|
||||
//! Clears data of iteration
|
||||
Standard_EXPORT void Destroy();
|
||||
~Interface_CheckIterator()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Interface_HSequenceOfCheck) thelist;
|
||||
Handle(TColStd_HSequenceOfInteger) thenums;
|
||||
Handle(Interface_InterfaceModel) themod;
|
||||
TCollection_AsciiString thename;
|
||||
Handle(Interface_IntVal) thecurr;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_CheckIterator_HeaderFile
|
34
src/Interface/Interface_CheckStatus.hxx
Normal file
34
src/Interface/Interface_CheckStatus.hxx
Normal file
@@ -0,0 +1,34 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_CheckStatus_HeaderFile
|
||||
#define _Interface_CheckStatus_HeaderFile
|
||||
|
||||
//! Classifies checks
|
||||
//! OK : check is empty Warning : Warning, no Fail Fail : Fail
|
||||
//! Others to query :
|
||||
//! Any : any status Message : Warning/Fail NoFail : Warning/OK
|
||||
enum Interface_CheckStatus
|
||||
{
|
||||
Interface_CheckOK,
|
||||
Interface_CheckWarning,
|
||||
Interface_CheckFail,
|
||||
Interface_CheckAny,
|
||||
Interface_CheckMessage,
|
||||
Interface_CheckNoFail
|
||||
};
|
||||
|
||||
#endif // _Interface_CheckStatus_HeaderFile
|
@@ -1,114 +0,0 @@
|
||||
-- Created on: 1993-02-02
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class CheckTool from Interface
|
||||
|
||||
---Purpose : Performs Checks on Entities, using General Service Library and
|
||||
-- Modules to work. Works on one Entity or on a complete Model
|
||||
|
||||
uses Transient, InterfaceModel, Check,
|
||||
CheckIterator, EntityIterator, HGraph, Graph, ShareTool,
|
||||
Messenger from Message,
|
||||
Protocol from Interface, GeneralLib, GTool
|
||||
|
||||
raises CheckFailure
|
||||
|
||||
is
|
||||
|
||||
Create (model : InterfaceModel; protocol : Protocol from Interface)
|
||||
returns CheckTool;
|
||||
---Purpose : Creates a CheckTool, by calling the General Service Library
|
||||
-- and Modules, selected through a Protocol, to work on a Model
|
||||
-- Moreover, Protocol recognizes Unknown Entities
|
||||
|
||||
Create (model : InterfaceModel)
|
||||
returns CheckTool;
|
||||
---Purpose : Creates a CheckTool, by calling the General Service Library
|
||||
-- and Modules, selected through a Protocol, to work on a Model
|
||||
-- Protocol and so on are taken from the Model (its GTool)
|
||||
|
||||
Create (graph : Graph) returns CheckTool;
|
||||
---Purpose : Creates a CheckTool from a Graph. The Graph contains a Model
|
||||
-- which designates a Protocol: they are used to create ShareTool
|
||||
|
||||
Create (hgraph : HGraph) returns CheckTool;
|
||||
|
||||
FillCheck (me : in out; ent : Transient; sh : ShareTool; ach : in out Check);
|
||||
---Purpose : Fills as required a Check with the Error and Warning messages
|
||||
-- produced by Checking a given Entity.
|
||||
-- For an Erroneous or Corrected Entity : Check build at Analyse
|
||||
-- time; else, Check computed for Entity (Verify integrity), can
|
||||
-- use a Graph as required to control context
|
||||
|
||||
Print (me; ach : Check; S : Messenger from Message);
|
||||
---Purpose : Utility method which Prints the content of a Check
|
||||
|
||||
Print (me; list : CheckIterator; S : Messenger from Message);
|
||||
---Purpose : Simply Lists all the Checks and the Content (messages) and the
|
||||
-- Entity, if there is, of each Check
|
||||
-- (if all Checks are OK, nothing is Printed)
|
||||
|
||||
-- -- Checking a Model (the one given for Creation) -- --
|
||||
|
||||
Check (me : in out; num : Integer) returns Check;
|
||||
---Purpose : Returns the Check associated to an Entity identified by
|
||||
-- its Number in a Model.
|
||||
|
||||
CheckSuccess (me : in out; reset : Boolean = Standard_False)
|
||||
raises CheckFailure;
|
||||
---Purpose : Checks if any Error has been detected (CheckList not empty)
|
||||
-- Returns normally if none, raises exception if some exists.
|
||||
-- It reuses the last computations from other checking methods,
|
||||
-- unless the argument <resest> is given True
|
||||
|
||||
CompleteCheckList (me : in out) returns CheckIterator;
|
||||
---Purpose : Returns list of all "remarkable" informations, which include :
|
||||
-- - GlobalCheck, if not empty
|
||||
-- - Error Checks, for all Errors (Verify + Analyse)
|
||||
-- - also Corrected Entities
|
||||
-- - and Unknown Entities : for those, each Unknown Entity is
|
||||
-- associated to an empty Check (it is neither an Error nor a
|
||||
-- Correction, but a remarkable information)
|
||||
|
||||
CheckList (me : in out) returns CheckIterator;
|
||||
---Purpose : Returns list of all Errors detected
|
||||
-- Note that presence of Unknown Entities is not an error
|
||||
-- Cumulates : GlobalCheck if error +
|
||||
-- AnalyseCheckList + VerifyCheckList
|
||||
|
||||
AnalyseCheckList (me : in out) returns CheckIterator;
|
||||
---Purpose : Returns list of errors dectected at Analyse time (syntactic)
|
||||
-- (note that GlobalCheck is not in this list)
|
||||
|
||||
VerifyCheckList (me : in out) returns CheckIterator;
|
||||
---Purpose : Returns list of integrity constraints errors (semantic)
|
||||
-- (note that GlobalCheck is not in this list)
|
||||
|
||||
WarningCheckList (me : in out) returns CheckIterator;
|
||||
---Purpose : Returns list of Corrections (includes GlobalCheck if corrected)
|
||||
|
||||
UnknownEntities (me : in out) returns EntityIterator;
|
||||
---Purpose : Returns list of Unknown Entities
|
||||
-- Note that Error and Erroneous Entities are not considered
|
||||
-- as Unknown
|
||||
|
||||
fields
|
||||
|
||||
thegtool : GTool;
|
||||
theshare : ShareTool;
|
||||
thestat : Integer;
|
||||
|
||||
end CheckTool;
|
@@ -11,16 +11,27 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Interface_CheckTool.ixx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_ReportEntity.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_CheckFailure.hxx>
|
||||
#include <Interface_CheckIterator.hxx>
|
||||
#include <Interface_CheckTool.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GTool.hxx>
|
||||
#include <Interface_HGraph.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_ReportEntity.hxx>
|
||||
#include <Interface_ShareTool.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
#ifdef WNT
|
||||
#include <OSD_Exception.hxx>
|
||||
#else
|
||||
|
148
src/Interface/Interface_CheckTool.hxx
Normal file
148
src/Interface/Interface_CheckTool.hxx
Normal file
@@ -0,0 +1,148 @@
|
||||
// Created on: 1993-02-02
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_CheckTool_HeaderFile
|
||||
#define _Interface_CheckTool_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_ShareTool.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_GTool;
|
||||
class Interface_CheckFailure;
|
||||
class Interface_InterfaceModel;
|
||||
class Interface_Protocol;
|
||||
class Interface_Graph;
|
||||
class Interface_HGraph;
|
||||
class Standard_Transient;
|
||||
class Interface_ShareTool;
|
||||
class Interface_Check;
|
||||
class Message_Messenger;
|
||||
class Interface_CheckIterator;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! Performs Checks on Entities, using General Service Library and
|
||||
//! Modules to work. Works on one Entity or on a complete Model
|
||||
class Interface_CheckTool
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a CheckTool, by calling the General Service Library
|
||||
//! and Modules, selected through a Protocol, to work on a Model
|
||||
//! Moreover, Protocol recognizes Unknown Entities
|
||||
Standard_EXPORT Interface_CheckTool(const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol);
|
||||
|
||||
//! Creates a CheckTool, by calling the General Service Library
|
||||
//! and Modules, selected through a Protocol, to work on a Model
|
||||
//! Protocol and so on are taken from the Model (its GTool)
|
||||
Standard_EXPORT Interface_CheckTool(const Handle(Interface_InterfaceModel)& model);
|
||||
|
||||
//! Creates a CheckTool from a Graph. The Graph contains a Model
|
||||
//! which designates a Protocol: they are used to create ShareTool
|
||||
Standard_EXPORT Interface_CheckTool(const Interface_Graph& graph);
|
||||
|
||||
Standard_EXPORT Interface_CheckTool(const Handle(Interface_HGraph)& hgraph);
|
||||
|
||||
//! Fills as required a Check with the Error and Warning messages
|
||||
//! produced by Checking a given Entity.
|
||||
//! For an Erroneous or Corrected Entity : Check build at Analyse
|
||||
//! time; else, Check computed for Entity (Verify integrity), can
|
||||
//! use a Graph as required to control context
|
||||
Standard_EXPORT void FillCheck (const Handle(Standard_Transient)& ent, const Interface_ShareTool& sh, Handle(Interface_Check)& ach);
|
||||
|
||||
//! Utility method which Prints the content of a Check
|
||||
Standard_EXPORT void Print (const Handle(Interface_Check)& ach, const Handle(Message_Messenger)& S) const;
|
||||
|
||||
//! Simply Lists all the Checks and the Content (messages) and the
|
||||
//! Entity, if there is, of each Check
|
||||
//! (if all Checks are OK, nothing is Printed)
|
||||
Standard_EXPORT void Print (const Interface_CheckIterator& list, const Handle(Message_Messenger)& S) const;
|
||||
|
||||
//! Returns the Check associated to an Entity identified by
|
||||
//! its Number in a Model.
|
||||
Standard_EXPORT Handle(Interface_Check) Check (const Standard_Integer num);
|
||||
|
||||
//! Checks if any Error has been detected (CheckList not empty)
|
||||
//! Returns normally if none, raises exception if some exists.
|
||||
//! It reuses the last computations from other checking methods,
|
||||
//! unless the argument <resest> is given True
|
||||
Standard_EXPORT void CheckSuccess (const Standard_Boolean reset = Standard_False);
|
||||
|
||||
//! Returns list of all "remarkable" informations, which include :
|
||||
//! - GlobalCheck, if not empty
|
||||
//! - Error Checks, for all Errors (Verify + Analyse)
|
||||
//! - also Corrected Entities
|
||||
//! - and Unknown Entities : for those, each Unknown Entity is
|
||||
//! associated to an empty Check (it is neither an Error nor a
|
||||
//! Correction, but a remarkable information)
|
||||
Standard_EXPORT Interface_CheckIterator CompleteCheckList();
|
||||
|
||||
//! Returns list of all Errors detected
|
||||
//! Note that presence of Unknown Entities is not an error
|
||||
//! Cumulates : GlobalCheck if error +
|
||||
//! AnalyseCheckList + VerifyCheckList
|
||||
Standard_EXPORT Interface_CheckIterator CheckList();
|
||||
|
||||
//! Returns list of errors dectected at Analyse time (syntactic)
|
||||
//! (note that GlobalCheck is not in this list)
|
||||
Standard_EXPORT Interface_CheckIterator AnalyseCheckList();
|
||||
|
||||
//! Returns list of integrity constraints errors (semantic)
|
||||
//! (note that GlobalCheck is not in this list)
|
||||
Standard_EXPORT Interface_CheckIterator VerifyCheckList();
|
||||
|
||||
//! Returns list of Corrections (includes GlobalCheck if corrected)
|
||||
Standard_EXPORT Interface_CheckIterator WarningCheckList();
|
||||
|
||||
//! Returns list of Unknown Entities
|
||||
//! Note that Error and Erroneous Entities are not considered
|
||||
//! as Unknown
|
||||
Standard_EXPORT Interface_EntityIterator UnknownEntities();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Interface_GTool) thegtool;
|
||||
Interface_ShareTool theshare;
|
||||
Standard_Integer thestat;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_CheckTool_HeaderFile
|
@@ -1,48 +0,0 @@
|
||||
-- Created on: 1993-04-08
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class CopyControl from Interface inherits TShared
|
||||
|
||||
---Purpose : This deferred class describes the services required by
|
||||
-- CopyTool to work. They are very simple and correspond
|
||||
-- basically to the management of an indexed map.
|
||||
-- But they can be provided by various classes which can
|
||||
-- control a Transfer. Each Starting Entity have at most
|
||||
-- one Result (Mapping one-one)
|
||||
|
||||
uses Transient
|
||||
|
||||
raises InterfaceError
|
||||
|
||||
is
|
||||
|
||||
Clear (me : mutable) is deferred;
|
||||
---Purpose : Clears List of Copy Results. Gets Ready to begin another Copy
|
||||
-- Process.
|
||||
|
||||
Bind (me : mutable; ent : Transient; res : Transient)
|
||||
---Purpose : Bind a Result to a Starting Entity identified by its Number
|
||||
raises InterfaceError is deferred;
|
||||
-- Error if <num> is already bound or is out of range
|
||||
|
||||
Search (me; ent : Transient; res : out Transient)
|
||||
returns Boolean is deferred;
|
||||
---Purpose : Searches for the Result bound to a Startingf Entity identified
|
||||
-- by its Number.
|
||||
-- If Found, returns True and fills <res>
|
||||
-- Else, returns False and nullifies <res>
|
||||
|
||||
end CopyControl;
|
@@ -11,4 +11,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_CopyControl.ixx>
|
||||
|
||||
#include <Interface_CopyControl.hxx>
|
||||
#include <Interface_InterfaceError.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
80
src/Interface/Interface_CopyControl.hxx
Normal file
80
src/Interface/Interface_CopyControl.hxx
Normal file
@@ -0,0 +1,80 @@
|
||||
// Created on: 1993-04-08
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_CopyControl_HeaderFile
|
||||
#define _Interface_CopyControl_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_InterfaceError;
|
||||
class Standard_Transient;
|
||||
|
||||
|
||||
class Interface_CopyControl;
|
||||
DEFINE_STANDARD_HANDLE(Interface_CopyControl, MMgt_TShared)
|
||||
|
||||
//! This deferred class describes the services required by
|
||||
//! CopyTool to work. They are very simple and correspond
|
||||
//! basically to the management of an indexed map.
|
||||
//! But they can be provided by various classes which can
|
||||
//! control a Transfer. Each Starting Entity have at most
|
||||
//! one Result (Mapping one-one)
|
||||
class Interface_CopyControl : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Clears List of Copy Results. Gets Ready to begin another Copy
|
||||
//! Process.
|
||||
Standard_EXPORT virtual void Clear() = 0;
|
||||
|
||||
//! Bind a Result to a Starting Entity identified by its Number
|
||||
Standard_EXPORT virtual void Bind (const Handle(Standard_Transient)& ent, const Handle(Standard_Transient)& res) = 0;
|
||||
|
||||
//! Searches for the Result bound to a Startingf Entity identified
|
||||
//! by its Number.
|
||||
//! If Found, returns True and fills <res>
|
||||
//! Else, returns False and nullifies <res>
|
||||
Standard_EXPORT virtual Standard_Boolean Search (const Handle(Standard_Transient)& ent, Handle(Standard_Transient)& res) const = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_CopyControl,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_CopyControl_HeaderFile
|
@@ -1,57 +0,0 @@
|
||||
-- Created on: 1993-03-16
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class CopyMap from Interface inherits CopyControl
|
||||
|
||||
---Purpose : Manages a Map for the need of single Transfers, such as Copies
|
||||
-- In such transfer, Starting Entities are read from a unique
|
||||
-- Starting Model, and each transferred Entity is bound to one
|
||||
-- and only one Result, which cannot be changed later.
|
||||
|
||||
uses Transient, Array1OfTransient from TColStd, InterfaceModel
|
||||
|
||||
raises InterfaceError
|
||||
|
||||
is
|
||||
|
||||
Create (amodel : InterfaceModel) returns CopyMap;
|
||||
---Purpose : Creates a CopyMap adapted to work from a Model
|
||||
|
||||
Clear (me : mutable);
|
||||
---Purpose : Clears Transfer List. Gets Ready to begin another Transfer
|
||||
|
||||
Model (me) returns InterfaceModel is static;
|
||||
---Purpose : Returns the InterfaceModel used at Creation time
|
||||
|
||||
Bind (me : mutable; ent : Transient; res : Transient)
|
||||
---Purpose : Binds a Starting Entity identified by its Number <num> in the
|
||||
-- Starting Model, to a Result of Transfer <res>
|
||||
raises InterfaceError;
|
||||
-- Error if <num> is already bound to a result, or is out of range
|
||||
|
||||
Search (me; ent : Transient; res : out Transient)
|
||||
returns Boolean;
|
||||
---Purpose : Search for the result of a Starting Object (i.e. an Entity,
|
||||
-- identified by its Number <num> in the Starting Model)
|
||||
-- Returns True if a Result is Bound (and fills <res>)
|
||||
-- Returns False if no result is Bound (and nullifies <res>)
|
||||
|
||||
fields
|
||||
|
||||
themod : InterfaceModel; -- Starting Model
|
||||
theres : Array1OfTransient; -- list of bound Results
|
||||
|
||||
end CopyMap;
|
@@ -11,12 +11,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_CopyMap.ixx>
|
||||
|
||||
#include <Interface_CopyMap.hxx>
|
||||
#include <Interface_InterfaceError.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
// CopyMap : rien de plus qu une Map passive
|
||||
|
||||
|
||||
Interface_CopyMap::Interface_CopyMap
|
||||
(const Handle(Interface_InterfaceModel)& amodel)
|
||||
: theres (0,amodel->NbEntities())
|
||||
|
88
src/Interface/Interface_CopyMap.hxx
Normal file
88
src/Interface/Interface_CopyMap.hxx
Normal file
@@ -0,0 +1,88 @@
|
||||
// Created on: 1993-03-16
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_CopyMap_HeaderFile
|
||||
#define _Interface_CopyMap_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TColStd_Array1OfTransient.hxx>
|
||||
#include <Interface_CopyControl.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_InterfaceModel;
|
||||
class Interface_InterfaceError;
|
||||
class Standard_Transient;
|
||||
|
||||
|
||||
class Interface_CopyMap;
|
||||
DEFINE_STANDARD_HANDLE(Interface_CopyMap, Interface_CopyControl)
|
||||
|
||||
//! Manages a Map for the need of single Transfers, such as Copies
|
||||
//! In such transfer, Starting Entities are read from a unique
|
||||
//! Starting Model, and each transferred Entity is bound to one
|
||||
//! and only one Result, which cannot be changed later.
|
||||
class Interface_CopyMap : public Interface_CopyControl
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a CopyMap adapted to work from a Model
|
||||
Standard_EXPORT Interface_CopyMap(const Handle(Interface_InterfaceModel)& amodel);
|
||||
|
||||
//! Clears Transfer List. Gets Ready to begin another Transfer
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Returns the InterfaceModel used at Creation time
|
||||
Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
|
||||
|
||||
//! Binds a Starting Entity identified by its Number <num> in the
|
||||
//! Starting Model, to a Result of Transfer <res>
|
||||
Standard_EXPORT void Bind (const Handle(Standard_Transient)& ent, const Handle(Standard_Transient)& res);
|
||||
|
||||
//! Search for the result of a Starting Object (i.e. an Entity,
|
||||
//! identified by its Number <num> in the Starting Model)
|
||||
//! Returns True if a Result is Bound (and fills <res>)
|
||||
//! Returns False if no result is Bound (and nullifies <res>)
|
||||
Standard_EXPORT Standard_Boolean Search (const Handle(Standard_Transient)& ent, Handle(Standard_Transient)& res) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_CopyMap,Interface_CopyControl)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Interface_InterfaceModel) themod;
|
||||
TColStd_Array1OfTransient theres;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_CopyMap_HeaderFile
|
@@ -1,212 +0,0 @@
|
||||
-- Created on: 1993-02-02
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class CopyTool from Interface
|
||||
|
||||
---Purpose : Performs Deep Copies of sets of Entities
|
||||
-- Allows to perform Copy of Interface Entities from a Model to
|
||||
-- another one. Works by calling general services GetFromAnother
|
||||
-- and GetImplied.
|
||||
-- Uses a CopyMap to bind a unique Result to each Copied Entity
|
||||
--
|
||||
-- It is possible to command Copies of Entities (and those they
|
||||
-- reference) by call to the General Service Library, or to
|
||||
-- enforce results for transfer of some Entities (calling Bind)
|
||||
--
|
||||
-- A Same CopyTool can be used for several successive Copies from
|
||||
-- the same Model : either by restarting from scratch (e.g. to
|
||||
-- copy different parts of a starting Model to several Targets),
|
||||
-- or incremental : in that case, it is possible to know what is
|
||||
-- the content of the last increment (defined by last call to
|
||||
-- ClearLastFlags and queried by call to LastCopiedAfter)
|
||||
--
|
||||
-- Works in two times : first, create the list of copied Entities
|
||||
-- second, pushes them to a target Model (manages also Model's
|
||||
-- Header) or returns the Result as an Iterator, as desired
|
||||
--
|
||||
-- The core action (Copy) works by using ShallowCopy (method
|
||||
-- attached to each class) and Copy from GeneralLib (itself using
|
||||
-- dedicated tools). It can be redefined for specific actions.
|
||||
|
||||
uses Transient, SequenceOfInteger from TColStd, BitMap,
|
||||
InterfaceModel, EntityIterator, CopyControl, CopyMap,
|
||||
GeneralModule, GeneralLib, Protocol from Interface
|
||||
|
||||
raises InterfaceError
|
||||
|
||||
is
|
||||
|
||||
Create (amodel : InterfaceModel; lib : GeneralLib) returns CopyTool;
|
||||
---Purpose : Creates a CopyTool adapted to work from a Model. Works
|
||||
-- with a General Service Library, given as an argument
|
||||
|
||||
Create (amodel : InterfaceModel; protocol : Protocol from Interface)
|
||||
returns CopyTool;
|
||||
---Purpose : Same as above, but Library is defined through a Protocol
|
||||
|
||||
Create (amodel : InterfaceModel) returns CopyTool
|
||||
---Purpose : Same as above, but works with the Active Protocol
|
||||
raises InterfaceError;
|
||||
-- Error if no Active Protocol is defined
|
||||
|
||||
Model (me) returns InterfaceModel;
|
||||
---Purpose : Returns the Model on which the CopyTool works
|
||||
|
||||
SetControl (me : in out; othermap : CopyControl);
|
||||
---Purpose : Changes the Map of Result for another one. This allows to work
|
||||
-- with a more sophisticated Mapping Control than the Standard
|
||||
-- one which is CopyMap (e.g. TransferProcess from Transfer)
|
||||
|
||||
Control (me) returns CopyControl;
|
||||
---Purpose : Returns the object used for Control
|
||||
|
||||
-- -- Basic Operations -- --
|
||||
|
||||
Clear (me : in out) is virtual;
|
||||
---Purpose : Clears Transfer List. Gets Ready to begin another Transfer
|
||||
|
||||
NewVoid (me : in out; entfrom : Transient; entto : out Transient)
|
||||
returns Boolean is virtual protected;
|
||||
---Purpose : Creates a new void instance (just created) of the same class
|
||||
-- as <entfrom>. Uses the general service GeneralModule:NewVoid
|
||||
-- Returns True if OK (Recognize has succeeded), False else
|
||||
-- (in such a case, the standard method ShallowCopy is called
|
||||
-- to produce <ento> from <entfrom> : hence it is not void)
|
||||
--
|
||||
-- No mapping is managed by this method
|
||||
|
||||
Copy (me : in out; entfrom : Transient; entto : out Transient;
|
||||
mapped : Boolean; errstat : Boolean)
|
||||
returns Boolean is virtual;
|
||||
---Purpose : Creates the CounterPart of an Entity (by ShallowCopy), Binds
|
||||
-- it, then Copies the content of the former Entity to the other
|
||||
-- one (same Type), by call to the General Service Library
|
||||
-- It may command the Copy of Referenced Entities
|
||||
-- Then, its returns True.
|
||||
--
|
||||
-- If <mapped> is True, the Map is used to store the Result
|
||||
-- Else, the Result is simply produced : it can be used to Copy
|
||||
-- internal sub-parts of Entities, which are not intended to be
|
||||
-- shared (Strings, Arrays, etc...)
|
||||
-- If <errstat> is True, this means that the Entity is recorded
|
||||
-- in the Model as Erroneous : in this case, the General Service
|
||||
-- for Deep Copy is not called (this could be dangerous) : hence
|
||||
-- the Counter-Part is produced but empty, it can be referenced.
|
||||
--
|
||||
-- This method does nothing and returns False if the Protocol
|
||||
-- does not recognize <ent>.
|
||||
-- It basically makes a Deep Copy without changing the Types.
|
||||
-- It can be redefined for special uses.
|
||||
|
||||
Implied (me : in out; entfrom : Transient; entto : Transient)
|
||||
is virtual private;
|
||||
---Purpose : Renews the Implied References of one already Copied Entity
|
||||
|
||||
Transferred (me : in out; ent : Transient) returns Transient
|
||||
---Purpose : Transfers one Entity, if not yet bound to a result
|
||||
-- Remark : For an Entity which is reported in the Starting Model,
|
||||
-- the ReportEntity will also be copied with its Content if it
|
||||
-- has one (at least ShallowCopy; Complete Copy if the Protocol
|
||||
-- recognizes the Content : see method Copy)
|
||||
raises InterfaceError;
|
||||
-- This method can raise any kind of Interface exception.
|
||||
-- Especially if <ent> is not contained in Starting Model.
|
||||
|
||||
Bind (me : in out; ent : Transient; res : Transient)
|
||||
---Purpose : Defines a Result for the Transfer of a Starting object.
|
||||
-- Used by method Transferred (which performs a normal Copy),
|
||||
-- but can also be called to enforce a result : in the latter
|
||||
-- case, the enforced result must be compatible with the other
|
||||
-- Transfers which are performed
|
||||
raises InterfaceError;
|
||||
-- Error if a Result is already bound with this Starting Object
|
||||
|
||||
Search (me; ent : Transient; res : out Transient)
|
||||
returns Boolean;
|
||||
---Purpose : Search for the result of a Starting Object (i.e. an Entity)
|
||||
-- Returns True if a Result is Bound (and fills "result")
|
||||
-- Returns False if no result is Bound
|
||||
|
||||
ClearLastFlags (me : in out);
|
||||
---Purpose : Clears LastFlags only. This allows to know what Entities are
|
||||
-- copied after its call (see method LastCopiedAfter). It can be
|
||||
-- used when copies are done by increments, which must be
|
||||
-- distinghished. ClearLastFlags is also called by Clear.
|
||||
|
||||
LastCopiedAfter (me; numfrom : Integer;
|
||||
ent : out Transient; res : out Transient) returns Integer;
|
||||
---Purpose : Returns an copied Entity and its Result which were operated
|
||||
-- after last call to ClearLastFlags. It returns the first
|
||||
-- "Last Copied Entity" which Number follows <numfrom>, Zero if
|
||||
-- none. It is used in a loop as follow :
|
||||
-- Integer num = 0;
|
||||
-- while ( (num = CopyTool.LastCopiedAfter(num,ent,res)) ) {
|
||||
-- .. Process Starting <ent> and its Result <res>
|
||||
-- }
|
||||
|
||||
-- -- General Operations -- --
|
||||
|
||||
TransferEntity (me : in out; ent : Transient)
|
||||
---Purpose : Transfers one Entity and records result into the Transfer List
|
||||
-- Calls method Transferred
|
||||
raises InterfaceError;
|
||||
-- This method can raise any kind of Interface exception
|
||||
|
||||
RenewImpliedRefs (me : in out) raises InterfaceError;
|
||||
---Purpose : Renews the Implied References. These References do not involve
|
||||
-- Copying of referenced Entities. For such a Reference, if the
|
||||
-- Entity which defines it AND the referenced Entity are both
|
||||
-- copied, then this Reference is renewed. Else it is deleted in
|
||||
-- the copied Entities.
|
||||
-- Remark : this concerns only some specific references, such as
|
||||
-- "back pointers".
|
||||
|
||||
FillModel (me : in out; bmodel : InterfaceModel)
|
||||
raises InterfaceError;
|
||||
---Purpose : Fills a Model with the result of the transfer (TransferList)
|
||||
-- Commands copy of Header too, and calls RenewImpliedRefs
|
||||
|
||||
CompleteResult (me; withreports : Boolean = Standard_False)
|
||||
returns EntityIterator;
|
||||
---Purpose : Returns the complete list of copied Entities
|
||||
-- If <withreports> is given True, the entities which were
|
||||
-- reported in the Starting Model are replaced in the list
|
||||
-- by the copied ReportEntities
|
||||
|
||||
RootResult (me; withreports : Boolean = Standard_False)
|
||||
returns EntityIterator;
|
||||
---Purpose : Returns the list of Root copied Entities (those which were
|
||||
-- asked for copy by the user of CopyTool, not by copying
|
||||
-- another Entity)
|
||||
|
||||
---C++: alias " Standard_EXPORT virtual ~Interface_CopyTool();"
|
||||
|
||||
fields
|
||||
|
||||
themod : InterfaceModel; -- Starting Model & Entities
|
||||
themap : CopyControl; -- Basic Copy Results
|
||||
therep : CopyMap; -- Report Results (if any)
|
||||
thelst : BitMap;
|
||||
thelib : GeneralLib is protected; -- (heirs can use it)
|
||||
thelev : Integer; -- Current recursive Call Level (Root = 0)
|
||||
therts : SequenceOfInteger from TColStd; -- "Root" Entities (thelev = 0)
|
||||
theimp : Boolean; -- are Implied Refs renewed
|
||||
|
||||
theent : Transient; -- Last processed
|
||||
themdu : GeneralModule;
|
||||
theCN : Integer;
|
||||
|
||||
end CopyTool;
|
@@ -11,12 +11,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_CopyTool.ixx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_ReportEntity.hxx>
|
||||
#include <Interface_InterfaceError.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
#include <Interface_CopyControl.hxx>
|
||||
#include <Interface_CopyMap.hxx>
|
||||
#include <Interface_CopyTool.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_InterfaceError.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_ReportEntity.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
// Se souvenir qu une version plus riche de CopyTool existe : c est
|
||||
// TransferDispatch (package Transfer). Cette classe offre beaucoup plus de
|
||||
@@ -27,11 +34,8 @@
|
||||
// Passe 2 : une fois tous les transferts faits, les relations "Imply" sont
|
||||
// mises, pour les entites designees ET QUI ONT ETE AUSSI TRANSFEREES, la
|
||||
// relation est reconduite (pas de nouveau Share)
|
||||
|
||||
|
||||
// #####################################################################
|
||||
// .... CONSTRUCTEURS ....
|
||||
|
||||
Interface_CopyTool::Interface_CopyTool
|
||||
(const Handle(Interface_InterfaceModel)& amodel,
|
||||
const Interface_GeneralLib& lib)
|
||||
|
226
src/Interface/Interface_CopyTool.hxx
Normal file
226
src/Interface/Interface_CopyTool.hxx
Normal file
@@ -0,0 +1,226 @@
|
||||
// Created on: 1993-02-02
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_CopyTool_HeaderFile
|
||||
#define _Interface_CopyTool_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_BitMap.hxx>
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_InterfaceModel;
|
||||
class Interface_CopyControl;
|
||||
class Interface_CopyMap;
|
||||
class Standard_Transient;
|
||||
class Interface_GeneralModule;
|
||||
class Interface_InterfaceError;
|
||||
class Interface_GeneralLib;
|
||||
class Interface_Protocol;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! Performs Deep Copies of sets of Entities
|
||||
//! Allows to perform Copy of Interface Entities from a Model to
|
||||
//! another one. Works by calling general services GetFromAnother
|
||||
//! and GetImplied.
|
||||
//! Uses a CopyMap to bind a unique Result to each Copied Entity
|
||||
//!
|
||||
//! It is possible to command Copies of Entities (and those they
|
||||
//! reference) by call to the General Service Library, or to
|
||||
//! enforce results for transfer of some Entities (calling Bind)
|
||||
//!
|
||||
//! A Same CopyTool can be used for several successive Copies from
|
||||
//! the same Model : either by restarting from scratch (e.g. to
|
||||
//! copy different parts of a starting Model to several Targets),
|
||||
//! or incremental : in that case, it is possible to know what is
|
||||
//! the content of the last increment (defined by last call to
|
||||
//! ClearLastFlags and queried by call to LastCopiedAfter)
|
||||
//!
|
||||
//! Works in two times : first, create the list of copied Entities
|
||||
//! second, pushes them to a target Model (manages also Model's
|
||||
//! Header) or returns the Result as an Iterator, as desired
|
||||
//!
|
||||
//! The core action (Copy) works by using ShallowCopy (method
|
||||
//! attached to each class) and Copy from GeneralLib (itself using
|
||||
//! dedicated tools). It can be redefined for specific actions.
|
||||
class Interface_CopyTool
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a CopyTool adapted to work from a Model. Works
|
||||
//! with a General Service Library, given as an argument
|
||||
Standard_EXPORT Interface_CopyTool(const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib);
|
||||
|
||||
//! Same as above, but Library is defined through a Protocol
|
||||
Standard_EXPORT Interface_CopyTool(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol);
|
||||
|
||||
//! Same as above, but works with the Active Protocol
|
||||
Standard_EXPORT Interface_CopyTool(const Handle(Interface_InterfaceModel)& amodel);
|
||||
|
||||
//! Returns the Model on which the CopyTool works
|
||||
Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
|
||||
|
||||
//! Changes the Map of Result for another one. This allows to work
|
||||
//! with a more sophisticated Mapping Control than the Standard
|
||||
//! one which is CopyMap (e.g. TransferProcess from Transfer)
|
||||
Standard_EXPORT void SetControl (const Handle(Interface_CopyControl)& othermap);
|
||||
|
||||
//! Returns the object used for Control
|
||||
Standard_EXPORT Handle(Interface_CopyControl) Control() const;
|
||||
|
||||
//! Clears Transfer List. Gets Ready to begin another Transfer
|
||||
Standard_EXPORT virtual void Clear();
|
||||
|
||||
//! Creates the CounterPart of an Entity (by ShallowCopy), Binds
|
||||
//! it, then Copies the content of the former Entity to the other
|
||||
//! one (same Type), by call to the General Service Library
|
||||
//! It may command the Copy of Referenced Entities
|
||||
//! Then, its returns True.
|
||||
//!
|
||||
//! If <mapped> is True, the Map is used to store the Result
|
||||
//! Else, the Result is simply produced : it can be used to Copy
|
||||
//! internal sub-parts of Entities, which are not intended to be
|
||||
//! shared (Strings, Arrays, etc...)
|
||||
//! If <errstat> is True, this means that the Entity is recorded
|
||||
//! in the Model as Erroneous : in this case, the General Service
|
||||
//! for Deep Copy is not called (this could be dangerous) : hence
|
||||
//! the Counter-Part is produced but empty, it can be referenced.
|
||||
//!
|
||||
//! This method does nothing and returns False if the Protocol
|
||||
//! does not recognize <ent>.
|
||||
//! It basically makes a Deep Copy without changing the Types.
|
||||
//! It can be redefined for special uses.
|
||||
Standard_EXPORT virtual Standard_Boolean Copy (const Handle(Standard_Transient)& entfrom, Handle(Standard_Transient)& entto, const Standard_Boolean mapped, const Standard_Boolean errstat);
|
||||
|
||||
//! Transfers one Entity, if not yet bound to a result
|
||||
//! Remark : For an Entity which is reported in the Starting Model,
|
||||
//! the ReportEntity will also be copied with its Content if it
|
||||
//! has one (at least ShallowCopy; Complete Copy if the Protocol
|
||||
//! recognizes the Content : see method Copy)
|
||||
Standard_EXPORT Handle(Standard_Transient) Transferred (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Defines a Result for the Transfer of a Starting object.
|
||||
//! Used by method Transferred (which performs a normal Copy),
|
||||
//! but can also be called to enforce a result : in the latter
|
||||
//! case, the enforced result must be compatible with the other
|
||||
//! Transfers which are performed
|
||||
Standard_EXPORT void Bind (const Handle(Standard_Transient)& ent, const Handle(Standard_Transient)& res);
|
||||
|
||||
//! Search for the result of a Starting Object (i.e. an Entity)
|
||||
//! Returns True if a Result is Bound (and fills "result")
|
||||
//! Returns False if no result is Bound
|
||||
Standard_EXPORT Standard_Boolean Search (const Handle(Standard_Transient)& ent, Handle(Standard_Transient)& res) const;
|
||||
|
||||
//! Clears LastFlags only. This allows to know what Entities are
|
||||
//! copied after its call (see method LastCopiedAfter). It can be
|
||||
//! used when copies are done by increments, which must be
|
||||
//! distinghished. ClearLastFlags is also called by Clear.
|
||||
Standard_EXPORT void ClearLastFlags();
|
||||
|
||||
//! Returns an copied Entity and its Result which were operated
|
||||
//! after last call to ClearLastFlags. It returns the first
|
||||
//! "Last Copied Entity" which Number follows <numfrom>, Zero if
|
||||
//! none. It is used in a loop as follow :
|
||||
//! Integer num = 0;
|
||||
//! while ( (num = CopyTool.LastCopiedAfter(num,ent,res)) ) {
|
||||
//! .. Process Starting <ent> and its Result <res>
|
||||
//! }
|
||||
Standard_EXPORT Standard_Integer LastCopiedAfter (const Standard_Integer numfrom, Handle(Standard_Transient)& ent, Handle(Standard_Transient)& res) const;
|
||||
|
||||
//! Transfers one Entity and records result into the Transfer List
|
||||
//! Calls method Transferred
|
||||
Standard_EXPORT void TransferEntity (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Renews the Implied References. These References do not involve
|
||||
//! Copying of referenced Entities. For such a Reference, if the
|
||||
//! Entity which defines it AND the referenced Entity are both
|
||||
//! copied, then this Reference is renewed. Else it is deleted in
|
||||
//! the copied Entities.
|
||||
//! Remark : this concerns only some specific references, such as
|
||||
//! "back pointers".
|
||||
Standard_EXPORT void RenewImpliedRefs();
|
||||
|
||||
//! Fills a Model with the result of the transfer (TransferList)
|
||||
//! Commands copy of Header too, and calls RenewImpliedRefs
|
||||
Standard_EXPORT void FillModel (const Handle(Interface_InterfaceModel)& bmodel);
|
||||
|
||||
//! Returns the complete list of copied Entities
|
||||
//! If <withreports> is given True, the entities which were
|
||||
//! reported in the Starting Model are replaced in the list
|
||||
//! by the copied ReportEntities
|
||||
Standard_EXPORT Interface_EntityIterator CompleteResult (const Standard_Boolean withreports = Standard_False) const;
|
||||
|
||||
//! Returns the list of Root copied Entities (those which were
|
||||
//! asked for copy by the user of CopyTool, not by copying
|
||||
//! another Entity)
|
||||
Standard_EXPORT Interface_EntityIterator RootResult (const Standard_Boolean withreports = Standard_False) const;
|
||||
Standard_EXPORT virtual ~Interface_CopyTool();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Creates a new void instance (just created) of the same class
|
||||
//! as <entfrom>. Uses the general service GeneralModule:NewVoid
|
||||
//! Returns True if OK (Recognize has succeeded), False else
|
||||
//! (in such a case, the standard method ShallowCopy is called
|
||||
//! to produce <ento> from <entfrom> : hence it is not void)
|
||||
//!
|
||||
//! No mapping is managed by this method
|
||||
Standard_EXPORT virtual Standard_Boolean NewVoid (const Handle(Standard_Transient)& entfrom, Handle(Standard_Transient)& entto);
|
||||
|
||||
|
||||
Interface_GeneralLib thelib;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Renews the Implied References of one already Copied Entity
|
||||
Standard_EXPORT virtual void Implied (const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto);
|
||||
|
||||
|
||||
Handle(Interface_InterfaceModel) themod;
|
||||
Handle(Interface_CopyControl) themap;
|
||||
Handle(Interface_CopyMap) therep;
|
||||
Interface_BitMap thelst;
|
||||
Standard_Integer thelev;
|
||||
TColStd_SequenceOfInteger therts;
|
||||
Standard_Boolean theimp;
|
||||
Handle(Standard_Transient) theent;
|
||||
Handle(Interface_GeneralModule) themdu;
|
||||
Standard_Integer theCN;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_CopyTool_HeaderFile
|
32
src/Interface/Interface_DataState.hxx
Normal file
32
src/Interface/Interface_DataState.hxx
Normal file
@@ -0,0 +1,32 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_DataState_HeaderFile
|
||||
#define _Interface_DataState_HeaderFile
|
||||
|
||||
//! validity state of anentity's content (see InterfaceModel)
|
||||
enum Interface_DataState
|
||||
{
|
||||
Interface_StateOK,
|
||||
Interface_LoadWarning,
|
||||
Interface_LoadFail,
|
||||
Interface_DataWarning,
|
||||
Interface_DataFail,
|
||||
Interface_StateUnloaded,
|
||||
Interface_StateUnknown
|
||||
};
|
||||
|
||||
#endif // _Interface_DataState_HeaderFile
|
@@ -1,117 +0,0 @@
|
||||
-- Created on: 1992-11-02
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
private class EntityCluster from Interface inherits TShared
|
||||
|
||||
---Purpose : Auxiliary class for EntityList. An EntityList designates an
|
||||
-- EntityCluster, which brings itself an fixed maximum count of
|
||||
-- Entities. If it is full, it gives access to another cluster
|
||||
-- ("Next"). This class is intended to give a good compromise
|
||||
-- between access time (faster than a Sequence, good for little
|
||||
-- count) and memory use (better than a Sequence in any case,
|
||||
-- overall for little count, better than an Array for a very
|
||||
-- little count. It is designed for a light management.
|
||||
-- Remark that a new Item may not be Null, because this is the
|
||||
-- criterium used for "End of List"
|
||||
|
||||
uses EntityIterator, Transient
|
||||
|
||||
raises OutOfRange, NullObject
|
||||
|
||||
is
|
||||
|
||||
Create returns EntityCluster;
|
||||
---Purpose : Creates an empty, non-chained, EntityCluster
|
||||
|
||||
Create (ent : any Transient) returns EntityCluster;
|
||||
---Purpose : Creates a non-chained EntityCluster, filled with one Entity
|
||||
|
||||
Create (ec : EntityCluster) returns EntityCluster;
|
||||
---Purpose : Creates an empty EntityCluster, chained with another one
|
||||
-- (that is, put BEFORE this other one in the list)
|
||||
|
||||
Create (ant : any Transient; ec : EntityCluster)
|
||||
returns EntityCluster;
|
||||
---Purpose : Creates an EntityCluster, filled with a first Entity, and
|
||||
-- chained to another EntityCluster (BEFORE it, as above)
|
||||
|
||||
|
||||
Append (me : mutable; ent : any Transient)
|
||||
---Purpose : Appends an Entity to the Cluster. If it is not full, adds the
|
||||
-- entity directly inside itself. Else, transmits to its Next
|
||||
-- and Creates it if it does not yet exist
|
||||
raises NullObject is static;
|
||||
-- Error if <ent> is Null
|
||||
|
||||
Remove (me : mutable; ent : any Transient) returns Boolean
|
||||
---Purpose : Removes an Entity from the Cluster. If it is not found, calls
|
||||
-- its Next one to do so.
|
||||
-- Returns True if it becomes itself empty, False else
|
||||
-- (thus, a Cluster which becomes empty is deleted from the list)
|
||||
raises NullObject is static;
|
||||
-- Error if <ent> is Null
|
||||
|
||||
Remove (me : mutable; num : Integer) returns Boolean
|
||||
---Purpose : Removes an Entity from the Cluster, given its rank. If <num>
|
||||
-- is greater than NbLocal, calls its Next with (num - NbLocal),
|
||||
-- Returns True if it becomes itself empty, False else
|
||||
raises OutOfRange is static;
|
||||
-- Raises an Exception if there is no Next to do so.
|
||||
|
||||
NbEntities (me) returns Integer is static;
|
||||
---Purpose : Returns total count of Entities (including Next)
|
||||
|
||||
Value (me; num : Integer) returns any Transient
|
||||
---Purpose : Returns the Entity identified by its rank in the list
|
||||
-- (including Next)
|
||||
raises OutOfRange is static;
|
||||
-- Error if num less than 1 or num more then NbEntities
|
||||
---C++ : return const &
|
||||
|
||||
SetValue (me : mutable; num : Integer; ent : any Transient)
|
||||
---Purpose : Changes an Entity given its rank.
|
||||
raises OutOfRange, NullObject is static;
|
||||
-- Error if <num> is not in [1 - NbEntities], or if <ent> is Null
|
||||
|
||||
FillIterator (me; iter : in out EntityIterator) is static;
|
||||
---Purpose : Fills an Iterator with designated Entities (includes Next)
|
||||
|
||||
-- -- Internal Queries, also used by EntityList -- --
|
||||
|
||||
IsLocalFull (me) returns Boolean is static private;
|
||||
---Purpose : Returns True if all the set of entities local to a Cluster is
|
||||
-- full. Used by EntityList.
|
||||
|
||||
NbLocal (me) returns Integer is static private;
|
||||
---Purpose : Returns count of entities in the local set (without Next)
|
||||
-- Entities can then be read normally by method Value
|
||||
|
||||
HasNext (me) returns Boolean is static private;
|
||||
---Purpose : Returns True if a Cluster has a Next
|
||||
|
||||
Next (me) returns EntityCluster is static private;
|
||||
---Purpose : Returns Next Cluster in the chain
|
||||
|
||||
fields
|
||||
|
||||
theents : Transient[4]; -- 4 : best compromise for memory use
|
||||
thenext : EntityCluster;
|
||||
|
||||
friends
|
||||
|
||||
class EntityList -- of which EntityCluster stores content
|
||||
|
||||
end EntityCluster;
|
@@ -11,21 +11,22 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_EntityCluster.ixx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
#include <Interface_EntityCluster.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_EntityList.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
// Un Cluster, ce sont 4 entites qui se suivent (dans le principe, nombre fixe,
|
||||
// meme si pas 4). Elles sont remplies depuis 0. Il y a donc autant d Entites
|
||||
// que de Handles non Nuls, plus le fait qu ils sont remplis dans l ordre
|
||||
|
||||
// Ainsi (avec Next), on consomme 5 Handles pour 4 Entites, avec une pointe
|
||||
// pour 1 et 2 Entites (on reste a 5 Handles)
|
||||
|
||||
// Suppression : On retasse le Cluster pour que les Nulls soient tjrs a la fin
|
||||
|
||||
// .... CONSTRUCTEURS ....
|
||||
|
||||
Interface_EntityCluster::Interface_EntityCluster () { }
|
||||
|
||||
Interface_EntityCluster::Interface_EntityCluster
|
||||
|
135
src/Interface/Interface_EntityCluster.hxx
Normal file
135
src/Interface/Interface_EntityCluster.hxx
Normal file
@@ -0,0 +1,135 @@
|
||||
// Created on: 1992-11-02
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_EntityCluster_HeaderFile
|
||||
#define _Interface_EntityCluster_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Standard_Transient;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NullObject;
|
||||
class Interface_EntityList;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
class Interface_EntityCluster;
|
||||
DEFINE_STANDARD_HANDLE(Interface_EntityCluster, MMgt_TShared)
|
||||
|
||||
//! Auxiliary class for EntityList. An EntityList designates an
|
||||
//! EntityCluster, which brings itself an fixed maximum count of
|
||||
//! Entities. If it is full, it gives access to another cluster
|
||||
//! ("Next"). This class is intended to give a good compromise
|
||||
//! between access time (faster than a Sequence, good for little
|
||||
//! count) and memory use (better than a Sequence in any case,
|
||||
//! overall for little count, better than an Array for a very
|
||||
//! little count. It is designed for a light management.
|
||||
//! Remark that a new Item may not be Null, because this is the
|
||||
//! criterium used for "End of List"
|
||||
class Interface_EntityCluster : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an empty, non-chained, EntityCluster
|
||||
Standard_EXPORT Interface_EntityCluster();
|
||||
|
||||
//! Creates a non-chained EntityCluster, filled with one Entity
|
||||
Standard_EXPORT Interface_EntityCluster(const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Creates an empty EntityCluster, chained with another one
|
||||
//! (that is, put BEFORE this other one in the list)
|
||||
Standard_EXPORT Interface_EntityCluster(const Handle(Interface_EntityCluster)& ec);
|
||||
|
||||
//! Creates an EntityCluster, filled with a first Entity, and
|
||||
//! chained to another EntityCluster (BEFORE it, as above)
|
||||
Standard_EXPORT Interface_EntityCluster(const Handle(Standard_Transient)& ant, const Handle(Interface_EntityCluster)& ec);
|
||||
|
||||
//! Appends an Entity to the Cluster. If it is not full, adds the
|
||||
//! entity directly inside itself. Else, transmits to its Next
|
||||
//! and Creates it if it does not yet exist
|
||||
Standard_EXPORT void Append (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Removes an Entity from the Cluster. If it is not found, calls
|
||||
//! its Next one to do so.
|
||||
//! Returns True if it becomes itself empty, False else
|
||||
//! (thus, a Cluster which becomes empty is deleted from the list)
|
||||
Standard_EXPORT Standard_Boolean Remove (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Removes an Entity from the Cluster, given its rank. If <num>
|
||||
//! is greater than NbLocal, calls its Next with (num - NbLocal),
|
||||
//! Returns True if it becomes itself empty, False else
|
||||
Standard_EXPORT Standard_Boolean Remove (const Standard_Integer num);
|
||||
|
||||
//! Returns total count of Entities (including Next)
|
||||
Standard_EXPORT Standard_Integer NbEntities() const;
|
||||
|
||||
//! Returns the Entity identified by its rank in the list
|
||||
//! (including Next)
|
||||
Standard_EXPORT const Handle(Standard_Transient)& Value (const Standard_Integer num) const;
|
||||
|
||||
//! Changes an Entity given its rank.
|
||||
Standard_EXPORT void SetValue (const Standard_Integer num, const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Fills an Iterator with designated Entities (includes Next)
|
||||
Standard_EXPORT void FillIterator (Interface_EntityIterator& iter) const;
|
||||
|
||||
|
||||
friend class Interface_EntityList;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_EntityCluster,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Returns True if all the set of entities local to a Cluster is
|
||||
//! full. Used by EntityList.
|
||||
Standard_EXPORT Standard_Boolean IsLocalFull() const;
|
||||
|
||||
//! Returns count of entities in the local set (without Next)
|
||||
//! Entities can then be read normally by method Value
|
||||
Standard_EXPORT Standard_Integer NbLocal() const;
|
||||
|
||||
//! Returns True if a Cluster has a Next
|
||||
Standard_EXPORT Standard_Boolean HasNext() const;
|
||||
|
||||
//! Returns Next Cluster in the chain
|
||||
Standard_EXPORT Handle(Interface_EntityCluster) Next() const;
|
||||
|
||||
Handle(Standard_Transient) theents[4];
|
||||
Handle(Interface_EntityCluster) thenext;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_EntityCluster_HeaderFile
|
@@ -1,92 +0,0 @@
|
||||
-- Created on: 1992-02-03
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class EntityIterator from Interface
|
||||
|
||||
---Purpose : Defines an Iterator on Entities.
|
||||
-- Allows considering of various criteria
|
||||
|
||||
uses Transient, HSequenceOfTransient from TColStd,
|
||||
IntVal, InterfaceModel
|
||||
|
||||
raises NoMoreObject, NoSuchObject
|
||||
|
||||
is
|
||||
|
||||
Create returns EntityIterator;
|
||||
---Purpose : Defines an empty iterator (see AddList & AddItem)
|
||||
|
||||
Create (list : HSequenceOfTransient) returns EntityIterator;
|
||||
---Purpose : Defines an iterator on a list, directly i.e. without copying it
|
||||
|
||||
AddList (me : in out; list : HSequenceOfTransient);
|
||||
---Purpose : Gets a list of entities and adds its to the iteration list
|
||||
|
||||
AddItem (me : in out; anentity : any Transient);
|
||||
---Purpose : Adds to the iteration list a defined entity
|
||||
|
||||
GetOneItem (me : in out; anentity : any Transient) is static;
|
||||
---Purpose : same as AddItem (kept for compatibility)
|
||||
|
||||
Reset (me : in out) is protected;
|
||||
---Purpose : Allows subclasses of EntityIterator to reevaluate an iteration
|
||||
|
||||
SelectType (me : in out; atype : Type; keep : Boolean);
|
||||
---Purpose : Selects entities with are Kind of a given type, keep only
|
||||
-- them (is keep is True) or reject only them (if keep is False)
|
||||
|
||||
|
||||
NbEntities (me) returns Integer is static;
|
||||
---Purpose : Returns count of entities which will be iterated on
|
||||
-- Calls Start if not yet done
|
||||
|
||||
NbTyped (me; type : Type) returns Integer is static;
|
||||
---Purpose : Returns count of entities of a given type (kind of)
|
||||
|
||||
Typed (me; type : Type) returns EntityIterator;
|
||||
---Purpose : Returns the list of entities of a given type (kind of)
|
||||
|
||||
Start (me) is virtual;
|
||||
---Purpose : Allows re-iteration (useless for the first iteration)
|
||||
|
||||
More (me) returns Boolean;
|
||||
---Purpose : Says if there are other entities (vertices) to iterate
|
||||
-- the first time, calls Start
|
||||
|
||||
Next (me) raises NoMoreObject;
|
||||
---Purpose : Sets iteration to the next entity (vertex) to give
|
||||
|
||||
Value (me) returns any Transient raises NoSuchObject;
|
||||
---Purpose : Returns the current Entity iterated, to be used by Interface
|
||||
-- tools
|
||||
---C++ : return const &
|
||||
|
||||
Content (me) returns HSequenceOfTransient;
|
||||
---Purpose : Returns the content of the Iterator, accessed through a Handle
|
||||
-- to be used by a frontal-engine logic
|
||||
-- Returns an empty Sequence if the Iterator is empty
|
||||
-- Calls Start if not yet done
|
||||
|
||||
Destroy (me : in out) is virtual;
|
||||
---Purpose : Clears data of iteration
|
||||
---C++: alias "Standard_EXPORT virtual ~Interface_EntityIterator() { Destroy();}"
|
||||
|
||||
fields
|
||||
|
||||
thecurr : IntVal;
|
||||
thelist : HSequenceOfTransient;
|
||||
|
||||
end EntityIterator;
|
@@ -11,18 +11,17 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_EntityIterator.ixx>
|
||||
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_IntVal.hxx>
|
||||
#include <Standard_NoMoreObject.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
// Iterateur pour ecriture for, ou while avec Next en fin :
|
||||
// for (creer iterateur; iter.More(); iter.Next()) { val = iter.Value(); ... }
|
||||
|
||||
|
||||
// .... Definitions initiales : en particulier celles requises pour
|
||||
// les outils de graphe (construction avec le graphe, avec un vertex)
|
||||
|
||||
Interface_EntityIterator::Interface_EntityIterator ()
|
||||
{
|
||||
// thecurr = new Interface_IntVal;
|
||||
|
124
src/Interface/Interface_EntityIterator.hxx
Normal file
124
src/Interface/Interface_EntityIterator.hxx
Normal file
@@ -0,0 +1,124 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_EntityIterator_HeaderFile
|
||||
#define _Interface_EntityIterator_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Interface_IntVal;
|
||||
class Standard_NoMoreObject;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_Transient;
|
||||
|
||||
|
||||
//! Defines an Iterator on Entities.
|
||||
//! Allows considering of various criteria
|
||||
class Interface_EntityIterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Defines an empty iterator (see AddList & AddItem)
|
||||
Standard_EXPORT Interface_EntityIterator();
|
||||
|
||||
//! Defines an iterator on a list, directly i.e. without copying it
|
||||
Standard_EXPORT Interface_EntityIterator(const Handle(TColStd_HSequenceOfTransient)& list);
|
||||
|
||||
//! Gets a list of entities and adds its to the iteration list
|
||||
Standard_EXPORT void AddList (const Handle(TColStd_HSequenceOfTransient)& list);
|
||||
|
||||
//! Adds to the iteration list a defined entity
|
||||
Standard_EXPORT void AddItem (const Handle(Standard_Transient)& anentity);
|
||||
|
||||
//! same as AddItem (kept for compatibility)
|
||||
Standard_EXPORT void GetOneItem (const Handle(Standard_Transient)& anentity);
|
||||
|
||||
//! Selects entities with are Kind of a given type, keep only
|
||||
//! them (is keep is True) or reject only them (if keep is False)
|
||||
Standard_EXPORT void SelectType (const Handle(Standard_Type)& atype, const Standard_Boolean keep);
|
||||
|
||||
//! Returns count of entities which will be iterated on
|
||||
//! Calls Start if not yet done
|
||||
Standard_EXPORT Standard_Integer NbEntities() const;
|
||||
|
||||
//! Returns count of entities of a given type (kind of)
|
||||
Standard_EXPORT Standard_Integer NbTyped (const Handle(Standard_Type)& type) const;
|
||||
|
||||
//! Returns the list of entities of a given type (kind of)
|
||||
Standard_EXPORT Interface_EntityIterator Typed (const Handle(Standard_Type)& type) const;
|
||||
|
||||
//! Allows re-iteration (useless for the first iteration)
|
||||
Standard_EXPORT virtual void Start() const;
|
||||
|
||||
//! Says if there are other entities (vertices) to iterate
|
||||
//! the first time, calls Start
|
||||
Standard_EXPORT Standard_Boolean More() const;
|
||||
|
||||
//! Sets iteration to the next entity (vertex) to give
|
||||
Standard_EXPORT void Next() const;
|
||||
|
||||
//! Returns the current Entity iterated, to be used by Interface
|
||||
//! tools
|
||||
Standard_EXPORT const Handle(Standard_Transient)& Value() const;
|
||||
|
||||
//! Returns the content of the Iterator, accessed through a Handle
|
||||
//! to be used by a frontal-engine logic
|
||||
//! Returns an empty Sequence if the Iterator is empty
|
||||
//! Calls Start if not yet done
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Content() const;
|
||||
|
||||
//! Clears data of iteration
|
||||
Standard_EXPORT virtual void Destroy();
|
||||
Standard_EXPORT virtual ~Interface_EntityIterator() { Destroy();}
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Allows subclasses of EntityIterator to reevaluate an iteration
|
||||
Standard_EXPORT void Reset();
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Interface_IntVal) thecurr;
|
||||
Handle(TColStd_HSequenceOfTransient) thelist;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_EntityIterator_HeaderFile
|
@@ -1,110 +0,0 @@
|
||||
-- Created on: 1992-11-02
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class EntityList from Interface
|
||||
|
||||
---Purpose : This class defines a list of Entities (Transient Objects),
|
||||
-- it can be used as a field of other Transient classes, with
|
||||
-- these features :
|
||||
-- - oriented to define a little list, that is, slower than an
|
||||
-- Array or a Map of Entities for a big count (about 100 and
|
||||
-- over), but faster than a Sequence
|
||||
-- - allows to work as a Sequence, limited to Clear, Append,
|
||||
-- Remove, Access to an Item identified by its rank in the list
|
||||
-- - space saving, compared to a Sequence, especially for little
|
||||
-- amounts; better than an Array for a very little amount (less
|
||||
-- than 10) but less good for a greater amount
|
||||
--
|
||||
-- Works in conjunction with EntityCluster
|
||||
-- An EntityList gives access to a list of Entity Clusters, which
|
||||
-- are chained (in one sense : Single List)
|
||||
-- Remark : a new Item may not be Null, because this is the
|
||||
-- criterium used for "End of List"
|
||||
|
||||
uses Type, Transient, EntityCluster, EntityIterator
|
||||
|
||||
raises OutOfRange, InterfaceError, NullObject
|
||||
|
||||
is
|
||||
|
||||
Create returns EntityList;
|
||||
---Purpose : Creates a List as beeing empty
|
||||
|
||||
Clear (me : in out) is static;
|
||||
---Purpose : Clears the List
|
||||
|
||||
Append (me : in out; ent : any Transient)
|
||||
---Purpose : Appends an Entity, that is to the END of the list
|
||||
-- (keeps order, but works slowerly than Add, see below)
|
||||
raises NullObject is static;
|
||||
-- Error if <ent> is Null
|
||||
|
||||
Add (me : in out; ent : any Transient)
|
||||
---Purpose : Adds an Entity to the list, that is, with NO REGARD about the
|
||||
-- order (faster than Append if count becomes greater than 10)
|
||||
raises NullObject is static;
|
||||
-- Error if <ent> is Null
|
||||
|
||||
Remove (me : in out; ent : any Transient)
|
||||
---Purpose : Removes an Entity from the list, if it is there
|
||||
raises NullObject is static;
|
||||
-- Error if <ent> is Null
|
||||
|
||||
Remove (me : in out; num : Integer)
|
||||
---Purpose : Removes an Entity from the list, given its rank
|
||||
raises OutOfRange is static;
|
||||
-- Error if <num> is not in range [1 - NbEntities]
|
||||
|
||||
IsEmpty (me) returns Boolean is static;
|
||||
---Purpose : Returns True if the list is empty
|
||||
|
||||
NbEntities (me) returns Integer is static;
|
||||
---Purpose : Returns count of recorded Entities
|
||||
|
||||
Value (me; num : Integer) returns any Transient
|
||||
---Purpose : Returns an Item given its number. Beware about the way the
|
||||
-- list was filled (see above, Add and Append)
|
||||
raises OutOfRange is static;
|
||||
-- Error if <num> is not in range [1 - NbEntities]
|
||||
---C++ : return const &
|
||||
|
||||
SetValue (me : in out; num : Integer; ent : any Transient)
|
||||
---Purpose : Returns an Item given its number. Beware about the way the
|
||||
-- list was filled (see above, Add and Append)
|
||||
raises OutOfRange, NullObject is static;
|
||||
-- Error if <num> is not in [1 - NbEntities], or if <ent> is Null
|
||||
|
||||
|
||||
FillIterator (me; iter : in out EntityIterator) is static;
|
||||
---Purpose : fills an Iterator with the content of the list
|
||||
-- (normal way to consult a list which has been filled with Add)
|
||||
|
||||
NbTypedEntities (me; atype : any Type) returns Integer is static;
|
||||
---Purpose : Returns count of Entities of a given Type (0 : none)
|
||||
|
||||
TypedEntity (me; atype : any Type; num : Integer = 0) returns any Transient
|
||||
---Purpose : Returns the Entity which is of a given type.
|
||||
-- If num = 0 (D), there must be ONE AND ONLY ONE
|
||||
-- If num > 0, returns the num-th entity of this type
|
||||
raises InterfaceError is static;
|
||||
-- Error if none or several found (num=0), or not enough (num>0)
|
||||
|
||||
fields
|
||||
|
||||
theval : Transient; -- Null(zero), a Transient(one), EntityCluster(more)
|
||||
-- Mandatory only one field
|
||||
|
||||
end EntityList;
|
@@ -11,20 +11,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_EntityList.ixx>
|
||||
#include <Interface_EntityCluster.hxx>
|
||||
#include <Interface_InterfaceError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
|
||||
#include <Interface_EntityCluster.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_EntityList.hxx>
|
||||
#include <Interface_InterfaceError.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
// Une EntityList, c est au fond un "Handle" bien entoure :
|
||||
// S il est nul, la liste est vide
|
||||
// Si c est une Entite, la liste comprend cette entite et rien d autre
|
||||
// Si c est un EntityCluster, il definit (avec ses Next eventuels) le contenu
|
||||
// de la liste
|
||||
|
||||
|
||||
Interface_EntityList::Interface_EntityList () { }
|
||||
|
||||
void Interface_EntityList::Clear ()
|
||||
|
128
src/Interface/Interface_EntityList.hxx
Normal file
128
src/Interface/Interface_EntityList.hxx
Normal file
@@ -0,0 +1,128 @@
|
||||
// Created on: 1992-11-02
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_EntityList_HeaderFile
|
||||
#define _Interface_EntityList_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
class Standard_Transient;
|
||||
class Standard_OutOfRange;
|
||||
class Interface_InterfaceError;
|
||||
class Standard_NullObject;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! This class defines a list of Entities (Transient Objects),
|
||||
//! it can be used as a field of other Transient classes, with
|
||||
//! these features :
|
||||
//! - oriented to define a little list, that is, slower than an
|
||||
//! Array or a Map of Entities for a big count (about 100 and
|
||||
//! over), but faster than a Sequence
|
||||
//! - allows to work as a Sequence, limited to Clear, Append,
|
||||
//! Remove, Access to an Item identified by its rank in the list
|
||||
//! - space saving, compared to a Sequence, especially for little
|
||||
//! amounts; better than an Array for a very little amount (less
|
||||
//! than 10) but less good for a greater amount
|
||||
//!
|
||||
//! Works in conjunction with EntityCluster
|
||||
//! An EntityList gives access to a list of Entity Clusters, which
|
||||
//! are chained (in one sense : Single List)
|
||||
//! Remark : a new Item may not be Null, because this is the
|
||||
//! criterium used for "End of List"
|
||||
class Interface_EntityList
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a List as beeing empty
|
||||
Standard_EXPORT Interface_EntityList();
|
||||
|
||||
//! Clears the List
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Appends an Entity, that is to the END of the list
|
||||
//! (keeps order, but works slowerly than Add, see below)
|
||||
Standard_EXPORT void Append (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Adds an Entity to the list, that is, with NO REGARD about the
|
||||
//! order (faster than Append if count becomes greater than 10)
|
||||
Standard_EXPORT void Add (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Removes an Entity from the list, if it is there
|
||||
Standard_EXPORT void Remove (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Removes an Entity from the list, given its rank
|
||||
Standard_EXPORT void Remove (const Standard_Integer num);
|
||||
|
||||
//! Returns True if the list is empty
|
||||
Standard_EXPORT Standard_Boolean IsEmpty() const;
|
||||
|
||||
//! Returns count of recorded Entities
|
||||
Standard_EXPORT Standard_Integer NbEntities() const;
|
||||
|
||||
//! Returns an Item given its number. Beware about the way the
|
||||
//! list was filled (see above, Add and Append)
|
||||
Standard_EXPORT const Handle(Standard_Transient)& Value (const Standard_Integer num) const;
|
||||
|
||||
//! Returns an Item given its number. Beware about the way the
|
||||
//! list was filled (see above, Add and Append)
|
||||
Standard_EXPORT void SetValue (const Standard_Integer num, const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! fills an Iterator with the content of the list
|
||||
//! (normal way to consult a list which has been filled with Add)
|
||||
Standard_EXPORT void FillIterator (Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Returns count of Entities of a given Type (0 : none)
|
||||
Standard_EXPORT Standard_Integer NbTypedEntities (const Handle(Standard_Type)& atype) const;
|
||||
|
||||
//! Returns the Entity which is of a given type.
|
||||
//! If num = 0 (D), there must be ONE AND ONLY ONE
|
||||
//! If num > 0, returns the num-th entity of this type
|
||||
Standard_EXPORT Handle(Standard_Transient) TypedEntity (const Handle(Standard_Type)& atype, const Standard_Integer num = 0) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Standard_Transient) theval;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_EntityList_HeaderFile
|
@@ -1,68 +0,0 @@
|
||||
-- Created on: 1992-02-03
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class FileParameter from Interface
|
||||
|
||||
---Purpose : Auxiliary class to store a litteral parameter in a file
|
||||
-- intermediate directory or in an UndefinedContent : a reference
|
||||
-- type Parameter detains an Integer which is used to address a
|
||||
-- record in the directory.
|
||||
-- FileParameter is intended to be stored in a ParamSet : hence
|
||||
-- memory management is performed by ParamSet, which calls Clear
|
||||
-- to work, while the Destructor (see Destroy) does nothing.
|
||||
-- Also a FileParameter can be read for consultation only, not to
|
||||
-- be read from a Structure to be included into another one.
|
||||
|
||||
uses Integer, CString, AsciiString from TCollection, ParamType
|
||||
|
||||
is
|
||||
|
||||
Create returns FileParameter;
|
||||
|
||||
Init (me : in out; val : AsciiString from TCollection; typ : ParamType)
|
||||
is static;
|
||||
---Purpose : Fills fields (with Entity Number set to zero)
|
||||
|
||||
Init (me : in out; val : CString; typ : ParamType) is static;
|
||||
---Purpose : Same as above, but builds the Value from a CString
|
||||
|
||||
CValue (me) returns CString is static;
|
||||
---Purpose : Same as above, but as a CString (for immediate exploitation)
|
||||
-- was C++ : return const
|
||||
|
||||
ParamType (me) returns ParamType is static;
|
||||
---Purpose : Returns the type of the parameter
|
||||
|
||||
SetEntityNumber (me : in out; num : Integer) is static;
|
||||
---Purpose : Allows to set a reference to an Entity in a numbered list
|
||||
|
||||
EntityNumber (me) returns Integer is static;
|
||||
---Purpose : Returns value set by SetEntityNumber
|
||||
|
||||
Clear (me : in out) is static;
|
||||
---Purpose : Clears stored data : frees memory taken for the String Value
|
||||
|
||||
Destroy (me : in out) is static;
|
||||
---Purpose : Destructor. Does nothing because Memory is managed by ParamSet
|
||||
---C++ : alias ~
|
||||
|
||||
fields
|
||||
|
||||
thetype : ParamType; -- for ParamType
|
||||
theval : PCharacter; -- for Value
|
||||
thenum : Integer; -- for EntityNumber
|
||||
|
||||
end FileParameter;
|
@@ -11,7 +11,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_FileParameter.ixx>
|
||||
|
||||
#include <Interface_FileParameter.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Interface_FileParameter
|
||||
|
104
src/Interface/Interface_FileParameter.hxx
Normal file
104
src/Interface/Interface_FileParameter.hxx
Normal file
@@ -0,0 +1,104 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_FileParameter_HeaderFile
|
||||
#define _Interface_FileParameter_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_ParamType.hxx>
|
||||
#include <Standard_PCharacter.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
//! Auxiliary class to store a litteral parameter in a file
|
||||
//! intermediate directory or in an UndefinedContent : a reference
|
||||
//! type Parameter detains an Integer which is used to address a
|
||||
//! record in the directory.
|
||||
//! FileParameter is intended to be stored in a ParamSet : hence
|
||||
//! memory management is performed by ParamSet, which calls Clear
|
||||
//! to work, while the Destructor (see Destroy) does nothing.
|
||||
//! Also a FileParameter can be read for consultation only, not to
|
||||
//! be read from a Structure to be included into another one.
|
||||
class Interface_FileParameter
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT Interface_FileParameter();
|
||||
|
||||
//! Fills fields (with Entity Number set to zero)
|
||||
Standard_EXPORT void Init (const TCollection_AsciiString& val, const Interface_ParamType typ);
|
||||
|
||||
//! Same as above, but builds the Value from a CString
|
||||
Standard_EXPORT void Init (const Standard_CString val, const Interface_ParamType typ);
|
||||
|
||||
//! Same as above, but as a CString (for immediate exploitation)
|
||||
//! was C++ : return const
|
||||
Standard_EXPORT Standard_CString CValue() const;
|
||||
|
||||
//! Returns the type of the parameter
|
||||
Standard_EXPORT Interface_ParamType ParamType() const;
|
||||
|
||||
//! Allows to set a reference to an Entity in a numbered list
|
||||
Standard_EXPORT void SetEntityNumber (const Standard_Integer num);
|
||||
|
||||
//! Returns value set by SetEntityNumber
|
||||
Standard_EXPORT Standard_Integer EntityNumber() const;
|
||||
|
||||
//! Clears stored data : frees memory taken for the String Value
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Destructor. Does nothing because Memory is managed by ParamSet
|
||||
Standard_EXPORT void Destroy();
|
||||
~Interface_FileParameter()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Interface_ParamType thetype;
|
||||
Standard_PCharacter theval;
|
||||
Standard_Integer thenum;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_FileParameter_HeaderFile
|
@@ -1,208 +0,0 @@
|
||||
-- Created on: 1992-02-10
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class FileReaderData from Interface inherits TShared
|
||||
|
||||
---Purpose : This class defines services which permit to access Data issued
|
||||
-- from a File, in a form which does not depend of physical
|
||||
-- format : thus, each Record has an attached ParamList (to be
|
||||
-- managed) and resulting Entity.
|
||||
--
|
||||
-- Each Interface defines its own FileReaderData : on one hand by
|
||||
-- defining deferred methods given here, on the other hand by
|
||||
-- describing literal data and their accesses, with the help of
|
||||
-- basic classes such as String, Array1OfString, etc...
|
||||
--
|
||||
-- FileReaderData is used by a FileReaderTool, which is also
|
||||
-- specific of each Norm, to read an InterfaceModel of the Norm
|
||||
-- FileReaderData inherits TShared to be accessed by Handle :
|
||||
-- this allows FileReaderTool to define more easily the specific
|
||||
-- methods, and improves memory management.
|
||||
|
||||
uses Integer, Boolean, CString, Transient, AsciiString from TCollection,
|
||||
Array1OfInteger from TColStd, Array1OfTransient from TColStd,
|
||||
InterfaceModel, Check, FileParameter, ParamSet, ParamList, ParamType
|
||||
|
||||
raises NoSuchObject
|
||||
|
||||
is
|
||||
|
||||
Initialize (nbr : Integer; npar : Integer);
|
||||
---Purpose : Initializes arrays of Entities and of ParamLists attached
|
||||
-- to registered records
|
||||
-- <nbr> must be the maximum number of records to get (no way to
|
||||
-- extend it at run-time) : count entities and sub-entities ...
|
||||
-- <npar> is the total count of parameters (if it is not exact,
|
||||
-- it will be extented as necessary)
|
||||
--
|
||||
-- Hence, to each record can be bound an Entity and a list of
|
||||
-- Parameters. Each kind of FileReaderData can add other data, by
|
||||
-- having them in parallel (other arrays with same sizes)
|
||||
-- Else, it must manage binding between items and their data
|
||||
|
||||
|
||||
NbRecords (me) returns Integer is virtual;
|
||||
---Purpose : Returns the count of registered records
|
||||
-- That is, value given for Initialization (can be redefined)
|
||||
|
||||
NbEntities (me) returns Integer is virtual;
|
||||
---Purpose : Returns the count of entities. Depending of each norm, records
|
||||
-- can be Entities or SubParts (SubList in STEP, SubGroup in SET
|
||||
-- ...). NbEntities counts only Entities, not Subs
|
||||
-- Used for memory reservation in InterfaceModel
|
||||
-- Default implementation uses FindNextRecord
|
||||
-- Can be redefined into a more performant way
|
||||
|
||||
FindNextRecord (me; num : Integer) returns Integer is deferred;
|
||||
---Purpose : Determines the record number defining an Entity following a
|
||||
-- given record number. Specific to each sub-class of
|
||||
-- FileReaderData. Returning zero means no record found
|
||||
|
||||
-- -- access to Paramaters -- --
|
||||
|
||||
InitParams (me : mutable; num : Integer);
|
||||
---Purpose : attaches an empty ParamList to a Record
|
||||
|
||||
AddParam (me : mutable; num : Integer; aval : CString;
|
||||
atype : ParamType; nument : Integer = 0);
|
||||
---Purpose : Adds a parameter to record no "num" and fills its fields
|
||||
-- (EntityNumber is optional)
|
||||
-- Warning : <aval> is assumed to be memory-managed elsewhere : it is NOT
|
||||
-- copied. This gives a best speed : strings remain stored in
|
||||
-- pages of characters
|
||||
|
||||
AddParam (me : mutable; num : Integer; aval : AsciiString from TCollection;
|
||||
atype : ParamType; nument : Integer = 0);
|
||||
---Purpose : Same as above, but gets a AsciiString from TCollection
|
||||
-- Remark that the content of the AsciiString is locally copied
|
||||
-- (because its content is most often lost after using)
|
||||
|
||||
AddParam (me : mutable; num : Integer; FP : FileParameter);
|
||||
---Purpose : Same as above, but gets a complete FileParameter
|
||||
-- Warning : Content of <FP> is NOT copied : its original address and space
|
||||
-- in memory are assumed to be managed elsewhere (see ParamSet)
|
||||
|
||||
SetParam (me : mutable; num, nump : Integer; FP : FileParameter);
|
||||
---Purpose : Sets a new value for a parameter of a record, given by :
|
||||
-- num : record number; nump : parameter number in the record
|
||||
|
||||
NbParams (me; num : Integer) returns Integer is static;
|
||||
---Purpose : Returns count of parameters attached to record "num"
|
||||
-- If <num> = 0, returns the total recorded count of parameters
|
||||
|
||||
Params (me; num : Integer) returns ParamList is static;
|
||||
---Purpose : Returns the complete ParamList of a record (read only)
|
||||
-- num = 0 to return the whole param list for the file
|
||||
|
||||
Param (me; num, nump : Integer) returns FileParameter is static;
|
||||
---Purpose : Returns parameter "nump" of record "num", as a complete
|
||||
-- FileParameter
|
||||
---C++ : return const &
|
||||
|
||||
ChangeParam (me : mutable; num, nump : Integer) returns FileParameter
|
||||
is static;
|
||||
---Purpose : Same as above, but in order to be modified on place
|
||||
---C++ : return &
|
||||
|
||||
ParamType (me; num, nump : Integer) returns ParamType is static;
|
||||
---Purpose : Returns type of parameter "nump" of record "num"
|
||||
|
||||
-- ParamValue (me; num, nump : Integer) returns AsciiString from TCollection;
|
||||
---Purpose : Returns literal value of parameter "nump" of record "num"
|
||||
-- was C++ : return const &
|
||||
|
||||
ParamCValue (me; num, nump : Integer) returns CString is static;
|
||||
---Purpose : Same as above, but as a CString
|
||||
-- was C++ : return const
|
||||
|
||||
IsParamDefined (me; num, nump : Integer) returns Boolean is static;
|
||||
---Purpose : Returns True if parameter "nump" of record "num" is defined
|
||||
-- (it is not if its type is ParamVoid)
|
||||
|
||||
ParamNumber (me; num, nump : Integer) returns Integer is static;
|
||||
---Purpose : Returns record number of an entity referenced by a parameter
|
||||
-- of type Ident; 0 if no EntityNumber has been determined
|
||||
-- Note that it is used to reference Entities but also Sublists
|
||||
-- (sublists are not objects, but internal descriptions)
|
||||
|
||||
ParamEntity (me; num, nump : Integer)
|
||||
returns Transient raises NoSuchObject is static;
|
||||
---Purpose : Returns the StepEntity referenced by a parameter
|
||||
-- Error if none
|
||||
---C++ : return const &
|
||||
|
||||
ChangeParameter (me : mutable; numpar : Integer) returns FileParameter
|
||||
is static protected;
|
||||
---Purpose : Returns a parameter given its absolute rank in the file
|
||||
-- in order to be consulted or modified in specilaized actions
|
||||
---C++ : return &
|
||||
|
||||
ParamPosition (me; numpar : Integer; num,nump : out Integer)
|
||||
is static protected;
|
||||
---Purpose : For a given absolute rank of parameter, determines the
|
||||
-- record to which its belongs, and the parameter number for it
|
||||
|
||||
ParamFirstRank (me; num : Integer) returns Integer is static;
|
||||
---Purpose : Returns the absolute rank of the beginning of a record
|
||||
-- (its lsit is from ParamFirstRank+1 to ParamFirstRank+NbParams)
|
||||
|
||||
-- -- binding empty entities before loading model -- --
|
||||
|
||||
BoundEntity (me; num : Integer) returns Transient;
|
||||
---Purpose : Returns the entity bound to a record, set by SetEntities
|
||||
---C++ : return const &
|
||||
|
||||
BindEntity (me : mutable; num : Integer; ent : Transient);
|
||||
---Purpose : Binds an entity to a record
|
||||
|
||||
SetErrorLoad (me : mutable; val : Boolean);
|
||||
---Purpose : Sets the status "Error Load" on, to overside check fails
|
||||
-- <val> True : declares unloaded
|
||||
-- <val> False : declares loaded
|
||||
-- If not called before loading (see FileReaderTool), check fails
|
||||
-- give the status
|
||||
-- IsErrorLoad says if SetErrorLoad has been called by user
|
||||
-- ResetErrorLoad resets it (called by FileReaderTool)
|
||||
-- This allows to specify that the currently loaded entity
|
||||
-- remains unloaded (because of syntactic fail)
|
||||
|
||||
IsErrorLoad (me) returns Boolean;
|
||||
---Purpose : Returns True if the status "Error Load" has been set (to True
|
||||
-- or False)
|
||||
|
||||
ResetErrorLoad (me : mutable) returns Boolean;
|
||||
---Purpose : Returns the former value of status "Error Load" then resets it
|
||||
-- Used to read the status then ensure it is reset
|
||||
|
||||
-- -- specials -- --
|
||||
|
||||
Destroy (me : mutable);
|
||||
---Purpose : Destructor (waiting for memory management)
|
||||
---C++ : alias ~
|
||||
|
||||
Fastof (myclass; str : CString) returns Real;
|
||||
---Purpose : Same spec.s as standard <atof> but 5 times faster
|
||||
|
||||
fields
|
||||
|
||||
thenum0 : Integer; -- current data for access to parameters
|
||||
therrload : Integer;
|
||||
theparams : ParamSet; -- the general set of parameters
|
||||
thenumpar : Array1OfInteger from TColStd; -- beginning of each one
|
||||
-- thenbpar : Array1OfInteger from TColStd; -- its size
|
||||
theents : Array1OfTransient from TColStd; -- entities bound to records
|
||||
|
||||
end FileReaderData;
|
@@ -15,17 +15,22 @@
|
||||
//#10 smh 22.12.99 Protection (case of unexisting directory entry in file)
|
||||
//sln 21.01.2002 OCC133: Exception handling was added in method Interface_FileReaderData::BoundEntity
|
||||
//====================================================================
|
||||
|
||||
#include <Interface_FileParameter.hxx>
|
||||
#include <Interface_FileReaderData.hxx>
|
||||
#include <Interface_ParamList.hxx>
|
||||
#include <Interface_ParamSet.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Interface_FileReaderData.ixx>
|
||||
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
// Stoque les Donnees issues d un Fichier (Conservees sous forme Litterale)
|
||||
// Chaque norme peut s en servir comme base (listes de parametres litteraux,
|
||||
// entites associees) et y ajoute ses donnees propres.
|
||||
|
||||
// Travaille sous le controle de FileReaderTool
|
||||
|
||||
// Optimisation : Champs pas possibles, car Param est const. Dommage
|
||||
// Donc, on suppose qu on lit un fichier a la fois (hypothese raisonnable)
|
||||
// On note en champ un numero de fichier, par rapport auquel on optimise
|
||||
|
229
src/Interface/Interface_FileReaderData.hxx
Normal file
229
src/Interface/Interface_FileReaderData.hxx
Normal file
@@ -0,0 +1,229 @@
|
||||
// Created on: 1992-02-10
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_FileReaderData_HeaderFile
|
||||
#define _Interface_FileReaderData_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_Array1OfTransient.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Interface_ParamType.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class Interface_ParamSet;
|
||||
class Standard_NoSuchObject;
|
||||
class TCollection_AsciiString;
|
||||
class Interface_FileParameter;
|
||||
class Interface_ParamList;
|
||||
class Standard_Transient;
|
||||
|
||||
|
||||
class Interface_FileReaderData;
|
||||
DEFINE_STANDARD_HANDLE(Interface_FileReaderData, MMgt_TShared)
|
||||
|
||||
//! This class defines services which permit to access Data issued
|
||||
//! from a File, in a form which does not depend of physical
|
||||
//! format : thus, each Record has an attached ParamList (to be
|
||||
//! managed) and resulting Entity.
|
||||
//!
|
||||
//! Each Interface defines its own FileReaderData : on one hand by
|
||||
//! defining deferred methods given here, on the other hand by
|
||||
//! describing literal data and their accesses, with the help of
|
||||
//! basic classes such as String, Array1OfString, etc...
|
||||
//!
|
||||
//! FileReaderData is used by a FileReaderTool, which is also
|
||||
//! specific of each Norm, to read an InterfaceModel of the Norm
|
||||
//! FileReaderData inherits TShared to be accessed by Handle :
|
||||
//! this allows FileReaderTool to define more easily the specific
|
||||
//! methods, and improves memory management.
|
||||
class Interface_FileReaderData : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Returns the count of registered records
|
||||
//! That is, value given for Initialization (can be redefined)
|
||||
Standard_EXPORT virtual Standard_Integer NbRecords() const;
|
||||
|
||||
//! Returns the count of entities. Depending of each norm, records
|
||||
//! can be Entities or SubParts (SubList in STEP, SubGroup in SET
|
||||
//! ...). NbEntities counts only Entities, not Subs
|
||||
//! Used for memory reservation in InterfaceModel
|
||||
//! Default implementation uses FindNextRecord
|
||||
//! Can be redefined into a more performant way
|
||||
Standard_EXPORT virtual Standard_Integer NbEntities() const;
|
||||
|
||||
//! Determines the record number defining an Entity following a
|
||||
//! given record number. Specific to each sub-class of
|
||||
//! FileReaderData. Returning zero means no record found
|
||||
Standard_EXPORT virtual Standard_Integer FindNextRecord (const Standard_Integer num) const = 0;
|
||||
|
||||
//! attaches an empty ParamList to a Record
|
||||
Standard_EXPORT void InitParams (const Standard_Integer num);
|
||||
|
||||
//! Adds a parameter to record no "num" and fills its fields
|
||||
//! (EntityNumber is optional)
|
||||
//! Warning : <aval> is assumed to be memory-managed elsewhere : it is NOT
|
||||
//! copied. This gives a best speed : strings remain stored in
|
||||
//! pages of characters
|
||||
Standard_EXPORT void AddParam (const Standard_Integer num, const Standard_CString aval, const Interface_ParamType atype, const Standard_Integer nument = 0);
|
||||
|
||||
//! Same as above, but gets a AsciiString from TCollection
|
||||
//! Remark that the content of the AsciiString is locally copied
|
||||
//! (because its content is most often lost after using)
|
||||
Standard_EXPORT void AddParam (const Standard_Integer num, const TCollection_AsciiString& aval, const Interface_ParamType atype, const Standard_Integer nument = 0);
|
||||
|
||||
//! Same as above, but gets a complete FileParameter
|
||||
//! Warning : Content of <FP> is NOT copied : its original address and space
|
||||
//! in memory are assumed to be managed elsewhere (see ParamSet)
|
||||
Standard_EXPORT void AddParam (const Standard_Integer num, const Interface_FileParameter& FP);
|
||||
|
||||
//! Sets a new value for a parameter of a record, given by :
|
||||
//! num : record number; nump : parameter number in the record
|
||||
Standard_EXPORT void SetParam (const Standard_Integer num, const Standard_Integer nump, const Interface_FileParameter& FP);
|
||||
|
||||
//! Returns count of parameters attached to record "num"
|
||||
//! If <num> = 0, returns the total recorded count of parameters
|
||||
Standard_EXPORT Standard_Integer NbParams (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the complete ParamList of a record (read only)
|
||||
//! num = 0 to return the whole param list for the file
|
||||
Standard_EXPORT Handle(Interface_ParamList) Params (const Standard_Integer num) const;
|
||||
|
||||
//! Returns parameter "nump" of record "num", as a complete
|
||||
//! FileParameter
|
||||
Standard_EXPORT const Interface_FileParameter& Param (const Standard_Integer num, const Standard_Integer nump) const;
|
||||
|
||||
//! Same as above, but in order to be modified on place
|
||||
Standard_EXPORT Interface_FileParameter& ChangeParam (const Standard_Integer num, const Standard_Integer nump);
|
||||
|
||||
//! Returns type of parameter "nump" of record "num"
|
||||
//! Returns literal value of parameter "nump" of record "num"
|
||||
//! was C++ : return const &
|
||||
Standard_EXPORT Interface_ParamType ParamType (const Standard_Integer num, const Standard_Integer nump) const;
|
||||
|
||||
//! Same as above, but as a CString
|
||||
//! was C++ : return const
|
||||
Standard_EXPORT Standard_CString ParamCValue (const Standard_Integer num, const Standard_Integer nump) const;
|
||||
|
||||
//! Returns True if parameter "nump" of record "num" is defined
|
||||
//! (it is not if its type is ParamVoid)
|
||||
Standard_EXPORT Standard_Boolean IsParamDefined (const Standard_Integer num, const Standard_Integer nump) const;
|
||||
|
||||
//! Returns record number of an entity referenced by a parameter
|
||||
//! of type Ident; 0 if no EntityNumber has been determined
|
||||
//! Note that it is used to reference Entities but also Sublists
|
||||
//! (sublists are not objects, but internal descriptions)
|
||||
Standard_EXPORT Standard_Integer ParamNumber (const Standard_Integer num, const Standard_Integer nump) const;
|
||||
|
||||
//! Returns the StepEntity referenced by a parameter
|
||||
//! Error if none
|
||||
Standard_EXPORT const Handle(Standard_Transient)& ParamEntity (const Standard_Integer num, const Standard_Integer nump) const;
|
||||
|
||||
//! Returns the absolute rank of the beginning of a record
|
||||
//! (its lsit is from ParamFirstRank+1 to ParamFirstRank+NbParams)
|
||||
Standard_EXPORT Standard_Integer ParamFirstRank (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the entity bound to a record, set by SetEntities
|
||||
Standard_EXPORT const Handle(Standard_Transient)& BoundEntity (const Standard_Integer num) const;
|
||||
|
||||
//! Binds an entity to a record
|
||||
Standard_EXPORT void BindEntity (const Standard_Integer num, const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Sets the status "Error Load" on, to overside check fails
|
||||
//! <val> True : declares unloaded
|
||||
//! <val> False : declares loaded
|
||||
//! If not called before loading (see FileReaderTool), check fails
|
||||
//! give the status
|
||||
//! IsErrorLoad says if SetErrorLoad has been called by user
|
||||
//! ResetErrorLoad resets it (called by FileReaderTool)
|
||||
//! This allows to specify that the currently loaded entity
|
||||
//! remains unloaded (because of syntactic fail)
|
||||
Standard_EXPORT void SetErrorLoad (const Standard_Boolean val);
|
||||
|
||||
//! Returns True if the status "Error Load" has been set (to True
|
||||
//! or False)
|
||||
Standard_EXPORT Standard_Boolean IsErrorLoad() const;
|
||||
|
||||
//! Returns the former value of status "Error Load" then resets it
|
||||
//! Used to read the status then ensure it is reset
|
||||
Standard_EXPORT Standard_Boolean ResetErrorLoad();
|
||||
|
||||
//! Destructor (waiting for memory management)
|
||||
Standard_EXPORT void Destroy();
|
||||
~Interface_FileReaderData()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
//! Same spec.s as standard <atof> but 5 times faster
|
||||
Standard_EXPORT static Standard_Real Fastof (const Standard_CString str);
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_FileReaderData,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Initializes arrays of Entities and of ParamLists attached
|
||||
//! to registered records
|
||||
//! <nbr> must be the maximum number of records to get (no way to
|
||||
//! extend it at run-time) : count entities and sub-entities ...
|
||||
//! <npar> is the total count of parameters (if it is not exact,
|
||||
//! it will be extented as necessary)
|
||||
//!
|
||||
//! Hence, to each record can be bound an Entity and a list of
|
||||
//! Parameters. Each kind of FileReaderData can add other data, by
|
||||
//! having them in parallel (other arrays with same sizes)
|
||||
//! Else, it must manage binding between items and their data
|
||||
Standard_EXPORT Interface_FileReaderData(const Standard_Integer nbr, const Standard_Integer npar);
|
||||
|
||||
//! Returns a parameter given its absolute rank in the file
|
||||
//! in order to be consulted or modified in specilaized actions
|
||||
Standard_EXPORT Interface_FileParameter& ChangeParameter (const Standard_Integer numpar);
|
||||
|
||||
//! For a given absolute rank of parameter, determines the
|
||||
//! record to which its belongs, and the parameter number for it
|
||||
Standard_EXPORT void ParamPosition (const Standard_Integer numpar, Standard_Integer& num, Standard_Integer& nump) const;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Integer thenum0;
|
||||
Standard_Integer therrload;
|
||||
Handle(Interface_ParamSet) theparams;
|
||||
TColStd_Array1OfInteger thenumpar;
|
||||
TColStd_Array1OfTransient theents;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_FileReaderData_HeaderFile
|
@@ -1,203 +0,0 @@
|
||||
-- Created on: 1993-02-04
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class FileReaderTool from Interface
|
||||
|
||||
---Purpose : Defines services which are required to load an InterfaceModel
|
||||
-- from a File. Typically, it may firstly transform a system
|
||||
-- file into a FileReaderData object, then work on it, not longer
|
||||
-- considering file contents, to load an Interface Model.
|
||||
-- It may also work on a FileReaderData already loaded.
|
||||
--
|
||||
-- FileReaderTool provides, on one hand, some general services
|
||||
-- which are common to all read operations but can be redefined,
|
||||
-- plus general actions to be performed specifically for each
|
||||
-- Norm, as deferred methods to define.
|
||||
--
|
||||
-- In particular, FileReaderTool defines the Interface's Unknown
|
||||
-- and Error entities
|
||||
|
||||
uses Integer, Boolean, Transient, HArray1OfTransient,
|
||||
FileReaderData, InterfaceModel, Check, Protocol from Interface,
|
||||
Messenger from Message,
|
||||
GeneralLib, ReaderLib
|
||||
|
||||
raises DomainError, NoSuchObject
|
||||
|
||||
is
|
||||
|
||||
-- -- generals -- --
|
||||
Initialize returns FileReaderTool from Interface;
|
||||
---Purpose: Constructor; sets default fields
|
||||
|
||||
SetData (me : in out; reader : FileReaderData;
|
||||
protocol : Protocol from Interface);
|
||||
---Purpose : Sets Data to a FileReaderData. Works with a Protocol
|
||||
|
||||
Protocol (me) returns Protocol from Interface;
|
||||
---Purpose : Returns the Protocol given at creation time
|
||||
|
||||
Data (me) returns FileReaderData;
|
||||
---Purpose : Returns the FileReaderData which is used to work
|
||||
|
||||
SetModel (me : in out; amodel : InterfaceModel);
|
||||
---Purpose : Stores a Model. Used when the Model has been loaded
|
||||
|
||||
Model (me) returns InterfaceModel;
|
||||
---Purpose : Returns the stored Model
|
||||
|
||||
-- -- setting empty entities before loading model -- --
|
||||
|
||||
SetMessenger (me: out; messenger: Messenger from Message);
|
||||
---Purpose : Sets Messenger used for outputting messages
|
||||
|
||||
Messenger (me) returns Messenger from Message;
|
||||
---Purpose : Returns Messenger used for outputting messages.
|
||||
-- The returned object is guaranteed to be non-null;
|
||||
-- default is Message::Messenger().
|
||||
|
||||
SetTraceLevel (me: out; 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.
|
||||
|
||||
SetErrorHandle (me : in out; err : Boolean);
|
||||
---Purpose : Allows controlling whether exception raisings are handled
|
||||
-- If err is False, they are not (hence, dbx can take control)
|
||||
-- If err is True, they are, and they are traced
|
||||
-- (by putting on messenger Entity's Number and file record num)
|
||||
-- Default given at Model's creation time is True
|
||||
|
||||
ErrorHandle (me) returns Boolean;
|
||||
---Purpose : Returns ErrorHandle flag
|
||||
|
||||
-- -- setting empty entities before loading model -- --
|
||||
|
||||
SetEntities (me : in out);
|
||||
---Purpose : Fills records with empty entities; once done, each entity can
|
||||
-- ask the FileReaderTool for any entity referenced through an
|
||||
-- identifier. Calls Recognize which is specific to each specific
|
||||
-- type of FileReaderTool
|
||||
|
||||
Recognize (me : in out; num : Integer;
|
||||
ach : in out Check; ent : out Transient)
|
||||
returns Boolean is deferred;
|
||||
---Purpose : Recognizes a record, given its number. Specific to each
|
||||
-- Interface; called by SetEntities. It can call the basic method
|
||||
-- RecognizeByLib.
|
||||
-- Returns False if recognition has failed, True else.
|
||||
-- <ach> has not to be filled if simply Recognition has failed :
|
||||
-- it must record true error messages : RecognizeByLib can
|
||||
-- generate error messages if NewRead is called
|
||||
--
|
||||
-- Note that it works thru a Recognizer (method Evaluate) which
|
||||
-- has to be memorized before starting
|
||||
|
||||
RecognizeByLib (me; num : Integer;
|
||||
glib : in out GeneralLib; rlib : in out ReaderLib;
|
||||
ach : in out Check; ent : out Transient)
|
||||
returns Boolean;
|
||||
---Purpose : Recognizes a record with the help of Libraries. Can be used
|
||||
-- to implement the method Recognize.
|
||||
-- <rlib> is used to find Protocol and CaseNumber to apply
|
||||
-- <glib> performs the creation (by service NewVoid, or NewRead
|
||||
-- if NewVoid gave no result)
|
||||
-- <ach> is a check, which is transmitted to NewRead if it is
|
||||
-- called, gives a result but which is false
|
||||
-- <ent> is the result
|
||||
-- Returns False if recognition has failed, True else
|
||||
|
||||
UnknownEntity (me) returns Transient;
|
||||
---Purpose : Provides an unknown entity, specific to the Interface
|
||||
-- called by SetEntities when Recognize has failed (Unknown alone)
|
||||
-- or by LoadModel when an Entity has caused a Fail on reading
|
||||
-- (to keep at least its literal description)
|
||||
-- Uses Protocol to do it
|
||||
|
||||
-- -- loading entities into the model -- --
|
||||
|
||||
NewModel (me) returns InterfaceModel;
|
||||
---Purpose : Creates an empty Model of the norm. Uses Protocol to do it
|
||||
|
||||
LoadModel (me : in out; amodel : InterfaceModel)
|
||||
raises DomainError;
|
||||
---Purpose : Reads and fills Entities from the FileReaderData set by
|
||||
-- SetData to an InterfaceModel.
|
||||
-- It enchains required operations, the specific ones correspond
|
||||
-- to deferred methods (below) to be defined for each Norm.
|
||||
-- It manages also error recovery and trace.
|
||||
-- Remark : it calls SetModel.
|
||||
-- It Can raise any error which can occur during a load
|
||||
-- operation, unless Error Handling is set.
|
||||
-- This method can also be redefined if judged necessary.
|
||||
|
||||
LoadedEntity (me : in out; num : Integer) returns Transient;
|
||||
---Purpose : Reads, Fills and Returns one Entity read from a Record of the
|
||||
-- FileReaderData. This Method manages also case of Fail or
|
||||
-- Warning, by producing a ReportEntyty plus , for a Fail, a
|
||||
-- literal Content (as an UnknownEntity). Performs also Trace
|
||||
|
||||
BeginRead (me : in out; amodel : InterfaceModel) is deferred;
|
||||
---Purpose : Fills model's header; each Interface defines for its Model its
|
||||
-- own file header; this method fills it from FileReaderTool.+
|
||||
-- It is called by AnalyseFile from InterfaceModel
|
||||
|
||||
AnalyseRecord (me : in out;
|
||||
num : Integer; anent : Transient; acheck : in out Check)
|
||||
returns Boolean is deferred;
|
||||
---Purpose : Fills an Entity, given record no; specific to each Interface,
|
||||
-- called by AnalyseFile from InterfaceModel (which manages its
|
||||
-- calling arguments)
|
||||
-- To work, each Interface can define a method in its proper
|
||||
-- Transient class, like this (given as an example) :
|
||||
-- AnalyseRecord (me : mutable; FR : in out FileReaderTool;
|
||||
-- num : Integer; acheck : in out Check)
|
||||
-- returns Boolean;
|
||||
-- and call it from AnalyseRecord
|
||||
--
|
||||
-- Returned Value : True if the entity could be loaded, False
|
||||
-- else (in case of syntactic fail)
|
||||
|
||||
Destroy (me: in out) is virtual;
|
||||
---C++ : alias "Standard_EXPORT virtual ~Interface_FileReaderTool() { Destroy(); }"
|
||||
|
||||
EndRead (me : in out; amodel : InterfaceModel) is virtual;
|
||||
---Purpose : Ends file reading after reading all the entities
|
||||
-- default is doing nothing; redefinable as necessary
|
||||
|
||||
|
||||
Clear(me : in out);
|
||||
---Purpose : Clear filelds
|
||||
|
||||
fields
|
||||
|
||||
theproto : Protocol from Interface;
|
||||
thereader : FileReaderData;
|
||||
themodel : InterfaceModel;
|
||||
themessenger:Messenger from Message;
|
||||
thetrace : Integer; -- trace level (exceptions,errors, etc...)
|
||||
theerrhand : Boolean; -- to handle or not exceptions
|
||||
thenbrep0 : Integer; -- (reports at creation time)
|
||||
thenbreps : Integer; -- (all reports)
|
||||
thereports : HArray1OfTransient;
|
||||
|
||||
end FileReaderTool;
|
@@ -12,20 +12,30 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// dce 21/01/99 S3767 : Suppression of general messages
|
||||
#include <Interface_FileReaderTool.ixx>
|
||||
#include <Interface_ReportEntity.hxx>
|
||||
#include <Interface_InterfaceMismatch.hxx>
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_CheckFailure.hxx>
|
||||
#include <Interface_FileReaderData.hxx>
|
||||
#include <Interface_FileReaderTool.hxx>
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_InterfaceMismatch.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_ReaderLib.hxx>
|
||||
#include <Interface_ReaderModule.hxx>
|
||||
#include <Interface_ReportEntity.hxx>
|
||||
#include <Message.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <Message.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
|
||||
#ifdef WNT
|
||||
#include <OSD_Exception.hxx>
|
||||
#else
|
||||
|
223
src/Interface/Interface_FileReaderTool.hxx
Normal file
223
src/Interface/Interface_FileReaderTool.hxx
Normal file
@@ -0,0 +1,223 @@
|
||||
// Created on: 1993-02-04
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_FileReaderTool_HeaderFile
|
||||
#define _Interface_FileReaderTool_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TColStd_HArray1OfTransient.hxx>
|
||||
class Interface_Protocol;
|
||||
class Interface_FileReaderData;
|
||||
class Interface_InterfaceModel;
|
||||
class Message_Messenger;
|
||||
class Standard_DomainError;
|
||||
class Standard_NoSuchObject;
|
||||
class Interface_Check;
|
||||
class Standard_Transient;
|
||||
class Interface_GeneralLib;
|
||||
class Interface_ReaderLib;
|
||||
|
||||
|
||||
//! Defines services which are required to load an InterfaceModel
|
||||
//! from a File. Typically, it may firstly transform a system
|
||||
//! file into a FileReaderData object, then work on it, not longer
|
||||
//! considering file contents, to load an Interface Model.
|
||||
//! It may also work on a FileReaderData already loaded.
|
||||
//!
|
||||
//! FileReaderTool provides, on one hand, some general services
|
||||
//! which are common to all read operations but can be redefined,
|
||||
//! plus general actions to be performed specifically for each
|
||||
//! Norm, as deferred methods to define.
|
||||
//!
|
||||
//! In particular, FileReaderTool defines the Interface's Unknown
|
||||
//! and Error entities
|
||||
class Interface_FileReaderTool
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Sets Data to a FileReaderData. Works with a Protocol
|
||||
Standard_EXPORT void SetData (const Handle(Interface_FileReaderData)& reader, const Handle(Interface_Protocol)& protocol);
|
||||
|
||||
//! Returns the Protocol given at creation time
|
||||
Standard_EXPORT Handle(Interface_Protocol) Protocol() const;
|
||||
|
||||
//! Returns the FileReaderData which is used to work
|
||||
Standard_EXPORT Handle(Interface_FileReaderData) Data() const;
|
||||
|
||||
//! Stores a Model. Used when the Model has been loaded
|
||||
Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& amodel);
|
||||
|
||||
//! Returns the stored Model
|
||||
Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
|
||||
|
||||
//! Sets Messenger used for outputting messages
|
||||
Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger);
|
||||
|
||||
//! Returns Messenger used for outputting messages.
|
||||
//! The returned object is guaranteed to be non-null;
|
||||
//! default is Message::Messenger().
|
||||
Standard_EXPORT Handle(Message_Messenger) Messenger() 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;
|
||||
|
||||
//! Allows controlling whether exception raisings are handled
|
||||
//! If err is False, they are not (hence, dbx can take control)
|
||||
//! If err is True, they are, and they are traced
|
||||
//! (by putting on messenger Entity's Number and file record num)
|
||||
//! Default given at Model's creation time is True
|
||||
Standard_EXPORT void SetErrorHandle (const Standard_Boolean err);
|
||||
|
||||
//! Returns ErrorHandle flag
|
||||
Standard_EXPORT Standard_Boolean ErrorHandle() const;
|
||||
|
||||
//! Fills records with empty entities; once done, each entity can
|
||||
//! ask the FileReaderTool for any entity referenced through an
|
||||
//! identifier. Calls Recognize which is specific to each specific
|
||||
//! type of FileReaderTool
|
||||
Standard_EXPORT void SetEntities();
|
||||
|
||||
//! Recognizes a record, given its number. Specific to each
|
||||
//! Interface; called by SetEntities. It can call the basic method
|
||||
//! RecognizeByLib.
|
||||
//! Returns False if recognition has failed, True else.
|
||||
//! <ach> has not to be filled if simply Recognition has failed :
|
||||
//! it must record true error messages : RecognizeByLib can
|
||||
//! generate error messages if NewRead is called
|
||||
//!
|
||||
//! Note that it works thru a Recognizer (method Evaluate) which
|
||||
//! has to be memorized before starting
|
||||
Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) = 0;
|
||||
|
||||
//! Recognizes a record with the help of Libraries. Can be used
|
||||
//! to implement the method Recognize.
|
||||
//! <rlib> is used to find Protocol and CaseNumber to apply
|
||||
//! <glib> performs the creation (by service NewVoid, or NewRead
|
||||
//! if NewVoid gave no result)
|
||||
//! <ach> is a check, which is transmitted to NewRead if it is
|
||||
//! called, gives a result but which is false
|
||||
//! <ent> is the result
|
||||
//! Returns False if recognition has failed, True else
|
||||
Standard_EXPORT Standard_Boolean RecognizeByLib (const Standard_Integer num, Interface_GeneralLib& glib, Interface_ReaderLib& rlib, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Provides an unknown entity, specific to the Interface
|
||||
//! called by SetEntities when Recognize has failed (Unknown alone)
|
||||
//! or by LoadModel when an Entity has caused a Fail on reading
|
||||
//! (to keep at least its literal description)
|
||||
//! Uses Protocol to do it
|
||||
Standard_EXPORT Handle(Standard_Transient) UnknownEntity() const;
|
||||
|
||||
//! Creates an empty Model of the norm. Uses Protocol to do it
|
||||
Standard_EXPORT Handle(Interface_InterfaceModel) NewModel() const;
|
||||
|
||||
//! Reads and fills Entities from the FileReaderData set by
|
||||
//! SetData to an InterfaceModel.
|
||||
//! It enchains required operations, the specific ones correspond
|
||||
//! to deferred methods (below) to be defined for each Norm.
|
||||
//! It manages also error recovery and trace.
|
||||
//! Remark : it calls SetModel.
|
||||
//! It Can raise any error which can occur during a load
|
||||
//! operation, unless Error Handling is set.
|
||||
//! This method can also be redefined if judged necessary.
|
||||
Standard_EXPORT void LoadModel (const Handle(Interface_InterfaceModel)& amodel);
|
||||
|
||||
//! Reads, Fills and Returns one Entity read from a Record of the
|
||||
//! FileReaderData. This Method manages also case of Fail or
|
||||
//! Warning, by producing a ReportEntyty plus , for a Fail, a
|
||||
//! literal Content (as an UnknownEntity). Performs also Trace
|
||||
Standard_EXPORT Handle(Standard_Transient) LoadedEntity (const Standard_Integer num);
|
||||
|
||||
//! Fills model's header; each Interface defines for its Model its
|
||||
//! own file header; this method fills it from FileReaderTool.+
|
||||
//! It is called by AnalyseFile from InterfaceModel
|
||||
Standard_EXPORT virtual void BeginRead (const Handle(Interface_InterfaceModel)& amodel) = 0;
|
||||
|
||||
//! Fills an Entity, given record no; specific to each Interface,
|
||||
//! called by AnalyseFile from InterfaceModel (which manages its
|
||||
//! calling arguments)
|
||||
//! To work, each Interface can define a method in its proper
|
||||
//! Transient class, like this (given as an example) :
|
||||
//! AnalyseRecord (me : mutable; FR : in out FileReaderTool;
|
||||
//! num : Integer; acheck : in out Check)
|
||||
//! returns Boolean;
|
||||
//! and call it from AnalyseRecord
|
||||
//!
|
||||
//! Returned Value : True if the entity could be loaded, False
|
||||
//! else (in case of syntactic fail)
|
||||
Standard_EXPORT virtual Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) = 0;
|
||||
|
||||
Standard_EXPORT virtual void Destroy();
|
||||
Standard_EXPORT virtual ~Interface_FileReaderTool() { Destroy(); }
|
||||
|
||||
//! Ends file reading after reading all the entities
|
||||
//! default is doing nothing; redefinable as necessary
|
||||
Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel);
|
||||
|
||||
//! Clear filelds
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Constructor; sets default fields
|
||||
Standard_EXPORT Interface_FileReaderTool();
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Interface_Protocol) theproto;
|
||||
Handle(Interface_FileReaderData) thereader;
|
||||
Handle(Interface_InterfaceModel) themodel;
|
||||
Handle(Message_Messenger) themessenger;
|
||||
Standard_Integer thetrace;
|
||||
Standard_Boolean theerrhand;
|
||||
Standard_Integer thenbrep0;
|
||||
Standard_Integer thenbreps;
|
||||
Handle(TColStd_HArray1OfTransient) thereports;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_FileReaderTool_HeaderFile
|
@@ -1,105 +0,0 @@
|
||||
-- Created on: 1994-04-15
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1994-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class FloatWriter from Interface
|
||||
|
||||
---Purpose : This class converts a floting number (Real) to a string
|
||||
-- It can be used if the standard C-C++ output functions
|
||||
-- (sprintf or cout<<) are not convenient. That is to say :
|
||||
-- - to suppress trailing '0' and 'E+00' (if desired)
|
||||
-- - to control exponant output and floating point output
|
||||
--
|
||||
-- Formats are given in the form used by printf-sprintf
|
||||
|
||||
uses Boolean, Character, Real, CString
|
||||
|
||||
is
|
||||
|
||||
Create (chars : Integer = 0) returns FloatWriter;
|
||||
---Purpose : Creates a FloatWriter ready to work, with default options -
|
||||
-- - zero suppress option is set
|
||||
-- - main format is set to "%E"
|
||||
-- - secondary format is set to "%f" for values between 0.1 and
|
||||
-- 1000. in absolute values
|
||||
-- If <chars> is given (and positive), it will produce options
|
||||
-- to produce this count of characters : "%<chars>f","%<chars>%E"
|
||||
|
||||
|
||||
-- Options for Real Formats --
|
||||
|
||||
SetFormat (me : in out; form : CString; reset : Boolean = Standard_True);
|
||||
---Purpose : Sets a specific Format for Sending Reals (main format)
|
||||
-- (Default from Creation is "%E")
|
||||
-- If <reset> is given True (default), this call clears effects
|
||||
-- of former calls to SetFormatForRange and SetZeroSuppress
|
||||
|
||||
SetFormatForRange (me : in out; form : CString; R1, R2 : Real);
|
||||
---Purpose : Sets a secondary Format for Real, to be applied between R1 and
|
||||
-- R2 (in absolute values). A Call to SetRealForm cancels this
|
||||
-- secondary form if <reset> is True.
|
||||
-- (Default from Creation is "%f" between 0.1 and 1000.)
|
||||
-- Warning : if the condition (0. <= R1 < R2) is not fulfilled, this
|
||||
-- secondary form is canceled.
|
||||
|
||||
SetZeroSuppress (me : in out; mode : Boolean);
|
||||
---Purpose : Sets Sending Real Parameters to suppress trailing Zeros and
|
||||
-- Null Exponant ("E+00"), if <mode> is given True, Resets this
|
||||
-- mode if <mode> is False (in addition to Real Forms)
|
||||
-- A call to SetRealFrom resets this mode to False ig <reset> is
|
||||
-- given True (Default from Creation is True)
|
||||
|
||||
SetDefaults (me : in out; chars : Integer = 0);
|
||||
---Purpose : Sets again options to the defaults given by Create
|
||||
|
||||
Options (me; zerosup, range : out Boolean; R1, R2 : out Real);
|
||||
---Purpose : Returns active options : <zerosup> is the option ZeroSuppress,
|
||||
-- <range> is True if a range is set, False else
|
||||
-- R1,R2 give the range (if it is set)
|
||||
|
||||
MainFormat (me) returns CString;
|
||||
---Purpose : Returns the main format
|
||||
-- was C++ : return const
|
||||
|
||||
FormatForRange (me) returns CString;
|
||||
---Purpose : Returns the format for range, if set
|
||||
-- Meaningful only if <range> from Options is True
|
||||
-- was C++ : return const
|
||||
|
||||
Write (me; val : Real; text : CString) returns Integer is static;
|
||||
---Purpose : Writes a Real value <val> to a string <text> by using the
|
||||
-- options. Returns the useful Length of produced string.
|
||||
-- It calls the class method Convert.
|
||||
-- Warning : <text> is assumed to be wide enough (20-30 is correct)
|
||||
-- And, even if declared in, its content will be modified
|
||||
|
||||
Convert (myclass; val : Real; text : CString;
|
||||
zerosup : Boolean; Range1,Range2 : Real;
|
||||
mainform, rangeform : CString)
|
||||
returns Integer;
|
||||
---Purpose : This class method converts a Real Value to a string, given
|
||||
-- options given as arguments. It can be called independantly.
|
||||
-- Warning : even if declared in, content of <text> will be modified
|
||||
|
||||
|
||||
fields -- options
|
||||
|
||||
themainform : Character[12]; -- Main Printing from for Reals
|
||||
therange1 : Real; -- range for second printing form (if any)
|
||||
therange2 : Real; -- range for second printing form (if any)
|
||||
therangeform : Character[12]; -- Printing form applying inside Range
|
||||
thezerosup : Boolean; -- Trailing Zero Suppression Status
|
||||
|
||||
end FloatWriter;
|
@@ -12,10 +12,10 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//#52 rln 23.12.98
|
||||
#include <Interface_FloatWriter.ixx>
|
||||
|
||||
#include <Interface_FloatWriter.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
Interface_FloatWriter::Interface_FloatWriter (const Standard_Integer chars)
|
||||
{
|
||||
SetDefaults(chars);
|
||||
|
132
src/Interface/Interface_FloatWriter.hxx
Normal file
132
src/Interface/Interface_FloatWriter.hxx
Normal file
@@ -0,0 +1,132 @@
|
||||
// Created on: 1994-04-15
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1994-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_FloatWriter_HeaderFile
|
||||
#define _Interface_FloatWriter_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Character.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
|
||||
|
||||
//! This class converts a floting number (Real) to a string
|
||||
//! It can be used if the standard C-C++ output functions
|
||||
//! (sprintf or cout<<) are not convenient. That is to say :
|
||||
//! - to suppress trailing '0' and 'E+00' (if desired)
|
||||
//! - to control exponant output and floating point output
|
||||
//!
|
||||
//! Formats are given in the form used by printf-sprintf
|
||||
class Interface_FloatWriter
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a FloatWriter ready to work, with default options -
|
||||
//! - zero suppress option is set
|
||||
//! - main format is set to "%E"
|
||||
//! - secondary format is set to "%f" for values between 0.1 and
|
||||
//! 1000. in absolute values
|
||||
//! If <chars> is given (and positive), it will produce options
|
||||
//! to produce this count of characters : "%<chars>f","%<chars>%E"
|
||||
Standard_EXPORT Interface_FloatWriter(const Standard_Integer chars = 0);
|
||||
|
||||
//! Sets a specific Format for Sending Reals (main format)
|
||||
//! (Default from Creation is "%E")
|
||||
//! If <reset> is given True (default), this call clears effects
|
||||
//! of former calls to SetFormatForRange and SetZeroSuppress
|
||||
Standard_EXPORT void SetFormat (const Standard_CString form, const Standard_Boolean reset = Standard_True);
|
||||
|
||||
//! Sets a secondary Format for Real, to be applied between R1 and
|
||||
//! R2 (in absolute values). A Call to SetRealForm cancels this
|
||||
//! secondary form if <reset> is True.
|
||||
//! (Default from Creation is "%f" between 0.1 and 1000.)
|
||||
//! Warning : if the condition (0. <= R1 < R2) is not fulfilled, this
|
||||
//! secondary form is canceled.
|
||||
Standard_EXPORT void SetFormatForRange (const Standard_CString form, const Standard_Real R1, const Standard_Real R2);
|
||||
|
||||
//! Sets Sending Real Parameters to suppress trailing Zeros and
|
||||
//! Null Exponant ("E+00"), if <mode> is given True, Resets this
|
||||
//! mode if <mode> is False (in addition to Real Forms)
|
||||
//! A call to SetRealFrom resets this mode to False ig <reset> is
|
||||
//! given True (Default from Creation is True)
|
||||
Standard_EXPORT void SetZeroSuppress (const Standard_Boolean mode);
|
||||
|
||||
//! Sets again options to the defaults given by Create
|
||||
Standard_EXPORT void SetDefaults (const Standard_Integer chars = 0);
|
||||
|
||||
//! Returns active options : <zerosup> is the option ZeroSuppress,
|
||||
//! <range> is True if a range is set, False else
|
||||
//! R1,R2 give the range (if it is set)
|
||||
Standard_EXPORT void Options (Standard_Boolean& zerosup, Standard_Boolean& range, Standard_Real& R1, Standard_Real& R2) const;
|
||||
|
||||
//! Returns the main format
|
||||
//! was C++ : return const
|
||||
Standard_EXPORT Standard_CString MainFormat() const;
|
||||
|
||||
//! Returns the format for range, if set
|
||||
//! Meaningful only if <range> from Options is True
|
||||
//! was C++ : return const
|
||||
Standard_EXPORT Standard_CString FormatForRange() const;
|
||||
|
||||
//! Writes a Real value <val> to a string <text> by using the
|
||||
//! options. Returns the useful Length of produced string.
|
||||
//! It calls the class method Convert.
|
||||
//! Warning : <text> is assumed to be wide enough (20-30 is correct)
|
||||
//! And, even if declared in, its content will be modified
|
||||
Standard_EXPORT Standard_Integer Write (const Standard_Real val, const Standard_CString text) const;
|
||||
|
||||
//! This class method converts a Real Value to a string, given
|
||||
//! options given as arguments. It can be called independantly.
|
||||
//! Warning : even if declared in, content of <text> will be modified
|
||||
Standard_EXPORT static Standard_Integer Convert (const Standard_Real val, const Standard_CString text, const Standard_Boolean zerosup, const Standard_Real Range1, const Standard_Real Range2, const Standard_CString mainform, const Standard_CString rangeform);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Character themainform[12];
|
||||
Standard_Real therange1;
|
||||
Standard_Real therange2;
|
||||
Standard_Character therangeform[12];
|
||||
Standard_Boolean thezerosup;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_FloatWriter_HeaderFile
|
@@ -1,95 +0,0 @@
|
||||
-- Created on: 1998-01-08
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1998-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class GTool from Interface inherits TShared
|
||||
|
||||
---Purpose : GTool - General Tool for a Model
|
||||
-- Provides the functions performed by Protocol/GeneralModule for
|
||||
-- entities of a Model, and recorded in a GeneralLib
|
||||
-- Optimized : once an entity has been queried, the GeneralLib is
|
||||
-- not longer queried
|
||||
-- Shareable between several users : as a Handle
|
||||
|
||||
uses Transient,
|
||||
Protocol, GeneralLib, GeneralModule,
|
||||
SignType, InterfaceModel,
|
||||
IndexedDataMapOfTransientTransient from TColStd,
|
||||
DataMapOfTransientInteger from Interface
|
||||
|
||||
is
|
||||
|
||||
Create returns GTool;
|
||||
---Purpose : Creates an empty, not set, GTool
|
||||
|
||||
Create (proto : Protocol; nbent : Integer = 0) returns GTool;
|
||||
---Purpose : Creates a GTool from a Protocol
|
||||
-- Optional starting count of entities
|
||||
|
||||
SetSignType (me : mutable; sign : SignType);
|
||||
---Purpose : Sets a new SignType
|
||||
|
||||
SignType (me) returns SignType;
|
||||
---Purpose : Returns the SignType. Can be null
|
||||
|
||||
SignValue (me; ent : Transient; model : InterfaceModel)
|
||||
returns CString;
|
||||
---Purpose : Returns the Signature for a Transient Object in a Model
|
||||
-- It calls SignType to do that
|
||||
-- If SignType is not defined, return ClassName of <ent>
|
||||
|
||||
SignName (me) returns CString;
|
||||
---Purpose : Returns the Name of the SignType, or "Class Name"
|
||||
|
||||
SetProtocol (me : mutable; proto : Protocol; enforce : Boolean = Standard_False);
|
||||
---Purpose : Sets a new Protocol
|
||||
-- if <enforce> is False and the new Protocol equates the old one
|
||||
-- then nothing is done
|
||||
|
||||
Protocol (me) returns Protocol;
|
||||
---Purpose : Returns the Protocol. Warning : it can be Null
|
||||
|
||||
Lib (me : mutable) returns GeneralLib;
|
||||
---Purpose : Returns the GeneralLib itself
|
||||
---C++ : return &
|
||||
|
||||
Reservate (me : mutable; nb : Integer; enforce : Boolean = Standard_False);
|
||||
---Purpose : Reservates maps for a count of entities
|
||||
-- <enforce> False : minimum count
|
||||
-- <enforce> True : clears former reservations
|
||||
-- Does not clear the maps
|
||||
|
||||
ClearEntities (me : mutable);
|
||||
---Purpose : Clears the maps which record, for each already recorded entity
|
||||
-- its Module and Case Number
|
||||
|
||||
Select (me : mutable; ent : Transient;
|
||||
gmod : out GeneralModule;
|
||||
CN : out Integer;
|
||||
enforce : Boolean = Standard_False) returns Boolean;
|
||||
---Purpose : Selects for an entity, its Module and Case Number
|
||||
-- It is optimised : once done for each entity, the result is
|
||||
-- mapped and the GeneralLib is not longer queried
|
||||
-- <enforce> True overpasses this optimisation
|
||||
|
||||
fields
|
||||
|
||||
theproto : Protocol;
|
||||
thesign : SignType;
|
||||
thelib : GeneralLib;
|
||||
thentnum : DataMapOfTransientInteger;
|
||||
thentmod : IndexedDataMapOfTransientTransient;
|
||||
|
||||
end GTool;
|
@@ -11,8 +11,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_GTool.ixx>
|
||||
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_GTool.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_SignType.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Interface_GTool::Interface_GTool () { }
|
||||
|
||||
|
129
src/Interface/Interface_GTool.hxx
Normal file
129
src/Interface/Interface_GTool.hxx
Normal file
@@ -0,0 +1,129 @@
|
||||
// Created on: 1998-01-08
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1998-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_GTool_HeaderFile
|
||||
#define _Interface_GTool_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
#include <Interface_DataMapOfTransientInteger.hxx>
|
||||
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_Protocol;
|
||||
class Interface_SignType;
|
||||
class Standard_Transient;
|
||||
class Interface_InterfaceModel;
|
||||
class Interface_GeneralLib;
|
||||
class Interface_GeneralModule;
|
||||
|
||||
|
||||
class Interface_GTool;
|
||||
DEFINE_STANDARD_HANDLE(Interface_GTool, MMgt_TShared)
|
||||
|
||||
//! GTool - General Tool for a Model
|
||||
//! Provides the functions performed by Protocol/GeneralModule for
|
||||
//! entities of a Model, and recorded in a GeneralLib
|
||||
//! Optimized : once an entity has been queried, the GeneralLib is
|
||||
//! not longer queried
|
||||
//! Shareable between several users : as a Handle
|
||||
class Interface_GTool : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an empty, not set, GTool
|
||||
Standard_EXPORT Interface_GTool();
|
||||
|
||||
//! Creates a GTool from a Protocol
|
||||
//! Optional starting count of entities
|
||||
Standard_EXPORT Interface_GTool(const Handle(Interface_Protocol)& proto, const Standard_Integer nbent = 0);
|
||||
|
||||
//! Sets a new SignType
|
||||
Standard_EXPORT void SetSignType (const Handle(Interface_SignType)& sign);
|
||||
|
||||
//! Returns the SignType. Can be null
|
||||
Standard_EXPORT Handle(Interface_SignType) SignType() const;
|
||||
|
||||
//! Returns the Signature for a Transient Object in a Model
|
||||
//! It calls SignType to do that
|
||||
//! If SignType is not defined, return ClassName of <ent>
|
||||
Standard_EXPORT Standard_CString SignValue (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const;
|
||||
|
||||
//! Returns the Name of the SignType, or "Class Name"
|
||||
Standard_EXPORT Standard_CString SignName() const;
|
||||
|
||||
//! Sets a new Protocol
|
||||
//! if <enforce> is False and the new Protocol equates the old one
|
||||
//! then nothing is done
|
||||
Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& proto, const Standard_Boolean enforce = Standard_False);
|
||||
|
||||
//! Returns the Protocol. Warning : it can be Null
|
||||
Standard_EXPORT Handle(Interface_Protocol) Protocol() const;
|
||||
|
||||
//! Returns the GeneralLib itself
|
||||
Standard_EXPORT Interface_GeneralLib& Lib();
|
||||
|
||||
//! Reservates maps for a count of entities
|
||||
//! <enforce> False : minimum count
|
||||
//! <enforce> True : clears former reservations
|
||||
//! Does not clear the maps
|
||||
Standard_EXPORT void Reservate (const Standard_Integer nb, const Standard_Boolean enforce = Standard_False);
|
||||
|
||||
//! Clears the maps which record, for each already recorded entity
|
||||
//! its Module and Case Number
|
||||
Standard_EXPORT void ClearEntities();
|
||||
|
||||
//! Selects for an entity, its Module and Case Number
|
||||
//! It is optimised : once done for each entity, the result is
|
||||
//! mapped and the GeneralLib is not longer queried
|
||||
//! <enforce> True overpasses this optimisation
|
||||
Standard_EXPORT Standard_Boolean Select (const Handle(Standard_Transient)& ent, Handle(Interface_GeneralModule)& gmod, Standard_Integer& CN, const Standard_Boolean enforce = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_GTool,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Interface_Protocol) theproto;
|
||||
Handle(Interface_SignType) thesign;
|
||||
Interface_GeneralLib thelib;
|
||||
Interface_DataMapOfTransientInteger thentnum;
|
||||
TColStd_IndexedDataMapOfTransientTransient thentmod;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_GTool_HeaderFile
|
91
src/Interface/Interface_GeneralLib.hxx
Normal file
91
src/Interface/Interface_GeneralLib.hxx
Normal file
@@ -0,0 +1,91 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_GeneralLib_HeaderFile
|
||||
#define _Interface_GeneralLib_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Interface_NodeOfGeneralLib;
|
||||
class Standard_NoSuchObject;
|
||||
class Standard_Transient;
|
||||
class Interface_GeneralModule;
|
||||
class Interface_Protocol;
|
||||
class Interface_GlobalNodeOfGeneralLib;
|
||||
|
||||
|
||||
|
||||
class Interface_GeneralLib
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT static void SetGlobal (const Handle(Interface_GeneralModule)& amodule, const Handle(Interface_Protocol)& aprotocol);
|
||||
|
||||
Standard_EXPORT Interface_GeneralLib(const Handle(Interface_Protocol)& aprotocol);
|
||||
|
||||
Standard_EXPORT Interface_GeneralLib();
|
||||
|
||||
Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol);
|
||||
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
Standard_EXPORT void SetComplete();
|
||||
|
||||
Standard_EXPORT Standard_Boolean Select (const Handle(Standard_Transient)& obj, Handle(Interface_GeneralModule)& module, Standard_Integer& CN) const;
|
||||
|
||||
Standard_EXPORT void Start();
|
||||
|
||||
Standard_EXPORT Standard_Boolean More() const;
|
||||
|
||||
Standard_EXPORT void Next();
|
||||
|
||||
Standard_EXPORT const Handle(Interface_GeneralModule)& Module() const;
|
||||
|
||||
Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Interface_NodeOfGeneralLib) thelist;
|
||||
Handle(Interface_NodeOfGeneralLib) thecurr;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_GeneralLib_HeaderFile
|
44
src/Interface/Interface_GeneralLib_0.cxx
Normal file
44
src/Interface/Interface_GeneralLib_0.cxx
Normal file
@@ -0,0 +1,44 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
|
||||
#include <Interface_NodeOfGeneralLib.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_GlobalNodeOfGeneralLib.hxx>
|
||||
|
||||
|
||||
#define TheObject Handle(Standard_Transient)
|
||||
#define TheObject_hxx <Standard_Transient.hxx>
|
||||
#define Handle_TheModule Handle(Interface_GeneralModule)
|
||||
#define TheModule Interface_GeneralModule
|
||||
#define TheModule_hxx <Interface_GeneralModule.hxx>
|
||||
#define Handle_TheProtocol Handle(Interface_Protocol)
|
||||
#define TheProtocol Interface_Protocol
|
||||
#define TheProtocol_hxx <Interface_Protocol.hxx>
|
||||
#define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib
|
||||
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfGeneralLib.hxx>
|
||||
#define LibCtl_Node Interface_NodeOfGeneralLib
|
||||
#define LibCtl_Node_hxx <Interface_NodeOfGeneralLib.hxx>
|
||||
#define Handle_LibCtl_GlobalNode Handle(Interface_GlobalNodeOfGeneralLib)
|
||||
#define Handle_LibCtl_Node Handle(Interface_NodeOfGeneralLib)
|
||||
#define LibCtl_Library Interface_GeneralLib
|
||||
#define LibCtl_Library_hxx <Interface_GeneralLib.hxx>
|
||||
#include <LibCtl_Library.gxx>
|
||||
|
@@ -1,185 +0,0 @@
|
||||
-- Created on: 1993-02-02
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class GeneralModule from Interface inherits TShared
|
||||
|
||||
---Purpose : This class defines general services, which must be provided
|
||||
-- for each type of Entity (i.e. of Transient Object processed
|
||||
-- by an Interface) : Shared List, Check, Copy, Delete, Category
|
||||
--
|
||||
-- To optimise processing (e.g. firstly bind an Entity to a Module
|
||||
-- then calls Module), each recognized Entity Type corresponds
|
||||
-- to a Case Number, determined by the Protocol each class of
|
||||
-- GeneralModule belongs to.
|
||||
|
||||
uses Transient, HAsciiString from TCollection,
|
||||
InterfaceModel, ShareTool, Check, EntityIterator, CopyTool
|
||||
|
||||
is
|
||||
|
||||
FillShared (me; model : InterfaceModel; CN : Integer; ent : Transient;
|
||||
iter : in out EntityIterator) is virtual;
|
||||
---Purpose : Specific filling of the list of Entities shared by an Entity
|
||||
-- <ent>, according a Case Number <CN> (formerly computed by
|
||||
-- CaseNum), considered in the context of a Model <model>
|
||||
-- Default calls FillSharedCase (i.e., ignores the model)
|
||||
-- Can be redefined to use the model for working
|
||||
|
||||
FillSharedCase (me; CN : Integer; ent : Transient;
|
||||
iter : in out EntityIterator) is deferred;
|
||||
---Purpose : Specific filling of the list of Entities shared by an Entity
|
||||
-- <ent>, according a Case Number <CN> (formerly computed by
|
||||
-- CaseNum). Can use the internal utility method Share, below
|
||||
|
||||
Share (me; iter : in out EntityIterator; shared : Transient);
|
||||
---Purpose : Adds an Entity to a Shared List (uses GetOneItem on <iter>)
|
||||
|
||||
ListImplied (me; model : InterfaceModel; CN : Integer; ent : Transient;
|
||||
iter : in out EntityIterator) is virtual;
|
||||
---Purpose : List the Implied References of <ent> considered in the context
|
||||
-- of a Model <model> : i.e. the Entities which are Referenced
|
||||
-- while not considered as Shared (not copied if <ent> is,
|
||||
-- references not renewed by CopyCase but by ImpliedCase, only
|
||||
-- if referenced Entities have been Copied too)
|
||||
-- FillShared + ListImplied give the complete list of References
|
||||
-- Default calls ListImpliedCase (i.e. ignores the model)
|
||||
-- Can be redefined to use the model for working
|
||||
|
||||
ListImpliedCase (me; CN : Integer; ent : Transient;
|
||||
iter : in out EntityIterator) is virtual;
|
||||
---Purpose : List the Implied References of <ent> (see above)
|
||||
-- are Referenced while not considered as Shared (not copied if
|
||||
-- <ent> is, references not renewed by CopyCase but by
|
||||
-- ImpliedCase, only if referenced Entities have been Copied too)
|
||||
-- FillSharedCase + ListImpliedCase give the complete list of
|
||||
-- Referenced Entities
|
||||
-- The provided default method does nothing (Implied References
|
||||
-- are specific of a little amount of Entity Classes).
|
||||
|
||||
|
||||
CheckCase (me; CN : Integer; ent : Transient; shares : ShareTool;
|
||||
ach : in out Check) is deferred;
|
||||
---Purpose : Specific Checking of an Entity <ent>
|
||||
-- Can check context queried through a ShareTool, as required
|
||||
|
||||
|
||||
CanCopy (me; CN : Integer; ent : Transient) returns Boolean is virtual;
|
||||
---Purpose : Specific answer to the question "is Copy properly implemented"
|
||||
-- Remark that it should be in phase with the implementation of
|
||||
-- NewVoid+CopyCase/NewCopyCase
|
||||
-- Default returns always False, can be redefined
|
||||
|
||||
Dispatch (me; CN : Integer;
|
||||
entfrom : Transient; entto : out Transient;
|
||||
TC : in out CopyTool) returns Boolean is virtual;
|
||||
---Purpose : Dispatches an entity
|
||||
-- Returns True if it works by copy, False if it just duplicates
|
||||
-- the starting Handle
|
||||
--
|
||||
-- Dispatching means producing a new entity, image of the
|
||||
-- starting one, in order to be put into a new Model, this Model
|
||||
-- being itself the result of a dispatch from an original Model
|
||||
--
|
||||
-- According to the cases, dispatch can either
|
||||
-- * just return <entto> as equating <entfrom>
|
||||
-- -> the new model designates the starting entity : it is
|
||||
-- lighter, but the dispatched entity being shared might not be
|
||||
-- modified for dispatch
|
||||
-- * copy <entfrom> to <entto>
|
||||
-- by calling NewVoid+CopyCase (two steps) or NewCopiedCase (1)
|
||||
-- -> the dispatched entity is a COPY, hence it can be modified
|
||||
--
|
||||
-- The provided default just duplicates the handle without
|
||||
-- copying, then returns False. Can be redefined
|
||||
|
||||
|
||||
NewVoid (me; CN : Integer; entto : out Transient)
|
||||
returns Boolean is deferred;
|
||||
---Purpose : Creates a new void entity <entto> according to a Case Number
|
||||
-- This entity remains to be filled, by reading from a file or
|
||||
-- by copying from another entity of same type (see CopyCase)
|
||||
|
||||
CopyCase (me; CN : Integer;
|
||||
entfrom : Transient; entto : Transient;
|
||||
TC : in out CopyTool) is deferred;
|
||||
---Purpose : Specific Copy ("Deep") from <entfrom> to <entto> (same type)
|
||||
-- by using a CopyTool which provides its working Map.
|
||||
-- Use method Transferred from CopyTool to work
|
||||
|
||||
NewCopiedCase (me; CN : Integer;
|
||||
entfrom : Transient; entto : out Transient;
|
||||
TC : in out CopyTool) returns Boolean is virtual;
|
||||
---Purpose : Specific operator (create+copy) defaulted to do nothing.
|
||||
-- It can be redefined : When it is not possible to work in two
|
||||
-- steps (NewVoid then CopyCase). This can occur when there is
|
||||
-- no default constructor : hence the result <entto> must be
|
||||
-- created with an effective definition.
|
||||
-- Remark : if NewCopiedCase is defined, CopyCase has nothing to do
|
||||
-- Returns True if it has produced something, false else
|
||||
|
||||
RenewImpliedCase (me; CN : Integer;
|
||||
entfrom : Transient; entto : Transient;
|
||||
TC : CopyTool) is virtual;
|
||||
---Purpose : Specific Copying of Implied References
|
||||
-- A Default is provided which does nothing (must current case !)
|
||||
-- Already copied references (by CopyFrom) must remain unchanged
|
||||
-- Use method Search from CopyTool to work
|
||||
|
||||
WhenDeleteCase (me; CN : Integer;
|
||||
ent : Transient; dispatched : Boolean) is virtual;
|
||||
---Purpose : Prepares an entity to be deleted. What does it mean :
|
||||
-- Basically, any class of entity may define its own destructor
|
||||
-- By default, it does nothing but calling destructors on fields
|
||||
-- With the Memory Manager, it is useless to call destructor,
|
||||
-- it is done automatically when the Handle is nullified(cleared)
|
||||
-- BUT this is ineffective in looping structures (whatever these
|
||||
-- are "Implied" references or not).
|
||||
--
|
||||
-- THUS : if no loop may appear in definitions, a class which
|
||||
-- inherits from TShared is correctly managed by automatic way
|
||||
-- BUT if there can be loops (or simply back pointers), they must
|
||||
-- be broken, for instance by clearing fields of one of the nodes
|
||||
-- The default does nothing, to be redefined if a loop can occur
|
||||
-- (Implied generally requires WhenDelete, but other cases can
|
||||
-- occur)
|
||||
--
|
||||
-- Warning : <dispatched> tells if the entity to be deleted has been
|
||||
-- produced by Dispatch or not. Hence WhenDelete must be in
|
||||
-- coherence with Dispatch
|
||||
-- Dispatch can either copy or not.
|
||||
-- If it copies the entity, this one should be deleted
|
||||
-- If it doesnt (i.e. duplicates the handle) nothing to do
|
||||
--
|
||||
-- If <dispatch> is False, normal deletion is to be performed
|
||||
|
||||
CategoryNumber (me; CN : Integer; ent : Transient; shares : ShareTool)
|
||||
returns Integer is virtual;
|
||||
---Purpose : Returns a category number which characterizes an entity
|
||||
-- Category Numbers are managed by the class Category
|
||||
-- <shares> can be used to evaluate this number in the context
|
||||
-- Default returns 0 which means "unspecified"
|
||||
|
||||
Name (me; CN : Integer; ent : Transient; shares : ShareTool)
|
||||
returns HAsciiString from TCollection is virtual;
|
||||
---Purpose : Determines if an entity brings a Name (or widerly, if a Name
|
||||
-- can be attached to it, through the ShareTool
|
||||
-- By default, returns a Null Handle (no name can be produced)
|
||||
-- Can be redefined
|
||||
--
|
||||
-- Warning : While this string may be edited on the spot, if it is a read
|
||||
-- field, the returned value must be copied before.
|
||||
|
||||
end GeneralModule;
|
@@ -11,8 +11,16 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_GeneralModule.ixx>
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_CopyTool.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_ShareTool.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
void Interface_GeneralModule::FillShared
|
||||
(const Handle(Interface_InterfaceModel)& /*model*/,
|
||||
|
207
src/Interface/Interface_GeneralModule.hxx
Normal file
207
src/Interface/Interface_GeneralModule.hxx
Normal file
@@ -0,0 +1,207 @@
|
||||
// Created on: 1993-02-02
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_GeneralModule_HeaderFile
|
||||
#define _Interface_GeneralModule_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_InterfaceModel;
|
||||
class Standard_Transient;
|
||||
class Interface_EntityIterator;
|
||||
class Interface_ShareTool;
|
||||
class Interface_Check;
|
||||
class Interface_CopyTool;
|
||||
class TCollection_HAsciiString;
|
||||
|
||||
|
||||
class Interface_GeneralModule;
|
||||
DEFINE_STANDARD_HANDLE(Interface_GeneralModule, MMgt_TShared)
|
||||
|
||||
//! This class defines general services, which must be provided
|
||||
//! for each type of Entity (i.e. of Transient Object processed
|
||||
//! by an Interface) : Shared List, Check, Copy, Delete, Category
|
||||
//!
|
||||
//! To optimise processing (e.g. firstly bind an Entity to a Module
|
||||
//! then calls Module), each recognized Entity Type corresponds
|
||||
//! to a Case Number, determined by the Protocol each class of
|
||||
//! GeneralModule belongs to.
|
||||
class Interface_GeneralModule : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Specific filling of the list of Entities shared by an Entity
|
||||
//! <ent>, according a Case Number <CN> (formerly computed by
|
||||
//! CaseNum), considered in the context of a Model <model>
|
||||
//! Default calls FillSharedCase (i.e., ignores the model)
|
||||
//! Can be redefined to use the model for working
|
||||
Standard_EXPORT virtual void FillShared (const Handle(Interface_InterfaceModel)& model, const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Specific filling of the list of Entities shared by an Entity
|
||||
//! <ent>, according a Case Number <CN> (formerly computed by
|
||||
//! CaseNum). Can use the internal utility method Share, below
|
||||
Standard_EXPORT virtual void FillSharedCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const = 0;
|
||||
|
||||
//! Adds an Entity to a Shared List (uses GetOneItem on <iter>)
|
||||
Standard_EXPORT void Share (Interface_EntityIterator& iter, const Handle(Standard_Transient)& shared) const;
|
||||
|
||||
//! List the Implied References of <ent> considered in the context
|
||||
//! of a Model <model> : i.e. the Entities which are Referenced
|
||||
//! while not considered as Shared (not copied if <ent> is,
|
||||
//! references not renewed by CopyCase but by ImpliedCase, only
|
||||
//! if referenced Entities have been Copied too)
|
||||
//! FillShared + ListImplied give the complete list of References
|
||||
//! Default calls ListImpliedCase (i.e. ignores the model)
|
||||
//! Can be redefined to use the model for working
|
||||
Standard_EXPORT virtual void ListImplied (const Handle(Interface_InterfaceModel)& model, const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
//! List the Implied References of <ent> (see above)
|
||||
//! are Referenced while not considered as Shared (not copied if
|
||||
//! <ent> is, references not renewed by CopyCase but by
|
||||
//! ImpliedCase, only if referenced Entities have been Copied too)
|
||||
//! FillSharedCase + ListImpliedCase give the complete list of
|
||||
//! Referenced Entities
|
||||
//! The provided default method does nothing (Implied References
|
||||
//! are specific of a little amount of Entity Classes).
|
||||
Standard_EXPORT virtual void ListImpliedCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Specific Checking of an Entity <ent>
|
||||
//! Can check context queried through a ShareTool, as required
|
||||
Standard_EXPORT virtual void CheckCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const = 0;
|
||||
|
||||
//! Specific answer to the question "is Copy properly implemented"
|
||||
//! Remark that it should be in phase with the implementation of
|
||||
//! NewVoid+CopyCase/NewCopyCase
|
||||
//! Default returns always False, can be redefined
|
||||
Standard_EXPORT virtual Standard_Boolean CanCopy (const Standard_Integer CN, const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Dispatches an entity
|
||||
//! Returns True if it works by copy, False if it just duplicates
|
||||
//! the starting Handle
|
||||
//!
|
||||
//! Dispatching means producing a new entity, image of the
|
||||
//! starting one, in order to be put into a new Model, this Model
|
||||
//! being itself the result of a dispatch from an original Model
|
||||
//!
|
||||
//! According to the cases, dispatch can either
|
||||
//! * just return <entto> as equating <entfrom>
|
||||
//! -> the new model designates the starting entity : it is
|
||||
//! lighter, but the dispatched entity being shared might not be
|
||||
//! modified for dispatch
|
||||
//! * copy <entfrom> to <entto>
|
||||
//! by calling NewVoid+CopyCase (two steps) or NewCopiedCase (1)
|
||||
//! -> the dispatched entity is a COPY, hence it can be modified
|
||||
//!
|
||||
//! The provided default just duplicates the handle without
|
||||
//! copying, then returns False. Can be redefined
|
||||
Standard_EXPORT virtual Standard_Boolean Dispatch (const Standard_Integer CN, const Handle(Standard_Transient)& entfrom, Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const;
|
||||
|
||||
//! Creates a new void entity <entto> according to a Case Number
|
||||
//! This entity remains to be filled, by reading from a file or
|
||||
//! by copying from another entity of same type (see CopyCase)
|
||||
Standard_EXPORT virtual Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const = 0;
|
||||
|
||||
//! Specific Copy ("Deep") from <entfrom> to <entto> (same type)
|
||||
//! by using a CopyTool which provides its working Map.
|
||||
//! Use method Transferred from CopyTool to work
|
||||
Standard_EXPORT virtual void CopyCase (const Standard_Integer CN, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const = 0;
|
||||
|
||||
//! Specific operator (create+copy) defaulted to do nothing.
|
||||
//! It can be redefined : When it is not possible to work in two
|
||||
//! steps (NewVoid then CopyCase). This can occur when there is
|
||||
//! no default constructor : hence the result <entto> must be
|
||||
//! created with an effective definition.
|
||||
//! Remark : if NewCopiedCase is defined, CopyCase has nothing to do
|
||||
//! Returns True if it has produced something, false else
|
||||
Standard_EXPORT virtual Standard_Boolean NewCopiedCase (const Standard_Integer CN, const Handle(Standard_Transient)& entfrom, Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const;
|
||||
|
||||
//! Specific Copying of Implied References
|
||||
//! A Default is provided which does nothing (must current case !)
|
||||
//! Already copied references (by CopyFrom) must remain unchanged
|
||||
//! Use method Search from CopyTool to work
|
||||
Standard_EXPORT virtual void RenewImpliedCase (const Standard_Integer CN, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, const Interface_CopyTool& TC) const;
|
||||
|
||||
//! Prepares an entity to be deleted. What does it mean :
|
||||
//! Basically, any class of entity may define its own destructor
|
||||
//! By default, it does nothing but calling destructors on fields
|
||||
//! With the Memory Manager, it is useless to call destructor,
|
||||
//! it is done automatically when the Handle is nullified(cleared)
|
||||
//! BUT this is ineffective in looping structures (whatever these
|
||||
//! are "Implied" references or not).
|
||||
//!
|
||||
//! THUS : if no loop may appear in definitions, a class which
|
||||
//! inherits from TShared is correctly managed by automatic way
|
||||
//! BUT if there can be loops (or simply back pointers), they must
|
||||
//! be broken, for instance by clearing fields of one of the nodes
|
||||
//! The default does nothing, to be redefined if a loop can occur
|
||||
//! (Implied generally requires WhenDelete, but other cases can
|
||||
//! occur)
|
||||
//!
|
||||
//! Warning : <dispatched> tells if the entity to be deleted has been
|
||||
//! produced by Dispatch or not. Hence WhenDelete must be in
|
||||
//! coherence with Dispatch
|
||||
//! Dispatch can either copy or not.
|
||||
//! If it copies the entity, this one should be deleted
|
||||
//! If it doesnt (i.e. duplicates the handle) nothing to do
|
||||
//!
|
||||
//! If <dispatch> is False, normal deletion is to be performed
|
||||
Standard_EXPORT virtual void WhenDeleteCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Standard_Boolean dispatched) const;
|
||||
|
||||
//! Returns a category number which characterizes an entity
|
||||
//! Category Numbers are managed by the class Category
|
||||
//! <shares> can be used to evaluate this number in the context
|
||||
//! Default returns 0 which means "unspecified"
|
||||
Standard_EXPORT virtual Standard_Integer CategoryNumber (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares) const;
|
||||
|
||||
//! Determines if an entity brings a Name (or widerly, if a Name
|
||||
//! can be attached to it, through the ShareTool
|
||||
//! By default, returns a Null Handle (no name can be produced)
|
||||
//! Can be redefined
|
||||
//!
|
||||
//! Warning : While this string may be edited on the spot, if it is a read
|
||||
//! field, the returned value must be copied before.
|
||||
Standard_EXPORT virtual Handle(TCollection_HAsciiString) Name (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_GeneralModule,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_GeneralModule_HeaderFile
|
77
src/Interface/Interface_GlobalNodeOfGeneralLib.hxx
Normal file
77
src/Interface/Interface_GlobalNodeOfGeneralLib.hxx
Normal file
@@ -0,0 +1,77 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_GlobalNodeOfGeneralLib_HeaderFile
|
||||
#define _Interface_GlobalNodeOfGeneralLib_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
class Interface_GeneralModule;
|
||||
class Interface_Protocol;
|
||||
class Standard_Transient;
|
||||
class Interface_GeneralLib;
|
||||
class Interface_NodeOfGeneralLib;
|
||||
|
||||
|
||||
class Interface_GlobalNodeOfGeneralLib;
|
||||
DEFINE_STANDARD_HANDLE(Interface_GlobalNodeOfGeneralLib, Standard_Transient)
|
||||
|
||||
|
||||
class Interface_GlobalNodeOfGeneralLib : public Standard_Transient
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT Interface_GlobalNodeOfGeneralLib();
|
||||
|
||||
Standard_EXPORT void Add (const Handle(Interface_GeneralModule)& amodule, const Handle(Interface_Protocol)& aprotocol);
|
||||
|
||||
Standard_EXPORT const Handle(Interface_GeneralModule)& Module() const;
|
||||
|
||||
Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
|
||||
|
||||
Standard_EXPORT const Handle(Interface_GlobalNodeOfGeneralLib)& Next() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_GlobalNodeOfGeneralLib,Standard_Transient)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Interface_GeneralModule) themod;
|
||||
Handle(Interface_Protocol) theprot;
|
||||
Handle(Interface_GlobalNodeOfGeneralLib) thenext;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_GlobalNodeOfGeneralLib_HeaderFile
|
54
src/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx
Normal file
54
src/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx
Normal file
@@ -0,0 +1,54 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_GlobalNodeOfGeneralLib.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_GlobalNodeOfGeneralLib.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
#include <Interface_NodeOfGeneralLib.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheObject Handle(Standard_Transient)
|
||||
#define TheObject_hxx <Standard_Transient.hxx>
|
||||
#define Handle_TheModule Handle(Interface_GeneralModule)
|
||||
#define TheModule Interface_GeneralModule
|
||||
#define TheModule_hxx <Interface_GeneralModule.hxx>
|
||||
#define Handle_TheProtocol Handle(Interface_Protocol)
|
||||
#define TheProtocol Interface_Protocol
|
||||
#define TheProtocol_hxx <Interface_Protocol.hxx>
|
||||
#define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib
|
||||
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfGeneralLib.hxx>
|
||||
#define LibCtl_Node Interface_NodeOfGeneralLib
|
||||
#define LibCtl_Node_hxx <Interface_NodeOfGeneralLib.hxx>
|
||||
#define Handle_LibCtl_GlobalNode Handle(Interface_GlobalNodeOfGeneralLib)
|
||||
#define Handle_LibCtl_Node Handle(Interface_NodeOfGeneralLib)
|
||||
#define LibCtl_Library Interface_GeneralLib
|
||||
#define LibCtl_Library_hxx <Interface_GeneralLib.hxx>
|
||||
#include <LibCtl_GlobalNode.gxx>
|
||||
|
77
src/Interface/Interface_GlobalNodeOfReaderLib.hxx
Normal file
77
src/Interface/Interface_GlobalNodeOfReaderLib.hxx
Normal file
@@ -0,0 +1,77 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_GlobalNodeOfReaderLib_HeaderFile
|
||||
#define _Interface_GlobalNodeOfReaderLib_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
class Interface_ReaderModule;
|
||||
class Interface_Protocol;
|
||||
class Standard_Transient;
|
||||
class Interface_ReaderLib;
|
||||
class Interface_NodeOfReaderLib;
|
||||
|
||||
|
||||
class Interface_GlobalNodeOfReaderLib;
|
||||
DEFINE_STANDARD_HANDLE(Interface_GlobalNodeOfReaderLib, Standard_Transient)
|
||||
|
||||
|
||||
class Interface_GlobalNodeOfReaderLib : public Standard_Transient
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT Interface_GlobalNodeOfReaderLib();
|
||||
|
||||
Standard_EXPORT void Add (const Handle(Interface_ReaderModule)& amodule, const Handle(Interface_Protocol)& aprotocol);
|
||||
|
||||
Standard_EXPORT const Handle(Interface_ReaderModule)& Module() const;
|
||||
|
||||
Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
|
||||
|
||||
Standard_EXPORT const Handle(Interface_GlobalNodeOfReaderLib)& Next() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_GlobalNodeOfReaderLib,Standard_Transient)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Interface_ReaderModule) themod;
|
||||
Handle(Interface_Protocol) theprot;
|
||||
Handle(Interface_GlobalNodeOfReaderLib) thenext;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_GlobalNodeOfReaderLib_HeaderFile
|
54
src/Interface/Interface_GlobalNodeOfReaderLib_0.cxx
Normal file
54
src/Interface/Interface_GlobalNodeOfReaderLib_0.cxx
Normal file
@@ -0,0 +1,54 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_GlobalNodeOfReaderLib.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Interface_ReaderModule.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_GlobalNodeOfReaderLib.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Interface_ReaderLib.hxx>
|
||||
#include <Interface_NodeOfReaderLib.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheObject Handle(Standard_Transient)
|
||||
#define TheObject_hxx <Standard_Transient.hxx>
|
||||
#define Handle_TheModule Handle(Interface_ReaderModule)
|
||||
#define TheModule Interface_ReaderModule
|
||||
#define TheModule_hxx <Interface_ReaderModule.hxx>
|
||||
#define Handle_TheProtocol Handle(Interface_Protocol)
|
||||
#define TheProtocol Interface_Protocol
|
||||
#define TheProtocol_hxx <Interface_Protocol.hxx>
|
||||
#define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib
|
||||
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfReaderLib.hxx>
|
||||
#define LibCtl_Node Interface_NodeOfReaderLib
|
||||
#define LibCtl_Node_hxx <Interface_NodeOfReaderLib.hxx>
|
||||
#define Handle_LibCtl_GlobalNode Handle(Interface_GlobalNodeOfReaderLib)
|
||||
#define Handle_LibCtl_Node Handle(Interface_NodeOfReaderLib)
|
||||
#define LibCtl_Library Interface_ReaderLib
|
||||
#define LibCtl_Library_hxx <Interface_ReaderLib.hxx>
|
||||
#include <LibCtl_GlobalNode.gxx>
|
||||
|
@@ -1,272 +0,0 @@
|
||||
-- Created on: 1992-09-22
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Graph from Interface
|
||||
|
||||
---Purpose : Gives basic data structure for operating and storing
|
||||
-- graph results (usage is normally internal)
|
||||
-- Entities are Mapped according their Number in the Model
|
||||
--
|
||||
-- Each Entity from the Model can be known as "Present" or
|
||||
-- not; if it is, it is Mapped with a Status : an Integer
|
||||
-- which can be used according to needs of each algorithm
|
||||
-- In addition, the Graph brings a BitMap which can be used
|
||||
-- by any caller
|
||||
--
|
||||
-- Also, it is bound with two lists : a list of Shared
|
||||
-- Entities (in fact, their Numbers in the Model) which is
|
||||
-- filled by a ShareTool, and a list of Sharing Entities,
|
||||
-- computed by deduction from the Shared Lists
|
||||
--
|
||||
-- Moreover, it is possible to redefine the list of Entities
|
||||
-- Shared by an Entity (instead of standard answer by general
|
||||
-- service Shareds) : this new list can be empty; it can
|
||||
-- be changed or reset (i.e. to come back to standard answer)
|
||||
|
||||
uses Transient, Type,
|
||||
HArray1OfInteger from TColStd,
|
||||
HArray1OfTransient from TColStd,
|
||||
HSequenceOfTransient from TColStd,
|
||||
HArray1OfListOfInteger from TColStd,
|
||||
AsciiString from TCollection, HAsciiString from TCollection,
|
||||
Protocol from Interface, GeneralLib, InterfaceModel, GTool,
|
||||
EntityIterator, BitMap
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create (amodel : InterfaceModel; lib : GeneralLib; theModeStats : Boolean = Standard_True ) returns Graph;
|
||||
---Purpose : Creates an empty graph, ready to receive Entities from amodel
|
||||
-- Note that this way of Creation allows <me> to verify that
|
||||
-- Entities to work with are contained in <amodel>
|
||||
-- Basic Shared and Sharing lists are obtained from a General
|
||||
-- Services Library, given directly as an argument
|
||||
|
||||
Create (amodel : InterfaceModel; protocol : Protocol from Interface;
|
||||
theModeStats : Boolean = Standard_True)
|
||||
returns Graph;
|
||||
---Purpose : Same as above, but the Library is defined through a Protocol
|
||||
|
||||
Create (amodel : InterfaceModel; gtool : GTool from Interface;
|
||||
theModeStats : Boolean = Standard_True)
|
||||
returns Graph;
|
||||
---Purpose : Same as above, but the Library is defined through a Protocol
|
||||
|
||||
Create (amodel : InterfaceModel;theModeStats : Boolean = Standard_True) returns Graph;
|
||||
---Purpose : Same a above but works with the Protocol recorded in the Model
|
||||
|
||||
Create (agraph : Graph; copied : Boolean = Standard_False) returns Graph;
|
||||
---Purpose : Creates a Graph from another one, getting all its data
|
||||
-- Remark that status are copied from <agraph>, but the other
|
||||
-- lists (sharing/shared) are copied only if <copied> = True
|
||||
|
||||
|
||||
Evaluate (me : in out ) is static private;
|
||||
---Purpose : Performs the Evaluation of the Graph, from an initial Library,
|
||||
-- either defined through a Protocol, or given dierctly
|
||||
-- Called by the non-empty Constructors
|
||||
--
|
||||
-- Normally, gtool suffices. But if a Graph is created from a
|
||||
-- GeneralLib directly, it cannot be used
|
||||
-- If <gtool> is defined, it has priority
|
||||
|
||||
|
||||
Reset (me : in out) is static;
|
||||
---Purpose : Erases data, making graph ready to rebegin from void
|
||||
-- (also resets Shared lists redefinitions)
|
||||
|
||||
ResetStatus (me : in out) is static;
|
||||
---Purpose : Erases Status (Values and Flags of Presence), making graph
|
||||
-- ready to rebegin from void. Does not concerns Shared lists
|
||||
|
||||
Size (me) returns Integer is static;
|
||||
---Purpose : Returns size (max nb of entities, i.e. Model's nb of entities)
|
||||
|
||||
-- -- Fine Actions -- --
|
||||
|
||||
NbStatuses(me) returns Integer;
|
||||
---Purpose : Returns size of array of statuses
|
||||
|
||||
EntityNumber (me; ent : Transient) returns Integer is static;
|
||||
---Purpose : Returns the Number of the entity in the Map, computed at
|
||||
-- creation time (Entities loaded from the Model)
|
||||
-- Returns 0 if <ent> not contained by Model used to create <me>
|
||||
-- (that is, <ent> is unknown from <me>)
|
||||
|
||||
IsPresent (me; num : Integer) returns Boolean is static;
|
||||
---Purpose : Returns True if an Entity is noted as present in the graph
|
||||
-- (See methods Get... which determine this status)
|
||||
-- Returns False if <num> is out of range too
|
||||
|
||||
IsPresent (me; ent : Transient) returns Boolean;
|
||||
---Purpose : Same as above but directly on an Entity <ent> : if it is not
|
||||
-- contained in the Model, returns False. Else calls
|
||||
-- IsPresent(num) with <num> given by EntityNumber
|
||||
|
||||
Entity (me; num : Integer) returns any Transient is static;
|
||||
---Purpose : Returns mapped Entity given its no (if it is present)
|
||||
---C++ : return const &
|
||||
|
||||
Status (me; num : Integer) returns Integer is static;
|
||||
---Purpose : Returns Status associated to a numero (only to read it)
|
||||
|
||||
SetStatus (me : in out; num : Integer; stat : Integer) is static;
|
||||
---Purpose : Modifies Status associated to a numero
|
||||
|
||||
RemoveItem (me : in out; num : Integer) is static;
|
||||
---Purpose : Clears Entity and sets Status to 0, for a numero
|
||||
|
||||
ChangeStatus (me : in out; oldstat, newstat : Integer) is static;
|
||||
---Purpose : Changes all status which value is oldstat to new value newstat
|
||||
|
||||
RemoveStatus (me : in out; stat : Integer) is static;
|
||||
---Purpose : Removes all items of which status has a given value stat
|
||||
|
||||
BitMap (me) returns BitMap;
|
||||
---Purpose : Returns the Bit Map in order to read or edit flag values
|
||||
---C++ : return const &
|
||||
|
||||
CBitMap (me : in out) returns BitMap;
|
||||
---Purpose : Returns the Bit Map in order to edit it (add new flags)
|
||||
---C++ : return &
|
||||
|
||||
-- -- General Actions -- --
|
||||
|
||||
Model (me) returns InterfaceModel is static;
|
||||
---Purpose : Returns the Model with which this Graph was created
|
||||
---C++ : return const &
|
||||
|
||||
GetFromModel (me : in out) is static;
|
||||
---Purpose : Loads Graph with all Entities contained in the Model
|
||||
|
||||
GetFromEntity (me : in out; ent : Transient; shared : Boolean;
|
||||
newstat : Integer = 0) is static;
|
||||
---Purpose : Gets an Entity, plus its shared ones (at every level) if
|
||||
-- "shared" is True. New items are set to status "newstat"
|
||||
-- Items already present in graph remain unchanged
|
||||
-- Of course, redefinitions of Shared lists are taken into
|
||||
-- account if there are some
|
||||
|
||||
GetFromEntity (me : in out; ent : Transient; shared : Boolean;
|
||||
newstat, overlapstat : Integer; cumul : Boolean)
|
||||
is static;
|
||||
---Purpose : Gets an Entity, plus its shared ones (at every level) if
|
||||
-- "shared" is True. New items are set to status "newstat".
|
||||
-- Items already present in graph are processed as follows :
|
||||
-- - if they already have status "newstat", they remain unchanged
|
||||
-- - if they have another status, this one is modified :
|
||||
-- if cumul is True, to former status + overlapstat (cumul)
|
||||
-- if cumul is False, to overlapstat (enforce)
|
||||
|
||||
GetFromIter (me : in out; iter : EntityIterator; newstat : Integer)
|
||||
is static;
|
||||
---Purpose : Gets Entities given by an EntityIterator. Entities which were
|
||||
-- not yet present in the graph are mapped with status "newstat"
|
||||
-- Entities already present remain unchanged
|
||||
|
||||
GetFromIter (me : in out; iter : EntityIterator;
|
||||
newstat, overlapstat : Integer; cumul : Boolean)
|
||||
is static;
|
||||
---Purpose : Gets Entities given by an EntityIterator and distinguishes
|
||||
-- those already present in the Graph :
|
||||
-- - new entities added to the Graph with status "newstst"
|
||||
-- - entities already present with status = "newstat" remain
|
||||
-- unchanged
|
||||
-- - entities already present with status different form
|
||||
-- "newstat" have their status modified :
|
||||
-- if cumul is True, to former status + overlapstat (cumul)
|
||||
-- if cumul is False, to overlapstat (enforce)
|
||||
-- (Note : works as GetEntity, shared = False, for each entity)
|
||||
|
||||
GetFromGraph (me : in out; agraph : Graph)
|
||||
---Purpose : Gets all present items from another graph
|
||||
raises DomainError is static;
|
||||
-- Error if the other graph has not been created with same Model
|
||||
|
||||
GetFromGraph (me : in out; agraph : Graph; stat : Integer)
|
||||
---Purpose : Gets items from another graph which have a specific Status
|
||||
raises DomainError is static;
|
||||
-- Error if the other graph has not been created with same Model
|
||||
|
||||
-- -- Shared Lists -- --
|
||||
|
||||
HasShareErrors (me; ent : Transient) returns Boolean is static;
|
||||
---Purpose : Returns True if <ent> or the list of entities shared by <ent>
|
||||
-- (not redefined) contains items unknown from this Graph
|
||||
-- Remark : apart from the status HasShareError, these items
|
||||
-- are ignored
|
||||
|
||||
GetShareds(me; ent : Transient) returns HSequenceOfTransient;
|
||||
---Purpose : Returns the sequence of Entities Shared by an Entity
|
||||
|
||||
Shareds (me; ent : Transient) returns EntityIterator
|
||||
---Purpose : Returns the list of Entities Shared by an Entity, as recorded
|
||||
-- by the Graph. That is, by default Basic Shared List, else it
|
||||
-- can be redefined by methods SetShare, SetNoShare ... see below
|
||||
raises DomainError is static;
|
||||
-- Error if <ent> is not contained by the model used for Creation
|
||||
|
||||
|
||||
Sharings (me; ent : Transient) returns EntityIterator
|
||||
---Purpose : Returns the list of Entities which Share an Entity, computed
|
||||
-- from the Basic or Redefined Shared Lists
|
||||
raises DomainError is static;
|
||||
-- Error if <ent> is not contained by the model used for Creation
|
||||
|
||||
|
||||
GetSharings(me; ent : Transient) returns HSequenceOfTransient;
|
||||
---Purpose : Returns the sequence of Entities Sharings by an Entity
|
||||
|
||||
TypedSharings (me; ent : Transient; type : Type) returns EntityIterator;
|
||||
---Purpose : Returns the list of sharings entities, AT ANY LEVEL, which are
|
||||
-- kind of a given type. A sharing entity kind of this type
|
||||
-- ends the exploration of its branch
|
||||
|
||||
RootEntities (me) returns EntityIterator is static;
|
||||
---Purpose : Returns the Entities which are not Shared (their Sharing List
|
||||
-- is empty) in the Model
|
||||
|
||||
-- -- Redefinitions of Shared-Sharing Lists -- --
|
||||
|
||||
|
||||
Name (me; ent : Transient) returns HAsciiString;
|
||||
---Purpose : Determines the name attached to an entity, by using the
|
||||
-- general service Name in GeneralModule
|
||||
-- Returns a null handle if no name could be computed or if
|
||||
-- the entity is not in the model
|
||||
|
||||
|
||||
SharingTable (me) returns HArray1OfListOfInteger from TColStd; --HArray1OfTransient from TColStd ;
|
||||
---C++ : return const &
|
||||
---Purpose : Returns the Table of Sharing lists. Used to Create
|
||||
-- another Graph from <me>
|
||||
|
||||
InitStats(me : in out) is protected;
|
||||
---Purpose : Initialize statuses and flags
|
||||
|
||||
ModeStat(me) returns Boolean;
|
||||
---Purpose : Returns mode resposible for computation of statuses;
|
||||
|
||||
fields
|
||||
|
||||
themodel : InterfaceModel is protected ; -- Model which contains the Entities
|
||||
thepresents : AsciiString from TCollection is protected ; -- flags present/or not
|
||||
thestats : HArray1OfInteger from TColStd is protected; -- numeric status
|
||||
theflags : BitMap; -- logical flags status
|
||||
thesharings : HArray1OfListOfInteger from TColStd is protected; --HArray1OfTransient from TColStd is protected;
|
||||
|
||||
end Graph;
|
@@ -11,15 +11,23 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_Graph.ixx>
|
||||
|
||||
#include <Interface_BitMap.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GTool.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_ReportEntity.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <Interface_ShareTool.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||
#include <Interface_GTool.hxx>
|
||||
|
||||
// Flags : 0 = Presence, 1 = Sharing Error
|
||||
#define Graph_Present 0
|
||||
|
272
src/Interface/Interface_Graph.hxx
Normal file
272
src/Interface/Interface_Graph.hxx
Normal file
@@ -0,0 +1,272 @@
|
||||
// Created on: 1992-09-22
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_Graph_HeaderFile
|
||||
#define _Interface_Graph_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <Interface_BitMap.hxx>
|
||||
#include <TColStd_HArray1OfListOfInteger.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
class Interface_InterfaceModel;
|
||||
class Standard_DomainError;
|
||||
class Interface_GeneralLib;
|
||||
class Interface_Protocol;
|
||||
class Interface_GTool;
|
||||
class Standard_Transient;
|
||||
class Interface_BitMap;
|
||||
class Interface_EntityIterator;
|
||||
class TCollection_HAsciiString;
|
||||
|
||||
|
||||
//! Gives basic data structure for operating and storing
|
||||
//! graph results (usage is normally internal)
|
||||
//! Entities are Mapped according their Number in the Model
|
||||
//!
|
||||
//! Each Entity from the Model can be known as "Present" or
|
||||
//! not; if it is, it is Mapped with a Status : an Integer
|
||||
//! which can be used according to needs of each algorithm
|
||||
//! In addition, the Graph brings a BitMap which can be used
|
||||
//! by any caller
|
||||
//!
|
||||
//! Also, it is bound with two lists : a list of Shared
|
||||
//! Entities (in fact, their Numbers in the Model) which is
|
||||
//! filled by a ShareTool, and a list of Sharing Entities,
|
||||
//! computed by deduction from the Shared Lists
|
||||
//!
|
||||
//! Moreover, it is possible to redefine the list of Entities
|
||||
//! Shared by an Entity (instead of standard answer by general
|
||||
//! service Shareds) : this new list can be empty; it can
|
||||
//! be changed or reset (i.e. to come back to standard answer)
|
||||
class Interface_Graph
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an empty graph, ready to receive Entities from amodel
|
||||
//! Note that this way of Creation allows <me> to verify that
|
||||
//! Entities to work with are contained in <amodel>
|
||||
//! Basic Shared and Sharing lists are obtained from a General
|
||||
//! Services Library, given directly as an argument
|
||||
Standard_EXPORT Interface_Graph(const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib, const Standard_Boolean theModeStats = Standard_True);
|
||||
|
||||
//! Same as above, but the Library is defined through a Protocol
|
||||
Standard_EXPORT Interface_Graph(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol, const Standard_Boolean theModeStats = Standard_True);
|
||||
|
||||
//! Same as above, but the Library is defined through a Protocol
|
||||
Standard_EXPORT Interface_Graph(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_GTool)& gtool, const Standard_Boolean theModeStats = Standard_True);
|
||||
|
||||
//! Same a above but works with the Protocol recorded in the Model
|
||||
Standard_EXPORT Interface_Graph(const Handle(Interface_InterfaceModel)& amodel, const Standard_Boolean theModeStats = Standard_True);
|
||||
|
||||
//! Creates a Graph from another one, getting all its data
|
||||
//! Remark that status are copied from <agraph>, but the other
|
||||
//! lists (sharing/shared) are copied only if <copied> = True
|
||||
Standard_EXPORT Interface_Graph(const Interface_Graph& agraph, const Standard_Boolean copied = Standard_False);
|
||||
|
||||
//! Erases data, making graph ready to rebegin from void
|
||||
//! (also resets Shared lists redefinitions)
|
||||
Standard_EXPORT void Reset();
|
||||
|
||||
//! Erases Status (Values and Flags of Presence), making graph
|
||||
//! ready to rebegin from void. Does not concerns Shared lists
|
||||
Standard_EXPORT void ResetStatus();
|
||||
|
||||
//! Returns size (max nb of entities, i.e. Model's nb of entities)
|
||||
Standard_EXPORT Standard_Integer Size() const;
|
||||
|
||||
//! Returns size of array of statuses
|
||||
Standard_EXPORT Standard_Integer NbStatuses() const;
|
||||
|
||||
//! Returns the Number of the entity in the Map, computed at
|
||||
//! creation time (Entities loaded from the Model)
|
||||
//! Returns 0 if <ent> not contained by Model used to create <me>
|
||||
//! (that is, <ent> is unknown from <me>)
|
||||
Standard_EXPORT Standard_Integer EntityNumber (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns True if an Entity is noted as present in the graph
|
||||
//! (See methods Get... which determine this status)
|
||||
//! Returns False if <num> is out of range too
|
||||
Standard_EXPORT Standard_Boolean IsPresent (const Standard_Integer num) const;
|
||||
|
||||
//! Same as above but directly on an Entity <ent> : if it is not
|
||||
//! contained in the Model, returns False. Else calls
|
||||
//! IsPresent(num) with <num> given by EntityNumber
|
||||
Standard_EXPORT Standard_Boolean IsPresent (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns mapped Entity given its no (if it is present)
|
||||
Standard_EXPORT const Handle(Standard_Transient)& Entity (const Standard_Integer num) const;
|
||||
|
||||
//! Returns Status associated to a numero (only to read it)
|
||||
Standard_EXPORT Standard_Integer Status (const Standard_Integer num) const;
|
||||
|
||||
//! Modifies Status associated to a numero
|
||||
Standard_EXPORT void SetStatus (const Standard_Integer num, const Standard_Integer stat);
|
||||
|
||||
//! Clears Entity and sets Status to 0, for a numero
|
||||
Standard_EXPORT void RemoveItem (const Standard_Integer num);
|
||||
|
||||
//! Changes all status which value is oldstat to new value newstat
|
||||
Standard_EXPORT void ChangeStatus (const Standard_Integer oldstat, const Standard_Integer newstat);
|
||||
|
||||
//! Removes all items of which status has a given value stat
|
||||
Standard_EXPORT void RemoveStatus (const Standard_Integer stat);
|
||||
|
||||
//! Returns the Bit Map in order to read or edit flag values
|
||||
Standard_EXPORT const Interface_BitMap& BitMap() const;
|
||||
|
||||
//! Returns the Bit Map in order to edit it (add new flags)
|
||||
Standard_EXPORT Interface_BitMap& CBitMap();
|
||||
|
||||
//! Returns the Model with which this Graph was created
|
||||
Standard_EXPORT const Handle(Interface_InterfaceModel)& Model() const;
|
||||
|
||||
//! Loads Graph with all Entities contained in the Model
|
||||
Standard_EXPORT void GetFromModel();
|
||||
|
||||
//! Gets an Entity, plus its shared ones (at every level) if
|
||||
//! "shared" is True. New items are set to status "newstat"
|
||||
//! Items already present in graph remain unchanged
|
||||
//! Of course, redefinitions of Shared lists are taken into
|
||||
//! account if there are some
|
||||
Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent, const Standard_Boolean shared, const Standard_Integer newstat = 0);
|
||||
|
||||
//! Gets an Entity, plus its shared ones (at every level) if
|
||||
//! "shared" is True. New items are set to status "newstat".
|
||||
//! Items already present in graph are processed as follows :
|
||||
//! - if they already have status "newstat", they remain unchanged
|
||||
//! - if they have another status, this one is modified :
|
||||
//! if cumul is True, to former status + overlapstat (cumul)
|
||||
//! if cumul is False, to overlapstat (enforce)
|
||||
Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent, const Standard_Boolean shared, const Standard_Integer newstat, const Standard_Integer overlapstat, const Standard_Boolean cumul);
|
||||
|
||||
//! Gets Entities given by an EntityIterator. Entities which were
|
||||
//! not yet present in the graph are mapped with status "newstat"
|
||||
//! Entities already present remain unchanged
|
||||
Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter, const Standard_Integer newstat);
|
||||
|
||||
//! Gets Entities given by an EntityIterator and distinguishes
|
||||
//! those already present in the Graph :
|
||||
//! - new entities added to the Graph with status "newstst"
|
||||
//! - entities already present with status = "newstat" remain
|
||||
//! unchanged
|
||||
//! - entities already present with status different form
|
||||
//! "newstat" have their status modified :
|
||||
//! if cumul is True, to former status + overlapstat (cumul)
|
||||
//! if cumul is False, to overlapstat (enforce)
|
||||
//! (Note : works as GetEntity, shared = False, for each entity)
|
||||
Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter, const Standard_Integer newstat, const Standard_Integer overlapstat, const Standard_Boolean cumul);
|
||||
|
||||
//! Gets all present items from another graph
|
||||
Standard_EXPORT void GetFromGraph (const Interface_Graph& agraph);
|
||||
|
||||
//! Gets items from another graph which have a specific Status
|
||||
Standard_EXPORT void GetFromGraph (const Interface_Graph& agraph, const Standard_Integer stat);
|
||||
|
||||
//! Returns True if <ent> or the list of entities shared by <ent>
|
||||
//! (not redefined) contains items unknown from this Graph
|
||||
//! Remark : apart from the status HasShareError, these items
|
||||
//! are ignored
|
||||
Standard_EXPORT Standard_Boolean HasShareErrors (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns the sequence of Entities Shared by an Entity
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShareds (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns the list of Entities Shared by an Entity, as recorded
|
||||
//! by the Graph. That is, by default Basic Shared List, else it
|
||||
//! can be redefined by methods SetShare, SetNoShare ... see below
|
||||
Standard_EXPORT Interface_EntityIterator Shareds (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns the list of Entities which Share an Entity, computed
|
||||
//! from the Basic or Redefined Shared Lists
|
||||
Standard_EXPORT Interface_EntityIterator Sharings (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns the sequence of Entities Sharings by an Entity
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetSharings (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns the list of sharings entities, AT ANY LEVEL, which are
|
||||
//! kind of a given type. A sharing entity kind of this type
|
||||
//! ends the exploration of its branch
|
||||
Standard_EXPORT Interface_EntityIterator TypedSharings (const Handle(Standard_Transient)& ent, const Handle(Standard_Type)& type) const;
|
||||
|
||||
//! Returns the Entities which are not Shared (their Sharing List
|
||||
//! is empty) in the Model
|
||||
Standard_EXPORT Interface_EntityIterator RootEntities() const;
|
||||
|
||||
//! Determines the name attached to an entity, by using the
|
||||
//! general service Name in GeneralModule
|
||||
//! Returns a null handle if no name could be computed or if
|
||||
//! the entity is not in the model
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) Name (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns the Table of Sharing lists. Used to Create
|
||||
//! another Graph from <me>
|
||||
Standard_EXPORT const Handle(TColStd_HArray1OfListOfInteger)& SharingTable() const;
|
||||
|
||||
//! Returns mode resposible for computation of statuses;
|
||||
Standard_EXPORT Standard_Boolean ModeStat() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Initialize statuses and flags
|
||||
Standard_EXPORT void InitStats();
|
||||
|
||||
|
||||
Handle(Interface_InterfaceModel) themodel;
|
||||
TCollection_AsciiString thepresents;
|
||||
Handle(TColStd_HArray1OfInteger) thestats;
|
||||
Handle(TColStd_HArray1OfListOfInteger) thesharings;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Performs the Evaluation of the Graph, from an initial Library,
|
||||
//! either defined through a Protocol, or given dierctly
|
||||
//! Called by the non-empty Constructors
|
||||
//!
|
||||
//! Normally, gtool suffices. But if a Graph is created from a
|
||||
//! GeneralLib directly, it cannot be used
|
||||
//! If <gtool> is defined, it has priority
|
||||
Standard_EXPORT void Evaluate();
|
||||
|
||||
|
||||
Interface_BitMap theflags;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_Graph_HeaderFile
|
@@ -1,70 +0,0 @@
|
||||
-- Created on: 1992-09-23
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class GraphContent from Interface inherits EntityIterator
|
||||
|
||||
---Purpose : Defines general form for classes of graph algorithms on
|
||||
-- Interfaces, this form is that of EntityIterator
|
||||
-- Each sub-class fills it according to its own algorithm
|
||||
-- This also allows to combine any graph result to others,
|
||||
-- all being given under one unique form
|
||||
|
||||
uses Transient, Graph
|
||||
|
||||
is
|
||||
|
||||
Create returns GraphContent;
|
||||
---Purpose : Creates an empty GraphContent, ready to be filled
|
||||
|
||||
Create (agraph : Graph) returns GraphContent;
|
||||
---Purpose : Creates with all entities designated by a Graph
|
||||
|
||||
Create (agraph : Graph; stat : Integer) returns GraphContent;
|
||||
---Purpose : Creates with entities having specific Status value in a Graph
|
||||
|
||||
Create (agraph : Graph; ent : Transient) returns GraphContent;
|
||||
---Purpose : Creates an Iterator with Shared entities of an entity
|
||||
-- (equivalente to EntityIterator but with a Graph)
|
||||
|
||||
GetFromGraph (me : in out; agraph : Graph);
|
||||
---Purpose : Gets all Entities designated by a Graph (once created), adds
|
||||
-- them to those already recorded
|
||||
|
||||
GetFromGraph (me : in out; agraph : Graph; stat : Integer);
|
||||
---Purpose : Gets entities from a graph which have a specific Status value
|
||||
-- (one created), adds them to those already recorded
|
||||
|
||||
Result (me : in out) returns EntityIterator;
|
||||
---Purpose : Returns Result under the exact form of an EntityIterator :
|
||||
-- Can be used when EntityIterator itself is required (as a
|
||||
-- returned value for instance), whitout way for a sub-class
|
||||
|
||||
-- -- Evaluation - Iteration -- --
|
||||
-- Made by Start-More-Next-Value inherited from EntityIterator
|
||||
-- Start is redefined to call Evaluate moreover
|
||||
-- Default for Evaluate is given as doing nothing
|
||||
|
||||
-- Start (me : in out) is redefined;
|
||||
Begin (me : in out);
|
||||
---Purpose : Does the Evaluation before starting the iteration itself
|
||||
-- (in out)
|
||||
|
||||
Evaluate (me : in out) is virtual;
|
||||
---Purpose : Evaluates list of Entities to be iterated. Called by Start
|
||||
-- Default is set to doing nothing : intended to be redefined
|
||||
-- by each sub-class
|
||||
|
||||
end GraphContent;
|
@@ -11,11 +11,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_GraphContent.ixx>
|
||||
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_IntList.hxx>
|
||||
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
Interface_GraphContent::Interface_GraphContent () { }
|
||||
|
||||
|
101
src/Interface/Interface_GraphContent.hxx
Normal file
101
src/Interface/Interface_GraphContent.hxx
Normal file
@@ -0,0 +1,101 @@
|
||||
// Created on: 1992-09-23
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_GraphContent_HeaderFile
|
||||
#define _Interface_GraphContent_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Interface_Graph;
|
||||
class Standard_Transient;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! Defines general form for classes of graph algorithms on
|
||||
//! Interfaces, this form is that of EntityIterator
|
||||
//! Each sub-class fills it according to its own algorithm
|
||||
//! This also allows to combine any graph result to others,
|
||||
//! all being given under one unique form
|
||||
class Interface_GraphContent : public Interface_EntityIterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an empty GraphContent, ready to be filled
|
||||
Standard_EXPORT Interface_GraphContent();
|
||||
|
||||
//! Creates with all entities designated by a Graph
|
||||
Standard_EXPORT Interface_GraphContent(const Interface_Graph& agraph);
|
||||
|
||||
//! Creates with entities having specific Status value in a Graph
|
||||
Standard_EXPORT Interface_GraphContent(const Interface_Graph& agraph, const Standard_Integer stat);
|
||||
|
||||
//! Creates an Iterator with Shared entities of an entity
|
||||
//! (equivalente to EntityIterator but with a Graph)
|
||||
Standard_EXPORT Interface_GraphContent(const Interface_Graph& agraph, const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Gets all Entities designated by a Graph (once created), adds
|
||||
//! them to those already recorded
|
||||
Standard_EXPORT void GetFromGraph (const Interface_Graph& agraph);
|
||||
|
||||
//! Gets entities from a graph which have a specific Status value
|
||||
//! (one created), adds them to those already recorded
|
||||
Standard_EXPORT void GetFromGraph (const Interface_Graph& agraph, const Standard_Integer stat);
|
||||
|
||||
//! Returns Result under the exact form of an EntityIterator :
|
||||
//! Can be used when EntityIterator itself is required (as a
|
||||
//! returned value for instance), whitout way for a sub-class
|
||||
Standard_EXPORT Interface_EntityIterator Result();
|
||||
|
||||
//! Does the Evaluation before starting the iteration itself
|
||||
//! (in out)
|
||||
Standard_EXPORT void Begin();
|
||||
|
||||
//! Evaluates list of Entities to be iterated. Called by Start
|
||||
//! Default is set to doing nothing : intended to be redefined
|
||||
//! by each sub-class
|
||||
Standard_EXPORT virtual void Evaluate();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_GraphContent_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1993-04-22
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class HGraph from Interface inherits TShared
|
||||
|
||||
---Purpose : This class allows to store a redefinable Graph, via a Handle
|
||||
-- (usefull for an Object which can work on several successive
|
||||
-- Models, with the same general conditions)
|
||||
|
||||
uses Graph, InterfaceModel, GeneralLib, Protocol, GTool
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph) returns HGraph;
|
||||
---Purpose : Creates an HGraph directly from a Graph.
|
||||
-- Remark that the starting Graph is duplicated
|
||||
|
||||
Create (amodel : InterfaceModel; lib : GeneralLib;
|
||||
theModeStats : Boolean = Standard_True) returns HGraph;
|
||||
---Purpose : Creates an HGraph with a Graph created from <amodel> and <lib>
|
||||
|
||||
Create (amodel : InterfaceModel; protocol : Protocol from Interface;
|
||||
theModeStats : Boolean = Standard_True)
|
||||
returns HGraph;
|
||||
---Purpose : Creates an HGraph with a graph itself created from <amodel>
|
||||
-- and <protocol>
|
||||
|
||||
Create (amodel : InterfaceModel; gtool : GTool from Interface;
|
||||
theModeStats : Boolean = Standard_True)
|
||||
returns HGraph;
|
||||
---Purpose : Creates an HGraph with a graph itself created from <amodel>
|
||||
-- and <protocol>
|
||||
|
||||
Create (amodel : InterfaceModel;
|
||||
theModeStats : Boolean = Standard_True) returns HGraph
|
||||
---Purpose : Same a above, but works with the GTool in the model
|
||||
raises DomainError;
|
||||
-- Error if no Active Protocol is defined
|
||||
|
||||
Graph (me) returns Graph;
|
||||
---Purpose : Returns the Graph contained in <me>, for Read Only Operations
|
||||
-- Remark that it is returns as "const &"
|
||||
-- Getting it in a new variable instead of a reference would be
|
||||
-- a pitty, because all the graph's content would be duplicated
|
||||
---C++ : return const &
|
||||
|
||||
CGraph (me : mutable) returns Graph;
|
||||
---Purpose : Same as above, but for Read-Write Operations
|
||||
-- Then, The Graph will be modified in the HGraph itself
|
||||
---C++ : return &
|
||||
|
||||
fields
|
||||
|
||||
thegraph : Graph;
|
||||
|
||||
end HGraph;
|
@@ -11,8 +11,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_HGraph.ixx>
|
||||
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GTool.hxx>
|
||||
#include <Interface_HGraph.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Interface_HGraph::Interface_HGraph (const Interface_Graph& agraph)
|
||||
: thegraph(agraph) { }
|
||||
|
98
src/Interface/Interface_HGraph.hxx
Normal file
98
src/Interface/Interface_HGraph.hxx
Normal file
@@ -0,0 +1,98 @@
|
||||
// Created on: 1993-04-22
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_HGraph_HeaderFile
|
||||
#define _Interface_HGraph_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_DomainError;
|
||||
class Interface_Graph;
|
||||
class Interface_InterfaceModel;
|
||||
class Interface_GeneralLib;
|
||||
class Interface_Protocol;
|
||||
class Interface_GTool;
|
||||
|
||||
|
||||
class Interface_HGraph;
|
||||
DEFINE_STANDARD_HANDLE(Interface_HGraph, MMgt_TShared)
|
||||
|
||||
//! This class allows to store a redefinable Graph, via a Handle
|
||||
//! (usefull for an Object which can work on several successive
|
||||
//! Models, with the same general conditions)
|
||||
class Interface_HGraph : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an HGraph directly from a Graph.
|
||||
//! Remark that the starting Graph is duplicated
|
||||
Standard_EXPORT Interface_HGraph(const Interface_Graph& agraph);
|
||||
|
||||
//! Creates an HGraph with a Graph created from <amodel> and <lib>
|
||||
Standard_EXPORT Interface_HGraph(const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib, const Standard_Boolean theModeStats = Standard_True);
|
||||
|
||||
//! Creates an HGraph with a graph itself created from <amodel>
|
||||
//! and <protocol>
|
||||
Standard_EXPORT Interface_HGraph(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol, const Standard_Boolean theModeStats = Standard_True);
|
||||
|
||||
//! Creates an HGraph with a graph itself created from <amodel>
|
||||
//! and <protocol>
|
||||
Standard_EXPORT Interface_HGraph(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_GTool)& gtool, const Standard_Boolean theModeStats = Standard_True);
|
||||
|
||||
//! Same a above, but works with the GTool in the model
|
||||
Standard_EXPORT Interface_HGraph(const Handle(Interface_InterfaceModel)& amodel, const Standard_Boolean theModeStats = Standard_True);
|
||||
|
||||
//! Returns the Graph contained in <me>, for Read Only Operations
|
||||
//! Remark that it is returns as "const &"
|
||||
//! Getting it in a new variable instead of a reference would be
|
||||
//! a pitty, because all the graph's content would be duplicated
|
||||
Standard_EXPORT const Interface_Graph& Graph() const;
|
||||
|
||||
//! Same as above, but for Read-Write Operations
|
||||
//! Then, The Graph will be modified in the HGraph itself
|
||||
Standard_EXPORT Interface_Graph& CGraph();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_HGraph,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Interface_Graph thegraph;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_HGraph_HeaderFile
|
@@ -1,131 +0,0 @@
|
||||
-- Created on: 1995-05-12
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class IntList from Interface
|
||||
|
||||
---Purpose : This class detains the data which describe a Graph. A Graph
|
||||
-- has two lists, one for shared refs, one for sharing refs
|
||||
-- (the reverses). Each list comprises, for each Entity of the
|
||||
-- Model of the Graph, a list of Entities (shared or sharing).
|
||||
-- In fact, entities are identified by their numbers in the Model
|
||||
-- or Graph : this gives better performances.
|
||||
--
|
||||
-- A simple way to implement this is to instantiate a HArray1
|
||||
-- with a HSequenceOfInteger : each Entity Number designates a
|
||||
-- value, which is a Sequence (if it is null, it is considered as
|
||||
-- empty : this is a little optimisation).
|
||||
--
|
||||
-- This class gives a more efficient way to implement this.
|
||||
-- It has two lists (two arrays of integers), one to describe
|
||||
-- list (empty, one value given immediately, or negated index in
|
||||
-- the second list), one to store refs (pointed from the first
|
||||
-- list). This is much more efficient than a list of sequences,
|
||||
-- in terms of speed (especially for read) and of memory
|
||||
--
|
||||
-- An IntList can also be set to access data for a given entity
|
||||
-- number, it then acts as a single sequence
|
||||
--
|
||||
-- Remark that if an IntList is created from another one, it can
|
||||
-- be read, but if it is created without copying, it may not be
|
||||
-- edited
|
||||
|
||||
uses HArray1OfInteger
|
||||
|
||||
is
|
||||
Create returns IntList;
|
||||
---Purpose :Creates empty IntList.
|
||||
|
||||
|
||||
|
||||
Create (nbe : Integer) returns IntList;
|
||||
---Purpose : Creates an IntList for <nbe> entities
|
||||
|
||||
Create (other : IntList; copied : Boolean) returns IntList;
|
||||
---Purpose : Creates an IntList from another one.
|
||||
-- if <copied> is True, copies data
|
||||
-- else, data are not copied, only the header object is
|
||||
Initialize(me : in out;nbe : Integer);
|
||||
---Purpose :Initialize IntList by number of entities.
|
||||
Internals (me; nbrefs : out Integer; ents, refs : out HArray1OfInteger);
|
||||
---Purpose : Returns internal values, used for copying
|
||||
|
||||
NbEntities (me) returns Integer;
|
||||
---Purpose : Returns count of entities to be aknowledged
|
||||
|
||||
SetNbEntities (me : in out; nbe : Integer);
|
||||
---Purpose : Changes the count of entities (ignored if decreased)
|
||||
|
||||
SetNumber (me : in out; number : Integer);
|
||||
---Purpose : Sets an entity number as current (for read and fill)
|
||||
|
||||
Number (me) returns Integer;
|
||||
---Purpose : Returns the current entity number
|
||||
|
||||
List (me; number : Integer; copied : Boolean = Standard_False) returns IntList;
|
||||
---Purpose : Returns an IntList, identical to <me> but set to a specified
|
||||
-- entity Number
|
||||
-- By default, not copied (in order to be read)
|
||||
-- Specified <copied> to produce another list and edit it
|
||||
|
||||
SetRedefined (me : in out; mode : Boolean);
|
||||
---Purpose : Sets current entity list to be redefined or not
|
||||
-- This is used in a Graph for redefinition list : it can be
|
||||
-- disable (no redefinition, i.e. list is cleared), or enabled
|
||||
-- (starts as empty). The original list has not to be "redefined"
|
||||
|
||||
Reservate (me : in out; count : Integer);
|
||||
---Purpose : Makes a reservation for <count> references to be later
|
||||
-- attached to the current entity. If required, it increases
|
||||
-- the size of array used to store refs. Remark that if count is
|
||||
-- less than two, it does nothing (because immediate storing)
|
||||
|
||||
Add (me : in out; ref : Integer);
|
||||
---Purpose : Adds a reference (as an integer value, an entity number) to
|
||||
-- the current entity number. Zero is ignored
|
||||
|
||||
Length (me) returns Integer;
|
||||
---Purpose : Returns the count of refs attached to current entity number
|
||||
|
||||
IsRedefined (me; num : Integer = 0) returns Boolean;
|
||||
---Purpose : Returns True if the list for a number (default is taken as
|
||||
-- current) is "redefined" (usefull for empty list)
|
||||
|
||||
Value (me; num : Integer) returns Integer;
|
||||
---Purpose : Returns a reference number in the list for current number,
|
||||
-- according to its rank
|
||||
|
||||
Remove (me : in out; num : Integer) returns Boolean;
|
||||
---Purpose : Removes an item in the list for current number, given its rank
|
||||
-- Returns True if done, False else
|
||||
|
||||
Clear (me : in out);
|
||||
---Purpose : Clears all data, hence each entity number has an empty list
|
||||
|
||||
AdjustSize (me : in out; margin : Integer = 0);
|
||||
---Purpose : Resizes lists to exact sizes. For list of refs, a positive
|
||||
-- margin can be added.
|
||||
|
||||
fields
|
||||
|
||||
thenbe : Integer;
|
||||
thenbr : Integer;
|
||||
thenum : Integer; -- for current entity number :
|
||||
thecount : Integer;
|
||||
therank : Integer;
|
||||
theents : HArray1OfInteger;
|
||||
therefs : HArray1OfInteger;
|
||||
|
||||
end IntList;
|
@@ -12,7 +12,8 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//szv#4 S4163
|
||||
#include <Interface_IntList.ixx>
|
||||
|
||||
#include <Interface_IntList.hxx>
|
||||
|
||||
// Organisation des donnees :
|
||||
// theents vaut : 0 pas de reference
|
||||
@@ -23,13 +24,11 @@
|
||||
// de <rank>+1 a <rank>+nb , <rank>+1 a <rank>+nb-1 sont negatifs et
|
||||
// <rank>+nb est negatif
|
||||
// un zero signifie : place libre
|
||||
|
||||
// Pre-reservation : <rank> note le nombre courant, en positif strict
|
||||
// Il faut alors l incrementer a chaque ajout
|
||||
// Usage contextuel, il faut demander SetNumber(num < 0) pour exploiter cette
|
||||
// info et Add(ref < 0) pour la gerer.
|
||||
// Si elle n est pas presente, on bascule en mode courant
|
||||
|
||||
Interface_IntList::Interface_IntList ()
|
||||
{
|
||||
thenbe = thenbr = thenum = thecount = therank = 0;
|
||||
|
164
src/Interface/Interface_IntList.hxx
Normal file
164
src/Interface/Interface_IntList.hxx
Normal file
@@ -0,0 +1,164 @@
|
||||
// Created on: 1995-05-12
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_IntList_HeaderFile
|
||||
#define _Interface_IntList_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
|
||||
//! This class detains the data which describe a Graph. A Graph
|
||||
//! has two lists, one for shared refs, one for sharing refs
|
||||
//! (the reverses). Each list comprises, for each Entity of the
|
||||
//! Model of the Graph, a list of Entities (shared or sharing).
|
||||
//! In fact, entities are identified by their numbers in the Model
|
||||
//! or Graph : this gives better performances.
|
||||
//!
|
||||
//! A simple way to implement this is to instantiate a HArray1
|
||||
//! with a HSequenceOfInteger : each Entity Number designates a
|
||||
//! value, which is a Sequence (if it is null, it is considered as
|
||||
//! empty : this is a little optimisation).
|
||||
//!
|
||||
//! This class gives a more efficient way to implement this.
|
||||
//! It has two lists (two arrays of integers), one to describe
|
||||
//! list (empty, one value given immediately, or negated index in
|
||||
//! the second list), one to store refs (pointed from the first
|
||||
//! list). This is much more efficient than a list of sequences,
|
||||
//! in terms of speed (especially for read) and of memory
|
||||
//!
|
||||
//! An IntList can also be set to access data for a given entity
|
||||
//! number, it then acts as a single sequence
|
||||
//!
|
||||
//! Remark that if an IntList is created from another one, it can
|
||||
//! be read, but if it is created without copying, it may not be
|
||||
//! edited
|
||||
class Interface_IntList
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates empty IntList.
|
||||
Standard_EXPORT Interface_IntList();
|
||||
|
||||
//! Creates an IntList for <nbe> entities
|
||||
Standard_EXPORT Interface_IntList(const Standard_Integer nbe);
|
||||
|
||||
//! Creates an IntList from another one.
|
||||
//! if <copied> is True, copies data
|
||||
//! else, data are not copied, only the header object is
|
||||
Standard_EXPORT Interface_IntList(const Interface_IntList& other, const Standard_Boolean copied);
|
||||
|
||||
//! Initialize IntList by number of entities.
|
||||
Standard_EXPORT void Initialize (const Standard_Integer nbe);
|
||||
|
||||
//! Returns internal values, used for copying
|
||||
Standard_EXPORT void Internals (Standard_Integer& nbrefs, Handle(TColStd_HArray1OfInteger)& ents, Handle(TColStd_HArray1OfInteger)& refs) const;
|
||||
|
||||
//! Returns count of entities to be aknowledged
|
||||
Standard_EXPORT Standard_Integer NbEntities() const;
|
||||
|
||||
//! Changes the count of entities (ignored if decreased)
|
||||
Standard_EXPORT void SetNbEntities (const Standard_Integer nbe);
|
||||
|
||||
//! Sets an entity number as current (for read and fill)
|
||||
Standard_EXPORT void SetNumber (const Standard_Integer number);
|
||||
|
||||
//! Returns the current entity number
|
||||
Standard_EXPORT Standard_Integer Number() const;
|
||||
|
||||
//! Returns an IntList, identical to <me> but set to a specified
|
||||
//! entity Number
|
||||
//! By default, not copied (in order to be read)
|
||||
//! Specified <copied> to produce another list and edit it
|
||||
Standard_EXPORT Interface_IntList List (const Standard_Integer number, const Standard_Boolean copied = Standard_False) const;
|
||||
|
||||
//! Sets current entity list to be redefined or not
|
||||
//! This is used in a Graph for redefinition list : it can be
|
||||
//! disable (no redefinition, i.e. list is cleared), or enabled
|
||||
//! (starts as empty). The original list has not to be "redefined"
|
||||
Standard_EXPORT void SetRedefined (const Standard_Boolean mode);
|
||||
|
||||
//! Makes a reservation for <count> references to be later
|
||||
//! attached to the current entity. If required, it increases
|
||||
//! the size of array used to store refs. Remark that if count is
|
||||
//! less than two, it does nothing (because immediate storing)
|
||||
Standard_EXPORT void Reservate (const Standard_Integer count);
|
||||
|
||||
//! Adds a reference (as an integer value, an entity number) to
|
||||
//! the current entity number. Zero is ignored
|
||||
Standard_EXPORT void Add (const Standard_Integer ref);
|
||||
|
||||
//! Returns the count of refs attached to current entity number
|
||||
Standard_EXPORT Standard_Integer Length() const;
|
||||
|
||||
//! Returns True if the list for a number (default is taken as
|
||||
//! current) is "redefined" (usefull for empty list)
|
||||
Standard_EXPORT Standard_Boolean IsRedefined (const Standard_Integer num = 0) const;
|
||||
|
||||
//! Returns a reference number in the list for current number,
|
||||
//! according to its rank
|
||||
Standard_EXPORT Standard_Integer Value (const Standard_Integer num) const;
|
||||
|
||||
//! Removes an item in the list for current number, given its rank
|
||||
//! Returns True if done, False else
|
||||
Standard_EXPORT Standard_Boolean Remove (const Standard_Integer num);
|
||||
|
||||
//! Clears all data, hence each entity number has an empty list
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Resizes lists to exact sizes. For list of refs, a positive
|
||||
//! margin can be added.
|
||||
Standard_EXPORT void AdjustSize (const Standard_Integer margin = 0);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Integer thenbe;
|
||||
Standard_Integer thenbr;
|
||||
Standard_Integer thenum;
|
||||
Standard_Integer thecount;
|
||||
Standard_Integer therank;
|
||||
Handle(TColStd_HArray1OfInteger) theents;
|
||||
Handle(TColStd_HArray1OfInteger) therefs;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_IntList_HeaderFile
|
@@ -1,36 +0,0 @@
|
||||
-- Created on: 1997-09-03
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class IntVal from Interface inherits TShared from MMgt
|
||||
|
||||
---Purpose : An Integer through a Handle (i.e. managed as TShared)
|
||||
|
||||
uses Integer
|
||||
|
||||
is
|
||||
|
||||
Create returns IntVal;
|
||||
|
||||
Value (me) returns Integer;
|
||||
|
||||
CValue (me : mutable) returns Integer;
|
||||
---C++ : return &
|
||||
|
||||
fields
|
||||
|
||||
theval : Integer;
|
||||
|
||||
end IntVal;
|
@@ -11,7 +11,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_IntVal.ixx>
|
||||
|
||||
#include <Interface_IntVal.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Interface_IntVal::Interface_IntVal () { theval = 0; }
|
||||
|
||||
|
67
src/Interface/Interface_IntVal.hxx
Normal file
67
src/Interface/Interface_IntVal.hxx
Normal file
@@ -0,0 +1,67 @@
|
||||
// Created on: 1997-09-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_IntVal_HeaderFile
|
||||
#define _Interface_IntVal_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
|
||||
|
||||
class Interface_IntVal;
|
||||
DEFINE_STANDARD_HANDLE(Interface_IntVal, MMgt_TShared)
|
||||
|
||||
//! An Integer through a Handle (i.e. managed as TShared)
|
||||
class Interface_IntVal : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT Interface_IntVal();
|
||||
|
||||
Standard_EXPORT Standard_Integer Value() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer& CValue();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_IntVal,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Integer theval;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_IntVal_HeaderFile
|
37
src/Interface/Interface_InterfaceError.hxx
Normal file
37
src/Interface/Interface_InterfaceError.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_InterfaceError_HeaderFile
|
||||
#define _Interface_InterfaceError_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
|
||||
class Interface_InterfaceError;
|
||||
DEFINE_STANDARD_HANDLE(Interface_InterfaceError, Standard_Failure)
|
||||
|
||||
#if !defined No_Exception && !defined No_Interface_InterfaceError
|
||||
#define Interface_InterfaceError_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Interface_InterfaceError::Raise(MESSAGE);
|
||||
#else
|
||||
#define Interface_InterfaceError_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Interface_InterfaceError, Standard_Failure)
|
||||
|
||||
#endif // _Interface_InterfaceError_HeaderFile
|
37
src/Interface/Interface_InterfaceMismatch.hxx
Normal file
37
src/Interface/Interface_InterfaceMismatch.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_InterfaceMismatch_HeaderFile
|
||||
#define _Interface_InterfaceMismatch_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Interface_InterfaceError.hxx>
|
||||
|
||||
class Interface_InterfaceMismatch;
|
||||
DEFINE_STANDARD_HANDLE(Interface_InterfaceMismatch, Interface_InterfaceError)
|
||||
|
||||
#if !defined No_Exception && !defined No_Interface_InterfaceMismatch
|
||||
#define Interface_InterfaceMismatch_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Interface_InterfaceMismatch::Raise(MESSAGE);
|
||||
#else
|
||||
#define Interface_InterfaceMismatch_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Interface_InterfaceMismatch, Interface_InterfaceError)
|
||||
|
||||
#endif // _Interface_InterfaceMismatch_HeaderFile
|
@@ -1,449 +0,0 @@
|
||||
-- Created by: Christian CAILLET <cky@phobox>
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- Modified : David Carbonel Mon 4 january 1999
|
||||
-- Add of DENumber function. no. and of PrintToLog
|
||||
|
||||
|
||||
deferred class InterfaceModel from Interface inherits TShared
|
||||
|
||||
---Purpose : Defines an (Indexed) Set of data corresponding to a complete
|
||||
-- Transfer by a File Interface, i.e. File Header and Transient
|
||||
-- Entities (Objects) contained in a File. Contained Entities are
|
||||
-- identified in the Model by unique and consecutive Numbers.
|
||||
--
|
||||
-- In addition, a Model can attach to each entity, a specific
|
||||
-- Label according to the norm (e.g. Name for VDA, #ident for
|
||||
-- Step ...), intended to be output on a string or a stream
|
||||
-- (remark : labels are not obliged to be unique)
|
||||
--
|
||||
-- InterfaceModel itself is not Transient, it is intended to
|
||||
-- work on a set of Transient Data. The services offered are
|
||||
-- basic Listing and Identification operations on Transient
|
||||
-- Entities, storage of Error Reports, Copying.
|
||||
--
|
||||
-- Moreovere, it is possible to define and use templates. These
|
||||
-- are empty Models, from which copies can be obtained in order
|
||||
-- to be filled with effective data. This allows to record
|
||||
-- standard definitions for headers, avoiding to recreate them
|
||||
-- for each sendings, and assuring customisation of produced
|
||||
-- files for a given site.
|
||||
-- A template is attached to a name. It is possible to define a
|
||||
-- template from another one (get it, edit it then record it
|
||||
-- under another name).
|
||||
--
|
||||
-- See also Graph, ShareTool, CheckTool for more
|
||||
|
||||
uses Transient, IndexedMapOfTransient,
|
||||
DataMapOfIntegerTransient from TColStd,
|
||||
HAsciiString from TCollection,
|
||||
HSequenceOfHAsciiString from TColStd,
|
||||
Messenger from Message,
|
||||
ReportEntity, Check, CheckIterator,
|
||||
EntityIterator, GeneralLib, Protocol, GTool,
|
||||
DataState
|
||||
|
||||
raises OutOfRange, NoSuchObject, InterfaceMismatch
|
||||
|
||||
is
|
||||
|
||||
Initialize;
|
||||
---Purpose : Defines empty InterfaceModel, ready to be filled
|
||||
|
||||
Destroy (me : mutable);
|
||||
---Purpose : Clears the list of entities (service WhenDelete)
|
||||
---C++ : alias ~
|
||||
|
||||
SetProtocol (me : mutable; proto : Protocol from Interface);
|
||||
---Purpose : Sets a Protocol for this Model
|
||||
-- It is also set by a call to AddWithRefs with Protocol
|
||||
-- It is used for : DumpHeader (as required), ClearEntities ...
|
||||
|
||||
Protocol (me) returns Protocol from Interface is virtual;
|
||||
---Purpose : Returns the Protocol which has been set by SetProtocol, or
|
||||
-- AddWithRefs with Protocol
|
||||
|
||||
SetGTool (me : mutable; gtool : GTool from Interface);
|
||||
---Purpose : Sets a GTool for this model, which already defines a Protocol
|
||||
|
||||
GTool (me) returns GTool;
|
||||
---Purpose : Returns the GTool, set by SetProtocol or by SetGTool
|
||||
|
||||
DispatchStatus (me : mutable) returns Boolean;
|
||||
---Purpose : Returns the Dispatch Status, either for get or set
|
||||
-- A Model which is produced from Dispatch may share entities
|
||||
-- with the original (according to the Protocol), hence these
|
||||
-- non-copied entities should not be deleted
|
||||
---C++ : return &
|
||||
|
||||
Clear (me : mutable) is virtual;
|
||||
---Purpose : Erases contained data; used when a Model is copied to others :
|
||||
-- the new copied ones begin from clear
|
||||
-- Clear calls specific method ClearHeader (see below)
|
||||
|
||||
ClearEntities (me : mutable) is virtual;
|
||||
---Purpose : Clears the entities; uses the general service WhenDelete, in
|
||||
-- addition to the standard Memory Manager; can be redefined
|
||||
|
||||
ClearLabels (me : mutable) is deferred;
|
||||
---Purpose : Erases informations about labels, if any : specific to each
|
||||
-- norm
|
||||
|
||||
ClearHeader (me : mutable) is deferred;
|
||||
---Purpose : Clears Model's header : specific to each norm
|
||||
|
||||
-- -- Unitary Accesses to Entities -- --
|
||||
|
||||
NbEntities (me) returns Integer;
|
||||
---Purpose : Returns count of contained Entities
|
||||
|
||||
Contains (me; anentity : Transient) returns Boolean;
|
||||
---Purpose : Returns True if a Model contains an Entity (for a ReportEntity,
|
||||
-- looks for the ReportEntity itself AND its Concerned Entity)
|
||||
|
||||
Number (me; anentity : Transient) returns Integer;
|
||||
---Purpose : Returns the Number of an Entity in the Model if it contains it.
|
||||
-- Else returns 0. For a ReportEntity, looks at Concerned Entity.
|
||||
|
||||
-- DENumber (me; anentity : Transient) returns Integer;
|
||||
---Purpose : Returns the Directory entry Number of an Entity in
|
||||
-- the Model if it contains it. Else returns 0. For a
|
||||
-- ReportEntity, looks at Concerned Entity.
|
||||
|
||||
Value (me; num : Integer) returns Transient raises OutOfRange;
|
||||
---Purpose : Returns an Entity identified by its number in the Model
|
||||
-- Each sub-class of InterfaceModel can define its own method
|
||||
-- Entity to return its specific class of Entity (e.g. for VDA,
|
||||
-- VDAModel returns a VDAEntity), working by calling Value
|
||||
-- Remark : For a Reported Entity, (Erroneous, Corrected, Unknown), this
|
||||
-- method returns this Reported Entity.
|
||||
-- See ReportEntity for other questions.
|
||||
---C++ : return const &
|
||||
|
||||
NbTypes (me; ent : Transient) returns Integer;
|
||||
---Purpose : Returns the count of DISTINCT types under which an entity may
|
||||
-- be processed. Defined by the Protocol, which gives default as
|
||||
-- 1 (dynamic Type).
|
||||
|
||||
Type (me; ent : Transient; num : Integer = 1) returns Type;
|
||||
---Purpose : Returns a type, given its rank : defined by the Protocol
|
||||
-- (by default, the first one)
|
||||
|
||||
TypeName (me; ent : Transient; complete : Boolean = Standard_True)
|
||||
returns CString;
|
||||
---Purpose : Returns the type name of an entity, from the list of types
|
||||
-- (one or more ...)
|
||||
-- <complete> True (D) gives the complete type, else packages are
|
||||
-- removed
|
||||
-- WARNING : buffered, to be immediately copied or printed
|
||||
|
||||
ClassName (myclass; typnam : CString) returns CString;
|
||||
---Purpose : From a CDL Type Name, returns the Class part (package dropped)
|
||||
-- WARNING : buffered, to be immediately copied or printed
|
||||
|
||||
-- -- Report Entities (for syntactic concerns) -- --
|
||||
|
||||
EntityState (me; num : Integer) returns DataState raises OutOfRange;
|
||||
---Purpose : Returns the State of an entity, given its number
|
||||
|
||||
IsReportEntity (me; num : Integer; semantic : Boolean = Standard_False)
|
||||
returns Boolean raises OutOfRange;
|
||||
---Purpose : Returns True if <num> identifies a ReportEntity in the Model
|
||||
-- Hence, ReportEntity can be called.
|
||||
--
|
||||
-- By default, queries main report, if <semantic> is True, it
|
||||
-- queries report for semantic check
|
||||
--
|
||||
-- Remember that a Report Entity can be defined for an Unknown
|
||||
-- Entity, or a Corrected or Erroneous (at read time) Entity.
|
||||
-- The ReportEntity is defined before call to method AddEntity.
|
||||
|
||||
ReportEntity (me; num : Integer; semantic : Boolean = Standard_False)
|
||||
returns ReportEntity
|
||||
---Purpose : Returns a ReportEntity identified by its number in the Model,
|
||||
-- or a Null Handle If <num> does not identify a ReportEntity.
|
||||
--
|
||||
-- By default, queries main report, if <semantic> is True, it
|
||||
-- queries report for semantic check
|
||||
raises OutOfRange;
|
||||
-- Error if <num> is out of range
|
||||
|
||||
IsErrorEntity (me; num : Integer) returns Boolean raises OutOfRange;
|
||||
---Purpose : Returns True if <num> identifies an Error Entity : in this
|
||||
-- case, a ReportEntity brings Fail Messages and possibly an
|
||||
-- "undefined" Content, see IsRedefinedEntity
|
||||
|
||||
IsRedefinedContent (me; num : Integer) returns Boolean raises OutOfRange;
|
||||
---Purpose : Returns True if <num> identifies an Entity which content is
|
||||
-- redefined through a ReportEntity (i.e. with literal data only)
|
||||
-- This happens when an entity is syntactically erroneous in the
|
||||
-- way that its basic content remains empty.
|
||||
-- For more details (such as content itself), see ReportEntity
|
||||
|
||||
ClearReportEntity (me : mutable; num : Integer) returns Boolean
|
||||
---Purpose : Removes the ReportEntity attached to Entity <num>. Returns
|
||||
-- True if done, False if no ReportEntity was attached to <num>.
|
||||
-- Warning : the caller must assume that this clearing is meaningfull
|
||||
raises OutOfRange;
|
||||
-- Error if <num> is out of range
|
||||
|
||||
SetReportEntity (me : mutable; num : Integer; rep : ReportEntity)
|
||||
returns Boolean
|
||||
---Purpose : Sets or Replaces a ReportEntity for the Entity <num>. Returns
|
||||
-- True if Report is replaced, False if it has been replaced
|
||||
-- Warning : the caller must assume that this setting is meaningfull
|
||||
raises OutOfRange, InterfaceMismatch;
|
||||
-- Error if <num> is out of range, or if concerned Entity is
|
||||
-- not equal to Value(num)
|
||||
|
||||
AddReportEntity (me : mutable; rep : ReportEntity;
|
||||
semantic : Boolean = Standard_False) returns Boolean;
|
||||
---Purpose : Adds a ReportEntity as such. Returns False if the concerned
|
||||
-- entity is not recorded in the Model
|
||||
-- Else, adds it into, either the main report list or the
|
||||
-- list for semantic checks, then returns True
|
||||
|
||||
IsUnknownEntity (me; num : Integer) returns Boolean raises OutOfRange;
|
||||
---Purpose : Returns True if <num> identifies an Unknown Entity : in this
|
||||
-- case, a ReportEntity with no Check Messages designates it.
|
||||
|
||||
-- -- Checks (semantic & syntactic) -- --
|
||||
|
||||
FillSemanticChecks (me : mutable; checks : CheckIterator;
|
||||
clear : Boolean = Standard_True);
|
||||
---Purpose : Fills the list of semantic checks.
|
||||
-- This list is computed (by CheckTool). Hence, it can be stored
|
||||
-- in the model for later queries
|
||||
-- <clear> True (D) : new list replaces
|
||||
-- <clear> False : new list is cumulated
|
||||
|
||||
HasSemanticChecks (me) returns Boolean;
|
||||
---Purpose : Returns True if semantic checks have been filled
|
||||
|
||||
Check (me; num : Integer; syntactic : Boolean) returns Check;
|
||||
---Purpose : Returns the check attached to an entity, designated by its
|
||||
-- Number. 0 for global check
|
||||
-- <semantic> True : recorded semantic check
|
||||
-- <semantic> False : recorded syntactic check (see ReportEntity)
|
||||
-- If no check is recorded for <num>, returns an empty Check
|
||||
---C++ : return const &
|
||||
|
||||
-- -- Editions -- --
|
||||
|
||||
Reservate (me : mutable; nbent : Integer) is virtual;
|
||||
---Purpose : Does a reservation for the List of Entities (for optimized
|
||||
-- storage management). If it is not called, storage management
|
||||
-- can be less efficient. <nbent> is the expected count of
|
||||
-- Entities to store
|
||||
|
||||
AddEntity (me : mutable; anentity : Transient)
|
||||
---Purpose : Internal method for adding an Entity. Used by file reading
|
||||
-- (defined by each Interface) and Transfer tools. It adds the
|
||||
-- entity required to be added, not its refs : see AddWithRefs.
|
||||
-- If <anentity> is a ReportEntity, it is added to the list of
|
||||
-- Reports, its Concerned Entity (Erroneous or Corrected, else
|
||||
-- Unknown) is added to the list of Entities.
|
||||
-- That is, the ReportEntity must be created before Adding
|
||||
raises InterfaceMismatch is virtual;
|
||||
-- Error if anentity already recorded
|
||||
|
||||
AddWithRefs (me : mutable; anent : Transient; proto : Protocol;
|
||||
level : Integer = 0; listall : Boolean = Standard_False);
|
||||
---Purpose : Adds to the Model, an Entity with all its References, as they
|
||||
-- are defined by General Services FillShared and ListImplied.
|
||||
-- Process is recursive (any sub-levels) if <level> = 0 (Default)
|
||||
-- Else, adds sub-entities until the required sub-level.
|
||||
-- Especially, if <level> = 1, adds immediate subs and that's all
|
||||
--
|
||||
-- If <listall> is False (Default), an entity (<anentity> itself
|
||||
-- or one of its subs at any level) which is already recorded in
|
||||
-- the Model is not analysed, only the newly added ones are.
|
||||
-- If <listall> is True, all items are analysed (this allows to
|
||||
-- ensure the consistency of an adding made by steps)
|
||||
|
||||
AddWithRefs (me : mutable; anent : Transient;
|
||||
level : Integer = 0; listall : Boolean = Standard_False)
|
||||
---Purpose : Same as above, but works with the Protocol of the Model
|
||||
raises InterfaceMismatch;
|
||||
-- Error if no Protocol is defined in the Model
|
||||
|
||||
AddWithRefs (me : mutable; anent : Transient; lib : GeneralLib;
|
||||
level : Integer = 0; listall : Boolean = Standard_False);
|
||||
---Purpose : Same as above, but works with an already created GeneralLib
|
||||
|
||||
|
||||
ReplaceEntity (me : mutable; nument : Integer; anent : Transient);
|
||||
---Purpose : Replace Entity with Number=nument on other entity - "anent"
|
||||
|
||||
ReverseOrders (me : mutable; after : Integer = 0);
|
||||
---Purpose : Reverses the Numbers of the Entities, between <after> and the
|
||||
-- total count of Entities. Thus, the entities :
|
||||
-- 1,2 ... after, after+1 ... nb-1, nb become numbered as :
|
||||
-- 1,2 ... after, nb, nb-1 ... after+1
|
||||
-- By default (after = 0) the whole list of Entities is reversed
|
||||
|
||||
ChangeOrder (me : mutable; oldnum, newnum : Integer; count : Integer = 1)
|
||||
---Purpose : Changes the Numbers of some Entities : <oldnum> is moved to
|
||||
-- <newnum>, same for <count> entities. Thus :
|
||||
-- 1,2 ... newnum-1 newnum ... oldnum .. oldnum+count oldnum+count+1 .. gives
|
||||
-- 1,2 ... newnum-1 oldnum .. oldnum+count newnum ... oldnum+count+1
|
||||
-- (can be seen as a circular permutation)
|
||||
raises OutOfRange;
|
||||
-- Error if one of <oldnum,newnum, and + count> is out of range,
|
||||
-- or if <count> is greater than Abs(newnum-oldnum)
|
||||
|
||||
GetFromTransfer (me : mutable; aniter : EntityIterator)
|
||||
---Purpose : Gets contents from an EntityIterator, prepared by a
|
||||
-- Transfer tool (e.g TransferCopy). Starts from clear
|
||||
raises InterfaceMismatch;
|
||||
-- Error if InterfaceEntities to get are not free
|
||||
|
||||
GetFromAnother (me : mutable; other : InterfaceModel) is deferred;
|
||||
---Purpose : Gets header (data specific of a defined Interface) from
|
||||
-- another InterfaceModel; called from TransferCopy
|
||||
|
||||
NewEmptyModel (me) returns InterfaceModel is deferred;
|
||||
---Purpose : Returns a New Empty Model, same type as <me> (whatever its
|
||||
-- Type); called to Copy parts a Model into other ones, then
|
||||
-- followed by a call to GetFromAnother (Header) then filling
|
||||
-- with specified Entities, themselves copied
|
||||
|
||||
-- -- Categories -- --
|
||||
|
||||
SetCategoryNumber (me : mutable; num : Integer; val : Integer)
|
||||
returns Boolean;
|
||||
---Purpose : Records a category number for an entity number
|
||||
-- Returns True when done, False if <num> is out of range
|
||||
|
||||
CategoryNumber (me; num : Integer) returns Integer;
|
||||
---Purpose : Returns the recorded category number for a given entity number
|
||||
-- 0 if none was defined for this entity
|
||||
|
||||
-- -- Global Queries -- --
|
||||
|
||||
FillIterator (me; iter : in out EntityIterator);
|
||||
---Purpose : Allows an EntityIterator to get a list of Entities
|
||||
|
||||
|
||||
Entities (me) returns EntityIterator;
|
||||
---Purpose : Returns the list of all Entities, as an Iterator on Entities
|
||||
-- (the Entities themselves, not the Reports)
|
||||
|
||||
Reports (me; semantic : Boolean = Standard_False) returns EntityIterator;
|
||||
---Purpose : Returns the list of all ReportEntities, i.e. data about
|
||||
-- Entities read with Error or Warning informations
|
||||
-- (each item has to be casted to Report Entity then it can be
|
||||
-- queried for Concerned Entity, Content, Check ...)
|
||||
-- By default, returns the main reports, is <semantic> is True it
|
||||
-- returns the list for sematic checks
|
||||
---See Also : classes ReportEntity (for contents) and CheckTool
|
||||
|
||||
Redefineds (me) returns EntityIterator;
|
||||
---Purpose : Returns the list of ReportEntities which redefine data
|
||||
-- (generally, if concerned entity is "Error", a literal content
|
||||
-- is added to it : this is a "redefined entity"
|
||||
|
||||
|
||||
GlobalCheck (me; syntactic : Boolean = Standard_True) returns Check;
|
||||
---Purpose : Returns the GlobalCheck, which memorizes messages global to
|
||||
-- the file (not specific to an Entity), especially Header
|
||||
---C++ : return const &
|
||||
|
||||
SetGlobalCheck (me : mutable; ach : Check);
|
||||
---Purpose : Allows to modify GlobalCheck, after getting then completing it
|
||||
-- Remark : it is SYNTACTIC check. Semantics, see FillChecks
|
||||
|
||||
VerifyCheck (me; ach : in out Check) is virtual;
|
||||
---Purpose : Minimum Semantic Global Check on data in model (header)
|
||||
-- Can only check basic Data. See also GlobalCheck from Protocol
|
||||
-- for a check which takes the Graph into account
|
||||
-- Default does nothing, can be redefined
|
||||
|
||||
DumpHeader (me; S : Messenger from Message; level : Integer = 0) is deferred;
|
||||
---Purpose : Dumps Header in a short, easy to read, form, onto a Stream
|
||||
-- <level> allows to print more or less parts of the header,
|
||||
-- if necessary. 0 for basic print
|
||||
|
||||
Print (me; ent : Transient; s : Messenger from Message; mode : Integer = 0);
|
||||
---Purpose : Prints identification of a given entity in <me>, in order to
|
||||
-- be printed in a list or phrase
|
||||
-- <mode> < 0 : prints only its number
|
||||
-- <mode> = 1 : just calls PrintLabel
|
||||
-- <mode> = 0 (D) : prints its number plus '/' plus PrintLabel
|
||||
-- If <ent> == <me>, simply prints "Global"
|
||||
-- If <ent> is unknown, prints "??/its type"
|
||||
|
||||
PrintLabel (me; ent : Transient; S : Messenger from Message) is deferred;
|
||||
---Purpose : Prints label specific to each norm, for a given entity.
|
||||
-- Must only print label itself, in order to be included in a
|
||||
-- phrase. Can call the result of StringLabel, but not obliged.
|
||||
|
||||
PrintToLog (me; ent : Transient; S : Messenger from Message) is virtual;
|
||||
---Purpose : Prints label specific to each norm in log format, for
|
||||
-- a given entity.
|
||||
-- By default, just calls PrintLabel, can be redefined
|
||||
|
||||
StringLabel (me; ent : Transient) returns HAsciiString from TCollection
|
||||
is deferred;
|
||||
---Purpose : Returns a string with the label attached to a given entity.
|
||||
-- Warning : While this string may be edited on the spot, if it is a read
|
||||
-- field, the returned value must be copied before.
|
||||
|
||||
NextNumberForLabel (me; label : CString;
|
||||
lastnum : Integer = 0; exact : Boolean = Standard_True)
|
||||
returns Integer is virtual;
|
||||
---Purpose : Searches a label which matches with one entity.
|
||||
-- Begins from <lastnum>+1 (default:1) and scans the entities
|
||||
-- until <NbEntities>. For the first which matches <label>,
|
||||
-- this method returns its Number. Returns 0 if nothing found
|
||||
-- Can be called recursively (labels are not specified as unique)
|
||||
-- <exact> : if True (default), exact match is required
|
||||
-- else, checks the END of entity label
|
||||
--
|
||||
-- This method is virtual, hence it can be redefined for a more
|
||||
-- efficient search (if exact is true).
|
||||
|
||||
-- -- Templates -- --
|
||||
|
||||
HasTemplate (myclass; name : CString) returns Boolean;
|
||||
---Purpose : Returns true if a template is attached to a given name
|
||||
|
||||
Template (myclass; name : CString) returns InterfaceModel;
|
||||
---Purpose : Returns the template model attached to a name, or a Null Handle
|
||||
|
||||
SetTemplate (myclass; name : CString; model : InterfaceModel)
|
||||
returns Boolean;
|
||||
---Purpose : Records a new template model with a name. If the name was
|
||||
-- already recorded, the corresponding template is replaced by
|
||||
-- the new one. Then, WARNING : test HasTemplate to avoid
|
||||
-- surprises
|
||||
|
||||
ListTemplates (myclass) returns HSequenceOfHAsciiString;
|
||||
---Purpose : Returns the complete list of names attached to template models
|
||||
|
||||
fields
|
||||
|
||||
theentities : IndexedMapOfTransient;
|
||||
thereports : DataMapOfIntegerTransient from TColStd; -- EntityNumber -> ReportEntity
|
||||
therepch : DataMapOfIntegerTransient from TColStd; -- for semantic checks
|
||||
thecheckstx : Check; -- it is GlobalCheck (Syntactic)
|
||||
thechecksem : Check; -- it is GlobalCheck (Semantic)
|
||||
haschecksem : Boolean; -- are semantic checks recorded
|
||||
isdispatch : Boolean; -- is <me> produced for dispatch ?
|
||||
thecategory : HAsciiString;
|
||||
thegtool : GTool;
|
||||
-- theprotocol : Protocol;
|
||||
|
||||
end InterfaceModel;
|
@@ -15,29 +15,36 @@
|
||||
//svv#1 11.01.00 : porting on DEC
|
||||
//svv#2 21.02.00 : porting on SIL
|
||||
//smh#14 17.03.2000 : FRA62479 Clearing of gtool.
|
||||
#include <Interface_InterfaceModel.ixx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <TColStd_Array1OfTransient.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <Interface_InterfaceMismatch.hxx>
|
||||
|
||||
#include <Dico_DictionaryOfTransient.hxx>
|
||||
#include <Dico_IteratorOfDictionaryOfTransient.hxx>
|
||||
#include <TColStd_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_CheckIterator.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_GTool.hxx>
|
||||
#include <Interface_InterfaceMismatch.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_ReportEntity.hxx>
|
||||
#include <Interface_SignType.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <Interface_ReportEntity.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_Array1OfTransient.hxx>
|
||||
#include <TColStd_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
|
||||
|
||||
// Un Modele d`Interface est un ensemble ferme d`Entites d`interface : chacune
|
||||
// est dans un seul modele a la fois; elle y a un numero (Number) qui permet de
|
||||
// verifier qu`une entite est bien dans un seul modele, de definir des Map tres
|
||||
// performantes, de fournir un identifieur numerique
|
||||
|
||||
// Il est a meme d`etre utilise dans des traitements de Graphe
|
||||
|
||||
// STATICS : les TEMPLATES
|
||||
|
||||
|
||||
static const Handle(Dico_DictionaryOfTransient)& templates()
|
||||
{
|
||||
static Handle(Dico_DictionaryOfTransient) atemp;
|
||||
|
435
src/Interface/Interface_InterfaceModel.hxx
Normal file
435
src/Interface/Interface_InterfaceModel.hxx
Normal file
@@ -0,0 +1,435 @@
|
||||
// Created by: Christian CAILLET <cky@phobox>
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_InterfaceModel_HeaderFile
|
||||
#define _Interface_InterfaceModel_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TColStd_IndexedMapOfTransient.hxx>
|
||||
#include <TColStd_DataMapOfIntegerTransient.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Interface_DataState.hxx>
|
||||
#include <TColStd_HSequenceOfHAsciiString.hxx>
|
||||
class Interface_Check;
|
||||
class TCollection_HAsciiString;
|
||||
class Interface_GTool;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Interface_InterfaceMismatch;
|
||||
class Interface_Protocol;
|
||||
class Standard_Transient;
|
||||
class Interface_ReportEntity;
|
||||
class Interface_CheckIterator;
|
||||
class Interface_GeneralLib;
|
||||
class Interface_EntityIterator;
|
||||
class Message_Messenger;
|
||||
|
||||
|
||||
class Interface_InterfaceModel;
|
||||
DEFINE_STANDARD_HANDLE(Interface_InterfaceModel, MMgt_TShared)
|
||||
|
||||
//! Defines an (Indexed) Set of data corresponding to a complete
|
||||
//! Transfer by a File Interface, i.e. File Header and Transient
|
||||
//! Entities (Objects) contained in a File. Contained Entities are
|
||||
//! identified in the Model by unique and consecutive Numbers.
|
||||
//!
|
||||
//! In addition, a Model can attach to each entity, a specific
|
||||
//! Label according to the norm (e.g. Name for VDA, #ident for
|
||||
//! Step ...), intended to be output on a string or a stream
|
||||
//! (remark : labels are not obliged to be unique)
|
||||
//!
|
||||
//! InterfaceModel itself is not Transient, it is intended to
|
||||
//! work on a set of Transient Data. The services offered are
|
||||
//! basic Listing and Identification operations on Transient
|
||||
//! Entities, storage of Error Reports, Copying.
|
||||
//!
|
||||
//! Moreovere, it is possible to define and use templates. These
|
||||
//! are empty Models, from which copies can be obtained in order
|
||||
//! to be filled with effective data. This allows to record
|
||||
//! standard definitions for headers, avoiding to recreate them
|
||||
//! for each sendings, and assuring customisation of produced
|
||||
//! files for a given site.
|
||||
//! A template is attached to a name. It is possible to define a
|
||||
//! template from another one (get it, edit it then record it
|
||||
//! under another name).
|
||||
//!
|
||||
//! See also Graph, ShareTool, CheckTool for more
|
||||
class Interface_InterfaceModel : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Clears the list of entities (service WhenDelete)
|
||||
Standard_EXPORT void Destroy();
|
||||
~Interface_InterfaceModel()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
//! Sets a Protocol for this Model
|
||||
//! It is also set by a call to AddWithRefs with Protocol
|
||||
//! It is used for : DumpHeader (as required), ClearEntities ...
|
||||
Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& proto);
|
||||
|
||||
//! Returns the Protocol which has been set by SetProtocol, or
|
||||
//! AddWithRefs with Protocol
|
||||
Standard_EXPORT virtual Handle(Interface_Protocol) Protocol() const;
|
||||
|
||||
//! Sets a GTool for this model, which already defines a Protocol
|
||||
Standard_EXPORT void SetGTool (const Handle(Interface_GTool)& gtool);
|
||||
|
||||
//! Returns the GTool, set by SetProtocol or by SetGTool
|
||||
Standard_EXPORT Handle(Interface_GTool) GTool() const;
|
||||
|
||||
//! Returns the Dispatch Status, either for get or set
|
||||
//! A Model which is produced from Dispatch may share entities
|
||||
//! with the original (according to the Protocol), hence these
|
||||
//! non-copied entities should not be deleted
|
||||
Standard_EXPORT Standard_Boolean& DispatchStatus();
|
||||
|
||||
//! Erases contained data; used when a Model is copied to others :
|
||||
//! the new copied ones begin from clear
|
||||
//! Clear calls specific method ClearHeader (see below)
|
||||
Standard_EXPORT virtual void Clear();
|
||||
|
||||
//! Clears the entities; uses the general service WhenDelete, in
|
||||
//! addition to the standard Memory Manager; can be redefined
|
||||
Standard_EXPORT virtual void ClearEntities();
|
||||
|
||||
//! Erases informations about labels, if any : specific to each
|
||||
//! norm
|
||||
Standard_EXPORT virtual void ClearLabels() = 0;
|
||||
|
||||
//! Clears Model's header : specific to each norm
|
||||
Standard_EXPORT virtual void ClearHeader() = 0;
|
||||
|
||||
//! Returns count of contained Entities
|
||||
Standard_EXPORT Standard_Integer NbEntities() const;
|
||||
|
||||
//! Returns True if a Model contains an Entity (for a ReportEntity,
|
||||
//! looks for the ReportEntity itself AND its Concerned Entity)
|
||||
Standard_EXPORT Standard_Boolean Contains (const Handle(Standard_Transient)& anentity) const;
|
||||
|
||||
//! Returns the Number of an Entity in the Model if it contains it.
|
||||
//! Else returns 0. For a ReportEntity, looks at Concerned Entity.
|
||||
//! Returns the Directory entry Number of an Entity in
|
||||
//! the Model if it contains it. Else returns 0. For a
|
||||
//! ReportEntity, looks at Concerned Entity.
|
||||
Standard_EXPORT Standard_Integer Number (const Handle(Standard_Transient)& anentity) const;
|
||||
|
||||
//! Returns an Entity identified by its number in the Model
|
||||
//! Each sub-class of InterfaceModel can define its own method
|
||||
//! Entity to return its specific class of Entity (e.g. for VDA,
|
||||
//! VDAModel returns a VDAEntity), working by calling Value
|
||||
//! Remark : For a Reported Entity, (Erroneous, Corrected, Unknown), this
|
||||
//! method returns this Reported Entity.
|
||||
//! See ReportEntity for other questions.
|
||||
Standard_EXPORT const Handle(Standard_Transient)& Value (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the count of DISTINCT types under which an entity may
|
||||
//! be processed. Defined by the Protocol, which gives default as
|
||||
//! 1 (dynamic Type).
|
||||
Standard_EXPORT Standard_Integer NbTypes (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns a type, given its rank : defined by the Protocol
|
||||
//! (by default, the first one)
|
||||
Standard_EXPORT Handle(Standard_Type) Type (const Handle(Standard_Transient)& ent, const Standard_Integer num = 1) const;
|
||||
|
||||
//! Returns the type name of an entity, from the list of types
|
||||
//! (one or more ...)
|
||||
//! <complete> True (D) gives the complete type, else packages are
|
||||
//! removed
|
||||
//! WARNING : buffered, to be immediately copied or printed
|
||||
Standard_EXPORT Standard_CString TypeName (const Handle(Standard_Transient)& ent, const Standard_Boolean complete = Standard_True) const;
|
||||
|
||||
//! From a CDL Type Name, returns the Class part (package dropped)
|
||||
//! WARNING : buffered, to be immediately copied or printed
|
||||
Standard_EXPORT static Standard_CString ClassName (const Standard_CString typnam);
|
||||
|
||||
//! Returns the State of an entity, given its number
|
||||
Standard_EXPORT Interface_DataState EntityState (const Standard_Integer num) const;
|
||||
|
||||
//! Returns True if <num> identifies a ReportEntity in the Model
|
||||
//! Hence, ReportEntity can be called.
|
||||
//!
|
||||
//! By default, queries main report, if <semantic> is True, it
|
||||
//! queries report for semantic check
|
||||
//!
|
||||
//! Remember that a Report Entity can be defined for an Unknown
|
||||
//! Entity, or a Corrected or Erroneous (at read time) Entity.
|
||||
//! The ReportEntity is defined before call to method AddEntity.
|
||||
Standard_EXPORT Standard_Boolean IsReportEntity (const Standard_Integer num, const Standard_Boolean semantic = Standard_False) const;
|
||||
|
||||
//! Returns a ReportEntity identified by its number in the Model,
|
||||
//! or a Null Handle If <num> does not identify a ReportEntity.
|
||||
//!
|
||||
//! By default, queries main report, if <semantic> is True, it
|
||||
//! queries report for semantic check
|
||||
Standard_EXPORT Handle(Interface_ReportEntity) ReportEntity (const Standard_Integer num, const Standard_Boolean semantic = Standard_False) const;
|
||||
|
||||
//! Returns True if <num> identifies an Error Entity : in this
|
||||
//! case, a ReportEntity brings Fail Messages and possibly an
|
||||
//! "undefined" Content, see IsRedefinedEntity
|
||||
Standard_EXPORT Standard_Boolean IsErrorEntity (const Standard_Integer num) const;
|
||||
|
||||
//! Returns True if <num> identifies an Entity which content is
|
||||
//! redefined through a ReportEntity (i.e. with literal data only)
|
||||
//! This happens when an entity is syntactically erroneous in the
|
||||
//! way that its basic content remains empty.
|
||||
//! For more details (such as content itself), see ReportEntity
|
||||
Standard_EXPORT Standard_Boolean IsRedefinedContent (const Standard_Integer num) const;
|
||||
|
||||
//! Removes the ReportEntity attached to Entity <num>. Returns
|
||||
//! True if done, False if no ReportEntity was attached to <num>.
|
||||
//! Warning : the caller must assume that this clearing is meaningfull
|
||||
Standard_EXPORT Standard_Boolean ClearReportEntity (const Standard_Integer num);
|
||||
|
||||
//! Sets or Replaces a ReportEntity for the Entity <num>. Returns
|
||||
//! True if Report is replaced, False if it has been replaced
|
||||
//! Warning : the caller must assume that this setting is meaningfull
|
||||
Standard_EXPORT Standard_Boolean SetReportEntity (const Standard_Integer num, const Handle(Interface_ReportEntity)& rep);
|
||||
|
||||
//! Adds a ReportEntity as such. Returns False if the concerned
|
||||
//! entity is not recorded in the Model
|
||||
//! Else, adds it into, either the main report list or the
|
||||
//! list for semantic checks, then returns True
|
||||
Standard_EXPORT Standard_Boolean AddReportEntity (const Handle(Interface_ReportEntity)& rep, const Standard_Boolean semantic = Standard_False);
|
||||
|
||||
//! Returns True if <num> identifies an Unknown Entity : in this
|
||||
//! case, a ReportEntity with no Check Messages designates it.
|
||||
Standard_EXPORT Standard_Boolean IsUnknownEntity (const Standard_Integer num) const;
|
||||
|
||||
//! Fills the list of semantic checks.
|
||||
//! This list is computed (by CheckTool). Hence, it can be stored
|
||||
//! in the model for later queries
|
||||
//! <clear> True (D) : new list replaces
|
||||
//! <clear> False : new list is cumulated
|
||||
Standard_EXPORT void FillSemanticChecks (const Interface_CheckIterator& checks, const Standard_Boolean clear = Standard_True);
|
||||
|
||||
//! Returns True if semantic checks have been filled
|
||||
Standard_EXPORT Standard_Boolean HasSemanticChecks() const;
|
||||
|
||||
//! Returns the check attached to an entity, designated by its
|
||||
//! Number. 0 for global check
|
||||
//! <semantic> True : recorded semantic check
|
||||
//! <semantic> False : recorded syntactic check (see ReportEntity)
|
||||
//! If no check is recorded for <num>, returns an empty Check
|
||||
Standard_EXPORT const Handle(Interface_Check)& Check (const Standard_Integer num, const Standard_Boolean syntactic) const;
|
||||
|
||||
//! Does a reservation for the List of Entities (for optimized
|
||||
//! storage management). If it is not called, storage management
|
||||
//! can be less efficient. <nbent> is the expected count of
|
||||
//! Entities to store
|
||||
Standard_EXPORT virtual void Reservate (const Standard_Integer nbent);
|
||||
|
||||
//! Internal method for adding an Entity. Used by file reading
|
||||
//! (defined by each Interface) and Transfer tools. It adds the
|
||||
//! entity required to be added, not its refs : see AddWithRefs.
|
||||
//! If <anentity> is a ReportEntity, it is added to the list of
|
||||
//! Reports, its Concerned Entity (Erroneous or Corrected, else
|
||||
//! Unknown) is added to the list of Entities.
|
||||
//! That is, the ReportEntity must be created before Adding
|
||||
Standard_EXPORT virtual void AddEntity (const Handle(Standard_Transient)& anentity);
|
||||
|
||||
//! Adds to the Model, an Entity with all its References, as they
|
||||
//! are defined by General Services FillShared and ListImplied.
|
||||
//! Process is recursive (any sub-levels) if <level> = 0 (Default)
|
||||
//! Else, adds sub-entities until the required sub-level.
|
||||
//! Especially, if <level> = 1, adds immediate subs and that's all
|
||||
//!
|
||||
//! If <listall> is False (Default), an entity (<anentity> itself
|
||||
//! or one of its subs at any level) which is already recorded in
|
||||
//! the Model is not analysed, only the newly added ones are.
|
||||
//! If <listall> is True, all items are analysed (this allows to
|
||||
//! ensure the consistency of an adding made by steps)
|
||||
Standard_EXPORT void AddWithRefs (const Handle(Standard_Transient)& anent, const Handle(Interface_Protocol)& proto, const Standard_Integer level = 0, const Standard_Boolean listall = Standard_False);
|
||||
|
||||
//! Same as above, but works with the Protocol of the Model
|
||||
Standard_EXPORT void AddWithRefs (const Handle(Standard_Transient)& anent, const Standard_Integer level = 0, const Standard_Boolean listall = Standard_False);
|
||||
|
||||
//! Same as above, but works with an already created GeneralLib
|
||||
Standard_EXPORT void AddWithRefs (const Handle(Standard_Transient)& anent, const Interface_GeneralLib& lib, const Standard_Integer level = 0, const Standard_Boolean listall = Standard_False);
|
||||
|
||||
//! Replace Entity with Number=nument on other entity - "anent"
|
||||
Standard_EXPORT void ReplaceEntity (const Standard_Integer nument, const Handle(Standard_Transient)& anent);
|
||||
|
||||
//! Reverses the Numbers of the Entities, between <after> and the
|
||||
//! total count of Entities. Thus, the entities :
|
||||
//! 1,2 ... after, after+1 ... nb-1, nb become numbered as :
|
||||
//! 1,2 ... after, nb, nb-1 ... after+1
|
||||
//! By default (after = 0) the whole list of Entities is reversed
|
||||
Standard_EXPORT void ReverseOrders (const Standard_Integer after = 0);
|
||||
|
||||
//! Changes the Numbers of some Entities : <oldnum> is moved to
|
||||
//! <newnum>, same for <count> entities. Thus :
|
||||
//! 1,2 ... newnum-1 newnum ... oldnum .. oldnum+count oldnum+count+1 .. gives
|
||||
//! 1,2 ... newnum-1 oldnum .. oldnum+count newnum ... oldnum+count+1
|
||||
//! (can be seen as a circular permutation)
|
||||
Standard_EXPORT void ChangeOrder (const Standard_Integer oldnum, const Standard_Integer newnum, const Standard_Integer count = 1);
|
||||
|
||||
//! Gets contents from an EntityIterator, prepared by a
|
||||
//! Transfer tool (e.g TransferCopy). Starts from clear
|
||||
Standard_EXPORT void GetFromTransfer (const Interface_EntityIterator& aniter);
|
||||
|
||||
//! Gets header (data specific of a defined Interface) from
|
||||
//! another InterfaceModel; called from TransferCopy
|
||||
Standard_EXPORT virtual void GetFromAnother (const Handle(Interface_InterfaceModel)& other) = 0;
|
||||
|
||||
//! Returns a New Empty Model, same type as <me> (whatever its
|
||||
//! Type); called to Copy parts a Model into other ones, then
|
||||
//! followed by a call to GetFromAnother (Header) then filling
|
||||
//! with specified Entities, themselves copied
|
||||
Standard_EXPORT virtual Handle(Interface_InterfaceModel) NewEmptyModel() const = 0;
|
||||
|
||||
//! Records a category number for an entity number
|
||||
//! Returns True when done, False if <num> is out of range
|
||||
Standard_EXPORT Standard_Boolean SetCategoryNumber (const Standard_Integer num, const Standard_Integer val);
|
||||
|
||||
//! Returns the recorded category number for a given entity number
|
||||
//! 0 if none was defined for this entity
|
||||
Standard_EXPORT Standard_Integer CategoryNumber (const Standard_Integer num) const;
|
||||
|
||||
//! Allows an EntityIterator to get a list of Entities
|
||||
Standard_EXPORT void FillIterator (Interface_EntityIterator& iter) const;
|
||||
|
||||
//! Returns the list of all Entities, as an Iterator on Entities
|
||||
//! (the Entities themselves, not the Reports)
|
||||
Standard_EXPORT Interface_EntityIterator Entities() const;
|
||||
|
||||
//! Returns the list of all ReportEntities, i.e. data about
|
||||
//! Entities read with Error or Warning informations
|
||||
//! (each item has to be casted to Report Entity then it can be
|
||||
//! queried for Concerned Entity, Content, Check ...)
|
||||
//! By default, returns the main reports, is <semantic> is True it
|
||||
//! returns the list for sematic checks
|
||||
Standard_EXPORT Interface_EntityIterator Reports (const Standard_Boolean semantic = Standard_False) const;
|
||||
|
||||
//! Returns the list of ReportEntities which redefine data
|
||||
//! (generally, if concerned entity is "Error", a literal content
|
||||
//! is added to it : this is a "redefined entity"
|
||||
Standard_EXPORT Interface_EntityIterator Redefineds() const;
|
||||
|
||||
//! Returns the GlobalCheck, which memorizes messages global to
|
||||
//! the file (not specific to an Entity), especially Header
|
||||
Standard_EXPORT const Handle(Interface_Check)& GlobalCheck (const Standard_Boolean syntactic = Standard_True) const;
|
||||
|
||||
//! Allows to modify GlobalCheck, after getting then completing it
|
||||
//! Remark : it is SYNTACTIC check. Semantics, see FillChecks
|
||||
Standard_EXPORT void SetGlobalCheck (const Handle(Interface_Check)& ach);
|
||||
|
||||
//! Minimum Semantic Global Check on data in model (header)
|
||||
//! Can only check basic Data. See also GlobalCheck from Protocol
|
||||
//! for a check which takes the Graph into account
|
||||
//! Default does nothing, can be redefined
|
||||
Standard_EXPORT virtual void VerifyCheck (Handle(Interface_Check)& ach) const;
|
||||
|
||||
//! Dumps Header in a short, easy to read, form, onto a Stream
|
||||
//! <level> allows to print more or less parts of the header,
|
||||
//! if necessary. 0 for basic print
|
||||
Standard_EXPORT virtual void DumpHeader (const Handle(Message_Messenger)& S, const Standard_Integer level = 0) const = 0;
|
||||
|
||||
//! Prints identification of a given entity in <me>, in order to
|
||||
//! be printed in a list or phrase
|
||||
//! <mode> < 0 : prints only its number
|
||||
//! <mode> = 1 : just calls PrintLabel
|
||||
//! <mode> = 0 (D) : prints its number plus '/' plus PrintLabel
|
||||
//! If <ent> == <me>, simply prints "Global"
|
||||
//! If <ent> is unknown, prints "??/its type"
|
||||
Standard_EXPORT void Print (const Handle(Standard_Transient)& ent, const Handle(Message_Messenger)& s, const Standard_Integer mode = 0) const;
|
||||
|
||||
//! Prints label specific to each norm, for a given entity.
|
||||
//! Must only print label itself, in order to be included in a
|
||||
//! phrase. Can call the result of StringLabel, but not obliged.
|
||||
Standard_EXPORT virtual void PrintLabel (const Handle(Standard_Transient)& ent, const Handle(Message_Messenger)& S) const = 0;
|
||||
|
||||
//! Prints label specific to each norm in log format, for
|
||||
//! a given entity.
|
||||
//! By default, just calls PrintLabel, can be redefined
|
||||
Standard_EXPORT virtual void PrintToLog (const Handle(Standard_Transient)& ent, const Handle(Message_Messenger)& S) const;
|
||||
|
||||
//! Returns a string with the label attached to a given entity.
|
||||
//! Warning : While this string may be edited on the spot, if it is a read
|
||||
//! field, the returned value must be copied before.
|
||||
Standard_EXPORT virtual Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const = 0;
|
||||
|
||||
//! Searches a label which matches with one entity.
|
||||
//! Begins from <lastnum>+1 (default:1) and scans the entities
|
||||
//! until <NbEntities>. For the first which matches <label>,
|
||||
//! this method returns its Number. Returns 0 if nothing found
|
||||
//! Can be called recursively (labels are not specified as unique)
|
||||
//! <exact> : if True (default), exact match is required
|
||||
//! else, checks the END of entity label
|
||||
//!
|
||||
//! This method is virtual, hence it can be redefined for a more
|
||||
//! efficient search (if exact is true).
|
||||
Standard_EXPORT virtual Standard_Integer NextNumberForLabel (const Standard_CString label, const Standard_Integer lastnum = 0, const Standard_Boolean exact = Standard_True) const;
|
||||
|
||||
//! Returns true if a template is attached to a given name
|
||||
Standard_EXPORT static Standard_Boolean HasTemplate (const Standard_CString name);
|
||||
|
||||
//! Returns the template model attached to a name, or a Null Handle
|
||||
Standard_EXPORT static Handle(Interface_InterfaceModel) Template (const Standard_CString name);
|
||||
|
||||
//! Records a new template model with a name. If the name was
|
||||
//! already recorded, the corresponding template is replaced by
|
||||
//! the new one. Then, WARNING : test HasTemplate to avoid
|
||||
//! surprises
|
||||
Standard_EXPORT static Standard_Boolean SetTemplate (const Standard_CString name, const Handle(Interface_InterfaceModel)& model);
|
||||
|
||||
//! Returns the complete list of names attached to template models
|
||||
Standard_EXPORT static Handle(TColStd_HSequenceOfHAsciiString) ListTemplates();
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_InterfaceModel,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Defines empty InterfaceModel, ready to be filled
|
||||
Standard_EXPORT Interface_InterfaceModel();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TColStd_IndexedMapOfTransient theentities;
|
||||
TColStd_DataMapOfIntegerTransient thereports;
|
||||
TColStd_DataMapOfIntegerTransient therepch;
|
||||
Handle(Interface_Check) thecheckstx;
|
||||
Handle(Interface_Check) thechecksem;
|
||||
Standard_Boolean haschecksem;
|
||||
Standard_Boolean isdispatch;
|
||||
Handle(TCollection_HAsciiString) thecategory;
|
||||
Handle(Interface_GTool) thegtool;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_InterfaceModel_HeaderFile
|
@@ -1,47 +0,0 @@
|
||||
-- Created on: 1995-05-30
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class JaggedArray from Interface
|
||||
(TheKey as TShared)
|
||||
inherits TShared
|
||||
|
||||
---Purpose : This class allows to define an HArray1 Of HArray1 ...
|
||||
-- which is not possible with the actual system of
|
||||
-- genericity supported by CasCade
|
||||
|
||||
uses Array1OfTransient
|
||||
|
||||
is
|
||||
|
||||
Create (low, up : Integer) returns JaggedArray;
|
||||
|
||||
Lower (me) returns Integer;
|
||||
Upper (me) returns Integer;
|
||||
Length (me) returns Integer;
|
||||
|
||||
SetValue (me : mutable; num : Integer; val : any TheKey);
|
||||
|
||||
Value (me; num : Integer) returns any TheKey;
|
||||
-- C++ : return const & (NO , DownCast required)
|
||||
|
||||
-- ChangeValue (me : mutable; num : Integer) returns any TheKey;
|
||||
-- C++ : return & (NO , DownCast required !)
|
||||
|
||||
fields
|
||||
|
||||
thelist : Array1OfTransient;
|
||||
|
||||
end JaggedArray;
|
@@ -1,126 +0,0 @@
|
||||
-- Created on: 1993-04-15
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class LineBuffer from Interface
|
||||
|
||||
---Purpose : Simple Management of a Line Buffer, to be used by Interface
|
||||
-- File Writers.
|
||||
-- While a String is suitable to do that, this class ensures an
|
||||
-- optimised Memory Management, because this is a hard point of
|
||||
-- File Writing.
|
||||
|
||||
uses Integer, Boolean, Character, CString,
|
||||
AsciiString from TCollection, HAsciiString from TCollection
|
||||
|
||||
raises OutOfRange
|
||||
|
||||
is
|
||||
|
||||
Create (size : Integer = 10) returns LineBuffer;
|
||||
---Purpose : Creates a LineBuffer with an absolute maximum size
|
||||
-- (Default value is only to satisfy compiler requirement)
|
||||
|
||||
SetMax (me : in out; max : Integer)
|
||||
---Purpose : Changes Maximum allowed size of Buffer.
|
||||
-- If <max> is Zero, Maximum size is set to the initial size.
|
||||
raises OutOfRange is static;
|
||||
-- Error if <max> is greater than <size> given at Creation time.
|
||||
|
||||
SetInitial (me : in out; initial : Integer)
|
||||
---Purpose : Sets an Initial reservation for Blank characters
|
||||
-- (this reservation is counted in the size of the current Line)
|
||||
raises OutOfRange is static;
|
||||
-- Error if <initial> is greater than current Maximum size
|
||||
|
||||
SetKeep (me : in out) is static;
|
||||
---Purpose : Sets a Keep Status at current Length. It means that at next
|
||||
-- Move, the new line will begin by characters between Keep + 1
|
||||
-- and current Length
|
||||
|
||||
CanGet (me : in out; more : Integer) returns Boolean is static;
|
||||
---Purpose : Returns True if there is room enough to add <more> characters
|
||||
-- Else, it is required to Dump the Buffer before refilling it
|
||||
-- <more> is recorded to manage SetKeep status
|
||||
|
||||
Content (me) returns CString is static;
|
||||
---Purpose : Returns the Content of the LineBuffer
|
||||
-- was C++ : return const
|
||||
|
||||
Length (me) returns Integer is static;
|
||||
---Purpose : Returns the Length of the LineBuffer
|
||||
|
||||
Clear (me : in out) is static;
|
||||
---Purpose : Clears completely the LineBuffer
|
||||
|
||||
FreezeInitial (me : in out) is static;
|
||||
---Purpose : Inhibits effect of SetInitial until the next Move (i.e. Keep)
|
||||
-- Then Prepare will not insert initial blanks, but further ones
|
||||
-- will. This allows to cancel initial blanks on an internal Split
|
||||
-- A call to SetInitial has no effect on this until Move
|
||||
|
||||
Prepare (me : in out) is static private;
|
||||
---Purpose : Prepares Move : Inserts Initial Blanks if required, and
|
||||
-- determines if SetKeep can be supported (it cannot be if Length
|
||||
-- + Next String to get (see CanGet) overpass Max Size)
|
||||
|
||||
Keep (me : in out) is static private;
|
||||
---Purpose : Keeps characters from SetKeep. If SetKeep is Zero, equivalent
|
||||
-- to Clear
|
||||
|
||||
Move (me : in out; str : in out AsciiString from TCollection) is static;
|
||||
---Purpose : Fills a AsciiString <str> with the Content of the Line Buffer,
|
||||
-- then Clears the LineBuffer
|
||||
|
||||
Move (me : in out; str : HAsciiString from TCollection) is static;
|
||||
---Purpose : Same as above, but <str> is known through a Handle
|
||||
|
||||
Moved (me : in out) returns HAsciiString from TCollection;
|
||||
---Purpose : Same as above, but generates the HAsciiString
|
||||
|
||||
|
||||
Add (me : in out; text : CString)
|
||||
---Purpose : Adds a text as a CString. Its Length is evaluated from the
|
||||
-- text (by C function strlen)
|
||||
raises OutOfRange is static;
|
||||
-- Error if there remains no room enough
|
||||
|
||||
Add (me : in out; text : CString; lntext : Integer)
|
||||
---Purpose : Adds a text as a CString. Its length is given as <lntext>
|
||||
raises OutOfRange is static;
|
||||
-- Error if there remains no room enough
|
||||
|
||||
Add (me : in out; text : AsciiString from TCollection)
|
||||
---Purpose : Adds a text as a AsciiString from TCollection
|
||||
raises OutOfRange is static;
|
||||
-- Error if there remains no room enough
|
||||
|
||||
Add (me : in out; text : Character)
|
||||
---Purpose : Adds a text made of only ONE Character
|
||||
raises OutOfRange is static;
|
||||
-- Error if there remains no room enough
|
||||
|
||||
fields
|
||||
|
||||
theline : AsciiString from TCollection;
|
||||
themax : Integer;
|
||||
theinit : Integer;
|
||||
thekeep : Integer;
|
||||
theget : Integer;
|
||||
thelen : Integer;
|
||||
thefriz : Integer;
|
||||
thekept : Character;
|
||||
|
||||
end LineBuffer;
|
@@ -11,16 +11,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_LineBuffer.ixx>
|
||||
|
||||
#include <Interface_LineBuffer.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
// LineBuffer, c est une String avec une Longueur reservee fixe au depart
|
||||
// et une longueur effective <thelen>. theline(thelen+1) vaut '\0'
|
||||
|
||||
|
||||
|
||||
Interface_LineBuffer::Interface_LineBuffer (const Standard_Integer size)
|
||||
: theline (size+1,' ')
|
||||
{
|
||||
|
147
src/Interface/Interface_LineBuffer.hxx
Normal file
147
src/Interface/Interface_LineBuffer.hxx
Normal file
@@ -0,0 +1,147 @@
|
||||
// Created on: 1993-04-15
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_LineBuffer_HeaderFile
|
||||
#define _Interface_LineBuffer_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Character.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class TCollection_AsciiString;
|
||||
class TCollection_HAsciiString;
|
||||
|
||||
|
||||
//! Simple Management of a Line Buffer, to be used by Interface
|
||||
//! File Writers.
|
||||
//! While a String is suitable to do that, this class ensures an
|
||||
//! optimised Memory Management, because this is a hard point of
|
||||
//! File Writing.
|
||||
class Interface_LineBuffer
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a LineBuffer with an absolute maximum size
|
||||
//! (Default value is only to satisfy compiler requirement)
|
||||
Standard_EXPORT Interface_LineBuffer(const Standard_Integer size = 10);
|
||||
|
||||
//! Changes Maximum allowed size of Buffer.
|
||||
//! If <max> is Zero, Maximum size is set to the initial size.
|
||||
Standard_EXPORT void SetMax (const Standard_Integer max);
|
||||
|
||||
//! Sets an Initial reservation for Blank characters
|
||||
//! (this reservation is counted in the size of the current Line)
|
||||
Standard_EXPORT void SetInitial (const Standard_Integer initial);
|
||||
|
||||
//! Sets a Keep Status at current Length. It means that at next
|
||||
//! Move, the new line will begin by characters between Keep + 1
|
||||
//! and current Length
|
||||
Standard_EXPORT void SetKeep();
|
||||
|
||||
//! Returns True if there is room enough to add <more> characters
|
||||
//! Else, it is required to Dump the Buffer before refilling it
|
||||
//! <more> is recorded to manage SetKeep status
|
||||
Standard_EXPORT Standard_Boolean CanGet (const Standard_Integer more);
|
||||
|
||||
//! Returns the Content of the LineBuffer
|
||||
//! was C++ : return const
|
||||
Standard_EXPORT Standard_CString Content() const;
|
||||
|
||||
//! Returns the Length of the LineBuffer
|
||||
Standard_EXPORT Standard_Integer Length() const;
|
||||
|
||||
//! Clears completely the LineBuffer
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Inhibits effect of SetInitial until the next Move (i.e. Keep)
|
||||
//! Then Prepare will not insert initial blanks, but further ones
|
||||
//! will. This allows to cancel initial blanks on an internal Split
|
||||
//! A call to SetInitial has no effect on this until Move
|
||||
Standard_EXPORT void FreezeInitial();
|
||||
|
||||
//! Fills a AsciiString <str> with the Content of the Line Buffer,
|
||||
//! then Clears the LineBuffer
|
||||
Standard_EXPORT void Move (TCollection_AsciiString& str);
|
||||
|
||||
//! Same as above, but <str> is known through a Handle
|
||||
Standard_EXPORT void Move (const Handle(TCollection_HAsciiString)& str);
|
||||
|
||||
//! Same as above, but generates the HAsciiString
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) Moved();
|
||||
|
||||
//! Adds a text as a CString. Its Length is evaluated from the
|
||||
//! text (by C function strlen)
|
||||
Standard_EXPORT void Add (const Standard_CString text);
|
||||
|
||||
//! Adds a text as a CString. Its length is given as <lntext>
|
||||
Standard_EXPORT void Add (const Standard_CString text, const Standard_Integer lntext);
|
||||
|
||||
//! Adds a text as a AsciiString from TCollection
|
||||
Standard_EXPORT void Add (const TCollection_AsciiString& text);
|
||||
|
||||
//! Adds a text made of only ONE Character
|
||||
Standard_EXPORT void Add (const Standard_Character text);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Prepares Move : Inserts Initial Blanks if required, and
|
||||
//! determines if SetKeep can be supported (it cannot be if Length
|
||||
//! + Next String to get (see CanGet) overpass Max Size)
|
||||
Standard_EXPORT void Prepare();
|
||||
|
||||
//! Keeps characters from SetKeep. If SetKeep is Zero, equivalent
|
||||
//! to Clear
|
||||
Standard_EXPORT void Keep();
|
||||
|
||||
|
||||
TCollection_AsciiString theline;
|
||||
Standard_Integer themax;
|
||||
Standard_Integer theinit;
|
||||
Standard_Integer thekeep;
|
||||
Standard_Integer theget;
|
||||
Standard_Integer thelen;
|
||||
Standard_Integer thefriz;
|
||||
Standard_Character thekept;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_LineBuffer_HeaderFile
|
@@ -1,224 +0,0 @@
|
||||
-- Created on: 1995-03-08
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class MSG from Interface
|
||||
|
||||
---Purpose : This class gives a set of functions to manage and use a list
|
||||
-- of translated messages (messagery)
|
||||
--
|
||||
-- Keys are strings, their corresponding (i.e. translated) items
|
||||
-- are strings, managed by a dictionary (a global one).
|
||||
--
|
||||
-- If the dictionary is not set, or if a key is not recorded,
|
||||
-- the key is returned as item, and it is possible to :
|
||||
-- - trace or not this fail, record or not it for further trace
|
||||
--
|
||||
-- It is also possible to suspend the translation (keys are then
|
||||
-- always returned as items)
|
||||
--
|
||||
-- This class also provides a file format for loading :
|
||||
-- It is made of couples of lines, the first one begins by '@'
|
||||
-- the following is the key, the second one is the message
|
||||
-- Lines which are empty or which begin by '@@' are skipped
|
||||
|
||||
|
||||
uses Character, CString , OStream, IStream
|
||||
|
||||
raises DomainError
|
||||
|
||||
is
|
||||
|
||||
Create (key : CString) returns MSG;
|
||||
---Purpose : A MSG is created to write a "functional code" in conjunction
|
||||
-- with operator () attached to Value
|
||||
-- Then, to have a translated message, write in C++ :
|
||||
--
|
||||
-- Interface_MSG("...mykey...") which returns a CString
|
||||
-- See also some help which follow
|
||||
|
||||
Create (key : CString; i1 : Integer) returns MSG;
|
||||
---Purpose : Translates a message which contains one integer variable
|
||||
-- It is just a help which avoid the following :
|
||||
-- char mess[100]; sprintf(mess,Interface_MSG("code"),ival);
|
||||
-- then AddFail(mess);
|
||||
-- replaced by AddFail (Interface_MSG("code",ival));
|
||||
--
|
||||
-- The basic message is intended to be in C-sprintf format,
|
||||
-- with one %d form in it
|
||||
|
||||
Create (key : CString; i1,i2 : Integer) returns MSG;
|
||||
---Purpose : Translates a message which contains two integer variables
|
||||
-- As for one integer, it is just a writing help
|
||||
--
|
||||
-- The basic message is intended to be in C-sprintf format
|
||||
-- with two %d forms in it
|
||||
|
||||
Create (key : CString; r1 : Real; intervals : Integer = -1) returns MSG;
|
||||
---Purpose : Translates a message which contains one real variable
|
||||
-- <intervals> if set, commands the variable to be rounded to an
|
||||
-- interval (see below, method Intervals)
|
||||
-- As for one integer, it is just a writing help
|
||||
--
|
||||
-- The basic message is intended to be in C-sprintf format
|
||||
-- with one %f form (or equivalent : %e etc) in it
|
||||
|
||||
Create (key : CString; str : CString) returns MSG;
|
||||
---Purpose : Translates a message which contains one string variable
|
||||
-- As for one integer, it is just a writing help
|
||||
--
|
||||
-- The basic message is intended to be in C-sprintf format
|
||||
-- with one %s form in it
|
||||
|
||||
Create (key : CString; ival : Integer; str : CString) returns MSG;
|
||||
---Purpose : Translates a message which contains one integer and one
|
||||
-- string variables
|
||||
-- As for one integer, it is just a writing help
|
||||
-- Used for instance to say "Param n0.<ival> i.e. <str> is not.."
|
||||
--
|
||||
-- The basic message is intended to be in C-sprintf format
|
||||
-- with one %d then one %s forms in it
|
||||
|
||||
Destroy (me : in out);
|
||||
---Purpose : Optimised destructor (applies for additional forms of Create)
|
||||
---C++ : alias ~
|
||||
|
||||
Value (me) returns CString is static;
|
||||
---Purpose : Returns the translated message, in a functional form with
|
||||
-- operator ()
|
||||
-- was C++ : return const
|
||||
---C++ : alias "operator Standard_CString() const;"
|
||||
|
||||
Read (myclass; S : in out IStream) returns Integer;
|
||||
---Purpose : Reads a list of messages from a stream, returns read count
|
||||
-- 0 means empty file, -1 means error
|
||||
|
||||
Read (myclass; file : CString) returns Integer;
|
||||
---Purpose : Reads a list of messages from a file defined by its name
|
||||
|
||||
Write (myclass; S : in out OStream; rootkey : CString = "") returns Integer;
|
||||
---Purpose : Writes the list of messages recorded to be translated, to a
|
||||
-- stream. Writes all the list (Default) or only keys which begin
|
||||
-- by <rootkey>. Returns the count of written messages
|
||||
|
||||
IsKey (myclass; mess : CString) returns Boolean;
|
||||
---Purpose : Returns True if a given message is surely a key
|
||||
-- (according to the form adopted for keys)
|
||||
-- (before activating messages, answer is false)
|
||||
|
||||
Translated (myclass; key : CString) returns CString
|
||||
---Purpose : Returns the item recorded for a key.
|
||||
-- Returns the key itself if :
|
||||
-- - it is not recorded (then, the trace system is activated)
|
||||
-- - MSG has been required to be hung on
|
||||
raises DomainError;
|
||||
-- Raises an exception if not found and if <raising> mode is True
|
||||
|
||||
Record (myclass; key : CString; item : CString)
|
||||
---Purpose : Fills the dictionary with a couple (key-item)
|
||||
-- If a key is already recorded, it is possible to :
|
||||
-- - keep the last definition, and activate the trace system
|
||||
raises DomainError;
|
||||
-- - or raise an exception
|
||||
|
||||
SetTrace (myclass; toprint, torecord : Boolean);
|
||||
---Purpose : Sets the trace system to work when activated, as follow :
|
||||
-- - if <toprint> is True, print immediately on standard output
|
||||
-- - if <torecord> is True, record it for further print
|
||||
|
||||
SetMode (myclass; running, raising : Boolean);
|
||||
---Purpose : Sets the main modes for MSG :
|
||||
-- - if <running> is True, translation works normally
|
||||
-- - if <running> is False, translated item equate keys
|
||||
-- - if <raising> is True, errors (from Record or Translate)
|
||||
-- cause MSG to raise an exception
|
||||
-- - if <raising> is False, MSG runs without exception, then
|
||||
-- see also Trace Modes above
|
||||
|
||||
PrintTrace (myclass; S : in out OStream);
|
||||
---Purpose : Prints the recorded errors (without title; can be empty, this
|
||||
-- is the normally expected case)
|
||||
|
||||
-- some helps : printing rounded floating values
|
||||
|
||||
Intervalled (myclass; val : Real; order : Integer = 3;
|
||||
upper : Boolean = Standard_False)
|
||||
returns Real;
|
||||
---Purpose : Returns an "intervalled" value from a starting real <val> :
|
||||
-- i.e. a value which is rounded on an interval limit
|
||||
-- Interval limits are defined to be in a coarsely "geometric"
|
||||
-- progression (two successive intervals are inside a limit ratio)
|
||||
--
|
||||
-- <order> gives the count of desired intervals in a range <1-10>
|
||||
-- <upper> False, returns the first lower interval (D)
|
||||
-- <upper> True, returns the first upper interval
|
||||
-- Values of Intervals according <order> :
|
||||
-- 0,1 : 1 10 100 ...
|
||||
-- 2 : 1 3 10 30 100 ...
|
||||
-- 3(D): 1 2 5 10 20 50 100 ...
|
||||
-- 4 : 1 2 3 6 10 20 30 60 100 ...
|
||||
-- 6 : 1 1.5 2 3 5 7 10 15 20 ...
|
||||
-- 10 : 1 1.2 1.5 2 2.5 3 4 5 6 8 10 12 15 20 25 ...
|
||||
|
||||
-- coding/decoding dates with strings --
|
||||
|
||||
TDate (myclass; text : CString; yy,mm,dd,hh,mn,ss : Integer;
|
||||
format : CString = "");
|
||||
---Purpose : Codes a date as a text, from its numeric value (-> seconds) :
|
||||
-- YYYY-MM-DD:HH-MN-SS fixed format, completed by leading zeros
|
||||
-- Another format can be provided, as follows :
|
||||
-- C:%d ... C like format, preceeded by C:
|
||||
-- S:... format to call system (not yet implemented)
|
||||
|
||||
NDate (myclass; text : CString; yy,mm,dd,hh,mn,ss : out Integer) returns Boolean;
|
||||
---Purpose : Decodes a date to numeric integer values
|
||||
-- Returns True if OK, False if text does not fit with required
|
||||
-- format. Incomplete forms are allowed (for instance, for only
|
||||
-- YYYY-MM-DD, hour is zero)
|
||||
|
||||
CDate (myclass; text1, text2 : CString) returns Integer;
|
||||
---Purpose : Returns a value about comparison of two dates
|
||||
-- 0 : equal. <0 text1 anterior. >0 text1 posterior
|
||||
|
||||
Blanks (myclass; val : Integer; max : Integer) returns CString;
|
||||
---Purpose : Returns a blank string, of length between 0 and <max>, to fill
|
||||
-- the printing of a numeric value <val>, i.e. :
|
||||
-- If val < 10 , max-1 blanks
|
||||
-- If val between 10 and 99, max-2 blanks ... etc...
|
||||
|
||||
Blanks (myclass; val : CString; max : Integer) returns CString;
|
||||
---Purpose : Returns a blank string, to complete a given string <val> up to
|
||||
-- <max> characters :
|
||||
-- If strlen(val) is 0, max blanks
|
||||
-- If strlen(val) is 5, max-5 blanks etc...
|
||||
|
||||
Blanks (myclass; count : Integer) returns CString;
|
||||
---Purpose : Returns a blank string of <count> blanks (mini 0, maxi 76)
|
||||
|
||||
Print (myclass; S : in out OStream;
|
||||
val : CString; max : Integer; just : Integer = -1);
|
||||
---Purpose : Prints a String on an Output Stream, as follows :
|
||||
-- Accompagned with blanks, to give up to <max> charis at all,
|
||||
-- justified according just :
|
||||
-- -1 (D) : left 0 : center 1 : right
|
||||
-- Maximum 76 characters
|
||||
|
||||
fields
|
||||
|
||||
thekey : CString;
|
||||
theval : PCharacter; -- only if translation is done
|
||||
-- thecont : Character[30]; -- for a short local definition
|
||||
|
||||
end MSG;
|
@@ -11,23 +11,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
|
||||
#include <Interface_MSG.ixx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <Dico_DictionaryOfTransient.hxx>
|
||||
#include <Dico_DictionaryOfInteger.hxx>
|
||||
#include <Dico_DictionaryOfTransient.hxx>
|
||||
#include <Dico_IteratorOfDictionaryOfInteger.hxx>
|
||||
#include <Dico_IteratorOfDictionaryOfTransient.hxx>
|
||||
#include <TColStd_HSequenceOfHAsciiString.hxx>
|
||||
#include <Interface_MSG.hxx>
|
||||
#include <OSD_Process.hxx>
|
||||
#include <Quantity_Date.hxx>
|
||||
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_Stream.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TColStd_HSequenceOfHAsciiString.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
static Handle(Dico_DictionaryOfTransient) thedic;
|
||||
static Handle(Dico_DictionaryOfInteger) thelist;
|
||||
static Handle(TColStd_HSequenceOfHAsciiString) thedup;
|
||||
|
248
src/Interface/Interface_MSG.hxx
Normal file
248
src/Interface/Interface_MSG.hxx
Normal file
@@ -0,0 +1,248 @@
|
||||
// Created on: 1995-03-08
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_MSG_HeaderFile
|
||||
#define _Interface_MSG_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_PCharacter.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_IStream.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_DomainError;
|
||||
|
||||
|
||||
//! This class gives a set of functions to manage and use a list
|
||||
//! of translated messages (messagery)
|
||||
//!
|
||||
//! Keys are strings, their corresponding (i.e. translated) items
|
||||
//! are strings, managed by a dictionary (a global one).
|
||||
//!
|
||||
//! If the dictionary is not set, or if a key is not recorded,
|
||||
//! the key is returned as item, and it is possible to :
|
||||
//! - trace or not this fail, record or not it for further trace
|
||||
//!
|
||||
//! It is also possible to suspend the translation (keys are then
|
||||
//! always returned as items)
|
||||
//!
|
||||
//! This class also provides a file format for loading :
|
||||
//! It is made of couples of lines, the first one begins by '@'
|
||||
//! the following is the key, the second one is the message
|
||||
//! Lines which are empty or which begin by '@@' are skipped
|
||||
class Interface_MSG
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! A MSG is created to write a "functional code" in conjunction
|
||||
//! with operator () attached to Value
|
||||
//! Then, to have a translated message, write in C++ :
|
||||
//!
|
||||
//! Interface_MSG("...mykey...") which returns a CString
|
||||
//! See also some help which follow
|
||||
Standard_EXPORT Interface_MSG(const Standard_CString key);
|
||||
|
||||
//! Translates a message which contains one integer variable
|
||||
//! It is just a help which avoid the following :
|
||||
//! char mess[100]; sprintf(mess,Interface_MSG("code"),ival);
|
||||
//! then AddFail(mess);
|
||||
//! replaced by AddFail (Interface_MSG("code",ival));
|
||||
//!
|
||||
//! The basic message is intended to be in C-sprintf format,
|
||||
//! with one %d form in it
|
||||
Standard_EXPORT Interface_MSG(const Standard_CString key, const Standard_Integer i1);
|
||||
|
||||
//! Translates a message which contains two integer variables
|
||||
//! As for one integer, it is just a writing help
|
||||
//!
|
||||
//! The basic message is intended to be in C-sprintf format
|
||||
//! with two %d forms in it
|
||||
Standard_EXPORT Interface_MSG(const Standard_CString key, const Standard_Integer i1, const Standard_Integer i2);
|
||||
|
||||
//! Translates a message which contains one real variable
|
||||
//! <intervals> if set, commands the variable to be rounded to an
|
||||
//! interval (see below, method Intervals)
|
||||
//! As for one integer, it is just a writing help
|
||||
//!
|
||||
//! The basic message is intended to be in C-sprintf format
|
||||
//! with one %f form (or equivalent : %e etc) in it
|
||||
Standard_EXPORT Interface_MSG(const Standard_CString key, const Standard_Real r1, const Standard_Integer intervals = -1);
|
||||
|
||||
//! Translates a message which contains one string variable
|
||||
//! As for one integer, it is just a writing help
|
||||
//!
|
||||
//! The basic message is intended to be in C-sprintf format
|
||||
//! with one %s form in it
|
||||
Standard_EXPORT Interface_MSG(const Standard_CString key, const Standard_CString str);
|
||||
|
||||
//! Translates a message which contains one integer and one
|
||||
//! string variables
|
||||
//! As for one integer, it is just a writing help
|
||||
//! Used for instance to say "Param n0.<ival> i.e. <str> is not.."
|
||||
//!
|
||||
//! The basic message is intended to be in C-sprintf format
|
||||
//! with one %d then one %s forms in it
|
||||
Standard_EXPORT Interface_MSG(const Standard_CString key, const Standard_Integer ival, const Standard_CString str);
|
||||
|
||||
//! Optimised destructor (applies for additional forms of Create)
|
||||
Standard_EXPORT void Destroy();
|
||||
~Interface_MSG()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
//! Returns the translated message, in a functional form with
|
||||
//! operator ()
|
||||
//! was C++ : return const
|
||||
Standard_EXPORT Standard_CString Value() const;
|
||||
operator Standard_CString() const;
|
||||
|
||||
//! Reads a list of messages from a stream, returns read count
|
||||
//! 0 means empty file, -1 means error
|
||||
Standard_EXPORT static Standard_Integer Read (Standard_IStream& S);
|
||||
|
||||
//! Reads a list of messages from a file defined by its name
|
||||
Standard_EXPORT static Standard_Integer Read (const Standard_CString file);
|
||||
|
||||
//! Writes the list of messages recorded to be translated, to a
|
||||
//! stream. Writes all the list (Default) or only keys which begin
|
||||
//! by <rootkey>. Returns the count of written messages
|
||||
Standard_EXPORT static Standard_Integer Write (Standard_OStream& S, const Standard_CString rootkey = "");
|
||||
|
||||
//! Returns True if a given message is surely a key
|
||||
//! (according to the form adopted for keys)
|
||||
//! (before activating messages, answer is false)
|
||||
Standard_EXPORT static Standard_Boolean IsKey (const Standard_CString mess);
|
||||
|
||||
//! Returns the item recorded for a key.
|
||||
//! Returns the key itself if :
|
||||
//! - it is not recorded (then, the trace system is activated)
|
||||
//! - MSG has been required to be hung on
|
||||
Standard_EXPORT static Standard_CString Translated (const Standard_CString key);
|
||||
|
||||
//! Fills the dictionary with a couple (key-item)
|
||||
//! If a key is already recorded, it is possible to :
|
||||
//! - keep the last definition, and activate the trace system
|
||||
Standard_EXPORT static void Record (const Standard_CString key, const Standard_CString item);
|
||||
|
||||
//! Sets the trace system to work when activated, as follow :
|
||||
//! - if <toprint> is True, print immediately on standard output
|
||||
//! - if <torecord> is True, record it for further print
|
||||
Standard_EXPORT static void SetTrace (const Standard_Boolean toprint, const Standard_Boolean torecord);
|
||||
|
||||
//! Sets the main modes for MSG :
|
||||
//! - if <running> is True, translation works normally
|
||||
//! - if <running> is False, translated item equate keys
|
||||
//! - if <raising> is True, errors (from Record or Translate)
|
||||
//! cause MSG to raise an exception
|
||||
//! - if <raising> is False, MSG runs without exception, then
|
||||
//! see also Trace Modes above
|
||||
Standard_EXPORT static void SetMode (const Standard_Boolean running, const Standard_Boolean raising);
|
||||
|
||||
//! Prints the recorded errors (without title; can be empty, this
|
||||
//! is the normally expected case)
|
||||
Standard_EXPORT static void PrintTrace (Standard_OStream& S);
|
||||
|
||||
//! Returns an "intervalled" value from a starting real <val> :
|
||||
//! i.e. a value which is rounded on an interval limit
|
||||
//! Interval limits are defined to be in a coarsely "geometric"
|
||||
//! progression (two successive intervals are inside a limit ratio)
|
||||
//!
|
||||
//! <order> gives the count of desired intervals in a range <1-10>
|
||||
//! <upper> False, returns the first lower interval (D)
|
||||
//! <upper> True, returns the first upper interval
|
||||
//! Values of Intervals according <order> :
|
||||
//! 0,1 : 1 10 100 ...
|
||||
//! 2 : 1 3 10 30 100 ...
|
||||
//! 3(D): 1 2 5 10 20 50 100 ...
|
||||
//! 4 : 1 2 3 6 10 20 30 60 100 ...
|
||||
//! 6 : 1 1.5 2 3 5 7 10 15 20 ...
|
||||
//! 10 : 1 1.2 1.5 2 2.5 3 4 5 6 8 10 12 15 20 25 ...
|
||||
Standard_EXPORT static Standard_Real Intervalled (const Standard_Real val, const Standard_Integer order = 3, const Standard_Boolean upper = Standard_False);
|
||||
|
||||
//! Codes a date as a text, from its numeric value (-> seconds) :
|
||||
//! YYYY-MM-DD:HH-MN-SS fixed format, completed by leading zeros
|
||||
//! Another format can be provided, as follows :
|
||||
//! C:%d ... C like format, preceeded by C:
|
||||
//! S:... format to call system (not yet implemented)
|
||||
Standard_EXPORT static void TDate (const Standard_CString text, const Standard_Integer yy, const Standard_Integer mm, const Standard_Integer dd, const Standard_Integer hh, const Standard_Integer mn, const Standard_Integer ss, const Standard_CString format = "");
|
||||
|
||||
//! Decodes a date to numeric integer values
|
||||
//! Returns True if OK, False if text does not fit with required
|
||||
//! format. Incomplete forms are allowed (for instance, for only
|
||||
//! YYYY-MM-DD, hour is zero)
|
||||
Standard_EXPORT static Standard_Boolean NDate (const Standard_CString text, Standard_Integer& yy, Standard_Integer& mm, Standard_Integer& dd, Standard_Integer& hh, Standard_Integer& mn, Standard_Integer& ss);
|
||||
|
||||
//! Returns a value about comparison of two dates
|
||||
//! 0 : equal. <0 text1 anterior. >0 text1 posterior
|
||||
Standard_EXPORT static Standard_Integer CDate (const Standard_CString text1, const Standard_CString text2);
|
||||
|
||||
//! Returns a blank string, of length between 0 and <max>, to fill
|
||||
//! the printing of a numeric value <val>, i.e. :
|
||||
//! If val < 10 , max-1 blanks
|
||||
//! If val between 10 and 99, max-2 blanks ... etc...
|
||||
Standard_EXPORT static Standard_CString Blanks (const Standard_Integer val, const Standard_Integer max);
|
||||
|
||||
//! Returns a blank string, to complete a given string <val> up to
|
||||
//! <max> characters :
|
||||
//! If strlen(val) is 0, max blanks
|
||||
//! If strlen(val) is 5, max-5 blanks etc...
|
||||
Standard_EXPORT static Standard_CString Blanks (const Standard_CString val, const Standard_Integer max);
|
||||
|
||||
//! Returns a blank string of <count> blanks (mini 0, maxi 76)
|
||||
Standard_EXPORT static Standard_CString Blanks (const Standard_Integer count);
|
||||
|
||||
//! Prints a String on an Output Stream, as follows :
|
||||
//! Accompagned with blanks, to give up to <max> charis at all,
|
||||
//! justified according just :
|
||||
//! -1 (D) : left 0 : center 1 : right
|
||||
//! Maximum 76 characters
|
||||
Standard_EXPORT static void Print (Standard_OStream& S, const Standard_CString val, const Standard_Integer max, const Standard_Integer just = -1);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_CString thekey;
|
||||
Standard_PCharacter theval;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_MSG_HeaderFile
|
@@ -1,32 +0,0 @@
|
||||
-- Created on: 2003-05-06
|
||||
-- Created by: Galina KULIKOVA
|
||||
-- Copyright (c) 2003-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class MapAsciiStringHasher from Interface
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
AsciiString from TCollection
|
||||
|
||||
|
||||
is
|
||||
|
||||
|
||||
HashCode(myclass; K : AsciiString from TCollection ; Upper : Integer) returns Integer;
|
||||
IsEqual(myclass; K1, K2 : AsciiString from TCollection) returns Boolean;
|
||||
|
||||
|
||||
|
||||
end MapAsciiStringHasher;
|
@@ -11,14 +11,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_MapAsciiStringHasher.ixx>
|
||||
|
||||
#include <Interface_MapAsciiStringHasher.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : HashCode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Interface_MapAsciiStringHasher::HashCode(const TCollection_AsciiString& K,
|
||||
const Standard_Integer Upper)
|
||||
{
|
||||
|
63
src/Interface/Interface_MapAsciiStringHasher.hxx
Normal file
63
src/Interface/Interface_MapAsciiStringHasher.hxx
Normal file
@@ -0,0 +1,63 @@
|
||||
// Created on: 2003-05-06
|
||||
// Created by: Galina KULIKOVA
|
||||
// Copyright (c) 2003-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_MapAsciiStringHasher_HeaderFile
|
||||
#define _Interface_MapAsciiStringHasher_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
|
||||
class Interface_MapAsciiStringHasher
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT static Standard_Integer HashCode (const TCollection_AsciiString& K, const Standard_Integer Upper);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean IsEqual (const TCollection_AsciiString& K1, const TCollection_AsciiString& K2);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_MapAsciiStringHasher_HeaderFile
|
76
src/Interface/Interface_NodeOfGeneralLib.hxx
Normal file
76
src/Interface/Interface_NodeOfGeneralLib.hxx
Normal file
@@ -0,0 +1,76 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_NodeOfGeneralLib_HeaderFile
|
||||
#define _Interface_NodeOfGeneralLib_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
class Interface_GlobalNodeOfGeneralLib;
|
||||
class Standard_Transient;
|
||||
class Interface_GeneralModule;
|
||||
class Interface_Protocol;
|
||||
class Interface_GeneralLib;
|
||||
|
||||
|
||||
class Interface_NodeOfGeneralLib;
|
||||
DEFINE_STANDARD_HANDLE(Interface_NodeOfGeneralLib, MMgt_TShared)
|
||||
|
||||
|
||||
class Interface_NodeOfGeneralLib : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT Interface_NodeOfGeneralLib();
|
||||
|
||||
Standard_EXPORT void AddNode (const Handle(Interface_GlobalNodeOfGeneralLib)& anode);
|
||||
|
||||
Standard_EXPORT const Handle(Interface_GeneralModule)& Module() const;
|
||||
|
||||
Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
|
||||
|
||||
Standard_EXPORT const Handle(Interface_NodeOfGeneralLib)& Next() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_NodeOfGeneralLib,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Interface_GlobalNodeOfGeneralLib) thenode;
|
||||
Handle(Interface_NodeOfGeneralLib) thenext;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_NodeOfGeneralLib_HeaderFile
|
54
src/Interface/Interface_NodeOfGeneralLib_0.cxx
Normal file
54
src/Interface/Interface_NodeOfGeneralLib_0.cxx
Normal file
@@ -0,0 +1,54 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_NodeOfGeneralLib.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Interface_GlobalNodeOfGeneralLib.hxx>
|
||||
#include <Interface_NodeOfGeneralLib.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Interface_GeneralModule.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_GeneralLib.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheObject Handle(Standard_Transient)
|
||||
#define TheObject_hxx <Standard_Transient.hxx>
|
||||
#define Handle_TheModule Handle(Interface_GeneralModule)
|
||||
#define TheModule Interface_GeneralModule
|
||||
#define TheModule_hxx <Interface_GeneralModule.hxx>
|
||||
#define Handle_TheProtocol Handle(Interface_Protocol)
|
||||
#define TheProtocol Interface_Protocol
|
||||
#define TheProtocol_hxx <Interface_Protocol.hxx>
|
||||
#define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib
|
||||
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfGeneralLib.hxx>
|
||||
#define LibCtl_Node Interface_NodeOfGeneralLib
|
||||
#define LibCtl_Node_hxx <Interface_NodeOfGeneralLib.hxx>
|
||||
#define Handle_LibCtl_GlobalNode Handle(Interface_GlobalNodeOfGeneralLib)
|
||||
#define Handle_LibCtl_Node Handle(Interface_NodeOfGeneralLib)
|
||||
#define LibCtl_Library Interface_GeneralLib
|
||||
#define LibCtl_Library_hxx <Interface_GeneralLib.hxx>
|
||||
#include <LibCtl_Node.gxx>
|
||||
|
76
src/Interface/Interface_NodeOfReaderLib.hxx
Normal file
76
src/Interface/Interface_NodeOfReaderLib.hxx
Normal file
@@ -0,0 +1,76 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Interface_NodeOfReaderLib_HeaderFile
|
||||
#define _Interface_NodeOfReaderLib_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
class Interface_GlobalNodeOfReaderLib;
|
||||
class Standard_Transient;
|
||||
class Interface_ReaderModule;
|
||||
class Interface_Protocol;
|
||||
class Interface_ReaderLib;
|
||||
|
||||
|
||||
class Interface_NodeOfReaderLib;
|
||||
DEFINE_STANDARD_HANDLE(Interface_NodeOfReaderLib, MMgt_TShared)
|
||||
|
||||
|
||||
class Interface_NodeOfReaderLib : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT Interface_NodeOfReaderLib();
|
||||
|
||||
Standard_EXPORT void AddNode (const Handle(Interface_GlobalNodeOfReaderLib)& anode);
|
||||
|
||||
Standard_EXPORT const Handle(Interface_ReaderModule)& Module() const;
|
||||
|
||||
Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const;
|
||||
|
||||
Standard_EXPORT const Handle(Interface_NodeOfReaderLib)& Next() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_NodeOfReaderLib,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Interface_GlobalNodeOfReaderLib) thenode;
|
||||
Handle(Interface_NodeOfReaderLib) thenext;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_NodeOfReaderLib_HeaderFile
|
54
src/Interface/Interface_NodeOfReaderLib_0.cxx
Normal file
54
src/Interface/Interface_NodeOfReaderLib_0.cxx
Normal file
@@ -0,0 +1,54 @@
|
||||
// Created on: 1992-02-03
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_NodeOfReaderLib.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Interface_GlobalNodeOfReaderLib.hxx>
|
||||
#include <Interface_NodeOfReaderLib.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Interface_ReaderModule.hxx>
|
||||
#include <Interface_Protocol.hxx>
|
||||
#include <Interface_ReaderLib.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheObject Handle(Standard_Transient)
|
||||
#define TheObject_hxx <Standard_Transient.hxx>
|
||||
#define Handle_TheModule Handle(Interface_ReaderModule)
|
||||
#define TheModule Interface_ReaderModule
|
||||
#define TheModule_hxx <Interface_ReaderModule.hxx>
|
||||
#define Handle_TheProtocol Handle(Interface_Protocol)
|
||||
#define TheProtocol Interface_Protocol
|
||||
#define TheProtocol_hxx <Interface_Protocol.hxx>
|
||||
#define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib
|
||||
#define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfReaderLib.hxx>
|
||||
#define LibCtl_Node Interface_NodeOfReaderLib
|
||||
#define LibCtl_Node_hxx <Interface_NodeOfReaderLib.hxx>
|
||||
#define Handle_LibCtl_GlobalNode Handle(Interface_GlobalNodeOfReaderLib)
|
||||
#define Handle_LibCtl_Node Handle(Interface_NodeOfReaderLib)
|
||||
#define LibCtl_Library Interface_ReaderLib
|
||||
#define LibCtl_Library_hxx <Interface_ReaderLib.hxx>
|
||||
#include <LibCtl_Node.gxx>
|
||||
|
@@ -1,78 +0,0 @@
|
||||
-- Created on: 2008-01-21
|
||||
-- Created by: Galina KULIKOVA
|
||||
-- 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 ParamList from Interface inherits TShared from MMgt
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
FileParameter from Interface,VectorOfFileParameter from Interface
|
||||
|
||||
raises RangeError from Standard,
|
||||
OutOfRange from Standard,
|
||||
OutOfMemory from Standard
|
||||
is
|
||||
|
||||
Create( theIncrement : Integer = 256) returns ParamList from Interface;
|
||||
---Purpose: Creates an vector with size of memmory blok equal to theIncrement
|
||||
|
||||
|
||||
Length (me) returns Integer from Standard;
|
||||
---Purpose: Returns the number of elements of <me>.
|
||||
--
|
||||
---C++: inline
|
||||
|
||||
Lower (me) returns Integer from Standard;
|
||||
---Purpose: Returns the lower bound.
|
||||
-- Warning
|
||||
--Client programs of the Array1 class must be independent of the first item range.--
|
||||
---C++: inline
|
||||
|
||||
Upper (me) returns Integer from Standard;
|
||||
---Purpose: Returns the upper bound.
|
||||
-- Warning
|
||||
--Client programs of the Array1 class must be independent of the first item range.--
|
||||
---C++: inline
|
||||
|
||||
SetValue (me : mutable; Index: Integer from Standard; Value: FileParameter from Interface)
|
||||
---Purpose: Assigns the value <Value> to the <Index>-th item of this array.
|
||||
raises OutOfRange from Standard;
|
||||
|
||||
Value (me; Index:Integer from Standard) returns FileParameter from Interface
|
||||
---Purpose: Return the value of the <Index>th element of the
|
||||
-- array.
|
||||
---C++: alias operator ()
|
||||
---C++: return const &
|
||||
raises OutOfRange from Standard;
|
||||
|
||||
ChangeValue (me: mutable; Index:Integer from Standard) returns FileParameter from Interface
|
||||
---Purpose: return the value of the <Index>th element of the
|
||||
-- array.
|
||||
--
|
||||
---C++: alias operator ()
|
||||
---C++: return &
|
||||
raises OutOfRange from Standard;
|
||||
|
||||
Clear(me: mutable);
|
||||
|
||||
|
||||
|
||||
|
||||
fields
|
||||
|
||||
|
||||
myVector : VectorOfFileParameter;
|
||||
|
||||
end ParamList;
|
@@ -13,13 +13,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Interface_ParamList.ixx>
|
||||
|
||||
#include <Interface_FileParameter.hxx>
|
||||
#include <Interface_ParamList.hxx>
|
||||
#include <Standard_OutOfMemory.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_RangeError.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Interface_ParamList
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Interface_ParamList::Interface_ParamList(const Standard_Integer theIncrement) :
|
||||
myVector (theIncrement)
|
||||
{
|
||||
|
101
src/Interface/Interface_ParamList.hxx
Normal file
101
src/Interface/Interface_ParamList.hxx
Normal file
@@ -0,0 +1,101 @@
|
||||
// Created on: 2008-01-21
|
||||
// Created by: Galina KULIKOVA
|
||||
// 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 _Interface_ParamList_HeaderFile
|
||||
#define _Interface_ParamList_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Interface_VectorOfFileParameter.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Standard_RangeError;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_OutOfMemory;
|
||||
class Interface_FileParameter;
|
||||
|
||||
|
||||
class Interface_ParamList;
|
||||
DEFINE_STANDARD_HANDLE(Interface_ParamList, MMgt_TShared)
|
||||
|
||||
|
||||
class Interface_ParamList : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an vector with size of memmory blok equal to theIncrement
|
||||
Standard_EXPORT Interface_ParamList(const Standard_Integer theIncrement = 256);
|
||||
|
||||
//! Returns the number of elements of <me>.
|
||||
Standard_Integer Length() const;
|
||||
|
||||
//! Returns the lower bound.
|
||||
//! Warning
|
||||
Standard_Integer Lower() const;
|
||||
|
||||
//! Returns the upper bound.
|
||||
//! Warning
|
||||
Standard_Integer Upper() const;
|
||||
|
||||
//! Assigns the value <Value> to the <Index>-th item of this array.
|
||||
Standard_EXPORT void SetValue (const Standard_Integer Index, const Interface_FileParameter& Value);
|
||||
|
||||
//! Return the value of the <Index>th element of the
|
||||
//! array.
|
||||
Standard_EXPORT const Interface_FileParameter& Value (const Standard_Integer Index) const;
|
||||
const Interface_FileParameter& operator () (const Standard_Integer Index) const
|
||||
{
|
||||
return Value(Index);
|
||||
}
|
||||
|
||||
//! return the value of the <Index>th element of the
|
||||
//! array.
|
||||
Standard_EXPORT Interface_FileParameter& ChangeValue (const Standard_Integer Index);
|
||||
Interface_FileParameter& operator () (const Standard_Integer Index)
|
||||
{
|
||||
return ChangeValue(Index);
|
||||
}
|
||||
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Interface_ParamList,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Interface_VectorOfFileParameter myVector;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Interface_ParamList.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Interface_ParamList_HeaderFile
|
@@ -1,90 +0,0 @@
|
||||
-- Created on: 1992-10-29
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class ParamSet from Interface inherits TShared
|
||||
|
||||
---Purpose : Defines an ordered set of FileParameters, in a way to be
|
||||
-- efficient as in memory requirement or in speed
|
||||
|
||||
uses CString, ParamList, FileParameter, ParamType
|
||||
|
||||
raises OutOfRange
|
||||
|
||||
is
|
||||
|
||||
Create (nres : Integer; nst : Integer = 1) returns ParamSet;
|
||||
---Purpose : Creates an empty ParamSet, beginning at number "nst" and of
|
||||
-- initial reservation "nres" : the "nres" first parameters
|
||||
-- which follow "ndeb" (included) will be put in an Array
|
||||
-- (a ParamList). The remainders are set in Next(s) ParamSet(s)
|
||||
|
||||
Append (me : mutable; val : CString; lnval : Integer; typ : ParamType;
|
||||
nument : Integer)
|
||||
returns Integer is static;
|
||||
---Purpose : Adds a parameter defined as its Value (CString and length) and
|
||||
-- Type. Optionnal EntityNumber (for FileReaderData) can be given
|
||||
-- Allows a better memory management than Appending a
|
||||
-- complete FileParameter
|
||||
-- If <lnval> < 0, <val> is assumed to be managed elsewhere : its
|
||||
-- adress is stored as such. Else, <val> is copied in a locally
|
||||
-- (quickly) managed Page of Characters
|
||||
-- Returns new count of recorded Parameters
|
||||
|
||||
Append (me : mutable; FP : FileParameter) returns Integer is static;
|
||||
---Purpose : Adds a parameter at the end of the ParamSet (transparent
|
||||
-- about reservation and "Next")
|
||||
-- Returns new count of recorded Parameters
|
||||
|
||||
NbParams (me) returns Integer is static;
|
||||
---Purpose : Returns the total count of parameters (including nexts)
|
||||
|
||||
Param (me; num : Integer) returns FileParameter
|
||||
---Purpose : Returns a parameter identified by its number
|
||||
raises OutOfRange is static;
|
||||
-- Error if num < 1 or num > NbParams
|
||||
---C++ : return const &
|
||||
|
||||
ChangeParam (me : mutable; num : Integer) returns FileParameter
|
||||
---Purpose : Same as above, but in order to be modified on place
|
||||
raises OutOfRange is static;
|
||||
-- Error if num < 1 or num > NbParams
|
||||
---C++ : return &
|
||||
|
||||
SetParam (me : mutable; num : Integer; FP : FileParameter)
|
||||
raises OutOfRange is static;
|
||||
---Purpose : Changes a parameter identified by its number
|
||||
|
||||
Params (me; num,nb : Integer) returns ParamList
|
||||
raises OutOfRange is static;
|
||||
---Purpose : Builds and returns the sub-list correspinding to parameters,
|
||||
-- from "num" included, with count "nb"
|
||||
-- If <num> and <nb> are zero, returns the whole list
|
||||
|
||||
Destroy (me : mutable) is static;
|
||||
---Purpose : Destructor (waiting for transparent memory management)
|
||||
---C++ : alias ~
|
||||
|
||||
fields
|
||||
|
||||
theval : PCharacter;
|
||||
thelnval : Integer;
|
||||
thelnres : Integer;
|
||||
thenbpar : Integer;
|
||||
themxpar : Integer;
|
||||
thelist : ParamList;
|
||||
thenext : ParamSet;
|
||||
|
||||
end ParamSet;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user