コード例 #1
0
ファイル: werkstuck.cpp プロジェクト: ra3xdh/HeidCAM
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);
}
コード例 #2
0
ファイル: beamtest.cpp プロジェクト: jf---/openshapefactory
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;

}
コード例 #3
0
ファイル: beamtest.cpp プロジェクト: jf---/openshapefactory
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;

}