/******************************************************************************
** Copyright (c) 2008 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/

//! \file DtAddPropsRuleRecord.h
//! \brief Contains makArchives::DtAddPropsRuleRecord class.
//! \ingroup makArchives

#ifndef DtAddPropsRuleRecord_H_
#define DtAddPropsRuleRecord_H_

#include <makArchives/makArchives.h>

#include <map>
#include <string>
#include <vector>

namespace makArchives
{
   //! \brief Record of a rule used to add props to a feaure layer
   //! \ingroup makArchives
   class DT_DLL_MAKARCHIVES DtAddPropsRuleRecord
   {

   public:

      typedef std::map<std::string, std::string> FieldValueMap;

      //! \brief CTOR
      DtAddPropsRuleRecord();

      //! \brief Copy CTOR
      DtAddPropsRuleRecord(const DtAddPropsRuleRecord& orig);

      bool operator==(const DtAddPropsRuleRecord& orig) const;
      bool operator!=(const DtAddPropsRuleRecord& orig) const;

      //! \brief Assignment OP
      DtAddPropsRuleRecord& operator=(const DtAddPropsRuleRecord& orig);

      //! \brief DTOR
      ~DtAddPropsRuleRecord();

      //! \name Accessors/ mutators:
      //@{

      const std::string& propType() const;
      void setPropType(const std::string& propType);

      const std::string& modelDefinition() const;
      void setModelDefinition(const std::string& modelDef);

      const std::string& rotationField() const;
      void setRotationField(const std::string& rotationField);

      const FieldValueMap& fieldValueMap() const;
      void setFieldValueMap(const FieldValueMap& fvMap);

      bool groundClamp() const;
      void setGroundClamp(bool gc);

      //@}


   protected:

      friend class boost::serialization::access;

      //! When the class Archive corresponds to an output archive, the
      //! & operator is defined similar to <<.  Likewise, when the class Archive
      //! is a type of input archive the & operator is defined similar to >>.
      template<class Archive>
         void serialize(Archive & ar, const unsigned int version)
      {
         ar & BOOST_SERIALIZATION_NVP(myPropType);
         ar & BOOST_SERIALIZATION_NVP(myModelDef);
         ar & BOOST_SERIALIZATION_NVP(myFieldValueMap);
         ar & BOOST_SERIALIZATION_NVP(myGroundClamp);

         if (version >= 1)
         {
            ar & BOOST_SERIALIZATION_NVP(myRotationField);
         }
      }

   protected:

      std::string myPropType;
      std::string myModelDef; 
      FieldValueMap myFieldValueMap;
      bool myGroundClamp;
      std::string myRotationField;
   };

   typedef std::vector<DtAddPropsRuleRecord> DtAddPropsRuleRecordVector;

}

BOOST_CLASS_VERSION(makArchives::DtAddPropsRuleRecord,1)

#endif

