Aurelon Open API 8.1.1
Loading...
Searching...
No Matches
AOI_Style.cpp
1#include "./AOI_Document.h"
2#include "../GStyle.h"
3#include "../Shading.h"
4#include "../GSymbol.h"
5
6using namespace aur;
7using namespace aur::PDF;
8
101uint32_t AOI_Style::GetType() const
102{
103 switch( StylePtr(this)->ResourceType() )
104 {
105 case Solid::eResourceType :
106 return AOI_Style_Color::Type;
107 break;
108
109 case PatternSpace::eResourceType :
110 return AOI_Style_Pattern::Type;
111 break;
112
113 case AxialShading::eResourceType :
114 return AOI_Style_Axial::Type;
115 break;
116
117 case RadialShading::eResourceType :
118 return AOI_Style_Radial::Type;
119 break;
120
121 case FunctionShading::eResourceType :
122 return AOI_Style_FunctionShading::Type;
123 break;
124
125 case CoonePatchShading::eResourceType :
126 return AOI_Style_CoonePatch::Type;
127 break;
128 }
129 return 'NONE';
130}
131
137{
138 StylePtr(this)->Dispose();
139}
140
149AOI_Style_ColorPtr AOI_Style_Color::Create( AOI_Document* document, const AOI_Color& color )
150{
151 return (AOI_Style_ColorPtr)new Solid( document->mDocument, (const Color&)color );
152}
153
160void AOI_Style_Color::GetColor( AOI_Color& color ) const
161{
162 // hard cast
163 SolidPtr(this)->GetColor( (Color&)color );
164}
165
172AOI_ColorSpace* AOI_Style_Color::GetSpace() const
173{
174 return (AOI_ColorSpace*)SolidPtr(this)->GetSpace();
175}
176
186void AOI_Style_Color::GetDescriptor( char* name ) const
187{
188 ::strcpy( name, SolidPtr(this)->GetDescriptor().ToUTF8() );
189}
190
197{
198 ShadingSpacePtr(this)->GetBounds( (FRectangle&)bounds );
199}
200
206AOI_ColorSpace* AOI_Style_Shading::GetColorSpace() const
207{
208 return (AOI_ColorSpace*)ShadingSpacePtr(this)->GetColorSpace();
209}
210
217{
218 return (AOI_Mapping&)ShadingSpacePtr(this)->GetMapping();
219}
220
227{
228 return (AOI_Function**)FunctionShadingPtr(this)->GetFunctions();
229}
230
231/*void AOI_Style_FunctionShading::Open( Renderer* ren ) const
232{
233 ShadingSpacePtr(this)->Open( ren );
234}
235
236void AOI_Style_FunctionShading::Close() const
237{
238 ShadingSpacePtr(this)->Close();
239}
240
241bool AOI_Style_FunctionShading::GetColor( int32_t x, int32_t y, ChannelColor& cc ) const
242{
243 return ShadingSpacePtr(this)->GetColor( x, y, cc );
244}*/
245
253{
254 AxialShadingPtr(this)->GetPoints( (PDF::Point&)p1, (PDF::Point&)p2 );
255}
256
266void AOI_Style_Axial::GetExtends( bool& e1, bool& e2 ) const
267{
268 AxialShadingPtr(this)->GetExtends( e1, e2 );
269}
270
278{
279 return AxialShadingPtr(this)->GetFunctionCount();
280}
281
290{
291 return (AOI_Function**)AxialShadingPtr(this)->GetFunctions( i );
292}
293
294/*CArray<float>* AOI_Style_Axial::GetBalances( ) const
295{
296}*/
297
305void AOI_Style_Radial::GetCircleStart( AOI_Point& outCenter, float& outRadius ) const
306{
307 RadialShadingPtr(this)->GetCircleStart( (PDF::Point&)outCenter, outRadius );
308}
309
317void AOI_Style_Radial::GetCircleEnd( AOI_Point& outCenter, float& outRadius ) const
318{
319 RadialShadingPtr(this)->GetCircleEnd( (PDF::Point&)outCenter, outRadius );
320}
321
329{
330 return RadialShadingPtr(this)->GetFunctionCount();
331}
332
341{
342 return (AOI_Function**)RadialShadingPtr(this)->GetFunctions( i );
343}
344
351{
352 return (AOI_Object*)PatternSpacePtr(this)->GetTile()->GetObject();
353}
354
362{
363 return (AOI_Point&)PatternSpacePtr(this)->GetDeltas();
364}
365
372{
373 return (AOI_Mapping&)PatternSpacePtr(this)->GetMapping();
374}
375
382{
383 return !CoonePatchShadingPtr(this)->mPatches.empty();
384}
385
391const AOI_Style_CoonePatch::AOI_Patch& AOI_Style_CoonePatch::GetPatch( uint32_t index ) const
392{
393 return reinterpret_cast<const AOI_Patch&>( CoonePatchShadingPtr(this)->mPatches[ index ] );
394}
395
401const AOI_Style_CoonePatch::AOI_Side& AOI_Style_CoonePatch::GetSide( uint32_t index ) const
402{
403 return reinterpret_cast<const AOI_Side&>( CoonePatchShadingPtr(this)->mSides[ index ] );
404}
405
411const AOI_Style_CoonePatch::AOI_Beziers& AOI_Style_CoonePatch::GetBezier( uint32_t index ) const
412{
413 return reinterpret_cast<const AOI_Beziers&>( CoonePatchShadingPtr(this)->mBeziers[ index ] );
414}
415
421const AOI_Style_CoonePatch::AOI_SE& AOI_Style_CoonePatch::GetPoint( uint32_t index ) const
422{
423 return reinterpret_cast<const AOI_SE&>( CoonePatchShadingPtr(this)->mBeginEndPoints[ index ] );
424}
PDF Document.
Base class for functions.
3x3 matrix
Definition AOI_Types.h:113
Base class for all graphic objects.
Definition AOI_Object.h:13
Coordinate.
Definition AOI_Types.h:137
Rectangle.
Definition AOI_Types.h:148
AOI_Function ** GetFunctions(uint32_t &) const
void GetExtends(bool &, bool &) const
uint32_t GetFunctionCount() const
void GetPoints(AOI_Point &, AOI_Point &) const
Color fill.
Definition AOI_Style.h:56
void GetColor(AOI_Color &) const
static AOI_Style_Color * Create(AOI_Document *document, const AOI_Color &)
AOI_ColorSpace * GetSpace() const
void GetDescriptor(char *name) const
const AOI_Patch & GetPatch(uint32_t index) const
const AOI_Beziers & GetBezier(uint32_t index) const
const AOI_Side & GetSide(uint32_t index) const
const AOI_SE & GetPoint(uint32_t index) const
uint32_t GetPatchCount() const
AOI_Function ** GetFunctions() const
AOI_Object * GetTile() const
const AOI_Mapping & GetMapping() const
AOI_Point GetDeltas() const
AOI_Function ** GetFunctions(uint32_t &) const
void GetCircleEnd(AOI_Point &outCenter, float &outRadius) const
uint32_t GetFunctionCount() const
void GetCircleStart(AOI_Point &outCenter, float &outRadius) const
AOI_ColorSpace * GetColorSpace() const
void GetBounds(AOI_Rectangle &) const
const AOI_Mapping & GetMapping() const
void Dispose()
uint32_t GetType() const