Panda3D
 All Classes Functions Variables Enumerations
textGraphic.h
00001 // Filename: textGraphic.h
00002 // Created by:  drose (18Aug06)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef TEXTGRAPHIC_H
00016 #define TEXTGRAPHIC_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "config_text.h"
00021 #include "nodePath.h"
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //       Class : TextGraphic
00025 // Description : This defines a special model that has been
00026 //               constructed for the purposes of embedding an
00027 //               arbitrary graphic image within a text paragraph.
00028 //
00029 //               It can be any arbitrary model, though it should be
00030 //               built along the same scale as the text, and it should
00031 //               probably be at least mostly two-dimensional.
00032 //               Typically, this means it should be constructed in the
00033 //               X-Z plane, and it should have a maximum vertical (Z)
00034 //               height of 1.0.
00035 //
00036 //               The frame specifies an arbitrary bounding volume in
00037 //               the form (left, right, bottom, top).  This indicates
00038 //               the amount of space that will be reserved within the
00039 //               paragraph.  The actual model is not actually required
00040 //               to fit within this rectangle, but if it does not, it
00041 //               may visually overlap with nearby text.
00042 ////////////////////////////////////////////////////////////////////
00043 class EXPCL_PANDA_TEXT TextGraphic {
00044 PUBLISHED:
00045   INLINE TextGraphic();
00046   INLINE TextGraphic(const NodePath &model, const LVecBase4 &frame);
00047   INLINE TextGraphic(const NodePath &model, PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
00048 
00049   INLINE NodePath get_model() const;
00050   INLINE void set_model(const NodePath &model);
00051 
00052   INLINE LVecBase4 get_frame() const;
00053   INLINE void set_frame(const LVecBase4 &frame);
00054   INLINE void set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
00055 
00056   INLINE bool get_instance_flag() const;
00057   INLINE void set_instance_flag(bool instance_flag);
00058 
00059 private:
00060   NodePath _model;
00061   LVecBase4 _frame;
00062   bool _instance_flag;
00063 };
00064 
00065 #include "textGraphic.I"
00066 
00067 #endif
 All Classes Functions Variables Enumerations