- if (! _facesIDsPeriodicityVector.empty()){
- MESSAGE("INTO FACE PERIODICITY");
- for (std::size_t i=0; i < _facesIDsPeriodicityVector.size(); i++){
- int theFace1 = _facesIDsPeriodicityVector[i].first;
- int theFace2 = _facesIDsPeriodicityVector[i].second;
- MESSAGE("_facesIDsPeriodicityVector[" << i << "] = (" << theFace1 << ", " << theFace2 << ")");
- status = cad_add_face_periodicity(c, theFace1, theFace2);
- if(status != STATUS_OK){
- cout << "cad_add_face_periodicity failed with error code " << status << "\n";
- }
- }
- MESSAGE("END FACE PERIODICITY");
- }
-
-
- if (! _edgesIDsPeriodicityVector.empty()){
- MESSAGE("INTO EDGE PERIODICITY");
- for (std::size_t i=0; i < _edgesIDsPeriodicityVector.size(); i++){
- int theFace1 = _edgesIDsPeriodicityVector[i].theFace1ID;
- int theEdge1 = _edgesIDsPeriodicityVector[i].theEdge1ID;
- int theFace2 = _edgesIDsPeriodicityVector[i].theFace2ID;
- int theEdge2 = _edgesIDsPeriodicityVector[i].theEdge2ID;
- int edge_orientation = _edgesIDsPeriodicityVector[i].edge_orientation;
- MESSAGE("_edgesIDsPeriodicityVector[" << i << "] = (" << theFace1 << ", " << theEdge1 << ", " << theFace2 << ", " << theEdge2 << ", " << edge_orientation << ")");
- status = cad_add_edge_periodicity(c, theFace1, theEdge1, theFace2, theEdge2, edge_orientation);
- if(status != STATUS_OK){
- cout << "cad_add_edge_periodicity failed with error code " << status << "\n";
- }
- }
- MESSAGE("END EDGE PERIODICITY");
- }
-
- if (! _verticesIDsPeriodicityVector.empty()){
- MESSAGE("INTO VERTEX PERIODICITY");
- for (std::size_t i=0; i < _verticesIDsPeriodicityVector.size(); i++){
- int theEdge1 = _verticesIDsPeriodicityVector[i].theEdge1ID;
- int theVertex1 = _verticesIDsPeriodicityVector[i].theVertex1ID;
- int theEdge2 = _verticesIDsPeriodicityVector[i].theEdge2ID;
- int theVertex2 = _verticesIDsPeriodicityVector[i].theVertex2ID;
- MESSAGE("_verticesIDsPeriodicityVector[" << i << "] = (" << theEdge1 << ", " << theVertex1 << ", " << theEdge2 << ", " << theVertex2 << ")");
- status = cad_add_point_periodicity(c, theEdge1, theVertex1, theEdge2, theVertex2);
- if(status != STATUS_OK){
- cout << "cad_add_vertex_periodicity failed with error code " << status << "\n";
- }
- }
- MESSAGE("END VERTEX PERIODICITY");
- }
-
- ////
-
- if (use_precad) {
- MESSAGE("use_precad");
- /* Now launch the PreCAD process */
- status = precad_process(pcs);
- if(status != STATUS_OK){
- // TODO: raise an error if status < 0.
- cout << "================ WARNING =================== \n";
- stringstream msg;
- msg << "PreCAD processing failed with error code " << status << "\n";
- msg << *mcud._error;
- cout << msg.str();
- cout << "============================================ \n";
- // the text of _comment is set in message_cb by mcud->_error
- // => No need to append msg to _comment
- if (status > 0)
- {
- // TODO: fix the SIGSEGV of COMPERR_WARNING with 2 launches
- error(COMPERR_WARNING, _comment);
- }
- if (status < 0)
- {
- error(_comment);
- }
- }
- else {
- // retrieve the pre-processed CAD object
-
- // dcad
- cleandc = precad_new_dcad(pcs);
- if(!cleandc){
- cout << "Unable to retrieve PreCAD result on dcad \n";
- }
- else
- cout << "PreCAD processing successfull on dcad \n";
-
- // cad
- cleanc = precad_new_cad(pcs);
- if(!cleanc){
- cout << "Unable to retrieve PreCAD result on cad \n";
- }
- else
- cout << "PreCAD processing successfull on cad \n";
-
- // #if BLSURF_VERSION_LONG >= "3.1.1"
- // /* We can now get the updated sizemaps (if any) */
- // // if(geo_sizemap_e)
- // // clean_geo_sizemap_e = precad_new_sizemap(pcs, geo_sizemap_e);
- // //
- // // if(geo_sizemap_f)
- // // clean_geo_sizemap_f = precad_new_sizemap(pcs, geo_sizemap_f);
- //
- // if(iso_sizemap_p)
- // clean_iso_sizemap_p = precad_new_sizemap(pcs, iso_sizemap_p);
- //
- // if(iso_sizemap_e)
- // clean_iso_sizemap_e = precad_new_sizemap(pcs, iso_sizemap_e);
- //
- // if(iso_sizemap_f)
- // clean_iso_sizemap_f = precad_new_sizemap(pcs, iso_sizemap_f);
- // #endif
- }
- // Now we can delete the PreCAD session
- precad_session_delete(pcs);
- }