void MDAL::DriverGdal::createMesh() { Vertices vertices( meshGDALDataset()->mNPoints ); bool is_longitude_shifted = initVertices( vertices ); Faces faces( meshGDALDataset()->mNVolumes ); initFaces( vertices, faces, is_longitude_shifted ); mMesh.reset( new MemoryMesh( name(), vertices.size(), faces.size(), 4, //maximum quads computeExtent( vertices ), mFileName ) ); mMesh->vertices = vertices; mMesh->faces = faces; bool proj_added = addSrcProj(); if ( ( !proj_added ) && is_longitude_shifted ) { std::string wgs84( "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" ); mMesh->setSourceCrs( wgs84 ); } }
void CustomSmileyManager::init( ) { // doesn't support import/export to eip package tbtnImport->hide(); tbtnExport->hide(); // cancel does same job as ok, so hide it for now btnCancel->hide(); lblPreview->setAlignment( TQt::AlignHCenter | TQt::AlignVCenter ); d = new GroupActionPrivate; d->m_Action = GroupActionPrivate::GNone; d->m_Item = 0; d->m_OldName = ""; if(m_Config) delete m_Config; TQString dir = EvaMain::user->getSetting()->getCustomSmileyDir() + "/"; m_Config = new CustomFaceConfig(dir); m_Config->loadXML(); // group list first loadGroups(); // init table initFaces(); lvGroups->setSelected( lvGroups->firstChild(), true); }
// Initialize variables and call initalizations for the window, openGL, and textures void init() { clockwise = true; rotVel = 0.5; negRotVel = rotVel * -1.0; initFaces(); initWindow(); initOpenGL(); initTextures(); }
//---------------------------------------------------------------- // TO DO: Complete this function to create your sphere // The sphere is a unit icosphere centered at the origin (0,0,0). // First add a key press event in KeyCallback that will call this function //---------------------------------------------------------------- void createSphere(void) { globalCount = 0; //for subdivisions // TO DO: Optional remove this as a global var // triangle mesh object std::vector<STTriangleMesh *> gTriangleMeshes_sphere; // vertices std::vector<STVector3> vertices; // Creates the initial verticies initVertices(&vertices); //----------------------------------------------------- // TO DO: create the faces of the intIcosahedron // Place your code in the function initFaces() //----------------------------------------------------- std::vector<TriangleIndices> faces; initFaces(&faces); //--------------------------------------------------------------- // TO DO: Recursively split each triangle into four triangles // See images in docs/icosahedron/ // Determine the levels for the recursion by changing the value in levels //---------------------------------------------------------------- std::vector<TriangleIndices> newfaces; int levels = 1; subDivideTriangles(levels, &faces, &newfaces, &vertices); //----------------------------------------------------------------- // TO DO: Once faces are generated, add each triangle to the // mesh. Place your code in createMySphereMesh() // call createMySphereMesh here //----------------------------------------------------------------- //piyush add code // std::vector<STTriangleMesh*> tmesh; STTriangleMesh *tmesh = new STTriangleMesh(); for(int i =0; i<vertices.size(); i++){ tmesh->AddVertex(vertices.at(i).x, vertices.at(i).y, vertices.at(i).z); } for(int i=0; i< faces.size(); i++){ createMySphereMesh(tmesh, faces[i], &vertices); gTriangleMeshes_sphere.push_back(tmesh); } // save the result sphere for(unsigned int id=0;id<gTriangleMeshes_sphere.size(); id++) gTriangleMeshes_sphere[id]->Write("mysphere.obj"); }
void MDAL::LoaderGdal::createMesh() { Vertices vertices( meshGDALDataset()->mNPoints ); bool is_longitude_shifted = initVertices( vertices ); Faces faces( meshGDALDataset()->mNVolumes ); initFaces( vertices, faces, is_longitude_shifted ); mMesh.reset( new Mesh() ); mMesh->vertices = vertices; mMesh->faces = faces; bool proj_added = addSrcProj(); if ( ( !proj_added ) && is_longitude_shifted ) { std::string wgs84( "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" ); mMesh->setSourceCrs( wgs84 ); } }
CoreHaxFunc::CoreHaxFunc() { debug = new dbg(); debug->cleanFile(); initFaces(); }