- 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.
p BinMDocStd
p BinMFunction
p BinMNaming
-p BinMPrsStd
p BinObjMgt
p BinTools
p CDF
p MDocStd
p MFunction
p MNaming
-p MPrsStd
p MgtBRep
p MgtGeom
p MgtGeom2d
p PMMgt
p PNaming
p PPoly
-p PPrsStd
p PShort
p PStandard
p PTColStd
p XmlMDocStd
p XmlMFunction
p XmlMNaming
-p XmlMPrsStd
p XmlObjMgt
r StdResource
r XmlOcafResource
t TKLCAF
t TKPCAF
t TKPLCAF
+t TKVCAF
t TKPShape
t TKShapeSchema
t TKStdLSchema
#include <BinMNaming.hxx>
#include <BinMDocStd.hxx>
#include <BinMFunction.hxx>
-#include <BinMPrsStd.hxx>
#include <Standard_Failure.hxx>
#include <BinDrivers_DocumentStorageDriver.hxx>
#include <BinDrivers_DocumentRetrievalDriver.hxx>
BinMNaming ::AddDrivers (aTable, aMsgDrv);
BinMDocStd ::AddDrivers (aTable, aMsgDrv);
BinMFunction ::AddDrivers (aTable, aMsgDrv);
- BinMPrsStd ::AddDrivers (aTable, aMsgDrv);
return aTable;
}
BinMDocStd ::AddDrivers (aTable, aMsgDrv);
// BinMNaming ::AddDrivers (aTable, aMsgDrv);
-// BinMPrsStd ::AddDrivers (aTable, aMsgDrv);
return aTable;
}
class PatternStdDriver;
class ShapeDriver;
+
+ class PresentationDriver;
+
+ class PositionDriver;
AddDrivers (theDriverTable : ADriverTable from BinMDF;
#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;
//=======================================================================
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) );
}
--- /dev/null
+-- 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.
+
+class PositionDriver from BinMDataXtd inherits ADriver from BinMDF
+
+ ---Purpose: Position Attribute Driver.
+
+uses
+ SRelocationTable from BinObjMgt,
+ RRelocationTable from BinObjMgt,
+ Persistent from BinObjMgt,
+ MessageDriver from CDM,
+ Attribute from TDF
+
+is
+
+ Create (theMessageDriver:MessageDriver from CDM)
+ returns PositionDriver from BinMDataXtd;
+
+ NewEmpty (me) returns Attribute from TDF;
+
+ Paste(me; Source : Persistent from BinObjMgt;
+ Target : Attribute from TDF;
+ RelocTable : out RRelocationTable from BinObjMgt)
+ returns Boolean from Standard;
+
+ Paste(me; Source : Attribute from TDF;
+ Target : in out Persistent from BinObjMgt;
+ RelocTable : out SRelocationTable from BinObjMgt);
+
+end PositionDriver;
--- /dev/null
+// 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.
+
+// modified 13.04.2009 Sergey ZARITCHNY
+
+#include <BinMDataXtd_PositionDriver.ixx>
+#include <gp_Pnt.hxx>
+#include <TDataXtd_Position.hxx>
+#include <CDM_MessageDriver.hxx>
+
+//=======================================================================
+//function : BinMDataStd_PositionDriver
+//purpose : Constructor
+//=======================================================================
+
+BinMDataXtd_PositionDriver::BinMDataXtd_PositionDriver
+ (const Handle(CDM_MessageDriver)& theMsgDriver)
+: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TDataXtd_Position)->Name())
+{
+}
+
+//=======================================================================
+//function : NewEmpty
+//purpose :
+//=======================================================================
+
+Handle(TDF_Attribute) BinMDataXtd_PositionDriver::NewEmpty() const
+{
+ return new TDataXtd_Position();
+}
+
+//=======================================================================
+//function : Paste
+//purpose : persistent -> transient (retrieve)
+//=======================================================================
+
+Standard_Boolean BinMDataXtd_PositionDriver::Paste
+ (const BinObjMgt_Persistent& theSource,
+ const Handle(TDF_Attribute)& theTarget,
+ BinObjMgt_RRelocationTable& ) const
+{
+ Handle(TDataXtd_Position) anAtt = Handle(TDataXtd_Position)::DownCast(theTarget);
+ Standard_Real aValue;
+ Standard_Boolean ok = theSource >> aValue;
+ if (!ok) return ok;
+ gp_Pnt aPosition(0., 0., 0.);
+ aPosition.SetX(aValue);
+
+ ok = theSource >> aValue;
+ if (!ok) return ok;
+ aPosition.SetY(aValue);
+
+ ok = theSource >> aValue;
+ if (!ok) return ok;
+ aPosition.SetZ(aValue);
+
+ anAtt->SetPosition(aPosition);
+
+ return ok;
+}
+
+//=======================================================================
+//function : Paste
+//purpose : transient -> persistent (store)
+//=======================================================================
+
+void BinMDataXtd_PositionDriver::Paste (const Handle(TDF_Attribute)& theSource,
+ BinObjMgt_Persistent& theTarget,
+ BinObjMgt_SRelocationTable& ) const
+{
+ Handle(TDataXtd_Position) anAtt = Handle(TDataXtd_Position)::DownCast(theSource);
+
+ theTarget << anAtt->GetPosition().X();
+ theTarget << anAtt->GetPosition().Y();
+ theTarget << anAtt->GetPosition().Z();
+}
--- /dev/null
+-- 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.
+
+class PresentationDriver from BinMDataXtd inherits ADriver from BinMDF
+
+ ---Purpose: Presentation Attribute Driver.
+
+uses
+ SRelocationTable from BinObjMgt,
+ RRelocationTable from BinObjMgt,
+ Persistent from BinObjMgt,
+ MessageDriver from CDM,
+ Attribute from TDF
+
+is
+
+ Create (theMessageDriver:MessageDriver from CDM)
+ returns PresentationDriver from BinMDataXtd;
+
+ NewEmpty (me) returns Attribute from TDF;
+
+ Paste(me; Source : Persistent from BinObjMgt;
+ Target : Attribute from TDF;
+ RelocTable : out RRelocationTable from BinObjMgt)
+ returns Boolean from Standard;
+
+ Paste(me; Source : Attribute from TDF;
+ Target : in out Persistent from BinObjMgt;
+ RelocTable : out SRelocationTable from BinObjMgt);
+
+
+end PresentationDriver;
--- /dev/null
+// 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);
+}
+++ /dev/null
--- 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
- ---Category: 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;
+++ /dev/null
-// 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));
-}
+++ /dev/null
--- 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.
-
-class AISPresentationDriver from BinMPrsStd inherits ADriver from BinMDF
-
- ---Purpose: AISPresentation Attribute Driver.
-
-uses
- SRelocationTable from BinObjMgt,
- RRelocationTable from BinObjMgt,
- Persistent from BinObjMgt,
- MessageDriver from CDM,
- Attribute from TDF
-
-is
-
- Create (theMessageDriver:MessageDriver from CDM)
- returns AISPresentationDriver from BinMPrsStd;
-
- NewEmpty (me) returns Attribute from TDF;
-
- Paste(me; Source : Persistent from BinObjMgt;
- Target : Attribute from TDF;
- RelocTable : out RRelocationTable from BinObjMgt)
- returns Boolean from Standard;
-
- Paste(me; Source : Attribute from TDF;
- Target : in out Persistent from BinObjMgt;
- RelocTable : out SRelocationTable from BinObjMgt);
-
-
-end AISPresentationDriver;
+++ /dev/null
-// 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);
-}
+++ /dev/null
--- 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.
-
-class PositionDriver from BinMPrsStd inherits ADriver from BinMDF
-
- ---Purpose: Position Attribute Driver.
-
-uses
- SRelocationTable from BinObjMgt,
- RRelocationTable from BinObjMgt,
- Persistent from BinObjMgt,
- MessageDriver from CDM,
- Attribute from TDF
-
-is
-
-Create (theMessageDriver:MessageDriver from CDM)
- returns PositionDriver from BinMPrsStd;
-
- NewEmpty (me) returns Attribute from TDF;
-
- Paste(me; Source : Persistent from BinObjMgt;
- Target : Attribute from TDF;
- RelocTable : out RRelocationTable from BinObjMgt)
- returns Boolean from Standard;
-
- Paste(me; Source : Attribute from TDF;
- Target : in out Persistent from BinObjMgt;
- RelocTable : out SRelocationTable from BinObjMgt);
-
-end PositionDriver;
+++ /dev/null
-// 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.
-
-// modified 13.04.2009 Sergey ZARITCHNY
-
-#include <BinMPrsStd_PositionDriver.ixx>
-#include <gp_Pnt.hxx>
-#include <TDataXtd_Position.hxx>
-#include <CDM_MessageDriver.hxx>
-
-//=======================================================================
-//function : BinMDataStd_PositionDriver
-//purpose : Constructor
-//=======================================================================
-
-BinMPrsStd_PositionDriver::BinMPrsStd_PositionDriver
- (const Handle(CDM_MessageDriver)& theMsgDriver)
- : BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TDataXtd_Position)->Name())
-{
-}
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-
-Handle(TDF_Attribute) BinMPrsStd_PositionDriver::NewEmpty() const
-{
- return new TDataXtd_Position();
-}
-
-//=======================================================================
-//function : Paste
-//purpose : persistent -> transient (retrieve)
-//=======================================================================
-
-Standard_Boolean BinMPrsStd_PositionDriver::Paste
- (const BinObjMgt_Persistent& theSource,
- const Handle(TDF_Attribute)& theTarget,
- BinObjMgt_RRelocationTable& ) const
-{
- Handle(TDataXtd_Position) anAtt = Handle(TDataXtd_Position)::DownCast(theTarget);
- Standard_Real aValue;
- Standard_Boolean ok = theSource >> aValue;
- if (!ok) return ok;
- gp_Pnt aPosition(0., 0., 0.);
- aPosition.SetX(aValue);
-
- ok = theSource >> aValue;
- if (!ok) return ok;
- aPosition.SetY(aValue);
-
- ok = theSource >> aValue;
- if (!ok) return ok;
- aPosition.SetZ(aValue);
-
- anAtt->SetPosition(aPosition);
-
- return ok;
-}
-
-//=======================================================================
-//function : Paste
-//purpose : transient -> persistent (store)
-//=======================================================================
-
-void BinMPrsStd_PositionDriver::Paste (const Handle(TDF_Attribute)& theSource,
- BinObjMgt_Persistent& theTarget,
- BinObjMgt_SRelocationTable& ) const
-{
- Handle(TDataXtd_Position) anAtt = Handle(TDataXtd_Position)::DownCast(theSource);
-
- theTarget << anAtt->GetPosition().X();
- theTarget << anAtt->GetPosition().Y();
- theTarget << anAtt->GetPosition().Z();
-}
class PatternStdStorageDriver;
+ class PresentationStorageDriver;
+
+ class PositionStorageDriver;
---Category: Retrieval drivers for PDataXtd attributes
class PatternStdRetrievalDriver;
+ class PresentationRetrievalDriver;
+
+ class PresentationRetrievalDriver_1;
+
+ class PositionRetrievalDriver;
+
AddStorageDrivers(aDriverSeq : ASDriverHSequence from MDF; theMessageDriver : MessageDriver from CDM);
#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>
#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>
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));
}
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));
}
//=======================================================================
--- /dev/null
+-- Created on: 1998-04-07
+-- Created by: Jean-Pierre COMBE
+-- 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 PositionRetrievalDriver from MDataXtd inherits ARDriver from MDF
+ ---Purpose: Retrieval drivers for graphic attributes from
+ -- PDataXtd
+
+
+uses RRelocationTable from MDF,
+ Attribute from PDF,
+ Attribute from TDF,
+ MessageDriver from CDM
+
+is
+
+
+ Create(theMessageDriver : MessageDriver from CDM) -- Version 0
+ returns PositionRetrievalDriver from MDataXtd;
+
+
+ VersionNumber(me) returns Integer from Standard;
+ ---Purpose: Returns the version number from which the driver
+ -- is available: 0.
+
+ SourceType(me) returns Type from Standard;
+ ---Purpose: Returns the type: ColorAttribute from PGraphicAttribute.
+
+ NewEmpty (me) returns Attribute from TDF;
+
+
+ Paste(me;
+ Source : Attribute from PDF;
+ Target : Attribute from TDF;
+ RelocTable : RRelocationTable from MDF);
+
+end PositionRetrievalDriver;
--- /dev/null
+// Created on: 1998-04-07
+// Created by: Jean-Pierre COMBE
+// 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.
+
+#include <MDataXtd_PositionRetrievalDriver.ixx>
+
+#include <PDataXtd_Position.hxx>
+#include <TDataXtd_Position.hxx>
+#include <CDM_MessageDriver.hxx>
+
+//=======================================================================
+//function : MDataXtd_PositionRetrievalDriver
+//purpose :
+//=======================================================================
+MDataXtd_PositionRetrievalDriver::MDataXtd_PositionRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver)
+: MDF_ARDriver(theMsgDriver)
+{}
+
+//=======================================================================
+//function : VersionNumber
+//purpose :
+//=======================================================================
+Standard_Integer MDataXtd_PositionRetrievalDriver::VersionNumber() const
+{
+ return 0;
+}
+
+//=======================================================================
+//function : SourceType
+//purpose :
+//=======================================================================
+Handle(Standard_Type) MDataXtd_PositionRetrievalDriver::SourceType() const
+{
+ return STANDARD_TYPE(PDataXtd_Position);
+}
+
+//=======================================================================
+//function : NewEmpty
+//purpose :
+//=======================================================================
+Handle(TDF_Attribute) MDataXtd_PositionRetrievalDriver::NewEmpty() const
+{
+ return new TDataXtd_Position;
+}
+
+//=======================================================================
+//function : Paste
+//purpose :
+//=======================================================================
+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);
+ T->SetPosition(S->GetPosition());
+}
+
--- /dev/null
+-- Created on: 1998-04-07
+-- Created by: Jean-Pierre COMBE
+-- 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 PositionStorageDriver from MDataXtd inherits ASDriver from MDF
+
+ ---Purpose: Storage driver for graphic attributes from
+ -- TPrsStd
+
+uses SRelocationTable from MDF,
+ Attribute from TDF,
+ Attribute from PDF,
+ MessageDriver from CDM
+
+
+is
+
+ Create(theMessageDriver : MessageDriver from CDM)
+ returns PositionStorageDriver from MDataXtd;
+
+
+ VersionNumber(me) returns Integer from Standard;
+ ---Purpose: Returns the version number from which the driver
+ -- is available: 0.
+
+ SourceType(me) returns Type from Standard;
+ ---Purpose: Returns the type: ColorAttribute from TGraphicAttribute.
+
+ NewEmpty (me) returns Attribute from PDF;
+
+
+ Paste(me;
+ Source : Attribute from TDF;
+ Target : Attribute from PDF;
+ RelocTable : SRelocationTable from MDF);
+
+
+end PositionStorageDriver;
+
--- /dev/null
+// Created on: 1998-04-07
+// Created by: Jean-Pierre COMBE
+// 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.
+
+#include <MDataXtd_PositionStorageDriver.ixx>
+
+#include <PDataXtd_Position.hxx>
+#include <TDataXtd_Position.hxx>
+#include <CDM_MessageDriver.hxx>
+
+//=======================================================================
+//function : MDataXtd_PositionStorageDriver
+//purpose :
+//=======================================================================
+MDataXtd_PositionStorageDriver::MDataXtd_PositionStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
+{
+}
+
+//=======================================================================
+//function : VersionNumber
+//purpose :
+//=======================================================================
+Standard_Integer MDataXtd_PositionStorageDriver::VersionNumber() const
+{ return 0; }
+
+//=======================================================================
+//function : SourceType
+//purpose :
+//=======================================================================
+Handle(Standard_Type) MDataXtd_PositionStorageDriver::SourceType() const
+{ return STANDARD_TYPE(TDataXtd_Position); }
+
+//=======================================================================
+//function : NewEmpty
+//purpose :
+//=======================================================================
+Handle(PDF_Attribute) MDataXtd_PositionStorageDriver::NewEmpty() const
+{ return new PDataXtd_Position; }
+
+//=======================================================================
+//function : Paste
+//purpose :
+//=======================================================================
+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);
+ T->SetPosition(S->GetPosition());
+}
+
+
--- /dev/null
+-- Created on: 1999-07-08
+-- Created by: Sergey RUIN
+-- Copyright (c) 1999 Matra Datavision
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
+--
+-- This file is part of Open CASCADE Technology software library.
+--
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
+--
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
+
+class PresentationRetrievalDriver from MDataXtd inherits ARDriver from MDF
+
+ ---Purpose: Retrieval drivers for graphic attributes from
+ -- MDataXtd
+
+uses RRelocationTable from MDF,
+ Attribute from PDF,
+ Attribute from TDF,
+ MessageDriver from CDM
+
+is
+
+ Create(theMessageDriver : MessageDriver from CDM) -- Version 0
+ returns PresentationRetrievalDriver from MDataXtd;
+
+
+ VersionNumber(me) returns Integer from Standard;
+ ---Purpose: Returns the version number from which the driver
+ -- is available: 0.
+
+ SourceType(me) returns Type from Standard;
+ ---Purpose: Returns the type: Presentation from PDataXtd.
+
+ NewEmpty (me) returns Attribute from TDF;
+
+
+ Paste(me;
+ Source : Attribute from PDF;
+ Target : Attribute from TDF;
+ RelocTable : RRelocationTable from MDF);
+
+end PresentationRetrievalDriver;
--- /dev/null
+// Created on: 1999-07-08
+// Created by: Sergey RUIN
+// Copyright (c) 1999-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_PresentationRetrievalDriver.ixx>
+
+#include <PDataXtd_Presentation.hxx>
+#include <TDataXtd_Presentation.hxx>
+#include <TCollection_ExtendedString.hxx>
+#include <PCollection_HExtendedString.hxx>
+#include <CDM_MessageDriver.hxx>
+
+//=======================================================================
+//function : MDataXtd_PresentationRetrievalDriver
+//purpose :
+//=======================================================================
+
+MDataXtd_PresentationRetrievalDriver::MDataXtd_PresentationRetrievalDriver
+ (const Handle(CDM_MessageDriver)& theMsgDriver)
+: MDF_ARDriver(theMsgDriver)
+{
+}
+
+Standard_Integer MDataXtd_PresentationRetrievalDriver::VersionNumber() const
+{
+ return 0;
+}
+
+Handle(Standard_Type) MDataXtd_PresentationRetrievalDriver::SourceType() const
+{
+ return STANDARD_TYPE(PDataXtd_Presentation);
+}
+
+Handle(TDF_Attribute) MDataXtd_PresentationRetrievalDriver::NewEmpty() const
+{
+ return new TDataXtd_Presentation;
+}
+
+void MDataXtd_PresentationRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
+ const Handle(TDF_Attribute)& Target,
+ const Handle(MDF_RRelocationTable)& /*RelocTable*/) const
+{
+ Handle(PDataXtd_Presentation) S = Handle(PDataXtd_Presentation)::DownCast (Source);
+ Handle(TDataXtd_Presentation) T = Handle(TDataXtd_Presentation)::DownCast (Target);
+
+ T->SetDisplayed( S->IsDisplayed() );
+
+ TCollection_ExtendedString extstr = (S->GetDriverGUID())->Convert();
+ Standard_GUID guid( extstr.ToExtString() );
+
+ T->SetDriverGUID( guid );
+
+ if( S->Color() != -1 ) T->SetColor( S->Color() );
+ else T->UnsetColor();
+
+ 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();
+
+#ifdef OCCT_DEBUG
+ cout << "AISPresentationRetrievalDriver " << "retrieved DriverGUID ==> ";
+ guid.ShallowDump(cout);
+ cout << endl;
+#endif
+}
--- /dev/null
+-- Created on: 1999-07-08
+-- Created by: Sergey RUIN
+-- Copyright (c) 1999 Matra Datavision
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
+--
+-- This file is part of Open CASCADE Technology software library.
+--
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
+--
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
+
+class PresentationRetrievalDriver_1 from MDataXtd inherits ARDriver from MDF
+
+ ---Purpose: Retrieval drivers for graphic attributes from
+ -- PDataXtd
+
+uses RRelocationTable from MDF,
+ Attribute from PDF,
+ Attribute from TDF,
+ MessageDriver from CDM
+
+is
+
+
+ Create (theMessageDriver : MessageDriver from CDM) -- Version 1
+ returns PresentationRetrievalDriver_1 from MDataXtd;
+
+
+ VersionNumber(me) returns Integer from Standard;
+ ---Purpose: Returns the version number from which the driver
+ -- is available: 1.
+
+ SourceType(me) returns Type from Standard;
+ ---Purpose: Returns the type: Presentation from PDataXtd.
+
+ NewEmpty (me) returns Attribute from TDF;
+
+
+ Paste(me;
+ Source : Attribute from PDF;
+ Target : Attribute from TDF;
+ RelocTable : RRelocationTable from MDF);
+
+
+end PresentationRetrievalDriver_1;
--- /dev/null
+// Created on: 1999-07-08
+// Created by: Sergey RUIN
+// Copyright (c) 1999-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_PresentationRetrievalDriver_1.ixx>
+
+#include <PDataXtd_Presentation_1.hxx>
+#include <TDataXtd_Presentation.hxx>
+#include <TCollection_ExtendedString.hxx>
+#include <PCollection_HExtendedString.hxx>
+#include <CDM_MessageDriver.hxx>
+
+//=======================================================================
+//function : MDataXtd_PresentationRetrievalDriver_1
+//purpose :
+//=======================================================================
+MDataXtd_PresentationRetrievalDriver_1::MDataXtd_PresentationRetrievalDriver_1(const Handle(CDM_MessageDriver)& theMsgDriver)
+:MDF_ARDriver(theMsgDriver)
+{}
+
+Standard_Integer MDataXtd_PresentationRetrievalDriver_1::VersionNumber() const
+{
+ return 1;
+}
+
+Handle(Standard_Type) MDataXtd_PresentationRetrievalDriver_1::SourceType() const
+{
+ return STANDARD_TYPE(PDataXtd_Presentation_1);
+}
+
+Handle(TDF_Attribute) MDataXtd_PresentationRetrievalDriver_1::NewEmpty() const
+{
+ return new TDataXtd_Presentation;
+}
+
+void MDataXtd_PresentationRetrievalDriver_1::Paste(const Handle(PDF_Attribute)& Source,
+ const Handle(TDF_Attribute)& Target,
+ const Handle(MDF_RRelocationTable)& /*RelocTable*/) const
+{
+ Handle(PDataXtd_Presentation_1) S = Handle(PDataXtd_Presentation_1)::DownCast (Source);
+ Handle(TDataXtd_Presentation) T = Handle(TDataXtd_Presentation)::DownCast (Target);
+
+ T->SetDisplayed( S->IsDisplayed() );
+
+ TCollection_ExtendedString extstr = (S->GetDriverGUID())->Convert();
+ Standard_GUID guid( extstr.ToExtString() );
+
+ T->SetDriverGUID( guid );
+
+ if( S->Color() != -1 ) T->SetColor( S->Color() );
+ else T->UnsetColor();
+
+ 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();
+
+ T->SetMode(S->Mode());
+
+#ifdef OCCT_DEBUG
+ cout << "AISPresentationRetrievalDriver " << "retrieved DriverGUID ==> ";
+ guid.ShallowDump(cout);
+ cout << endl;
+#endif
+}
--- /dev/null
+-- Created on: 1999-07-08
+-- Created by: Sergey RUIN
+-- Copyright (c) 1999 Matra Datavision
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
+--
+-- This file is part of Open CASCADE Technology software library.
+--
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
+--
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
+
+class PresentationStorageDriver from MDataXtd inherits ASDriver from MDF
+
+ ---Purpose: Storage driver for graphic attributes from
+ -- TDataXtd
+
+uses SRelocationTable from MDF,
+ Attribute from TDF,
+ Attribute from PDF,
+ MessageDriver from CDM
+
+
+is
+
+ Create (theMessageDriver : MessageDriver from CDM)
+ returns PresentationStorageDriver from MDataXtd;
+
+
+ VersionNumber(me) returns Integer from Standard;
+ ---Purpose: Returns the version number from which the driver
+ -- is available: 0.
+
+ SourceType(me) returns Type from Standard;
+ ---Purpose: Returns the type: Presentation from TDataXtd.
+
+ NewEmpty (me) returns Attribute from PDF;
+
+
+ Paste(me;
+ Source : Attribute from TDF;
+ Target : Attribute from PDF;
+ RelocTable : SRelocationTable from MDF);
+
+
+end PresentationStorageDriver;
+
--- /dev/null
+// 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
+}
+++ /dev/null
--- 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
-
- ---Category: StorageDriver
-
- class AISPresentationStorageDriver;
- class PositionStorageDriver;
-
-
- ---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;
-
-
-
+++ /dev/null
-// 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));
-}
-
-
+++ /dev/null
--- Created on: 1999-07-08
--- Created by: Sergey RUIN
--- Copyright (c) 1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class AISPresentationRetrievalDriver from MPrsStd inherits ARDriver from MDF
-
- ---Purpose: Retrieval drivers for graphic attributes from
- -- PPrsStd
-
-uses RRelocationTable from MDF,
- Attribute from PDF,
- Attribute from TDF,
- MessageDriver from CDM
-
-is
-
-
- Create(theMessageDriver : MessageDriver from CDM) -- Version 0
- returns AISPresentationRetrievalDriver from MPrsStd;
-
-
- VersionNumber(me) returns Integer from Standard;
- ---Purpose: Returns the version number from which the driver
- -- is available: 0.
-
- SourceType(me) returns Type from Standard;
- ---Purpose: Returns the type: AISPresentation from PPrsStd.
-
- NewEmpty (me) returns Attribute from TDF;
-
-
- Paste(me;
- Source : Attribute from PDF;
- Target : Attribute from TDF;
- RelocTable : RRelocationTable from MDF);
-
-end AISPresentationRetrievalDriver;
+++ /dev/null
-// Created on: 1999-07-08
-// Created by: Sergey RUIN
-// Copyright (c) 1999-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_AISPresentationRetrievalDriver.ixx>
-
-#include <PPrsStd_AISPresentation.hxx>
-#include <TPrsStd_AISPresentation.hxx>
-#include <TCollection_ExtendedString.hxx>
-#include <PCollection_HExtendedString.hxx>
-#include <Quantity_NameOfColor.hxx>
-#include <Graphic3d_NameOfMaterial.hxx>
-#include <CDM_MessageDriver.hxx>
-
-//=======================================================================
-//function : MPrsStd_AISPresentationRetrievalDriver
-//purpose :
-//=======================================================================
-
-MPrsStd_AISPresentationRetrievalDriver::MPrsStd_AISPresentationRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
-{}
-
-Standard_Integer MPrsStd_AISPresentationRetrievalDriver::VersionNumber() const
-{ return 0; }
-
-Handle(Standard_Type) MPrsStd_AISPresentationRetrievalDriver::SourceType() const
-{ return STANDARD_TYPE(PPrsStd_AISPresentation); }
-
-Handle(TDF_Attribute) MPrsStd_AISPresentationRetrievalDriver::NewEmpty() const
-{ return new TPrsStd_AISPresentation; }
-
-void MPrsStd_AISPresentationRetrievalDriver::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);
-
- T->SetDisplayed( S->IsDisplayed() );
-
- TCollection_ExtendedString extstr = (S->GetDriverGUID())->Convert();
- Standard_GUID guid( extstr.ToExtString() );
-
- T->SetDriverGUID( guid );
-
- if( S->Color() != -1 ) T->SetColor( (Quantity_NameOfColor)(S->Color()) );
- else T->UnsetColor();
-
- if( S->Material() != -1 ) T->SetMaterial( (Graphic3d_NameOfMaterial)(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();
-
-#ifdef OCCT_DEBUG
- cout << "AISPresentationRetrievalDriver " << "retrieved DriverGUID ==> ";
- guid.ShallowDump(cout);
- cout << endl;
-#endif
-}
-
+++ /dev/null
--- Created on: 1999-07-08
--- Created by: Sergey RUIN
--- Copyright (c) 1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class AISPresentationRetrievalDriver_1 from MPrsStd inherits ARDriver from MDF
-
- ---Purpose: Retrieval drivers for graphic attributes from
- -- PPrsStd
-
-uses RRelocationTable from MDF,
- Attribute from PDF,
- Attribute from TDF,
- MessageDriver from CDM
-
-is
-
-
- Create (theMessageDriver : MessageDriver from CDM) -- Version 1
- returns AISPresentationRetrievalDriver_1 from MPrsStd;
-
-
- VersionNumber(me) returns Integer from Standard;
- ---Purpose: Returns the version number from which the driver
- -- is available: 1.
-
- SourceType(me) returns Type from Standard;
- ---Purpose: Returns the type: AISPresentation from PPrsStd.
-
- NewEmpty (me) returns Attribute from TDF;
-
-
- Paste(me;
- Source : Attribute from PDF;
- Target : Attribute from TDF;
- RelocTable : RRelocationTable from MDF);
-
-
-end AISPresentationRetrievalDriver_1;
+++ /dev/null
-// Created on: 1999-07-08
-// Created by: Sergey RUIN
-// Copyright (c) 1999-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_AISPresentationRetrievalDriver_1.ixx>
-
-#include <PPrsStd_AISPresentation_1.hxx>
-#include <TPrsStd_AISPresentation.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
-//purpose :
-//=======================================================================
-
-MPrsStd_AISPresentationRetrievalDriver_1::MPrsStd_AISPresentationRetrievalDriver_1(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
-{}
-
-Standard_Integer MPrsStd_AISPresentationRetrievalDriver_1::VersionNumber() const
-{ return 1; }
-
-Handle(Standard_Type) MPrsStd_AISPresentationRetrievalDriver_1::SourceType() const
-{ return STANDARD_TYPE(PPrsStd_AISPresentation_1); }
-
-Handle(TDF_Attribute) MPrsStd_AISPresentationRetrievalDriver_1::NewEmpty() const
-{ return new TPrsStd_AISPresentation; }
-
-void MPrsStd_AISPresentationRetrievalDriver_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);
-
- T->SetDisplayed( S->IsDisplayed() );
-
- TCollection_ExtendedString extstr = (S->GetDriverGUID())->Convert();
- Standard_GUID guid( extstr.ToExtString() );
-
- T->SetDriverGUID( guid );
-
- if( S->Color() != -1 ) T->SetColor( (Quantity_NameOfColor)(S->Color()) );
- else T->UnsetColor();
-
- if( S->Material() != -1 ) T->SetMaterial( (Graphic3d_NameOfMaterial)(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();
-
- T->SetMode(S->Mode());
-
-#ifdef OCCT_DEBUG
- cout << "AISPresentationRetrievalDriver " << "retrieved DriverGUID ==> ";
- guid.ShallowDump(cout);
- cout << endl;
-#endif
-}
-
-
+++ /dev/null
--- Created on: 1999-07-08
--- Created by: Sergey RUIN
--- Copyright (c) 1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class AISPresentationStorageDriver from MPrsStd inherits ASDriver from MDF
-
- ---Purpose: Storage driver for graphic attributes from
- -- TPrsStd
-
-uses SRelocationTable from MDF,
- Attribute from TDF,
- Attribute from PDF,
- MessageDriver from CDM
-
-
-is
-
- Create (theMessageDriver : MessageDriver from CDM)
- returns AISPresentationStorageDriver from MPrsStd;
-
-
- VersionNumber(me) returns Integer from Standard;
- ---Purpose: Returns the version number from which the driver
- -- is available: 0.
-
- SourceType(me) returns Type from Standard;
- ---Purpose: Returns the type: AISPresentation from TPrsStd.
-
- NewEmpty (me) returns Attribute from PDF;
-
-
- Paste(me;
- Source : Attribute from TDF;
- Target : Attribute from PDF;
- RelocTable : SRelocationTable from MDF);
-
-
-end AISPresentationStorageDriver;
-
+++ /dev/null
-// 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 <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 OCCT_DEBUG
- cout << "AISPresentationStorageDriver " << "storaged DriverGUID ==> " << guid->Convert() << endl;
-#endif
-}
-
-
-
+++ /dev/null
--- Created on: 1998-04-07
--- Created by: Jean-Pierre COMBE
--- 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 PositionRetrievalDriver from MPrsStd inherits ARDriver from MDF
- ---Purpose: Retrieval drivers for graphic attributes from
- -- PPrsStd
-
-
-uses RRelocationTable from MDF,
- Attribute from PDF,
- Attribute from TDF,
- MessageDriver from CDM
-
-is
-
-
- Create(theMessageDriver : MessageDriver from CDM) -- Version 0
- returns PositionRetrievalDriver from MPrsStd;
-
-
- VersionNumber(me) returns Integer from Standard;
- ---Purpose: Returns the version number from which the driver
- -- is available: 0.
-
- SourceType(me) returns Type from Standard;
- ---Purpose: Returns the type: ColorAttribute from PGraphicAttribute.
-
- NewEmpty (me) returns Attribute from TDF;
-
-
- Paste(me;
- Source : Attribute from PDF;
- Target : Attribute from TDF;
- RelocTable : RRelocationTable from MDF);
-
-end PositionRetrievalDriver;
+++ /dev/null
-// Created on: 1998-04-07
-// Created by: Jean-Pierre COMBE
-// 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.
-
-#include <MPrsStd_PositionRetrievalDriver.ixx>
-
-#include <PDataXtd_Position.hxx>
-#include <TDataXtd_Position.hxx>
-#include <CDM_MessageDriver.hxx>
-
-//=======================================================================
-//function : MPrsStd_PositionRetrievalDriver
-//purpose :
-//=======================================================================
-MPrsStd_PositionRetrievalDriver::MPrsStd_PositionRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
-{}
-
-//=======================================================================
-//function : VersionNumber
-//purpose :
-//=======================================================================
-Standard_Integer MPrsStd_PositionRetrievalDriver::VersionNumber() const
-{ return 0; }
-
-//=======================================================================
-//function : SourceType
-//purpose :
-//=======================================================================
-Handle(Standard_Type) MPrsStd_PositionRetrievalDriver::SourceType() const
-{ return STANDARD_TYPE(PDataXtd_Position); }
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-Handle(TDF_Attribute) MPrsStd_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
-{
- Handle(PDataXtd_Position) S = Handle(PDataXtd_Position)::DownCast (Source);
- Handle(TDataXtd_Position) T = Handle(TDataXtd_Position)::DownCast (Target);
- T->SetPosition(S->GetPosition());
-}
-
+++ /dev/null
--- Created on: 1998-04-07
--- Created by: Jean-Pierre COMBE
--- 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 PositionStorageDriver from MPrsStd inherits ASDriver from MDF
-
- ---Purpose: Storage driver for graphic attributes from
- -- TPrsStd
-
-uses SRelocationTable from MDF,
- Attribute from TDF,
- Attribute from PDF,
- MessageDriver from CDM
-
-
-is
-
- Create(theMessageDriver : MessageDriver from CDM)
- returns PositionStorageDriver from MPrsStd;
-
-
- VersionNumber(me) returns Integer from Standard;
- ---Purpose: Returns the version number from which the driver
- -- is available: 0.
-
- SourceType(me) returns Type from Standard;
- ---Purpose: Returns the type: ColorAttribute from TGraphicAttribute.
-
- NewEmpty (me) returns Attribute from PDF;
-
-
- Paste(me;
- Source : Attribute from TDF;
- Target : Attribute from PDF;
- RelocTable : SRelocationTable from MDF);
-
-
-end PositionStorageDriver;
-
+++ /dev/null
-// Created on: 1998-04-07
-// Created by: Jean-Pierre COMBE
-// 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.
-
-#include <MPrsStd_PositionStorageDriver.ixx>
-
-#include <PDataXtd_Position.hxx>
-#include <TDataXtd_Position.hxx>
-#include <CDM_MessageDriver.hxx>
-
-//=======================================================================
-//function : MPrsStd_PositionStorageDriver
-//purpose :
-//=======================================================================
-MPrsStd_PositionStorageDriver::MPrsStd_PositionStorageDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ASDriver(theMsgDriver)
-{
-}
-
-//=======================================================================
-//function : VersionNumber
-//purpose :
-//=======================================================================
-Standard_Integer MPrsStd_PositionStorageDriver::VersionNumber() const
-{ return 0; }
-
-//=======================================================================
-//function : SourceType
-//purpose :
-//=======================================================================
-Handle(Standard_Type) MPrsStd_PositionStorageDriver::SourceType() const
-{ return STANDARD_TYPE(TDataXtd_Position); }
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-Handle(PDF_Attribute) MPrsStd_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
-{
- Handle(TDataXtd_Position) S = Handle(TDataXtd_Position)::DownCast (Source);
- Handle(PDataXtd_Position) T = Handle(PDataXtd_Position)::DownCast (Target);
- T->SetPosition(S->GetPosition());
-}
-
-
TKCDF \
TKLCAF \
TKCAF \
+ TKVCAF \
TKBinL \
TKXmlL \
TKShapeSchema \
class PatternStd;
- class Shape;
+ class Shape;
+
+ class Presentation;
+
+ class Presentation_1;
end PDataXtd;
--- /dev/null
+-- Created on: 1999-07-08
+-- Created by: Sergey RUIN
+-- Copyright (c) 1999 Matra Datavision
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
+--
+-- This file is part of Open CASCADE Technology software library.
+--
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
+--
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
+
+class Presentation from PDataXtd
+ inherits Attribute from PDF
+
+ ---Purpose:
+
+uses HExtendedString from PCollection
+is
+
+ Create returns Presentation from PDataXtd;
+
+ IsDisplayed(me) returns Boolean from Standard;
+ SetDisplayed(me : mutable; B : Boolean from Standard);
+
+ SetDriverGUID(me: mutable; guid: HExtendedString from PCollection );
+ GetDriverGUID(me) returns HExtendedString from PCollection;
+
+ Color(me) returns Integer from Standard;
+ SetColor(me : mutable; C : Integer from Standard);
+
+ Transparency(me) returns Real from Standard;
+ SetTransparency(me : mutable; T : Real from Standard);
+
+ Material(me) returns Integer from Standard;
+ SetMaterial(me : mutable; M : Integer from Standard);
+
+ Width(me) returns Real from Standard;
+ SetWidth(me : mutable; W : Real from Standard);
+
+
+fields
+
+ myIsDisplayed : Boolean from Standard;
+ myDriverGUID : HExtendedString from PCollection;
+ myTransparency : Real from Standard;
+ myColor : Integer from Standard;
+ myMaterial : Integer from Standard;
+ myWidth : Real from Standard;
+end Presentation;
--- /dev/null
+// Created on: 1999-07-08
+// Created by: srn
+// Copyright (c) 1999-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 <PDataXtd_Presentation.ixx>
+
+
+//=======================================================================
+//function : PDataXtd_Presentation
+//purpose :
+//=======================================================================
+
+PDataXtd_Presentation::PDataXtd_Presentation() :
+ myIsDisplayed(Standard_False),
+ myTransparency(0.),
+ myColor(0),
+ myMaterial(0),
+ myWidth(0.)
+{}
+
+
+//=======================================================================
+//function : SetDisplayed
+//purpose :
+//=======================================================================
+
+void PDataXtd_Presentation::SetDisplayed (const Standard_Boolean B)
+{
+ myIsDisplayed = B ;
+}
+
+//=======================================================================
+//function : IsDisplayed
+//purpose :
+//=======================================================================
+
+Standard_Boolean PDataXtd_Presentation::IsDisplayed() const
+{
+ return myIsDisplayed;
+}
+
+
+//=======================================================================
+//function : SetDriverGUID
+//purpose :
+//=======================================================================
+void PDataXtd_Presentation::SetDriverGUID( const Handle(PCollection_HExtendedString)& guid)
+{
+ myDriverGUID = guid;
+}
+
+//=======================================================================
+//function : GetDriverGUID
+//purpose :
+//=======================================================================
+Handle(PCollection_HExtendedString) PDataXtd_Presentation::GetDriverGUID( void ) const
+{
+ return myDriverGUID;
+}
+
+//=======================================================================
+//function : Color
+//purpose :
+//=======================================================================
+Standard_Integer PDataXtd_Presentation::Color() const
+{
+ return myColor;
+}
+
+//=======================================================================
+//function : SetColor
+//purpose :
+//=======================================================================
+void PDataXtd_Presentation::SetColor(const Standard_Integer C)
+{
+ myColor = C;
+}
+
+//=======================================================================
+//function : Transparency
+//purpose :
+//=======================================================================
+Standard_Real PDataXtd_Presentation::Transparency() const
+{
+ return myTransparency;
+}
+
+//=======================================================================
+//function : SetTransparency
+//purpose :
+//=======================================================================
+void PDataXtd_Presentation::SetTransparency(const Standard_Real T)
+{
+ myTransparency = T;
+}
+
+//=======================================================================
+//function : Material
+//purpose :
+//=======================================================================
+Standard_Integer PDataXtd_Presentation::Material() const
+{
+ return myMaterial;
+}
+
+//=======================================================================
+//function : SetMaterial
+//purpose :
+//=======================================================================
+void PDataXtd_Presentation::SetMaterial(const Standard_Integer M)
+{
+ myMaterial = M;
+}
+
+//=======================================================================
+//function : Width
+//purpose :
+//=======================================================================
+Standard_Real PDataXtd_Presentation::Width() const
+{
+ return myWidth;
+}
+
+//=======================================================================
+//function : SetWidth
+//purpose :
+//=======================================================================
+void PDataXtd_Presentation::SetWidth(const Standard_Real W)
+{
+ myWidth = W;
+}
+
--- /dev/null
+-- Created on: 1999-07-08
+-- Created by: Sergey RUIN
+-- Copyright (c) 1999 Matra Datavision
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
+--
+-- This file is part of Open CASCADE Technology software library.
+--
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
+--
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
+
+class Presentation_1 from PDataXtd
+ inherits Attribute from PDF
+
+ ---Purpose:
+
+uses HExtendedString from PCollection
+is
+
+ Create returns Presentation_1 from PDataXtd;
+
+ IsDisplayed(me) returns Boolean from Standard;
+ SetDisplayed(me : mutable; B : Boolean from Standard);
+
+ SetDriverGUID(me: mutable; guid: HExtendedString from PCollection );
+ GetDriverGUID(me) returns HExtendedString from PCollection;
+
+ Color(me) returns Integer from Standard;
+ SetColor(me : mutable; C : Integer from Standard);
+
+ Transparency(me) returns Real from Standard;
+ SetTransparency(me : mutable; T : Real from Standard);
+
+ Material(me) returns Integer from Standard;
+ SetMaterial(me : mutable; M : Integer from Standard);
+
+ Width(me) returns Real from Standard;
+ SetWidth(me : mutable; W : Real from Standard);
+
+ Mode(me) returns Integer from Standard;
+ SetMode(me : mutable; M : Integer from Standard);
+fields
+
+ myIsDisplayed : Boolean from Standard;
+ myDriverGUID : HExtendedString from PCollection;
+ myTransparency : Real from Standard;
+ myColor : Integer from Standard;
+ myMaterial : Integer from Standard;
+ myWidth : Real from Standard;
+ myMode : Integer from Standard;
+end Presentation_1;
--- /dev/null
+// Created on: 1999-07-08
+// Created by: srn
+// Copyright (c) 1999-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 <PDataXtd_Presentation_1.ixx>
+
+
+//=======================================================================
+//function : PDataXtd_Presentation_1
+//purpose :
+//=======================================================================
+
+PDataXtd_Presentation_1::PDataXtd_Presentation_1() :
+ myIsDisplayed(Standard_False),
+ myTransparency(0.),
+ myColor(0),
+ myMaterial(0),
+ myWidth(0.),
+ myMode(0)
+{
+}
+
+
+//=======================================================================
+//function : SetDisplayed
+//purpose :
+//=======================================================================
+
+void PDataXtd_Presentation_1::SetDisplayed (const Standard_Boolean B)
+{
+ myIsDisplayed = B ;
+}
+
+//=======================================================================
+//function : IsDisplayed
+//purpose :
+//=======================================================================
+
+Standard_Boolean PDataXtd_Presentation_1::IsDisplayed() const
+{
+ return myIsDisplayed;
+}
+
+
+//=======================================================================
+//function : SetDriverGUID
+//purpose :
+//=======================================================================
+void PDataXtd_Presentation_1::SetDriverGUID( const Handle(PCollection_HExtendedString)& guid)
+{
+ myDriverGUID = guid;
+}
+
+//=======================================================================
+//function : GetDriverGUID
+//purpose :
+//=======================================================================
+Handle(PCollection_HExtendedString) PDataXtd_Presentation_1::GetDriverGUID( void ) const
+{
+ return myDriverGUID;
+}
+
+//=======================================================================
+//function : Color
+//purpose :
+//=======================================================================
+Standard_Integer PDataXtd_Presentation_1::Color() const
+{
+ return myColor;
+}
+
+//=======================================================================
+//function : SetColor
+//purpose :
+//=======================================================================
+void PDataXtd_Presentation_1::SetColor(const Standard_Integer C)
+{
+ myColor = C;
+}
+
+//=======================================================================
+//function : Transparency
+//purpose :
+//=======================================================================
+Standard_Real PDataXtd_Presentation_1::Transparency() const
+{
+ return myTransparency;
+}
+
+//=======================================================================
+//function : SetTransparency
+//purpose :
+//=======================================================================
+void PDataXtd_Presentation_1::SetTransparency(const Standard_Real T)
+{
+ myTransparency = T;
+}
+
+//=======================================================================
+//function : Material
+//purpose :
+//=======================================================================
+Standard_Integer PDataXtd_Presentation_1::Material() const
+{
+ return myMaterial;
+}
+
+//=======================================================================
+//function : SetMaterial
+//purpose :
+//=======================================================================
+void PDataXtd_Presentation_1::SetMaterial(const Standard_Integer M)
+{
+ myMaterial = M;
+}
+
+//=======================================================================
+//function : Width
+//purpose :
+//=======================================================================
+Standard_Real PDataXtd_Presentation_1::Width() const
+{
+ return myWidth;
+}
+
+
+
+
+//=======================================================================
+//function : SetWidth
+//purpose :
+//=======================================================================
+
+void PDataXtd_Presentation_1::SetWidth(const Standard_Real W)
+{
+ myWidth = W;
+}
+
+
+
+//=======================================================================
+//function : Mode
+//purpose :
+//=======================================================================
+
+Standard_Integer PDataXtd_Presentation_1::Mode() const
+{
+ return myMode;
+}
+
+
+//=======================================================================
+//function : SetMode
+//purpose :
+//=======================================================================
+
+void PDataXtd_Presentation_1::SetMode(const Standard_Integer M)
+{
+ myMode = M;
+}
+++ /dev/null
--- 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;
-
-
+++ /dev/null
--- Created on: 1999-07-08
--- Created by: Sergey RUIN
--- Copyright (c) 1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class AISPresentation from PPrsStd
- inherits Attribute from PDF
-
- ---Purpose:
-
-uses HExtendedString from PCollection
-is
-
- Create returns AISPresentation from PPrsStd;
-
- IsDisplayed(me) returns Boolean from Standard;
- SetDisplayed(me : mutable; B : Boolean from Standard);
-
- SetDriverGUID(me: mutable; guid: HExtendedString from PCollection );
- GetDriverGUID(me) returns HExtendedString from PCollection;
-
- Color(me) returns Integer from Standard;
- SetColor(me : mutable; C : Integer from Standard);
-
- Transparency(me) returns Real from Standard;
- SetTransparency(me : mutable; T : Real from Standard);
-
- Material(me) returns Integer from Standard;
- SetMaterial(me : mutable; M : Integer from Standard);
-
- Width(me) returns Real from Standard;
- SetWidth(me : mutable; W : Real from Standard);
-
-
-fields
-
- myIsDisplayed : Boolean from Standard;
- myDriverGUID : HExtendedString from PCollection;
- myTransparency : Real from Standard;
- myColor : Integer from Standard;
- myMaterial : Integer from Standard;
- myWidth : Real from Standard;
-end AISPresentation;
+++ /dev/null
-// Created on: 1999-07-08
-// Created by: srn
-// Copyright (c) 1999-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 <PPrsStd_AISPresentation.ixx>
-
-
-//=======================================================================
-//function : PPrsStd_AISPresentation
-//purpose :
-//=======================================================================
-
-PPrsStd_AISPresentation::PPrsStd_AISPresentation() :
- myIsDisplayed(Standard_False),
- myTransparency(0.),
- myColor(0),
- myMaterial(0),
- myWidth(0.)
-{}
-
-
-//=======================================================================
-//function : SetDisplayed
-//purpose :
-//=======================================================================
-
-void PPrsStd_AISPresentation::SetDisplayed (const Standard_Boolean B)
-{
- myIsDisplayed = B ;
-}
-
-//=======================================================================
-//function : IsDisplayed
-//purpose :
-//=======================================================================
-
-Standard_Boolean PPrsStd_AISPresentation::IsDisplayed() const
-{
- return myIsDisplayed;
-}
-
-
-//=======================================================================
-//function : SetDriverGUID
-//purpose :
-//=======================================================================
-void PPrsStd_AISPresentation::SetDriverGUID( const Handle(PCollection_HExtendedString)& guid)
-{
- myDriverGUID = guid;
-}
-
-//=======================================================================
-//function : GetDriverGUID
-//purpose :
-//=======================================================================
-Handle(PCollection_HExtendedString) PPrsStd_AISPresentation::GetDriverGUID( void ) const
-{
- return myDriverGUID;
-}
-
-//=======================================================================
-//function : Color
-//purpose :
-//=======================================================================
-Standard_Integer PPrsStd_AISPresentation::Color() const
-{
- return myColor;
-}
-
-//=======================================================================
-//function : SetColor
-//purpose :
-//=======================================================================
-void PPrsStd_AISPresentation::SetColor(const Standard_Integer C)
-{
- myColor = C;
-}
-
-//=======================================================================
-//function : Transparency
-//purpose :
-//=======================================================================
-Standard_Real PPrsStd_AISPresentation::Transparency() const
-{
- return myTransparency;
-}
-
-//=======================================================================
-//function : SetTransparency
-//purpose :
-//=======================================================================
-void PPrsStd_AISPresentation::SetTransparency(const Standard_Real T)
-{
- myTransparency = T;
-}
-
-//=======================================================================
-//function : Material
-//purpose :
-//=======================================================================
-Standard_Integer PPrsStd_AISPresentation::Material() const
-{
- return myMaterial;
-}
-
-//=======================================================================
-//function : SetMaterial
-//purpose :
-//=======================================================================
-void PPrsStd_AISPresentation::SetMaterial(const Standard_Integer M)
-{
- myMaterial = M;
-}
-
-//=======================================================================
-//function : Width
-//purpose :
-//=======================================================================
-Standard_Real PPrsStd_AISPresentation::Width() const
-{
- return myWidth;
-}
-
-//=======================================================================
-//function : SetWidth
-//purpose :
-//=======================================================================
-void PPrsStd_AISPresentation::SetWidth(const Standard_Real W)
-{
- myWidth = W;
-}
-
+++ /dev/null
--- Created on: 1999-07-08
--- Created by: Sergey RUIN
--- Copyright (c) 1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class AISPresentation_1 from PPrsStd
- inherits Attribute from PDF
-
- ---Purpose:
-
-uses HExtendedString from PCollection
-is
-
- Create returns AISPresentation_1 from PPrsStd;
-
- IsDisplayed(me) returns Boolean from Standard;
- SetDisplayed(me : mutable; B : Boolean from Standard);
-
- SetDriverGUID(me: mutable; guid: HExtendedString from PCollection );
- GetDriverGUID(me) returns HExtendedString from PCollection;
-
- Color(me) returns Integer from Standard;
- SetColor(me : mutable; C : Integer from Standard);
-
- Transparency(me) returns Real from Standard;
- SetTransparency(me : mutable; T : Real from Standard);
-
- Material(me) returns Integer from Standard;
- SetMaterial(me : mutable; M : Integer from Standard);
-
- Width(me) returns Real from Standard;
- SetWidth(me : mutable; W : Real from Standard);
-
- Mode(me) returns Integer from Standard;
- SetMode(me : mutable; M : Integer from Standard);
-fields
-
- myIsDisplayed : Boolean from Standard;
- myDriverGUID : HExtendedString from PCollection;
- myTransparency : Real from Standard;
- myColor : Integer from Standard;
- myMaterial : Integer from Standard;
- myWidth : Real from Standard;
- myMode : Integer from Standard;
-end AISPresentation_1;
+++ /dev/null
-// Created on: 1999-07-08
-// Created by: srn
-// Copyright (c) 1999-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 <PPrsStd_AISPresentation_1.ixx>
-
-
-//=======================================================================
-//function : PPrsStd_AISPresentation
-//purpose :
-//=======================================================================
-
-PPrsStd_AISPresentation_1::PPrsStd_AISPresentation_1() :
- myIsDisplayed(Standard_False),
- myTransparency(0.),
- myColor(0),
- myMaterial(0),
- myWidth(0.),
- myMode(0)
-{
-}
-
-
-//=======================================================================
-//function : SetDisplayed
-//purpose :
-//=======================================================================
-
-void PPrsStd_AISPresentation_1::SetDisplayed (const Standard_Boolean B)
-{
- myIsDisplayed = B ;
-}
-
-//=======================================================================
-//function : IsDisplayed
-//purpose :
-//=======================================================================
-
-Standard_Boolean PPrsStd_AISPresentation_1::IsDisplayed() const
-{
- return myIsDisplayed;
-}
-
-
-//=======================================================================
-//function : SetDriverGUID
-//purpose :
-//=======================================================================
-void PPrsStd_AISPresentation_1::SetDriverGUID( const Handle(PCollection_HExtendedString)& guid)
-{
- myDriverGUID = guid;
-}
-
-//=======================================================================
-//function : GetDriverGUID
-//purpose :
-//=======================================================================
-Handle(PCollection_HExtendedString) PPrsStd_AISPresentation_1::GetDriverGUID( void ) const
-{
- return myDriverGUID;
-}
-
-//=======================================================================
-//function : Color
-//purpose :
-//=======================================================================
-Standard_Integer PPrsStd_AISPresentation_1::Color() const
-{
- return myColor;
-}
-
-//=======================================================================
-//function : SetColor
-//purpose :
-//=======================================================================
-void PPrsStd_AISPresentation_1::SetColor(const Standard_Integer C)
-{
- myColor = C;
-}
-
-//=======================================================================
-//function : Transparency
-//purpose :
-//=======================================================================
-Standard_Real PPrsStd_AISPresentation_1::Transparency() const
-{
- return myTransparency;
-}
-
-//=======================================================================
-//function : SetTransparency
-//purpose :
-//=======================================================================
-void PPrsStd_AISPresentation_1::SetTransparency(const Standard_Real T)
-{
- myTransparency = T;
-}
-
-//=======================================================================
-//function : Material
-//purpose :
-//=======================================================================
-Standard_Integer PPrsStd_AISPresentation_1::Material() const
-{
- return myMaterial;
-}
-
-//=======================================================================
-//function : SetMaterial
-//purpose :
-//=======================================================================
-void PPrsStd_AISPresentation_1::SetMaterial(const Standard_Integer M)
-{
- myMaterial = M;
-}
-
-//=======================================================================
-//function : Width
-//purpose :
-//=======================================================================
-Standard_Real PPrsStd_AISPresentation_1::Width() const
-{
- return myWidth;
-}
-
-
-
-
-//=======================================================================
-//function : SetWidth
-//purpose :
-//=======================================================================
-
-void PPrsStd_AISPresentation_1::SetWidth(const Standard_Real W)
-{
- myWidth = W;
-}
-
-
-
-//=======================================================================
-//function : Mode
-//purpose :
-//=======================================================================
-
-Standard_Integer PPrsStd_AISPresentation_1::Mode() const
-{
- return myMode;
-}
-
-
-//=======================================================================
-//function : SetMode
-//purpose :
-//=======================================================================
-
-void PPrsStd_AISPresentation_1::SetMode(const Standard_Integer M)
-{
- myMode = M;
-}
#include <MNaming.hxx>
#include <MDocStd.hxx>
#include <MFunction.hxx>
-#include <MPrsStd.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : PAppStd_DocumentRetrievalDriver
MDocStd::AddRetrievalDrivers(HARSeq, theMsgDriver);
MFunction::AddRetrievalDrivers(HARSeq, theMsgDriver);
MNaming::AddRetrievalDrivers(HARSeq, theMsgDriver);
- MPrsStd::AddRetrievalDrivers(HARSeq, theMsgDriver);
//
aRetrievalTable->SetDrivers(HARSeq);
#include <MDataXtd.hxx>
#include <MNaming.hxx>
#include <MDocStd.hxx>
-#include <MPrsStd.hxx>
#include <MFunction.hxx>
#include <TNaming_Tool.hxx>
MDocStd::AddStorageDrivers(HASSeq, theMsgDriver);
MFunction::AddStorageDrivers(HASSeq, theMsgDriver);
MNaming::AddStorageDrivers(HASSeq, theMsgDriver);
- MPrsStd::AddStorageDrivers(HASSeq, theMsgDriver);
//
aStorageTable->SetDrivers(HASSeq);
return aStorageTable;
is
package PDataXtd;
package PNaming;
- package PPrsStd;
end StdSchema;
class Axis;
class Plane;
+
+ class Presentation;
deferred class Pattern;
--- /dev/null
+-- 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 : Attribute from TDF; theRT : 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;
\ No newline at end of file
--- /dev/null
+// 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;
+}
TKCAF
TKCDF
TKLCAF
-TKV3d
TKBinL
BinDrivers
BinMDataXtd
-BinMPrsStd
BinMNaming
TKG3d
TKCDF
TKLCAF
-TKV3d
TKBO
TDataXtd
TNaming
-TPrsStd
AppStd
TKBool
TKBO
TKCAF
+TKVCAF
TKViewerTest
TKernel
TKCDF
TKG2d
-TKV3d
TKService
TKG3d
TKPShape
PDataXtd
PNaming
-PPrsStd
MDataXtd
MPrsStd
MNaming
TKOffset
TKFeat
TKCAF
+TKVCAF
TKIGES
TKXSBase
TKMesh
--- /dev/null
+TKernel
+TKGeomBase
+TKBRep
+TKTopAlgo
+TKMath
+TKService
+TKG2d
+TKG3d
+TKCDF
+TKLCAF
+TKBO
+TKCAF
+TKV3d
--- /dev/null
+EXTERNLIB
+PACKAGES
TKLCAF
TKG3d
TKCAF
+TKVCAF
TKXSBase
TKG2d
TKCAF
+TKVCAF
TKDraw
TKTopAlgo
TKLCAF
TKCDF
TKernel
-TKV3d
TKMath
TKBRep
TKG2d
XmlDrivers
XmlMDataXtd
XmlMNaming
-XmlMPrsStd
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
-- 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.
--
-- 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
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,
- Drawer from Prs3d
+ NameOfMaterial from Graphic3d
+
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 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
-
- AISUpdate (me : mutable)
- ---Purpose: Updates AIS_InteractiveObject stored in the attribute
- -- and applies the visualization settings
- is private;
- AISDisplay (me : mutable)
- ---Purpose: Displays AIS_InteractiveObject stored in the attribute
- is private;
+ IsDisplayed (me) returns Boolean from Standard;
+ ---Purpose: Returns true if this AIS presentation attribute is displayed.
- 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
- 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.
----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.
+ ---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.
+ --- 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.
+ ---Purpose: Returns true if this presentation attribute already has a transparency setting.
+
UnsetTransparency(me : mutable);
----Purpose: Removes the transparency setting from this presentation attribute.
+ ---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.
+ ---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 ;
-
+ ---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.
+ ---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);
-
+ ---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);
+
+ UnsetMode(me : mutable);
SelectionMode(me) returns Integer from Standard;
-
- SetSelectionMode(me: mutable; theSelectionMode : 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 Attribute from TDF;
-
- Restore(me: mutable; with : Attribute from TDF);
+ NewEmpty(me) returns Attribute from TDF;
- Paste (me; into : Attribute from TDF;
- RT : RelocationTable from TDF);
+ Restore(me: mutable; theWith : Attribute from TDF);
+
+ Paste(me; into : Attribute from TDF; RT : RelocationTable from TDF);
BackupCopy(me) returns Attribute from TDF is redefined;
-
+
---Category: Callbacks for viewer updating
-- =============================
- AfterAddition (me: mutable)
- is redefined;
+ AfterAddition (me: mutable) is redefined;
- BeforeRemoval (me: mutable)
- is redefined;
+ BeforeRemoval (me: mutable) is redefined;
- BeforeForget(me: mutable)
- is redefined;
+ BeforeForget(me: mutable) is redefined;
+
+ AfterResume(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;
-
+ 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)
+ forceIt : Boolean from Standard = Standard_False)
---Purpose: update AIS viewer according to delta
- returns Boolean from Standard
- is redefined;
-
+ 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
+ is private;
+
+ AISDisplay (me : mutable)
+ ---Purpose: Displays AIS_InteractiveObject stored in the attribute
+ is private;
+
+ 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
+ is private;
+
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;
// 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!
-// +---------------------------------------------------------------------------+
#include <TPrsStd_AISPresentation.ixx>
#include <TDF_DefaultDeltaOnRemoval.hxx>
#include <TDF_DeltaOnAddition.hxx>
#include <TDF_Tool.hxx>
#include <TCollection_ExtendedString.hxx>
+#include <TDataXtd_Presentation.hxx>
#include <TPrsStd_AISViewer.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <TPrsStd_Driver.hxx>
#include <TPrsStd_DriverTable.hxx>
+
+//=======================================================================
+//function : TPrsStd_AISPresentation
+//purpose : Constructor
+//=======================================================================
+TPrsStd_AISPresentation::TPrsStd_AISPresentation ()
+: myDriverGUID("00000000-0000-0000-0000-000000000000")
+{
+}
+
+
//=======================================================================
//function : Set
//purpose :
//=======================================================================
-Handle(TPrsStd_AISPresentation) TPrsStd_AISPresentation::Set(const TDF_Label& L,const Standard_GUID& driver)
-{
-
- Handle(TPrsStd_AISPresentation) P;
+Handle(TPrsStd_AISPresentation) TPrsStd_AISPresentation::Set
+ ( const TDF_Label& theLabel, const Standard_GUID& theDriver )
+{
+ Handle(TPrsStd_AISPresentation) aPresentation;
- if (!L.FindAttribute(TPrsStd_AISPresentation::GetID(),P)) {
- P = new TPrsStd_AISPresentation ();
- L.AddAttribute(P);
+ if ( !theLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), aPresentation) )
+ {
+ aPresentation = new TPrsStd_AISPresentation();
+ theLabel.AddAttribute(aPresentation);
}
- P->SetDriverGUID(driver);
- return P;
+
+ aPresentation->SetDriverGUID(theDriver);
+ return aPresentation;
}
//function : Unset
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::Unset (const TDF_Label& L)
-{
- Handle(TPrsStd_AISPresentation) P;
+void TPrsStd_AISPresentation::Unset (const TDF_Label& theLabel)
+{
+ Handle(TPrsStd_AISPresentation) aPresentation;
- if (L.FindAttribute(TPrsStd_AISPresentation::GetID(),P)) {
- L.ForgetAttribute(P);
- }
+ if ( theLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), aPresentation) )
+ theLabel.ForgetAttribute(aPresentation);
}
//function : Set
//purpose :
//=======================================================================
-Handle(TPrsStd_AISPresentation) TPrsStd_AISPresentation::Set (const Handle(TDF_Attribute)& master)
-{
- Handle(TPrsStd_AISPresentation) P;
-
- if (!master->Label().FindAttribute(TPrsStd_AISPresentation::GetID(),P)) {
- P = new TPrsStd_AISPresentation ();
- master->Label().AddAttribute(P);
- }
-
- P->SetDriverGUID( master->ID() );
+Handle(TPrsStd_AISPresentation) TPrsStd_AISPresentation::Set(const Handle(TDF_Attribute)& theMaster)
+{
+ Handle(TPrsStd_AISPresentation) aPresentation;
+ if ( !theMaster->Label().FindAttribute(TPrsStd_AISPresentation::GetID(), aPresentation) )
+ {
+ aPresentation = new TPrsStd_AISPresentation ();
+ theMaster->Label().AddAttribute(aPresentation);
+ }
- return P;
+ aPresentation->SetDriverGUID( theMaster->ID() );
+ return aPresentation;
}
-
-
//=======================================================================
//function : GetID
//purpose :
//=======================================================================
-const Standard_GUID& TPrsStd_AISPresentation::GetID()
+const Standard_GUID& TPrsStd_AISPresentation::GetID()
{
- static Standard_GUID TPrsStd_AISPresentationID("04fb4d00-5690-11d1-8940-080009dc3333");
+ static Standard_GUID TPrsStd_AISPresentationID("3680ac6c-47ae-4366-bb94-26abb6e07341");
return TPrsStd_AISPresentationID;
}
-//=======================================================================
-//function : TPrsStd_AISPresentation
-//purpose :
-//=======================================================================
-TPrsStd_AISPresentation::TPrsStd_AISPresentation () :
-myDriverGUID("00000000-0000-0000-0000-000000000000"),
-myTransparency(0.),
-myColor(Quantity_NOC_WHITE),
-myMaterial(Graphic3d_NOM_BRASS),
-myWidth(0.),
-myMode(0),
-mySelectionMode(0),
-isDisplayed(Standard_False),
-hasOwnColor(Standard_False),
-hasOwnMaterial(Standard_False),
-hasOwnTransparency(Standard_False),
-hasOwnWidth(Standard_False),
-hasOwnMode(Standard_False),
-hasOwnSelectionMode(Standard_False)
-{}
-
-
//=======================================================================
//function : Display
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::Display (const Standard_Boolean update)
+void TPrsStd_AISPresentation::Display(const Standard_Boolean theIsUpdate)
{
-
- if( update || myAIS.IsNull() ) {
+ if ( theIsUpdate || myAIS.IsNull() )
AISUpdate();
- }
- AISDisplay();
+
+ AISDisplay();
}
//function : Erase
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::Erase (const Standard_Boolean remove)
-{
- if( isDisplayed ) AISErase(remove);
+void TPrsStd_AISPresentation::Erase(const Standard_Boolean theIsRemove)
+{
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ {
+ if ( aPresentation.IsNull() == Standard_False && aPresentation->IsDisplayed() )
+ AISErase(theIsRemove);
+ }
}
+
//=======================================================================
//function : Update
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::Update ()
-{
+void TPrsStd_AISPresentation::Update()
+{
AISUpdate();
}
//function : IsDisplayed
//purpose :
//=======================================================================
-Standard_Boolean TPrsStd_AISPresentation::IsDisplayed () const
+Standard_Boolean TPrsStd_AISPresentation::IsDisplayed() const
{
- return isDisplayed;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->IsDisplayed();
+
+ return Standard_False;
+}
+
+
+//=======================================================================
+//function : SetDisplayed
+//purpose :
+//=======================================================================
+void TPrsStd_AISPresentation::SetDisplayed(const Standard_Boolean theIsDisplayed)
+{
+ Handle(TDataXtd_Presentation) aPresentation = getData();
+ return aPresentation->SetDisplayed(theIsDisplayed);
}
//function :SetDriverGUID
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::SetDriverGUID(const Standard_GUID& guid)
+void TPrsStd_AISPresentation::SetDriverGUID(const Standard_GUID& theGUID)
{
- // OCC2932 correction
- if(myDriverGUID == guid) return;
+ if ( myDriverGUID == theGUID )
+ return;
- Backup();
- myDriverGUID = guid;
+ Backup();
+ myDriverGUID = theGUID;
}
//=======================================================================
Graphic3d_NameOfMaterial TPrsStd_AISPresentation::Material() const
{
- return myMaterial;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return static_cast<Graphic3d_NameOfMaterial>( aPresentation->Material() );
+
+ return Graphic3d_NOM_BRASS;
}
+
//=======================================================================
//function :HasMaterial
//purpose :
//=======================================================================
Standard_Boolean TPrsStd_AISPresentation::HasOwnMaterial() const
{
- return hasOwnMaterial;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->IsHasOwnMaterial();
+
+ return Standard_False;
}
+
//=======================================================================
-//function :UnsetMaterial
+//function : UnsetMaterial
//purpose :
//=======================================================================
void TPrsStd_AISPresentation::UnsetMaterial()
{
- // OCC2932 correction
- if(hasOwnMaterial == Standard_False && !myAIS.IsNull()) {
- if(!myAIS->HasMaterial())
- return;
- }
-
- Backup();
- hasOwnMaterial = Standard_False;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() && myAIS->HasMaterial() ) {
- Handle(AIS_InteractiveContext) ctx;
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) ) ctx = viewer->GetInteractiveContext();
- if( !ctx.IsNull() )
- ctx->UnsetMaterial(myAIS, Standard_False);
- else
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( !FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return;
+
+ if ( !aPresentation->IsHasOwnMaterial() )
+ if( !myAIS.IsNull() && !myAIS->HasMaterial() )
+ return;
+
+ aPresentation->UnsetMaterial();
+
+ if ( myAIS.IsNull() )
+ AISUpdate();
+
+ if ( !myAIS.IsNull() && myAIS->HasMaterial() )
+ {
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ if ( !aContext.IsNull() )
+ aContext->UnsetMaterial(myAIS, Standard_False);
+ else
myAIS->UnsetMaterial();
}
}
+
//=======================================================================
-//function :SetMaterial
+//function : SetMaterial
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::SetMaterial(const Graphic3d_NameOfMaterial aName)
+void TPrsStd_AISPresentation::SetMaterial(const Graphic3d_NameOfMaterial theName)
{
- // OCC2932 correction
- if(myMaterial == aName && hasOwnMaterial == Standard_True && !myAIS.IsNull()) {
- if(myAIS->HasMaterial() && myAIS->Material() == aName)
- return;
- }
+ const Standard_Integer aName = static_cast<Standard_Integer>(theName);
- Backup();
- myMaterial = aName;
- hasOwnMaterial = Standard_True;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() ) {
- if( myAIS->HasMaterial() && myAIS->Material() == aName ) return; // AIS has already had that material
- Handle(AIS_InteractiveContext) ctx;
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) ) ctx = viewer->GetInteractiveContext();
- if( !ctx.IsNull() )
- ctx->SetMaterial(myAIS, aName, Standard_False);
- else
- myAIS->SetMaterial(aName);
+ Handle(TDataXtd_Presentation) aPresentation = getData();
+
+ if ( aPresentation->IsHasOwnMode() && aPresentation->Material() == aName )
+ if ( !myAIS.IsNull() && myAIS->HasMaterial() && myAIS->Material() == theName )
+ return;
+
+ aPresentation->SetMaterial(aName);
+
+ if ( myAIS.IsNull() )
+ AISUpdate();
+
+ if ( !myAIS.IsNull() )
+ {
+ if ( myAIS->HasMaterial() && myAIS->Material() == theName )
+ return; // AIS has already had that material
+
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ if ( !aContext.IsNull() )
+ aContext->SetMaterial(myAIS, theName, Standard_False);
+ else
+ myAIS->SetMaterial(theName);
}
}
//=======================================================================
-//function :SetTransparency
+//function :Transparency
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::SetTransparency(const Standard_Real aValue)
+Standard_Real TPrsStd_AISPresentation::Transparency() const
{
- // OCC2932 correction
- if(hasOwnTransparency == Standard_True && myTransparency == aValue && !myAIS.IsNull())
- if(myAIS->Transparency() == aValue)
- return;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->Transparency();
- Backup();
- myTransparency = aValue;
- hasOwnTransparency = Standard_True;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() ) {
- if( myAIS->Transparency() == aValue ) return; // AIS has already had that transparency
- Handle(AIS_InteractiveContext) ctx;
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) ) ctx = viewer->GetInteractiveContext();
- if( !ctx.IsNull() )
- ctx->SetTransparency(myAIS, aValue, Standard_False);
- else
- myAIS->SetTransparency(aValue);
- }
+ return 0.0;
}
//=======================================================================
-//function :Transparency
+//function :SetTransparency
//purpose :
//=======================================================================
-Standard_Real TPrsStd_AISPresentation::Transparency() const
+void TPrsStd_AISPresentation::SetTransparency(const Standard_Real theValue)
{
- return myTransparency;
+ Handle(TDataXtd_Presentation) aPresentation = getData();
+
+ if( aPresentation->IsHasOwnTransparency() && aPresentation->Transparency() == theValue )
+ if ( !myAIS.IsNull() && myAIS->Transparency() == theValue )
+ return;
+
+ aPresentation->SetTransparency(theValue);
+
+ if ( myAIS.IsNull() )
+ AISUpdate();
+
+ if ( !myAIS.IsNull() )
+ {
+ if ( myAIS->Transparency() == theValue )
+ return; // AIS has already had that transparency
+
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ if ( !aContext.IsNull() )
+ aContext->SetTransparency(myAIS, theValue, Standard_False);
+ else
+ myAIS->SetTransparency(theValue);
+ }
}
+
//=======================================================================
//function :UnsetTransparency
//purpose :
//=======================================================================
void TPrsStd_AISPresentation::UnsetTransparency()
{
- // OCC2932 correction
- if(!hasOwnTransparency)
- return;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ {
+ if ( !aPresentation->IsHasOwnTransparency() )
+ return;
- Backup();
- hasOwnTransparency = Standard_False;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() ) {
- Handle(AIS_InteractiveContext) ctx;
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) ) ctx = viewer->GetInteractiveContext();
- if( !ctx.IsNull() )
- ctx->UnsetTransparency(myAIS, Standard_False);
- else
+ aPresentation->UnsetTransparency();
+ }
+
+ if ( myAIS.IsNull() )
+ AISUpdate();
+
+ if ( !myAIS.IsNull() )
+ {
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ if( !aContext.IsNull() )
+ aContext->UnsetTransparency(myAIS, Standard_False);
+ else
myAIS->UnsetTransparency();
}
}
+
//=======================================================================
-//function :HasTransparency
+//function : HasTransparency
//purpose :
//=======================================================================
Standard_Boolean TPrsStd_AISPresentation::HasOwnTransparency() const
{
- return hasOwnTransparency;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->IsHasOwnTransparency();
+
+ return Standard_False;
}
+
//=======================================================================
-//function :Color
+//function : Color
//purpose :
//=======================================================================
Quantity_NameOfColor TPrsStd_AISPresentation::Color() const
{
- return myColor;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return static_cast<Quantity_NameOfColor>(aPresentation->Color());
+
+ return Quantity_NOC_WHITE;
}
//=======================================================================
-//function :HasColor
+//function : HasOwnColor
//purpose :
//=======================================================================
Standard_Boolean TPrsStd_AISPresentation::HasOwnColor() const
{
- return hasOwnColor;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->IsHasOwnColor();
+
+ return Standard_False;
}
+
//=======================================================================
-//function :UnsetColor
+//function : UnsetColor
//purpose :
//=======================================================================
void TPrsStd_AISPresentation::UnsetColor()
{
- // OCC2932 correction
- if(!hasOwnColor && !myAIS.IsNull())
- if(!myAIS->HasColor())
- return;
-
- Backup();
- hasOwnColor = Standard_False;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() && myAIS->HasColor() ) {
- Handle(AIS_InteractiveContext) ctx;
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) ) ctx = viewer->GetInteractiveContext();
- if( !ctx.IsNull() )
- ctx->UnsetColor(myAIS, Standard_False);
- else
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ {
+ if ( aPresentation->IsHasOwnColor() )
+ if ( !myAIS.IsNull() && !myAIS->HasColor() )
+ return;
+
+ aPresentation->UnsetColor();
+ }
+
+ if ( myAIS.IsNull() )
+ AISUpdate();
+
+ if ( !myAIS.IsNull() && myAIS->HasColor() )
+ {
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ if ( !aContext.IsNull() )
+ aContext->UnsetColor(myAIS, Standard_False);
+ else
myAIS->UnsetColor();
}
}
+
//=======================================================================
-//function :SetColor
+//function : SetColor
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::SetColor(const Quantity_NameOfColor aColor)
+void TPrsStd_AISPresentation::SetColor(const Quantity_NameOfColor theColor)
{
- // OCC2932 correction
- if(hasOwnColor && myColor == aColor && ! myAIS.IsNull())
- if(myAIS->HasColor() && myAIS->Color() == aColor )
+ Handle(TDataXtd_Presentation) aPresentation = getData();
+
+ const Standard_Integer aColor = static_cast<Standard_Integer>(theColor);
+ if ( aPresentation->IsHasOwnColor() && aPresentation->Color() == aColor )
+ if ( !myAIS.IsNull() && myAIS->HasColor() && myAIS->Color() == theColor )
return;
-
- Backup();
- myColor = aColor;
- hasOwnColor = Standard_True;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() ) {
- if( myAIS->HasColor() && myAIS->Color() == aColor ) return; // AIS has already had that color
- Handle(AIS_InteractiveContext) ctx;
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) ) ctx = viewer->GetInteractiveContext();
- if( !ctx.IsNull() )
- ctx->SetColor(myAIS, aColor, Standard_False);
+
+ aPresentation->SetColor(aColor);
+
+ if ( myAIS.IsNull() )
+ AISUpdate();
+
+ if ( !myAIS.IsNull() )
+ {
+ if ( myAIS->HasColor() && myAIS->Color() == theColor )
+ return; // AIS has already had that color
+
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ if( !aContext.IsNull() )
+ aContext->SetColor(myAIS, theColor, Standard_False);
else
- myAIS->SetColor(aColor);
+ myAIS->SetColor(theColor);
}
}
//=======================================================================
Standard_Real TPrsStd_AISPresentation::Width() const
{
- return myWidth;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->Width();
+
+ return 0.0;
}
+
//=======================================================================
-//function :HasWidth
+//function : HasWidth
//purpose :
//=======================================================================
Standard_Boolean TPrsStd_AISPresentation::HasOwnWidth() const
{
- return hasOwnWidth;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->IsHasOwnWidth();
+
+ return Standard_False;
}
+
//=======================================================================
-//function :SetWidth
+//function : SetWidth
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::SetWidth(const Standard_Real aWidth)
+void TPrsStd_AISPresentation::SetWidth(const Standard_Real theWidth)
{
- // OCC2932 correction
- if(hasOwnWidth && myWidth == aWidth && myAIS.IsNull())
- if(myAIS->HasWidth() && myAIS->Width() == aWidth )
+ Handle(TDataXtd_Presentation) aPresentation = getData();
+
+ if ( aPresentation->IsHasOwnWidth() && aPresentation->Width() == theWidth )
+ if ( !myAIS.IsNull() && myAIS->HasWidth() && myAIS->Width() == theWidth )
return;
- Backup();
- myWidth = aWidth;
- hasOwnWidth = Standard_True;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() ) {
- if( myAIS->HasWidth() && myAIS->Width() == aWidth ) return; // AIS has already had that width
- Handle(AIS_InteractiveContext) ctx;
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) ) ctx = viewer->GetInteractiveContext();
- if( !ctx.IsNull() )
- ctx->SetWidth(myAIS, aWidth, Standard_False);
+ aPresentation->SetWidth(theWidth);
+
+ if( !myAIS.IsNull() )
+ {
+ if ( myAIS->HasWidth() && myAIS->Width() == theWidth )
+ return; // AIS has already had that width
+
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ if( !aContext.IsNull() )
+ aContext->SetWidth(myAIS, theWidth, Standard_False);
else
- myAIS->SetWidth(aWidth);
+ myAIS->SetWidth(theWidth);
}
}
+
//=======================================================================
-//function :UnsetWidth
+//function : UnsetWidth
//purpose :
//=======================================================================
void TPrsStd_AISPresentation::UnsetWidth()
{
- // OCC2932 correction
- if(!hasOwnWidth && !myAIS.IsNull())
- if(!myAIS->HasWidth())
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( !FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ {
+ // create new
+ return;
+ }
+
+ if ( !aPresentation->IsHasOwnWidth() )
+ if ( !myAIS.IsNull() && !myAIS->HasWidth() )
return;
- Backup();
- hasOwnWidth = Standard_False;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() && myAIS->HasWidth() ) {
- Handle(AIS_InteractiveContext) ctx;
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) ) ctx = viewer->GetInteractiveContext();
- if( !ctx.IsNull() )
- ctx->UnsetWidth(myAIS, Standard_False);
- else
+ aPresentation->UnsetWidth();
+
+ if( myAIS.IsNull() )
+ AISUpdate();
+
+ if ( !myAIS.IsNull() && myAIS->HasWidth() )
+ {
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ if ( !aContext.IsNull() )
+ aContext->UnsetWidth(myAIS, Standard_False);
+ else
myAIS->UnsetWidth();
}
}
-
//=======================================================================
//function : Mode
//purpose :
//=======================================================================
-
Standard_Integer TPrsStd_AISPresentation::Mode() const
{
- return myMode;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->Mode();
+
+ return 0;
}
+
//=======================================================================
-//function :HasOwnMode
+//function : HasOwnMode
//purpose :
//=======================================================================
Standard_Boolean TPrsStd_AISPresentation::HasOwnMode() const
{
- return hasOwnMode;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->IsHasOwnMode();
+
+ return Standard_False;
}
+
//=======================================================================
-//function :SetMode
+//function : SetMode
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::SetMode(const Standard_Integer theMode)
+void TPrsStd_AISPresentation::SetMode(const Standard_Integer theMode)
{
- // OCC2932 correction
- if(hasOwnMode && myMode == theMode && !myAIS.IsNull())
- if(myAIS->DisplayMode() == theMode )
+ Handle(TDataXtd_Presentation) aPresentation = getData();
+
+ if ( aPresentation->IsHasOwnMode() && aPresentation->Mode() == theMode )
+ if ( !myAIS.IsNull() && myAIS->DisplayMode() == theMode )
return;
- Backup();
- myMode = theMode;
- hasOwnMode = Standard_True;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() ) {
- if( myAIS->DisplayMode() == theMode ) return; // AIS has already had that mode
- Handle(AIS_InteractiveContext) ctx;
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) )
- ctx = viewer->GetInteractiveContext();
- if( !ctx.IsNull() )
- ctx->SetDisplayMode(myAIS, theMode, Standard_False);
+ aPresentation->SetMode(theMode);
+
+ if ( myAIS.IsNull() )
+ AISUpdate();
+
+ if ( !myAIS.IsNull() )
+ {
+ if ( myAIS->DisplayMode() == theMode )
+ return; // AIS has already had that mode
+
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ if( !aContext.IsNull() )
+ aContext->SetDisplayMode(myAIS, theMode, Standard_False);
else
myAIS->SetDisplayMode(theMode);
}
}
+
//=======================================================================
-//function :UnsetMode
+//function : UnsetMode
//purpose :
//=======================================================================
void TPrsStd_AISPresentation::UnsetMode()
{
- // OCC2932 correction
- if(HasOwnMode() == Standard_False && myAIS.IsNull() == Standard_False)
- if(!myAIS->HasDisplayMode())
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( !FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return;
+
+ if ( !aPresentation->IsHasOwnMode() )
+ if ( !myAIS.IsNull() && !myAIS->HasDisplayMode() )
return;
- Backup();
- hasOwnMode = Standard_False;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() && myAIS->HasDisplayMode() ) {
- Handle(AIS_InteractiveContext) ctx;
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) )
- ctx = viewer->GetInteractiveContext();
- if( !ctx.IsNull() )
- ctx->UnsetDisplayMode(myAIS, Standard_False);
- else
- myAIS->UnsetDisplayMode();
+ aPresentation->UnsetMode();
+
+ if ( myAIS.IsNull() )
+ AISUpdate();
+
+ if( !myAIS.IsNull() && myAIS->HasDisplayMode() )
+ {
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ if ( !aContext.IsNull() )
+ aContext->UnsetDisplayMode(myAIS, Standard_False);
+ else
+ myAIS->UnsetDisplayMode();
}
}
+
//=======================================================================
//function : SelectionMode
//purpose :
//=======================================================================
-
Standard_Integer TPrsStd_AISPresentation::SelectionMode() const
{
- return mySelectionMode;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->SelectionMode();
+
+ return 0;
}
+
//=======================================================================
-//function :HasOwnSelectionMode
+//function : HasOwnSelectionMode
//purpose :
//=======================================================================
Standard_Boolean TPrsStd_AISPresentation::HasOwnSelectionMode() const
{
- return hasOwnSelectionMode;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ return aPresentation->IsHasOwnSelectionMode();
+
+ return Standard_False;
}
+
//=======================================================================
-//function :SetSelectionMode
+//function : SetSelectionMode
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::SetSelectionMode(const Standard_Integer theSelectionMode)
+void TPrsStd_AISPresentation::SetSelectionMode(const Standard_Integer theSelectionMode)
{
- // OCC2932 correction
- if(hasOwnSelectionMode && mySelectionMode == theSelectionMode && !myAIS.IsNull())
- if(myAIS->SelectionMode() == theSelectionMode )
+ Handle(TDataXtd_Presentation) aPresentation = getData();
+
+ if ( aPresentation->IsHasOwnSelectionMode() &&
+ aPresentation->SelectionMode() == theSelectionMode )
+ {
+ if ( !myAIS.IsNull() && myAIS->SelectionMode() == theSelectionMode )
+ return;
+ }
+
+ aPresentation->SetSelectionMode(theSelectionMode);
+
+ if ( myAIS.IsNull() )
+ AISUpdate();
+
+ if ( !myAIS.IsNull() )
+ {
+ if ( myAIS->SelectionMode() == theSelectionMode )
return;
- Backup();
- mySelectionMode = theSelectionMode;
- hasOwnSelectionMode = Standard_True;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() ) {
- if( myAIS->SelectionMode() == theSelectionMode ) return;
myAIS->SetSelectionMode(theSelectionMode);
}
}
+
//=======================================================================
-//function :UnsetSelectionMode
+//function : UnsetSelectionMode
//purpose :
//=======================================================================
void TPrsStd_AISPresentation::UnsetSelectionMode()
{
- if(!hasOwnSelectionMode && !myAIS.IsNull())
- if(!myAIS->HasSelectionMode())
- return;
+ Handle(TDataXtd_Presentation) aPresentation;
+ if ( FindAttribute(TDataXtd_Presentation::GetID(), aPresentation) )
+ {
- Backup();
- hasOwnSelectionMode = Standard_False;
- if( myAIS.IsNull() ) AISUpdate();
- if( !myAIS.IsNull() && myAIS->HasSelectionMode() ) {
- myAIS->UnsetSelectionMode();
+ if ( !aPresentation->IsHasOwnSelectionMode() )
+ if ( !myAIS.IsNull() && !myAIS->HasSelectionMode() )
+ return;
+
+ aPresentation->UnsetSelectionMode();
}
+
+ if ( myAIS.IsNull() )
+ AISUpdate();
+
+ if ( !myAIS.IsNull() && myAIS->HasSelectionMode() )
+ myAIS->UnsetSelectionMode();
}
+
//=======================================================================
//function : ID
//purpose :
//=======================================================================
-const Standard_GUID& TPrsStd_AISPresentation::ID() const { return GetID(); }
+const Standard_GUID& TPrsStd_AISPresentation::ID() const
+{
+ return GetID();
+}
//=======================================================================
//=======================================================================
Handle(TDF_Attribute) TPrsStd_AISPresentation::BackupCopy() const
{
- Handle(TPrsStd_AISPresentation) copy = new TPrsStd_AISPresentation;
- copy->myTransparency = myTransparency;
- copy->myColor = myColor;
- copy->myMode= myMode;
- copy->myWidth= myWidth;
- copy->myMaterial = myMaterial;
- copy->hasOwnColor = hasOwnColor;
- copy->hasOwnMaterial = hasOwnMaterial;
- copy->hasOwnWidth = hasOwnWidth;
- copy->hasOwnMode=hasOwnMode;
- copy->hasOwnTransparency = hasOwnTransparency;
- copy->myAIS.Nullify();
- copy->isDisplayed = isDisplayed;
- copy->myDriverGUID = myDriverGUID;
- copy->mySelectionMode= mySelectionMode;
- copy->hasOwnSelectionMode = hasOwnSelectionMode;
- return copy;
+ return new TPrsStd_AISPresentation;
}
//=======================================================================
Handle(TDF_Attribute) TPrsStd_AISPresentation::NewEmpty() const
{
- return new TPrsStd_AISPresentation ();
+ return new TPrsStd_AISPresentation();
}
+
//=======================================================================
-//function : Restore
+//function : Paste
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::Restore (const Handle(TDF_Attribute)& With)
-{
- Handle(TPrsStd_AISPresentation) with = Handle(TPrsStd_AISPresentation)::DownCast(With);
+void TPrsStd_AISPresentation::Restore(const Handle(TDF_Attribute)& theWith)
+{
+ Handle(TPrsStd_AISPresentation) aWith =
+ Handle(TPrsStd_AISPresentation)::DownCast(theWith);
myAIS.Nullify();
-
- if(!with->HasOwnMaterial()) hasOwnMaterial = Standard_False;
- else {
- hasOwnMaterial = Standard_True;
- }
- myMaterial = with->Material();
-
- if(!with->HasOwnColor()) hasOwnColor = Standard_False;
- else {
- hasOwnColor = Standard_True;
- }
- myColor = with->Color();
-
- if(!with->HasOwnWidth()) hasOwnWidth = Standard_False;
- else {
- hasOwnWidth = Standard_True;
- }
- myWidth = with->Width();
-
- if(!with->HasOwnMode()) hasOwnMode = Standard_False;
- else {
- hasOwnMode = Standard_True;
- }
- myMode = with->Mode();
-
- if(!with->HasOwnSelectionMode()) hasOwnSelectionMode = Standard_False;
- else {
- hasOwnSelectionMode = Standard_True;
- }
- mySelectionMode = with->SelectionMode();
-
- if(!with->HasOwnTransparency()) hasOwnTransparency = Standard_False;
- else {
- hasOwnTransparency = Standard_True;
- }
- myTransparency = with->Transparency();
-
- isDisplayed = with->IsDisplayed();
- myDriverGUID = with->GetDriverGUID();
+ myDriverGUID = aWith->GetDriverGUID();
}
+
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::Paste (const Handle(TDF_Attribute)& Into,
- const Handle(TDF_RelocationTable)& ) const
-{
- Handle(TPrsStd_AISPresentation) into = Handle(TPrsStd_AISPresentation)::DownCast(Into);
-
- into->Backup();
-
- if(!hasOwnMaterial) into->hasOwnMaterial = Standard_False;
- else {
- into->myMaterial = myMaterial;
- into->hasOwnMaterial = Standard_True;
- }
-
- if(!hasOwnColor) into->hasOwnColor = Standard_False;
- else {
- into->myColor = myColor;
- into->hasOwnColor = Standard_True;
- }
-
- if(!hasOwnWidth) into->hasOwnWidth = Standard_False;
- else {
- into->myWidth = myWidth;
- into->hasOwnWidth = Standard_True;
- }
- if(!hasOwnMode) into->hasOwnMode = Standard_False;
- else {
- into->myMode = myMode;
- into->hasOwnMode = Standard_True;
- }
-
- if(!hasOwnSelectionMode) into->hasOwnSelectionMode = Standard_False;
- else {
- into->mySelectionMode = mySelectionMode;
- into->hasOwnSelectionMode = Standard_True;
- }
-
- if(!hasOwnTransparency) into->hasOwnTransparency = Standard_False;
- else {
- into->myTransparency = myTransparency;
- into->hasOwnTransparency = Standard_True;
- }
-
- if (into->isDisplayed)
- into->AISErase(Standard_True);
-
- into->isDisplayed = isDisplayed;
- into->myDriverGUID = myDriverGUID;
+void TPrsStd_AISPresentation::Paste (const Handle(TDF_Attribute)& theInto,
+ const Handle(TDF_RelocationTable)& ) const
+{
+ Handle(TPrsStd_AISPresentation) anInto =
+ Handle(TPrsStd_AISPresentation)::DownCast(theInto);
- into->myAIS.Nullify();
+ anInto->Backup();
+ anInto->myAIS.Nullify();
}
+
//=======================================================================
//function : AfterAddition
//purpose : erase if displayed
//=======================================================================
void TPrsStd_AISPresentation::AfterAddition()
-{
+{
AfterResume();
}
+
//=======================================================================
//function : BeforeRemoval
//purpose : erase if displayed
//=======================================================================
void TPrsStd_AISPresentation::BeforeRemoval()
-{
- BeforeForget();
+{
+ BeforeForget();
}
+
//=======================================================================
//function : BeforeForget
//purpose : erase if displayed
//=======================================================================
void TPrsStd_AISPresentation::BeforeForget()
{
- if( !myAIS.IsNull() ) {
- AISErase(Standard_True); //Remove AISObject from context
+ if ( !myAIS.IsNull() )
+ { // Remove AISObject from context.
+ AISErase(Standard_True);
myAIS.Nullify();
}
}
//function : AfterResume
//purpose : display if displayed
//=======================================================================
-void TPrsStd_AISPresentation::AfterResume()
+void TPrsStd_AISPresentation::AfterResume()
{
AISUpdate();
- if( IsDisplayed() ) AISDisplay();
- else AISErase();
+
+ if ( IsDisplayed() )
+ AISDisplay();
+ else
+ AISErase();
}
+
//=======================================================================
//function : BeforeUndo
//purpose : le NamedShape associe doit etre present
//=======================================================================
-
Standard_Boolean TPrsStd_AISPresentation::BeforeUndo (const Handle(TDF_AttributeDelta)& AD,
- const Standard_Boolean )
+ const Standard_Boolean )
{
Handle(TPrsStd_AISPresentation) P;
- AD->Label().FindAttribute(TPrsStd_AISPresentation::GetID(), P);
+ AD->Label().FindAttribute(TPrsStd_AISPresentation::GetID(), P);
- if (AD->IsKind(STANDARD_TYPE(TDF_DeltaOnAddition))) {
- if( !P.IsNull() ) P->BeforeForget();
+ if (AD->IsKind(STANDARD_TYPE(TDF_DeltaOnAddition)))
+ {
+ if ( !P.IsNull() )
+ P->BeforeForget();
}
else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnRemoval))) {
- }
- else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnModification))) {
- if( !P.IsNull() ) P->BeforeForget();
- }
+ }
+ else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnModification)))
+ {
+ if ( !P.IsNull() )
+ P->BeforeForget();
+ }
return Standard_True;
}
//function : AfterUndo
//purpose : le NamedShape associe doit etre present
//=======================================================================
-
Standard_Boolean TPrsStd_AISPresentation::AfterUndo (const Handle(TDF_AttributeDelta)& AD,
- const Standard_Boolean )
+ const Standard_Boolean )
{
Handle(TPrsStd_AISPresentation) P;
AD->Label().FindAttribute(TPrsStd_AISPresentation::GetID(), P);
- if (AD->IsKind(STANDARD_TYPE(TDF_DeltaOnAddition))) {
+ if (AD->IsKind(STANDARD_TYPE(TDF_DeltaOnAddition)))
+ {}
+ else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnRemoval)))
+ {
+ if ( !P.IsNull() )
+ P->AfterAddition();
}
- else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnRemoval))) {
- if( !P.IsNull() ) P->AfterAddition();
- }
- else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnModification))) {
- if( !P.IsNull() ) P->AfterResume();
+ else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnModification)))
+ {
+ if ( !P.IsNull() )
+ P->AfterResume();
}
return Standard_True;
}
-
//=======================================================================
//function : AISUpdate
//purpose :
//=======================================================================
-
-void TPrsStd_AISPresentation::AISUpdate ()
-{
+void TPrsStd_AISPresentation::AISUpdate()
+{
Backup();
- Handle(AIS_InteractiveContext) ctx;
- if(!Label().IsNull()) {
- Handle(TPrsStd_AISViewer) viewer;
- if( TPrsStd_AISViewer::Find(Label(), viewer) ) ctx = viewer->GetInteractiveContext();
-
- Handle(TPrsStd_Driver) driver;
- if (TPrsStd_DriverTable::Get()->FindDriver(GetDriverGUID(), driver)) {
- if (myAIS.IsNull()) { // build a new AIS
- Handle(AIS_InteractiveObject) newais;
- if (driver->Update (Label(), newais)) {
- myAIS = newais;
- newais->SetOwner(this);
- }
+ Handle(AIS_InteractiveContext) aContext;
+ if ( !Label().IsNull() )
+ {
+ aContext = getAISContext();
+
+ Handle(TPrsStd_Driver) aDriver;
+ if ( TPrsStd_DriverTable::Get()->FindDriver(GetDriverGUID(), aDriver) )
+ {
+ // Build a new AIS.
+ if ( myAIS.IsNull() )
+ {
+ Handle(AIS_InteractiveObject) aNewObj;
+ if ( aDriver->Update(Label(), aNewObj) )
+ {
+ myAIS = aNewObj;
+ aNewObj->SetOwner(this);
+ }
}
- else {
- Handle(AIS_InteractiveObject) theais = myAIS;
- if (driver->Update (Label(), theais)) {
- if (! (theais == myAIS)) {
- if(!ctx.IsNull()) ctx->Remove(myAIS);
- myAIS = theais; //Driver has built new AIS
- theais->SetOwner(this);
- }
- }
+ else
+ {
+ Handle(AIS_InteractiveObject) anObj = myAIS;
+ if ( aDriver->Update(Label(), anObj) )
+ if ( !(anObj == myAIS) )
+ {
+ if ( !aContext.IsNull() )
+ aContext->Remove(myAIS);
+
+ // Driver has built new AIS.
+ myAIS = anObj;
+ anObj->SetOwner(this);
+ }
}
}
}
else return;
-//Apply the visualization settings
- if( !myAIS.IsNull() ) {
-
- if( hasOwnColor ) {
- if( !(myAIS->HasColor()) || (myAIS->HasColor() && myAIS->Color() != myColor) ) {
- if(!ctx.IsNull()) ctx->SetColor(myAIS, myColor, Standard_False);
- else myAIS->SetColor(myColor);
- }
- }
+ // Apply the visualization settings.
+ if ( !myAIS.IsNull() )
+ {
+ if ( HasOwnColor() )
+ {
+ Quantity_NameOfColor aColor = Color();
+ if ( !(myAIS->HasColor()) || (myAIS->HasColor() && myAIS->Color() != aColor) )
+ if ( !aContext.IsNull() )
+ aContext->SetColor(myAIS, aColor, Standard_False);
+ else
+ myAIS->SetColor(aColor);
+ }
- if( hasOwnMaterial ) {
- if( !(myAIS->HasMaterial()) || (myAIS->HasMaterial() && myAIS->Material() != myMaterial) ) {
- if(!ctx.IsNull()) ctx->SetMaterial(myAIS, myMaterial, Standard_False );
- else myAIS->SetMaterial(myMaterial);
- }
- }
-
- if( hasOwnTransparency ) {
- if( myAIS->Transparency() != myTransparency ) {
- if(!ctx.IsNull()) ctx->SetTransparency(myAIS, myTransparency, Standard_False);
- else myAIS->SetTransparency(myTransparency);
- }
+ if ( HasOwnMaterial() )
+ {
+ Graphic3d_NameOfMaterial aMaterial = Material();
+ if ( !(myAIS->HasMaterial()) || (myAIS->HasMaterial() && myAIS->Material() != aMaterial) )
+ if ( !aContext.IsNull() )
+ aContext->SetMaterial(myAIS, aMaterial, Standard_False );
+ else
+ myAIS->SetMaterial(aMaterial);
}
- if( hasOwnWidth ) {
- if( !(myAIS->HasWidth()) || (myAIS->HasWidth() && myAIS->Width() != myWidth) ) {
- if(!ctx.IsNull()) ctx->SetWidth(myAIS, myWidth, Standard_False);
- else myAIS->SetWidth(myWidth);
- }
+ if ( HasOwnTransparency() )
+ {
+ const Standard_Real aTransparency = Transparency();
+ if ( myAIS->Transparency() != aTransparency )
+ if( !aContext.IsNull() )
+ aContext->SetTransparency(myAIS, aTransparency, Standard_False);
+ else
+ myAIS->SetTransparency(aTransparency);
}
- if( hasOwnMode) {
- if( myAIS->DisplayMode() != myMode ) {
- myAIS->SetDisplayMode(myMode);
- }
-
-
+ if ( HasOwnWidth() )
+ {
+ const Standard_Real aWidth = Width();
+ if ( !(myAIS->HasWidth()) || (myAIS->HasWidth() && myAIS->Width() != aWidth) )
+ if ( !aContext.IsNull() )
+ aContext->SetWidth(myAIS, aWidth, Standard_False);
+ else
+ myAIS->SetWidth(aWidth);
}
- if (hasOwnSelectionMode) {
- if (myAIS->SelectionMode() != mySelectionMode ) {
- myAIS->SetSelectionMode(mySelectionMode);
- }
+ if ( HasOwnMode() )
+ {
+ const Standard_Integer aMode = Mode();
+ if ( myAIS->DisplayMode() != aMode )
+ myAIS->SetDisplayMode(aMode);
}
+ if ( HasOwnSelectionMode() )
+ {
+ const Standard_Integer aMode = SelectionMode();
+ if (myAIS->SelectionMode() != aMode )
+ myAIS->SetSelectionMode(aMode);
+ }
}
-
- if( isDisplayed && !ctx.IsNull() ) ctx->Redisplay(myAIS, Standard_False);
-
+
+ if ( !aContext.IsNull() && IsDisplayed() )
+ aContext->Redisplay(myAIS, Standard_False);
+
return;
}
//function : AISDisplay
//purpose :
//=======================================================================
+void TPrsStd_AISPresentation::AISDisplay()
+{
+ if ( !Label().IsNull() )
+ {
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
-void TPrsStd_AISPresentation::AISDisplay ()
-{
-
- if (!Label().IsNull()) {
- Handle(TPrsStd_AISViewer) viewer;
- if( !TPrsStd_AISViewer::Find(Label(), viewer) ) return;
- Handle(AIS_InteractiveContext) ctx = viewer->GetInteractiveContext();
- if( ctx.IsNull() ) return;
-
- if (!myAIS.IsNull()) {
-
- if( !(myAIS->GetContext()).IsNull() && (myAIS->GetContext()) != ctx ) myAIS->GetContext()->Remove(myAIS);
-
- if( isDisplayed && ctx->IsDisplayed(myAIS) ) return;
-
- ctx->Display(myAIS, Standard_False);
-
- if( ctx->IsDisplayed(myAIS) ) SetDisplayed(Standard_True);
+ if ( aContext.IsNull() )
+ return;
+
+ if ( !myAIS.IsNull() )
+ {
+ if ( !(myAIS->GetContext()).IsNull() && (myAIS->GetContext()) != aContext )
+ myAIS->GetContext()->Remove(myAIS);
+
+ if ( IsDisplayed() && aContext->IsDisplayed(myAIS) )
+ return;
+
+ aContext->Display(myAIS, Standard_False);
+
+ if ( aContext->IsDisplayed(myAIS) )
+ SetDisplayed(Standard_True);
}
}
}
//function : AISErase
//purpose :
//=======================================================================
+void TPrsStd_AISPresentation::AISErase(const Standard_Boolean theIsRemove)
+{
+ SetDisplayed(Standard_False);
+ Handle(AIS_InteractiveContext) aContext, anOwnContext;
-void TPrsStd_AISPresentation::AISErase (const Standard_Boolean remove)
-{
- SetDisplayed(Standard_False);
- Handle(AIS_InteractiveContext) ctx, ownctx;
-
- if ( !myAIS.IsNull() ) {
-
- if ( !Label().IsNull()) {
+ if ( !myAIS.IsNull() )
+ {
+ if ( !Label().IsNull() )
+ {
Handle(TPrsStd_AISViewer) viewer;
- if( !TPrsStd_AISViewer::Find(Label(), viewer) ) return;
- ownctx = myAIS->GetContext();
- ctx = viewer->GetInteractiveContext();
- if( remove ) {
- if( !ctx.IsNull() ) ctx->Remove (myAIS,Standard_False);
- if( !ownctx.IsNull() && ownctx != ctx ) ownctx->Remove (myAIS,Standard_False);
+ if( !TPrsStd_AISViewer::Find(Label(), viewer) )
+ return;
+ anOwnContext = myAIS->GetContext();
+ aContext = viewer->GetInteractiveContext();
+
+ if ( theIsRemove )
+ {
+ if ( !aContext.IsNull() )
+ aContext->Remove(myAIS, Standard_False);
+ if ( !anOwnContext.IsNull() && anOwnContext != aContext )
+ anOwnContext->Remove(myAIS, Standard_False);
+
myAIS->SetToUpdate();
}
- else {
- if( !ctx.IsNull() ) ctx->Erase (myAIS,Standard_False);
- if( !ownctx.IsNull() && ownctx != ctx ) ownctx->Erase (myAIS,Standard_False);
+ else
+ {
+ if ( !aContext.IsNull() )
+ aContext->Erase(myAIS, Standard_False);
+ if ( !anOwnContext.IsNull() && anOwnContext != aContext )
+ anOwnContext->Erase(myAIS, Standard_False);
}
}
- else {
- if( remove ) {
- if( !ownctx.IsNull() ) {
- ownctx->Remove (myAIS,Standard_False);
- myAIS->SetToUpdate();
+ else
+ {
+ if ( theIsRemove )
+ {
+ if ( !anOwnContext.IsNull() )
+ {
+ anOwnContext->Remove(myAIS, Standard_False);
+ myAIS->SetToUpdate();
+ }
}
- } else
- if( !ownctx.IsNull() ) ownctx->Erase (myAIS,Standard_False);
+ else
+ if( !anOwnContext.IsNull() )
+ anOwnContext->Erase(myAIS, Standard_False);
}
}
}
//=======================================================================
-//function :SetDisplayed
+//function : getAISContext
//purpose :
//=======================================================================
-void TPrsStd_AISPresentation::SetDisplayed(const Standard_Boolean B)
+Handle(AIS_InteractiveContext) TPrsStd_AISPresentation::getAISContext() const
{
- Backup();
- isDisplayed = B;
+ Handle(TPrsStd_AISViewer) aViewer;
+ if ( TPrsStd_AISViewer::Find(Label(), aViewer) )
+ return aViewer->GetInteractiveContext();
+
+ return Handle_AIS_InteractiveContext();
}
+
+//=======================================================================
+//function : getData
+//purpose :
+//=======================================================================
+Handle(TDataXtd_Presentation) TPrsStd_AISPresentation::getData() const
+{
+ return TDataXtd_Presentation::Set(this);
+}
//=======================================================================
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)) {
//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)) {
//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));
}
//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)) {
//=======================================================================
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)) {
void TPrsStd_AISViewer::Update () const
{
- myInteractiveContext->UpdateCurrentViewer();
+ myInteractiveContext->UpdateCurrentViewer();
}
-
+
//=======================================================================
//function : SetInteractiveContext
//purpose :
//=======================================================================
void TPrsStd_AISViewer::Paste (const Handle(TDF_Attribute)&,
- const Handle(TDF_RelocationTable)&) const
+ const Handle(TDF_RelocationTable)&) const
{
}
#include <XmlMDataXtd.hxx>
#include <XmlMDocStd.hxx>
#include <XmlMNaming.hxx>
-#include <XmlMPrsStd.hxx>
#include <XmlMFunction.hxx>
#include <Standard_GUID.hxx>
XmlMNaming ::AddDrivers (aTable, theMessageDriver);
XmlMFunction ::AddDrivers (aTable, theMessageDriver);
XmlMDocStd ::AddDrivers (aTable, theMessageDriver);
- XmlMPrsStd ::AddDrivers (aTable, theMessageDriver);
//
return aTable;
}
class PlacementDriver;
class PatternStdDriver;
+
+ class PresentationDriver;
+
+ class PositionDriver;
AddDrivers (aDriverTable : ADriverTable from XmlMDF;
#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;
//=======================================================================
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));
}
//=======================================================================
--- /dev/null
+-- Created on: 2001-09-04
+-- 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.
+
+class PositionDriver from XmlMDataXtd inherits ADriver from XmlMDF
+
+ ---Purpose: Attribute Driver.
+
+uses
+ SRelocationTable from XmlObjMgt,
+ RRelocationTable from XmlObjMgt,
+ Persistent from XmlObjMgt,
+ MessageDriver from CDM,
+ Attribute from TDF
+
+is
+ Create (theMessageDriver:MessageDriver from CDM)
+ returns PositionDriver from XmlMDataXtd;
+
+ NewEmpty (me) returns Attribute from TDF;
+
+ Paste(me; Source : Persistent from XmlObjMgt;
+ Target : Attribute from TDF;
+ RelocTable : out RRelocationTable from XmlObjMgt)
+ returns Boolean from Standard;
+
+ Paste(me; Source : Attribute from TDF;
+ Target : in out Persistent from XmlObjMgt;
+ RelocTable : out SRelocationTable from XmlObjMgt);
+
+end PositionDriver;
--- /dev/null
+// Created on: 2001-09-04
+// 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 <XmlMDataXtd_PositionDriver.ixx>
+
+#include <XmlObjMgt.hxx>
+#include <TDataXtd_Position.hxx>
+#include <gp_XYZ.hxx>
+
+#include <stdio.h>
+
+//=======================================================================
+//function : XmlMDataXtd_PositionDriver
+//purpose : Constructor
+//=======================================================================
+XmlMDataXtd_PositionDriver::XmlMDataXtd_PositionDriver
+ (const Handle(CDM_MessageDriver)& theMsgDriver)
+: XmlMDF_ADriver (theMsgDriver, NULL)
+{}
+
+//=======================================================================
+//function : NewEmpty
+//purpose :
+//=======================================================================
+Handle(TDF_Attribute) XmlMDataXtd_PositionDriver::NewEmpty() const
+{
+ return (new TDataXtd_Position());
+}
+
+//=======================================================================
+//function : Paste
+//purpose : persistent -> transient (retrieve)
+//=======================================================================
+Standard_Boolean XmlMDataXtd_PositionDriver::Paste
+ (const XmlObjMgt_Persistent& theSource,
+ const Handle(TDF_Attribute)& theTarget,
+ XmlObjMgt_RRelocationTable& ) const
+{
+ Handle(TDataXtd_Position) aTPos = Handle(TDataXtd_Position)::DownCast(theTarget);
+
+ // position
+ XmlObjMgt_DOMString aPosStr = XmlObjMgt::GetStringValue(theSource.Element());
+ if (aPosStr == NULL)
+ {
+ WriteMessage ("Cannot retrieve position string from element");
+ return Standard_False;
+ }
+
+ gp_Pnt aPos;
+ Standard_Real aValue;
+ Standard_CString aValueStr = Standard_CString(aPosStr.GetString());
+
+ // X
+ if (!XmlObjMgt::GetReal(aValueStr, aValue))
+ {
+ TCollection_ExtendedString aMessageString =
+ TCollection_ExtendedString
+ ("Cannot retrieve X coordinate for TDataXtd_Position attribute as \"")
+ + aValueStr + "\"";
+ WriteMessage (aMessageString);
+ return Standard_False;
+ }
+ aPos.SetX(aValue);
+
+ // Y
+ if (!XmlObjMgt::GetReal(aValueStr, aValue))
+ {
+ TCollection_ExtendedString aMessageString =
+ TCollection_ExtendedString
+ ("Cannot retrieve Y coordinate for TDataXtd_Position attribute as \"")
+ + aValueStr + "\"";
+ WriteMessage (aMessageString);
+ return Standard_False;
+ }
+ aPos.SetY(aValue);
+
+ // Z
+ if (!XmlObjMgt::GetReal(aValueStr, aValue))
+ {
+ TCollection_ExtendedString aMessageString =
+ TCollection_ExtendedString
+ ("Cannot retrieve Z coordinate for TDataXtd_Position attribute as \"")
+ + aValueStr + "\"";
+ WriteMessage (aMessageString);
+ return Standard_False;
+ }
+ aPos.SetZ(aValue);
+
+ aTPos->SetPosition(aPos);
+
+ return Standard_True;
+}
+
+//=======================================================================
+//function : Paste
+//purpose : transient -> persistent (store)
+//=======================================================================
+void XmlMDataXtd_PositionDriver::Paste
+ (const Handle(TDF_Attribute)& theSource,
+ XmlObjMgt_Persistent& theTarget,
+ XmlObjMgt_SRelocationTable& ) const
+{
+ Handle(TDataXtd_Position) aTPos = Handle(TDataXtd_Position)::DownCast(theSource);
+ if (!aTPos.IsNull())
+ {
+ gp_Pnt aPos = aTPos->GetPosition();
+ char buf [64];
+ Sprintf (buf, "%.17g %.17g %.17g", aPos.X(), aPos.Y(), aPos.Z());
+ XmlObjMgt::SetStringValue(theTarget.Element(), buf);
+ }
+}
--- /dev/null
+-- Created on: 2001-09-04
+-- 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.
+
+class PresentationDriver from XmlMDataXtd inherits ADriver from XmlMDF
+
+ ---Purpose: Attribute Driver.
+
+uses
+ SRelocationTable from XmlObjMgt,
+ RRelocationTable from XmlObjMgt,
+ Persistent from XmlObjMgt,
+ MessageDriver from CDM,
+ Attribute from TDF
+
+is
+ Create (theMessageDriver:MessageDriver from CDM)
+ returns PresentationDriver from XmlMDataXtd;
+
+ NewEmpty (me) returns Attribute from TDF;
+
+ Paste(me; Source : Persistent from XmlObjMgt;
+ Target : Attribute from TDF;
+ RelocTable : out RRelocationTable from XmlObjMgt)
+ returns Boolean from Standard;
+
+ Paste(me; Source : Attribute from TDF;
+ Target : in out Persistent from XmlObjMgt;
+ RelocTable : out SRelocationTable from XmlObjMgt);
+
+end PresentationDriver;
--- /dev/null
+// Created on: 2001-09-04
+// 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 <XmlMDataXtd_PresentationDriver.ixx>
+
+#include <XmlObjMgt.hxx>
+
+#include <TDataXtd_Presentation.hxx>
+
+IMPLEMENT_DOMSTRING (GuidString, "guid")
+IMPLEMENT_DOMSTRING (IsDisplayedString, "isdisplayed")
+IMPLEMENT_DOMSTRING (ColorString, "color")
+IMPLEMENT_DOMSTRING (MaterialString, "material")
+IMPLEMENT_DOMSTRING (TransparencyString,"transparency")
+IMPLEMENT_DOMSTRING (WidthString, "width")
+IMPLEMENT_DOMSTRING (ModeString, "mode")
+
+IMPLEMENT_DOMSTRING (DisplayedString, "true")
+
+//=======================================================================
+//function : XmlMDataXtd_PresentationDriver
+//purpose : Constructor
+//=======================================================================
+XmlMDataXtd_PresentationDriver::XmlMDataXtd_PresentationDriver
+ (const Handle(CDM_MessageDriver)& theMsgDriver)
+ : XmlMDF_ADriver (theMsgDriver, NULL)
+{}
+
+//=======================================================================
+//function : NewEmpty
+//purpose :
+//=======================================================================
+Handle(TDF_Attribute) XmlMDataXtd_PresentationDriver::NewEmpty() const
+{
+ return (new TDataXtd_Presentation());
+}
+
+//=======================================================================
+//function : Paste
+//purpose : persistent -> transient (retrieve)
+//=======================================================================
+Standard_Boolean XmlMDataXtd_PresentationDriver::Paste
+ (const XmlObjMgt_Persistent& theSource,
+ const Handle(TDF_Attribute)& theTarget,
+ XmlObjMgt_RRelocationTable& ) const
+{
+ TCollection_ExtendedString aMessageString;
+ XmlObjMgt_DOMString aDOMStr;
+
+ Handle(TDataXtd_Presentation) aTPrs =
+ Handle(TDataXtd_Presentation)::DownCast(theTarget);
+ const XmlObjMgt_Element& anElem = theSource;
+
+ //convert attribute value into GUID
+ aDOMStr = anElem.getAttribute(::GuidString());
+ if (aDOMStr == NULL)
+ {
+ WriteMessage("Cannot retrieve guid string from attribute");
+ return Standard_False;
+ }
+ Standard_CString aGuidStr = (Standard_CString) aDOMStr.GetString();
+ aTPrs->SetDriverGUID(aGuidStr);
+
+ // is displayed
+ aDOMStr = anElem.getAttribute(::IsDisplayedString());
+ aTPrs->SetDisplayed(aDOMStr != NULL);
+
+ Standard_Integer anIValue;
+
+ // color
+ aDOMStr = anElem.getAttribute(::ColorString());
+ if (aDOMStr != NULL)
+ {
+ if (!aDOMStr.GetInteger(anIValue))
+ {
+ aMessageString = TCollection_ExtendedString
+ ("Cannot retrieve Integer value from \"") + aDOMStr + "\"";
+ WriteMessage (aMessageString);
+ return Standard_False;
+ }
+ aTPrs->SetColor(anIValue);
+ }
+ else
+ {
+ aTPrs->UnsetColor();
+ }
+
+ // material
+ aDOMStr = anElem.getAttribute(::MaterialString());
+ if (aDOMStr != NULL)
+ {
+ if (!aDOMStr.GetInteger(anIValue))
+ {
+ aMessageString = TCollection_ExtendedString
+ ("Cannot retrieve Integer value from \"") + aDOMStr + "\"";
+ WriteMessage (aMessageString);
+ return Standard_False;
+ }
+ aTPrs->SetMaterial(anIValue);
+ }
+ else
+ {
+ aTPrs->UnsetMaterial();
+ }
+
+ Standard_Real aValue;
+
+ // transparency
+ aDOMStr = anElem.getAttribute(::TransparencyString());
+ if (aDOMStr != NULL)
+ {
+ if (!XmlObjMgt::GetReal(aDOMStr, aValue))
+ {
+ aMessageString = TCollection_ExtendedString
+ ("Cannot retrieve Real value from \"") + aDOMStr + "\"";
+ WriteMessage (aMessageString);
+ return Standard_False;
+ }
+ aTPrs->SetTransparency(aValue);
+ }
+ else
+ {
+ aTPrs->UnsetTransparency();
+ }
+
+ // width
+ aDOMStr = anElem.getAttribute(::WidthString());
+ if (aDOMStr != NULL)
+ {
+ if (!XmlObjMgt::GetReal(aDOMStr, aValue))
+ {
+ aMessageString = TCollection_ExtendedString
+ ("Cannot retrieve Real value from \"") + aDOMStr + "\"";
+ WriteMessage (aMessageString);
+ return Standard_False;
+ }
+ aTPrs->SetWidth(aValue);
+ }
+ else
+ {
+ aTPrs->UnsetWidth();
+ }
+
+ // mode
+ aDOMStr = anElem.getAttribute(::ModeString());
+ if (aDOMStr != NULL)
+ {
+ if (!aDOMStr.GetInteger(anIValue))
+ {
+ aMessageString = TCollection_ExtendedString
+ ("Cannot retrieve Integer value from \"") + aDOMStr + "\"";
+ WriteMessage (aMessageString);
+ return Standard_False;
+ }
+ aTPrs->SetMode(anIValue);
+ }
+ else
+ {
+ aTPrs->UnsetMode();
+ }
+
+ return Standard_True;
+}
+
+//=======================================================================
+//function : Paste
+//purpose : transient -> persistent (store)
+//=======================================================================
+void XmlMDataXtd_PresentationDriver::Paste
+ (const Handle(TDF_Attribute)& theSource,
+ XmlObjMgt_Persistent& theTarget,
+ XmlObjMgt_SRelocationTable&) const
+{
+ Handle(TDataXtd_Presentation) aTPrs =
+ Handle(TDataXtd_Presentation)::DownCast(theSource);
+ if (aTPrs.IsNull()) return;
+
+ //convert GUID into attribute value
+ Standard_Character aGuidStr [40];
+ Standard_PCharacter pGuidStr;
+ pGuidStr=aGuidStr;
+ aTPrs->GetDriverGUID().ToCString (pGuidStr);
+ theTarget.Element().setAttribute(::GuidString(), aGuidStr);
+
+ // is displayed
+ if (aTPrs->IsDisplayed())
+ theTarget.Element().setAttribute(::IsDisplayedString(), ::DisplayedString());
+
+ Standard_Integer aNb;
+
+ // color
+ if (aTPrs->IsHasOwnColor())
+ {
+ aNb = aTPrs->Color();
+ theTarget.Element().setAttribute(::ColorString(), aNb);
+ }
+
+ // material
+ if (aTPrs->IsHasOwnMaterial())
+ {
+ aNb = (Standard_Integer)(aTPrs->Material());
+ theTarget.Element().setAttribute(::MaterialString(), aNb);
+ }
+
+ // transparency
+ if (aTPrs->IsHasOwnTransparency())
+ {
+ TCollection_AsciiString aRNbStr (aTPrs->Transparency());
+ theTarget.Element().setAttribute(::TransparencyString(), aRNbStr.ToCString());
+ }
+
+ // width
+ if (aTPrs->IsHasOwnWidth())
+ {
+ TCollection_AsciiString aRNbStr (aTPrs->Width());
+ theTarget.Element().setAttribute(::WidthString(), aRNbStr.ToCString());
+ }
+
+#ifdef OCC6010
+ // mode
+ if (aTPrs->IsHasOwnMode())
+ {
+ aNb = aTPrs->Mode();
+ theTarget.Element().setAttribute(::ModeString(), aNb);
+ }
+#endif
+}
+++ /dev/null
--- 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;
+++ /dev/null
-// 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));
-}
+++ /dev/null
--- Created on: 2001-09-04
--- 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.
-
-class AISPresentationDriver from XmlMPrsStd inherits ADriver from XmlMDF
-
- ---Purpose: Attribute Driver.
-
-uses
- SRelocationTable from XmlObjMgt,
- RRelocationTable from XmlObjMgt,
- Persistent from XmlObjMgt,
- MessageDriver from CDM,
- Attribute from TDF
-
-is
- Create (theMessageDriver:MessageDriver from CDM)
- returns AISPresentationDriver from XmlMPrsStd;
-
- NewEmpty (me) returns Attribute from TDF;
-
- Paste(me; Source : Persistent from XmlObjMgt;
- Target : Attribute from TDF;
- RelocTable : out RRelocationTable from XmlObjMgt)
- returns Boolean from Standard;
-
- Paste(me; Source : Attribute from TDF;
- Target : in out Persistent from XmlObjMgt;
- RelocTable : out SRelocationTable from XmlObjMgt);
-
-end AISPresentationDriver;
+++ /dev/null
-// Created on: 2001-09-04
-// 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_AISPresentationDriver.ixx>
-
-#include <XmlObjMgt.hxx>
-
-#include <TPrsStd_AISPresentation.hxx>
-
-IMPLEMENT_DOMSTRING (GuidString, "guid")
-IMPLEMENT_DOMSTRING (IsDisplayedString, "isdisplayed")
-IMPLEMENT_DOMSTRING (ColorString, "color")
-IMPLEMENT_DOMSTRING (MaterialString, "material")
-IMPLEMENT_DOMSTRING (TransparencyString,"transparency")
-IMPLEMENT_DOMSTRING (WidthString, "width")
-IMPLEMENT_DOMSTRING (ModeString, "mode")
-
-IMPLEMENT_DOMSTRING (DisplayedString, "true")
-
-//=======================================================================
-//function : XmlMPrsStd_AISPresentationDriver
-//purpose : Constructor
-//=======================================================================
-XmlMPrsStd_AISPresentationDriver::XmlMPrsStd_AISPresentationDriver
- (const Handle(CDM_MessageDriver)& theMsgDriver)
- : XmlMDF_ADriver (theMsgDriver, NULL)
-{}
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-Handle(TDF_Attribute) XmlMPrsStd_AISPresentationDriver::NewEmpty() const
-{
- return (new TPrsStd_AISPresentation());
-}
-
-//=======================================================================
-//function : Paste
-//purpose : persistent -> transient (retrieve)
-//=======================================================================
-Standard_Boolean XmlMPrsStd_AISPresentationDriver::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);
- const XmlObjMgt_Element& anElem = theSource;
-
- //convert attribute value into GUID
- aDOMStr = anElem.getAttribute(::GuidString());
- if (aDOMStr == NULL)
- {
- WriteMessage("Cannot retrieve guid string from attribute");
- return Standard_False;
- }
- Standard_CString aGuidStr = (Standard_CString) aDOMStr.GetString();
- aTPrs->SetDriverGUID(aGuidStr);
-
- // is displayed
- aDOMStr = anElem.getAttribute(::IsDisplayedString());
- aTPrs->SetDisplayed(aDOMStr != NULL);
-
- Standard_Integer anIValue;
-
- // color
- aDOMStr = anElem.getAttribute(::ColorString());
- if (aDOMStr != NULL)
- {
- if (!aDOMStr.GetInteger(anIValue))
- {
- aMessageString = TCollection_ExtendedString
- ("Cannot retrieve Integer value from \"") + aDOMStr + "\"";
- WriteMessage (aMessageString);
- return Standard_False;
- }
- aTPrs->SetColor((Quantity_NameOfColor)anIValue);
- }
- else
- {
- aTPrs->UnsetColor();
- }
-
- // material
- aDOMStr = anElem.getAttribute(::MaterialString());
- if (aDOMStr != NULL)
- {
- if (!aDOMStr.GetInteger(anIValue))
- {
- aMessageString = TCollection_ExtendedString
- ("Cannot retrieve Integer value from \"") + aDOMStr + "\"";
- WriteMessage (aMessageString);
- return Standard_False;
- }
- aTPrs->SetMaterial((Graphic3d_NameOfMaterial)anIValue);
- }
- else
- {
- aTPrs->UnsetMaterial();
- }
-
- Standard_Real aValue;
-
- // transparency
- aDOMStr = anElem.getAttribute(::TransparencyString());
- if (aDOMStr != NULL)
- {
- if (!XmlObjMgt::GetReal(aDOMStr, aValue))
- {
- aMessageString = TCollection_ExtendedString
- ("Cannot retrieve Real value from \"") + aDOMStr + "\"";
- WriteMessage (aMessageString);
- return Standard_False;
- }
- aTPrs->SetTransparency(aValue);
- }
- else
- {
- aTPrs->UnsetTransparency();
- }
-
- // width
- aDOMStr = anElem.getAttribute(::WidthString());
- if (aDOMStr != NULL)
- {
- if (!XmlObjMgt::GetReal(aDOMStr, aValue))
- {
- aMessageString = TCollection_ExtendedString
- ("Cannot retrieve Real value from \"") + aDOMStr + "\"";
- WriteMessage (aMessageString);
- return Standard_False;
- }
- aTPrs->SetWidth(aValue);
- }
- else
- {
- aTPrs->UnsetWidth();
- }
-
- // mode
- aDOMStr = anElem.getAttribute(::ModeString());
- if (aDOMStr != NULL)
- {
- if (!aDOMStr.GetInteger(anIValue))
- {
- aMessageString = TCollection_ExtendedString
- ("Cannot retrieve Integer value from \"") + aDOMStr + "\"";
- WriteMessage (aMessageString);
- return Standard_False;
- }
- aTPrs->SetMode(anIValue);
- }
- else
- {
- aTPrs->UnsetMode();
- }
-
- return Standard_True;
-}
-
-//=======================================================================
-//function : Paste
-//purpose : transient -> persistent (store)
-//=======================================================================
-void XmlMPrsStd_AISPresentationDriver::Paste
- (const Handle(TDF_Attribute)& theSource,
- XmlObjMgt_Persistent& theTarget,
- XmlObjMgt_SRelocationTable& ) const
-{
- Handle(TPrsStd_AISPresentation) aTPrs =
- Handle(TPrsStd_AISPresentation)::DownCast(theSource);
- if (aTPrs.IsNull()) return;
-
- //convert GUID into attribute value
- Standard_Character aGuidStr [40];
- Standard_PCharacter pGuidStr;
- pGuidStr=aGuidStr;
- aTPrs->GetDriverGUID().ToCString (pGuidStr);
- theTarget.Element().setAttribute(::GuidString(), aGuidStr);
-
- // is displayed
- if (aTPrs->IsDisplayed())
- theTarget.Element().setAttribute(::IsDisplayedString(), ::DisplayedString());
-
- Standard_Integer aNb;
-
- // color
- if (aTPrs->HasOwnColor())
- {
- aNb = (Standard_Integer)(aTPrs->Color());
- theTarget.Element().setAttribute(::ColorString(), aNb);
- }
-
- // material
- if (aTPrs->HasOwnMaterial())
- {
- aNb = (Standard_Integer)(aTPrs->Material());
- theTarget.Element().setAttribute(::MaterialString(), aNb);
- }
-
- // transparency
- if (aTPrs->HasOwnTransparency())
- {
- TCollection_AsciiString aRNbStr (aTPrs->Transparency());
- theTarget.Element().setAttribute(::TransparencyString(), aRNbStr.ToCString());
- }
-
- // width
- if (aTPrs->HasOwnWidth())
- {
- TCollection_AsciiString aRNbStr (aTPrs->Width());
- theTarget.Element().setAttribute(::WidthString(), aRNbStr.ToCString());
- }
-
-#ifdef OCC6010
- // mode
- if (aTPrs->HasOwnMode())
- {
- aNb = aTPrs->Mode();
- theTarget.Element().setAttribute(::ModeString(), aNb);
- }
-#endif
-}
+++ /dev/null
--- Created on: 2001-09-04
--- 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.
-
-class PositionDriver from XmlMPrsStd inherits ADriver from XmlMDF
-
- ---Purpose: Attribute Driver.
-
-uses
- SRelocationTable from XmlObjMgt,
- RRelocationTable from XmlObjMgt,
- Persistent from XmlObjMgt,
- MessageDriver from CDM,
- Attribute from TDF
-
-is
- Create (theMessageDriver:MessageDriver from CDM)
- returns PositionDriver from XmlMPrsStd;
-
- NewEmpty (me) returns Attribute from TDF;
-
- Paste(me; Source : Persistent from XmlObjMgt;
- Target : Attribute from TDF;
- RelocTable : out RRelocationTable from XmlObjMgt)
- returns Boolean from Standard;
-
- Paste(me; Source : Attribute from TDF;
- Target : in out Persistent from XmlObjMgt;
- RelocTable : out SRelocationTable from XmlObjMgt);
-
-end PositionDriver;
+++ /dev/null
-// Created on: 2001-09-04
-// 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_PositionDriver.ixx>
-
-#include <XmlObjMgt.hxx>
-#include <TDataXtd_Position.hxx>
-#include <gp_XYZ.hxx>
-
-#include <stdio.h>
-
-//=======================================================================
-//function : XmlMPrsStd_PositionDriver
-//purpose : Constructor
-//=======================================================================
-XmlMPrsStd_PositionDriver::XmlMPrsStd_PositionDriver
- (const Handle(CDM_MessageDriver)& theMsgDriver)
- : XmlMDF_ADriver (theMsgDriver, NULL)
-{}
-
-//=======================================================================
-//function : NewEmpty
-//purpose :
-//=======================================================================
-Handle(TDF_Attribute) XmlMPrsStd_PositionDriver::NewEmpty() const
-{
- return (new TDataXtd_Position());
-}
-
-//=======================================================================
-//function : Paste
-//purpose : persistent -> transient (retrieve)
-//=======================================================================
-Standard_Boolean XmlMPrsStd_PositionDriver::Paste
- (const XmlObjMgt_Persistent& theSource,
- const Handle(TDF_Attribute)& theTarget,
- XmlObjMgt_RRelocationTable& ) const
-{
- Handle(TDataXtd_Position) aTPos = Handle(TDataXtd_Position)::DownCast(theTarget);
-
- // position
- XmlObjMgt_DOMString aPosStr = XmlObjMgt::GetStringValue(theSource.Element());
- if (aPosStr == NULL)
- {
- WriteMessage ("Cannot retrieve position string from element");
- return Standard_False;
- }
-
- gp_Pnt aPos;
- Standard_Real aValue;
- Standard_CString aValueStr = Standard_CString(aPosStr.GetString());
-
- // X
- if (!XmlObjMgt::GetReal(aValueStr, aValue))
- {
- TCollection_ExtendedString aMessageString =
- TCollection_ExtendedString
- ("Cannot retrieve X coordinate for TDataXtd_Position attribute as \"")
- + aValueStr + "\"";
- WriteMessage (aMessageString);
- return Standard_False;
- }
- aPos.SetX(aValue);
-
- // Y
- if (!XmlObjMgt::GetReal(aValueStr, aValue))
- {
- TCollection_ExtendedString aMessageString =
- TCollection_ExtendedString
- ("Cannot retrieve Y coordinate for TDataXtd_Position attribute as \"")
- + aValueStr + "\"";
- WriteMessage (aMessageString);
- return Standard_False;
- }
- aPos.SetY(aValue);
-
- // Z
- if (!XmlObjMgt::GetReal(aValueStr, aValue))
- {
- TCollection_ExtendedString aMessageString =
- TCollection_ExtendedString
- ("Cannot retrieve Z coordinate for TDataXtd_Position attribute as \"")
- + aValueStr + "\"";
- WriteMessage (aMessageString);
- return Standard_False;
- }
- aPos.SetZ(aValue);
-
- aTPos->SetPosition(aPos);
-
- return Standard_True;
-}
-
-//=======================================================================
-//function : Paste
-//purpose : transient -> persistent (store)
-//=======================================================================
-void XmlMPrsStd_PositionDriver::Paste
- (const Handle(TDF_Attribute)& theSource,
- XmlObjMgt_Persistent& theTarget,
- XmlObjMgt_SRelocationTable& ) const
-{
- Handle(TDataXtd_Position) aTPos = Handle(TDataXtd_Position)::DownCast(theSource);
- if (!aTPos.IsNull())
- {
- gp_Pnt aPos = aTPos->GetPosition();
- char buf [64];
- Sprintf (buf, "%.17g %.17g %.17g", aPos.X(), aPos.Y(), aPos.Z());
- XmlObjMgt::SetStringValue(theTarget.Element(), buf);
- }
-}