summaryrefslogtreecommitdiff
path: root/drv/ShapeSchema/ShapeSchema_PGeom_BSplineSurface.cxx
blob: 774b3b5dad462eac0fcec69895cbd0391abe3fe7 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#ifndef _ShapeSchema_PGeom_BSplineSurface_HeaderFile
#include <ShapeSchema_PGeom_BSplineSurface.hxx>
#endif
#ifndef _PGeom_BSplineSurface_HeaderFile
#include <PGeom_BSplineSurface.hxx>
#endif
#include <ShapeSchema_PGeom_BSplineSurface.ixx>
#ifndef _Storage_Schema_HeaderFile
#include <Storage_Schema.hxx>
#endif
#ifndef _Storage_stCONSTclCOM_HeaderFile
#include <Storage_stCONSTclCOM.hxx>
#endif

IMPLEMENT_STANDARD_HANDLE(ShapeSchema_PGeom_BSplineSurface,Storage_CallBack)
IMPLEMENT_STANDARD_RTTIEXT(ShapeSchema_PGeom_BSplineSurface,Storage_CallBack)

Handle(Standard_Persistent) ShapeSchema_PGeom_BSplineSurface::New() const
{
  return new PGeom_BSplineSurface(Storage_stCONSTclCOM());
}

void ShapeSchema_PGeom_BSplineSurface::SAdd(const Handle(PGeom_BSplineSurface)& p, const Handle(Storage_Schema)& theSchema)
{
  if (!p.IsNull()) {
    if (theSchema->AddPersistent(p,"PGeom_BSplineSurface")) {
         theSchema->PersistentToAdd(p->_CSFDB_GetPGeom_BSplineSurfacepoles());
   theSchema->PersistentToAdd(p->_CSFDB_GetPGeom_BSplineSurfaceweights());
   theSchema->PersistentToAdd(p->_CSFDB_GetPGeom_BSplineSurfaceuKnots());
   theSchema->PersistentToAdd(p->_CSFDB_GetPGeom_BSplineSurfacevKnots());
   theSchema->PersistentToAdd(p->_CSFDB_GetPGeom_BSplineSurfaceuMultiplicities());
   theSchema->PersistentToAdd(p->_CSFDB_GetPGeom_BSplineSurfacevMultiplicities());

    }
  }
}

void ShapeSchema_PGeom_BSplineSurface::Add(const Handle(Standard_Persistent)& p, const Handle(Storage_Schema)& theSchema) const
{
  ShapeSchema_PGeom_BSplineSurface::SAdd((Handle(PGeom_BSplineSurface)&)p,theSchema);
}

void ShapeSchema_PGeom_BSplineSurface::SWrite(const Handle(Standard_Persistent)& p, Storage_BaseDriver& f, const Handle(Storage_Schema)& theSchema)
{ 
  if (!p.IsNull()) {
    Handle(PGeom_BSplineSurface) &pp = (Handle(PGeom_BSplineSurface)&)p;
    theSchema->WritePersistentObjectHeader(p,f);
    
    f.BeginWritePersistentObjectData();
  f.PutBoolean(pp->_CSFDB_GetPGeom_BSplineSurfaceuRational());
  f.PutBoolean(pp->_CSFDB_GetPGeom_BSplineSurfacevRational());
  f.PutBoolean(pp->_CSFDB_GetPGeom_BSplineSurfaceuPeriodic());
  f.PutBoolean(pp->_CSFDB_GetPGeom_BSplineSurfacevPeriodic());
  f.PutInteger(pp->_CSFDB_GetPGeom_BSplineSurfaceuSpineDegree());
  f.PutInteger(pp->_CSFDB_GetPGeom_BSplineSurfacevSpineDegree());
    theSchema->WritePersistentReference(pp->_CSFDB_GetPGeom_BSplineSurfacepoles(),f);
    theSchema->WritePersistentReference(pp->_CSFDB_GetPGeom_BSplineSurfaceweights(),f);
    theSchema->WritePersistentReference(pp->_CSFDB_GetPGeom_BSplineSurfaceuKnots(),f);
    theSchema->WritePersistentReference(pp->_CSFDB_GetPGeom_BSplineSurfacevKnots(),f);
    theSchema->WritePersistentReference(pp->_CSFDB_GetPGeom_BSplineSurfaceuMultiplicities(),f);
    theSchema->WritePersistentReference(pp->_CSFDB_GetPGeom_BSplineSurfacevMultiplicities(),f);

    f.EndWritePersistentObjectData();
  }
}

void ShapeSchema_PGeom_BSplineSurface::Write(const Handle(Standard_Persistent)& p, Storage_BaseDriver& f, const Handle(Storage_Schema)& theSchema) const
{ 
  ShapeSchema_PGeom_BSplineSurface::SWrite(p,f,theSchema);
}


void ShapeSchema_PGeom_BSplineSurface::SRead(const Handle(Standard_Persistent)& p, Storage_BaseDriver& f, const Handle(Storage_Schema)& theSchema)
{ 
  if (!p.IsNull()) {
    Handle(PGeom_BSplineSurface) &pp = (Handle(PGeom_BSplineSurface)&)p;

    theSchema->ReadPersistentObjectHeader(f);
    f.BeginReadPersistentObjectData();

    Standard_Boolean PGeom_BSplineSurfaceuRational;
    f.GetBoolean(PGeom_BSplineSurfaceuRational);
    pp->_CSFDB_SetPGeom_BSplineSurfaceuRational(PGeom_BSplineSurfaceuRational);

    Standard_Boolean PGeom_BSplineSurfacevRational;
    f.GetBoolean(PGeom_BSplineSurfacevRational);
    pp->_CSFDB_SetPGeom_BSplineSurfacevRational(PGeom_BSplineSurfacevRational);

    Standard_Boolean PGeom_BSplineSurfaceuPeriodic;
    f.GetBoolean(PGeom_BSplineSurfaceuPeriodic);
    pp->_CSFDB_SetPGeom_BSplineSurfaceuPeriodic(PGeom_BSplineSurfaceuPeriodic);

    Standard_Boolean PGeom_BSplineSurfacevPeriodic;
    f.GetBoolean(PGeom_BSplineSurfacevPeriodic);
    pp->_CSFDB_SetPGeom_BSplineSurfacevPeriodic(PGeom_BSplineSurfacevPeriodic);

    Standard_Integer PGeom_BSplineSurfaceuSpineDegree;
    f.GetInteger(PGeom_BSplineSurfaceuSpineDegree);
    pp->_CSFDB_SetPGeom_BSplineSurfaceuSpineDegree(PGeom_BSplineSurfaceuSpineDegree);

    Standard_Integer PGeom_BSplineSurfacevSpineDegree;
    f.GetInteger(PGeom_BSplineSurfacevSpineDegree);
    pp->_CSFDB_SetPGeom_BSplineSurfacevSpineDegree(PGeom_BSplineSurfacevSpineDegree);

    Handle(PColgp_HArray2OfPnt) PGeom_BSplineSurfacepoles;

    theSchema->ReadPersistentReference(PGeom_BSplineSurfacepoles,f);
    pp->_CSFDB_SetPGeom_BSplineSurfacepoles(PGeom_BSplineSurfacepoles);

    Handle(PColStd_HArray2OfReal) PGeom_BSplineSurfaceweights;

    theSchema->ReadPersistentReference(PGeom_BSplineSurfaceweights,f);
    pp->_CSFDB_SetPGeom_BSplineSurfaceweights(PGeom_BSplineSurfaceweights);

    Handle(PColStd_HArray1OfReal) PGeom_BSplineSurfaceuKnots;

    theSchema->ReadPersistentReference(PGeom_BSplineSurfaceuKnots,f);
    pp->_CSFDB_SetPGeom_BSplineSurfaceuKnots(PGeom_BSplineSurfaceuKnots);

    Handle(PColStd_HArray1OfReal) PGeom_BSplineSurfacevKnots;

    theSchema->ReadPersistentReference(PGeom_BSplineSurfacevKnots,f);
    pp->_CSFDB_SetPGeom_BSplineSurfacevKnots(PGeom_BSplineSurfacevKnots);

    Handle(PColStd_HArray1OfInteger) PGeom_BSplineSurfaceuMultiplicities;

    theSchema->ReadPersistentReference(PGeom_BSplineSurfaceuMultiplicities,f);
    pp->_CSFDB_SetPGeom_BSplineSurfaceuMultiplicities(PGeom_BSplineSurfaceuMultiplicities);

    Handle(PColStd_HArray1OfInteger) PGeom_BSplineSurfacevMultiplicities;

    theSchema->ReadPersistentReference(PGeom_BSplineSurfacevMultiplicities,f);
    pp->_CSFDB_SetPGeom_BSplineSurfacevMultiplicities(PGeom_BSplineSurfacevMultiplicities);

    f.EndReadPersistentObjectData();
  }
}

void ShapeSchema_PGeom_BSplineSurface::Read(const Handle(Standard_Persistent)& p, Storage_BaseDriver& f, const Handle(Storage_Schema)& theSchema) const

{ 
  ShapeSchema_PGeom_BSplineSurface::SRead(p,f,theSchema);
}