From 69204992fbe19677405d802283868c46f7d57bed Mon Sep 17 00:00:00 2001 From: prascle Date: Fri, 9 Jan 2004 14:27:26 +0000 Subject: [PATCH] PR: Bug Kernel4564 (add attributes) --- idl/SALOMEDS_Attributes.idl | 40 ++++++ .../Handle_SALOMEDS_ExternalFileDef.hxx | 85 +++++++++++++ src/SALOMEDS/Handle_SALOMEDS_FileType.hxx | 85 +++++++++++++ src/SALOMEDS/Makefile.in | 4 + src/SALOMEDS/README_attributes | 46 +++++++ .../SALOMEDS_AttributeExternalFileDef_i.cxx | 48 ++++++++ .../SALOMEDS_AttributeExternalFileDef_i.hxx | 56 +++++++++ src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx | 48 ++++++++ src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx | 56 +++++++++ src/SALOMEDS/SALOMEDS_ExternalFileDef.cdl | 76 ++++++++++++ src/SALOMEDS/SALOMEDS_ExternalFileDef.cxx | 114 ++++++++++++++++++ src/SALOMEDS/SALOMEDS_ExternalFileDef.hxx | 108 +++++++++++++++++ src/SALOMEDS/SALOMEDS_ExternalFileDef.ixx | 73 +++++++++++ src/SALOMEDS/SALOMEDS_ExternalFileDef.jxx | 18 +++ src/SALOMEDS/SALOMEDS_FileType.cdl | 76 ++++++++++++ src/SALOMEDS/SALOMEDS_FileType.cxx | 114 ++++++++++++++++++ src/SALOMEDS/SALOMEDS_FileType.hxx | 108 +++++++++++++++++ src/SALOMEDS/SALOMEDS_FileType.ixx | 73 +++++++++++ src/SALOMEDS/SALOMEDS_FileType.jxx | 18 +++ src/SALOMEDS/SALOMEDS_SObject_i.cxx | 24 ++++ src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx | 32 +++++ 21 files changed, 1302 insertions(+) create mode 100644 src/SALOMEDS/Handle_SALOMEDS_ExternalFileDef.hxx create mode 100644 src/SALOMEDS/Handle_SALOMEDS_FileType.hxx create mode 100644 src/SALOMEDS/README_attributes create mode 100644 src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx create mode 100644 src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx create mode 100644 src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx create mode 100644 src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx create mode 100644 src/SALOMEDS/SALOMEDS_ExternalFileDef.cdl create mode 100644 src/SALOMEDS/SALOMEDS_ExternalFileDef.cxx create mode 100644 src/SALOMEDS/SALOMEDS_ExternalFileDef.hxx create mode 100644 src/SALOMEDS/SALOMEDS_ExternalFileDef.ixx create mode 100644 src/SALOMEDS/SALOMEDS_ExternalFileDef.jxx create mode 100644 src/SALOMEDS/SALOMEDS_FileType.cdl create mode 100644 src/SALOMEDS/SALOMEDS_FileType.cxx create mode 100644 src/SALOMEDS/SALOMEDS_FileType.hxx create mode 100644 src/SALOMEDS/SALOMEDS_FileType.ixx create mode 100644 src/SALOMEDS/SALOMEDS_FileType.jxx diff --git a/idl/SALOMEDS_Attributes.idl b/idl/SALOMEDS_Attributes.idl index b47f39bea..fca28960a 100644 --- a/idl/SALOMEDS_Attributes.idl +++ b/idl/SALOMEDS_Attributes.idl @@ -275,6 +275,46 @@ module SALOMEDS void SetValue(in string value); }; + //========================================================================== +/*! \brief External File definition + + This attribute stores a path to an External File. +*/ + //========================================================================== + interface AttributeExternalFileDef: GenericAttribute + { +/*! + Returns the value of this attribute +
See also an example of this method usage in batchmode of %SALOME application. +*/ + string Value(); +/*! + Sets the value of this attribute +
See also an example of this method usage in batchmode of %SALOME application. +*/ + void SetValue(in string value); + }; + + //========================================================================== +/*! \brief File Type definition + + This attribute stores an external File Type (see ExternalFileDef attribute). +*/ + //========================================================================== + interface AttributeFileType: GenericAttribute + { +/*! + Returns the value of this attribute +
See also an example of this method usage in batchmode of %SALOME application. +*/ + string Value(); +/*! + Sets the value of this attribute +
See also an example of this method usage in batchmode of %SALOME application. +*/ + void SetValue(in string value); + }; + //========================================================================== //Below the list of presentation attributes for display study tree in browser //========================================================================== diff --git a/src/SALOMEDS/Handle_SALOMEDS_ExternalFileDef.hxx b/src/SALOMEDS/Handle_SALOMEDS_ExternalFileDef.hxx new file mode 100644 index 000000000..124e721c3 --- /dev/null +++ b/src/SALOMEDS/Handle_SALOMEDS_ExternalFileDef.hxx @@ -0,0 +1,85 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991,1995 by +// +// MATRA DATAVISION, FRANCE +// +// This software is furnished in accordance with the terms and conditions +// of the contract and with the inclusion of the above copyright notice. +// This software or any other copy thereof may not be provided or otherwise +// be made available to any other person. No title to an ownership of the +// software is hereby transferred. +// +// At the termination of the contract, the software and all copies of this +// software must be deleted. + +#ifndef _Handle_SALOMEDS_ExternalFileDef_HeaderFile +#define _Handle_SALOMEDS_ExternalFileDef_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TDataStd_Comment_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TDataStd_Comment); +class SALOMEDS_ExternalFileDef; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SALOMEDS_ExternalFileDef); + +class Handle(SALOMEDS_ExternalFileDef) : public Handle(TDataStd_Comment) { + public: + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + Handle(SALOMEDS_ExternalFileDef)():Handle(TDataStd_Comment)() {} + Handle(SALOMEDS_ExternalFileDef)(const Handle(SALOMEDS_ExternalFileDef)& aHandle) : Handle(TDataStd_Comment)(aHandle) + { + } + + Handle(SALOMEDS_ExternalFileDef)(const SALOMEDS_ExternalFileDef* anItem) : Handle(TDataStd_Comment)((TDataStd_Comment *)anItem) + { + } + + Handle(SALOMEDS_ExternalFileDef)& operator=(const Handle(SALOMEDS_ExternalFileDef)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(SALOMEDS_ExternalFileDef)& operator=(const SALOMEDS_ExternalFileDef* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + SALOMEDS_ExternalFileDef* operator->() + { + return (SALOMEDS_ExternalFileDef *)ControlAccess(); + } + + SALOMEDS_ExternalFileDef* operator->() const + { + return (SALOMEDS_ExternalFileDef *)ControlAccess(); + } + + Standard_EXPORT ~Handle(SALOMEDS_ExternalFileDef)(); + + Standard_EXPORT static const Handle(SALOMEDS_ExternalFileDef) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/SALOMEDS/Handle_SALOMEDS_FileType.hxx b/src/SALOMEDS/Handle_SALOMEDS_FileType.hxx new file mode 100644 index 000000000..24b684f29 --- /dev/null +++ b/src/SALOMEDS/Handle_SALOMEDS_FileType.hxx @@ -0,0 +1,85 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991,1995 by +// +// MATRA DATAVISION, FRANCE +// +// This software is furnished in accordance with the terms and conditions +// of the contract and with the inclusion of the above copyright notice. +// This software or any other copy thereof may not be provided or otherwise +// be made available to any other person. No title to an ownership of the +// software is hereby transferred. +// +// At the termination of the contract, the software and all copies of this +// software must be deleted. + +#ifndef _Handle_SALOMEDS_FileType_HeaderFile +#define _Handle_SALOMEDS_FileType_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TDataStd_Comment_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TDataStd_Comment); +class SALOMEDS_FileType; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SALOMEDS_FileType); + +class Handle(SALOMEDS_FileType) : public Handle(TDataStd_Comment) { + public: + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + Handle(SALOMEDS_FileType)():Handle(TDataStd_Comment)() {} + Handle(SALOMEDS_FileType)(const Handle(SALOMEDS_FileType)& aHandle) : Handle(TDataStd_Comment)(aHandle) + { + } + + Handle(SALOMEDS_FileType)(const SALOMEDS_FileType* anItem) : Handle(TDataStd_Comment)((TDataStd_Comment *)anItem) + { + } + + Handle(SALOMEDS_FileType)& operator=(const Handle(SALOMEDS_FileType)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(SALOMEDS_FileType)& operator=(const SALOMEDS_FileType* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + SALOMEDS_FileType* operator->() + { + return (SALOMEDS_FileType *)ControlAccess(); + } + + SALOMEDS_FileType* operator->() const + { + return (SALOMEDS_FileType *)ControlAccess(); + } + + Standard_EXPORT ~Handle(SALOMEDS_FileType)(); + + Standard_EXPORT static const Handle(SALOMEDS_FileType) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/SALOMEDS/Makefile.in b/src/SALOMEDS/Makefile.in index 4fe2c6f90..394cd98d9 100644 --- a/src/SALOMEDS/Makefile.in +++ b/src/SALOMEDS/Makefile.in @@ -50,8 +50,12 @@ LIB_SRC = \ SALOMEDS_OCAFApplication.cxx \ SALOMEDS_GenericAttribute_i.cxx \ SALOMEDS_IORAttribute.cxx \ + SALOMEDS_ExternalFileDef.cxx \ + SALOMEDS_FileType.cxx \ SALOMEDS_PersRefAttribute.cxx \ SALOMEDS_AttributeComment_i.cxx \ + SALOMEDS_AttributeExternalFileDef_i.cxx \ + SALOMEDS_AttributeFileType_i.cxx \ SALOMEDS_AttributeIOR_i.cxx \ SALOMEDS_AttributeInteger_i.cxx \ SALOMEDS_AttributeName_i.cxx \ diff --git a/src/SALOMEDS/README_attributes b/src/SALOMEDS/README_attributes new file mode 100644 index 000000000..b0c4ff789 --- /dev/null +++ b/src/SALOMEDS/README_attributes @@ -0,0 +1,46 @@ + +$Header$ + +How to add a new attribute (without WOK): +----------------------------------------- + +This works only for simple types (ex: string) + +example: add attribute FileType (string) + +# new files (copied from files specific to ExternalFileDef attribute = string): + +? src/SALOMEDS/Handle_SALOMEDS_FileType.hxx <--- Handle_SALOMEDS_ExternalFileDef.hxx +? src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx <--- SALOMEDS_AttributeExternalFileDef_i.cxx +? src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx <--- SALOMEDS_AttributeExternalFileDef_i.hxx +? src/SALOMEDS/SALOMEDS_FileType.cdl <--- SALOMEDS_ExternalFileDef.cdl +? src/SALOMEDS/SALOMEDS_FileType.cxx <--- SALOMEDS_ExternalFileDef.cxx +? src/SALOMEDS/SALOMEDS_FileType.hxx <--- SALOMEDS_ExternalFileDef.hxx +? src/SALOMEDS/SALOMEDS_FileType.ixx <--- SALOMEDS_ExternalFileDef.ixx +? src/SALOMEDS/SALOMEDS_FileType.jxx <--- SALOMEDS_ExternalFileDef.jxx + +# files modified: + +M idl/SALOMEDS_Attributes.idl +M src/SALOMEDS/Makefile.in +M src/SALOMEDS/SALOMEDS_SObject_i.cxx +M src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx + +# detailled modifications: + +- in new files, +change ExternalFileDef in FileType everywhere +- in SALOMEDS_FileType.cxx, +Standard_GUID (Global Universal IDentifier) must be changed. +To obtain a new GUID, it is possible to use guidgen.exe on windows (with visual C++). + +- in src/SALOMEDS/Makefile.in, +add under LIB_SRC = \ + SALOMEDS_FileType.cxx \ + SALOMEDS_AttributeExternalFileDef_i.cxx \ + +- in src/SALOMEDS/SALOMEDS_SObject_i.cxx, +- in src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx, +- in idl/SALOMEDS_Attributes.idl, +find portions of code containing ExternalFileDef, duplicate and replace + diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx new file mode 100644 index 000000000..94e2a313d --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx @@ -0,0 +1,48 @@ +// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOMEDS_AttributeExternalFileDef_i.cxx +// Author : Yves FRICAUD +// Module : SALOME +// $Header$ + +using namespace std; +#include "SALOMEDS_AttributeExternalFileDef_i.hxx" + +#include +#include "SALOMEDS_SObject_i.hxx" + +char* SALOMEDS_AttributeExternalFileDef_i::Value() +{ + TCollection_ExtendedString S = Handle(SALOMEDS_ExternalFileDef)::DownCast(_myAttr)->Get(); + CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString()); + return c_s._retn(); +} + +void SALOMEDS_AttributeExternalFileDef_i::SetValue(const char* value) +{ + CheckLocked(); + CORBA::String_var Str = CORBA::string_dup(value); + // Handle(SALOMEDS_ExternalFileDef)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); + Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); +} diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx new file mode 100644 index 000000000..b6d5244a7 --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx @@ -0,0 +1,56 @@ +// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOMEDS_AttributeExternalFileDef_i.hxx +// Author : Yves FRICAUD +// Module : SALOME +// $Header$ + +#ifndef SALOMEDS_AttributeExternalFileDef_i_HeaderFile +#define SALOMEDS_AttributeExternalFileDef_i_HeaderFile + +// IDL headers +#include +#include CORBA_SERVER_HEADER(SALOMEDS_Attributes) +#include "SALOMEDS_GenericAttribute_i.hxx" +#include "SALOMEDS_ExternalFileDef.hxx" + +class SALOMEDS_AttributeExternalFileDef_i: public virtual POA_SALOMEDS::AttributeExternalFileDef, + public virtual SALOMEDS_GenericAttribute_i { +public: + + SALOMEDS_AttributeExternalFileDef_i(const Handle(SALOMEDS_ExternalFileDef)& theCommentAttr, CORBA::ORB_ptr orb) + { + _myOrb = CORBA::ORB::_duplicate(orb); + _myAttr = theCommentAttr; + } + ~SALOMEDS_AttributeExternalFileDef_i() {}; + + char* Value(); + void SetValue(const char* value); + +}; + + + +#endif diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx new file mode 100644 index 000000000..d40a53f43 --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx @@ -0,0 +1,48 @@ +// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOMEDS_AttributeFileType_i.cxx +// Author : Yves FRICAUD +// Module : SALOME +// $Header$ + +using namespace std; +#include "SALOMEDS_AttributeFileType_i.hxx" + +#include +#include "SALOMEDS_SObject_i.hxx" + +char* SALOMEDS_AttributeFileType_i::Value() +{ + TCollection_ExtendedString S = Handle(SALOMEDS_FileType)::DownCast(_myAttr)->Get(); + CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString()); + return c_s._retn(); +} + +void SALOMEDS_AttributeFileType_i::SetValue(const char* value) +{ + CheckLocked(); + CORBA::String_var Str = CORBA::string_dup(value); + // Handle(SALOMEDS_FileType)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); + Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); +} diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx new file mode 100644 index 000000000..324c5cb9a --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx @@ -0,0 +1,56 @@ +// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOMEDS_AttributeFileType_i.hxx +// Author : Yves FRICAUD +// Module : SALOME +// $Header$ + +#ifndef SALOMEDS_AttributeFileType_i_HeaderFile +#define SALOMEDS_AttributeFileType_i_HeaderFile + +// IDL headers +#include +#include CORBA_SERVER_HEADER(SALOMEDS_Attributes) +#include "SALOMEDS_GenericAttribute_i.hxx" +#include "SALOMEDS_FileType.hxx" + +class SALOMEDS_AttributeFileType_i: public virtual POA_SALOMEDS::AttributeFileType, + public virtual SALOMEDS_GenericAttribute_i { +public: + + SALOMEDS_AttributeFileType_i(const Handle(SALOMEDS_FileType)& theCommentAttr, CORBA::ORB_ptr orb) + { + _myOrb = CORBA::ORB::_duplicate(orb); + _myAttr = theCommentAttr; + } + ~SALOMEDS_AttributeFileType_i() {}; + + char* Value(); + void SetValue(const char* value); + +}; + + + +#endif diff --git a/src/SALOMEDS/SALOMEDS_ExternalFileDef.cdl b/src/SALOMEDS/SALOMEDS_ExternalFileDef.cdl new file mode 100644 index 000000000..a5ab6d282 --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_ExternalFileDef.cdl @@ -0,0 +1,76 @@ +-- SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +-- +-- Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public +-- License as published by the Free Software Foundation; either +-- version 2.1 of the License. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +-- +-- +-- +-- File : SALOMEDS_ExternalFileDef.cdl +-- Author : Yves FRICAUD +-- Module : SALOME + +class ExternalFileDef from SALOMEDS inherits Comment from TDataStd + + ---Purpose: + + +uses Attribute from TDF, + Label from TDF, + GUID from Standard, + ExtendedString from TCollection, + DataSet from TDF, + RelocationTable from TDF, + AttributeSequence from TDF, + Data from TDF, + Comment from TDataStd + + +is + + + ---Purpose: class methods + -- ============= + + GetID (myclass) + ---C++: return const & + returns GUID from Standard; + + Set (myclass; label : Label from TDF; + Name : ExtendedString from TCollection) + returns ExternalFileDef from SALOMEDS; + + ---Purpose: Comment methods + -- ============ + + Create + returns mutable ExternalFileDef from SALOMEDS; + + ID (me) + ---C++: return const & + returns GUID from Standard; + + Restore (me: mutable; with : Attribute from TDF); + + NewEmpty (me) + returns mutable Attribute from TDF; + + Paste (me; into : mutable Attribute from TDF; + RT : mutable RelocationTable from TDF); + +end ExternalFileDef; diff --git a/src/SALOMEDS/SALOMEDS_ExternalFileDef.cxx b/src/SALOMEDS/SALOMEDS_ExternalFileDef.cxx new file mode 100644 index 000000000..2e07b0106 --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_ExternalFileDef.cxx @@ -0,0 +1,114 @@ +// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOMEDS_ExternalFileDef.cxx +// Author : Yves FRICAUD +// Module : SALOME +// $Header: + +#include "SALOMEDS_ExternalFileDef.ixx" +#include +#include +using namespace std; + +//======================================================================= +//function : GetID +//purpose : +//======================================================================= + +const Standard_GUID& SALOMEDS_ExternalFileDef::GetID () +{ + static Standard_GUID SALOMEDS_ExternalFileDefID ("7123AD4C-ACDB-4e3a-8FDC-70EA164D2CBE"); + return SALOMEDS_ExternalFileDefID; +} + + + +//======================================================================= +//function : Set +//purpose : +//======================================================================= + +Handle(SALOMEDS_ExternalFileDef) SALOMEDS_ExternalFileDef::Set (const TDF_Label& L, + const TCollection_ExtendedString& S) +{ + + Handle(SALOMEDS_ExternalFileDef) A; + if (!L.FindAttribute(SALOMEDS_ExternalFileDef::GetID(),A)) { + A = new SALOMEDS_ExternalFileDef(); + L.AddAttribute(A); + } + + (Handle(TDataStd_Comment)::DownCast(A))->Set (S); + return A; +} + + +//======================================================================= +//function : constructor +//purpose : +//======================================================================= +SALOMEDS_ExternalFileDef::SALOMEDS_ExternalFileDef() +{} + +//======================================================================= +//function : ID +//purpose : +//======================================================================= + +const Standard_GUID& SALOMEDS_ExternalFileDef::ID () const { return GetID(); } + + +//======================================================================= +//function : NewEmpty +//purpose : +//======================================================================= + +Handle(TDF_Attribute) SALOMEDS_ExternalFileDef::NewEmpty () const +{ + return new SALOMEDS_ExternalFileDef(); +} + +//======================================================================= +//function : Restore +//purpose : +//======================================================================= + +void SALOMEDS_ExternalFileDef::Restore(const Handle(TDF_Attribute)& with) +{ + TCollection_ExtendedString s = Handle(TDataStd_Comment)::DownCast (with)->Get (); + TDataStd_Comment::Set(s); + return; +} + +//======================================================================= +//function : Paste +//purpose : +//======================================================================= + +void SALOMEDS_ExternalFileDef::Paste (const Handle(TDF_Attribute)& into, + const Handle(TDF_RelocationTable)& RT) const +{ + Handle(TDataStd_Comment)::DownCast (into)->Set (Get()); +} + diff --git a/src/SALOMEDS/SALOMEDS_ExternalFileDef.hxx b/src/SALOMEDS/SALOMEDS_ExternalFileDef.hxx new file mode 100644 index 000000000..5abb1838f --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_ExternalFileDef.hxx @@ -0,0 +1,108 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991,1995 by +// +// MATRA DATAVISION, FRANCE +// +// This software is furnished in accordance with the terms and conditions +// of the contract and with the inclusion of the above copyright notice. +// This software or any other copy thereof may not be provided or otherwise +// be made available to any other person. No title to an ownership of the +// software is hereby transferred. +// +// At the termination of the contract, the software and all copies of this +// software must be deleted. +// +#ifndef _SALOMEDS_ExternalFileDef_HeaderFile +#define _SALOMEDS_ExternalFileDef_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_SALOMEDS_ExternalFileDef_HeaderFile +#include +#endif + +#ifndef _TDataStd_Comment_HeaderFile +#include +#endif +#ifndef _Handle_TDF_Attribute_HeaderFile +#include +#endif +#ifndef _Handle_TDF_RelocationTable_HeaderFile +#include +#endif +class Standard_GUID; +class TDF_Label; +class TCollection_ExtendedString; +class TDF_Attribute; +class TDF_RelocationTable; + + +class SALOMEDS_ExternalFileDef : public TDataStd_Comment { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // +Standard_EXPORT static const Standard_GUID& GetID() ; +Standard_EXPORT static Handle_SALOMEDS_ExternalFileDef Set(const TDF_Label& label,const TCollection_ExtendedString& Name) ; +Standard_EXPORT SALOMEDS_ExternalFileDef(); +Standard_EXPORT const Standard_GUID& ID() const; +Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; +Standard_EXPORT Handle_TDF_Attribute NewEmpty() const; +Standard_EXPORT void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const; +Standard_EXPORT ~SALOMEDS_ExternalFileDef(); + + + + + // Type management + // + Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_ExternalFileDef_Type_(); + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/SALOMEDS/SALOMEDS_ExternalFileDef.ixx b/src/SALOMEDS/SALOMEDS_ExternalFileDef.ixx new file mode 100644 index 000000000..2235302e0 --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_ExternalFileDef.ixx @@ -0,0 +1,73 @@ +// File generated by CPPExt (Transient) +// Copyright (C) 1991,1995 by +// +// MATRA DATAVISION, FRANCE +// +// This software is furnished in accordance with the terms and conditions +// of the contract and with the inclusion of the above copyright notice. +// This software or any other copy thereof may not be provided or otherwise +// be made available to any other person. No title to an ownership of the +// software is hereby transferred. +// +// At the termination of the contract, the software and all copies of this +// software must be deleted. +// +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +SALOMEDS_ExternalFileDef::~SALOMEDS_ExternalFileDef() {} + + + +Standard_EXPORT Handle_Standard_Type& SALOMEDS_ExternalFileDef_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TDataStd_Comment); + if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDataStd_Comment); + static Handle_Standard_Type aType2 = STANDARD_TYPE(TDF_Attribute); + if ( aType2.IsNull()) aType2 = STANDARD_TYPE(TDF_Attribute); + static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared); + if ( aType3.IsNull()) aType3 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient); + if ( aType4.IsNull()) aType4 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("SALOMEDS_ExternalFileDef", + sizeof(SALOMEDS_ExternalFileDef), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(SALOMEDS_ExternalFileDef) Handle(SALOMEDS_ExternalFileDef)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(SALOMEDS_ExternalFileDef) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(SALOMEDS_ExternalFileDef))) { + _anOtherObject = Handle(SALOMEDS_ExternalFileDef)((Handle(SALOMEDS_ExternalFileDef)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& SALOMEDS_ExternalFileDef::DynamicType() const +{ + return STANDARD_TYPE(SALOMEDS_ExternalFileDef) ; +} +Standard_Boolean SALOMEDS_ExternalFileDef::IsKind(const Handle(Standard_Type)& AType) const +{ + return (STANDARD_TYPE(SALOMEDS_ExternalFileDef) == AType || TDataStd_Comment::IsKind(AType)); +} +Handle_SALOMEDS_ExternalFileDef::~Handle_SALOMEDS_ExternalFileDef() {} + diff --git a/src/SALOMEDS/SALOMEDS_ExternalFileDef.jxx b/src/SALOMEDS/SALOMEDS_ExternalFileDef.jxx new file mode 100644 index 000000000..32adbec66 --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_ExternalFileDef.jxx @@ -0,0 +1,18 @@ +#ifndef _Standard_GUID_HeaderFile +#include +#endif +#ifndef _TDF_Label_HeaderFile +#include +#endif +#ifndef _TCollection_ExtendedString_HeaderFile +#include +#endif +#ifndef _TDF_Attribute_HeaderFile +#include +#endif +#ifndef _TDF_RelocationTable_HeaderFile +#include +#endif +#ifndef _SALOMEDS_ExternalFileDef_HeaderFile +#include +#endif diff --git a/src/SALOMEDS/SALOMEDS_FileType.cdl b/src/SALOMEDS/SALOMEDS_FileType.cdl new file mode 100644 index 000000000..d9e43f29c --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_FileType.cdl @@ -0,0 +1,76 @@ +-- SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +-- +-- Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public +-- License as published by the Free Software Foundation; either +-- version 2.1 of the License. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +-- +-- +-- +-- File : SALOMEDS_FileType.cdl +-- Author : Yves FRICAUD +-- Module : SALOME + +class FileType from SALOMEDS inherits Comment from TDataStd + + ---Purpose: + + +uses Attribute from TDF, + Label from TDF, + GUID from Standard, + ExtendedString from TCollection, + DataSet from TDF, + RelocationTable from TDF, + AttributeSequence from TDF, + Data from TDF, + Comment from TDataStd + + +is + + + ---Purpose: class methods + -- ============= + + GetID (myclass) + ---C++: return const & + returns GUID from Standard; + + Set (myclass; label : Label from TDF; + Name : ExtendedString from TCollection) + returns FileType from SALOMEDS; + + ---Purpose: Comment methods + -- ============ + + Create + returns mutable FileType from SALOMEDS; + + ID (me) + ---C++: return const & + returns GUID from Standard; + + Restore (me: mutable; with : Attribute from TDF); + + NewEmpty (me) + returns mutable Attribute from TDF; + + Paste (me; into : mutable Attribute from TDF; + RT : mutable RelocationTable from TDF); + +end FileType; diff --git a/src/SALOMEDS/SALOMEDS_FileType.cxx b/src/SALOMEDS/SALOMEDS_FileType.cxx new file mode 100644 index 000000000..515bbc551 --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_FileType.cxx @@ -0,0 +1,114 @@ +// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOMEDS_FileType.cxx +// Author : Yves FRICAUD +// Module : SALOME +// $Header: + +#include "SALOMEDS_FileType.ixx" +#include +#include +using namespace std; + +//======================================================================= +//function : GetID +//purpose : +//======================================================================= + +const Standard_GUID& SALOMEDS_FileType::GetID () +{ + static Standard_GUID SALOMEDS_FileTypeID ("0181B525-3F15-4ab2-9DE3-5E2F54B5F340"); + return SALOMEDS_FileTypeID; +} + + + +//======================================================================= +//function : Set +//purpose : +//======================================================================= + +Handle(SALOMEDS_FileType) SALOMEDS_FileType::Set (const TDF_Label& L, + const TCollection_ExtendedString& S) +{ + + Handle(SALOMEDS_FileType) A; + if (!L.FindAttribute(SALOMEDS_FileType::GetID(),A)) { + A = new SALOMEDS_FileType(); + L.AddAttribute(A); + } + + (Handle(TDataStd_Comment)::DownCast(A))->Set (S); + return A; +} + + +//======================================================================= +//function : constructor +//purpose : +//======================================================================= +SALOMEDS_FileType::SALOMEDS_FileType() +{} + +//======================================================================= +//function : ID +//purpose : +//======================================================================= + +const Standard_GUID& SALOMEDS_FileType::ID () const { return GetID(); } + + +//======================================================================= +//function : NewEmpty +//purpose : +//======================================================================= + +Handle(TDF_Attribute) SALOMEDS_FileType::NewEmpty () const +{ + return new SALOMEDS_FileType(); +} + +//======================================================================= +//function : Restore +//purpose : +//======================================================================= + +void SALOMEDS_FileType::Restore(const Handle(TDF_Attribute)& with) +{ + TCollection_ExtendedString s = Handle(TDataStd_Comment)::DownCast (with)->Get (); + TDataStd_Comment::Set(s); + return; +} + +//======================================================================= +//function : Paste +//purpose : +//======================================================================= + +void SALOMEDS_FileType::Paste (const Handle(TDF_Attribute)& into, + const Handle(TDF_RelocationTable)& RT) const +{ + Handle(TDataStd_Comment)::DownCast (into)->Set (Get()); +} + diff --git a/src/SALOMEDS/SALOMEDS_FileType.hxx b/src/SALOMEDS/SALOMEDS_FileType.hxx new file mode 100644 index 000000000..d912aaafc --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_FileType.hxx @@ -0,0 +1,108 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991,1995 by +// +// MATRA DATAVISION, FRANCE +// +// This software is furnished in accordance with the terms and conditions +// of the contract and with the inclusion of the above copyright notice. +// This software or any other copy thereof may not be provided or otherwise +// be made available to any other person. No title to an ownership of the +// software is hereby transferred. +// +// At the termination of the contract, the software and all copies of this +// software must be deleted. +// +#ifndef _SALOMEDS_FileType_HeaderFile +#define _SALOMEDS_FileType_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_SALOMEDS_FileType_HeaderFile +#include +#endif + +#ifndef _TDataStd_Comment_HeaderFile +#include +#endif +#ifndef _Handle_TDF_Attribute_HeaderFile +#include +#endif +#ifndef _Handle_TDF_RelocationTable_HeaderFile +#include +#endif +class Standard_GUID; +class TDF_Label; +class TCollection_ExtendedString; +class TDF_Attribute; +class TDF_RelocationTable; + + +class SALOMEDS_FileType : public TDataStd_Comment { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // +Standard_EXPORT static const Standard_GUID& GetID() ; +Standard_EXPORT static Handle_SALOMEDS_FileType Set(const TDF_Label& label,const TCollection_ExtendedString& Name) ; +Standard_EXPORT SALOMEDS_FileType(); +Standard_EXPORT const Standard_GUID& ID() const; +Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; +Standard_EXPORT Handle_TDF_Attribute NewEmpty() const; +Standard_EXPORT void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const; +Standard_EXPORT ~SALOMEDS_FileType(); + + + + + // Type management + // + Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_FileType_Type_(); + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/SALOMEDS/SALOMEDS_FileType.ixx b/src/SALOMEDS/SALOMEDS_FileType.ixx new file mode 100644 index 000000000..505e39dab --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_FileType.ixx @@ -0,0 +1,73 @@ +// File generated by CPPExt (Transient) +// Copyright (C) 1991,1995 by +// +// MATRA DATAVISION, FRANCE +// +// This software is furnished in accordance with the terms and conditions +// of the contract and with the inclusion of the above copyright notice. +// This software or any other copy thereof may not be provided or otherwise +// be made available to any other person. No title to an ownership of the +// software is hereby transferred. +// +// At the termination of the contract, the software and all copies of this +// software must be deleted. +// +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +SALOMEDS_FileType::~SALOMEDS_FileType() {} + + + +Standard_EXPORT Handle_Standard_Type& SALOMEDS_FileType_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TDataStd_Comment); + if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDataStd_Comment); + static Handle_Standard_Type aType2 = STANDARD_TYPE(TDF_Attribute); + if ( aType2.IsNull()) aType2 = STANDARD_TYPE(TDF_Attribute); + static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared); + if ( aType3.IsNull()) aType3 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient); + if ( aType4.IsNull()) aType4 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("SALOMEDS_FileType", + sizeof(SALOMEDS_FileType), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(SALOMEDS_FileType) Handle(SALOMEDS_FileType)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(SALOMEDS_FileType) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(SALOMEDS_FileType))) { + _anOtherObject = Handle(SALOMEDS_FileType)((Handle(SALOMEDS_FileType)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& SALOMEDS_FileType::DynamicType() const +{ + return STANDARD_TYPE(SALOMEDS_FileType) ; +} +Standard_Boolean SALOMEDS_FileType::IsKind(const Handle(Standard_Type)& AType) const +{ + return (STANDARD_TYPE(SALOMEDS_FileType) == AType || TDataStd_Comment::IsKind(AType)); +} +Handle_SALOMEDS_FileType::~Handle_SALOMEDS_FileType() {} + diff --git a/src/SALOMEDS/SALOMEDS_FileType.jxx b/src/SALOMEDS/SALOMEDS_FileType.jxx new file mode 100644 index 000000000..0d838e429 --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_FileType.jxx @@ -0,0 +1,18 @@ +#ifndef _Standard_GUID_HeaderFile +#include +#endif +#ifndef _TDF_Label_HeaderFile +#include +#endif +#ifndef _TCollection_ExtendedString_HeaderFile +#include +#endif +#ifndef _TDF_Attribute_HeaderFile +#include +#endif +#ifndef _TDF_RelocationTable_HeaderFile +#include +#endif +#ifndef _SALOMEDS_FileType_HeaderFile +#include +#endif diff --git a/src/SALOMEDS/SALOMEDS_SObject_i.cxx b/src/SALOMEDS/SALOMEDS_SObject_i.cxx index f9c00984e..e10791ded 100644 --- a/src/SALOMEDS/SALOMEDS_SObject_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject_i.cxx @@ -44,6 +44,8 @@ using namespace std; #include "SALOMEDS_AttributePersistentRef_i.hxx" #include "SALOMEDS_AttributeIOR_i.hxx" #include "SALOMEDS_AttributeComment_i.hxx" +#include "SALOMEDS_AttributeExternalFileDef_i.hxx" +#include "SALOMEDS_AttributeFileType_i.hxx" #include "SALOMEDS_AttributeName_i.hxx" #include "SALOMEDS_AttributeSequenceOfInteger_i.hxx" #include "SALOMEDS_AttributeSequenceOfReal_i.hxx" @@ -84,6 +86,8 @@ SALOMEDS_SObject_i::ReturnGUIDForAttribute(const char* aTypeOfAttribute) else if (strcmp(aTypeOfAttribute, "AttributeSequenceOfInteger") == 0 ) return SALOMEDS_SequenceOfIntegerAttribute::GetID(); else if (strcmp(aTypeOfAttribute, "AttributeName") == 0 ) return TDataStd_Name::GetID(); else if (strcmp(aTypeOfAttribute, "AttributeComment") == 0 ) return TDataStd_Comment::GetID(); + else if (strcmp(aTypeOfAttribute, "AttributeExternalFileDef") == 0 ) return SALOMEDS_ExternalFileDef::GetID(); + else if (strcmp(aTypeOfAttribute, "AttributeFileType") == 0 ) return SALOMEDS_FileType::GetID(); else if (strcmp(aTypeOfAttribute, "AttributeIOR") == 0 ) return SALOMEDS_IORAttribute::GetID(); else if (strcmp(aTypeOfAttribute, "AttributePersistentRef") == 0 ) return SALOMEDS_PersRefAttribute::GetID(); else if (strcmp(aTypeOfAttribute, "AttributeDrawable") == 0 ) return SALOMEDS_DrawableAttribute::GetID(); @@ -121,6 +125,8 @@ char* SALOMEDS_SObject_i::AttributeIDToType(Standard_GUID ID) { if (ID == TDataStd_Name::GetID()) return "AttributeName"; else if (ID == TDataStd_Comment::GetID()) return "AttributeComment"; + else if (ID == SALOMEDS_ExternalFileDef::GetID()) return "AttributeExternalFileDef"; + else if (ID == SALOMEDS_FileType::GetID()) return "AttributeFileType"; else if (ID == SALOMEDS_IORAttribute::GetID()) return "AttributeIOR"; else if (ID == SALOMEDS_PersRefAttribute::GetID()) return "AttributePersistentRef"; else if (ID == TDataStd_Real::GetID()) return "AttributeReal"; @@ -283,6 +289,16 @@ CORBA::Boolean SALOMEDS_SObject_i::FindAttribute (SALOMEDS::GenericAttribute_out anAttribute = Attr->AttributeComment::_this(); return Standard_True; } + else if (strcmp(aTypeOfAttribute, "AttributeExternalFileDef") == 0 ) { + SALOMEDS_AttributeExternalFileDef_i* Attr = new SALOMEDS_AttributeExternalFileDef_i(Handle(SALOMEDS_ExternalFileDef)::DownCast(anAttr), _orb); + anAttribute = Attr->AttributeExternalFileDef::_this(); + return Standard_True; + } + else if (strcmp(aTypeOfAttribute, "AttributeFileType") == 0 ) { + SALOMEDS_AttributeFileType_i* Attr = new SALOMEDS_AttributeFileType_i(Handle(SALOMEDS_FileType)::DownCast(anAttr), _orb); + anAttribute = Attr->AttributeFileType::_this(); + return Standard_True; + } else if (strcmp(aTypeOfAttribute, "AttributeIOR") == 0 ) { SALOMEDS_AttributeIOR_i* Attr = new SALOMEDS_AttributeIOR_i(Handle(SALOMEDS_IORAttribute)::DownCast(anAttr), _orb); anAttribute = Attr->AttributeIOR::_this(); @@ -416,6 +432,14 @@ SALOMEDS::ListOfAttributes* SALOMEDS_SObject_i::GetAllAttributes() SALOMEDS_AttributeComment_i* Attr= new SALOMEDS_AttributeComment_i(Handle(TDataStd_Comment)::DownCast(anAttr), _orb); anAttribute = Attr->AttributeComment::_this(); } + else if (ReturnGUIDForAttribute("AttributeExternalFileDef") == anAttr->ID()) { + SALOMEDS_AttributeExternalFileDef_i* Attr= new SALOMEDS_AttributeExternalFileDef_i(Handle(SALOMEDS_ExternalFileDef)::DownCast(anAttr), _orb); + anAttribute = Attr->AttributeExternalFileDef::_this(); + } + else if (ReturnGUIDForAttribute("AttributeFileType") == anAttr->ID()) { + SALOMEDS_AttributeFileType_i* Attr= new SALOMEDS_AttributeFileType_i(Handle(SALOMEDS_FileType)::DownCast(anAttr), _orb); + anAttribute = Attr->AttributeFileType::_this(); + } else if (ReturnGUIDForAttribute("AttributeIOR") == anAttr->ID()) { SALOMEDS_AttributeIOR_i* Attr= new SALOMEDS_AttributeIOR_i(Handle(SALOMEDS_IORAttribute)::DownCast(anAttr), _orb); anAttribute = Attr->AttributeIOR::_this(); diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx index 93eaa48bc..a0afc4e53 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx @@ -50,6 +50,8 @@ using namespace std; #include "SALOMEDS_AttributePersistentRef_i.hxx" #include "SALOMEDS_AttributeIOR_i.hxx" #include "SALOMEDS_AttributeComment_i.hxx" +#include "SALOMEDS_AttributeExternalFileDef_i.hxx" +#include "SALOMEDS_AttributeFileType_i.hxx" #include "SALOMEDS_AttributeName_i.hxx" #include "SALOMEDS_AttributeSequenceOfInteger_i.hxx" #include "SALOMEDS_AttributeSequenceOfReal_i.hxx" @@ -601,6 +603,26 @@ SALOMEDS::GenericAttribute_ptr SALOMEDS_StudyBuilder_i::FindOrCreateAttribute(SA SALOMEDS::AttributeComment_var aCA = aCommentAttr->AttributeComment::_this(); return aCA._retn(); } + else if (strcmp(aTypeOfAttribute, "AttributeExternalFileDef") == 0 ) { + Handle(SALOMEDS_ExternalFileDef) anAttr; + if (!Lab.FindAttribute(SALOMEDS_ExternalFileDef::GetID(), anAttr)) { + anAttr = new SALOMEDS_ExternalFileDef; + Lab.AddAttribute(anAttr); + } + SALOMEDS_AttributeExternalFileDef_i* anExternalFileDefAttr = new SALOMEDS_AttributeExternalFileDef_i(anAttr, _orb); + SALOMEDS::AttributeExternalFileDef_var aCA = anExternalFileDefAttr->AttributeExternalFileDef::_this(); + return aCA._retn(); + } + else if (strcmp(aTypeOfAttribute, "AttributeFileType") == 0 ) { + Handle(SALOMEDS_FileType) anAttr; + if (!Lab.FindAttribute(SALOMEDS_FileType::GetID(), anAttr)) { + anAttr = new SALOMEDS_FileType; + Lab.AddAttribute(anAttr); + } + SALOMEDS_AttributeFileType_i* anFileTypeAttr = new SALOMEDS_AttributeFileType_i(anAttr, _orb); + SALOMEDS::AttributeFileType_var aCA = anFileTypeAttr->AttributeFileType::_this(); + return aCA._retn(); + } else if (strcmp(aTypeOfAttribute, "AttributeIOR") == 0 ) { Handle(SALOMEDS_IORAttribute) anAttr; if (!Lab.FindAttribute(SALOMEDS_IORAttribute::GetID(), anAttr)) { @@ -836,6 +858,16 @@ CORBA::Boolean SALOMEDS_StudyBuilder_i::FindAttribute(SALOMEDS::SObject_ptr anOb anAttribute = Attr->AttributeComment::_this(); return Standard_True; } + else if (strcmp(aTypeOfAttribute, "AttributeExternalFileDef") == 0 ) { + SALOMEDS_AttributeExternalFileDef_i* Attr= new SALOMEDS_AttributeExternalFileDef_i(Handle(SALOMEDS_ExternalFileDef)::DownCast(anAttr), _orb); + anAttribute = Attr->AttributeExternalFileDef::_this(); + return Standard_True; + } + else if (strcmp(aTypeOfAttribute, "AttributeFileType") == 0 ) { + SALOMEDS_AttributeFileType_i* Attr= new SALOMEDS_AttributeFileType_i(Handle(SALOMEDS_FileType)::DownCast(anAttr), _orb); + anAttribute = Attr->AttributeFileType::_this(); + return Standard_True; + } else if (strcmp(aTypeOfAttribute, "AttributeIOR") == 0 ) { SALOMEDS_AttributeIOR_i* Attr= new SALOMEDS_AttributeIOR_i(Handle(SALOMEDS_IORAttribute)::DownCast(anAttr), _orb); anAttribute = Attr->AttributeIOR::_this(); -- 2.39.2