summaryrefslogtreecommitdiff
path: root/drv/ShapeSchema/ShapeSchema_PGeom_BSplineCurve.cxx
blob: a8bad135f32f853d29bf31bf77bc7f6b2144d472 (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
#ifndef _ShapeSchema_PGeom_BSplineCurve_HeaderFile
#include <ShapeSchema_PGeom_BSplineCurve.hxx>
#endif
#ifndef _PGeom_BSplineCurve_HeaderFile
#include <PGeom_BSplineCurve.hxx>
#endif
#include <ShapeSchema_PGeom_BSplineCurve.ixx>
#ifndef _Storage_Schema_HeaderFile
#include <Storage_Schema.hxx>
#endif
#ifndef _Storage_stCONSTclCOM_HeaderFile
#include <Storage_stCONSTclCOM.hxx>
#endif

IMPLEMENT_STANDARD_HANDLE(ShapeSchema_PGeom_BSplineCurve,Storage_CallBack)
IMPLEMENT_STANDARD_RTTIEXT(ShapeSchema_PGeom_BSplineCurve,Storage_CallBack)

Handle(Standard_Persistent) ShapeSchema_PGeom_BSplineCurve::New() const
{
  return new PGeom_BSplineCurve(Storage_stCONSTclCOM());
}

void ShapeSchema_PGeom_BSplineCurve::SAdd(const Handle(PGeom_BSplineCurve)& p, const Handle(Storage_Schema)& theSchema)
{
  if (!p.IsNull()) {
    if (theSchema->AddPersistent(p,"PGeom_BSplineCurve")) {
         theSchema->PersistentToAdd(p->_CSFDB_GetPGeom_BSplineCurvepoles());
   theSchema->PersistentToAdd(p->_CSFDB_GetPGeom_BSplineCurveweights());
   theSchema->PersistentToAdd(p->_CSFDB_GetPGeom_BSplineCurveknots());
   theSchema->PersistentToAdd(p->_CSFDB_GetPGeom_BSplineCurvemultiplicities());

    }
  }
}

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

void ShapeSchema_PGeom_BSplineCurve::SWrite(const Handle(Standard_Persistent)& p, Storage_BaseDriver& f, const Handle(Storage_Schema)& theSchema)
{ 
  if (!p.IsNull()) {
    Handle(PGeom_BSplineCurve) &pp = (Handle(PGeom_BSplineCurve)&)p;
    theSchema->WritePersistentObjectHeader(p,f);
    
    f.BeginWritePersistentObjectData();
  f.PutBoolean(pp->_CSFDB_GetPGeom_BSplineCurverational());
  f.PutBoolean(pp->_CSFDB_GetPGeom_BSplineCurveperiodic());
  f.PutInteger(pp->_CSFDB_GetPGeom_BSplineCurvespineDegree());
    theSchema->WritePersistentReference(pp->_CSFDB_GetPGeom_BSplineCurvepoles(),f);
    theSchema->WritePersistentReference(pp->_CSFDB_GetPGeom_BSplineCurveweights(),f);
    theSchema->WritePersistentReference(pp->_CSFDB_GetPGeom_BSplineCurveknots(),f);
    theSchema->WritePersistentReference(pp->_CSFDB_GetPGeom_BSplineCurvemultiplicities(),f);

    f.EndWritePersistentObjectData();
  }
}

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


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

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

    Standard_Boolean PGeom_BSplineCurverational;
    f.GetBoolean(PGeom_BSplineCurverational);
    pp->_CSFDB_SetPGeom_BSplineCurverational(PGeom_BSplineCurverational);

    Standard_Boolean PGeom_BSplineCurveperiodic;
    f.GetBoolean(PGeom_BSplineCurveperiodic);
    pp->_CSFDB_SetPGeom_BSplineCurveperiodic(PGeom_BSplineCurveperiodic);

    Standard_Integer PGeom_BSplineCurvespineDegree;
    f.GetInteger(PGeom_BSplineCurvespineDegree);
    pp->_CSFDB_SetPGeom_BSplineCurvespineDegree(PGeom_BSplineCurvespineDegree);

    Handle(PColgp_HArray1OfPnt) PGeom_BSplineCurvepoles;

    theSchema->ReadPersistentReference(PGeom_BSplineCurvepoles,f);
    pp->_CSFDB_SetPGeom_BSplineCurvepoles(PGeom_BSplineCurvepoles);

    Handle(PColStd_HArray1OfReal) PGeom_BSplineCurveweights;

    theSchema->ReadPersistentReference(PGeom_BSplineCurveweights,f);
    pp->_CSFDB_SetPGeom_BSplineCurveweights(PGeom_BSplineCurveweights);

    Handle(PColStd_HArray1OfReal) PGeom_BSplineCurveknots;

    theSchema->ReadPersistentReference(PGeom_BSplineCurveknots,f);
    pp->_CSFDB_SetPGeom_BSplineCurveknots(PGeom_BSplineCurveknots);

    Handle(PColStd_HArray1OfInteger) PGeom_BSplineCurvemultiplicities;

    theSchema->ReadPersistentReference(PGeom_BSplineCurvemultiplicities,f);
    pp->_CSFDB_SetPGeom_BSplineCurvemultiplicities(PGeom_BSplineCurvemultiplicities);

    f.EndReadPersistentObjectData();
  }
}

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

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