~ubuntu-branches/ubuntu/trusty/qhull/trusty-proposed

« back to all changes in this revision

Viewing changes to src/libqhullcpp/RboxPoints.h

  • Committer: Package Import Robot
  • Author(s): Barak A. Pearlmutter
  • Date: 2014-02-13 11:09:12 UTC
  • mfrom: (8.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20140213110912-ifwyxorlsnnl1ebh
Tags: 2012.1-4
Add convenience link to #include <qhull/qhull.h> to simplify transition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
 
4
** $Id: //main/2011/qhull/src/libqhullcpp/RboxPoints.h#6 $$Change: 1464 $
 
5
** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
 
6
**
 
7
****************************************************************************/
 
8
 
 
9
#ifndef RBOXPOINTS_H
 
10
#define RBOXPOINTS_H
 
11
 
 
12
#include "QhullPoint.h"
 
13
#include "PointCoordinates.h"
 
14
extern "C" {
 
15
#include "libqhull/libqhull.h"
 
16
}
 
17
 
 
18
#include <stdarg.h>
 
19
#include <string>
 
20
#include <vector>
 
21
#include <istream>
 
22
#include <ostream>
 
23
#include <sstream>
 
24
 
 
25
namespace orgQhull {
 
26
 
 
27
#//Types
 
28
    //! RboxPoints -- generate random PointCoordinates for Qhull
 
29
    class RboxPoints;
 
30
 
 
31
    class RboxPoints : public PointCoordinates {
 
32
 
 
33
private:
 
34
#//Fields and friends
 
35
    int                 rbox_new_count;     //! Number of points for PointCoordinates
 
36
    int                 rbox_status;    //! error status from rboxpoints.  qh_ERRnone if none.
 
37
    std::string         rbox_message;   //! stderr from rboxpoints
 
38
 
 
39
    friend void ::qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... );
 
40
 
 
41
public:
 
42
#//Construct
 
43
                        RboxPoints();
 
44
    explicit            RboxPoints(const char *rboxCommand);
 
45
                        RboxPoints(const RboxPoints &other);
 
46
                        RboxPoints &operator=(const RboxPoints &other);
 
47
                       ~RboxPoints();
 
48
 
 
49
public:
 
50
#//GetSet
 
51
    void                clearRboxMessage();
 
52
    int                 newCount() const { return rbox_new_count; }
 
53
    std::string         rboxMessage() const;
 
54
    int                 rboxStatus() const;
 
55
    bool                hasRboxMessage() const;
 
56
    void                setNewCount(int pointCount) { QHULL_ASSERT(pointCount>=0); rbox_new_count= pointCount; }
 
57
 
 
58
#//Modify
 
59
    void                appendPoints(const char* rboxCommand);
 
60
    using               PointCoordinates::appendPoints;
 
61
    void                reservePoints() { reserveCoordinates((count()+newCount())*dimension()); }
 
62
};//class RboxPoints
 
63
 
 
64
}//namespace orgQhull
 
65
 
 
66
#endif // RBOXPOINTS_H