Ejemplo n.º 1
0
void Werkstuck::AddVertex (double x, double y, double z, Handle_AIS_InteractiveContext theContext)
{
    TopoDS_Vertex aVertex=BRepBuilderAPI_MakeVertex( gp_Pnt(x,y,z) );
    Handle(AIS_Shape) AISVertex = new AIS_Shape(aVertex);
    // context is the handle to an AIS_InteractiveContext object.
    theContext->Display(AISVertex);
}
Ejemplo n.º 2
0
void beamtest::readbinary()
	{


QTime time;
time.start();
Handle_AIS_InteractiveContext ic = ui::getInstance()->getWindowContext();

QString filename = QFileDialog::getOpenFileName ( this,
							 tr("Import File"),"");

QFile file(filename);
file.open(QIODevice::ReadOnly);
QDataStream in(&file);    // read the data serialized from the file

QList<gp_Pnt> vertlist;
double x ;
double y ;
double z ;

int i=0;
do {

i++;
in >> x >> y >> z ;

if (i % 100000 == 0) qDebug() << i;
gp_Pnt thevert(x,y,z);
vertlist.append(thevert);
} while ( in.status() ==QDataStream::Ok );

file.close();

Handle(AIS_PointCloud) mypc1 = new AIS_PointCloud(vertlist);
ic->Display(mypc1);

double milliseconds = time.elapsed();
double seconds = (milliseconds/1000);
double minutes = seconds/60;
double hours = minutes/60;

QString timetxt;
QTextStream linestream(&timetxt);
linestream << "h" << hours << ":m " << minutes << ":s " << seconds << ".ms" << milliseconds; 

ui::getInstance()->Statusbar(timetxt);
qDebug() <<  "time ellapsed reading binary file:" << timetxt;

}
Ejemplo n.º 3
0
void beamtest::readbinarywithcolor()
	{


QTime time;
time.start();
Handle_AIS_InteractiveContext ic = ui::getInstance()->getWindowContext();

QString filename = QFileDialog::getOpenFileName ( this,
												 tr("Import File"),"");

QFile file(filename);
 file.open(QIODevice::ReadOnly);
 QDataStream in(&file);    // read the data serialized from the file

 //double pcount;
 //in >> pcount ;         // extract "the answer is" and 42


//QProgressDialog progress("loading cloudpoint", "Abort Copy", 1,100);

//QList<Graphic3d_Vertex> vertlist;
QList<gp_Pnt> vertlist;




//for (int i=0;i < pcount;i++)
//{
	       
	double x ;
	double y ;
	double z ;
	double intensity;
	int i=0;
	do {
		
	i++;
	in >> x >> y >> z >> intensity;

	if (i % 100000 == 0) qDebug() << i;
	

			//Graphic3d_Vertex thevert(x,y,z);
			gp_Pnt thevert(x,y,z);
			vertlist.append(thevert);

//			Quantity_Color rgbval(intensity,0,0,Quantity_TOC_RGB);
//			colorlist.append(rgbval);


	//if (i > 30000000) break;
			
		} while ( in.status() ==QDataStream::Ok );

file.close();

Handle(AIS_PointCloud) mypc1 = new AIS_PointCloud(vertlist);
ic->Display(mypc1);

double milliseconds = time.elapsed();
double seconds = (milliseconds/1000);
double minutes = seconds/60;
double hours = minutes/60;

QString timetxt;
QTextStream linestream(&timetxt);
linestream << "h" << hours << ":m " << minutes << ":s " << seconds << ".ms" << milliseconds; 

ui::getInstance()->Statusbar(timetxt);
qDebug() <<  "time ellapsed:" << timetxt;

}