BuildPage::BuildPage( wxWindow* parent, int id, wxPoint pos, wxSize size, int style ) : wxPanel( parent, id, pos, size, style ) { wxBoxSizer* mainSizer; mainSizer = new wxBoxSizer( wxVERTICAL ); m_staticText = new wxStaticText( this, wxID_ANY, wxT("Available Build Systems:"), wxDefaultPosition, wxDefaultSize, 0 ); mainSizer->Add( m_staticText, 0, wxALL, 5 ); m_bookBuildSystems = new wxChoicebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCHB_DEFAULT ); mainSizer->Add( m_bookBuildSystems, 0, wxEXPAND | wxALL, 5 ); m_fixOnStartup = new wxCheckBox(this, wxID_ANY, wxT("Fix build tool path on startup")); mainSizer->Add( m_fixOnStartup, 0, wxEXPAND | wxALL, 5 ); m_useFullPaths = new wxCheckBox(this, wxID_ANY, wxT("When compiling, pass absolute path of the file to the compiler")); mainSizer->Add( m_useFullPaths, 0, wxEXPAND | wxALL, 5 ); long fix(1); EditorConfigST::Get()->GetLongValue(wxT("FixBuildToolOnStartup"), fix); m_fixOnStartup->SetValue(fix ? true : false); long use_full_path(1); EditorConfigST::Get()->GetLongValue(wxT("GenerateFullPathMakefile"), use_full_path); m_useFullPaths->SetValue(use_full_path ? true : false); this->SetSizer( mainSizer ); this->Layout(); CustomInit(); }
/** * @brief * Splits the polygon */ bool Polygon::Split(const Plane &cSplitter, Polygon &cFrontPolygon, Polygon &cBackPolygon) { // Init splitted polygons cFrontPolygon.GetVertexList().Clear(); cBackPolygon.GetVertexList().Clear(); // Call custom init function CustomInit(cFrontPolygon); CustomInit(cBackPolygon); // Loop through vertices if (m_lstVertices.GetNumOfElements()) { Vector3 *pV1 = &m_lstVertices[m_lstVertices.GetNumOfElements()-1]; float fV1Distance = cSplitter.GetDistance(*pV1); for (uint32 i=0; i<m_lstVertices.GetNumOfElements(); i++) { Vector3 *pV2 = &m_lstVertices[i]; float fV2Distance = cSplitter.GetDistance(*pV2); Vector3 vDelta = (*pV2)-(*pV1); float fDistance = fV1Distance/(Math::Abs(fV1Distance)+Math::Abs(fV2Distance)); if (fV2Distance > Math::Epsilon) { // In front of splitter plane if (fV1Distance < Math::Epsilon) { // Line is splitted Vector3 vRes = (*pV1)+vDelta*(-fDistance); cFrontPolygon.GetVertexList().Add(vRes); cBackPolygon.GetVertexList().Add(vRes); // Call custom split function CustomSplit(cFrontPolygon, cBackPolygon, i, -fDistance); } cFrontPolygon.GetVertexList().Add(*pV2); // Call custom add function CustomAdd(cFrontPolygon, i); } else if (fV2Distance < Math::Epsilon) { // Behind splitter plane if (fV1Distance > Math::Epsilon) { // Line is splitted Vector3 vRes = (*pV1)+vDelta*fDistance; cFrontPolygon.GetVertexList().Add(vRes); cBackPolygon.GetVertexList().Add(vRes); // Call custom split function CustomSplit(cFrontPolygon, cBackPolygon, i, fDistance); } cBackPolygon.GetVertexList().Add(*pV2); // Call custom add function CustomAdd(cBackPolygon, i); } else { cFrontPolygon.GetVertexList().Add(*pV2); cBackPolygon.GetVertexList().Add(*pV2); // Call custom add functions CustomAdd(cFrontPolygon, i); CustomAdd(cBackPolygon, i); } pV1 = pV2; fV1Distance = fV2Distance; } } // Compute planes cFrontPolygon.ComputePlane(); cBackPolygon.ComputePlane(); // Done return true; }