mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-18 14:27:39 +03:00
TKCAF has been separated on two parts:
- The sources which independent from visualization are remained in this TK. - Visualisation dependencies are moved to the new TK: TKVCAF. - Some dependencies which are connected with persistent objects (from other TK) have been corrected.
This commit is contained in:
@@ -248,7 +248,6 @@ p BinMDataXtd
|
||||
p BinMDocStd
|
||||
p BinMFunction
|
||||
p BinMNaming
|
||||
p BinMPrsStd
|
||||
p BinObjMgt
|
||||
p BinTools
|
||||
p CDF
|
||||
@@ -261,7 +260,6 @@ p MDataXtd
|
||||
p MDocStd
|
||||
p MFunction
|
||||
p MNaming
|
||||
p MPrsStd
|
||||
p MgtBRep
|
||||
p MgtGeom
|
||||
p MgtGeom2d
|
||||
@@ -287,7 +285,6 @@ p PGeom2d
|
||||
p PMMgt
|
||||
p PNaming
|
||||
p PPoly
|
||||
p PPrsStd
|
||||
p PShort
|
||||
p PStandard
|
||||
p PTColStd
|
||||
@@ -311,7 +308,6 @@ p XmlMDataXtd
|
||||
p XmlMDocStd
|
||||
p XmlMFunction
|
||||
p XmlMNaming
|
||||
p XmlMPrsStd
|
||||
p XmlObjMgt
|
||||
r StdResource
|
||||
r XmlOcafResource
|
||||
@@ -328,6 +324,7 @@ t TKCDF
|
||||
t TKLCAF
|
||||
t TKPCAF
|
||||
t TKPLCAF
|
||||
t TKVCAF
|
||||
t TKPShape
|
||||
t TKShapeSchema
|
||||
t TKStdLSchema
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#include <BinMNaming.hxx>
|
||||
#include <BinMDocStd.hxx>
|
||||
#include <BinMFunction.hxx>
|
||||
#include <BinMPrsStd.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <BinDrivers_DocumentStorageDriver.hxx>
|
||||
#include <BinDrivers_DocumentRetrievalDriver.hxx>
|
||||
@@ -72,7 +71,6 @@ Handle(BinMDF_ADriverTable) BinDrivers::AttributeDrivers
|
||||
BinMNaming ::AddDrivers (aTable, aMsgDrv);
|
||||
BinMDocStd ::AddDrivers (aTable, aMsgDrv);
|
||||
BinMFunction ::AddDrivers (aTable, aMsgDrv);
|
||||
BinMPrsStd ::AddDrivers (aTable, aMsgDrv);
|
||||
return aTable;
|
||||
}
|
||||
|
||||
|
@@ -70,7 +70,6 @@ Handle(BinMDF_ADriverTable) BinLDrivers::AttributeDrivers
|
||||
BinMDocStd ::AddDrivers (aTable, aMsgDrv);
|
||||
|
||||
// BinMNaming ::AddDrivers (aTable, aMsgDrv);
|
||||
// BinMPrsStd ::AddDrivers (aTable, aMsgDrv);
|
||||
return aTable;
|
||||
}
|
||||
|
||||
|
@@ -43,6 +43,10 @@ is
|
||||
class PatternStdDriver;
|
||||
|
||||
class ShapeDriver;
|
||||
|
||||
class PresentationDriver;
|
||||
|
||||
class PositionDriver;
|
||||
|
||||
|
||||
AddDrivers (theDriverTable : ADriverTable from BinMDF;
|
||||
|
@@ -24,6 +24,8 @@
|
||||
#include <BinMDataXtd_AxisDriver.hxx>
|
||||
#include <BinMDataXtd_PlaneDriver.hxx>
|
||||
#include <BinMDataXtd_PlacementDriver.hxx>
|
||||
#include <BinMDataXtd_PresentationDriver.hxx>
|
||||
#include <BinMDataXtd_PositionDriver.hxx>
|
||||
|
||||
static Standard_Integer myDocumentVersion = -1;
|
||||
//=======================================================================
|
||||
@@ -42,6 +44,8 @@ void BinMDataXtd::AddDrivers (const Handle(BinMDF_ADriverTable)& theDriverTable,
|
||||
theDriverTable->AddDriver (new BinMDataXtd_AxisDriver (theMsgDriver) );
|
||||
theDriverTable->AddDriver (new BinMDataXtd_PlaneDriver (theMsgDriver) );
|
||||
theDriverTable->AddDriver (new BinMDataXtd_PlacementDriver (theMsgDriver) );
|
||||
theDriverTable->AddDriver (new BinMDataXtd_PresentationDriver(theMsgDriver) );
|
||||
theDriverTable->AddDriver (new BinMDataXtd_PositionDriver (theMsgDriver) );
|
||||
|
||||
}
|
||||
|
||||
|
@@ -13,7 +13,7 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class PositionDriver from BinMPrsStd inherits ADriver from BinMDF
|
||||
class PositionDriver from BinMDataXtd inherits ADriver from BinMDF
|
||||
|
||||
---Purpose: Position Attribute Driver.
|
||||
|
||||
@@ -26,8 +26,8 @@ uses
|
||||
|
||||
is
|
||||
|
||||
Create (theMessageDriver:MessageDriver from CDM)
|
||||
returns mutable PositionDriver from BinMPrsStd;
|
||||
Create (theMessageDriver:MessageDriver from CDM)
|
||||
returns PositionDriver from BinMDataXtd;
|
||||
|
||||
NewEmpty (me) returns mutable Attribute from TDF;
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
// modified 13.04.2009 Sergey ZARITCHNY
|
||||
|
||||
#include <BinMPrsStd_PositionDriver.ixx>
|
||||
#include <BinMDataXtd_PositionDriver.ixx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TDataXtd_Position.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
@@ -25,9 +25,9 @@
|
||||
//purpose : Constructor
|
||||
//=======================================================================
|
||||
|
||||
BinMPrsStd_PositionDriver::BinMPrsStd_PositionDriver
|
||||
BinMDataXtd_PositionDriver::BinMDataXtd_PositionDriver
|
||||
(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TDataXtd_Position)->Name())
|
||||
: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TDataXtd_Position)->Name())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ BinMPrsStd_PositionDriver::BinMPrsStd_PositionDriver
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(TDF_Attribute) BinMPrsStd_PositionDriver::NewEmpty() const
|
||||
Handle(TDF_Attribute) BinMDataXtd_PositionDriver::NewEmpty() const
|
||||
{
|
||||
return new TDataXtd_Position();
|
||||
}
|
||||
@@ -46,7 +46,7 @@ Handle(TDF_Attribute) BinMPrsStd_PositionDriver::NewEmpty() const
|
||||
//purpose : persistent -> transient (retrieve)
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BinMPrsStd_PositionDriver::Paste
|
||||
Standard_Boolean BinMDataXtd_PositionDriver::Paste
|
||||
(const BinObjMgt_Persistent& theSource,
|
||||
const Handle(TDF_Attribute)& theTarget,
|
||||
BinObjMgt_RRelocationTable& ) const
|
||||
@@ -76,7 +76,7 @@ Standard_Boolean BinMPrsStd_PositionDriver::Paste
|
||||
//purpose : transient -> persistent (store)
|
||||
//=======================================================================
|
||||
|
||||
void BinMPrsStd_PositionDriver::Paste (const Handle(TDF_Attribute)& theSource,
|
||||
void BinMDataXtd_PositionDriver::Paste (const Handle(TDF_Attribute)& theSource,
|
||||
BinObjMgt_Persistent& theTarget,
|
||||
BinObjMgt_SRelocationTable& ) const
|
||||
{
|
@@ -13,9 +13,9 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class AISPresentationDriver from BinMPrsStd inherits ADriver from BinMDF
|
||||
class PresentationDriver from BinMDataXtd inherits ADriver from BinMDF
|
||||
|
||||
---Purpose: AISPresentation Attribute Driver.
|
||||
---Purpose: Presentation Attribute Driver.
|
||||
|
||||
uses
|
||||
SRelocationTable from BinObjMgt,
|
||||
@@ -27,18 +27,18 @@ uses
|
||||
is
|
||||
|
||||
Create (theMessageDriver:MessageDriver from CDM)
|
||||
returns mutable AISPresentationDriver from BinMPrsStd;
|
||||
returns PresentationDriver from BinMDataXtd;
|
||||
|
||||
NewEmpty (me) returns mutable Attribute from TDF;
|
||||
|
||||
Paste(me; Source : Persistent from BinObjMgt;
|
||||
Target : mutable Attribute from TDF;
|
||||
RelocTable : out RRelocationTable from BinObjMgt)
|
||||
returns Boolean from Standard;
|
||||
returns Boolean from Standard;
|
||||
|
||||
Paste(me; Source : Attribute from TDF;
|
||||
Target : in out Persistent from BinObjMgt;
|
||||
RelocTable : out SRelocationTable from BinObjMgt);
|
||||
|
||||
|
||||
end AISPresentationDriver;
|
||||
|
||||
end PresentationDriver;
|
155
src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx
Normal file
155
src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx
Normal file
@@ -0,0 +1,155 @@
|
||||
// Created on: 2004-05-17
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2004-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 <BinMDataXtd_PresentationDriver.ixx>
|
||||
#include <TDataXtd_Presentation.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BinMDataStd_AISPresentationDriver
|
||||
//purpose : Constructor
|
||||
//=======================================================================
|
||||
BinMDataXtd_PresentationDriver::BinMDataXtd_PresentationDriver
|
||||
(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(TDataXtd_Presentation)->Name())
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NewEmpty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(TDF_Attribute) BinMDataXtd_PresentationDriver::NewEmpty() const
|
||||
{
|
||||
return new TDataXtd_Presentation();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose : persistent -> transient (retrieve)
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BinMDataXtd_PresentationDriver::Paste
|
||||
(const BinObjMgt_Persistent& theSource,
|
||||
const Handle(TDF_Attribute)& theTarget,
|
||||
BinObjMgt_RRelocationTable& /*theRT*/) const
|
||||
{
|
||||
Standard_Boolean ok = Standard_False;
|
||||
Handle(TDataXtd_Presentation) anAttribute = Handle(TDataXtd_Presentation)::DownCast(theTarget);
|
||||
|
||||
// Display status
|
||||
Standard_Integer aValue;
|
||||
ok = theSource >> aValue;
|
||||
if (!ok) return ok;
|
||||
anAttribute->SetDisplayed(static_cast<Standard_Boolean>(aValue));
|
||||
|
||||
// GUID
|
||||
Standard_GUID aGUID;
|
||||
ok = theSource >> aGUID;
|
||||
if (!ok) return ok;
|
||||
anAttribute->SetDriverGUID(aGUID);
|
||||
|
||||
// Color
|
||||
ok = theSource >> aValue;
|
||||
if (!ok) return ok;
|
||||
if ( aValue != -1 )
|
||||
anAttribute->SetColor(aValue);
|
||||
else
|
||||
anAttribute->UnsetColor();
|
||||
|
||||
// Material
|
||||
ok = theSource >> aValue;
|
||||
if ( !ok ) return ok;
|
||||
if (aValue != -1)
|
||||
anAttribute->SetMaterial(aValue);
|
||||
else
|
||||
anAttribute->UnsetMaterial();
|
||||
|
||||
// Transparency
|
||||
Standard_Real aRValue;
|
||||
ok = theSource >> aRValue;
|
||||
if ( !ok ) return ok;
|
||||
if ( aRValue != -1. )
|
||||
anAttribute->SetTransparency(aRValue);
|
||||
else
|
||||
anAttribute->UnsetTransparency();
|
||||
|
||||
// Width
|
||||
ok = theSource >> aRValue;
|
||||
if ( !ok ) return ok;
|
||||
if ( aRValue != -1. )
|
||||
anAttribute->SetWidth(aRValue);
|
||||
else
|
||||
anAttribute->UnsetWidth();
|
||||
|
||||
// Mode
|
||||
ok = theSource >> aValue;
|
||||
if ( !ok ) return ok;
|
||||
if ( aValue != -1 )
|
||||
anAttribute->SetMode(aValue);
|
||||
else
|
||||
anAttribute->UnsetMode();
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose : transient -> persistent (store)
|
||||
//=======================================================================
|
||||
|
||||
void BinMDataXtd_PresentationDriver::Paste(const Handle(TDF_Attribute)& theSource,
|
||||
BinObjMgt_Persistent& theTarget,
|
||||
BinObjMgt_SRelocationTable& /*theSRT*/) const
|
||||
{
|
||||
Handle(TDataXtd_Presentation) anAttribute = Handle(TDataXtd_Presentation)::DownCast(theSource);
|
||||
|
||||
// Display status
|
||||
theTarget.PutBoolean(anAttribute->IsDisplayed());
|
||||
|
||||
// GUID
|
||||
theTarget.PutGUID(anAttribute->GetDriverGUID());
|
||||
|
||||
// Color
|
||||
if (anAttribute->IsHasOwnColor())
|
||||
theTarget.PutInteger(anAttribute->Color());
|
||||
else
|
||||
theTarget.PutInteger(-1);
|
||||
|
||||
// Material
|
||||
if (anAttribute->IsHasOwnMaterial())
|
||||
theTarget.PutInteger(anAttribute->Material());
|
||||
else
|
||||
theTarget.PutInteger(-1);
|
||||
|
||||
// Transparency
|
||||
if (anAttribute->IsHasOwnTransparency())
|
||||
theTarget.PutReal(anAttribute->Transparency());
|
||||
else
|
||||
theTarget.PutReal(-1.);
|
||||
|
||||
// Width
|
||||
if (anAttribute->IsHasOwnWidth())
|
||||
theTarget.PutReal(anAttribute->Width());
|
||||
else
|
||||
theTarget.PutReal(-1.);
|
||||
|
||||
// Mode
|
||||
if (anAttribute->IsHasOwnMode())
|
||||
theTarget.PutInteger(anAttribute->Mode());
|
||||
else
|
||||
theTarget.PutInteger(-1);
|
||||
}
|
@@ -1,37 +0,0 @@
|
||||
-- Created on: 2004-05-17
|
||||
-- Created by: Sergey ZARITCHNY <szy@opencascade.com>
|
||||
-- Copyright (c) 2004-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 BinMPrsStd
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
BinObjMgt,
|
||||
TDF,
|
||||
BinMDF,
|
||||
CDM
|
||||
is
|
||||
---Purpose: Storage-Retrieval drivers for graphic attributes from
|
||||
-- TPrsStd
|
||||
|
||||
class AISPresentationDriver;
|
||||
|
||||
class PositionDriver;
|
||||
|
||||
AddDrivers(theDriverTable : ADriverTable from BinMDF;
|
||||
theMessageDriver : MessageDriver from CDM);
|
||||
---Purpose: Adds the attribute storage-retrieval driver to <theDriverTable>.
|
||||
|
||||
end BinMPrsStd;
|
@@ -1,32 +0,0 @@
|
||||
// Created on: 2004-05-17
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2004-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 <BinMPrsStd.ixx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
#include <BinMDF_ADriverTable.hxx>
|
||||
#include <BinMPrsStd_AISPresentationDriver.hxx>
|
||||
#include <BinMPrsStd_PositionDriver.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : AddDrivers
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BinMPrsStd::AddDrivers (const Handle(BinMDF_ADriverTable)& aDriverTable,
|
||||
const Handle(CDM_MessageDriver)& aMessageDriver)
|
||||
{
|
||||
aDriverTable->AddDriver (new BinMPrsStd_AISPresentationDriver(aMessageDriver));
|
||||
aDriverTable->AddDriver (new BinMPrsStd_PositionDriver(aMessageDriver));
|
||||
}
|
@@ -1,133 +0,0 @@
|
||||
// Created on: 2004-05-17
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 2004-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 <BinMPrsStd_AISPresentationDriver.ixx>
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
//=======================================================================
|
||||
//function : BinMDataStd_AISPresentationDriver
|
||||
//purpose : Constructor
|
||||
//=======================================================================
|
||||
|
||||
BinMPrsStd_AISPresentationDriver::BinMPrsStd_AISPresentationDriver
|
||||
(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TPrsStd_AISPresentation)->Name())
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NewEmpty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(TDF_Attribute) BinMPrsStd_AISPresentationDriver::NewEmpty() const
|
||||
{
|
||||
return new TPrsStd_AISPresentation();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose : persistent -> transient (retrieve)
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BinMPrsStd_AISPresentationDriver::Paste
|
||||
(const BinObjMgt_Persistent& theSource,
|
||||
const Handle(TDF_Attribute)& theTarget,
|
||||
BinObjMgt_RRelocationTable& ) const
|
||||
{
|
||||
Handle(TPrsStd_AISPresentation) anAtt = Handle(TPrsStd_AISPresentation)::DownCast(theTarget);
|
||||
Standard_Integer aValue;
|
||||
//Display status
|
||||
Standard_Boolean ok = theSource >> aValue;
|
||||
if (!ok) return ok;
|
||||
anAtt->SetDisplayed((Standard_Boolean)aValue);
|
||||
|
||||
//GUID
|
||||
Standard_GUID aGUID;
|
||||
ok = theSource >> aGUID;
|
||||
if (!ok) return ok;
|
||||
anAtt->SetDriverGUID(aGUID);
|
||||
|
||||
//Color
|
||||
ok = theSource >> aValue;
|
||||
if (!ok) return ok;
|
||||
if(aValue != -1) anAtt->SetColor( (Quantity_NameOfColor)(aValue) );
|
||||
else anAtt->UnsetColor();
|
||||
|
||||
//Material
|
||||
ok = theSource >> aValue;
|
||||
if (!ok) return ok;
|
||||
if(aValue != -1) anAtt->SetMaterial( (Graphic3d_NameOfMaterial)(aValue) );
|
||||
else anAtt->UnsetMaterial();
|
||||
|
||||
//Transparency
|
||||
Standard_Real aRValue;
|
||||
ok = theSource >> aRValue;
|
||||
if (!ok) return ok;
|
||||
if(aRValue != -1.) anAtt->SetTransparency(aRValue);
|
||||
else anAtt->UnsetTransparency();
|
||||
|
||||
//Width
|
||||
ok = theSource >> aRValue;
|
||||
if (!ok) return ok;
|
||||
if(aRValue != -1.) anAtt->SetWidth( aRValue );
|
||||
else anAtt->UnsetWidth();
|
||||
|
||||
//Mode
|
||||
ok = theSource >> aValue;
|
||||
if (!ok) return ok;
|
||||
if(aValue != -1) anAtt->SetMode(aValue);
|
||||
else anAtt->UnsetMode();
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose : transient -> persistent (store)
|
||||
//=======================================================================
|
||||
|
||||
void BinMPrsStd_AISPresentationDriver::Paste (const Handle(TDF_Attribute)& theSource,
|
||||
BinObjMgt_Persistent& theTarget,
|
||||
BinObjMgt_SRelocationTable& ) const
|
||||
{
|
||||
Handle(TPrsStd_AISPresentation) anAtt = Handle(TPrsStd_AISPresentation)::DownCast(theSource);
|
||||
//1
|
||||
theTarget.PutBoolean(anAtt->IsDisplayed());//Bool
|
||||
//2
|
||||
theTarget.PutGUID(anAtt->GetDriverGUID());//GUID
|
||||
//3
|
||||
if(anAtt->HasOwnColor())
|
||||
theTarget.PutInteger((Standard_Integer)anAtt->Color());//Color
|
||||
else theTarget.PutInteger(-1);
|
||||
//4
|
||||
if(anAtt->HasOwnMaterial())
|
||||
theTarget.PutInteger((Standard_Integer)anAtt->Material());
|
||||
else theTarget.PutInteger(-1);
|
||||
//5
|
||||
if(anAtt->HasOwnTransparency())
|
||||
theTarget.PutReal(anAtt->Transparency()); //Real
|
||||
else theTarget.PutReal(-1.);
|
||||
//6
|
||||
if(anAtt->HasOwnWidth())
|
||||
theTarget.PutReal(anAtt->Width());// Real
|
||||
else theTarget.PutReal(-1.);
|
||||
//7
|
||||
if(anAtt->HasOwnMode())
|
||||
theTarget.PutInteger(anAtt->Mode()); //Int
|
||||
else theTarget.PutInteger(-1);
|
||||
}
|
@@ -55,6 +55,9 @@ is
|
||||
|
||||
class PatternStdStorageDriver;
|
||||
|
||||
class PresentationStorageDriver;
|
||||
|
||||
class PositionStorageDriver;
|
||||
|
||||
|
||||
---Purpose: Retrieval drivers for PDataXtd attributes
|
||||
@@ -76,6 +79,12 @@ is
|
||||
|
||||
class PatternStdRetrievalDriver;
|
||||
|
||||
class PresentationRetrievalDriver;
|
||||
|
||||
class PresentationRetrievalDriver_1;
|
||||
|
||||
class PositionRetrievalDriver;
|
||||
|
||||
|
||||
|
||||
AddStorageDrivers(aDriverSeq : ASDriverHSequence from MDF; theMessageDriver : MessageDriver from CDM);
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include <MDataXtd_ConstraintStorageDriver.hxx>
|
||||
#include <MDataXtd_PlacementStorageDriver.hxx>
|
||||
#include <MDataXtd_PatternStdStorageDriver.hxx>
|
||||
#include <MDataXtd_PositionStorageDriver.hxx>
|
||||
#include <MDataXtd_PositionRetrievalDriver.hxx>
|
||||
|
||||
// Retrieval
|
||||
#include <MDataXtd_ShapeRetrievalDriver.hxx>
|
||||
@@ -44,6 +46,9 @@
|
||||
#include <MDataXtd_ConstraintRetrievalDriver.hxx>
|
||||
#include <MDataXtd_PlacementRetrievalDriver.hxx>
|
||||
#include <MDataXtd_PatternStdRetrievalDriver.hxx>
|
||||
#include <MDataXtd_PresentationStorageDriver.hxx>
|
||||
#include <MDataXtd_PresentationRetrievalDriver.hxx>
|
||||
#include <MDataXtd_PresentationRetrievalDriver_1.hxx>
|
||||
|
||||
// enums
|
||||
#include <TDataStd_RealEnum.hxx>
|
||||
@@ -83,6 +88,8 @@ void MDataXtd::AddStorageDrivers
|
||||
aDriverSeq->Append(new MDataXtd_ConstraintStorageDriver(theMsgDriver));
|
||||
aDriverSeq->Append(new MDataXtd_PlacementStorageDriver(theMsgDriver));
|
||||
aDriverSeq->Append(new MDataXtd_PatternStdStorageDriver(theMsgDriver));
|
||||
aDriverSeq->Append(new MDataXtd_PresentationStorageDriver(theMsgDriver));
|
||||
aDriverSeq->Append(new MDataXtd_PositionStorageDriver(theMsgDriver));
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +109,9 @@ void MDataXtd::AddRetrievalDrivers
|
||||
aDriverSeq->Append(new MDataXtd_ConstraintRetrievalDriver(theMsgDriver));
|
||||
aDriverSeq->Append(new MDataXtd_PlacementRetrievalDriver(theMsgDriver));
|
||||
aDriverSeq->Append(new MDataXtd_PatternStdRetrievalDriver(theMsgDriver));
|
||||
aDriverSeq->Append(new MDataXtd_PresentationRetrievalDriver(theMsgDriver));
|
||||
aDriverSeq->Append(new MDataXtd_PresentationRetrievalDriver_1(theMsgDriver));
|
||||
aDriverSeq->Append(new MDataXtd_PositionRetrievalDriver(theMsgDriver));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -14,8 +14,9 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class PositionRetrievalDriver from MPrsStd inherits ARDriver from MDF
|
||||
---Purpose:
|
||||
class PositionRetrievalDriver from MDataXtd inherits ARDriver from MDF
|
||||
---Purpose: Retrieval drivers for graphic attributes from
|
||||
-- PDataXtd
|
||||
|
||||
|
||||
|
||||
@@ -28,8 +29,8 @@ is
|
||||
|
||||
|
||||
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
|
||||
returns mutable PositionRetrievalDriver from MPrsStd;
|
||||
|
||||
returns mutable PositionRetrievalDriver from MDataXtd;
|
||||
|
||||
|
||||
VersionNumber(me) returns Integer from Standard;
|
||||
---Purpose: Returns the version number from which the driver
|
@@ -14,50 +14,57 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <MPrsStd_PositionRetrievalDriver.ixx>
|
||||
#include <MDataXtd_PositionRetrievalDriver.ixx>
|
||||
|
||||
#include <PDataXtd_Position.hxx>
|
||||
#include <TDataXtd_Position.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : MPrsStd_PositionRetrievalDriver
|
||||
//function : MDataXtd_PositionRetrievalDriver
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
MPrsStd_PositionRetrievalDriver::MPrsStd_PositionRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
|
||||
MDataXtd_PositionRetrievalDriver::MDataXtd_PositionRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
: MDF_ARDriver(theMsgDriver)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : VersionNumber
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer MPrsStd_PositionRetrievalDriver::VersionNumber() const
|
||||
{ return 0; }
|
||||
Standard_Integer MDataXtd_PositionRetrievalDriver::VersionNumber() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SourceType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Standard_Type) MPrsStd_PositionRetrievalDriver::SourceType() const
|
||||
{ return STANDARD_TYPE(PDataXtd_Position); }
|
||||
Handle(Standard_Type) MDataXtd_PositionRetrievalDriver::SourceType() const
|
||||
{
|
||||
return STANDARD_TYPE(PDataXtd_Position);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NewEmpty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TDF_Attribute) MPrsStd_PositionRetrievalDriver::NewEmpty() const
|
||||
{ return new TDataXtd_Position; }
|
||||
Handle(TDF_Attribute) MDataXtd_PositionRetrievalDriver::NewEmpty() const
|
||||
{
|
||||
return new TDataXtd_Position;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void MPrsStd_PositionRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
|
||||
const Handle(TDF_Attribute)& Target,
|
||||
const Handle(MDF_RRelocationTable)& /*RelocTable*/) const
|
||||
void MDataXtd_PositionRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
|
||||
const Handle(TDF_Attribute)& Target,
|
||||
const Handle(MDF_RRelocationTable)& /*RelocTable*/) const
|
||||
{
|
||||
Handle(PDataXtd_Position) S = Handle(PDataXtd_Position)::DownCast (Source);
|
||||
Handle(TDataXtd_Position) T = Handle(TDataXtd_Position)::DownCast (Target);
|
||||
Handle(PDataXtd_Position) S = Handle(PDataXtd_Position)::DownCast(Source);
|
||||
Handle(TDataXtd_Position) T = Handle(TDataXtd_Position)::DownCast(Target);
|
||||
T->SetPosition(S->GetPosition());
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class PositionStorageDriver from MPrsStd inherits ASDriver from MDF
|
||||
class PositionStorageDriver from MDataXtd inherits ASDriver from MDF
|
||||
|
||||
---Purpose:
|
||||
|
||||
@@ -27,7 +27,7 @@ uses SRelocationTable from MDF,
|
||||
is
|
||||
|
||||
Create(theMessageDriver : MessageDriver from CDM)
|
||||
returns mutable PositionStorageDriver from MPrsStd;
|
||||
returns mutable PositionStorageDriver from MDataXtd;
|
||||
|
||||
|
||||
VersionNumber(me) returns Integer from Standard;
|
@@ -14,17 +14,17 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <MPrsStd_PositionStorageDriver.ixx>
|
||||
#include <MDataXtd_PositionStorageDriver.ixx>
|
||||
|
||||
#include <PDataXtd_Position.hxx>
|
||||
#include <TDataXtd_Position.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : MPrsStd_PositionStorageDriver
|
||||
//function : MDataXtd_PositionStorageDriver
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
MPrsStd_PositionStorageDriver::MPrsStd_PositionStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
|
||||
MDataXtd_PositionStorageDriver::MDataXtd_PositionStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -32,30 +32,30 @@ MPrsStd_PositionStorageDriver::MPrsStd_PositionStorageDriver(const Handle(CDM_Me
|
||||
//function : VersionNumber
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer MPrsStd_PositionStorageDriver::VersionNumber() const
|
||||
Standard_Integer MDataXtd_PositionStorageDriver::VersionNumber() const
|
||||
{ return 0; }
|
||||
|
||||
//=======================================================================
|
||||
//function : SourceType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Standard_Type) MPrsStd_PositionStorageDriver::SourceType() const
|
||||
Handle(Standard_Type) MDataXtd_PositionStorageDriver::SourceType() const
|
||||
{ return STANDARD_TYPE(TDataXtd_Position); }
|
||||
|
||||
//=======================================================================
|
||||
//function : NewEmpty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(PDF_Attribute) MPrsStd_PositionStorageDriver::NewEmpty() const
|
||||
Handle(PDF_Attribute) MDataXtd_PositionStorageDriver::NewEmpty() const
|
||||
{ return new PDataXtd_Position; }
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void MPrsStd_PositionStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
|
||||
const Handle(PDF_Attribute)& Target,
|
||||
const Handle(MDF_SRelocationTable)& /*RelocTable*/) const
|
||||
void MDataXtd_PositionStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
|
||||
const Handle(PDF_Attribute)& Target,
|
||||
const Handle(MDF_SRelocationTable)& /*RelocTable*/) const
|
||||
{
|
||||
Handle(TDataXtd_Position) S = Handle(TDataXtd_Position)::DownCast (Source);
|
||||
Handle(PDataXtd_Position) T = Handle(PDataXtd_Position)::DownCast (Target);
|
@@ -14,9 +14,10 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class AISPresentationRetrievalDriver from MPrsStd inherits ARDriver from MDF
|
||||
class PresentationRetrievalDriver from MDataXtd inherits ARDriver from MDF
|
||||
|
||||
---Purpose:
|
||||
---Purpose: Retrieval drivers for graphic attributes from
|
||||
-- MDataXtd
|
||||
|
||||
uses RRelocationTable from MDF,
|
||||
Attribute from PDF,
|
||||
@@ -25,9 +26,8 @@ uses RRelocationTable from MDF,
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create(theMessageDriver : MessageDriver from CDM) -- Version 0
|
||||
returns mutable AISPresentationRetrievalDriver from MPrsStd;
|
||||
returns mutable PresentationRetrievalDriver from MDataXtd;
|
||||
|
||||
|
||||
VersionNumber(me) returns Integer from Standard;
|
||||
@@ -35,14 +35,14 @@ is
|
||||
-- is available: 0.
|
||||
|
||||
SourceType(me) returns Type from Standard;
|
||||
---Purpose: Returns the type: AISPresentation from PPrsStd.
|
||||
---Purpose: Returns the type: Presentation from PDataXtd.
|
||||
|
||||
NewEmpty (me) returns mutable Attribute from TDF;
|
||||
|
||||
|
||||
Paste(me;
|
||||
Source : Attribute from PDF;
|
||||
Source : Attribute from PDF;
|
||||
Target : mutable Attribute from TDF;
|
||||
RelocTable : RRelocationTable from MDF);
|
||||
|
||||
end AISPresentationRetrievalDriver;
|
||||
end PresentationRetrievalDriver;
|
@@ -14,52 +14,59 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <MPrsStd_AISPresentationRetrievalDriver.ixx>
|
||||
#include <MDataXtd_PresentationRetrievalDriver.ixx>
|
||||
|
||||
#include <PPrsStd_AISPresentation.hxx>
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <PDataXtd_Presentation.hxx>
|
||||
#include <TDataXtd_Presentation.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <PCollection_HExtendedString.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : MPrsStd_AISPresentationRetrievalDriver
|
||||
//function : MDataXtd_PresentationRetrievalDriver
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
MPrsStd_AISPresentationRetrievalDriver::MPrsStd_AISPresentationRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
|
||||
{}
|
||||
MDataXtd_PresentationRetrievalDriver::MDataXtd_PresentationRetrievalDriver
|
||||
(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
: MDF_ARDriver(theMsgDriver)
|
||||
{
|
||||
}
|
||||
|
||||
Standard_Integer MPrsStd_AISPresentationRetrievalDriver::VersionNumber() const
|
||||
{ return 0; }
|
||||
Standard_Integer MDataXtd_PresentationRetrievalDriver::VersionNumber() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Handle(Standard_Type) MPrsStd_AISPresentationRetrievalDriver::SourceType() const
|
||||
{ return STANDARD_TYPE(PPrsStd_AISPresentation); }
|
||||
Handle(Standard_Type) MDataXtd_PresentationRetrievalDriver::SourceType() const
|
||||
{
|
||||
return STANDARD_TYPE(PDataXtd_Presentation);
|
||||
}
|
||||
|
||||
Handle(TDF_Attribute) MPrsStd_AISPresentationRetrievalDriver::NewEmpty() const
|
||||
{ return new TPrsStd_AISPresentation; }
|
||||
Handle(TDF_Attribute) MDataXtd_PresentationRetrievalDriver::NewEmpty() const
|
||||
{
|
||||
return new TDataXtd_Presentation;
|
||||
}
|
||||
|
||||
void MPrsStd_AISPresentationRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
|
||||
void MDataXtd_PresentationRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
|
||||
const Handle(TDF_Attribute)& Target,
|
||||
const Handle(MDF_RRelocationTable)& /*RelocTable*/) const
|
||||
{
|
||||
Handle(PPrsStd_AISPresentation) S = Handle(PPrsStd_AISPresentation)::DownCast (Source);
|
||||
Handle(TPrsStd_AISPresentation) T = Handle(TPrsStd_AISPresentation)::DownCast (Target);
|
||||
Handle(PDataXtd_Presentation) S = Handle(PDataXtd_Presentation)::DownCast (Source);
|
||||
Handle(TDataXtd_Presentation) T = Handle(TDataXtd_Presentation)::DownCast (Target);
|
||||
|
||||
T->SetDisplayed( S->IsDisplayed() );
|
||||
T->SetDisplayed( S->IsDisplayed() );
|
||||
|
||||
TCollection_ExtendedString extstr = (S->GetDriverGUID())->Convert();
|
||||
Standard_GUID guid( extstr.ToExtString() );
|
||||
TCollection_ExtendedString extstr = (S->GetDriverGUID())->Convert();
|
||||
Standard_GUID guid( extstr.ToExtString() );
|
||||
|
||||
T->SetDriverGUID( guid );
|
||||
|
||||
if( S->Color() != -1 ) T->SetColor( (Quantity_NameOfColor)(S->Color()) );
|
||||
if( S->Color() != -1 ) T->SetColor( S->Color() );
|
||||
else T->UnsetColor();
|
||||
|
||||
if( S->Material() != -1 ) T->SetMaterial( (Graphic3d_NameOfMaterial)(S->Material()) );
|
||||
if( S->Material() != -1 ) T->SetMaterial( S->Material() );
|
||||
else T->UnsetMaterial();
|
||||
|
||||
if( S->Transparency() != -1. ) T->SetTransparency( S->Transparency() );
|
||||
@@ -74,4 +81,3 @@ void MPrsStd_AISPresentationRetrievalDriver::Paste(const Handle(PDF_Attribute)&
|
||||
cout << endl;
|
||||
#endif
|
||||
}
|
||||
|
@@ -14,9 +14,10 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class AISPresentationRetrievalDriver_1 from MPrsStd inherits ARDriver from MDF
|
||||
class PresentationRetrievalDriver_1 from MDataXtd inherits ARDriver from MDF
|
||||
|
||||
---Purpose:
|
||||
---Purpose: Retrieval drivers for graphic attributes from
|
||||
-- PDataXtd
|
||||
|
||||
uses RRelocationTable from MDF,
|
||||
Attribute from PDF,
|
||||
@@ -27,7 +28,7 @@ is
|
||||
|
||||
|
||||
Create (theMessageDriver : MessageDriver from CDM) -- Version 1
|
||||
returns mutable AISPresentationRetrievalDriver_1 from MPrsStd;
|
||||
returns mutable PresentationRetrievalDriver_1 from MDataXtd;
|
||||
|
||||
|
||||
VersionNumber(me) returns Integer from Standard;
|
||||
@@ -35,7 +36,7 @@ is
|
||||
-- is available: 1.
|
||||
|
||||
SourceType(me) returns Type from Standard;
|
||||
---Purpose: Returns the type: AISPresentation from PPrsStd.
|
||||
---Purpose: Returns the type: Presentation from PDataXtd.
|
||||
|
||||
NewEmpty (me) returns mutable Attribute from TDF;
|
||||
|
||||
@@ -46,4 +47,4 @@ is
|
||||
RelocTable : RRelocationTable from MDF);
|
||||
|
||||
|
||||
end AISPresentationRetrievalDriver_1;
|
||||
end PresentationRetrievalDriver_1;
|
@@ -14,67 +14,69 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <MPrsStd_AISPresentationRetrievalDriver_1.ixx>
|
||||
#include <MDataXtd_PresentationRetrievalDriver_1.ixx>
|
||||
|
||||
#include <PPrsStd_AISPresentation_1.hxx>
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <PDataXtd_Presentation_1.hxx>
|
||||
#include <TDataXtd_Presentation.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <PCollection_HExtendedString.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : MPrsStd_AISPresentationRetrievalDriver_1
|
||||
//function : MDataXtd_PresentationRetrievalDriver_1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
MPrsStd_AISPresentationRetrievalDriver_1::MPrsStd_AISPresentationRetrievalDriver_1(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
|
||||
MDataXtd_PresentationRetrievalDriver_1::MDataXtd_PresentationRetrievalDriver_1(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
:MDF_ARDriver(theMsgDriver)
|
||||
{}
|
||||
|
||||
Standard_Integer MPrsStd_AISPresentationRetrievalDriver_1::VersionNumber() const
|
||||
{ return 1; }
|
||||
Standard_Integer MDataXtd_PresentationRetrievalDriver_1::VersionNumber() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(Standard_Type) MPrsStd_AISPresentationRetrievalDriver_1::SourceType() const
|
||||
{ return STANDARD_TYPE(PPrsStd_AISPresentation_1); }
|
||||
Handle(Standard_Type) MDataXtd_PresentationRetrievalDriver_1::SourceType() const
|
||||
{
|
||||
return STANDARD_TYPE(PDataXtd_Presentation_1);
|
||||
}
|
||||
|
||||
Handle(TDF_Attribute) MPrsStd_AISPresentationRetrievalDriver_1::NewEmpty() const
|
||||
{ return new TPrsStd_AISPresentation; }
|
||||
Handle(TDF_Attribute) MDataXtd_PresentationRetrievalDriver_1::NewEmpty() const
|
||||
{
|
||||
return new TDataXtd_Presentation;
|
||||
}
|
||||
|
||||
void MPrsStd_AISPresentationRetrievalDriver_1::Paste(const Handle(PDF_Attribute)& Source,
|
||||
void MDataXtd_PresentationRetrievalDriver_1::Paste(const Handle(PDF_Attribute)& Source,
|
||||
const Handle(TDF_Attribute)& Target,
|
||||
const Handle(MDF_RRelocationTable)& /*RelocTable*/) const
|
||||
{
|
||||
Handle(PPrsStd_AISPresentation_1) S = Handle(PPrsStd_AISPresentation_1)::DownCast (Source);
|
||||
Handle(TPrsStd_AISPresentation) T = Handle(TPrsStd_AISPresentation)::DownCast (Target);
|
||||
Handle(PDataXtd_Presentation_1) S = Handle(PDataXtd_Presentation_1)::DownCast (Source);
|
||||
Handle(TDataXtd_Presentation) T = Handle(TDataXtd_Presentation)::DownCast (Target);
|
||||
|
||||
T->SetDisplayed( S->IsDisplayed() );
|
||||
T->SetDisplayed( S->IsDisplayed() );
|
||||
|
||||
TCollection_ExtendedString extstr = (S->GetDriverGUID())->Convert();
|
||||
Standard_GUID guid( extstr.ToExtString() );
|
||||
|
||||
T->SetDriverGUID( guid );
|
||||
TCollection_ExtendedString extstr = (S->GetDriverGUID())->Convert();
|
||||
Standard_GUID guid( extstr.ToExtString() );
|
||||
|
||||
if( S->Color() != -1 ) T->SetColor( (Quantity_NameOfColor)(S->Color()) );
|
||||
T->SetDriverGUID( guid );
|
||||
|
||||
if( S->Color() != -1 ) T->SetColor( S->Color() );
|
||||
else T->UnsetColor();
|
||||
|
||||
if( S->Material() != -1 ) T->SetMaterial( (Graphic3d_NameOfMaterial)(S->Material()) );
|
||||
else T->UnsetMaterial();
|
||||
if( S->Material() != -1 ) T->SetMaterial( S->Material() );
|
||||
else T->UnsetMaterial();
|
||||
|
||||
if( S->Transparency() != -1. ) T->SetTransparency( S->Transparency() );
|
||||
else T->UnsetTransparency();
|
||||
|
||||
if( S->Width() != -1. ) T->SetWidth( S->Width() );
|
||||
else T->UnsetWidth();
|
||||
else T->UnsetWidth();
|
||||
|
||||
T->SetMode(S->Mode());
|
||||
|
||||
|
||||
#ifdef DEB
|
||||
cout << "AISPresentationRetrievalDriver " << "retrieved DriverGUID ==> ";
|
||||
guid.ShallowDump(cout);
|
||||
cout << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -14,9 +14,10 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class AISPresentationStorageDriver from MPrsStd inherits ASDriver from MDF
|
||||
class PresentationStorageDriver from MDataXtd inherits ASDriver from MDF
|
||||
|
||||
---Purpose:
|
||||
---Purpose: Storage driver for graphic attributes from
|
||||
-- TDataXtd
|
||||
|
||||
uses SRelocationTable from MDF,
|
||||
Attribute from TDF,
|
||||
@@ -27,7 +28,7 @@ uses SRelocationTable from MDF,
|
||||
is
|
||||
|
||||
Create (theMessageDriver : MessageDriver from CDM)
|
||||
returns mutable AISPresentationStorageDriver from MPrsStd;
|
||||
returns mutable PresentationStorageDriver from MDataXtd;
|
||||
|
||||
|
||||
VersionNumber(me) returns Integer from Standard;
|
||||
@@ -35,7 +36,7 @@ is
|
||||
-- is available: 0.
|
||||
|
||||
SourceType(me) returns Type from Standard;
|
||||
---Purpose: Returns the type: AISPresentation from TPrsStd.
|
||||
---Purpose: Returns the type: Presentation from TDataXtd.
|
||||
|
||||
NewEmpty (me) returns mutable Attribute from PDF;
|
||||
|
||||
@@ -46,5 +47,5 @@ is
|
||||
RelocTable : SRelocationTable from MDF);
|
||||
|
||||
|
||||
end AISPresentationStorageDriver;
|
||||
end PresentationStorageDriver;
|
||||
|
85
src/MDataXtd/MDataXtd_PresentationStorageDriver.cxx
Normal file
85
src/MDataXtd/MDataXtd_PresentationStorageDriver.cxx
Normal file
@@ -0,0 +1,85 @@
|
||||
// Created on: 1997-07-08
|
||||
// Created by: Sergey RUIN
|
||||
// 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.
|
||||
|
||||
#include <MDataXtd_PresentationStorageDriver.ixx>
|
||||
|
||||
#include <PDataXtd_Presentation.hxx>
|
||||
#include <PDataXtd_Presentation_1.hxx>
|
||||
#include <TDataXtd_Presentation.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <PCollection_HExtendedString.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : MDataXtd_PresentationStorageDriver
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
MDataXtd_PresentationStorageDriver::MDataXtd_PresentationStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
: MDF_ASDriver(theMsgDriver)
|
||||
{
|
||||
}
|
||||
|
||||
Standard_Integer MDataXtd_PresentationStorageDriver::VersionNumber() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Handle(Standard_Type) MDataXtd_PresentationStorageDriver::SourceType() const
|
||||
{
|
||||
return STANDARD_TYPE(TDataXtd_Presentation);
|
||||
}
|
||||
|
||||
Handle(PDF_Attribute) MDataXtd_PresentationStorageDriver::NewEmpty() const
|
||||
{
|
||||
return new PDataXtd_Presentation_1;
|
||||
}
|
||||
|
||||
void MDataXtd_PresentationStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
|
||||
const Handle(PDF_Attribute)& Target,
|
||||
const Handle(MDF_SRelocationTable)& /*RelocTable*/) const
|
||||
{
|
||||
Handle(TDataXtd_Presentation) S = Handle(TDataXtd_Presentation)::DownCast(Source);
|
||||
|
||||
Handle(PDataXtd_Presentation_1) T = Handle(PDataXtd_Presentation_1)::DownCast(Target);
|
||||
|
||||
T->SetDisplayed( S->IsDisplayed() );
|
||||
|
||||
TCollection_ExtendedString extstr("00000000-0000-0000-0000-000000000000"); //covert GUID into ExtendedString
|
||||
Standard_PExtCharacter pStr = const_cast<Standard_PExtCharacter>(extstr.ToExtString());
|
||||
S->GetDriverGUID().ToExtString(pStr);
|
||||
|
||||
Handle(PCollection_HExtendedString) guid = new PCollection_HExtendedString ( extstr );
|
||||
T->SetDriverGUID ( guid );
|
||||
|
||||
if( S->IsHasOwnColor() ) T->SetColor( S->Color() );
|
||||
else T->SetColor(-1);
|
||||
|
||||
if( S->IsHasOwnMaterial() ) T->SetMaterial( S->Material() );
|
||||
else T->SetMaterial(-1);
|
||||
|
||||
if( S->IsHasOwnTransparency() ) T->SetTransparency( S->Transparency() );
|
||||
else T->SetTransparency(-1.);
|
||||
|
||||
if( S->IsHasOwnWidth() ) T->SetWidth( S->Width() );
|
||||
else T->SetWidth(-1.);
|
||||
|
||||
T->SetMode(S->Mode());
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "AISPresentationStorageDriver " << "storaged DriverGUID ==> " << guid->Convert() << endl;
|
||||
#endif
|
||||
}
|
@@ -1,60 +0,0 @@
|
||||
-- Created on: 1997-08-26
|
||||
-- Created by: SMO
|
||||
-- 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.
|
||||
|
||||
package MPrsStd
|
||||
|
||||
---Purpose: Storage and Retrieval drivers for graphic
|
||||
-- attributes. Transient attributes are defined in
|
||||
-- package TPrsStd and persistent one are defined in
|
||||
-- package PPrsStd
|
||||
|
||||
uses TDF,
|
||||
PDF,
|
||||
MDF,
|
||||
CDM
|
||||
|
||||
is
|
||||
|
||||
---Purpose: Storage drivers for graphic attributes from
|
||||
-- TPrsStd
|
||||
---Category: StorageDriver
|
||||
|
||||
class AISPresentationStorageDriver;
|
||||
class PositionStorageDriver;
|
||||
|
||||
---Purpose: Retrieval drivers for graphic attributes from
|
||||
-- PPrsStd
|
||||
---Category: RetrievalDriver
|
||||
|
||||
|
||||
class AISPresentationRetrievalDriver;
|
||||
class AISPresentationRetrievalDriver_1;
|
||||
class PositionRetrievalDriver;
|
||||
|
||||
AddStorageDrivers(aDriverTable : ASDriverHSequence from MDF;theMessageDriver : MessageDriver from CDM);
|
||||
---Purpose: Adds the attribute storage drivers to <aDriverTable>.
|
||||
---Category: StorageDriversTable
|
||||
|
||||
|
||||
AddRetrievalDrivers(aDriverTable : ARDriverHSequence from MDF;theMessageDriver : MessageDriver from CDM);
|
||||
---Purpose: Adds the attribute retrieval drivers to <aDriverTable>.
|
||||
---Category: RetrievalDriversTable
|
||||
|
||||
|
||||
end MPrsStd;
|
||||
|
||||
|
||||
|
@@ -1,56 +0,0 @@
|
||||
// Created on: 1997-08-26
|
||||
// Created by: Guest Design
|
||||
// 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.
|
||||
|
||||
#include <MPrsStd.ixx>
|
||||
#include <MDF_ASDriverHSequence.hxx>
|
||||
#include <MDF_ARDriverHSequence.hxx>
|
||||
#include <MPrsStd_AISPresentationStorageDriver.hxx>
|
||||
#include <MPrsStd_AISPresentationRetrievalDriver.hxx>
|
||||
#include <MPrsStd_AISPresentationRetrievalDriver_1.hxx>
|
||||
//#include <MPrsStd_AISViewerStorageDriver.hxx>
|
||||
//#include <MPrsStd_AISViewerRetrievalDriver.hxx>
|
||||
#include <MPrsStd_PositionStorageDriver.hxx>
|
||||
#include <MPrsStd_PositionRetrievalDriver.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : AddStorageDriver
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void MPrsStd::AddStorageDrivers
|
||||
(const Handle(MDF_ASDriverHSequence)& aDriverSeq, const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
{
|
||||
aDriverSeq->Append(new MPrsStd_AISPresentationStorageDriver(theMsgDriver));
|
||||
// aDriverSeq->Append(new MPrsStd_AISViewerStorageDriver());
|
||||
aDriverSeq->Append(new MPrsStd_PositionStorageDriver(theMsgDriver));
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : AddRetrievalDriver
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void MPrsStd::AddRetrievalDrivers
|
||||
(const Handle(MDF_ARDriverHSequence)& aDriverSeq, const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
{
|
||||
aDriverSeq->Append(new MPrsStd_AISPresentationRetrievalDriver(theMsgDriver));
|
||||
aDriverSeq->Append(new MPrsStd_AISPresentationRetrievalDriver_1(theMsgDriver));
|
||||
// aDriverSeq->Append(new MPrsStd_AISViewerRetrievalDriver());
|
||||
aDriverSeq->Append(new MPrsStd_PositionRetrievalDriver(theMsgDriver));
|
||||
}
|
||||
|
||||
|
@@ -1,91 +0,0 @@
|
||||
// Created on: 1997-07-08
|
||||
// Created by: Sergey RUIN
|
||||
// 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.
|
||||
|
||||
#include <MPrsStd_AISPresentationStorageDriver.ixx>
|
||||
|
||||
#include <PPrsStd_AISPresentation.hxx>
|
||||
#include <PPrsStd_AISPresentation_1.hxx>
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <PCollection_HExtendedString.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : MPrsStd_AISPresentationStorageDriver
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
MPrsStd_AISPresentationStorageDriver::MPrsStd_AISPresentationStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
|
||||
{
|
||||
}
|
||||
|
||||
Standard_Integer MPrsStd_AISPresentationStorageDriver::VersionNumber() const
|
||||
{ return 0; }
|
||||
|
||||
Handle(Standard_Type) MPrsStd_AISPresentationStorageDriver::SourceType() const
|
||||
{ return STANDARD_TYPE(TPrsStd_AISPresentation); }
|
||||
|
||||
Handle(PDF_Attribute) MPrsStd_AISPresentationStorageDriver::NewEmpty() const
|
||||
{
|
||||
// return new PPrsStd_AISPresentation;
|
||||
return new PPrsStd_AISPresentation_1;
|
||||
}
|
||||
|
||||
void MPrsStd_AISPresentationStorageDriver::Paste(const Handle(TDF_Attribute)& Source,
|
||||
const Handle(PDF_Attribute)& Target,
|
||||
const Handle(MDF_SRelocationTable)& /*RelocTable*/) const
|
||||
{
|
||||
Handle(TPrsStd_AISPresentation) S = Handle(TPrsStd_AISPresentation)::DownCast (Source);
|
||||
|
||||
// Handle(PPrsStd_AISPresentation) T = Handle(PPrsStd_AISPresentation)::DownCast (Target);
|
||||
Handle(PPrsStd_AISPresentation_1) T = Handle(PPrsStd_AISPresentation_1)::DownCast (Target);
|
||||
|
||||
T->SetDisplayed( S->IsDisplayed() );
|
||||
|
||||
TCollection_ExtendedString extstr("00000000-0000-0000-0000-000000000000"); //covert GUID into ExtendedString
|
||||
Standard_PExtCharacter pStr;
|
||||
//
|
||||
pStr=(Standard_PExtCharacter)extstr.ToExtString();
|
||||
S->GetDriverGUID().ToExtString(pStr);
|
||||
|
||||
Handle(PCollection_HExtendedString) guid = new PCollection_HExtendedString ( extstr );
|
||||
T->SetDriverGUID ( guid );
|
||||
|
||||
if( S->HasOwnColor() ) T->SetColor( (Standard_Integer)(S->Color()) );
|
||||
else T->SetColor(-1);
|
||||
|
||||
if( S->HasOwnMaterial() ) T->SetMaterial( (Standard_Integer)(S->Material()) );
|
||||
else T->SetMaterial(-1);
|
||||
|
||||
if( S->HasOwnTransparency() ) T->SetTransparency( S->Transparency() );
|
||||
else T->SetTransparency(-1.);
|
||||
|
||||
if( S->HasOwnWidth() ) T->SetWidth( S->Width() );
|
||||
else T->SetWidth(-1.);
|
||||
|
||||
T->SetMode(S->Mode());
|
||||
|
||||
#ifdef DEB
|
||||
cout << "AISPresentationStorageDriver " << "storaged DriverGUID ==> " << guid->Convert() << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@@ -21,6 +21,7 @@ proc ApplicationFramework:toolkits { } {
|
||||
TKCDF \
|
||||
TKLCAF \
|
||||
TKCAF \
|
||||
TKVCAF \
|
||||
TKBinL \
|
||||
TKXmlL \
|
||||
TKShapeSchema \
|
||||
|
@@ -58,7 +58,11 @@ is
|
||||
|
||||
class PatternStd;
|
||||
|
||||
class Shape;
|
||||
class Shape;
|
||||
|
||||
class Presentation;
|
||||
|
||||
class Presentation_1;
|
||||
|
||||
|
||||
end PDataXtd;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class AISPresentation from PPrsStd
|
||||
class Presentation from PDataXtd
|
||||
inherits Attribute from PDF
|
||||
|
||||
---Purpose:
|
||||
@@ -22,7 +22,7 @@ class AISPresentation from PPrsStd
|
||||
uses HExtendedString from PCollection
|
||||
is
|
||||
|
||||
Create returns mutable AISPresentation from PPrsStd;
|
||||
Create returns mutable Presentation from PDataXtd;
|
||||
|
||||
IsDisplayed(me) returns Boolean from Standard;
|
||||
SetDisplayed(me : mutable; B : Boolean from Standard);
|
||||
@@ -51,4 +51,4 @@ fields
|
||||
myColor : Integer from Standard;
|
||||
myMaterial : Integer from Standard;
|
||||
myWidth : Real from Standard;
|
||||
end AISPresentation;
|
||||
end Presentation;
|
@@ -14,20 +14,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <PPrsStd_AISPresentation.ixx>
|
||||
#include <PDataXtd_Presentation.ixx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PPrsStd_AISPresentation
|
||||
//function : PDataXtd_Presentation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
PPrsStd_AISPresentation::PPrsStd_AISPresentation() :
|
||||
myIsDisplayed(Standard_False),
|
||||
myTransparency(0.),
|
||||
myColor(0),
|
||||
myMaterial(0),
|
||||
myWidth(0.)
|
||||
PDataXtd_Presentation::PDataXtd_Presentation() :
|
||||
myIsDisplayed(Standard_False),
|
||||
myTransparency(0.),
|
||||
myColor(0),
|
||||
myMaterial(0),
|
||||
myWidth(0.)
|
||||
{}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ PPrsStd_AISPresentation::PPrsStd_AISPresentation() :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void PPrsStd_AISPresentation::SetDisplayed (const Standard_Boolean B)
|
||||
void PDataXtd_Presentation::SetDisplayed (const Standard_Boolean B)
|
||||
{
|
||||
myIsDisplayed = B ;
|
||||
}
|
||||
@@ -46,9 +46,9 @@ void PPrsStd_AISPresentation::SetDisplayed (const Standard_Boolean B)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean PPrsStd_AISPresentation::IsDisplayed() const
|
||||
Standard_Boolean PDataXtd_Presentation::IsDisplayed() const
|
||||
{
|
||||
return myIsDisplayed;
|
||||
return myIsDisplayed;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ Standard_Boolean PPrsStd_AISPresentation::IsDisplayed() const
|
||||
//function : SetDriverGUID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PPrsStd_AISPresentation::SetDriverGUID( const Handle(PCollection_HExtendedString)& guid)
|
||||
void PDataXtd_Presentation::SetDriverGUID( const Handle(PCollection_HExtendedString)& guid)
|
||||
{
|
||||
myDriverGUID = guid;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ void PPrsStd_AISPresentation::SetDriverGUID( const Handle(PCollection_HExtendedS
|
||||
//function : GetDriverGUID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(PCollection_HExtendedString) PPrsStd_AISPresentation::GetDriverGUID( void ) const
|
||||
Handle(PCollection_HExtendedString) PDataXtd_Presentation::GetDriverGUID( void ) const
|
||||
{
|
||||
return myDriverGUID;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ Handle(PCollection_HExtendedString) PPrsStd_AISPresentation::GetDriverGUID( void
|
||||
//function : Color
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer PPrsStd_AISPresentation::Color() const
|
||||
Standard_Integer PDataXtd_Presentation::Color() const
|
||||
{
|
||||
return myColor;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ Standard_Integer PPrsStd_AISPresentation::Color() const
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PPrsStd_AISPresentation::SetColor(const Standard_Integer C)
|
||||
void PDataXtd_Presentation::SetColor(const Standard_Integer C)
|
||||
{
|
||||
myColor = C;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ void PPrsStd_AISPresentation::SetColor(const Standard_Integer C)
|
||||
//function : Transparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real PPrsStd_AISPresentation::Transparency() const
|
||||
Standard_Real PDataXtd_Presentation::Transparency() const
|
||||
{
|
||||
return myTransparency;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ Standard_Real PPrsStd_AISPresentation::Transparency() const
|
||||
//function : SetTransparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PPrsStd_AISPresentation::SetTransparency(const Standard_Real T)
|
||||
void PDataXtd_Presentation::SetTransparency(const Standard_Real T)
|
||||
{
|
||||
myTransparency = T;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ void PPrsStd_AISPresentation::SetTransparency(const Standard_Real T)
|
||||
//function : Material
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer PPrsStd_AISPresentation::Material() const
|
||||
Standard_Integer PDataXtd_Presentation::Material() const
|
||||
{
|
||||
return myMaterial;
|
||||
}
|
||||
@@ -119,25 +119,25 @@ Standard_Integer PPrsStd_AISPresentation::Material() const
|
||||
//function : SetMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PPrsStd_AISPresentation::SetMaterial(const Standard_Integer M)
|
||||
void PDataXtd_Presentation::SetMaterial(const Standard_Integer M)
|
||||
{
|
||||
myMaterial = M;
|
||||
myMaterial = M;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Width
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real PPrsStd_AISPresentation::Width() const
|
||||
Standard_Real PDataXtd_Presentation::Width() const
|
||||
{
|
||||
return myWidth;
|
||||
return myWidth;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetWidth
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PPrsStd_AISPresentation::SetWidth(const Standard_Real W)
|
||||
void PDataXtd_Presentation::SetWidth(const Standard_Real W)
|
||||
{
|
||||
myWidth = W;
|
||||
}
|
@@ -14,7 +14,7 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class AISPresentation_1 from PPrsStd
|
||||
class Presentation_1 from PDataXtd
|
||||
inherits Attribute from PDF
|
||||
|
||||
---Purpose:
|
||||
@@ -22,7 +22,7 @@ class AISPresentation_1 from PPrsStd
|
||||
uses HExtendedString from PCollection
|
||||
is
|
||||
|
||||
Create returns mutable AISPresentation_1 from PPrsStd;
|
||||
Create returns mutable Presentation_1 from PDataXtd;
|
||||
|
||||
IsDisplayed(me) returns Boolean from Standard;
|
||||
SetDisplayed(me : mutable; B : Boolean from Standard);
|
||||
@@ -53,4 +53,4 @@ fields
|
||||
myMaterial : Integer from Standard;
|
||||
myWidth : Real from Standard;
|
||||
myMode : Integer from Standard;
|
||||
end AISPresentation_1;
|
||||
end Presentation_1;
|
@@ -14,15 +14,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <PPrsStd_AISPresentation_1.ixx>
|
||||
#include <PDataXtd_Presentation_1.ixx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PPrsStd_AISPresentation
|
||||
//function : PDataXtd_Presentation_1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
PPrsStd_AISPresentation_1::PPrsStd_AISPresentation_1() :
|
||||
PDataXtd_Presentation_1::PDataXtd_Presentation_1() :
|
||||
myIsDisplayed(Standard_False),
|
||||
myTransparency(0.),
|
||||
myColor(0),
|
||||
@@ -38,7 +38,7 @@ PPrsStd_AISPresentation_1::PPrsStd_AISPresentation_1() :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void PPrsStd_AISPresentation_1::SetDisplayed (const Standard_Boolean B)
|
||||
void PDataXtd_Presentation_1::SetDisplayed (const Standard_Boolean B)
|
||||
{
|
||||
myIsDisplayed = B ;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ void PPrsStd_AISPresentation_1::SetDisplayed (const Standard_Boolean B)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean PPrsStd_AISPresentation_1::IsDisplayed() const
|
||||
Standard_Boolean PDataXtd_Presentation_1::IsDisplayed() const
|
||||
{
|
||||
return myIsDisplayed;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ Standard_Boolean PPrsStd_AISPresentation_1::IsDisplayed() const
|
||||
//function : SetDriverGUID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PPrsStd_AISPresentation_1::SetDriverGUID( const Handle(PCollection_HExtendedString)& guid)
|
||||
void PDataXtd_Presentation_1::SetDriverGUID( const Handle(PCollection_HExtendedString)& guid)
|
||||
{
|
||||
myDriverGUID = guid;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ void PPrsStd_AISPresentation_1::SetDriverGUID( const Handle(PCollection_HExtende
|
||||
//function : GetDriverGUID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(PCollection_HExtendedString) PPrsStd_AISPresentation_1::GetDriverGUID( void ) const
|
||||
Handle(PCollection_HExtendedString) PDataXtd_Presentation_1::GetDriverGUID( void ) const
|
||||
{
|
||||
return myDriverGUID;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ Handle(PCollection_HExtendedString) PPrsStd_AISPresentation_1::GetDriverGUID( vo
|
||||
//function : Color
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer PPrsStd_AISPresentation_1::Color() const
|
||||
Standard_Integer PDataXtd_Presentation_1::Color() const
|
||||
{
|
||||
return myColor;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ Standard_Integer PPrsStd_AISPresentation_1::Color() const
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PPrsStd_AISPresentation_1::SetColor(const Standard_Integer C)
|
||||
void PDataXtd_Presentation_1::SetColor(const Standard_Integer C)
|
||||
{
|
||||
myColor = C;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ void PPrsStd_AISPresentation_1::SetColor(const Standard_Integer C)
|
||||
//function : Transparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real PPrsStd_AISPresentation_1::Transparency() const
|
||||
Standard_Real PDataXtd_Presentation_1::Transparency() const
|
||||
{
|
||||
return myTransparency;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ Standard_Real PPrsStd_AISPresentation_1::Transparency() const
|
||||
//function : SetTransparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PPrsStd_AISPresentation_1::SetTransparency(const Standard_Real T)
|
||||
void PDataXtd_Presentation_1::SetTransparency(const Standard_Real T)
|
||||
{
|
||||
myTransparency = T;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void PPrsStd_AISPresentation_1::SetTransparency(const Standard_Real T)
|
||||
//function : Material
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer PPrsStd_AISPresentation_1::Material() const
|
||||
Standard_Integer PDataXtd_Presentation_1::Material() const
|
||||
{
|
||||
return myMaterial;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ Standard_Integer PPrsStd_AISPresentation_1::Material() const
|
||||
//function : SetMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PPrsStd_AISPresentation_1::SetMaterial(const Standard_Integer M)
|
||||
void PDataXtd_Presentation_1::SetMaterial(const Standard_Integer M)
|
||||
{
|
||||
myMaterial = M;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ void PPrsStd_AISPresentation_1::SetMaterial(const Standard_Integer M)
|
||||
//function : Width
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real PPrsStd_AISPresentation_1::Width() const
|
||||
Standard_Real PDataXtd_Presentation_1::Width() const
|
||||
{
|
||||
return myWidth;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ Standard_Real PPrsStd_AISPresentation_1::Width() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void PPrsStd_AISPresentation_1::SetWidth(const Standard_Real W)
|
||||
void PDataXtd_Presentation_1::SetWidth(const Standard_Real W)
|
||||
{
|
||||
myWidth = W;
|
||||
}
|
||||
@@ -155,7 +155,7 @@ void PPrsStd_AISPresentation_1::SetWidth(const Standard_Real W)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer PPrsStd_AISPresentation_1::Mode() const
|
||||
Standard_Integer PDataXtd_Presentation_1::Mode() const
|
||||
{
|
||||
return myMode;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ Standard_Integer PPrsStd_AISPresentation_1::Mode() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void PPrsStd_AISPresentation_1::SetMode(const Standard_Integer M)
|
||||
void PDataXtd_Presentation_1::SetMode(const Standard_Integer M)
|
||||
{
|
||||
myMode = M;
|
||||
}
|
@@ -1,34 +0,0 @@
|
||||
-- Created on: 1997-08-26
|
||||
-- Created by: SMO
|
||||
-- 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.
|
||||
|
||||
package PPrsStd
|
||||
|
||||
uses
|
||||
|
||||
Standard,
|
||||
Quantity,
|
||||
PDF,
|
||||
PCollection,
|
||||
gp
|
||||
|
||||
is
|
||||
class AISPresentation;
|
||||
class AISPresentation_1;
|
||||
--class Position; now it is in PDataStd
|
||||
|
||||
end PPrsStd;
|
||||
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include <MNaming.hxx>
|
||||
#include <MDocStd.hxx>
|
||||
#include <MFunction.hxx>
|
||||
#include <MPrsStd.hxx>
|
||||
#include <CDM_MessageDriver.hxx>
|
||||
//=======================================================================
|
||||
//function : PAppStd_DocumentRetrievalDriver
|
||||
@@ -47,7 +46,6 @@ Handle(MDF_ARDriverTable) StdDrivers_DocumentRetrievalDriver::AttributeDrivers(c
|
||||
MDocStd::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
MFunction::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
MNaming::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
MPrsStd::AddRetrievalDrivers(HARSeq, theMsgDriver);
|
||||
|
||||
//
|
||||
aRetrievalTable->SetDrivers(HARSeq);
|
||||
|
@@ -19,7 +19,6 @@
|
||||
#include <MDataXtd.hxx>
|
||||
#include <MNaming.hxx>
|
||||
#include <MDocStd.hxx>
|
||||
#include <MPrsStd.hxx>
|
||||
#include <MFunction.hxx>
|
||||
|
||||
#include <TNaming_Tool.hxx>
|
||||
@@ -58,7 +57,6 @@ Handle(MDF_ASDriverTable) StdDrivers_DocumentStorageDriver::AttributeDrivers(con
|
||||
MDocStd::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
MFunction::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
MNaming::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
MPrsStd::AddStorageDrivers(HASSeq, theMsgDriver);
|
||||
//
|
||||
aStorageTable->SetDrivers(HASSeq);
|
||||
return aStorageTable;
|
||||
|
@@ -18,7 +18,6 @@ schema StdSchema
|
||||
is
|
||||
package PDataXtd;
|
||||
package PNaming;
|
||||
package PPrsStd;
|
||||
|
||||
end StdSchema;
|
||||
|
||||
|
@@ -105,6 +105,8 @@ is
|
||||
class Axis;
|
||||
|
||||
class Plane;
|
||||
|
||||
class Presentation;
|
||||
|
||||
deferred class Pattern;
|
||||
|
||||
|
162
src/TDataXtd/TDataXtd_Presentation.cdl
Normal file
162
src/TDataXtd/TDataXtd_Presentation.cdl
Normal file
@@ -0,0 +1,162 @@
|
||||
-- Created on: 1998-09-30
|
||||
-- Created by: Denis PASCAL
|
||||
-- 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 Presentation from TDataXtd inherits Attribute from TDF
|
||||
|
||||
---Purpose: An attribute to associate an
|
||||
-- AIS_InteractiveObject to a label in an AIS viewer.
|
||||
-- This attribute works in collaboration with TPrsStd_AISViewer.
|
||||
-- Note that all the Set... and Unset... attribute
|
||||
-- methods as well as the query methods for
|
||||
-- visualization attributes and the HasOwn... test
|
||||
-- methods are shortcuts to the respective
|
||||
-- AIS_InteractiveObject settings.
|
||||
|
||||
uses GUID from Standard,
|
||||
AttributeIndexedMap from TDF,
|
||||
DataSet from TDF,
|
||||
AttributeDelta from TDF,
|
||||
Label from TDF,
|
||||
RelocationTable from TDF
|
||||
|
||||
is
|
||||
|
||||
Create returns Presentation from TDataXtd;
|
||||
---Purpose: Default constructor.
|
||||
|
||||
Set(myclass; theLabel : Label from TDF; theDriverId : GUID from Standard)
|
||||
returns Presentation from TDataXtd;
|
||||
---Purpose: Creates or retrieves the presentation attribute on
|
||||
-- the label, and sets the GUID driver.
|
||||
|
||||
Set(myclass; theMaster : Attribute from TDF) returns Presentation from TDataXtd;
|
||||
---Purpose: Creates or retrieves the presentation attribute attached to master.
|
||||
-- The GUID of the driver will be the GUID of master.
|
||||
-- Master is the attribute you want to display.
|
||||
|
||||
Unset(myclass; theLabel : Label from TDF);
|
||||
---Purpose: Delete (if exist) the presentation attribute associated to the input label.
|
||||
|
||||
GetID(myclass) returns GUID from Standard;
|
||||
---Purpose: Returns the GUID for TDataXtd_Presentation attributes.
|
||||
---C++: return const &
|
||||
|
||||
GetDriverGUID(me) returns GUID from Standard;
|
||||
|
||||
SetDriverGUID(me: mutable ; theGUID : GUID from Standard);
|
||||
|
||||
ID(me)returns GUID from Standard;
|
||||
---C++: return const &
|
||||
|
||||
|
||||
IsDisplayed(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute is displayed.
|
||||
|
||||
IsHasOwnMaterial(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a material setting.
|
||||
|
||||
IsHasOwnTransparency(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a transparency setting.
|
||||
|
||||
IsHasOwnColor(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a color setting.
|
||||
|
||||
IsHasOwnWidth(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a width setting.
|
||||
|
||||
IsHasOwnMode(me) returns Boolean from Standard;
|
||||
|
||||
IsHasOwnSelectionMode(me) returns Boolean from Standard;
|
||||
|
||||
|
||||
SetDisplayed(me : mutable; theIsDisplayed : Boolean from Standard);
|
||||
|
||||
SetMaterial(me : mutable; theName : Integer from Standard);
|
||||
---Purpose: Sets the material for this presentation attribute.
|
||||
|
||||
SetTransparency(me : mutable; theValue : Real from Standard = 0.6);
|
||||
---Purpose:
|
||||
-- Sets the transparency value for this presentation attribute.
|
||||
-- @param theValue - parameter of transparency, this value is 0.6 by default.
|
||||
|
||||
SetColor(me: mutable; theColor : Integer from Standard);
|
||||
---Purpose: Sets the color aColor for this presentation attribute.
|
||||
|
||||
SetWidth(me: mutable; theWidth : Real from Standard);
|
||||
---Purpose: Sets the width for this presentation attribute.
|
||||
|
||||
SetMode(me: mutable; theMode : Integer from Standard);
|
||||
|
||||
SetSelectionMode(me: mutable; theSelectionMode : Integer from Standard);
|
||||
|
||||
|
||||
Material(me) returns Integer from Standard;
|
||||
---Purpose: Returns the material setting for this presentation attribute.
|
||||
|
||||
Transparency(me) returns Real from Standard;
|
||||
|
||||
Color(me) returns Integer from Standard;
|
||||
|
||||
Width(me) returns Real from Standard;
|
||||
|
||||
Mode(me) returns Integer from Standard;
|
||||
|
||||
SelectionMode(me) returns Integer from Standard;
|
||||
|
||||
|
||||
UnsetMaterial(me : mutable);
|
||||
---Purpose: Removes the material setting from this presentation attribute.
|
||||
|
||||
UnsetTransparency(me : mutable);
|
||||
---Purpose: Removes the transparency setting from this presentation attribute.
|
||||
|
||||
UnsetColor(me : mutable);
|
||||
---Purpose: Removes the color setting from this presentation attribute.
|
||||
|
||||
UnsetWidth(me : mutable);
|
||||
---Purpose: Removes the width setting from this presentation attribute.
|
||||
|
||||
UnsetMode(me : mutable);
|
||||
|
||||
UnsetSelectionMode(me : mutable);
|
||||
|
||||
|
||||
NewEmpty(me) returns Attribute from TDF;
|
||||
|
||||
Restore(me: mutable; theAttribute : Attribute from TDF);
|
||||
|
||||
Paste(me; theInto : mutable Attribute from TDF; theRT : mutable RelocationTable from TDF);
|
||||
|
||||
BackupCopy(me) returns Attribute from TDF is redefined;
|
||||
|
||||
fields
|
||||
|
||||
myDriverGUID : GUID from Standard;
|
||||
myColor : Integer from Standard;
|
||||
myMaterial : Integer from Standard;
|
||||
myMode : Integer from Standard;
|
||||
mySelectionMode : Integer from Standard;
|
||||
myTransparency : Real from Standard;
|
||||
myWidth : Real from Standard;
|
||||
myIsDisplayed : Boolean from Standard;
|
||||
myIsHasOwnColor : Boolean from Standard;
|
||||
myIsHasOwnMaterial : Boolean from Standard;
|
||||
myIsHasOwnTransparency : Boolean from Standard;
|
||||
myIsHasOwnWidth : Boolean from Standard;
|
||||
myIsHasOwnMode : Boolean from Standard;
|
||||
myIsHasOwnSelectionMode: Boolean from Standard;
|
||||
|
||||
end Presentation;
|
566
src/TDataXtd/TDataXtd_Presentation.cxx
Normal file
566
src/TDataXtd/TDataXtd_Presentation.cxx
Normal file
@@ -0,0 +1,566 @@
|
||||
// Created on: 2015-04-20
|
||||
// Created by: Alexander Zaikin
|
||||
// Copyright (c) 1998-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2015 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 <TDataXtd_Presentation.ixx>
|
||||
|
||||
#include <TDF_DefaultDeltaOnRemoval.hxx>
|
||||
#include <TDF_DefaultDeltaOnModification.hxx>
|
||||
#include <TDF_DeltaOnAddition.hxx>
|
||||
#include <TDF_Tool.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : TDataXtd_Presentation
|
||||
//purpose : Default constructor.
|
||||
//=======================================================================
|
||||
TDataXtd_Presentation::TDataXtd_Presentation()
|
||||
: myDriverGUID ("00000000-0000-0000-0000-000000000000"),
|
||||
myColor (516), // Quantity_NOC_WHITE
|
||||
myMaterial (0), // Graphic3d_NOM_BRASS
|
||||
myMode (0),
|
||||
mySelectionMode (0),
|
||||
myTransparency (0.0),
|
||||
myWidth (0.0),
|
||||
myIsDisplayed (Standard_False),
|
||||
myIsHasOwnColor (Standard_False),
|
||||
myIsHasOwnMaterial (Standard_False),
|
||||
myIsHasOwnTransparency (Standard_False),
|
||||
myIsHasOwnWidth (Standard_False),
|
||||
myIsHasOwnMode (Standard_False),
|
||||
myIsHasOwnSelectionMode(Standard_False)
|
||||
{}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TDataXtd_Presentation) TDataXtd_Presentation::Set(const TDF_Label& theLabel,
|
||||
const Standard_GUID& theDriverId)
|
||||
{
|
||||
Handle(TDataXtd_Presentation) aPresentation;
|
||||
|
||||
if ( !theLabel.FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
|
||||
{
|
||||
aPresentation = new TDataXtd_Presentation();
|
||||
theLabel.AddAttribute(aPresentation);
|
||||
}
|
||||
|
||||
aPresentation->SetDriverGUID(theDriverId);
|
||||
return aPresentation;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TDataXtd_Presentation) TDataXtd_Presentation::Set(const Handle(TDF_Attribute)& theMaster)
|
||||
{
|
||||
Handle(TDataXtd_Presentation) aPresentation;
|
||||
|
||||
const TDF_Label aLabel = theMaster->Label();
|
||||
if (!aLabel.FindAttribute(TDataXtd_Presentation::GetID(), aPresentation))
|
||||
{
|
||||
aPresentation = new TDataXtd_Presentation();
|
||||
aLabel.AddAttribute(aPresentation);
|
||||
}
|
||||
|
||||
aPresentation->SetDriverGUID( theMaster->ID() );
|
||||
return aPresentation;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Unset
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::Unset(const TDF_Label& theLabel)
|
||||
{
|
||||
Handle(TDataXtd_Presentation) aPresentation;
|
||||
if (theLabel.FindAttribute(TDataXtd_Presentation::GetID(), aPresentation))
|
||||
theLabel.ForgetAttribute(aPresentation);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Standard_GUID& TDataXtd_Presentation::GetID()
|
||||
{
|
||||
static Standard_GUID TDataXtd_PresentationID("04fb4d00-5690-11d1-8940-080009dc3333");
|
||||
return TDataXtd_PresentationID;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Standard_GUID& TDataXtd_Presentation::ID() const
|
||||
{
|
||||
return GetID();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function :GetDriverGUID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_GUID TDataXtd_Presentation::GetDriverGUID() const
|
||||
{
|
||||
return myDriverGUID;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function :SetDriverGUID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::SetDriverGUID(const Standard_GUID& theGUID)
|
||||
{
|
||||
if ( myDriverGUID != theGUID )
|
||||
{
|
||||
Backup();
|
||||
myDriverGUID = theGUID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsDisplayed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean TDataXtd_Presentation::IsDisplayed() const
|
||||
{
|
||||
return myIsDisplayed;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsHasOwnMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean TDataXtd_Presentation::IsHasOwnMaterial() const
|
||||
{
|
||||
return myIsHasOwnMaterial;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsHasOwnTransparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean TDataXtd_Presentation::IsHasOwnTransparency() const
|
||||
{
|
||||
return myIsHasOwnTransparency;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsHasOwnColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean TDataXtd_Presentation::IsHasOwnColor() const
|
||||
{
|
||||
return myIsHasOwnColor;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsHasOwnWidth
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean TDataXtd_Presentation::IsHasOwnWidth() const
|
||||
{
|
||||
return myIsHasOwnWidth;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsHasOwnMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean TDataXtd_Presentation::IsHasOwnMode() const
|
||||
{
|
||||
return myIsHasOwnMode;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsHasOwnSelectionMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean TDataXtd_Presentation::IsHasOwnSelectionMode() const
|
||||
{
|
||||
return myIsHasOwnSelectionMode;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDisplayed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::SetDisplayed(const Standard_Boolean theIsDisplayed)
|
||||
{
|
||||
Backup();
|
||||
myIsDisplayed = theIsDisplayed;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::SetMaterial(const Standard_Integer theName)
|
||||
{
|
||||
Backup();
|
||||
myMaterial = theName;
|
||||
myIsHasOwnMaterial = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTransparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::SetTransparency(const Standard_Real theValue)
|
||||
{
|
||||
Backup();
|
||||
myTransparency = theValue;
|
||||
myIsHasOwnTransparency = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::SetColor(const Standard_Integer theColor)
|
||||
{
|
||||
Backup();
|
||||
myColor = theColor;
|
||||
myIsHasOwnColor = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetWidth
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::SetWidth(const Standard_Real theWidth)
|
||||
{
|
||||
Backup();
|
||||
myWidth = theWidth;
|
||||
myIsHasOwnWidth = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::SetMode(const Standard_Integer theMode)
|
||||
{
|
||||
Backup();
|
||||
myMode = theMode;
|
||||
myIsHasOwnMode = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetSelectionMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::SetSelectionMode(const Standard_Integer theSelectionMode)
|
||||
{
|
||||
Backup();
|
||||
myIsHasOwnSelectionMode = Standard_True;
|
||||
mySelectionMode = theSelectionMode;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Material
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer TDataXtd_Presentation::Material() const
|
||||
{
|
||||
return myMaterial;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Transparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real TDataXtd_Presentation::Transparency() const
|
||||
{
|
||||
return myTransparency;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Color
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer TDataXtd_Presentation::Color() const
|
||||
{
|
||||
return myColor;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Width
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real TDataXtd_Presentation::Width() const
|
||||
{
|
||||
return myWidth;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Mode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer TDataXtd_Presentation::Mode() const
|
||||
{
|
||||
return myMode;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SelectionMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer TDataXtd_Presentation::SelectionMode() const
|
||||
{
|
||||
return mySelectionMode;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::UnsetMaterial()
|
||||
{
|
||||
Backup();
|
||||
myIsHasOwnMaterial = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetTransparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::UnsetTransparency()
|
||||
{
|
||||
myIsHasOwnTransparency = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::UnsetColor()
|
||||
{
|
||||
Backup();
|
||||
myIsHasOwnColor = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetWidth
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::UnsetWidth()
|
||||
{
|
||||
Backup();
|
||||
myIsHasOwnWidth = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::UnsetMode()
|
||||
{
|
||||
Backup();
|
||||
myIsHasOwnMode = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetSelectionMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::UnsetSelectionMode()
|
||||
{
|
||||
Backup();
|
||||
myIsHasOwnSelectionMode = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BackupCopy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TDF_Attribute) TDataXtd_Presentation::BackupCopy() const
|
||||
{
|
||||
Handle(TDataXtd_Presentation) aCopy = new TDataXtd_Presentation;
|
||||
|
||||
aCopy->myIsDisplayed = myIsDisplayed;
|
||||
aCopy->myDriverGUID = myDriverGUID;
|
||||
aCopy->mySelectionMode = mySelectionMode;
|
||||
aCopy->myTransparency = myTransparency;
|
||||
aCopy->myColor = myColor;
|
||||
aCopy->myMode = myMode;
|
||||
aCopy->myWidth = myWidth;
|
||||
aCopy->myMaterial = myMaterial;
|
||||
|
||||
aCopy->myIsHasOwnColor = myIsHasOwnColor;
|
||||
aCopy->myIsHasOwnMaterial = myIsHasOwnMaterial;
|
||||
aCopy->myIsHasOwnWidth = myIsHasOwnWidth;
|
||||
aCopy->myIsHasOwnMode = myIsHasOwnMode;
|
||||
aCopy->myIsHasOwnTransparency = myIsHasOwnTransparency;
|
||||
aCopy->myIsHasOwnSelectionMode = myIsHasOwnSelectionMode;
|
||||
|
||||
return aCopy;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NewEmpty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TDF_Attribute) TDataXtd_Presentation::NewEmpty() const
|
||||
{
|
||||
return new TDataXtd_Presentation();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::Restore(const Handle(TDF_Attribute)& theAttribute)
|
||||
{
|
||||
Handle(TDataXtd_Presentation) aPresentation =
|
||||
Handle(TDataXtd_Presentation)::DownCast(theAttribute);
|
||||
|
||||
myIsHasOwnMaterial = aPresentation->IsHasOwnMaterial();
|
||||
myMaterial = aPresentation->Material();
|
||||
|
||||
myIsHasOwnColor = aPresentation->IsHasOwnColor();
|
||||
myColor = aPresentation->Color();
|
||||
|
||||
myIsHasOwnWidth = aPresentation->IsHasOwnWidth();
|
||||
myWidth = aPresentation->Width();
|
||||
|
||||
myIsHasOwnMode = aPresentation->IsHasOwnMode();
|
||||
myMode = aPresentation->Mode();
|
||||
|
||||
myIsHasOwnSelectionMode = aPresentation->IsHasOwnSelectionMode();
|
||||
mySelectionMode = aPresentation->SelectionMode();
|
||||
|
||||
myIsHasOwnTransparency = aPresentation->IsHasOwnTransparency();
|
||||
myTransparency = aPresentation->Transparency();
|
||||
|
||||
myIsDisplayed = aPresentation->IsDisplayed();
|
||||
myDriverGUID = aPresentation->GetDriverGUID();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TDataXtd_Presentation::Paste(const Handle(TDF_Attribute)& theInto,
|
||||
const Handle(TDF_RelocationTable)&) const
|
||||
{
|
||||
Handle(TDataXtd_Presentation) anInto =
|
||||
Handle(TDataXtd_Presentation)::DownCast(theInto);
|
||||
|
||||
anInto->Backup();
|
||||
|
||||
if (myIsHasOwnMaterial)
|
||||
{
|
||||
anInto->myMaterial = myMaterial;
|
||||
anInto->myIsHasOwnMaterial = Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
anInto->myIsHasOwnMaterial = Standard_False;
|
||||
}
|
||||
|
||||
if (myIsHasOwnColor)
|
||||
{
|
||||
anInto->myColor = myColor;
|
||||
anInto->myIsHasOwnColor = Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
anInto->myIsHasOwnColor = Standard_False;
|
||||
}
|
||||
|
||||
if(myIsHasOwnWidth)
|
||||
{
|
||||
anInto->myWidth = myWidth;
|
||||
anInto->myIsHasOwnWidth = Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
anInto->myIsHasOwnWidth = Standard_False;
|
||||
}
|
||||
|
||||
if (myIsHasOwnMode)
|
||||
{
|
||||
anInto->myMode = myMode;
|
||||
anInto->myIsHasOwnMode = Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
anInto->myIsHasOwnMode = Standard_False;
|
||||
}
|
||||
|
||||
if (myIsHasOwnSelectionMode)
|
||||
{
|
||||
anInto->mySelectionMode = mySelectionMode;
|
||||
anInto->myIsHasOwnSelectionMode = Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
anInto->myIsHasOwnSelectionMode = Standard_False;
|
||||
}
|
||||
|
||||
if (myIsHasOwnTransparency)
|
||||
{
|
||||
anInto->myTransparency = myTransparency;
|
||||
anInto->myIsHasOwnTransparency = Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
anInto->myIsHasOwnTransparency = Standard_False;
|
||||
}
|
||||
|
||||
anInto->myIsDisplayed = myIsDisplayed;
|
||||
anInto->myDriverGUID = myDriverGUID;
|
||||
}
|
@@ -6,5 +6,4 @@ TKG3d
|
||||
TKCAF
|
||||
TKCDF
|
||||
TKLCAF
|
||||
TKV3d
|
||||
TKBinL
|
||||
|
@@ -1,5 +1,4 @@
|
||||
BinDrivers
|
||||
BinMDataXtd
|
||||
BinMPrsStd
|
||||
BinMNaming
|
||||
BinTools
|
||||
|
@@ -8,5 +8,4 @@ TKG2d
|
||||
TKG3d
|
||||
TKCDF
|
||||
TKLCAF
|
||||
TKV3d
|
||||
TKBO
|
||||
|
@@ -1,4 +1,3 @@
|
||||
TDataXtd
|
||||
TNaming
|
||||
TPrsStd
|
||||
AppStd
|
||||
|
@@ -17,4 +17,5 @@ TKPrim
|
||||
TKBool
|
||||
TKBO
|
||||
TKCAF
|
||||
TKVCAF
|
||||
TKViewerTest
|
||||
|
@@ -4,7 +4,6 @@ TKMath
|
||||
TKernel
|
||||
TKCDF
|
||||
TKG2d
|
||||
TKV3d
|
||||
TKService
|
||||
TKG3d
|
||||
TKPShape
|
||||
|
@@ -1,6 +1,5 @@
|
||||
PDataXtd
|
||||
PNaming
|
||||
PPrsStd
|
||||
MDataXtd
|
||||
MPrsStd
|
||||
MNaming
|
||||
|
@@ -24,6 +24,7 @@ TKShHealing
|
||||
TKOffset
|
||||
TKFeat
|
||||
TKCAF
|
||||
TKVCAF
|
||||
TKIGES
|
||||
TKXSBase
|
||||
TKMesh
|
||||
|
13
src/TKVCAF/EXTERNLIB
Normal file
13
src/TKVCAF/EXTERNLIB
Normal file
@@ -0,0 +1,13 @@
|
||||
TKernel
|
||||
TKGeomBase
|
||||
TKBRep
|
||||
TKTopAlgo
|
||||
TKMath
|
||||
TKService
|
||||
TKG2d
|
||||
TKG3d
|
||||
TKCDF
|
||||
TKLCAF
|
||||
TKBO
|
||||
TKCAF
|
||||
TKV3d
|
2
src/TKVCAF/FILES
Normal file
2
src/TKVCAF/FILES
Normal file
@@ -0,0 +1,2 @@
|
||||
EXTERNLIB
|
||||
PACKAGES
|
1
src/TKVCAF/PACKAGES
Normal file
1
src/TKVCAF/PACKAGES
Normal file
@@ -0,0 +1 @@
|
||||
TPrsStd
|
@@ -9,3 +9,4 @@ TKCDF
|
||||
TKLCAF
|
||||
TKG3d
|
||||
TKCAF
|
||||
TKVCAF
|
||||
|
@@ -10,6 +10,7 @@ TKService
|
||||
TKXSBase
|
||||
TKG2d
|
||||
TKCAF
|
||||
TKVCAF
|
||||
TKDraw
|
||||
TKTopAlgo
|
||||
TKLCAF
|
||||
|
@@ -5,7 +5,6 @@ TKMath
|
||||
TKBRep
|
||||
TKG2d
|
||||
TKGeomBase
|
||||
TKG3d
|
||||
TKLCAF
|
||||
TKCAF
|
||||
TKXmlL
|
||||
|
@@ -1,4 +1,3 @@
|
||||
XmlDrivers
|
||||
XmlMDataXtd
|
||||
XmlMNaming
|
||||
XmlMPrsStd
|
||||
|
@@ -1,7 +1,7 @@
|
||||
00000000-0000-0000-0000-000000000000 Reserved
|
||||
ffffffff-ffff-ffff-ffff-ffffffffffff Reserved
|
||||
|
||||
04fb4d00-5690-11d1-8940-080009dc3333 TPrsStd_AISPresentation
|
||||
3680ac6c-47ae-4366-bb94-26abb6e07341 TPrsStd_AISPresentation
|
||||
04fb4d01-5690-11d1-8940-080009dc3333 TPrsStd_ColorAttribute
|
||||
04fb4d02-5690-11d1-8940-080009dc3333 TPrsStd_TransparencyAttribute
|
||||
04fb4d04-5690-11d1-8940-080009dc3333 TPrsStd_GraphicAttribute
|
||||
|
@@ -1,7 +1,7 @@
|
||||
-- Created on: 1998-09-30
|
||||
-- Created by: Denis PASCAL
|
||||
-- Copyright (c) 1998-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
-- Copyright (c) 1999-2015 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
@@ -14,16 +14,9 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
-- Lastly modified by :
|
||||
-- +---------------------------------------------------------------------------+
|
||||
-- ! ivan ! SetMode ! 5-04-2001! 3.0-00-1!
|
||||
-- +---------------------------------------------------------------------------+
|
||||
|
||||
|
||||
|
||||
class AISPresentation from TPrsStd inherits Attribute from TDF
|
||||
|
||||
---Purpose: An attribute to associate an
|
||||
---Purpose: An attribute to associate an
|
||||
-- AIS_InteractiveObject to a label in an AIS viewer.
|
||||
-- This attribute works in collaboration with TPrsStd_AISViewer.
|
||||
-- Note that all the Set... and Unset... attribute
|
||||
@@ -38,8 +31,9 @@ uses GUID from Standard,
|
||||
AttributeDelta from TDF,
|
||||
Label from TDF,
|
||||
RelocationTable from TDF,
|
||||
Presentation from TDataXtd,
|
||||
InteractiveObject from AIS,
|
||||
Length from Quantity,
|
||||
InteractiveContext from AIS,
|
||||
NameOfColor from Quantity,
|
||||
PlaneAngle from Quantity,
|
||||
NameOfMaterial from Graphic3d,
|
||||
@@ -47,62 +41,170 @@ uses GUID from Standard,
|
||||
is
|
||||
|
||||
GetID (myclass) returns GUID from Standard;
|
||||
---Purpose: Returns the GUID for TPrsStd_AISPresentation attributes.
|
||||
---C++: return const &
|
||||
---Purpose: Returns the GUID for TPrsStd_AISPresentation attributes.
|
||||
---C++: return const &
|
||||
|
||||
Set (myclass; L : Label from TDF; driver : GUID from Standard)
|
||||
---Purpose: Creates or retrieves the presentation attribute on
|
||||
-- the label L, and sets the GUID driver.
|
||||
---Purpose: Creates or retrieves the presentation attribute on
|
||||
-- the label L, and sets the GUID driver.
|
||||
returns AISPresentation from TPrsStd;
|
||||
|
||||
Unset (myclass; L : Label from TDF);
|
||||
Unset (myclass; theLabel : Label from TDF);
|
||||
---Purpose: Delete (if exist) the presentation attribute associated to the label <L>.
|
||||
|
||||
|
||||
Set (myclass; master : Attribute from TDF)
|
||||
---Purpose: Creates or retrieves the AISPresentation
|
||||
-- attribute attached to master.
|
||||
-- The GUID of the driver will be the GUID of master.
|
||||
-- master is the attribute you want to display.
|
||||
---Purpose: Creates or retrieves the AISPresentation
|
||||
-- attribute attached to master.
|
||||
-- The GUID of the driver will be the GUID of master.
|
||||
-- master is the attribute you want to display.
|
||||
returns AISPresentation from TPrsStd;
|
||||
|
||||
|
||||
---Category: Presentation attribute implementation
|
||||
-- ======================================
|
||||
|
||||
|
||||
Create returns mutable AISPresentation from TPrsStd;
|
||||
|
||||
|
||||
SetDisplayed(me : mutable; B : Boolean from Standard);
|
||||
|
||||
|
||||
Display (me : mutable; update : Boolean from Standard = Standard_False);
|
||||
---Purpose: Display presentation of object in AIS viewer.
|
||||
-- If <update> = True then AISObject is recomputed and all
|
||||
-- the visualization settings are applied
|
||||
|
||||
---Purpose: Display presentation of object in AIS viewer.
|
||||
-- If <update> = True then AISObject is recomputed and all
|
||||
-- the visualization settings are applied
|
||||
|
||||
Erase (me : mutable; remove : Boolean from Standard = Standard_False);
|
||||
---Purpose: Removes the presentation of this AIS
|
||||
-- presentation attribute from the TPrsStd_AISViewer.
|
||||
-- If remove is true, this AIS presentation attribute
|
||||
-- is removed from the interactive context.
|
||||
|
||||
---Purpose: Removes the presentation of this AIS
|
||||
-- presentation attribute from the TPrsStd_AISViewer.
|
||||
-- If remove is true, this AIS presentation attribute
|
||||
-- is removed from the interactive context.
|
||||
|
||||
Update (me : mutable);
|
||||
---Purpose: Recompute presentation of object and apply the visualization settings
|
||||
|
||||
|
||||
|
||||
GetDriverGUID (me) returns GUID from Standard;
|
||||
|
||||
|
||||
SetDriverGUID (me: mutable ; guid : GUID from Standard);
|
||||
|
||||
IsDisplayed (me)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Returns true if this AIS presentation attribute is displayed.
|
||||
GetAIS (me) returns InteractiveObject from AIS;
|
||||
---Purpose: Returns AIS_InteractiveObject stored in the presentation attribute
|
||||
|
||||
|
||||
IsDisplayed (me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this AIS presentation attribute is displayed.
|
||||
|
||||
---Category: Visualization settings of AIS_InteractiveObject
|
||||
-- ================================================
|
||||
|
||||
Material(me) returns NameOfMaterial from Graphic3d;
|
||||
---Purpose:
|
||||
-- Returns the material setting for this presentation attribute.
|
||||
|
||||
SetMaterial(me : mutable; aName : NameOfMaterial from Graphic3d);
|
||||
---Purpose: Sets the material aName for this presentation attribute.
|
||||
|
||||
HasOwnMaterial(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a material setting.
|
||||
|
||||
UnsetMaterial(me : mutable);
|
||||
---Purpose: Removes the material setting from this presentation attribute.
|
||||
|
||||
SetTransparency(me : mutable; aValue : Real from Standard=0.6);
|
||||
--- Purpose:
|
||||
-- Sets the transparency value aValue for this presentation attribute.
|
||||
-- This value is 0.6 by default.
|
||||
|
||||
Transparency(me) returns Real from Standard;
|
||||
|
||||
HasOwnTransparency(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a transparency setting.
|
||||
|
||||
UnsetTransparency(me : mutable);
|
||||
---Purpose: Removes the transparency setting from this presentation attribute.
|
||||
|
||||
Color(me) returns NameOfColor from Quantity;
|
||||
|
||||
SetColor(me: mutable; aColor : NameOfColor from Quantity);
|
||||
---Purpose: Sets the color aColor for this presentation attribute.
|
||||
|
||||
HasOwnColor(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a color setting.
|
||||
|
||||
UnsetColor(me : mutable);
|
||||
---Purpose: Removes the color setting from this presentation attribute.
|
||||
|
||||
Width(me) returns Real from Standard;
|
||||
|
||||
SetWidth(me: mutable; aWidth : Real from Standard);
|
||||
---Purpose: Sets the width aWidth for this presentation attribute.
|
||||
|
||||
HasOwnWidth(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a width setting.
|
||||
|
||||
UnsetWidth(me : mutable);
|
||||
---Purpose: Removes the width setting from this presentation attribute.
|
||||
|
||||
Mode(me) returns Integer from Standard;
|
||||
|
||||
SetMode(me: mutable; theMode : Integer from Standard);
|
||||
|
||||
HasOwnMode(me) returns Boolean from Standard;
|
||||
|
||||
UnsetMode(me : mutable);
|
||||
|
||||
SelectionMode(me) returns Integer from Standard;
|
||||
|
||||
SetSelectionMode(me: mutable; theSelectionMode : Integer from Standard);
|
||||
|
||||
HasOwnSelectionMode(me) returns Boolean from Standard;
|
||||
|
||||
UnsetSelectionMode(me : mutable);
|
||||
|
||||
---Category: Methods of TDF_Attribute
|
||||
-- ========================
|
||||
|
||||
ID(me)returns GUID from Standard;
|
||||
---C++: return const &
|
||||
|
||||
NewEmpty(me)
|
||||
returns mutable Attribute from TDF;
|
||||
|
||||
Restore(me: mutable; with : Attribute from TDF);
|
||||
|
||||
Paste (me; into : mutable Attribute from TDF;
|
||||
RT : mutable RelocationTable from TDF);
|
||||
|
||||
BackupCopy(me) returns mutable Attribute from TDF is redefined;
|
||||
|
||||
---Category: Callbacks for viewer updating
|
||||
-- =============================
|
||||
|
||||
AfterAddition (me: mutable) is redefined;
|
||||
|
||||
BeforeRemoval (me: mutable) is redefined;
|
||||
|
||||
BeforeForget(me: mutable) is redefined;
|
||||
|
||||
AfterResume(me: mutable) is redefined;
|
||||
|
||||
BeforeUndo (me: mutable; anAttDelta : AttributeDelta from TDF;
|
||||
forceIt : Boolean from Standard = Standard_False)
|
||||
returns Boolean from Standard is redefined;
|
||||
|
||||
AfterUndo (me: mutable; anAttDelta : AttributeDelta from TDF;
|
||||
forceIt : Boolean from Standard = Standard_False)
|
||||
---Purpose: update AIS viewer according to delta
|
||||
returns Boolean from Standard is redefined;
|
||||
|
||||
getAISContext(me) returns InteractiveContext from AIS
|
||||
---Purpose: Returns interactive context associated with presentation.
|
||||
is private;
|
||||
|
||||
getData(me) returns Presentation from TDataXtd
|
||||
---Purpose: Returns data presentation attribute connected associated with presentation.
|
||||
is private;
|
||||
|
||||
GetAIS(me) returns InteractiveObject from AIS;
|
||||
---Purpose: Returns AIS_InteractiveObject stored in the presentation attribute.
|
||||
|
||||
AISUpdate (me : mutable)
|
||||
---Purpose: Updates AIS_InteractiveObject stored in the attribute
|
||||
-- and applies the visualization settings
|
||||
-- and applies the visualization settings
|
||||
is private;
|
||||
|
||||
AISDisplay (me : mutable)
|
||||
@@ -111,125 +213,13 @@ is
|
||||
|
||||
AISErase (me : mutable; remove : Boolean from Standard = Standard_False)
|
||||
---Purpose: Erases AIS_InteractiveObject stored in the attribute in
|
||||
-- the viewer; If <remove> = True then AISObject is removed
|
||||
-- from AIS_InteractiveContext instead of simple erasing in the viewer
|
||||
-- the viewer; If <remove> = True then AISObject is removed
|
||||
-- from AIS_InteractiveContext instead of simple erasing in the viewer
|
||||
is private;
|
||||
|
||||
---Category: Visualization settings of AIS_InteractiveObject
|
||||
-- ================================================
|
||||
|
||||
Material(me) returns NameOfMaterial from Graphic3d;
|
||||
|
||||
---Purpose:
|
||||
-- Returns the material setting for this presentation attribute.
|
||||
SetMaterial(me : mutable; aName : NameOfMaterial from Graphic3d);
|
||||
---Purpose: Sets the material aName for this presentation attribute.
|
||||
HasOwnMaterial(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a material setting.
|
||||
UnsetMaterial(me : mutable);
|
||||
---Purpose: Removes the material setting from this presentation attribute.
|
||||
SetTransparency(me : mutable; aValue : Real from Standard=0.6);
|
||||
--- Purpose:
|
||||
-- Sets the transparency value aValue for this
|
||||
-- presentation attribute.
|
||||
-- This value is 0.6 by default.
|
||||
Transparency(me) returns Real from Standard;
|
||||
|
||||
HasOwnTransparency(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a transparency setting.
|
||||
UnsetTransparency(me : mutable);
|
||||
---Purpose: Removes the transparency setting from this presentation attribute.
|
||||
Color(me) returns NameOfColor from Quantity;
|
||||
|
||||
SetColor(me: mutable; aColor : NameOfColor from Quantity);
|
||||
---Purpose: Sets the color aColor for this presentation attribute.
|
||||
HasOwnColor(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a color setting.
|
||||
UnsetColor(me : mutable);
|
||||
---Purpose: Removes the color setting from this presentation attribute.
|
||||
Width(me) returns Real from Standard ;
|
||||
|
||||
SetWidth(me: mutable; aWidth : Real from Standard);
|
||||
---Purpose: Sets the width aWidth for this presentation attribute.
|
||||
HasOwnWidth(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if this presentation attribute already has a width setting.
|
||||
UnsetWidth(me : mutable);
|
||||
---Purpose: Removes the width setting from this presentation attribute.
|
||||
Mode(me) returns Integer from Standard;
|
||||
|
||||
SetMode(me: mutable; theMode : Integer from Standard);
|
||||
|
||||
HasOwnMode(me) returns Boolean from Standard;
|
||||
|
||||
UnsetMode(me : mutable);
|
||||
|
||||
SelectionMode(me) returns Integer from Standard;
|
||||
|
||||
SetSelectionMode(me: mutable; theSelectionMode : Integer from Standard);
|
||||
|
||||
HasOwnSelectionMode(me) returns Boolean from Standard;
|
||||
|
||||
UnsetSelectionMode(me : mutable);
|
||||
|
||||
|
||||
---Category: Methods of TDF_Attribute
|
||||
-- ========================
|
||||
|
||||
ID(me)returns GUID from Standard;
|
||||
---C++: return const &
|
||||
|
||||
NewEmpty(me)
|
||||
returns mutable Attribute from TDF;
|
||||
|
||||
Restore(me: mutable; with : Attribute from TDF);
|
||||
|
||||
Paste (me; into : mutable Attribute from TDF;
|
||||
RT : mutable RelocationTable from TDF);
|
||||
|
||||
BackupCopy(me) returns mutable Attribute from TDF is redefined;
|
||||
|
||||
---Category: Callbacks for viewer updating
|
||||
-- =============================
|
||||
|
||||
AfterAddition (me: mutable)
|
||||
is redefined;
|
||||
|
||||
BeforeRemoval (me: mutable)
|
||||
is redefined;
|
||||
|
||||
BeforeForget(me: mutable)
|
||||
is redefined;
|
||||
|
||||
AfterResume(me: mutable)
|
||||
is redefined;
|
||||
|
||||
BeforeUndo (me: mutable; anAttDelta : AttributeDelta from TDF;
|
||||
forceIt : Boolean from Standard = Standard_False)
|
||||
returns Boolean from Standard
|
||||
is redefined;
|
||||
|
||||
AfterUndo (me: mutable; anAttDelta : AttributeDelta from TDF;
|
||||
forceIt : Boolean from Standard = Standard_False)
|
||||
---Purpose: update AIS viewer according to delta
|
||||
returns Boolean from Standard
|
||||
is redefined;
|
||||
|
||||
fields
|
||||
|
||||
myDriverGUID : GUID from Standard;
|
||||
myTransparency : Real from Standard;
|
||||
myColor : NameOfColor from Quantity;
|
||||
myMaterial : NameOfMaterial from Graphic3d;
|
||||
myWidth : Real from Standard;
|
||||
myMode : Integer from Standard;
|
||||
mySelectionMode : Integer from Standard;
|
||||
isDisplayed : Boolean from Standard;
|
||||
hasOwnColor : Boolean from Standard;
|
||||
hasOwnMaterial : Boolean from Standard;
|
||||
hasOwnTransparency : Boolean from Standard;
|
||||
hasOwnWidth : Boolean from Standard;
|
||||
hasOwnMode : Boolean from Standard;
|
||||
hasOwnSelectionMode: Boolean from Standard;
|
||||
myAIS : InteractiveObject from AIS;
|
||||
myDriverGUID : GUID from Standard;
|
||||
myAIS : InteractiveObject from AIS;
|
||||
end AISPresentation;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -33,7 +33,7 @@ const Standard_GUID& TPrsStd_AISViewer::GetID ()
|
||||
//=======================================================================
|
||||
|
||||
Handle(TPrsStd_AISViewer) TPrsStd_AISViewer::New (const TDF_Label& acces,
|
||||
const Handle(V3d_Viewer)& viewer)
|
||||
const Handle(V3d_Viewer)& viewer)
|
||||
{
|
||||
Handle(TPrsStd_AISViewer) V;
|
||||
if (acces.Root().FindAttribute(TPrsStd_AISViewer::GetID(),V)) {
|
||||
@@ -50,7 +50,7 @@ Handle(TPrsStd_AISViewer) TPrsStd_AISViewer::New (const TDF_Label& acces,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TPrsStd_AISViewer) TPrsStd_AISViewer::New (const TDF_Label& acces,
|
||||
const Handle(AIS_InteractiveContext)& IC)
|
||||
const Handle(AIS_InteractiveContext)& IC)
|
||||
{
|
||||
Handle(TPrsStd_AISViewer) V;
|
||||
if (acces.Root().FindAttribute(TPrsStd_AISViewer::GetID(),V)) {
|
||||
@@ -67,7 +67,7 @@ Handle(TPrsStd_AISViewer) TPrsStd_AISViewer::New (const TDF_Label& acces,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean TPrsStd_AISViewer::Find (const TDF_Label& acces,
|
||||
Handle(TPrsStd_AISViewer)& V)
|
||||
Handle(TPrsStd_AISViewer)& V)
|
||||
{
|
||||
return (acces.Root().FindAttribute(TPrsStd_AISViewer::GetID(),V));
|
||||
}
|
||||
@@ -77,7 +77,7 @@ Standard_Boolean TPrsStd_AISViewer::Find (const TDF_Label& acces,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean TPrsStd_AISViewer::Find (const TDF_Label& acces,
|
||||
Handle(AIS_InteractiveContext)& IC)
|
||||
Handle(AIS_InteractiveContext)& IC)
|
||||
{
|
||||
Handle(TPrsStd_AISViewer) V;
|
||||
if (acces.Root().FindAttribute(TPrsStd_AISViewer::GetID(),V)) {
|
||||
@@ -93,7 +93,7 @@ Standard_Boolean TPrsStd_AISViewer::Find (const TDF_Label& acces,
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean TPrsStd_AISViewer::Find (const TDF_Label& acces,
|
||||
Handle(V3d_Viewer)& VIEW)
|
||||
Handle(V3d_Viewer)& VIEW)
|
||||
{
|
||||
Handle(TPrsStd_AISViewer) V;
|
||||
if (acces.Root().FindAttribute(TPrsStd_AISViewer::GetID(),V)) {
|
||||
@@ -139,9 +139,9 @@ TPrsStd_AISViewer::TPrsStd_AISViewer()
|
||||
|
||||
void TPrsStd_AISViewer::Update () const
|
||||
{
|
||||
myInteractiveContext->UpdateCurrentViewer();
|
||||
myInteractiveContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetInteractiveContext
|
||||
//purpose :
|
||||
@@ -196,7 +196,7 @@ Handle(TDF_Attribute) TPrsStd_AISViewer::NewEmpty() const
|
||||
//=======================================================================
|
||||
|
||||
void TPrsStd_AISViewer::Paste (const Handle(TDF_Attribute)&,
|
||||
const Handle(TDF_RelocationTable)&) const
|
||||
const Handle(TDF_RelocationTable)&) const
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
#include <XmlMDataXtd.hxx>
|
||||
#include <XmlMDocStd.hxx>
|
||||
#include <XmlMNaming.hxx>
|
||||
#include <XmlMPrsStd.hxx>
|
||||
#include <XmlMFunction.hxx>
|
||||
|
||||
#include <Standard_GUID.hxx>
|
||||
@@ -78,7 +77,6 @@ Handle(XmlMDF_ADriverTable) XmlDrivers::AttributeDrivers
|
||||
XmlMNaming ::AddDrivers (aTable, theMessageDriver);
|
||||
XmlMFunction ::AddDrivers (aTable, theMessageDriver);
|
||||
XmlMDocStd ::AddDrivers (aTable, theMessageDriver);
|
||||
XmlMPrsStd ::AddDrivers (aTable, theMessageDriver);
|
||||
//
|
||||
return aTable;
|
||||
}
|
||||
|
@@ -40,6 +40,10 @@ is
|
||||
class PlacementDriver;
|
||||
|
||||
class PatternStdDriver;
|
||||
|
||||
class PresentationDriver;
|
||||
|
||||
class PositionDriver;
|
||||
|
||||
|
||||
AddDrivers (aDriverTable : ADriverTable from XmlMDF;
|
||||
|
@@ -25,6 +25,8 @@
|
||||
#include <XmlMDataXtd_ConstraintDriver.hxx>
|
||||
#include <XmlMDataXtd_PlacementDriver.hxx>
|
||||
#include <XmlMDataXtd_PatternStdDriver.hxx>
|
||||
#include <XmlMDataXtd_PositionDriver.hxx>
|
||||
#include <XmlMDataXtd_PresentationDriver.hxx>
|
||||
|
||||
static Standard_Integer myDocumentVersion = -1;
|
||||
//=======================================================================
|
||||
@@ -34,14 +36,16 @@ static Standard_Integer myDocumentVersion = -1;
|
||||
void XmlMDataXtd::AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable,
|
||||
const Handle(CDM_MessageDriver)& anMsgDrv)
|
||||
{
|
||||
aDriverTable-> AddDriver (new XmlMDataXtd_ShapeDriver (anMsgDrv));
|
||||
aDriverTable-> AddDriver (new XmlMDataXtd_PointDriver (anMsgDrv));
|
||||
aDriverTable-> AddDriver (new XmlMDataXtd_AxisDriver (anMsgDrv));
|
||||
aDriverTable-> AddDriver (new XmlMDataXtd_PlaneDriver (anMsgDrv));
|
||||
aDriverTable-> AddDriver (new XmlMDataXtd_GeometryDriver (anMsgDrv));
|
||||
aDriverTable-> AddDriver (new XmlMDataXtd_ConstraintDriver (anMsgDrv));
|
||||
aDriverTable-> AddDriver (new XmlMDataXtd_PlacementDriver (anMsgDrv));
|
||||
aDriverTable-> AddDriver (new XmlMDataXtd_PatternStdDriver (anMsgDrv));
|
||||
aDriverTable->AddDriver(new XmlMDataXtd_ShapeDriver (anMsgDrv));
|
||||
aDriverTable->AddDriver(new XmlMDataXtd_PointDriver (anMsgDrv));
|
||||
aDriverTable->AddDriver(new XmlMDataXtd_AxisDriver (anMsgDrv));
|
||||
aDriverTable->AddDriver(new XmlMDataXtd_PlaneDriver (anMsgDrv));
|
||||
aDriverTable->AddDriver(new XmlMDataXtd_GeometryDriver (anMsgDrv));
|
||||
aDriverTable->AddDriver(new XmlMDataXtd_ConstraintDriver (anMsgDrv));
|
||||
aDriverTable->AddDriver(new XmlMDataXtd_PlacementDriver (anMsgDrv));
|
||||
aDriverTable->AddDriver(new XmlMDataXtd_PatternStdDriver (anMsgDrv));
|
||||
aDriverTable->AddDriver(new XmlMDataXtd_PositionDriver (anMsgDrv));
|
||||
aDriverTable->AddDriver(new XmlMDataXtd_PresentationDriver (anMsgDrv));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -13,7 +13,7 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class PositionDriver from XmlMPrsStd inherits ADriver from XmlMDF
|
||||
class PositionDriver from XmlMDataXtd inherits ADriver from XmlMDF
|
||||
|
||||
---Purpose: Attribute Driver.
|
||||
|
||||
@@ -26,7 +26,7 @@ uses
|
||||
|
||||
is
|
||||
Create (theMessageDriver:MessageDriver from CDM)
|
||||
returns mutable PositionDriver from XmlMPrsStd;
|
||||
returns mutable PositionDriver from XmlMDataXtd;
|
||||
|
||||
NewEmpty (me) returns mutable Attribute from TDF;
|
||||
|
@@ -13,7 +13,7 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <XmlMPrsStd_PositionDriver.ixx>
|
||||
#include <XmlMDataXtd_PositionDriver.ixx>
|
||||
|
||||
#include <XmlObjMgt.hxx>
|
||||
#include <TDataXtd_Position.hxx>
|
||||
@@ -22,19 +22,19 @@
|
||||
#include <stdio.h>
|
||||
|
||||
//=======================================================================
|
||||
//function : XmlMPrsStd_PositionDriver
|
||||
//function : XmlMDataXtd_PositionDriver
|
||||
//purpose : Constructor
|
||||
//=======================================================================
|
||||
XmlMPrsStd_PositionDriver::XmlMPrsStd_PositionDriver
|
||||
XmlMDataXtd_PositionDriver::XmlMDataXtd_PositionDriver
|
||||
(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
: XmlMDF_ADriver (theMsgDriver, NULL)
|
||||
: XmlMDF_ADriver (theMsgDriver, NULL)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : NewEmpty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TDF_Attribute) XmlMPrsStd_PositionDriver::NewEmpty() const
|
||||
Handle(TDF_Attribute) XmlMDataXtd_PositionDriver::NewEmpty() const
|
||||
{
|
||||
return (new TDataXtd_Position());
|
||||
}
|
||||
@@ -43,7 +43,7 @@ Handle(TDF_Attribute) XmlMPrsStd_PositionDriver::NewEmpty() const
|
||||
//function : Paste
|
||||
//purpose : persistent -> transient (retrieve)
|
||||
//=======================================================================
|
||||
Standard_Boolean XmlMPrsStd_PositionDriver::Paste
|
||||
Standard_Boolean XmlMDataXtd_PositionDriver::Paste
|
||||
(const XmlObjMgt_Persistent& theSource,
|
||||
const Handle(TDF_Attribute)& theTarget,
|
||||
XmlObjMgt_RRelocationTable& ) const
|
||||
@@ -107,7 +107,7 @@ Standard_Boolean XmlMPrsStd_PositionDriver::Paste
|
||||
//function : Paste
|
||||
//purpose : transient -> persistent (store)
|
||||
//=======================================================================
|
||||
void XmlMPrsStd_PositionDriver::Paste
|
||||
void XmlMDataXtd_PositionDriver::Paste
|
||||
(const Handle(TDF_Attribute)& theSource,
|
||||
XmlObjMgt_Persistent& theTarget,
|
||||
XmlObjMgt_SRelocationTable& ) const
|
@@ -13,7 +13,7 @@
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class AISPresentationDriver from XmlMPrsStd inherits ADriver from XmlMDF
|
||||
class PresentationDriver from XmlMDataXtd inherits ADriver from XmlMDF
|
||||
|
||||
---Purpose: Attribute Driver.
|
||||
|
||||
@@ -26,7 +26,7 @@ uses
|
||||
|
||||
is
|
||||
Create (theMessageDriver:MessageDriver from CDM)
|
||||
returns mutable AISPresentationDriver from XmlMPrsStd;
|
||||
returns mutable PresentationDriver from XmlMDataXtd;
|
||||
|
||||
NewEmpty (me) returns mutable Attribute from TDF;
|
||||
|
||||
@@ -39,4 +39,4 @@ is
|
||||
Target : in out Persistent from XmlObjMgt;
|
||||
RelocTable : out SRelocationTable from XmlObjMgt);
|
||||
|
||||
end AISPresentationDriver;
|
||||
end PresentationDriver;
|
@@ -13,11 +13,11 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <XmlMPrsStd_AISPresentationDriver.ixx>
|
||||
#include <XmlMDataXtd_PresentationDriver.ixx>
|
||||
|
||||
#include <XmlObjMgt.hxx>
|
||||
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <TDataXtd_Presentation.hxx>
|
||||
|
||||
#define OCC6010 // vro: 09.06.2004
|
||||
|
||||
@@ -32,37 +32,37 @@ IMPLEMENT_DOMSTRING (ModeString, "mode")
|
||||
IMPLEMENT_DOMSTRING (DisplayedString, "true")
|
||||
|
||||
//=======================================================================
|
||||
//function : XmlMPrsStd_AISPresentationDriver
|
||||
//function : XmlMDataXtd_PresentationDriver
|
||||
//purpose : Constructor
|
||||
//=======================================================================
|
||||
XmlMPrsStd_AISPresentationDriver::XmlMPrsStd_AISPresentationDriver
|
||||
(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
: XmlMDF_ADriver (theMsgDriver, NULL)
|
||||
XmlMDataXtd_PresentationDriver::XmlMDataXtd_PresentationDriver
|
||||
(const Handle(CDM_MessageDriver)& theMsgDriver)
|
||||
: XmlMDF_ADriver (theMsgDriver, NULL)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : NewEmpty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TDF_Attribute) XmlMPrsStd_AISPresentationDriver::NewEmpty() const
|
||||
Handle(TDF_Attribute) XmlMDataXtd_PresentationDriver::NewEmpty() const
|
||||
{
|
||||
return (new TPrsStd_AISPresentation());
|
||||
return (new TDataXtd_Presentation());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose : persistent -> transient (retrieve)
|
||||
//=======================================================================
|
||||
Standard_Boolean XmlMPrsStd_AISPresentationDriver::Paste
|
||||
(const XmlObjMgt_Persistent& theSource,
|
||||
const Handle(TDF_Attribute)& theTarget,
|
||||
XmlObjMgt_RRelocationTable& ) const
|
||||
Standard_Boolean XmlMDataXtd_PresentationDriver::Paste
|
||||
(const XmlObjMgt_Persistent& theSource,
|
||||
const Handle(TDF_Attribute)& theTarget,
|
||||
XmlObjMgt_RRelocationTable& ) const
|
||||
{
|
||||
TCollection_ExtendedString aMessageString;
|
||||
XmlObjMgt_DOMString aDOMStr;
|
||||
|
||||
Handle(TPrsStd_AISPresentation) aTPrs =
|
||||
Handle(TPrsStd_AISPresentation)::DownCast(theTarget);
|
||||
Handle(TDataXtd_Presentation) aTPrs =
|
||||
Handle(TDataXtd_Presentation)::DownCast(theTarget);
|
||||
const XmlObjMgt_Element& anElem = theSource;
|
||||
|
||||
//convert attribute value into GUID
|
||||
@@ -92,7 +92,7 @@ Standard_Boolean XmlMPrsStd_AISPresentationDriver::Paste
|
||||
WriteMessage (aMessageString);
|
||||
return Standard_False;
|
||||
}
|
||||
aTPrs->SetColor((Quantity_NameOfColor)anIValue);
|
||||
aTPrs->SetColor(anIValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -110,7 +110,7 @@ Standard_Boolean XmlMPrsStd_AISPresentationDriver::Paste
|
||||
WriteMessage (aMessageString);
|
||||
return Standard_False;
|
||||
}
|
||||
aTPrs->SetMaterial((Graphic3d_NameOfMaterial)anIValue);
|
||||
aTPrs->SetMaterial(anIValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -182,13 +182,13 @@ Standard_Boolean XmlMPrsStd_AISPresentationDriver::Paste
|
||||
//function : Paste
|
||||
//purpose : transient -> persistent (store)
|
||||
//=======================================================================
|
||||
void XmlMPrsStd_AISPresentationDriver::Paste
|
||||
(const Handle(TDF_Attribute)& theSource,
|
||||
XmlObjMgt_Persistent& theTarget,
|
||||
XmlObjMgt_SRelocationTable& ) const
|
||||
void XmlMDataXtd_PresentationDriver::Paste
|
||||
(const Handle(TDF_Attribute)& theSource,
|
||||
XmlObjMgt_Persistent& theTarget,
|
||||
XmlObjMgt_SRelocationTable&) const
|
||||
{
|
||||
Handle(TPrsStd_AISPresentation) aTPrs =
|
||||
Handle(TPrsStd_AISPresentation)::DownCast(theSource);
|
||||
Handle(TDataXtd_Presentation) aTPrs =
|
||||
Handle(TDataXtd_Presentation)::DownCast(theSource);
|
||||
if (aTPrs.IsNull()) return;
|
||||
|
||||
//convert GUID into attribute value
|
||||
@@ -205,28 +205,28 @@ void XmlMPrsStd_AISPresentationDriver::Paste
|
||||
Standard_Integer aNb;
|
||||
|
||||
// color
|
||||
if (aTPrs->HasOwnColor())
|
||||
if (aTPrs->IsHasOwnColor())
|
||||
{
|
||||
aNb = (Standard_Integer)(aTPrs->Color());
|
||||
aNb = aTPrs->Color();
|
||||
theTarget.Element().setAttribute(::ColorString(), aNb);
|
||||
}
|
||||
|
||||
// material
|
||||
if (aTPrs->HasOwnMaterial())
|
||||
if (aTPrs->IsHasOwnMaterial())
|
||||
{
|
||||
aNb = (Standard_Integer)(aTPrs->Material());
|
||||
theTarget.Element().setAttribute(::MaterialString(), aNb);
|
||||
}
|
||||
|
||||
// transparency
|
||||
if (aTPrs->HasOwnTransparency())
|
||||
if (aTPrs->IsHasOwnTransparency())
|
||||
{
|
||||
TCollection_AsciiString aRNbStr (aTPrs->Transparency());
|
||||
theTarget.Element().setAttribute(::TransparencyString(), aRNbStr.ToCString());
|
||||
}
|
||||
|
||||
// width
|
||||
if (aTPrs->HasOwnWidth())
|
||||
if (aTPrs->IsHasOwnWidth())
|
||||
{
|
||||
TCollection_AsciiString aRNbStr (aTPrs->Width());
|
||||
theTarget.Element().setAttribute(::WidthString(), aRNbStr.ToCString());
|
||||
@@ -234,7 +234,7 @@ void XmlMPrsStd_AISPresentationDriver::Paste
|
||||
|
||||
#ifdef OCC6010
|
||||
// mode
|
||||
if (aTPrs->HasOwnMode())
|
||||
if (aTPrs->IsHasOwnMode())
|
||||
{
|
||||
aNb = aTPrs->Mode();
|
||||
theTarget.Element().setAttribute(::ModeString(), aNb);
|
@@ -1,37 +0,0 @@
|
||||
-- Created on: 2001-07-09
|
||||
-- Created by: Julia DOROVSKIKH
|
||||
-- Copyright (c) 2001-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 XmlMPrsStd
|
||||
|
||||
|
||||
uses
|
||||
TDF,
|
||||
CDM,
|
||||
XmlMDF,
|
||||
XmlObjMgt
|
||||
|
||||
is
|
||||
---Category: Classes
|
||||
-- =============================================================
|
||||
|
||||
class PositionDriver;
|
||||
|
||||
class AISPresentationDriver;
|
||||
|
||||
AddDrivers (aDriverTable : ADriverTable from XmlMDF;
|
||||
theMessageDriver: MessageDriver from CDM);
|
||||
---Purpose: Adds the attribute storage drivers to <aDriverTable>.
|
||||
|
||||
end XmlMPrsStd;
|
@@ -1,30 +0,0 @@
|
||||
// Created on: 2001-07-09
|
||||
// Created by: Julia DOROVSKIKH
|
||||
// Copyright (c) 2001-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 <XmlMPrsStd.ixx>
|
||||
|
||||
#include <XmlMPrsStd_PositionDriver.hxx>
|
||||
#include <XmlMPrsStd_AISPresentationDriver.hxx>
|
||||
|
||||
///=======================================================================
|
||||
//function : AddDrivers
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void XmlMPrsStd::AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable,
|
||||
const Handle(CDM_MessageDriver)& aMessageDriver)
|
||||
{
|
||||
aDriverTable->AddDriver(new XmlMPrsStd_PositionDriver(aMessageDriver));
|
||||
aDriverTable->AddDriver(new XmlMPrsStd_AISPresentationDriver(aMessageDriver));
|
||||
}
|
Reference in New Issue
Block a user