Naming conventions.

This commit is contained in:
Jeff Young 2021-03-19 21:38:53 +00:00
parent 2e129d9b47
commit 812d38736e
9 changed files with 1118 additions and 1110 deletions

View File

@ -59,7 +59,7 @@ void BASIC_GAL::doDrawPolyline( const std::vector<wxPoint>& aLocalPointList )
{ {
if( m_DC ) if( m_DC )
{ {
if( isFillEnabled ) if( m_isFillEnabled )
{ {
GRPoly( m_isClipped ? &m_clipBox : NULL, m_DC, aLocalPointList.size(), GRPoly( m_isClipped ? &m_clipBox : NULL, m_DC, aLocalPointList.size(),
&aLocalPointList[0], 0, GetLineWidth(), m_Color, m_Color ); &aLocalPointList[0], 0, GetLineWidth(), m_Color, m_Color );
@ -130,7 +130,7 @@ void BASIC_GAL::DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint
if( m_DC ) if( m_DC )
{ {
if( isFillEnabled ) if( m_isFillEnabled )
{ {
GRLine( m_isClipped ? &m_clipBox : NULL, m_DC, startVector.x, startVector.y, GRLine( m_isClipped ? &m_clipBox : NULL, m_DC, startVector.x, startVector.y,
endVector.x, endVector.y, GetLineWidth(), m_Color ); endVector.x, endVector.y, GetLineWidth(), m_Color );

File diff suppressed because it is too large Load Diff

View File

@ -136,10 +136,10 @@ CAIRO_PRINT_GAL::CAIRO_PRINT_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptio
CAIRO_GAL_BASE( aDisplayOptions ) CAIRO_GAL_BASE( aDisplayOptions )
{ {
m_printCtx = std::move( aContext ); m_printCtx = std::move( aContext );
context = currentContext = m_printCtx->GetContext(); m_context = m_currentContext = m_printCtx->GetContext();
surface = m_printCtx->GetSurface(); m_surface = m_printCtx->GetSurface();
cairo_reference( context ); cairo_reference( m_context );
cairo_surface_reference( surface ); cairo_surface_reference( m_surface );
m_clearColor = COLOR4D( 1.0, 1.0, 1.0, 1.0 ); m_clearColor = COLOR4D( 1.0, 1.0, 1.0, 1.0 );
m_hasNativeLandscapeRotation = false; m_hasNativeLandscapeRotation = false;
resetContext(); resetContext();
@ -150,10 +150,10 @@ CAIRO_PRINT_GAL::CAIRO_PRINT_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptio
void CAIRO_PRINT_GAL::ComputeWorldScreenMatrix() void CAIRO_PRINT_GAL::ComputeWorldScreenMatrix()
{ {
worldScale = screenDPI * worldUnitLength * zoomFactor; m_worldScale = m_screenDPI * m_worldUnitLength * m_zoomFactor;
const auto paperSizeIU = VECTOR2D( m_nativePaperSize.y, m_nativePaperSize.x ) /* inches */ const VECTOR2D paperSizeIU = VECTOR2D( m_nativePaperSize.y, m_nativePaperSize.x ) /* inches */
/ worldUnitLength; /* 1 inch in IU */ / m_worldUnitLength; /* 1" in IU */
const auto paperSizeIUTransposed = VECTOR2D( paperSizeIU.y, paperSizeIU.x ); const VECTOR2D paperSizeIUTransposed( paperSizeIU.y, paperSizeIU.x );
MATRIX3x3D scale, translation, flip, rotate, lookat; MATRIX3x3D scale, translation, flip, rotate, lookat;
@ -165,27 +165,27 @@ void CAIRO_PRINT_GAL::ComputeWorldScreenMatrix()
if( m_hasNativeLandscapeRotation ) if( m_hasNativeLandscapeRotation )
{ {
translation.SetTranslation( 0.5 / zoomFactor * paperSizeIUTransposed ); translation.SetTranslation( 0.5 / m_zoomFactor * paperSizeIUTransposed );
} }
else else
{ {
if( isLandscape() ) if( isLandscape() )
{ {
translation.SetTranslation( 0.5 / zoomFactor * paperSizeIU ); translation.SetTranslation( 0.5 / m_zoomFactor * paperSizeIU );
rotate.SetRotation( 90.0 * M_PI / 180.0 ); rotate.SetRotation( 90.0 * M_PI / 180.0 );
} }
else else
{ {
translation.SetTranslation( 0.5 / zoomFactor * paperSizeIUTransposed ); translation.SetTranslation( 0.5 / m_zoomFactor * paperSizeIUTransposed );
} }
} }
scale.SetScale( VECTOR2D( worldScale, worldScale ) ); scale.SetScale( VECTOR2D( m_worldScale, m_worldScale ) );
flip.SetScale( VECTOR2D( globalFlipX ? -1.0 : 1.0, globalFlipY ? -1.0 : 1.0 ) ); flip.SetScale( VECTOR2D( m_globalFlipX ? -1.0 : 1.0, m_globalFlipY ? -1.0 : 1.0 ) );
lookat.SetTranslation( -lookAtPoint ); lookat.SetTranslation( -m_lookAtPoint );
worldScreenMatrix = scale * translation * flip * rotate * lookat; m_worldScreenMatrix = scale * translation * flip * rotate * lookat;
screenWorldMatrix = worldScreenMatrix.Inverse(); m_screenWorldMatrix = m_worldScreenMatrix.Inverse();
} }
@ -199,8 +199,8 @@ void CAIRO_PRINT_GAL::SetNativePaperSize( const VECTOR2D& aSize, bool aHasNative
void CAIRO_PRINT_GAL::SetSheetSize( const VECTOR2D& aSize ) void CAIRO_PRINT_GAL::SetSheetSize( const VECTOR2D& aSize )
{ {
// Convert aSize (inches) to pixels // Convert aSize (inches) to pixels
SetScreenSize( VECTOR2I( std::ceil( aSize.x * screenDPI ) * 2, SetScreenSize( VECTOR2I( std::ceil( aSize.x * m_screenDPI ) * 2,
std::ceil( aSize.y * screenDPI ) * 2 ) ); std::ceil( aSize.y * m_screenDPI ) * 2 ) );
} }

View File

@ -37,8 +37,8 @@ using namespace KIGFX;
GAL::GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions ) : GAL::GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions ) :
options( aDisplayOptions ), m_options( aDisplayOptions ),
strokeFont( this ) m_strokeFont( this )
{ {
// Set the default values for the internal variables // Set the default values for the internal variables
SetIsFill( false ); SetIsFill( false );
@ -64,23 +64,23 @@ GAL::GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions ) :
// Set grid defaults // Set grid defaults
SetGridVisibility( true ); SetGridVisibility( true );
SetCoarseGrid( 10 ); SetCoarseGrid( 10 );
gridLineWidth = 0.5f; m_gridLineWidth = 0.5f;
gridStyle = GRID_STYLE::LINES; m_gridStyle = GRID_STYLE::LINES;
gridMinSpacing = 10; m_gridMinSpacing = 10;
// Initialize the cursor shape // Initialize the cursor shape
SetCursorColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) ); SetCursorColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
fullscreenCursor = false; m_fullscreenCursor = false;
forceDisplayCursor = false; m_forceDisplayCursor = false;
SetCursorEnabled( false ); SetCursorEnabled( false );
// Initialize text properties // Initialize text properties
ResetTextAttributes(); ResetTextAttributes();
strokeFont.LoadNewStrokeFont( newstroke_font, newstroke_font_bufsize ); m_strokeFont.LoadNewStrokeFont( newstroke_font, newstroke_font_bufsize );
// subscribe for settings updates // subscribe for settings updates
observerLink = options.Subscribe( this ); m_observerLink = m_options.Subscribe( this );
} }
@ -102,39 +102,39 @@ bool GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
{ {
bool refresh = false; bool refresh = false;
if( options.m_gridStyle != gridStyle ) if( m_options.m_gridStyle != m_gridStyle )
{ {
gridStyle = options.m_gridStyle ; m_gridStyle = m_options.m_gridStyle ;
refresh = true; refresh = true;
} }
if( options.m_gridLineWidth != gridLineWidth ) if( m_options.m_gridLineWidth != m_gridLineWidth )
{ {
gridLineWidth = std::floor( options.m_gridLineWidth + 0.5 ); m_gridLineWidth = std::floor( m_options.m_gridLineWidth + 0.5 );
refresh = true; refresh = true;
} }
if( options.m_gridMinSpacing != gridMinSpacing ) if( m_options.m_gridMinSpacing != m_gridMinSpacing )
{ {
gridMinSpacing = options.m_gridMinSpacing; m_gridMinSpacing = m_options.m_gridMinSpacing;
refresh = true; refresh = true;
} }
if( options.m_axesEnabled != axesEnabled ) if( m_options.m_axesEnabled != m_axesEnabled )
{ {
axesEnabled = options.m_axesEnabled; m_axesEnabled = m_options.m_axesEnabled;
refresh = true; refresh = true;
} }
if( options.m_forceDisplayCursor != forceDisplayCursor ) if( m_options.m_forceDisplayCursor != m_forceDisplayCursor )
{ {
forceDisplayCursor = options.m_forceDisplayCursor; m_forceDisplayCursor = m_options.m_forceDisplayCursor;
refresh = true; refresh = true;
} }
if( options.m_fullscreenCursor != fullscreenCursor ) if( m_options.m_fullscreenCursor != m_fullscreenCursor )
{ {
fullscreenCursor = options.m_fullscreenCursor; m_fullscreenCursor = m_options.m_fullscreenCursor;
refresh = true; refresh = true;
} }
@ -176,7 +176,7 @@ VECTOR2D GAL::GetTextLineSize( const UTF8& aText ) const
// Compute the X and Y size of a given text. // Compute the X and Y size of a given text.
// Because computeTextLineSize expects a one line text, // Because computeTextLineSize expects a one line text,
// aText is expected to be only one line text. // aText is expected to be only one line text.
return strokeFont.computeTextLineSize( aText ); return m_strokeFont.computeTextLineSize( aText );
} }
@ -186,26 +186,26 @@ void GAL::ComputeWorldScreenMatrix()
MATRIX3x3D translation; MATRIX3x3D translation;
translation.SetIdentity(); translation.SetIdentity();
translation.SetTranslation( 0.5 * VECTOR2D( screenSize ) ); translation.SetTranslation( 0.5 * VECTOR2D( m_screenSize ) );
MATRIX3x3D rotate; MATRIX3x3D rotate;
rotate.SetIdentity(); rotate.SetIdentity();
rotate.SetRotation( rotation ); rotate.SetRotation( m_rotation );
MATRIX3x3D scale; MATRIX3x3D scale;
scale.SetIdentity(); scale.SetIdentity();
scale.SetScale( VECTOR2D( worldScale, worldScale ) ); scale.SetScale( VECTOR2D( m_worldScale, m_worldScale ) );
MATRIX3x3D flip; MATRIX3x3D flip;
flip.SetIdentity(); flip.SetIdentity();
flip.SetScale( VECTOR2D( globalFlipX ? -1.0 : 1.0, globalFlipY ? -1.0 : 1.0 ) ); flip.SetScale( VECTOR2D( m_globalFlipX ? -1.0 : 1.0, m_globalFlipY ? -1.0 : 1.0 ) );
MATRIX3x3D lookat; MATRIX3x3D lookat;
lookat.SetIdentity(); lookat.SetIdentity();
lookat.SetTranslation( -lookAtPoint ); lookat.SetTranslation( -m_lookAtPoint );
worldScreenMatrix = translation * rotate * flip * scale * lookat; m_worldScreenMatrix = translation * rotate * flip * scale * lookat;
screenWorldMatrix = worldScreenMatrix.Inverse(); m_screenWorldMatrix = m_worldScreenMatrix.Inverse();
} }
@ -213,7 +213,7 @@ double GAL::computeMinGridSpacing() const
{ {
// just return the current value. This could be cleverer and take // just return the current value. This could be cleverer and take
// into account other settings in future // into account other settings in future
return gridMinSpacing; return m_gridMinSpacing;
} }
@ -221,14 +221,14 @@ VECTOR2D GAL::GetGridPoint( const VECTOR2D& aPoint ) const
{ {
#if 0 #if 0
// This old code expects a non zero grid size, which can be wrong here. // This old code expects a non zero grid size, which can be wrong here.
return VECTOR2D( KiROUND( ( aPoint.x - gridOffset.x ) / gridSize.x ) * gridSize.x + gridOffset.x, return VECTOR2D( KiROUND( ( aPoint.x - m_gridOffset.x ) / m_gridSize.x ) * m_gridSize.x + m_gridOffset.x,
KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y ); KiROUND( ( aPoint.y - m_gridOffset.y ) / m_gridSize.y ) * m_gridSize.y + m_gridOffset.y );
#else #else
// if grid size == 0.0 there is no grid, so use aPoint as grid reference position // if grid size == 0.0 there is no grid, so use aPoint as grid reference position
double cx = gridSize.x > 0.0 ? KiROUND( ( aPoint.x - gridOffset.x ) / gridSize.x ) * gridSize.x + gridOffset.x double cx = m_gridSize.x > 0.0 ? KiROUND( ( aPoint.x - m_gridOffset.x ) / m_gridSize.x ) * m_gridSize.x + m_gridOffset.x
: aPoint.x; : aPoint.x;
double cy = gridSize.y > 0.0 ? KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y double cy = m_gridSize.y > 0.0 ? KiROUND( ( aPoint.y - m_gridOffset.y ) / m_gridSize.y ) * m_gridSize.y + m_gridOffset.y
: aPoint.y; : aPoint.y;
return VECTOR2D( cx, cy ); return VECTOR2D( cx, cy );
#endif #endif
@ -241,14 +241,12 @@ const int GAL::GRID_DEPTH = MAX_DEPTH - 1;
COLOR4D GAL::getCursorColor() const COLOR4D GAL::getCursorColor() const
{ {
auto color = cursorColor; COLOR4D color = m_cursorColor;
// dim the cursor if it's only on because it was forced // dim the cursor if it's only on because it was forced
// (this helps to provide a hint for active tools) // (this helps to provide a hint for active tools)
if( !isCursorEnabled ) if( !m_isCursorEnabled )
{
color.a = color.a * 0.5; color.a = color.a * 0.5;
}
return color; return color;
} }

File diff suppressed because it is too large Load Diff

View File

@ -218,13 +218,13 @@ public:
protected: protected:
// Geometric transforms according to the currentWorld2Screen transform matrix: // Geometric transforms according to the m_currentWorld2Screen transform matrix:
const double xform( double x ); // scale const double xform( double x ); // scale
const VECTOR2D xform( double x, double y ); // rotation, scale and offset const VECTOR2D xform( double x, double y ); // rotation, scale and offset
const VECTOR2D xform( const VECTOR2D& aP ); // rotation, scale and offset const VECTOR2D xform( const VECTOR2D& aP ); // rotation, scale and offset
/** /**
* Transform according to the rotation from currentWorld2Screen transform matrix. * Transform according to the rotation from m_currentWorld2Screen transform matrix.
* *
* @param aAngle is the angle in radians to transform. * @param aAngle is the angle in radians to transform.
* @return the modified angle. * @return the modified angle.
@ -232,7 +232,7 @@ protected:
const double angle_xform( const double aAngle ); const double angle_xform( const double aAngle );
/** /**
* Transform according to the rotation from currentWorld2Screen transform matrix * Transform according to the rotation from m_currentWorld2Screen transform matrix
* for the start angle and the end angle of an arc. * for the start angle and the end angle of an arc.
* *
* @param aStartAngle is the arc starting point in radians to transform * @param aStartAngle is the arc starting point in radians to transform
@ -312,38 +312,38 @@ protected:
/// Type definition for an graphics group element /// Type definition for an graphics group element
typedef struct typedef struct
{ {
GRAPHICS_COMMAND command; ///< Command to execute GRAPHICS_COMMAND m_Command; ///< Command to execute
union { union {
double dblArg[MAX_CAIRO_ARGUMENTS]; ///< Arguments for Cairo commands double DblArg[MAX_CAIRO_ARGUMENTS]; ///< Arguments for Cairo commands
bool boolArg; ///< A bool argument bool BoolArg; ///< A bool argument
int intArg; ///< An int argument int IntArg; ///< An int argument
} argument; } m_Argument;
cairo_path_t* cairoPath; ///< Pointer to a Cairo path cairo_path_t* m_CairoPath; ///< Pointer to a Cairo path
} GROUP_ELEMENT; } GROUP_ELEMENT;
// Variables for the grouping function
bool isGrouping; ///< Is grouping enabled ?
bool isElementAdded; ///< Was an graphic element added ?
typedef std::deque<GROUP_ELEMENT> GROUP; ///< A graphic group type definition typedef std::deque<GROUP_ELEMENT> GROUP; ///< A graphic group type definition
std::map<int, GROUP> groups; ///< List of graphic groups
unsigned int groupCounter; ///< Counter used for generating keys for groups
GROUP* currentGroup; ///< Currently used group
double linePixelWidth; // Variables for the grouping function
double lineWidthInPixels; bool m_isGrouping; ///< Is grouping enabled ?
bool lineWidthIsOdd; bool m_isElementAdded; ///< Was an graphic element added ?
std::map<int, GROUP> m_groups; ///< List of graphic groups
unsigned int m_groupCounter; ///< Counter used for generating group keys
GROUP* m_currentGroup; ///< Currently used group
cairo_matrix_t cairoWorldScreenMatrix; ///< Cairo world to screen transformation matrix double m_lineWidthInPixels;
cairo_matrix_t currentXform; bool m_lineWidthIsOdd;
cairo_matrix_t currentWorld2Screen;
cairo_t* currentContext; ///< Currently used Cairo context for drawing cairo_matrix_t m_cairoWorldScreenMatrix; ///< Cairo world to screen transform matrix
cairo_t* context; ///< Cairo image cairo_matrix_t m_currentXform;
cairo_surface_t* surface; ///< Cairo surface cairo_matrix_t m_currentWorld2Screen;
cairo_t* m_currentContext; ///< Currently used Cairo context for drawing
cairo_t* m_context; ///< Cairo image
cairo_surface_t* m_surface; ///< Cairo surface
/// List of surfaces that were created by painting images, to be cleaned up later /// List of surfaces that were created by painting images, to be cleaned up later
std::vector<cairo_surface_t*> imageSurfaces; std::vector<cairo_surface_t*> m_imageSurfaces;
std::vector<cairo_matrix_t> xformStack; std::vector<cairo_matrix_t> m_xformStack;
/// Format used to store pixels /// Format used to store pixels
static constexpr cairo_format_t GAL_FORMAT = CAIRO_FORMAT_ARGB32; static constexpr cairo_format_t GAL_FORMAT = CAIRO_FORMAT_ARGB32;
}; };
@ -399,12 +399,12 @@ public:
void SetMouseListener( wxEvtHandler* aMouseListener ) void SetMouseListener( wxEvtHandler* aMouseListener )
{ {
mouseListener = aMouseListener; m_mouseListener = aMouseListener;
} }
void SetPaintListener( wxEvtHandler* aPaintListener ) void SetPaintListener( wxEvtHandler* aPaintListener )
{ {
paintListener = aPaintListener; m_paintListener = aPaintListener;
} }
/// @copydoc GAL::BeginDrawing() /// @copydoc GAL::BeginDrawing()
@ -448,25 +448,25 @@ public:
protected: protected:
// Compositor related variables // Compositor related variables
std::shared_ptr<CAIRO_COMPOSITOR> compositor; ///< Object for layers compositing std::shared_ptr<CAIRO_COMPOSITOR> m_compositor; ///< Object for layers compositing
unsigned int mainBuffer; ///< Handle to the main buffer unsigned int m_mainBuffer; ///< Handle to the main buffer
unsigned int overlayBuffer; ///< Handle to the overlay buffer unsigned int m_overlayBuffer; ///< Handle to the overlay buffer
RENDER_TARGET currentTarget; ///< Current rendering target RENDER_TARGET m_currentTarget; ///< Current rendering target
bool validCompositor; ///< Compositor initialization flag bool m_validCompositor; ///< Compositor initialization flag
// Variables related to wxWidgets // Variables related to wxWidgets
wxWindow* parentWindow; ///< Parent window wxWindow* m_parentWindow; ///< Parent window
wxEvtHandler* mouseListener; ///< Mouse listener wxEvtHandler* m_mouseListener; ///< Mouse listener
wxEvtHandler* paintListener; ///< Paint listener wxEvtHandler* m_paintListener; ///< Paint listener
unsigned int bufferSize; ///< Size of buffers cairoOutput, bitmapBuffers unsigned int m_bufferSize; ///< Size of buffers cairoOutput, bitmapBuffers
unsigned char* wxOutput; ///< wxImage compatible buffer unsigned char* m_wxOutput; ///< wxImage compatible buffer
// Variables related to Cairo <-> wxWidgets // Variables related to Cairo <-> wxWidgets
unsigned char* bitmapBuffer; ///< Storage of the Cairo image unsigned char* m_bitmapBuffer; ///< Storage of the Cairo image
int stride; ///< Stride value for Cairo int m_stride; ///< Stride value for Cairo
int wxBufferWidth; int m_wxBufferWidth;
bool isInitialized; ///< Are Cairo image & surface ready to use bool m_isInitialized; ///< Are Cairo image & surface ready to use
COLOR4D backgroundColor; ///< Background color COLOR4D m_backgroundColor; ///< Background color
}; };
} // namespace KIGFX } // namespace KIGFX

View File

@ -207,7 +207,7 @@ public:
/// Return GAL canvas size in pixels /// Return GAL canvas size in pixels
const VECTOR2I& GetScreenPixelSize() const const VECTOR2I& GetScreenPixelSize() const
{ {
return screenSize; return m_screenSize;
} }
/// Force all remaining objects to be drawn. /// Force all remaining objects to be drawn.
@ -241,7 +241,7 @@ public:
*/ */
virtual void SetIsFill( bool aIsFillEnabled ) virtual void SetIsFill( bool aIsFillEnabled )
{ {
isFillEnabled = aIsFillEnabled; m_isFillEnabled = aIsFillEnabled;
} }
/** /**
@ -251,7 +251,7 @@ public:
*/ */
virtual void SetIsStroke( bool aIsStrokeEnabled ) virtual void SetIsStroke( bool aIsStrokeEnabled )
{ {
isStrokeEnabled = aIsStrokeEnabled; m_isStrokeEnabled = aIsStrokeEnabled;
} }
/** /**
@ -261,7 +261,7 @@ public:
*/ */
virtual void SetFillColor( const COLOR4D& aColor ) virtual void SetFillColor( const COLOR4D& aColor )
{ {
fillColor = aColor; m_fillColor = aColor;
} }
/** /**
@ -271,7 +271,7 @@ public:
*/ */
inline const COLOR4D& GetFillColor() const inline const COLOR4D& GetFillColor() const
{ {
return fillColor; return m_fillColor;
} }
/** /**
@ -281,7 +281,7 @@ public:
*/ */
virtual void SetStrokeColor( const COLOR4D& aColor ) virtual void SetStrokeColor( const COLOR4D& aColor )
{ {
strokeColor = aColor; m_strokeColor = aColor;
} }
/** /**
@ -291,7 +291,7 @@ public:
*/ */
inline const COLOR4D& GetStrokeColor() const inline const COLOR4D& GetStrokeColor() const
{ {
return strokeColor; return m_strokeColor;
} }
/** /**
@ -301,7 +301,7 @@ public:
*/ */
virtual void SetLineWidth( float aLineWidth ) virtual void SetLineWidth( float aLineWidth )
{ {
lineWidth = aLineWidth; m_lineWidth = aLineWidth;
} }
/** /**
@ -311,7 +311,7 @@ public:
*/ */
inline float GetLineWidth() const inline float GetLineWidth() const
{ {
return lineWidth; return m_lineWidth;
} }
/** /**
@ -321,10 +321,10 @@ public:
*/ */
virtual void SetLayerDepth( double aLayerDepth ) virtual void SetLayerDepth( double aLayerDepth )
{ {
assert( aLayerDepth <= depthRange.y ); assert( aLayerDepth <= m_depthRange.y );
assert( aLayerDepth >= depthRange.x ); assert( aLayerDepth >= m_depthRange.x );
layerDepth = aLayerDepth; m_layerDepth = aLayerDepth;
} }
// ---- // ----
@ -333,7 +333,7 @@ public:
const STROKE_FONT& GetStrokeFont() const const STROKE_FONT& GetStrokeFont() const
{ {
return strokeFont; return m_strokeFont;
} }
/** /**
@ -346,7 +346,7 @@ public:
virtual void StrokeText( const wxString& aText, const VECTOR2D& aPosition, virtual void StrokeText( const wxString& aText, const VECTOR2D& aPosition,
double aRotationAngle ) double aRotationAngle )
{ {
strokeFont.Draw( aText, aPosition, aRotationAngle ); m_strokeFont.Draw( aText, aPosition, aRotationAngle );
} }
/** /**
@ -363,23 +363,23 @@ public:
// Fallback: use stroke font // Fallback: use stroke font
// Handle flipped view // Handle flipped view
if( globalFlipX ) if( m_globalFlipX )
textProperties.m_mirrored = !textProperties.m_mirrored; textProperties.m_mirrored = !textProperties.m_mirrored;
// Bitmap font is slightly smaller and slightly heavier than the stroke font so we // Bitmap font is slightly smaller and slightly heavier than the stroke font so we
// compensate a bit before stroking // compensate a bit before stroking
float saveLineWidth = lineWidth; float saveLineWidth = m_lineWidth;
VECTOR2D saveGlyphSize = textProperties.m_glyphSize; VECTOR2D saveGlyphSize = textProperties.m_glyphSize;
{ {
lineWidth *= 1.2f; m_lineWidth *= 1.2f;
textProperties.m_glyphSize = textProperties.m_glyphSize * 0.8; textProperties.m_glyphSize = textProperties.m_glyphSize * 0.8;
StrokeText( aText, aPosition, aRotationAngle ); StrokeText( aText, aPosition, aRotationAngle );
} }
lineWidth = saveLineWidth; m_lineWidth = saveLineWidth;
textProperties.m_glyphSize = saveGlyphSize; textProperties.m_glyphSize = saveGlyphSize;
if( globalFlipX ) if( m_globalFlipX )
textProperties.m_mirrored = !textProperties.m_mirrored; textProperties.m_mirrored = !textProperties.m_mirrored;
} }
@ -582,7 +582,7 @@ public:
*/ */
const MATRIX3x3D& GetWorldScreenMatrix() const const MATRIX3x3D& GetWorldScreenMatrix() const
{ {
return worldScreenMatrix; return m_worldScreenMatrix;
} }
/** /**
@ -592,7 +592,7 @@ public:
*/ */
const MATRIX3x3D& GetScreenWorldMatrix() const const MATRIX3x3D& GetScreenWorldMatrix() const
{ {
return screenWorldMatrix; return m_screenWorldMatrix;
} }
/** /**
@ -602,7 +602,7 @@ public:
*/ */
inline void SetWorldScreenMatrix( const MATRIX3x3D& aMatrix ) inline void SetWorldScreenMatrix( const MATRIX3x3D& aMatrix )
{ {
worldScreenMatrix = aMatrix; m_worldScreenMatrix = aMatrix;
} }
/** /**
@ -616,12 +616,12 @@ public:
*/ */
inline void SetWorldUnitLength( double aWorldUnitLength ) inline void SetWorldUnitLength( double aWorldUnitLength )
{ {
worldUnitLength = aWorldUnitLength; m_worldUnitLength = aWorldUnitLength;
} }
inline void SetScreenSize( const VECTOR2I& aSize ) inline void SetScreenSize( const VECTOR2I& aSize )
{ {
screenSize = aSize; m_screenSize = aSize;
} }
/** /**
@ -634,7 +634,7 @@ public:
*/ */
inline void SetScreenDPI( double aScreenDPI ) inline void SetScreenDPI( double aScreenDPI )
{ {
screenDPI = aScreenDPI; m_screenDPI = aScreenDPI;
} }
/** /**
@ -646,7 +646,7 @@ public:
*/ */
inline void SetLookAtPoint( const VECTOR2D& aPoint ) inline void SetLookAtPoint( const VECTOR2D& aPoint )
{ {
lookAtPoint = aPoint; m_lookAtPoint = aPoint;
} }
/** /**
@ -656,7 +656,7 @@ public:
*/ */
inline const VECTOR2D& GetLookAtPoint() const inline const VECTOR2D& GetLookAtPoint() const
{ {
return lookAtPoint; return m_lookAtPoint;
} }
/** /**
@ -666,7 +666,7 @@ public:
*/ */
inline void SetZoomFactor( double aZoomFactor ) inline void SetZoomFactor( double aZoomFactor )
{ {
zoomFactor = aZoomFactor; m_zoomFactor = aZoomFactor;
} }
/** /**
@ -676,7 +676,7 @@ public:
*/ */
inline double GetZoomFactor() const inline double GetZoomFactor() const
{ {
return zoomFactor; return m_zoomFactor;
} }
/** /**
@ -686,7 +686,7 @@ public:
*/ */
void SetRotation( double aRotation ) void SetRotation( double aRotation )
{ {
rotation = aRotation; m_rotation = aRotation;
} }
/** /**
@ -696,7 +696,7 @@ public:
*/ */
double GetRotation() const double GetRotation() const
{ {
return rotation; return m_rotation;
} }
/** /**
@ -709,7 +709,7 @@ public:
*/ */
inline void SetDepthRange( const VECTOR2D& aDepthRange ) inline void SetDepthRange( const VECTOR2D& aDepthRange )
{ {
depthRange = aDepthRange; m_depthRange = aDepthRange;
} }
/** /**
@ -717,7 +717,7 @@ public:
*/ */
inline double GetMinDepth() const inline double GetMinDepth() const
{ {
return depthRange.x; return m_depthRange.x;
} }
/** /**
@ -725,7 +725,7 @@ public:
*/ */
inline double GetMaxDepth() const inline double GetMaxDepth() const
{ {
return depthRange.y; return m_depthRange.y;
} }
/** /**
@ -735,7 +735,7 @@ public:
*/ */
inline double GetWorldScale() const inline double GetWorldScale() const
{ {
return worldScale; return m_worldScale;
} }
/** /**
@ -746,8 +746,8 @@ public:
*/ */
inline void SetFlip( bool xAxis, bool yAxis ) inline void SetFlip( bool xAxis, bool yAxis )
{ {
globalFlipX = xAxis; m_globalFlipX = xAxis;
globalFlipY = yAxis; m_globalFlipY = yAxis;
} }
/** /**
@ -755,7 +755,7 @@ public:
*/ */
bool IsFlippedX() const bool IsFlippedX() const
{ {
return globalFlipX; return m_globalFlipX;
} }
/** /**
@ -763,7 +763,7 @@ public:
*/ */
bool IsFlippedY() const bool IsFlippedY() const
{ {
return globalFlipY; return m_globalFlipY;
} }
// --------------------------- // ---------------------------
@ -823,14 +823,14 @@ public:
* *
* @param aVisibility is the new visibility setting of the grid. * @param aVisibility is the new visibility setting of the grid.
*/ */
void SetGridVisibility( bool aVisibility ) { gridVisibility = aVisibility; } void SetGridVisibility( bool aVisibility ) { m_gridVisibility = aVisibility; }
bool GetGridVisibility() const { return gridVisibility; } bool GetGridVisibility() const { return m_gridVisibility; }
bool GetGridSnapping() const bool GetGridSnapping() const
{ {
return ( options.m_gridSnapping == KIGFX::GRID_SNAPPING::ALWAYS || return m_options.m_gridSnapping == KIGFX::GRID_SNAPPING::ALWAYS ||
( gridVisibility && options.m_gridSnapping == KIGFX::GRID_SNAPPING::WITH_GRID ) ); ( m_gridVisibility && m_options.m_gridSnapping == KIGFX::GRID_SNAPPING::WITH_GRID );
} }
/** /**
* Set the origin point for the grid. * Set the origin point for the grid.
@ -839,18 +839,22 @@ public:
*/ */
inline void SetGridOrigin( const VECTOR2D& aGridOrigin ) inline void SetGridOrigin( const VECTOR2D& aGridOrigin )
{ {
gridOrigin = aGridOrigin; m_gridOrigin = aGridOrigin;
if( gridSize.x == 0.0 || gridSize.y == 0.0 ) if( m_gridSize.x == 0.0 || m_gridSize.y == 0.0 )
gridOffset = VECTOR2D(0.0, 0.0); {
m_gridOffset = VECTOR2D( 0.0, 0.0);
}
else else
gridOffset = VECTOR2D( (long) gridOrigin.x % (long) gridSize.x, {
(long) gridOrigin.y % (long) gridSize.y ); m_gridOffset = VECTOR2D( (long) m_gridOrigin.x % (long) m_gridSize.x,
(long) m_gridOrigin.y % (long) m_gridSize.y );
}
} }
inline const VECTOR2D& GetGridOrigin() const inline const VECTOR2D& GetGridOrigin() const
{ {
return gridOrigin; return m_gridOrigin;
} }
/** /**
@ -860,14 +864,14 @@ public:
*/ */
inline void SetGridSize( const VECTOR2D& aGridSize ) inline void SetGridSize( const VECTOR2D& aGridSize )
{ {
gridSize = aGridSize; m_gridSize = aGridSize;
// Avoid stupid grid size values: a grid size should be >= 1 in internal units // Avoid stupid grid size values: a grid size should be >= 1 in internal units
gridSize.x = std::max( 1.0, gridSize.x ); m_gridSize.x = std::max( 1.0, m_gridSize.x );
gridSize.y = std::max( 1.0, gridSize.y ); m_gridSize.y = std::max( 1.0, m_gridSize.y );
gridOffset = VECTOR2D( (long) gridOrigin.x % (long) gridSize.x, m_gridOffset = VECTOR2D( (long) m_gridOrigin.x % (long) m_gridSize.x,
(long) gridOrigin.y % (long) gridSize.y ); (long) m_gridOrigin.y % (long) m_gridSize.y );
} }
/** /**
@ -877,7 +881,7 @@ public:
*/ */
inline const VECTOR2D& GetGridSize() const inline const VECTOR2D& GetGridSize() const
{ {
return gridSize; return m_gridSize;
} }
/** /**
@ -887,7 +891,7 @@ public:
*/ */
inline void SetGridColor( const COLOR4D& aGridColor ) inline void SetGridColor( const COLOR4D& aGridColor )
{ {
gridColor = aGridColor; m_gridColor = aGridColor;
} }
/** /**
@ -897,7 +901,7 @@ public:
*/ */
inline void SetAxesColor( const COLOR4D& aAxesColor ) inline void SetAxesColor( const COLOR4D& aAxesColor )
{ {
axesColor = aAxesColor; m_axesColor = aAxesColor;
} }
/** /**
@ -905,7 +909,7 @@ public:
*/ */
inline void SetAxesEnabled( bool aAxesEnabled ) inline void SetAxesEnabled( bool aAxesEnabled )
{ {
axesEnabled = aAxesEnabled; m_axesEnabled = aAxesEnabled;
} }
/** /**
@ -915,7 +919,7 @@ public:
*/ */
inline void SetCoarseGrid( int aInterval ) inline void SetCoarseGrid( int aInterval )
{ {
gridTick = aInterval; m_gridTick = aInterval;
} }
/** /**
@ -925,7 +929,7 @@ public:
*/ */
inline float GetGridLineWidth() const inline float GetGridLineWidth() const
{ {
return gridLineWidth; return m_gridLineWidth;
} }
///< Draw the grid ///< Draw the grid
@ -947,7 +951,7 @@ public:
*/ */
inline VECTOR2D ToWorld( const VECTOR2D& aPoint ) const inline VECTOR2D ToWorld( const VECTOR2D& aPoint ) const
{ {
return VECTOR2D( screenWorldMatrix * aPoint ); return VECTOR2D( m_screenWorldMatrix * aPoint );
} }
/** /**
@ -958,7 +962,7 @@ public:
*/ */
inline VECTOR2D ToScreen( const VECTOR2D& aPoint ) const inline VECTOR2D ToScreen( const VECTOR2D& aPoint ) const
{ {
return VECTOR2D( worldScreenMatrix * aPoint ); return VECTOR2D( m_worldScreenMatrix * aPoint );
} }
/** /**
@ -968,7 +972,7 @@ public:
*/ */
inline void SetCursorEnabled( bool aCursorEnabled ) inline void SetCursorEnabled( bool aCursorEnabled )
{ {
isCursorEnabled = aCursorEnabled; m_isCursorEnabled = aCursorEnabled;
} }
/** /**
@ -978,7 +982,7 @@ public:
*/ */
bool IsCursorEnabled() const bool IsCursorEnabled() const
{ {
return isCursorEnabled || forceDisplayCursor; return m_isCursorEnabled || m_forceDisplayCursor;
} }
/** /**
@ -988,7 +992,7 @@ public:
*/ */
inline void SetCursorColor( const COLOR4D& aCursorColor ) inline void SetCursorColor( const COLOR4D& aCursorColor )
{ {
cursorColor = aCursorColor; m_cursorColor = aCursorColor;
} }
/** /**
@ -1004,7 +1008,7 @@ public:
*/ */
inline void AdvanceDepth() inline void AdvanceDepth()
{ {
layerDepth -= 0.05; m_layerDepth -= 0.05;
} }
/** /**
@ -1012,7 +1016,7 @@ public:
*/ */
inline void PushDepth() inline void PushDepth()
{ {
depthStack.push( layerDepth ); m_depthStack.push( m_layerDepth );
} }
/** /**
@ -1020,8 +1024,8 @@ public:
*/ */
inline void PopDepth() inline void PopDepth()
{ {
layerDepth = depthStack.top(); m_layerDepth = m_depthStack.top();
depthStack.pop(); m_depthStack.pop();
} }
virtual void EnableDepthTest( bool aEnabled = false ) {}; virtual void EnableDepthTest( bool aEnabled = false ) {};
@ -1059,7 +1063,7 @@ protected:
/// Compute the scaling factor for the world->screen matrix /// Compute the scaling factor for the world->screen matrix
inline void computeWorldScale() inline void computeWorldScale()
{ {
worldScale = screenDPI * worldUnitLength * zoomFactor; m_worldScale = m_screenDPI * m_worldUnitLength * m_zoomFactor;
} }
/** /**
@ -1099,60 +1103,60 @@ protected:
*/ */
virtual bool updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ); virtual bool updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions );
GAL_DISPLAY_OPTIONS& options; GAL_DISPLAY_OPTIONS& m_options;
UTIL::LINK observerLink; UTIL::LINK m_observerLink;
std::stack<double> depthStack; ///< Stored depth values std::stack<double> m_depthStack; ///< Stored depth values
VECTOR2I screenSize; ///< Screen size in screen coordinates VECTOR2I m_screenSize; ///< Screen size in screen coordinates
double worldUnitLength; ///< The unit length of the world coordinates [inch] double m_worldUnitLength; ///< The unit length of the world coordinates [inch]
double screenDPI; ///< The dots per inch of the screen double m_screenDPI; ///< The dots per inch of the screen
VECTOR2D lookAtPoint; ///< Point to be looked at in world space VECTOR2D m_lookAtPoint; ///< Point to be looked at in world space
double zoomFactor; ///< The zoom factor double m_zoomFactor; ///< The zoom factor
double rotation; ///< Rotation transformation (radians) double m_rotation; ///< Rotation transformation (radians)
MATRIX3x3D worldScreenMatrix; ///< World transformation MATRIX3x3D m_worldScreenMatrix; ///< World transformation
MATRIX3x3D screenWorldMatrix; ///< Screen transformation MATRIX3x3D m_screenWorldMatrix; ///< Screen transformation
double worldScale; ///< The scale factor world->screen double m_worldScale; ///< The scale factor world->screen
bool globalFlipX; ///< Flag for X axis flipping bool m_globalFlipX; ///< Flag for X axis flipping
bool globalFlipY; ///< Flag for Y axis flipping bool m_globalFlipY; ///< Flag for Y axis flipping
float lineWidth; ///< The line width float m_lineWidth; ///< The line width
bool isFillEnabled; ///< Is filling of graphic objects enabled ? bool m_isFillEnabled; ///< Is filling of graphic objects enabled ?
bool isStrokeEnabled; ///< Are the outlines stroked ? bool m_isStrokeEnabled; ///< Are the outlines stroked ?
COLOR4D fillColor; ///< The fill color COLOR4D m_fillColor; ///< The fill color
COLOR4D strokeColor; ///< The color of the outlines COLOR4D m_strokeColor; ///< The color of the outlines
COLOR4D m_clearColor; COLOR4D m_clearColor;
double layerDepth; ///< The actual layer depth double m_layerDepth; ///< The actual layer depth
VECTOR2D depthRange; ///< Range of the depth VECTOR2D m_depthRange; ///< Range of the depth
// Grid settings // Grid settings
bool gridVisibility; ///< Should the grid be shown bool m_gridVisibility; ///< Should the grid be shown
GRID_STYLE gridStyle; ///< Grid display style GRID_STYLE m_gridStyle; ///< Grid display style
VECTOR2D gridSize; ///< The grid size VECTOR2D m_gridSize; ///< The grid size
VECTOR2D gridOrigin; ///< The grid origin VECTOR2D m_gridOrigin; ///< The grid origin
VECTOR2D gridOffset; ///< The grid offset to compensate cursor position VECTOR2D m_gridOffset; ///< The grid offset to compensate cursor position
COLOR4D gridColor; ///< Color of the grid COLOR4D m_gridColor; ///< Color of the grid
COLOR4D axesColor; ///< Color of the axes COLOR4D m_axesColor; ///< Color of the axes
bool axesEnabled; ///< Should the axes be drawn bool m_axesEnabled; ///< Should the axes be drawn
int gridTick; ///< Every tick line gets the double width int m_gridTick; ///< Every tick line gets the double width
float gridLineWidth; ///< Line width of the grid float m_gridLineWidth; ///< Line width of the grid
int gridMinSpacing; ///< Minimum screen size of the grid (pixels) int m_gridMinSpacing; ///< Minimum screen size of the grid (pixels)
///< below which the grid is not drawn ///< below which the grid is not drawn
// Cursor settings // Cursor settings
bool isCursorEnabled; ///< Is the cursor enabled? bool m_isCursorEnabled; ///< Is the cursor enabled?
bool forceDisplayCursor; ///< Always show cursor bool m_forceDisplayCursor; ///< Always show cursor
COLOR4D cursorColor; ///< Cursor color COLOR4D m_cursorColor; ///< Cursor color
bool fullscreenCursor; ///< Shape of the cursor (fullscreen or small cross) bool m_fullscreenCursor; ///< Shape of the cursor (fullscreen or small cross)
VECTOR2D cursorPosition; ///< Current cursor position (world coordinates) VECTOR2D m_cursorPosition; ///< Current cursor position (world coordinates)
/// Instance of object that stores information about how to draw texts STROKE_FONT m_strokeFont; ///< Instance of object that stores information
STROKE_FONT strokeFont; ///< about how to draw texts
private: private:
struct TEXT_PROPERTIES struct TEXT_PROPERTIES

View File

@ -259,12 +259,12 @@ public:
void SetMouseListener( wxEvtHandler* aMouseListener ) void SetMouseListener( wxEvtHandler* aMouseListener )
{ {
mouseListener = aMouseListener; m_mouseListener = aMouseListener;
} }
void SetPaintListener( wxEvtHandler* aPaintListener ) void SetPaintListener( wxEvtHandler* aPaintListener )
{ {
paintListener = aPaintListener; m_paintListener = aPaintListener;
} }
void EnableDepthTest( bool aEnabled = false ) override; void EnableDepthTest( bool aEnabled = false ) override;
@ -291,48 +291,53 @@ private:
static const int CIRCLE_POINTS = 64; ///< The number of points for circle approximation static const int CIRCLE_POINTS = 64; ///< The number of points for circle approximation
static const int CURVE_POINTS = 32; ///< The number of points for curve approximation static const int CURVE_POINTS = 32; ///< The number of points for curve approximation
static wxGLContext* glMainContext; ///< Parent OpenGL context static wxGLContext* m_glMainContext; ///< Parent OpenGL context
wxGLContext* glPrivContext; ///< Canvas-specific OpenGL context wxGLContext* m_glPrivContext; ///< Canvas-specific OpenGL context
static int instanceCounter; ///< GL GAL instance counter static int m_instanceCounter; ///< GL GAL instance counter
wxEvtHandler* mouseListener; wxEvtHandler* m_mouseListener;
wxEvtHandler* paintListener; wxEvtHandler* m_paintListener;
static GLuint fontTexture; ///< Bitmap font texture handle (shared) static GLuint g_fontTexture; ///< Bitmap font texture handle (shared)
// Vertex buffer objects related fields // Vertex buffer objects related fields
typedef std::unordered_map< unsigned int, std::shared_ptr<VERTEX_ITEM> > GROUPS_MAP; typedef std::unordered_map< unsigned int, std::shared_ptr<VERTEX_ITEM> > GROUPS_MAP;
GROUPS_MAP groups; ///< Stores information about VBO objects (groups)
unsigned int groupCounter; ///< Counter used for generating keys for groups GROUPS_MAP m_groups; ///< Stores information about VBO objects (groups)
VERTEX_MANAGER* currentManager; ///< Currently used VERTEX_MANAGER (for storing unsigned int m_groupCounter; ///< Counter used for generating keys for groups
VERTEX_MANAGER* m_currentManager; ///< Currently used VERTEX_MANAGER (for storing
///< VERTEX_ITEMs). ///< VERTEX_ITEMs).
VERTEX_MANAGER* cachedManager; ///< Container for storing cached VERTEX_ITEMs VERTEX_MANAGER* m_cachedManager; ///< Container for storing cached VERTEX_ITEMs
VERTEX_MANAGER* nonCachedManager; ///< Container for storing non-cached VERTEX_ITEMs VERTEX_MANAGER* m_nonCachedManager; ///< Container for storing non-cached VERTEX_ITEMs
VERTEX_MANAGER* overlayManager; ///< Container for storing overlaid VERTEX_ITEMs VERTEX_MANAGER* m_overlayManager; ///< Container for storing overlaid VERTEX_ITEMs
// Framebuffer & compositing // Framebuffer & compositing
OPENGL_COMPOSITOR* compositor; ///< Handles multiple rendering targets OPENGL_COMPOSITOR* m_compositor; ///< Handles multiple rendering targets
unsigned int mainBuffer; ///< Main rendering target unsigned int m_mainBuffer; ///< Main rendering target
unsigned int overlayBuffer; ///< Auxiliary rendering target (for menus etc.) unsigned int m_overlayBuffer; ///< Auxiliary rendering target (for menus etc.)
RENDER_TARGET currentTarget; ///< Current rendering target RENDER_TARGET m_currentTarget; ///< Current rendering target
// Shader // Shader
SHADER* shader; ///< There is only one shader used for different SHADER* m_shader; ///< There is only one shader used for different
///< objects. ///< objects.
// Internal flags // Internal flags
bool isFramebufferInitialized; ///< Are the framebuffers initialized? bool m_isFramebufferInitialized; ///< Are the framebuffers initialized?
static bool isBitmapFontLoaded; ///< Is the bitmap font texture loaded? static bool m_isBitmapFontLoaded; ///< Is the bitmap font texture loaded?
bool isBitmapFontInitialized; ///< Is the shader set to use bitmap fonts? bool m_isBitmapFontInitialized; ///< Is the shader set to use bitmap fonts?
bool isInitialized; ///< Basic initialization flag, has to be done bool m_isInitialized; ///< Basic initialization flag, has to be
///< when the window is visible ///< done when the window is visible
bool isGrouping; ///< Was a group started? bool m_isGrouping; ///< Was a group started?
bool m_isContextLocked; ///< Used for assertion checking bool m_isContextLocked; ///< Used for assertion checking
int lockClientCookie; int m_lockClientCookie;
GLint ufm_worldPixelSize; GLint ufm_worldPixelSize;
GLint ufm_screenPixelSize; GLint ufm_screenPixelSize;
GLint ufm_pixelSizeMultiplier; GLint ufm_pixelSizeMultiplier;
std::unique_ptr<GL_BITMAP_CACHE> bitmapCache; std::unique_ptr<GL_BITMAP_CACHE> m_bitmapCache;
// Polygon tesselation
GLUtesselator* m_tesselator;
std::deque< boost::shared_array<GLdouble> > m_tessIntersects;
void lockContext( int aClientCookie ) override; void lockContext( int aClientCookie ) override;
@ -353,12 +358,6 @@ private:
///< Update handler for OpenGL settings ///< Update handler for OpenGL settings
bool updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) override; bool updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) override;
// Polygon tesselation
/// The tessellator
GLUtesselator* tesselator;
/// Storage for intersecting points
std::deque< boost::shared_array<GLdouble> > tessIntersects;
/** /**
* @brief Draw a quad for the line. * @brief Draw a quad for the line.
* *
@ -370,7 +369,7 @@ private:
/** /**
* Draw a semicircle. * Draw a semicircle.
* *
* Depending on settings (isStrokeEnabled & isFilledEnabled) it runs the proper function * Depending on settings (m_isStrokeEnabled & isFilledEnabled) it runs the proper function
* (drawStrokedSemiCircle or drawFilledSemiCircle). * (drawStrokedSemiCircle or drawFilledSemiCircle).
* *
* @param aCenterPoint is the center point. * @param aCenterPoint is the center point.

View File

@ -24,16 +24,16 @@ void screenSpaceLine( KIGFX::GAL* gal, const VECTOR2D& p0, const VECTOR2D& p1, d
#if 0 #if 0
//shader->Deactivate(); //shader->Deactivate();
currentManager->Reserve( 6 ); m_currentManager->Reserve( 6 );
currentManager->Shader( SHADER_NONE ); m_currentManager->Shader( SHADER_NONE );
currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a ); m_currentManager->Color( m_strokeColor.r, m_strokeColor.g, m_strokeColor.b, m_strokeColor.a );
currentManager->Shader( SHADER_NONE ); currentManager->Vertex( pa.x, pa.y, layerDepth ); m_currentManager->Shader( SHADER_NONE ); m_currentManager->Vertex( pa.x, pa.y, m_layerDepth );
currentManager->Shader( SHADER_NONE ); currentManager->Vertex( pb.x, pb.y, layerDepth ); m_currentManager->Shader( SHADER_NONE ); m_currentManager->Vertex( pb.x, pb.y, m_layerDepth );
currentManager->Shader( SHADER_NONE ); currentManager->Vertex( pc.x, pc.y, layerDepth ); m_currentManager->Shader( SHADER_NONE ); m_currentManager->Vertex( pc.x, pc.y, m_layerDepth );
currentManager->Shader( SHADER_NONE ); currentManager->Vertex( pa.x, pa.y, layerDepth ); m_currentManager->Shader( SHADER_NONE ); m_currentManager->Vertex( pa.x, pa.y, m_layerDepth );
currentManager->Shader( SHADER_NONE ); currentManager->Vertex( pc.x, pc.y, layerDepth ); m_currentManager->Shader( SHADER_NONE ); m_currentManager->Vertex( pc.x, pc.y, m_layerDepth );
currentManager->Shader( SHADER_NONE ); currentManager->Vertex( pd.x, pd.y, layerDepth ); m_currentManager->Shader( SHADER_NONE ); m_currentManager->Vertex( pd.x, pd.y, m_layerDepth );
shader->Use(); shader->Use();
#endif #endif