wxRect2DDouble wxPlotMarker::GetPlotRect() const { wxCHECK_MSG(Ok(), wxRect2DDouble(), wxT("Invalid plot marker")); return M_PMARKERDATA->m_rect; }
void wxGenericColour::SetRed( unsigned char r ) { wxCHECK_RET(Ok(), wxT("Invalid generic colour")); M_GCOLOURDATA->m_r = r; }
void wxGenericColour::SetBlue( unsigned char b ) { wxCHECK_RET(Ok(), wxT("Invalid generic colour")); M_GCOLOURDATA->m_b = b; }
int wxFont::GetPointSize() const { wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); return M_FONTDATA->GetPointSize(); }
wxFontFamily wxFont::GetFamily() const { wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") ); return M_FONTDATA->GetFamily(); }
bool wxFont::GetUnderlined() const { wxCHECK_MSG( Ok(), false, wxT("invalid font") ); return M_FONTDATA->GetUnderlined(); }
bool wxFont::IsFixedWidth() const { wxCHECK_MSG( Ok(), false, wxT("invalid font") ); return M_FONTDATA->IsFixedWidth(); }
WXHICON wxIcon::GetHICON() const { wxASSERT( Ok() ) ; return (WXHICON) ((wxIconRefData*)m_refData)->GetHICON() ; }
int wxIcon::GetHeight() const { wxCHECK_MSG( Ok(), -1, wxT("invalid icon") ); return M_ICONDATA->GetHeight(); }
int wxPen::GetWidth() const { wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); return M_PENDATA->m_width; }
wxColour &wxPen::GetColour() const { wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); return M_PENDATA->m_colour; }
int wxPen::GetStyle() const { wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); return M_PENDATA->m_style; }
// Find an existing, or create a new, XFontStruct // based on this wxFont and the given scale. Append the // font to list in the private data for future reference. wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const { if ( !Ok() ) return NULL; long intScale = long(scale * 100.0 + 0.5); // key for wxXFont int pointSize = (M_FONTDATA->m_pointSize * 10 * intScale) / 100; // search existing fonts first wxList::compatibility_iterator node = M_FONTDATA->m_fonts.GetFirst(); while (node) { wxXFont* f = (wxXFont*) node->GetData(); if ((!display || (f->m_display == display)) && (f->m_scale == intScale)) return f; node = node->GetNext(); } // not found, create a new one wxString xFontSpec; XFontStruct *font = (XFontStruct *) wxLoadQueryNearestFont(pointSize, M_FONTDATA->m_family, M_FONTDATA->m_style, M_FONTDATA->m_weight, M_FONTDATA->m_underlined, wxT(""), M_FONTDATA->m_encoding, &xFontSpec); if ( !font ) { wxFAIL_MSG( wxT("Could not allocate even a default font -- something is wrong.") ); return NULL; } wxXFont* f = new wxXFont; #if wxMOTIF_NEW_FONT_HANDLING XFreeFont( (Display*) display, font ); #else f->m_fontStruct = (WXFontStructPtr)font; #endif f->m_display = ( display ? display : wxGetDisplay() ); f->m_scale = intScale; #if wxMOTIF_USE_RENDER_TABLE XmRendition rendition; XmRenderTable renderTable; Arg args[5]; int count = 0; #if wxMOTIF_NEW_FONT_HANDLING char* fontSpec = wxStrdup(xFontSpec.mb_str()); XtSetArg( args[count], XmNfontName, fontSpec ); ++count; XtSetArg( args[count], XmNfontType, XmFONT_IS_FONTSET ); ++count; #else XtSetArg( args[count], XmNfont, font ); ++count; #endif XtSetArg( args[count], XmNunderlineType, GetUnderlined() ? XmSINGLE_LINE : XmNO_LINE ); ++count; rendition = XmRenditionCreate( XmGetXmDisplay( (Display*)f->m_display ), (XmStringTag)"", args, count ); renderTable = XmRenderTableAddRenditions( NULL, &rendition, 1, XmMERGE_REPLACE ); f->m_renderTable = (WXRenderTable)renderTable; f->m_rendition = (WXRendition)rendition; wxASSERT( f->m_renderTable != NULL ); #else // if !wxMOTIF_USE_RENDER_TABLE f->m_fontList = XmFontListCreate ((XFontStruct*) font, XmSTRING_DEFAULT_CHARSET); wxASSERT( f->m_fontList != NULL ); #endif M_FONTDATA->m_fonts.Append(f); return f; }
wxRect2DDouble& wxPlotMarker::GetPlotRect() { static wxRect2DDouble s_rect; wxCHECK_MSG(Ok(), s_rect, wxT("Invalid plot marker")); return M_PMARKERDATA->m_rect; }
wxFontStyle wxFont::GetStyle() const { wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->GetStyle(); }
bool wxFont::GetNoAntiAliasing() const { wxCHECK_MSG( Ok(), false, wxT("invalid font") ); return M_FONTDATA->GetNoAntiAliasing(); }
wxFontWeight wxFont::GetWeight() const { wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->GetWeight(); }
void wxGCDC::SetTextBackground( const wxColour &col ) { wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::SetTextBackground - invalid DC") ); m_textBackgroundColour = col; }
wxFontEncoding wxFont::GetEncoding() const { wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); return M_FONTDATA->GetEncoding(); }
void wxGCDC::DoDrawPoint( wxCoord x, wxCoord y ) { wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawPoint - invalid DC") ); DoDrawLine( x , y , x + 1 , y + 1 ); }
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); return M_FONTDATA->GetNativeFontInfo(); }
bool wxGCDC::CanGetTextExtent() const { wxCHECK_MSG( Ok(), false, wxT("wxGCDC(cg)::CanGetTextExtent - invalid DC") ); return true; }
wxString wxFont::GetFaceName() const { wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->GetFaceName(); }
void BL_Shader::Update( const RAS_MeshSlot & ms, RAS_IRasterizer* rasty ) { if (!Ok() || !mPreDef.size()) return; if ( GLEW_ARB_fragment_shader && GLEW_ARB_vertex_shader && GLEW_ARB_shader_objects ) { MT_Matrix4x4 model; model.setValue(ms.m_OpenGLMatrix); const MT_Matrix4x4& view = rasty->GetViewMatrix(); if (mAttr==SHD_TANGENT) ms.m_mesh->SetMeshModified(true); BL_UniformVecDef::iterator it; for (it = mPreDef.begin(); it!= mPreDef.end(); it++) { BL_DefUniform *uni = (*it); if (uni->mLoc == -1) continue; switch (uni->mType) { case MODELMATRIX: { SetUniform(uni->mLoc, model); break; } case MODELMATRIX_TRANSPOSE: { SetUniform(uni->mLoc, model, true); break; } case MODELMATRIX_INVERSE: { model.invert(); SetUniform(uni->mLoc, model); break; } case MODELMATRIX_INVERSETRANSPOSE: { model.invert(); SetUniform(uni->mLoc, model, true); break; } case MODELVIEWMATRIX: { SetUniform(uni->mLoc, view*model); break; } case MODELVIEWMATRIX_TRANSPOSE: { MT_Matrix4x4 mat(view*model); SetUniform(uni->mLoc, mat, true); break; } case MODELVIEWMATRIX_INVERSE: { MT_Matrix4x4 mat(view*model); mat.invert(); SetUniform(uni->mLoc, mat); break; } case MODELVIEWMATRIX_INVERSETRANSPOSE: { MT_Matrix4x4 mat(view*model); mat.invert(); SetUniform(uni->mLoc, mat, true); break; } case CAM_POS: { MT_Point3 pos(rasty->GetCameraPosition()); SetUniform(uni->mLoc, pos); break; } case VIEWMATRIX: { SetUniform(uni->mLoc, view); break; } case VIEWMATRIX_TRANSPOSE: { SetUniform(uni->mLoc, view, true); break; } case VIEWMATRIX_INVERSE: { MT_Matrix4x4 viewinv = view; viewinv.invert(); SetUniform(uni->mLoc, view); break; } case VIEWMATRIX_INVERSETRANSPOSE: { MT_Matrix4x4 viewinv = view; viewinv.invert(); SetUniform(uni->mLoc, view, true); break; } case CONSTANT_TIMER: { SetUniform(uni->mLoc, (float)rasty->GetTime()); break; } default: break; } } } }
void wxGenericColour::Set( const wxString& colourName ) { wxCHECK_RET(Ok(), wxT("Invalid generic colour")); Set(wxColour(colourName)); }
wxBrushStyle wxBrush::GetStyle() const { wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; }
void wxGenericColour::SetGreen( unsigned char g ) { wxCHECK_RET(Ok(), wxT("Invalid generic colour")); M_GCOLOURDATA->m_g = g; }
wxColour wxBrush::GetColour() const { wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; }
void wxGenericColour::SetAlpha( unsigned char a ) { wxCHECK_RET(Ok(), wxT("Invalid generic colour")); M_GCOLOURDATA->m_a = a; }
void wxPlotMarker::SetMarkerType(int type) { wxCHECK_RET(Ok(), wxT("Invalid plot marker")); M_PMARKERDATA->m_markerType = type; }