/* Fichier de gestion des deplacements en 3d a l'aide de la souris.*/
/* Olivier Didelot le 18 decembre 1995.*/
/* Derniere modification : Olivier Didelot le 17 janvier 1996.*/
/* Derniere modification : Marc Villemain le 04 juillet 1996 : adaptation ACP*/
 
#ifndef PIC_DEPLACER_H
#define PIC_DEPLACER_H
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
/* For DLL using these function :*/
#include "cpa_expt.h" 
 
#define GLI_tdstEqPlan_ PIC_tdstEqPlan_
#define GLI_tdstEqPlan PIC_tdstEqPlan
#define GLI_vCreatePlan PIC_vCreatePlan
#define GLI_cIsPlanNull PIC_cIsPlanNull
#define GLI_vDefinePlanEquation PIC_vDefinePlanEquation
#define GLI_vDefinePlanByNormale PIC_vDefinePlanByNormale
#define GLI_vDefinePlanBy3Points PIC_vDefinePlanBy3Points
#define GLI_bIntersectionPlanDroite PIC_bIntersectionPlanDroite
#define GLI_bGetVecteurDeplacement PIC_bGetVecteurDeplacement
#define GLI_vInitDeplacement PIC_vInitDeplacement
#define GLI_vEndDeplacement PIC_vEndDeplacement
 
/* Un plan est defini par son equation :*/
/* a.x + b.y + c.z + d=0*/
typedef struct PIC_tdstEqPlan_
{
  MTH_tdxReal xA;
  MTH_tdxReal xB;
  MTH_tdxReal xC;
  MTH_tdxReal xD;
 
} PIC_tdstEqPlan ;
 
extern CPA_EXPORT void PIC_vCreatePlan ( PIC_tdstEqPlan *p_stPlan );
extern CPA_EXPORT BOOL PIC_cIsPlanNull ( PIC_tdstEqPlan *p_stPlan );
extern CPA_EXPORT void PIC_vDefinePlanEquation ( PIC_tdstEqPlan *p_stPlan ,
                               MTH_tdxReal xA ,
                               MTH_tdxReal xB ,
                               MTH_tdxReal xC , 
                               MTH_tdxReal xD );
extern CPA_EXPORT void PIC_vDefinePlanByNormale ( PIC_tdstEqPlan *p_stPlan ,
                                MTH3D_tdstVector *p_stNormal, 
                                MTH3D_tdstVector *p_stPoint );
extern CPA_EXPORT void PIC_vDefinePlanBy3Points ( PIC_tdstEqPlan *p_stPlan ,
                                MTH3D_tdstVector *p_stA, 
                                MTH3D_tdstVector *p_stB, 
                                MTH3D_tdstVector *p_stC );
extern CPA_EXPORT BOOL PIC_bIntersectionPlanDroite ( PIC_tdstEqPlan *p_stPlan ,
                                   MTH3D_tdstVector *p_stA ,
                                   MTH3D_tdstVector *p_stB ,
                                   MTH3D_tdstVector *p_stInter );
 
 
 
/*  Calculate the moving vector of 3d Mouse, if this is possible.*/
extern CPA_EXPORT BOOL PIC_bGetVecteurDeplacement ( GLI_tdst2DVertex *p_stMouse2D ,
                                  MTH3D_tdstVector *p_stVect ) ;
extern CPA_EXPORT void PIC_vInitDeplacement ( GLD_tdhDevice hDev ,
                            GLD_tdhViewport hVp ,
                            GLI_tdst2DVertex *p_stMouse2D ,
                            MTH3D_tdstVector *p_stPointMobil);
extern CPA_EXPORT void PIC_vEndDeplacement ( void ) ;
 
 
#ifdef __cplusplus
};
#endif /* __cplusplus */
 
#endif  /* PIC_DEPLACER_H*/
