mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
25
src/XCAFApp/XCAFApp.cdl
Executable file
25
src/XCAFApp/XCAFApp.cdl
Executable file
@@ -0,0 +1,25 @@
|
||||
-- File: XCAFApp.cdl
|
||||
-- Created: Fri Aug 11 13:30:20 2000
|
||||
-- Author: data exchange team
|
||||
-- <det@doomox>
|
||||
---Copyright: Matra Datavision 2000
|
||||
|
||||
|
||||
package XCAFApp
|
||||
|
||||
---Purpose: Defines application for DECAF document
|
||||
-- and provides application-specific tools
|
||||
--
|
||||
-- The application should be registered before work with DECAF
|
||||
-- documents by call to XCAFApp_Application::GetApplication()
|
||||
|
||||
uses
|
||||
TColStd,
|
||||
TDocStd
|
||||
|
||||
is
|
||||
|
||||
class Application;
|
||||
---Purpose: Defines application for DECAF documents
|
||||
|
||||
end XCAFApp;
|
46
src/XCAFApp/XCAFApp_Application.cdl
Executable file
46
src/XCAFApp/XCAFApp_Application.cdl
Executable file
@@ -0,0 +1,46 @@
|
||||
-- File: XCAFApp_Application.cdl
|
||||
-- Created: Wed May 24 09:27:01 2000
|
||||
-- Author: data exchange team
|
||||
-- <det@strelox.nnov.matra-dtv.fr>
|
||||
---Copyright: Matra Datavision 2000
|
||||
|
||||
|
||||
class Application from XCAFApp inherits Application from TDocStd
|
||||
|
||||
---Purpose: Implements an Application for the DECAF documents
|
||||
|
||||
uses
|
||||
SequenceOfExtendedString from TColStd,
|
||||
Document from TDocStd
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable Application from XCAFApp is private;
|
||||
|
||||
|
||||
---Purpose: methods from CDF_Application
|
||||
-- ============================
|
||||
|
||||
|
||||
Formats(me: mutable; Formats: out SequenceOfExtendedString from TColStd)
|
||||
is redefined;
|
||||
|
||||
|
||||
ResourcesName (me: mutable) returns CString from Standard is redefined;
|
||||
|
||||
---Purpose: methods from TDocStd_Application
|
||||
-- ================================
|
||||
|
||||
InitDocument (me; aDoc : Document from TDocStd) is redefined;
|
||||
---Purpose: Set XCAFDoc_DocumentTool attribute
|
||||
|
||||
---API: method for initialisation
|
||||
|
||||
GetApplication (myclass) returns Application from XCAFApp;
|
||||
---Purpose: Initializes (for the first time) and returns the
|
||||
-- static object (XCAFApp_Application)
|
||||
-- This is the only valid method to get XCAFApp_Application
|
||||
-- object, and it should be called at least once before
|
||||
-- any actions with documents in order to init application
|
||||
|
||||
end Application;
|
68
src/XCAFApp/XCAFApp_Application.cxx
Executable file
68
src/XCAFApp/XCAFApp_Application.cxx
Executable file
@@ -0,0 +1,68 @@
|
||||
// File: XCAFApp_Application.cxx
|
||||
// Created: Wed May 24 11:02:31 2000
|
||||
// Author: data exchange team
|
||||
// <det@strelox.nnov.matra-dtv.fr>
|
||||
|
||||
#include <XCAFApp_Application.ixx>
|
||||
#include <TPrsStd_DriverTable.hxx>
|
||||
#include <XCAFPrs_Driver.hxx>
|
||||
#include <XCAFDoc_DocumentTool.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetApplication
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(XCAFApp_Application) XCAFApp_Application::GetApplication()
|
||||
{
|
||||
static Handle(XCAFApp_Application) locApp;
|
||||
if ( locApp.IsNull() ) locApp = new XCAFApp_Application;
|
||||
return locApp;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : XCAFApp_Application
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
XCAFApp_Application::XCAFApp_Application()
|
||||
{
|
||||
// register driver for presentation
|
||||
Handle(TPrsStd_DriverTable) table = TPrsStd_DriverTable::Get();
|
||||
table->AddDriver (XCAFPrs_Driver::GetID(), new XCAFPrs_Driver);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Formats
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFApp_Application::Formats(TColStd_SequenceOfExtendedString& Formats)
|
||||
{
|
||||
Formats.Append(TCollection_ExtendedString ("MDTV-XCAF"));
|
||||
Formats.Append(TCollection_ExtendedString ("XmlXCAF"));
|
||||
Formats.Append(TCollection_ExtendedString ("XmlOcaf"));
|
||||
Formats.Append(TCollection_ExtendedString ("MDTV-Standard"));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ResourcesName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_CString XCAFApp_Application::ResourcesName()
|
||||
{
|
||||
return Standard_CString("XCAF");
|
||||
// return Standard_CString("Standard");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : InitDocument
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XCAFApp_Application::InitDocument(const Handle(TDocStd_Document)& aDoc) const
|
||||
{
|
||||
XCAFDoc_DocumentTool::Set(aDoc->Main());
|
||||
}
|
Reference in New Issue
Block a user