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

/*********************************************************************/

#ifndef __diguyAuthorVisualMultiline_H
#define __diguyAuthorVisualMultiline_H

#include <declspec_diguy.h>
#include <diguy_vector_classes.h>
class diguyAuthorVisualMaterial;
class diguyAuthorVisualMultiline;
class bdiGeometryMultilineData;

typedef diguyAuthorVisualMultiline* diguyAuthorVisualMultilineCreateFunc(void* internal_data, long visual_uid);


/*l
 **  Function for setting the create function for multiline visual subclass
 **  objects.  This should be called after diguy_author_initialize(), but
 **  before any scenario is created of loaded.
 */
BDI_DECLSPEC_diguy void diguy_author_set_multiline_visual_create_func(diguyAuthorVisualMultilineCreateFunc* func);


/**
 *t  diguyAuthorVisualMultiline
 **
 ** \brief
 **
 **    The diguyAuthorVisualMultiline class provides an interface for creating
 **    supplemental visuals needed for creating DI-Guy scenarios in a Host
 **    App.
 **
 **    Multiline visuals are used for representing the spline curce of
 **    character paths.
 **
 *b    Link against: libdiguy
 */
class BDI_DECLSPEC_diguy diguyAuthorVisualMultiline
{

public:

   /*l
    **  Returns the visual material to be used for rendering this object.
    **
    **  Because multilines have no polygons the brush color of the material
    **  is not used.
    */
   diguyAuthorVisualMaterial* get_visual_material();

   int  get_num_points();
   diguyVec3f get_point_position(int point_number);
   diguyVec3d get_point_position_double(int point_number);

   /*l
    **  Returns the uid (unique identifier) of this multiline.
    */
   long get_uid();

   /*l
    **  Returns 1 if this visual should be visible, else 0.
    */
   int get_visible();


/*****************************************************************************/
/**
 *2  Virtual Functions
 **
 **    The functions in this section are all virtual functions that will
 **    be called by DI-Guy Author at various times during DI-Guy execution.
 **
 **    Because the functions are all virtual, DI-Guy programmers can create
 **    a subclass of this class and override them.  Unless otherwise stated,
 **    the base class functions do not need to be called.
 */

   /*l
    *b  Description:
    **
    **    See diguyAuthorVisualWaypoint::build() for general information
    **    about this function.
    **
    **    Multilines are mostly represented by renderer line primitives.
    */
   virtual void build();

   /*l
    *b  Description:
    **
    **    See diguyAuthorVisualWaypoint::unbuild() for general information
    **    about this function.
    */
   virtual void unbuild();

   /*l
    *b  Description:
    **
    **    See diguyAuthorVisualWaypoint::update() for general information
    **    about this function.
    **
    *i    DIGUY_GRAPHICS_VISUAL_UPDATE_GEOMETRY
    **
    **      The functions get_num_points(), get_point_position(), etc.,
    **      should be used to create line primitives.
    **
    *i    DIGUY_GRAPHICS_VISUAL_UPDATE_POSITION
    **
    **      Multiline visuals do not use this value.  The overall positions
    **      of line segment endpoints that make up the multiline are
    **      recomputed and applied during an overall geometry update
    **      operation.
    */
   virtual void update(int update_flags);

   /*l
    *b  Description:
    **
    **    See diguyAuthorVisualWaypoint::draw() for general information
    **    about this function.
    */
   virtual void draw();

   /*l
    *b  Description:
    **
    **    See diguyAuthorVisualWaypoint::show() for general information
    **    about this function.
    */
   virtual void show();

   /*l
    *b  Description:
    **
    **    See diguyAuthorVisualWaypoint::hide() for general information
    **    about this function.
    */
   virtual void hide();




/****************************************************************************/
/****************************************************************************/

/**
 *x  The functions and variables past this point are for internal use only.
 **   No external access to them is expected or necessary.
 */
   static diguyAuthorVisualMultilineCreateFunc* s_create_func;

protected:

   // protected constructor and destructor
   diguyAuthorVisualMultiline(void* internal_data, long uid);
   virtual ~diguyAuthorVisualMultiline();

   bdiGeometryMultilineData* m_scripted_object;
   bdiGeometryMultilineData* get_scripted_object() {return m_scripted_object;}

   diguyAuthorVisualMaterial* m_visual_material;
   long m_uid;

   friend class bdiPath;
   friend class bdiGeometryMultilineData;

};

#endif /* __diguyAuthorVisualMultiline_H */

