template <class T> void DebugRecorder<T>::recordPoint(const std::string &entityId, const Point3<T>& point)
	{
		std::ostringstream oss;
		oss.precision(std::numeric_limits<float>::max_digits10);

		oss<<point.X<<" "<<point.Y<<" "<<point.Z<<std::endl;

		writeAction(std::string(POINT3_ACTION) + ": " + entityId + "\n" + oss.str());
	}
示例#2
0
void
vpSimulator::save(const char *name,bool binary)
{
  // get a pointer to the object "name"
  SoOutput output ;
  output.openFile(name) ;

  if (binary==true)  output.setBinary(TRUE) ;

  SoWriteAction writeAction(&output) ;
  writeAction.apply(scene) ;
  output.closeFile() ;

}
示例#3
0
void
MainWindow::saveScene()
{
	SoOutput output;
	
	if (!output.openFile(QString("coach-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".wrl").toStdString().c_str()))
	{
		return;
	}
	
	output.setHeaderString("#VRML V2.0 utf8");
	
	SoWriteAction writeAction(&output);
	writeAction.apply(this->scene->root);
	
	output.closeFile();
}
	template <class T> void DebugRecorder<T>::recordConvexHull(const std::string &entityId, const ConvexHull3D<T> &convexHull)
	{
		std::ostringstream oss;
		oss.precision(std::numeric_limits<float>::max_digits10);

		oss<<NUM_INDEXED_POINTS<<": "<<convexHull.getIndexedPoints().size()<<std::endl;
		for(auto  &it : convexHull.getIndexedPoints())
		{
			oss<<it.first<<": "<<it.second.X<<" "<<it.second.Y<<" "<<it.second.Z<<std::endl;
		}

		oss<<NUM_INDEXED_TRIANGLES<<": "<<convexHull.getIndexedTriangles().size()<<std::endl;
		for(auto  &it : convexHull.getIndexedTriangles())
		{
			oss<<it.first<<": "<<it.second.getIndexes()[0]<<" "<<it.second.getIndexes()[1]<<" "<<it.second.getIndexes()[2]<<std::endl;
		}

		writeAction(std::string(CONVEX_HULL_3D_ACTION) + ": " + entityId + "\n" + oss.str());
	}
示例#5
0
void
Viewer::saveScene()
{
	QString filename = "rlPlanDemo-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmsszzz") + ".wrl";
	
	SoOutput output;
	
	if (!output.openFile(filename.toStdString().c_str()))
	{
		return;
	}
	
	output.setHeaderString("#VRML V2.0 utf8");
	
	SoWriteAction writeAction(&output);
	writeAction.apply(this->root);
	
	output.closeFile();
	
	MainWindow::instance()->statusBar()->showMessage("Successfully saved scene in '" + filename + "'.", 1000);
}
	template <class T> void DebugRecorder<T>::clearEntity(const std::string &entityId)
	{
		std::string content = std::string(CLEAR_ENTITY_ACTION) + ": " + entityId + "\n";
		writeAction(content);
	}