CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiPlotStyleDefs.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef __ODGIPSDEFS_H__
25#define __ODGIPSDEFS_H__
26
27#include "TD_PackPush.h"
28
29#include "GiExport.h"
30#include "UInt8Array.h"
31#include "Gi/GiRasterImage.h"
32#include "Ps/PlotStyles.h"
33#include "Gi/GiLinetype.h"
34#include "HatchPattern.h"
35
42{
43 public:
48 {
49 kPsDefs = 0, // PlotStyle linetype definitions in internal format.
50 kGiDefs = 1, // PlotStyle linetype definitions in Gi format.
51 kGDIDefs = 2, // PlotStyle linetype definitions in Windows GDI-compatible format.
52 kOpenGLDefs = 4 // PlotStyle linetype definitions in OpenGL-compatible format.
53 };
54
59 {
60 int m_numDashes; // Number of dashes in PlotStyle linetype.
61 double m_dashLength[10]; // Lengths of dashes and gaps in PlotStyle linetype.
62
68 double patternLength() const;
69 };
74 {
75 OdUInt32 m_numDashes; // Number of dashes in PlotStyle linetype.
76 OdUInt32 m_dashLength[20]; // Lengths of dashes and gaps in PlotStyle linetype.
77
87 void clean();
88 };
93 {
94 OdUInt16 m_patternLength; // Linetype pattern factor (multiplier).
95 OdUInt16 m_pattern; // 16-bit linetype pattern.
96 };
97 protected:
98 static const PsLinetypeDef g_psLinetypeDefs[OdPs::kLtpLast - 1];
100 PsLinetypeGDI m_gdiLinetypeDef[OdPs::kLtpLast];
101 PsLinetypeOGL m_oglLinetypeDef[OdPs::kLtpLast];
103 volatile bool m_bIsInit[4];
104 public:
110 OdGiPsLinetypes(bool bInitialize = true, OdUInt32 nDefs = kGiDefs | kGDIDefs | kOpenGLDefs);
111
116
123 bool isInitialized(OdUInt32 nDefs = kPsDefs) const;
128 void initialize(OdUInt32 nDefs = kPsDefs);
133 void uninitialize(OdUInt32 nDefs = kPsDefs | kGiDefs | kGDIDefs | kOpenGLDefs);
134
144
158
170 OdUInt8Array rasterizeLinetype(OdPs::LineType psLtp, OdUInt32 numRepititions = 1, OdUInt8 ltpValue = 0xFF) const;
171
183 ODCOLORREF backgroundColor = ODRGB(0, 0, 0),
184 ODCOLORREF foregroundColor = ODRGB(255, 255, 255)) const;
185
199
213 protected:
217 OdGiRasterImagePtr internalMakeImage(const OdUInt8 *pPixels, OdUInt32 nWidth, OdUInt32 numLevels = 1,
218 ODCOLORREF backgroundColor = ODRGB(0, 0, 0),
219 ODCOLORREF foregroundColor = ODRGB(255, 255, 255)) const;
220 private:
221 void internalDebugMe();
222};
223
229
236{
237 public:
241 typedef OdUInt16 PsFillstyleGDI[8];
245 typedef OdUInt8 PsFillstyleOGL[128];
246 protected:
247 inline OdUInt32 fsCorr(OdPs::FillStyle fs) const { return fs - OdPs::kFsSolid; }
248 inline bool fsRigth(OdPs::FillStyle fs) const { return (fs >= OdPs::kFsSolid) && (fs < OdPs::kFsLast); }
249 static const PsFillstyleGDI g_gdiFillstyleDef[OdPs::kFsLast - OdPs::kFsSolid];
250 static const PsFillstyleOGL g_oglFillstyleDef[OdPs::kFsLast - OdPs::kFsSolid];
251 public:
256
261
281
297 OdUInt32 nWidth = 32, OdUInt32 nHeight = 32, OdUInt8 fpValue = 0xFF) const;
298
310 OdUInt32 nWidth = 32, OdUInt32 nHeight = 32,
311 ODCOLORREF backgroundColor = ODRGB(0, 0, 0),
312 ODCOLORREF foregroundColor = ODRGB(255, 255, 255)) const;
313
319 const PsFillstyleGDI *getGDIDefinitions() const;
326 const PsFillstyleGDI &getGDIDefinition(OdPs::FillStyle psFs) const;
327
333 const PsFillstyleOGL *getOpenGLDefinitions() const;
339 const PsFillstyleOGL &getOpenGLDefinition(OdPs::FillStyle psFs) const;
340 protected:
343 ODCOLORREF backgroundColor = ODRGB(0, 0, 0),
344 ODCOLORREF foregroundColor = ODRGB(255, 255, 255)) const;
345 private:
346 void internalDebugMe() const;
347};
348
353
354#include "TD_PackPop.h"
355
356#endif //#ifndef __ODGIPSDEFS_H__
scale
Definition: DimVarDefs.h:1684
#define ODGI_EXPORT
Definition: GiExport.h:35
ODGI_EXPORT OdGiPsLinetypes & odgiGetPsLinetypesManager(OdUInt32 nDefs=OdGiPsLinetypes::kPsDefs)
ODGI_EXPORT OdGiPsFillstyles & odgiGetPsFillstylesManager()
#define ODRGB(r, g, b)
Definition: OdPlatform.h:934
#define ODCOLORREF
Definition: OdPlatform.h:933
unsigned int OdUInt32
unsigned short OdUInt16
unsigned char OdUInt8
bool fsRigth(OdPs::FillStyle fs) const
const PsFillstyleGDI * getGDIDefinitions() const
const OdHatchPattern * getGiDefinitions(OdHatchPattern *pPats, double scale, OdUInt32 nFirst=OdPs::kFsSolid+1, OdUInt32 nPats=OdPs::kFsLast - OdPs::kFsSolid - 1) const
OdGiRasterImagePtr internalMakeImage(const OdUInt8 *pPixels, OdUInt32 nWidth, OdUInt32 nHeight, ODCOLORREF backgroundColor=ODRGB(0, 0, 0), ODCOLORREF foregroundColor=ODRGB(255, 255, 255)) const
OdGiRasterImagePtr rasterizeFillstyleImage(OdPs::FillStyle psFs, OdUInt32 nOffsetX=0, OdUInt32 nOffsetY=0, OdUInt32 nWidth=32, OdUInt32 nHeight=32, ODCOLORREF backgroundColor=ODRGB(0, 0, 0), ODCOLORREF foregroundColor=ODRGB(255, 255, 255)) const
const PsFillstyleGDI & getGDIDefinition(OdPs::FillStyle psFs) const
const PsFillstyleOGL * getOpenGLDefinitions() const
const OdHatchPattern & getGiDefinition(OdPs::FillStyle psFs, OdHatchPattern &pPat, double scale) const
OdUInt8Array rasterizeFillstyle(OdPs::FillStyle psFs, OdUInt32 nOffsetX=0, OdUInt32 nOffsetY=0, OdUInt32 nWidth=32, OdUInt32 nHeight=32, OdUInt8 fpValue=0xFF) const
const PsFillstyleOGL & getOpenGLDefinition(OdPs::FillStyle psFs) const
void internalFillHatchDef(OdPs::FillStyle psFs, OdHatchPattern &pPat, double scale) const
OdUInt32 fsCorr(OdPs::FillStyle fs) const
void internalInitOpenGLLinetypes()
const PsLinetypeDef * getPsDefinitions() const
const OdArray< OdGiLinetype > & getGiDefinitions() const
const PsLinetypeGDI & getGDIDefinition(OdPs::LineType psLtp) const
OdUInt8Array rasterizeLinetype(OdPs::LineType psLtp, OdUInt32 numRepititions=1, OdUInt8 ltpValue=0xFF) const
const PsLinetypeOGL * getOpenGLDefinitions() const
const PsLinetypeOGL & getOpenGLDefinition(OdPs::LineType psLtp) const
OdArray< OdGiLinetype > m_giLinetypeDefs
const OdGiLinetype & getGiDefinition(OdPs::LineType psLtp) const
OdGiPsLinetypes(bool bInitialize=true, OdUInt32 nDefs=kGiDefs|kGDIDefs|kOpenGLDefs)
void uninitialize(OdUInt32 nDefs=kPsDefs|kGiDefs|kGDIDefs|kOpenGLDefs)
const PsLinetypeDef & getPsDefinition(OdPs::LineType psLtp) const
const PsLinetypeGDI * getGDIDefinitions() const
OdGiRasterImagePtr rasterizeLinetypeImage(OdPs::LineType psLtp, OdUInt32 numRepititions=1, OdUInt32 numLevels=1, ODCOLORREF backgroundColor=ODRGB(0, 0, 0), ODCOLORREF foregroundColor=ODRGB(255, 255, 255)) const
OdGiRasterImagePtr internalMakeImage(const OdUInt8 *pPixels, OdUInt32 nWidth, OdUInt32 numLevels=1, ODCOLORREF backgroundColor=ODRGB(0, 0, 0), ODCOLORREF foregroundColor=ODRGB(255, 255, 255)) const
void initialize(OdUInt32 nDefs=kPsDefs)
bool isInitialized(OdUInt32 nDefs=kPsDefs) const
void internalInitGDILinetypes()
void internalInitGiLinetypes()
LineType
Definition: PlotStyles.h:89
@ kLtpLast
Definition: PlotStyles.h:123
FillStyle
Definition: PlotStyles.h:53
@ kFsLast
Definition: PlotStyles.h:65
@ kFsSolid
Definition: PlotStyles.h:54
OdUInt32 patternLength() const