本文整理汇总了C++中Viewer3D类的典型用法代码示例。如果您正苦于以下问题:C++ Viewer3D类的具体用法?C++ Viewer3D怎么用?C++ Viewer3D使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Viewer3D类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char** argv )
{
if ( argc < 4 )
{
usage( argc, argv );
return 1;
}
std::string inputFilename = argv[ 1 ];
unsigned int minThreshold = atoi( argv[ 2 ] );
unsigned int maxThreshold = atoi( argv[ 3 ] );
//! [volScanBoundary-readVol]
trace.beginBlock( "Reading vol file into an image." );
typedef ImageSelector < Domain, int>::Type Image;
Image image = VolReader<Image>::importVol(inputFilename);
DigitalSet set3d (image.domain());
SetFromImage<DigitalSet>::append<Image>(set3d, image,
minThreshold, maxThreshold);
trace.endBlock();
//! [volScanBoundary-readVol]
//! [volScanBoundary-KSpace]
trace.beginBlock( "Construct the Khalimsky space from the image domain." );
KSpace ks;
bool space_ok = ks.init( image.domain().lowerBound(),
image.domain().upperBound(), true );
if (!space_ok)
{
trace.error() << "Error in the Khamisky space construction."<<std::endl;
return 2;
}
trace.endBlock();
//! [volScanBoundary-KSpace]
//! [volScanBoundary-ExtractingSurface]
trace.beginBlock( "Extracting boundary by scanning the space. " );
KSpace::SCellSet boundary;
Surfaces<KSpace>::sMakeBoundary( boundary, ks, set3d,
image.domain().lowerBound(),
image.domain().upperBound() );
trace.endBlock();
//! [volScanBoundary-ExtractingSurface]
//! [volScanBoundary-DisplayingSurface]
trace.beginBlock( "Displaying surface in Viewer3D." );
QApplication application(argc,argv);
Viewer3D viewer;
viewer.show();
viewer << CustomColors3D(Color(250, 0, 0 ), Color( 128, 128, 128 ) );
unsigned long nbSurfels = 0;
for ( KSpace::SCellSet::const_iterator it = boundary.begin(),
it_end = boundary.end(); it != it_end; ++it, ++nbSurfels )
viewer << *it;
viewer << Viewer3D::updateDisplay;
trace.info() << "nb surfels = " << nbSurfels << std::endl;
trace.endBlock();
return application.exec();
//! [volScanBoundary-DisplayingSurface]
}
开发者ID:kerautret,项目名称:DGCI_IPOL_Demo,代码行数:60,代码来源:volScanBoundary.cpp
示例2: testSphericalViewerInteger
bool testSphericalViewerInteger(int argc, char **argv)
{
QApplication application(argc,argv);
trace.beginBlock ( "Testing Spherical Accumulator Viewer with Integer numbers..." );
typedef Z3i::Vector Vector;
SphericalAccumulator<Vector> accumulator(15);
trace.info()<< accumulator << std::endl;
for(unsigned int i=0; i< 10000; i++)
accumulator.addDirection( Vector (1+(rand()-RAND_MAX/2),
(1+(rand()-RAND_MAX/2)),
(1+(rand()-RAND_MAX/2))));
Viewer3D<> viewer;
viewer.show();
Vector a,b,c,d;
Display3DFactory<Space,KSpace>::draw(viewer,accumulator, Z3i::RealVector(1.0,1.0,1.0), 3.0);
trace.info() << "Bin values: ";
for(SphericalAccumulator<Vector>::ConstIterator it=accumulator.begin(), itend=accumulator.end();
it != itend;
++it)
trace.info() << *it<<" ";
trace.info() << std::endl;
trace.info() << accumulator<<std::endl;
viewer << Viewer3D<>::updateDisplay;
bool res = application.exec();
trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
trace.endBlock();
return res ? 0 : 1;
}
开发者ID:BorisMansencal,项目名称:DGtal,代码行数:35,代码来源:testSphericalAccumulatorQGL.cpp
示例3: main
int main( int argc, char** argv )
{
QApplication application(argc,argv);
Viewer3D viewer;
viewer.show();
Point p1( 0, 0, 0 );
Point p2( 20, 20, 20 );
Domain domain(p1, p2);
DigitalSet shape_set( domain );
Shapes<Domain>::addNorm2Ball( shape_set, Point( 10, 10, 10 ), 7 );
viewer << SetMode3D( shape_set.styleName(), "Both" );
viewer << shape_set;
viewer << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 20));
viewer << SetMode3D( p1.styleName(), "Paving" );
//viewer << ClippingPlane(1,0,0,-4.9);
viewer << ClippingPlane(0,1,0.3,-10);
viewer << Viewer3D::updateDisplay;
return application.exec();
}
开发者ID:malaterre,项目名称:DGtal,代码行数:27,代码来源:viewer3D-6-clipping.cpp
示例4: main
int main( int argc, char** argv )
{
std::string inputFilename = examplesPath + "samples/Al.100.vol";
QApplication application(argc,argv);
Viewer3D viewer;
viewer.show();
typedef ImageSelector < Z3i::Domain, int>::Type Image;
// Image image = VolReader<Image>::VolReader<Image>::importVol(inputFilename);
Image image = VolReader<Image>::importVol(inputFilename);
Z3i::DigitalSet set3d (image.domain());
SetFromImage<Z3i::DigitalSet>::append<Image>(set3d, image, 0,255);
Z3i::Object18_6 obj3d (Z3i::dt18_6, set3d);
Z3i::Object18_6 border = obj3d.border();
viewer << border;
viewer << ClippingPlane(0,1,0, -40) << Display3D::updateDisplay;
//viewer << ClippingPlane(0,-1,0, 70)<< Viewer3D::updateDisplay;
//viewer << ClippingPlane(1,0.1,0, -50)<< Viewer3D::updateDisplay;
//viewer << ClippingPlane(1,0.1,0, -50)<< Viewer3D::updateDisplay;
return application.exec();
}
开发者ID:gdamiand,项目名称:DGtal,代码行数:26,代码来源:3dBorderExtractionImg.cpp
示例5: main
int main( int argc, char** argv )
{
std::string inputFilename = examplesPath + "samples/pointList3d.pl";
QApplication application(argc,argv);
Viewer3D<> viewer;
viewer.show();
// Importing the 3d set of points contained with the default index (0, 1, 2);
vector<Z3i::Point> vectPoints= PointListReader<Z3i::Point>::getPointsFromFile(inputFilename);
for(unsigned int i=0; i<vectPoints.size();i++){
viewer << vectPoints.at(i);
}
// Importing the 3d set of points with another index definition (0, 2, 1);
vector<unsigned int> vPos;
vPos.push_back(0);
vPos.push_back(2);
vPos.push_back(1);
vectPoints= PointListReader<Z3i::Point>::getPointsFromFile(inputFilename, vPos);
viewer<< CustomColors3D(Color(255,0,0), Color(255,0,0));
for(unsigned int i=0; i<vectPoints.size();i++){
viewer << vectPoints.at(i);
}
viewer << Viewer3D<>::updateDisplay;
return application.exec();
}
开发者ID:151706061,项目名称:DGtal,代码行数:26,代码来源:digitalSetFromPointList.cpp
示例6: main
int main( int argc, char** argv )
{
//! [MeshUseInitDisplay]
QApplication application(argc,argv);
Viewer3D<> viewer;
viewer.show();
//! [MeshUseInitDisplay]
//! [MeshUseMeshCreation]
// A mesh is constructed and faces are added from the vertex set.
//! [MeshUseMeshConstructor]
Mesh<Point> aMesh(true);
//! [MeshUseMeshConstructor]
//! [MeshUseMeshAddingPoints]
aMesh.addVertex(Point(0,0,0));
aMesh.addVertex(Point(1,0,0));
aMesh.addVertex(Point(1,1,0));
//! [MeshUseMeshAddingPoints]
aMesh.addVertex(Point(0,0,1));
aMesh.addVertex(Point(1,0,1));
aMesh.addVertex(Point(1,1,1));
aMesh.addVertex(Point(0,1,1));
aMesh.addVertex(Point(0,1,0));
aMesh.addVertex(Point(0,2,0));
aMesh.addVertex(Point(0,3,1));
aMesh.addVertex(Point(0,2,2));
aMesh.addVertex(Point(0,1,2));
aMesh.addVertex(Point(0,0,1));
//! [MeshUseMeshAddingBasicFaces]
aMesh.addTriangularFace(0, 1, 2, Color(150,0,150,104));
aMesh.addQuadFace(6,5,4,3, Color::Blue);
//! [MeshUseMeshAddingBasicFaces]
//! [MeshUseMeshAddingPolygonalFaces]
vector<unsigned int> listIndex;
listIndex.push_back(7);
listIndex.push_back(8);
listIndex.push_back(9);
listIndex.push_back(10);
listIndex.push_back(11);
listIndex.push_back(12);
aMesh.addFace(listIndex, Color(150,150,0,54));
//! [MeshUseMeshAddingPolygonalFaces]
//! [MeshUseMeshCreation]
//! [MeshUseDisplay]
viewer.setLineColor(Color(150,0,0,254));
viewer << aMesh;
viewer << Viewer3D<>::updateDisplay;
//! [MeshUseDisplay]
bool res = application.exec();
FATAL_ERROR(res);
return true;
}
开发者ID:151706061,项目名称:DGtal,代码行数:59,代码来源:mesh3DConstructionAndVisualisation.cpp
示例7: main
int main( int argc, char** argv )
{
typedef DGtal::ImageContainerBySTLVector< DGtal::Z2i::Domain, unsigned char> imageNG;
typedef DGtal::ImageContainerBySTLVector< DGtal::Z2i::Domain, unsigned int> imageCol;
QApplication application(argc,argv);
Viewer3D<> viewer;
viewer.setWindowTitle("simpleViewer");
viewer.show();
Point p1( 0, 0, 0 );
Point p2( 125, 188, 0 );
Point p3( 30, 30, 30 );
std::string filename = testPath + "samples/church-small.pgm";
std::string filename3 = testPath + "samples/color64.ppm";
imageNG image = DGtal::PGMReader<imageNG>::importPGM(filename);
imageNG image2 = DGtal::GenericReader<imageNG>::import(filename);
imageCol image3 = DGtal::GenericReader<imageCol>::import(filename3);
viewer << DGtal::AddTextureImage2DWithFunctor<imageNG, hueFct , Z3i::Space, Z3i::KSpace>(image2, hueFct(), Viewer3D<>::RGBMode );
viewer << image;
viewer << DGtal::AddTextureImage2DWithFunctor<imageCol, DefaultFunctor, Z3i::Space, Z3i::KSpace>(image3, DefaultFunctor(), Viewer3D<>::RGBMode );
viewer << DGtal::UpdateImagePosition<Z3i::Space, Z3i::KSpace>(0, Viewer3D<>::xDirection, 50, 50, 50 );
viewer << DGtal::UpdateImagePosition<Z3i::Space, Z3i::KSpace>(2, Viewer3D<>::yDirection, 0, 0, 0);
viewer << SetMode3D( image.domain().className(), "BoundingBox" );
viewer << image.domain();
viewer << DGtal::Update2DDomainPosition<Z3i::Space, Z3i::KSpace>(0, Viewer3D<>::xDirection, 0, 0, 0);
for(unsigned int i= 0; i< 10; i++){
if(i%4==0){
viewer << SetMode3D( image.className(), "" );
}else if(i%4==1){
viewer << SetMode3D( image.className(), "BoundingBox" );
}else if(i%4==2){
viewer << SetMode3D( image.className(), "Grid" );
}else if(i%4==3){
viewer << SetMode3D( image.className(), "InterGrid" );
}
viewer << image;
viewer << DGtal::UpdateImageData<imageNG>(i+3, image, i*50, i*50, i*50);
}
viewer << p1 << p2 << p3;
viewer << Viewer3D<>::updateDisplay;
bool res = application.exec();
trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
trace.endBlock();
return res ? 0 : 1;
}
开发者ID:alinemartin,项目名称:DGtal,代码行数:57,代码来源:test3DImageView.cpp
示例8: main
int main( int argc, char** argv )
{
trace.beginBlock ( "Testing class MeshFromPointsDisplay" );
trace.info() << "Args:";
for ( int i = 0; i < argc; ++i )
trace.info() << " " << argv[ i ];
trace.info() << endl;
//! [MeshFromPointsUseInitDisplay]
QApplication application(argc,argv);
Viewer3D viewer;
viewer.show();
//! [MeshFromPointsUseInitDisplay]
//! [MeshFromPointsUseMeshCreation]
MeshFromPoints<Point> aMesh(true);
aMesh.addVertex(Point(0,0,0));
aMesh.addVertex(Point(1,0,0));
aMesh.addVertex(Point(1,1,0));
aMesh.addVertex(Point(0,0,1));
aMesh.addVertex(Point(1,0,1));
aMesh.addVertex(Point(1,1,1));
aMesh.addVertex(Point(0,1,1));
aMesh.addVertex(Point(0,1,0));
aMesh.addVertex(Point(0,2,0));
aMesh.addVertex(Point(0,3,1));
aMesh.addVertex(Point(0,2,2));
aMesh.addVertex(Point(0,1,2));
aMesh.addVertex(Point(0,0,1));
aMesh.addTriangularFace(0, 1, 2, Color(150,0,150,104));
aMesh.addQuadFace(6,5,4,3, Color::Blue);
vector<unsigned int> listIndex;
listIndex.push_back(7);
listIndex.push_back(8);
listIndex.push_back(9);
listIndex.push_back(10);
listIndex.push_back(11);
listIndex.push_back(12);
aMesh.addFace(listIndex, Color(150,150,0,54));
//! [MeshFromPointsUseMeshCreation]
//! [MeshFromPointsUseDisplay]
viewer.setLineColor(Color(150,0,0,254));
viewer << aMesh;
viewer << Viewer3D::updateDisplay;
bool res = application.exec();
//! [MeshFromPointsUseDisplay]
trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
trace.endBlock();
return res ? 0 : 1;
}
开发者ID:Jeremy-Gaillard,项目名称:DGtal,代码行数:54,代码来源:testMeshFromPointsDisplay.cpp
示例9: main
int main( int argc, char** argv )
{
std::string inputFilename = examplesPath + "samples/Al.100.vol";
QApplication application(argc,argv);
Viewer3D<> viewer;
viewer.show();
typedef ImageSelector < Z3i::Domain, int>::Type Image;
Image image = VolReader<Image>::importVol(inputFilename);
Z3i::DigitalSet set3d (image.domain());
SetFromImage<Z3i::DigitalSet>::append<Image>(set3d, image, 0,255);
viewer << SetMode3D(image.domain().className(), "BoundingBox");
viewer << set3d << image.domain() << Viewer3D<>::updateDisplay;
return application.exec();
}
开发者ID:151706061,项目名称:DGtal,代码行数:14,代码来源:digitalSetFromVol.cpp
示例10: main
int main( int argc, char** argv )
{
QApplication application(argc,argv);
typedef DGtal::SpaceND<3, DGtal::int32_t> MySpace;
typedef MySpace::Point MyPoint;
typedef HyperRectDomain<MySpace> MyDomain;
MyPoint p1( 0, 0, 0 );
MyPoint p2( 5, 5 ,5 );
MyPoint p3( 2, 3, 4 );
MyDomain domain( p1, p2 );
Viewer3D viewer; // for 3D visualization
viewer.show();
viewer << domain;
viewer << p1 << p2 << p3;
viewer<< Viewer3D::updateDisplay;
return application.exec();
}
开发者ID:malaterre,项目名称:DGtal,代码行数:17,代码来源:demo-kernel-2.cpp
示例11: main
int main( int argc, char** argv )
{
typedef DGtal::ImageContainerBySTLVector< DGtal::Z3i::Domain, unsigned char> Image3D;
QApplication application(argc,argv);
Viewer3D<> viewer;
viewer.setWindowTitle("simpleViewer");
viewer.show();
trace.beginBlock("Testing Viewer with display of 3D Image ");
Point p1( 0, 0, 0 );
Point p2( 125, 188, 0 );
Point p3( 30, 30, 30 );
std::string filename = testPath + "samples/lobsterCroped.vol";
viewer.setFillTransparency(150);
Image3D image3d = VolReader<Image3D>::importVol(filename);
viewer << SetMode3D(image3d.className(), "BoundingBox");
viewer << DGtal::AddTextureImage3DWithFunctor<Image3D, hueFct , Space, KSpace>(image3d, hueFct(),Viewer3D<>::RGBMode );
viewer.setFillTransparency(255);
// Extract some slice images:
// Get the 2D domain of the slice:
DGtal::Projector<DGtal::Z2i::Space> invFunctor; invFunctor.initRemoveOneDim(2);
DGtal::Z2i::Domain domain2D(invFunctor(image3d.domain().lowerBound()),
invFunctor(image3d.domain().upperBound()));
typedef DGtal::ConstImageAdapter<Image3D, DGtal::Z2i::Domain, DGtal::Projector< Z3i::Space>,
Image3D::Value, DGtal::DefaultFunctor > SliceImageAdapter;
DGtal::DefaultFunctor idV;
DGtal::Projector<DGtal::Z3i::Space> aSliceFunctorZ(5); aSliceFunctorZ.initAddOneDim(2);
SliceImageAdapter sliceImageZ(image3d, domain2D, aSliceFunctorZ, idV);
viewer << sliceImageZ;
viewer << DGtal::UpdateImagePosition<Space, KSpace>(6, Viewer3D<>::zDirection, 0.0, 0.0, -10.0);
viewer << p1 << p2 << p3;
viewer << Viewer3D<>::updateDisplay;
bool res = application.exec();
trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
trace.endBlock();
return res ? 0 : 1;
}
开发者ID:arnaudetitia,项目名称:DGtal,代码行数:46,代码来源:test3DImage3DView.cpp
示例12: main
int main( int argc, char** argv )
{
QApplication application(argc,argv);
//! [DigiHelixConstr]
typedef EllipticHelix < Space > MyHelix;
typedef NaiveParametricCurveDigitizer3D < MyHelix > DigitizerHelix;
typedef NaiveParametricCurveDigitizer3D < MyHelix >::DigitalCurve MyDigitalCurve;
typedef NaiveParametricCurveDigitizer3D < MyHelix >::MetaData MyMetaData;
//! [DigiHelixConstr]
trace.info() << "exampleParamCurve3dDigitization" << endl;
Viewer3D<> viewer;
//! [DigiHelixInit]
MyDigitalCurve digitalCurve;
MyMetaData metaData;
MyHelix helix( 15, 10, 1 );
DigitizerHelix digitize;
digitize.init ( M_PI / 2., ( MyHelix::getPeriod() * 10. ) + M_PI / 2., 0.0001 );
digitize.attach ( &helix );
//! [DigiHelixInit]
//! [DigiHelixComp]
digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
//! [DigiHelixComp]
trace.info() << "Number of points: " << digitalCurve.size () << " number of metadata: " << metaData.size () << endl;
viewer.show();
//! [DigiHelixMetadata]
for ( unsigned int i = 0; i < digitalCurve.size ( ); i++ )
{
if ( findMainAxis ( helix, metaData.at ( i ).first ) == 0 )
viewer.setFillColor ( Color ( 255, 0, 0, 128 ) );
if ( findMainAxis ( helix, metaData.at ( i ).first ) == 1 )
viewer.setFillColor ( Color ( 0, 255, 0, 128 ) );
if ( findMainAxis ( helix, metaData.at ( i ).first ) == 2 )
viewer.setFillColor ( Color ( 0, 0, 255, 128 ) );
viewer << SetMode3D ( digitalCurve.at ( i ).className ( ), "PavingWired" ) << digitalCurve.at ( i );
}
//! [DigiHelixMetadata]
viewer << Viewer3D<>::updateDisplay;
return application.exec();
}
开发者ID:BorisMansencal,项目名称:DGtal,代码行数:46,代码来源:exampleParamCurve3dDigitization.cpp
示例13: main
int main( int argc, char** argv )
{
typedef PointVector<3,int> Point;
typedef std::vector<Point>::iterator Iterator;
typedef ArithmeticalDSS3d<Iterator,int,4> SegmentComputer;
typedef SaturatedSegmentation<SegmentComputer> Decomposition;
string inputFilename = examplesPath + "samples/sinus.dat";
vector<Point> sequence = PointListReader<Point>::getPointsFromFile(inputFilename);
SegmentComputer algo;
Decomposition theDecomposition(sequence.begin(), sequence.end(), algo);
///////////////////////////////////
//display
bool flag = true;
#ifdef WITH_VISU3D_QGLVIEWER
QApplication application(argc,argv);
Viewer3D viewer;
viewer.show();
Point p;
viewer << SetMode3D(p.className(), "Grid");
unsigned int c = 0;
Decomposition::SegmentComputerIterator i = theDecomposition.begin();
for ( ; i != theDecomposition.end(); ++i) {
SegmentComputer currentSegmentComputer(*i);
viewer << SetMode3D(currentSegmentComputer.className(), "Points");
viewer << currentSegmentComputer;
viewer << SetMode3D(currentSegmentComputer.className(), "BoundingBox");
viewer << currentSegmentComputer;
//cerr << currentSegmentComputer << endl;
c++;
}
viewer << Viewer3D::updateDisplay;
flag = application.exec();
#endif
return flag;
}
开发者ID:Jeremy-Gaillard,项目名称:DGtal,代码行数:45,代码来源:exampleArithDSS3d.cpp
示例14: main
int main( int argc, char** argv )
{
QApplication application(argc,argv);
Viewer3D<> viewer;
viewer.show();
//! [ImportOFFfile]
std::string inputFilename = examplesPath + "samples/tref.off";
// Since the input points are not necessary integers we use the PointD3D from Display3D.
Mesh<Viewer3D<>::RealPoint> anImportedMesh;
anImportedMesh << inputFilename;
//! [ImportOFFfile]
trace.info()<< "importating done..."<< endl;
//! [displayOFFfile]
viewer.setLineColor(DGtal::Color(150,0,0,254));
viewer << anImportedMesh;
viewer << Viewer3D<>::updateDisplay;
//! [displayOFFfile]
return application.exec();
}
开发者ID:Victor-Ostromoukhov,项目名称:DGtal,代码行数:19,代码来源:meshFromOFF.cpp
示例15: displayDSS2d
void displayDSS2d( Viewer3D<space, kspace> & viewer,
const KSpace & ks, const StandardDSS6Computer & dss3d,
const DGtal::Color & color2d )
{
typedef typename StandardDSS6Computer::ConstIterator ConstIterator3d;
typedef typename StandardDSS6Computer::ArithmeticalDSSComputer2d ArithmeticalDSSComputer2d;
typedef typename ArithmeticalDSSComputer2d::ConstIterator ConstIterator2d;
typedef typename ArithmeticalDSSComputer2d::Point Point2d;
typedef typename KSpace::Cell Cell;
typedef typename KSpace::Point Point3d;
typedef DGtal::PointVector<2,double> PointD2d;
typedef typename Display3D<>::BallD3D PointD3D;
Point3d b = ks.lowerBound();
for ( DGtal::Dimension i = 0; i < 3; ++i )
{
const typename ArithmeticalDSSComputer2d::Primitive & dss2d
= dss3d.arithmeticalDSS2d( i ).primitive();
// draw 2D bounding boxes for each arithmetical dss 2D.
std::vector<PointD2d> pts2d;
pts2d.push_back( dss2d.project(dss2d.back(), dss2d.Uf()) );
pts2d.push_back( dss2d.project(dss2d.back(), dss2d.Lf()) );
pts2d.push_back( dss2d.project(dss2d.front(), dss2d.Lf()) );
pts2d.push_back( dss2d.project(dss2d.front(), dss2d.Uf()) );
std::vector<PointD3D> bb;
PointD3D p3;
for ( unsigned int j = 0; j < pts2d.size(); ++j )
{
switch (i) {
case 0: p3.center[0] = (double) b[ i ]-0.5; p3.center[1] = pts2d[ j ][ 0 ]; p3.center[2] = pts2d[ j ][ 1 ]; break;
case 1: p3.center[0] = pts2d[ j ][ 0 ]; p3.center[1] = (double) b[ i ]-0.5; p3.center[2] = pts2d[ j ][ 1 ]; break;
case 2: p3.center[0] = pts2d[ j ][ 0 ]; p3.center[1] = pts2d[ j ][ 1 ]; p3.center[2] = (double) b[ i ]-0.5; break;
}
bb.push_back( p3 );
}
for ( unsigned int j = 0; j < pts2d.size(); ++j ){
viewer.setLineColor(color2d);
viewer.addLine( DGtal::Z3i::RealPoint(bb[ j ].center[0], bb[ j ].center[1], bb[ j ].center[2]),
DGtal::Z3i::RealPoint(bb[ (j+1)%4 ].center[0], bb[ (j+1)%4 ].center[1], bb[ (j+1)%4 ].center[2]),
MS3D_LINESIZE );
}
} // for ( DGtal::Dimension i = 0; i < 3; ++i )
}
开发者ID:arnaudetitia,项目名称:DGtalTools,代码行数:42,代码来源:3dCurveViewer.cpp
示例16: testSphericalViewer
///////////////////////////////////////////////////////////////////////////////
// Functions for testing class SphericalAccumulator.
///////////////////////////////////////////////////////////////////////////////
bool testSphericalViewer(int argc, char **argv)
{
QApplication application(argc,argv);
trace.beginBlock ( "Testing Spherical Accumulator Viewer..." );
typedef Z3i::RealVector Vector;
SphericalAccumulator<Vector> accumulator(15);
trace.info()<< accumulator << std::endl;
for(unsigned int i=0; i< 10000; i++)
accumulator.addDirection( Vector (1+10.0*(rand()-RAND_MAX/2)/(double)RAND_MAX,
(1+10.0*(rand()-RAND_MAX/2))/(double)RAND_MAX,
(1+10.0*(rand()-RAND_MAX/2))/(double)RAND_MAX));
Viewer3D<> viewer;
Board3D<> board;
viewer.show();
Vector a,b,c,d;
viewer << accumulator;
board << accumulator;
board.saveOBJ("testSpherical.obj");
trace.info() << "Bin values: ";
for(SphericalAccumulator<Vector>::ConstIterator it=accumulator.begin(), itend=accumulator.end();
it != itend;
++it)
trace.info() << *it<<" ";
trace.info() << std::endl;
trace.info() << accumulator<<std::endl;
viewer << Viewer3D<>::updateDisplay;
bool res = application.exec();
trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
trace.endBlock();
return res ? 0 : 1;
}
开发者ID:BorisMansencal,项目名称:DGtal,代码行数:44,代码来源:testSphericalAccumulatorQGL.cpp
示例17: main
int main(int argc, char**argv)
{
//Loading point set argv[1]==PTS argv[2]==SPHERES
ifstream mypts (argv[1], std::ifstream::in);
ifstream myspheres (argv[2], std::ifstream::in);
QApplication app(argc,argv);
Viewer3D<> viewer;
double x,y,z,rad;
viewer.show();
int cpt= 0;
while (myspheres.good())
{
myspheres>> x;
myspheres >>y;
myspheres>> z;
myspheres >> rad;
viewer.addBall(Z3i::RealPoint(x,y,z), 0.008,5);
++cpt;
}
myspheres.close();
trace.info()<< "Nb balls= "<<cpt<<std::endl;
viewer << CustomColors3D(Color::Red, Color::Red);
while (mypts.good())
{
mypts>> x;
mypts >>y;
mypts>> z;
viewer.addBall(Z3i::RealPoint(x,y,z), 0.008,5);
}
mypts.close();
return app.exec();
}
开发者ID:dcoeurjo,项目名称:thicknessExpe,代码行数:41,代码来源:ptsSpheresViewer.cpp
示例18: main
int main( int argc, char** argv )
{
QApplication application(argc,argv);
Viewer3D<> viewer;
viewer.setWindowTitle("simpleViewer");
viewer.show();
trace.beginBlock ( "Testing Polygon 3D display in Viewer3D" );
std::vector<Z3i::RealPoint> polyg1;
polyg1.push_back(Z3i::RealPoint(0,0,0));
polyg1.push_back(Z3i::RealPoint(0,1,0));
polyg1.push_back(Z3i::RealPoint(1,1,0));
viewer.addPolygon(polyg1);
viewer.createNewPolygonList("hop");
std::vector<Z3i::RealPoint> polyg2;
polyg2.push_back(Z3i::RealPoint(0,10,0));
polyg2.push_back(Z3i::RealPoint(0,11,0));
polyg2.push_back(Z3i::RealPoint(11,11,0));
viewer.addPolygon(polyg2);
viewer << Viewer3D<>::updateDisplay;
bool res = application.exec();
trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
trace.endBlock();
return res ? 0 : 1;
}
开发者ID:caomw,项目名称:DGtal,代码行数:35,代码来源:testPolygon3D.cpp
示例19: main
int main( int argc, char** argv )
{
QApplication application(argc,argv);
Viewer3D viewer;
viewer.show();
Point p1( 0, 0, 0 );
Point p2( 10, 10 , 10 );
Domain domain( p1, p2 );
viewer << domain;
DigitalSet shape_set( domain );
Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
shape_set.erase(Point(3,3,3));
shape_set.erase(Point(6,6,6));
viewer << shape_set << Display3D::updateDisplay;
return application.exec();
}
开发者ID:SqLL,项目名称:DGtal,代码行数:23,代码来源:viewer3D-2-sets.cpp
示例20: main
int main( int argc, char** argv )
{
QApplication application(argc,argv);
Viewer3D viewer;
viewer.show();
Point p1( -1, -1, -2 );
Point p2( 2, 2, 3 );
Domain domain( p1, p2 );
Point p3( 1, 1, 1 );
Point p4( 2, -1, 3 );
Point p5( -1, 2, 3 );
Point p6( 0, 0, 0 );
Point p0( 0, 2, 1 );
viewer << SetMode3D( p1.styleName(), "PavingWired" );
viewer << p1 << p2 << p3;
//viewer << SetMode3D( p1.styleName(), "Grid" );
viewer << CustomColors3D(Color(250, 0,0),Color(250, 0,0));
viewer << p4 << p5 ;
viewer << SetMode3D( p1.styleName(), "Both" );
viewer << CustomColors3D(Color(250, 200,0, 100),Color(250, 0,0, 100));
viewer << p6;
viewer << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 20));
viewer << p0;
viewer << SetMode3D(domain.styleName(), "Paving");
viewer << domain << Display3D::updateDisplay;
return application.exec();
}
开发者ID:malaterre,项目名称:DGtal,代码行数:36,代码来源:viewer3D-5-custom.cpp
注:本文中的Viewer3D类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论