123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- /*!
- * \file CategoryInfo.cpp
- * \brief
- * \author Gapchich Vladislav
- * \date 23/10/11
- */
- #include "vislearning/cbaselib/CategoryInfo.h"
- using namespace OBJREC;
- using namespace std;
- //! A constructor
- CategoryInfo::CategoryInfo()
- {
- category_name_.clear();
- id_ = -1;
- color_ = 0;
- is_main_ = 0;
- }
- //! A copy-constructur
- CategoryInfo::CategoryInfo(const CategoryInfo ©)
- {
- category_name_ = copy.categoryName();
- color_ = copy.color();
- id_ = copy.id();
- is_main_ = copy.isMain();
- }
- //! A desctructor
- CategoryInfo::~CategoryInfo()
- {
-
- }
- //! Sets category name(label)
- /*!
- * \param[in] aCategoryName should not be empty otherwise member does nothing.
- */
- void
- CategoryInfo::setCategoryName(const std::string &aCategoryName)
- {
- if (aCategoryName.empty()) {
- return;
- /* NOTREACHED */
- }
-
- category_name_ = aCategoryName;
- }
- //! Sets category ID(label ID)
- /*!
- * \param[in] anID should not be negative otherwise id_ becomes -1
- */
- void
- CategoryInfo::setID(const int &anID)
- {
- if (anID < 0) {
- id_ = -1;
- return;
- /* NOTREACHED */
- }
-
- id_ = anID;
- }
- //! Sets the color of a category
- /*!
- * \param[in] aColor is unsigned in which can be translated into ARGB
- * like 0xAARRBBGG
- */
- void
- CategoryInfo::setColor(const unsigned int &aColor)
- {
- color_ = aColor;
- }
- //! Sets category priority
- /*!
- * \param[in] aMain is a flag indicating whether current label is main or not
- */
- void
- CategoryInfo::setMain(bool aMain)
- {
- is_main_ = aMain;
- }
- //! returns category name(label name)
- std::string
- CategoryInfo::categoryName() const
- {
- return category_name_;
- }
- //! returns category ID(label ID)
- int
- CategoryInfo::id() const
- {
- return id_;
- }
- //! \brief returns unsigned int indicating category color which can
- //! be translated into ARGB like 0xAARRBBGG
- unsigned int
- CategoryInfo::color() const
- {
- return color_;
- }
- //! returns is_main_ flag
- bool
- CategoryInfo::isMain() const
- {
- return is_main_;
- }
- /*
- *
- */
|