Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:57

0001 /****************************************************************************
0002 **
0003 ** Copyright (c) 2008-2020 C.B. Barber. All rights reserved.
0004 ** $Id: //main/2019/qhull/src/libqhullcpp/RboxPoints.h#2 $$Change: 2953 $
0005 ** $DateTime: 2020/05/21 22:05:32 $$Author: bbarber $
0006 **
0007 ****************************************************************************/
0008 
0009 #ifndef RBOXPOINTS_H
0010 #define RBOXPOINTS_H
0011 
0012 #include "libqhull_r/qhull_ra.h"
0013 #include "libqhullcpp/QhullPoint.h"
0014 #include "libqhullcpp/PointCoordinates.h"
0015 
0016 #include <stdarg.h>
0017 #include <string>
0018 #include <vector>
0019 #include <istream>
0020 #include <ostream>
0021 #include <sstream>
0022 
0023 namespace orgQhull {
0024 
0025 #//!\name Defined here
0026     //! RboxPoints -- generate random PointCoordinates for Qhull
0027     class RboxPoints;
0028 
0029 class RboxPoints : public PointCoordinates {
0030 
0031 private:
0032 #//!\name Fields and friends
0033                         //! PointCoordinates.qh() is owned by RboxPoints
0034     countT              rbox_new_count;     //! Number of points for PointCoordinates
0035     int                 rbox_status;    //! error status from rboxpoints.  qh_ERRnone if none.
0036     std::string         rbox_message;   //! stderr from rboxpoints
0037 
0038     // '::' is required for friend references
0039     friend void ::qh_fprintf_rbox(qhT *qh, FILE *fp, int msgcode, const char *fmt, ... );
0040 
0041 public:
0042 #//!\name Construct
0043                         RboxPoints();
0044     explicit            RboxPoints(const char *rboxCommand);
0045                         ~RboxPoints();
0046 private:                // Disable copy constructor and assignment.  RboxPoints owns QhullQh.
0047                         RboxPoints(const RboxPoints &);
0048                         RboxPoints &operator=(const RboxPoints &);
0049 private:
0050     void                allocateQhullQh();
0051 
0052 public:
0053 #//!\name GetSet
0054     void                clearRboxMessage();
0055     countT              newCount() const { return rbox_new_count; }
0056     std::string         rboxMessage() const;
0057     int                 rboxStatus() const;
0058     bool                hasRboxMessage() const;
0059     void                setNewCount(countT pointCount) { QHULL_ASSERT(pointCount>=0); rbox_new_count= pointCount; }
0060 
0061 #//!\name Modify
0062     void                appendPoints(const char* rboxCommand);
0063     using               PointCoordinates::appendPoints;
0064     void                reservePoints() { reserveCoordinates((count()+newCount())*dimension()); }
0065 };//class RboxPoints
0066 
0067 }//namespace orgQhull
0068 
0069 #endif // RBOXPOINTS_H