blob: de75c743bd84102073b4edb4019846fc346cfe2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
// File: MPrsStd_AISPresentationRetrievalDriver.cxx
// Created: Thu Jul 8 17:25:26 1999
// Author: Sergey RUIN
#include <MPrsStd_AISPresentationRetrievalDriver_1.ixx>
#include <PPrsStd_AISPresentation_1.hxx>
#include <TPrsStd_AISPresentation.hxx>
#include <AIS_Drawer.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCollection_HExtendedString.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Graphic3d_NameOfMaterial.hxx>
#include <CDM_MessageDriver.hxx>
//=======================================================================
//function : MPrsStd_AISPresentationRetrievalDriver_1
//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 DEB
cout << "AISPresentationRetrievalDriver " << "retrieved DriverGUID ==> ";
guid.ShallowDump(cout);
cout << endl;
#endif
}
|