/*将自己逆掉,如果不可以返回false,否则返回true*/ BOHGE_FORCEINLINE bool InverseSelf() { if( true == GetInverse(*this) ) { return true; } return false; }
D3DXVECTOR3 Quaternion::Rotate(const D3DXVECTOR3& vector){ Quaternion v(vector.x, vector.y, vector.z, 0.0f); //Quaternion q = GetInverse().Product(v).Product(*this); Quaternion q = Product(v).Product(GetInverse()); return D3DXVECTOR3(q.x, q.y, q.z); }
BOHGE_FORCEINLINE void InverseSelf() { GetInverse( *this ); }
void Mat3x3::Invert(void) { *this = GetInverse(); }
CMatrix3D CMatrix3D::GetInverse() const { CMatrix3D r; GetInverse(r); return r;
void CodeEdit::SetFontColorSettings(const FontColorSettings& settings) { // For some reason StyleSetFont takes a (non-const) reference, so we need to make // a copy before passing it in. wxFont font = settings.GetFont(); SetSelForeground(true, settings.GetColors(FontColorSettings::DisplayItem_Selection).foreColor); SetSelBackground(true, settings.GetColors(FontColorSettings::DisplayItem_Selection).backColor); StyleSetFont(wxSTC_STYLE_DEFAULT, font); StyleClearAll(); font = settings.GetFont(FontColorSettings::DisplayItem_Default); StyleSetFont(wxSTC_LUA_DEFAULT, font); StyleSetFont(wxSTC_LUA_IDENTIFIER, font); StyleSetForeground(wxSTC_LUA_DEFAULT, settings.GetColors(FontColorSettings::DisplayItem_Default).foreColor); StyleSetBackground(wxSTC_LUA_DEFAULT, settings.GetColors(FontColorSettings::DisplayItem_Default).backColor); StyleSetForeground(wxSTC_STYLE_DEFAULT, settings.GetColors(FontColorSettings::DisplayItem_Default).foreColor); StyleSetBackground(wxSTC_STYLE_DEFAULT, settings.GetColors(FontColorSettings::DisplayItem_Default).backColor); StyleSetForeground(wxSTC_LUA_IDENTIFIER, settings.GetColors(FontColorSettings::DisplayItem_Default).foreColor); StyleSetBackground(wxSTC_LUA_IDENTIFIER, settings.GetColors(FontColorSettings::DisplayItem_Default).backColor); font = settings.GetFont(FontColorSettings::DisplayItem_Comment); StyleSetFont(wxSTC_LUA_COMMENT, font); StyleSetFont(wxSTC_LUA_COMMENTLINE, font); StyleSetFont(wxSTC_LUA_COMMENTDOC, font); StyleSetForeground(wxSTC_LUA_COMMENT, settings.GetColors(FontColorSettings::DisplayItem_Comment).foreColor); StyleSetBackground(wxSTC_LUA_COMMENT, settings.GetColors(FontColorSettings::DisplayItem_Comment).backColor); StyleSetForeground(wxSTC_LUA_COMMENTLINE, settings.GetColors(FontColorSettings::DisplayItem_Comment).foreColor); StyleSetBackground(wxSTC_LUA_COMMENTLINE, settings.GetColors(FontColorSettings::DisplayItem_Comment).backColor); StyleSetForeground(wxSTC_LUA_COMMENTDOC, settings.GetColors(FontColorSettings::DisplayItem_Comment).foreColor); StyleSetBackground(wxSTC_LUA_COMMENTDOC, settings.GetColors(FontColorSettings::DisplayItem_Comment).backColor); font = settings.GetFont(FontColorSettings::DisplayItem_Keyword); StyleSetFont(wxSTC_LUA_WORD2, font); StyleSetForeground(wxSTC_LUA_WORD2, settings.GetColors(FontColorSettings::DisplayItem_Keyword).foreColor); StyleSetBackground(wxSTC_LUA_WORD2, settings.GetColors(FontColorSettings::DisplayItem_Keyword).backColor); font = settings.GetFont(FontColorSettings::DisplayItem_Operator); StyleSetFont(wxSTC_LUA_OPERATOR, font); StyleSetForeground(wxSTC_LUA_OPERATOR, settings.GetColors(FontColorSettings::DisplayItem_Operator).foreColor); StyleSetBackground(wxSTC_LUA_OPERATOR, settings.GetColors(FontColorSettings::DisplayItem_Operator).backColor); font = settings.GetFont(FontColorSettings::DisplayItem_String); StyleSetFont(wxSTC_LUA_STRING, font); StyleSetForeground(wxSTC_LUA_STRING, settings.GetColors(FontColorSettings::DisplayItem_String).foreColor); StyleSetBackground(wxSTC_LUA_STRING, settings.GetColors(FontColorSettings::DisplayItem_String).backColor); StyleSetFont(wxSTC_LUA_STRINGEOL, font); StyleSetForeground(wxSTC_LUA_STRINGEOL, settings.GetColors(FontColorSettings::DisplayItem_String).foreColor); StyleSetBackground(wxSTC_LUA_STRINGEOL, settings.GetColors(FontColorSettings::DisplayItem_String).backColor); StyleSetFont(wxSTC_LUA_LITERALSTRING, font); StyleSetForeground(wxSTC_LUA_LITERALSTRING, settings.GetColors(FontColorSettings::DisplayItem_String).foreColor); StyleSetBackground(wxSTC_LUA_LITERALSTRING, settings.GetColors(FontColorSettings::DisplayItem_String).backColor); StyleSetFont(wxSTC_LUA_CHARACTER, font); StyleSetForeground(wxSTC_LUA_CHARACTER, settings.GetColors(FontColorSettings::DisplayItem_String).foreColor); StyleSetBackground(wxSTC_LUA_CHARACTER, settings.GetColors(FontColorSettings::DisplayItem_String).backColor); font = settings.GetFont(FontColorSettings::DisplayItem_Number); StyleSetFont(wxSTC_LUA_NUMBER, font); StyleSetForeground(wxSTC_LUA_NUMBER, settings.GetColors(FontColorSettings::DisplayItem_Number).foreColor); StyleSetBackground(wxSTC_LUA_NUMBER, settings.GetColors(FontColorSettings::DisplayItem_Number).backColor); StyleSetSize(wxSTC_STYLE_LINENUMBER, font.GetPointSize()); // Set the caret color as the inverse of the background color so it's always visible. SetCaretForeground( GetInverse(settings.GetColors(FontColorSettings::DisplayItem_Default).backColor) ); StyleSetBackground(wxSTC_STYLE_LINENUMBER, settings.GetColors(FontColorSettings::DisplayItem_WindowMargin).backColor); StyleSetForeground(wxSTC_STYLE_LINENUMBER, settings.GetColors(FontColorSettings::DisplayItem_WindowMargin).foreColor); //SetFoldMarginHiColour(true, settings.GetColors(FontColorSettings::DisplayItem_Window).backColor); }