/*
 * HnSRTreeCluster.hh
 *
 * DO NOT EDIT THIS FILE!
 *
 * This file is automatically generated by obj2ptr.
 * 2006/08/03 17:37:44
 */

#ifndef _HnSRTreeCluster_hh
#define _HnSRTreeCluster_hh

#ifndef _HNSRTIMP
#ifdef _MSC_VER
#define _HNSRTIMP _declspec(dllimport)
#else
#define _HNSRTIMP
#endif
#endif

#include "HnSRTree/HnPointer.hh"

#include "HnSRTree/HnPoint.hh"
#include "HnSRTree/HnSphere.hh"
#include "HnSRTree/HnRect.hh"

/*
 * HnSRTreeCluster
 */

class HnSRTreeClusterObj;

class _HNSRTIMP HnSRTreeCluster: public HnPointer {
private:
    friend class HnSRTreeClusterObj;
    HnSRTreeCluster(const HnSRTreeClusterObj *ptr) {
	HnPointer::assign((HnObject *)ptr);
    }
    HnSRTreeClusterObj *getObject(void) const {
	return (HnSRTreeClusterObj *)HnPointer::getObject();
    }
public:
    static const HnSRTreeCluster null;
    HnSRTreeCluster(void) {}
public:
    _HNSRTIMP friend HnSRTreeCluster
    new_HnSRTreeCluster(const HnPoint &centroid, int weight,
		       const HnSphere &sphere,
		       const HnRect &rect);

    HnBool equals(const HnSRTreeCluster &cluster) const;

    int getDimension(void) const;

    const HnPoint &getCentroid(void) const;
    int getWeight(void) const;
    const HnSphere &getSphere(void) const;
    const HnRect &getRect(void) const;

    HnString toString(void) const;
};

    _HNSRTIMP HnSRTreeCluster
    new_HnSRTreeCluster(const HnPoint &centroid, int weight,
		       const HnSphere &sphere,
		       const HnRect &rect);

#include "HnSRTree/HnString.hh"

#define HnClass HnSRTreeCluster
#include "HnSRTree/HnClassArray.hh"

#include "HnSRTree/HnSRTreeClusterObj.hh"

inline HnBool
HnSRTreeCluster::equals(const HnSRTreeCluster &ptr) const {
    if ( isInvalid() ) {
	if ( ptr.isInvalid() ) {
	    return HnTRUE;
	}
	else {
	    return HnFALSE;
	}
    }
    else {
	if ( ptr.isInvalid() ) {
	    return HnFALSE;
	}
	else {
	    return getObject()->equals(ptr);
	}
    }
}

inline int
HnSRTreeCluster::getDimension(void) const
{
    return getObject()->getDimension();
}

inline const HnPoint &
HnSRTreeCluster::getCentroid(void) const
{
    return getObject()->getCentroid();
}

inline int
HnSRTreeCluster::getWeight(void) const
{
    return getObject()->getWeight();
}

inline const HnSphere &
HnSRTreeCluster::getSphere(void) const
{
    return getObject()->getSphere();
}

inline const HnRect &
HnSRTreeCluster::getRect(void) const
{
    return getObject()->getRect();
}

inline HnString
HnSRTreeCluster::toString(void) const {
    if ( isInvalid() ) {
	return "HnSRTreeCluster::null";
    }
    else {
	return getObject()->toString();
    }
}


#endif /* _HnSRTreeCluster_hh */
