Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8603 in orxonox.OLD


Ignore:
Timestamp:
Jun 20, 2006, 9:10:19 AM (18 years ago)
Author:
bensch
Message:

debug function

Location:
branches/gui/src/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl/glgui_widget.cc

    r8598 r8603  
    282282    LoadParam(root, "foreground-color", this, GLGuiWidget, setForegroundColorS);
    283283
    284 //    LoadParamXML(root, "backmat", this, GLGuiWidget, loadBackgroundMaterial);
    285 //    LoadParamXML(root, "frontmat", this, GLGuiWidget, loadForegroundMaterial);
     284    //    LoadParamXML(root, "backmat", this, GLGuiWidget, loadBackgroundMaterial);
     285    //    LoadParamXML(root, "frontmat", this, GLGuiWidget, loadForegroundMaterial);
    286286
    287287    LoadParam(root, "feature-position", this, GLGuiWidget, setFeaturePositionS);
     
    514514  }
    515515
    516     /**
    517    * @brief sets the Background Texture to all States.
    518    * @param textureName the Texture's fileName.
    519      */
     516  /**
     517  * @brief sets the Background Texture to all States.
     518  * @param textureName the Texture's fileName.
     519   */
    520520  void GLGuiWidget::setBackgroundTexture(const std::string& textureName)
    521521  {
     
    620620
    621621  void GLGuiWidget::loadForegroundMaterial(const Material& material)
    622   {}
     622{}
    623623  void GLGuiWidget::loadForegroundMaterial(const Material& material, OrxGui::State state)
    624624  {}
     
    707707    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
    708708      if (stateName == OrxGui::StateString[i])
    709     {
    710       *state = (OrxGui::State)i;
    711       return true;
    712     }
     709      {
     710        *state = (OrxGui::State)i;
     711        return true;
     712      }
    713713    return false;
    714714  }
     
    740740  }
    741741
     742  void GLGuiWidget::debug() const
     743  {
     744    PRINT(0)("Debug of %s::%s - WidgetPart ", this->getClassName(), this->getName());
     745    if (_parent != NULL)
     746      PRINT(0)("- Parent %s::%s ", _parent->getClassName(), _parent->getName());
     747    PRINT(0)("- State: %s", StateString[_state].c_str());
     748
     749    if (_focusable)
     750      PRINT(0)("- focusable ");
     751    if (_clickable)
     752      PRINT(0)("- Clickable ");
     753    if (_pushed)
     754      PRINT(0)("- Pushed ");
     755    PRINT(0)("\n");
     756
     757
     758    PRINT(0)("Minimum Size %0.2f %0.2f ", _minSize.x, _minSize.y);
     759    PRINT(0)("Back Rect: ");
     760    _backRect.debug();
     761    PRINT(0)("Style:\n");
     762
     763    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     764    {
     765      PRINT(0)("In State %s: \n", StateString[i].c_str());
     766
     767      PRINT(0)("  Borders: Left: %0.2f, Right: %0.2f, Top: %0.2f, Bottom %0.2f\n",
     768               _style[i]._borderLeft, _style[i]._borderRight, _style[i]._borderTop, _style[i]._borderBottom);
     769      PRINT(0)("  TextSize %0.2f", _style[i]._textSize);
     770      PRINT(0)(" - BackgroundColor"); _style[i]._background.diffuseColor().debug();
     771      PRINT(0)(" - ForegroundColor"); _style[i]._foreground.diffuseColor().debug();
     772      PRINT(0)("\n");
     773    }
     774
     775
     776    PRINT(0)(" Feature at %s ", FeaturePositionString[_featurePosition].c_str());
     777    /// TODO    PRINT(0)("");    Font*               _font;                 //!< The Font used in the current Widget.
     778
     779    if (_animated)
     780      PRINT(0)("- Animated ");
     781    if (_animatedStateChanges)
     782      PRINT(0)("- AnimatedStateChanges");
     783    PRINT(0)("\n");
     784
     785    /*
     786    float               _animationCycle;
     787    float               _animationDuration;
     788    StatedStyle         _currentStyle;
     789    OrxGui::State       _currentState;
     790    */
     791  }
     792
     793
    742794}
  • branches/gui/src/lib/gui/gl/glgui_widget.h

    r8598 r8603  
    250250    virtual void destroyed();
    251251
     252    virtual void debug() const;
    252253
    253254  private:
  • branches/gui/src/lib/math/rect2D.cc

    r8448 r8603  
    475475}
    476476
     477/**
     478 * @brief print debug output for the Rect
     479 */
     480void Rect2D::debug() const
     481{
     482  PRINT(0)("Top: %0.2f Left: %0.2f; Bottom %0.2f Right:%0.2f; Size: %0.2fx%0.2f\n", top(), left(), bottom(), right(), size().x, size().y);
     483}
  • branches/gui/src/lib/math/rect2D.h

    r8448 r8603  
    127127  const Rect2D& slerp(const Rect2D& rect, float value);
    128128
     129  void debug() const;
     130
    129131private:
    130132  Vector2D _topLeft;
  • branches/gui/src/lib/util/color.cc

    r8448 r8603  
    2424  printf("r:%0.2f g:%0.2f, b:%0.2f, a:%0.2f\n", r(), g(), b(), a());
    2525}
     26
     27
    2628
    2729/**
Note: See TracChangeset for help on using the changeset viewer.