[vtkusers] VTK File Integrity Checker?
Dominik Szczerba
domi at vision.ee.ethz.ch
Thu Jan 25 18:23:46 EST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I do it myself using the Standart Template library. You can use the
"set" container or call "unique" explicitely. You would need to define <
operator, I do it e.g.
class Triangle{//class Triangle
int n1, n2, n3;//nodes
public:
//...
int id1()const{
assert(n1 != n2 && n2 != n3 && n3 != n1);
return min(min(n1, n2), n3);
}
int id2()const{
assert(n1 != n2 && n2 != n3 && n3 != n1);
if(n1>id1() && n1<id3())
return n1;
else if(n2>id1() && n2<id3())
return n2;
else if(n3>id1() && n3<id3())
return n3;
else assert(0);
return -1;
}
int id3()const{
assert(n1 != n2 && n2 != n3 && n3 != n1);
return max(max(n1, n2), n3);
}
bool operator < (const Triangle& rhs)const{
if( id1() != rhs.id1() )
return( id1()<rhs.id1() );
else if( id2() != rhs.id2() )
return( id2()<rhs.id2() );
else return id3()<rhs.id3();
};
and then all STL goodies are there for you.
Dominik
Kent Eschenberg wrote:
> Does anyone know of a utility that will check the integrity of a VTK file?
>
> I have an unstructured dataset with about 4 million cells and I think some may be duplicates (i.e., 2 or more cells using the same vertices). It would also be great if the utility checked for degenerate cells (ones using the same vertex more than once) and for duplicate vertices (ones closer than some tolerance).
>
> TIA!
> Kent
> Pittsburgh Supercomputing Center
>
>
>
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFuTwC/EBMh9bUuzIRAgXDAJ43M83Zplo1gn9LPXyL4jkaz4NeJACffsJS
8VElPHGUk3Anx184y1QCOdo=
=bXPK
-----END PGP SIGNATURE-----
More information about the vtkusers
mailing list