Go to the documentation of this file.
30 int main(
int argc,
char **argv);
34 user_eg3 -- demonstrate calling rbox and qhull from C++.\n\
36 user_eg3 is statically linked to reentrant qhull. If user_eg3\n\
37 fails immediately, it is probably linked to the non-reentrant qhull.\n\
38 Try 'user_eg3 rbox qhull \"T1\"'\n\
40 eg-100 Run the example in qh-code.htm\n\
41 rbox \"200 D4\" ... Generate points from rbox\n\
42 qhull \"d p\" ... Run qhull and produce output\n\
43 qhull-cout \"o\" ... Run qhull and produce output to cout\n\
44 qhull \"T1\" ... Run qhull with level-1 trace to cerr\n\
45 facets Print facets when done\n\
48 user_eg3 rbox qhull\n\
49 user_eg3 rbox qhull d\n\
50 user_eg3 rbox \"10 D2\" \"2 D2\" qhull \"s p\" facets\n\
58 int main(
int argc,
char **argv) {
69 cerr << e.
what() << std::endl;
76 if(strcmp(argv[1],
"eg-100")==0){
83 bool printFacets=
false;
88 for(
int i=1; i<argc; i++){
89 if(strcmp(argv[i],
"rbox")==0){
90 if(readingRbox!=0 || readingQhull!=0){
91 cerr <<
"user_eg3 -- \"rbox\" must be first" << endl;
95 }
else if(strcmp(argv[i],
"qhull")==0
96 || strcmp(argv[i],
"qhull-cout")==0){
98 cerr <<
"user_eg3 -- only one \"qhull\" or \"qhull-cout\" allowed." << endl;
101 if(strcmp(argv[i],
"qhull-cout")==0){
106 rbox.appendPoints(
"10 D2");
108 cerr <<
"Enter dimension count coordinates. End with ^Z (Windows) or ^D (Unix).\n";
109 rbox.appendPoints(cin);
114 }
else if(strcmp(argv[i],
"facets")==0){
116 }
else if(readingRbox){
118 cerr <<
"rbox " << argv[i] << endl;
119 rbox.appendPoints(argv[i]);
120 if(
rbox.hasRboxMessage()){
121 cerr <<
"user_eg3 " << argv[i] <<
" -- " <<
rbox.rboxMessage();
122 return rbox.rboxStatus();
124 }
else if(readingQhull){
133 cerr <<
"\nResults of " << argv[i] <<
"\n" << qhull.
qhullMessage();
137 cerr <<
"user_eg3 error: Expecting qhull, qhull-cout, or rbox. Got " << argv[i] << endl;
158 cout <<
"\nFacets created by Qhull::runQhull()\n" << facets;
virtual const char * what() const
int main(int argc, char **argv)
bool hasOutputStream() const
void runQhull(const RboxPoints &rboxPoints, const char *qhullCommand2)
For qhull commands, see http://www.qhull.org/html/qhull.htm or html/qhull.htm.
std::string qhullMessage() const
Interface to Qhull from C++.
POD type equivalent to qhT. No virtual members.
QhullFacetList facetList() const
void setOutputStream(std::ostream *os)
A QhullFacet is the C++ equivalent to Qhull's facetT*.
int user_eg3(int argc, char **argv)
bool hasQhullMessage() const
hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:59