Size.h

#pragma once


namespace Robotics
{
    /// サイズ
    [ System::ComponentModel::TypeConverter( System::ComponentModel::ExpandableObjectConverter::typeid ) ]  // 拡張可能なオブジェクト
    public value class Size
    {
    // Construction --------------------------------------------------------
    public:
        Size( double x, double y, double z );
        explicit Size( System::Xml::XmlElement^ element );


    // Operation -----------------------------------------------------------
    public:
        bool IsZero();

        virtual System::String^ ToString() override;


    // Overload ------------------------------------------------------------
    public:
        Size operator*=( double val );
        Size operator/=( double val );

        bool Equals( Size% obj ) new;

        static bool operator==( Size% left, Size% right );
        static bool operator!=( Size% left, Size% right );

        static Size operator*( Size% obj, double val );
        static Size operator/( Size% obj, double val );


    // Attribute ===========================================================
    private:
        double m_x;        ///< X方向のサイズ
        double m_y;        ///< Y方向のサイズ
        double m_z;        ///< Z方向のサイズ


    // Property ------------------------------------------------------------
    public:
        /// X方向のサイズ
        property double X
        {
            double get()
            {
                return m_x;
            }
            void set( double value )
            {
                m_x = value;
            }
        }

        /// Y方向のサイズ
        property double Y
        {
            double get()
            {
                return m_y;
            }
            void set( double value )
            {
                m_y = value;
            }
        }

        /// Z方向のサイズ
        property double Z
        {
            double get()
            {
                return m_z;
            }
            void set( double value )
            {
                m_z = value;
            }
        }
    };
}