Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions Common/Examples/CheckOrientation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@
* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
* Author : Sebastien Valette
*
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* or in the file LICENSE.txt.
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
* liability.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
* ------------------------------------------------------------------------ */

#include <iostream>
#include <vtkCommand.h>
#include <vtkCellData.h>
#include <vtkPointData.h>
Expand All @@ -31,7 +32,7 @@
int main( int argc, char *argv[] )
{
if (argc < 2) {
cout << "Usage : CheckOrientation input" << endl;
std::cout << "Usage : CheckOrientation input" << std::endl;
exit (1);
}
vtkSurface *Mesh = vtkSurface::New();
Expand Down
4 changes: 4 additions & 0 deletions Common/Examples/CleanMesh.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */

#include <iostream>
#include <vtkCommand.h>
#include "vtkSurface.h"
#include "RenderWindow.h"

using std::cout;
using std::endl;

int main( int argc, char *argv[] )
{
if (argc<3)
Expand Down
28 changes: 16 additions & 12 deletions Common/Examples/ExamplevtkSurface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,31 @@
* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
* Author : Sebastien Valette
*
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* or in the file LICENSE.txt.
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
* liability.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
* ------------------------------------------------------------------------ */

#include <iostream>
#include <vtkCommand.h>
#include "vtkSurface.h"
#include "RenderWindow.h"

using std::cout;
using std::endl;

void traverse( vtkSurface *test ) {

vtkIdType v1,v2,v3; // stockage de l'identite de points
Expand Down Expand Up @@ -77,15 +81,15 @@ int main( int argc, char *argv[] )

// points and cells definitions
static double x[7][3]={{0,0,1},{0.707,0.707,0},{0.707,-0.707,0},{-0.707,-0.707,0},{-0.707,0.707,0},{0,0,-1}, {0,0,2}};
static int pts[12][3]={{0,1,2},{0,2,3},{0,3,4},{0,4,1},{5,1,2},{5,2,3},{5,3,4},{5,4,1},{6,1,2},{6,2,3},{6,3,4},{6,4,1} };
static int pts[12][3]={{0,1,2},{0,2,3},{0,3,4},{0,4,1},{5,1,2},{5,2,3},{5,3,4},{5,4,1},{6,1,2},{6,2,3},{6,3,4},{6,4,1} };

vtkSurface *test=vtkSurface::New();

// create vertices
for (int i=0;i<7;i++) test->AddVertex(x[i]);

// create triangles
for (int i=0;i<6;i++)
for (int i=0;i<6;i++)
test->AddFace(pts[i][0],pts[i][1],pts[i][2]);

traverse( test );
Expand All @@ -98,7 +102,7 @@ int main( int argc, char *argv[] )
Window->Interact();

// add more triangles
for (int i=6;i<8;i++)
for (int i=6;i<8;i++)
test->AddFace(pts[i][0],pts[i][1],pts[i][2]);

traverse( test );
Expand All @@ -111,13 +115,13 @@ int main( int argc, char *argv[] )
for (int i=0;i<4;i++) test->DeleteFace( i );

traverse( test );

//render again
Window->Render();
Window->Interact();

// add more triangles
for (int i=8;i<12;i++)
for (int i=8;i<12;i++)
test->AddFace(pts[i][0],pts[i][1],pts[i][2]);

traverse( test );
Expand Down
20 changes: 12 additions & 8 deletions Common/Examples/ManifoldSimplification.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,37 @@ Author: Sebastien Valette
* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
* Author : Sebastien Valette
*
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* or in the file LICENSE.txt.
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
* liability.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
* ------------------------------------------------------------------------ */

// .NAME ManifoldSimplification
// .SECTION Description

#include <iostream>
#include <vtkPLYWriter.h>
#include "vtkManifoldSimplification.h"

using std::cout;
using std::endl;

/////////////////////////////////////////////////////////////////////////////////////////
// ManifoldSimplification program:
/////////////////////////////////////////////////////////////////////////////////////////
//
//
// Coarsening of triangular meshes
// This program should be run with 2 arguments:
// run: "ManifoldSimplification file nvertices"
Expand Down
36 changes: 20 additions & 16 deletions Common/Examples/RandomTriangulation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,34 @@ Author: Sebastien Valette
* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
* Author : Sebastien Valette
*
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* or in the file LICENSE.txt.
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
* liability.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
* ------------------------------------------------------------------------ */

// .NAME meshviewer
// .NAME meshviewer
// .SECTION Description
#include <iostream>
#include <vtkPLYWriter.h>
#include "vtkSurface.h"
#include "RenderWindow.h"
#include "vtkRandomTriangulation.h"

using std::cout;
using std::endl;

int main( int argc, char *argv[] )
{
if (argc<3)
Expand All @@ -51,25 +55,25 @@ int main( int argc, char *argv[] )
cout<<"4 : half pipe cut on one corner"<<endl;
return (1);
}

vtkRandomTriangulation *Triangulation=vtkRandomTriangulation::New();
vtkSurface *Mesh=Triangulation->BuildRandomTriangulation(atoi(argv[1]),atoi(argv[2]));

Mesh->DisplayMeshProperties();

RenderWindow *Window=RenderWindow::New();
Window->SetInputData(Mesh);
Window->Render();
Window->Interact();

vtkPLYWriter *Writer=vtkPLYWriter::New();
Writer->SetInputData(Mesh);
Writer->SetFileName("mesh.ply");
Writer->Write();
Writer->Delete();

Mesh->Delete();
Window->Delete();
Window->Delete();
return (0);
}
}

18 changes: 11 additions & 7 deletions Common/Examples/clipMesh.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,27 @@ Author: Sebastien Valette
* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
* Author : Sebastien Valette
*
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* or in the file LICENSE.txt.
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
* liability.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
* ------------------------------------------------------------------------ */

// .NAME clipMesh
// .SECTION Description

#include <iostream>
#include <vtkClipPolyData.h>
#include <vtkPlane.h>
#include <vtkPLYWriter.h>
Expand All @@ -41,6 +42,9 @@ Author: Sebastien Valette
#include "vtkSurface.h"
#include "RenderWindow.h"

using std::cout;
using std::endl;

int main( int argc, char *argv[] ) {

if (argc < 3 ) {
Expand Down
20 changes: 12 additions & 8 deletions Common/Examples/icp.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,37 @@ Author: Sebastien Valette
* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
* Author : Sebastien Valette
*
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* or in the file LICENSE.txt.
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
* liability.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
* ------------------------------------------------------------------------ */

// .NAME icp
// .NAME icp
// .SECTION Description

#include <iostream>
#include <vtkIterativeClosestPointTransform.h>
#include <vtkLandmarkTransform.h>
#include <vtkPLYWriter.h>
#include <vtkTransformPolyDataFilter.h>

#include "vtkSurface.h"

using std::cout;
using std::endl;

int main( int argc, char *argv[] ) {

if (argc < 3 ) {
Expand Down
Loading