//==== Decode XML ====// xmlNodePtr PtCloudGeom::DecodeXml( xmlNodePtr & node ) { Geom::DecodeXml( node ); xmlNodePtr ptcloud_node = XmlUtil::GetNode( node, "PtCloudGeom", 0 ); if ( ptcloud_node ) { // Read in old encoding if it exists. m_Pts = XmlUtil::ExtractVectorVec3dNode( ptcloud_node, "Points" ); // Read in new encoding if they exist. xmlNodePtr pt_list_node = XmlUtil::GetNode( ptcloud_node, "Pt_List", 0 ); if ( pt_list_node ) { int num_pts = XmlUtil::GetNumNames( pt_list_node, "Pt" ); m_Pts.reserve( m_Pts.size() + num_pts ); xmlNodePtr iter_node = pt_list_node->xmlChildrenNode; while( iter_node != NULL ) { if ( !xmlStrcmp( iter_node->name, ( const xmlChar * )"Pt" ) ) { vec3d pt = XmlUtil::GetVec3dNode( iter_node ); m_Pts.push_back( pt ); } iter_node = iter_node->next; } } } InitPts(); return ptcloud_node; }
int PtCloudGeom::ReadPTS( const char* file_name ) { FILE* file_id = fopen( file_name, "r" ); if ( !file_id ) { return 0; } else { m_Pts.clear(); int stopFlag = 0; while ( !stopFlag ) { double x, y, z; if ( EOF == fscanf( file_id, "%lf %lf %lf\n", &x, &y, &z ) ) { break; } m_Pts.push_back( vec3d( x, y, z ) ); } fclose( file_id ); } if ( m_Pts.size() == 0 ) { return 0; } InitPts(); return 1; }
REAL cEqOneHomogFormelle::cOneHEq::ResiduSigneP1P2(Pt2dr aP1,Pt2dr aP2) { InitPts(aP1,aP2); return mEQF.mSet.ResiduSigne(pFEq); }
REAL cEqOneHomogFormelle::cOneHEq::AddLiaisonP1P2(Pt2dr aP1,Pt2dr aP2,REAL aPds,bool WithD2) { InitPts(aP1,aP2); return mEQF.mSet.AddEqFonctToSys(pFEq,aPds,WithD2); }