Пример #1
0
/*
 * NonModal VIEW Panel Interface
 *
 * NonModal interfaces are created on activation.
 */
int
HeteroTerrainInterface (long version, GlobalFunc *global, LWInterface *iface,
  void *serverdata )
{
  int rc = AFUNC_OK;

  LWXPanelID     panID = NULL;

  HeteroTerrain	*inst = NULL;

  static LWXPanelHint HT_hint[] = {
    XpLABEL(0,"HeteroTerrain"),
    XpDESTROYNOTIFY(HT_view_destroy),
    XpEND
  };

  // Check the version
  // NOTE: The interface version is different from handler version
  if ( version != LWINTERFACE_VERSION )
    return (AFUNC_BADVERSION);

  xpfunc = global(LWXPANELFUNCS_GLOBAL, GFUSE_TRANSIENT);

  if ( !xpfunc )
    return AFUNC_BADGLOBAL;

  inst = (HeteroTerrain *) iface->inst;

  // If we already have an XPanel which has not been destroyed,
  // we can destroy it and create another, or return the existing instance.
    // Create panel
    panID = (*xpfunc->create)( LWXP_VIEW, OPTS4_ctrl_list );
    if (panID) {

      // Apply some hints
      (*xpfunc->hint) ( panID, 0, OPTS4_hint );
      (*xpfunc->hint) ( panID, 0, HT_hint );

      // Describe the structure of the data instance to the panel
      (*xpfunc->describe)( panID, OPTS4_data_descrip, HT_view_get, HT_view_set);

      // Now give the data instance to the panel
      (*xpfunc->viewInst)( panID, inst );

      // Set the userdata
      (*xpfunc->setData)(panID, 0, inst);
  	}

    // Set the interface panel pointer
    iface->panel = panID;

  // Return and let LightWave play with the panel :)
  return rc;
}
Пример #2
0
LWXPanelID UnMultiply::XPanel()
{
  static LWXPanelControl con[] =
  {
	{CH_UNMU, "Unmultiply", "iBoolean"},
	{CH_UBGC, "Background Colour", "color"},
	{CH_FL2A, "Flare 2 Alpha", "iBoolean"},
	{CH_CALP, "Clip Alpha at Threshold", "iBoolean"},
	{CH_CRGB, "Clip RGB at Threshold", "iBoolean"},
	{CH_THRS, "Threshold", "float"},
	0
  };

  static LWXPanelDataDesc  def[] =
  {
	{CH_UNMU, "Unmultiply", "integer"},
	{CH_UBGC, "Background Colour", "color"},
	{CH_FL2A, "Flare 2 Alpha", "iBoolean"},
	{CH_CALP, "Clip Alpha at Threshold", "integer"},
	{CH_CRGB, "Clip RGB at Threshold", "integer"},
	{CH_THRS, "Threshold", "float"},
	0
  };

  // Hints
  static LWXPanelHint hint[] = 
  {
	XpLABEL( 0, "Alphachannel tools " __DATE__),
	XpENABLE_(CH_CALP),
	  XpH(CH_THRS),
	  XpH(CH_CRGB),
	XpEND,
	XpENABLE_(CH_UNMU),
	  XpH(CH_UBGC),
	XpEND,
	XpDIVADD(CH_UBGC),
	XpDIVADD(CH_FL2A),
	XpEND
  };

  LWXPanelFuncs	  *pan_func = NULL;
  LWXPanelID	  pan = NULL;

  pan_func = ( LWXPanelFuncs * )(*global) (LWXPANELFUNCS_GLOBAL, GFUSE_TRANSIENT);

  pan = (*pan_func->create) (LWXP_VIEW, con);
  if (!pan) return NULL;
  (*pan_func->hint)		(pan, 0, hint );
  //(*pan_func->describe) (pan, def, lwpp::WrapXPanelImageFilter<UnMultiply>::XGet, lwpp::WrapXPanelImageFilter<UnMultiply>::XSet);
  (*pan_func->viewInst) (pan, this);
  (*pan_func->setData)	(pan, 0, this);
  return pan;
}
LWXPanelID get_panel( SurfaceInstance *inst )
{
   static LWXPanelControl xctl[] = {
      { ID_SHADER,   "Shader",   "string",  },
      { ID_TEXTURE0,   "Texture0",   "string" },
      { ID_TEXTURE1,   "Texture1",   "string" },
      { ID_TEXTURE2,   "Texture2",   "string" },
      { ID_TEXTURE3,   "Texture3",   "string" },
      { ID_TEXTURE4,   "Texture4",   "string" },
      { ID_TEXTURE5,   "Texture5",   "string" },
      { ID_TEXTURE6,   "Texture6",   "string" },
      { ID_TEXTURE7,   "Texture7",   "string" },
      { ID_COLOR0,   "Color0",   "color" },
      { ID_COLOR1,   "Color1",   "color" },
      { ID_COLOR2,   "Color2",   "color" },
      { ID_COLOR3,   "Color3",   "color" },
      { ID_COLOR4,   "Color4",   "color" },
      { ID_COLOR5,   "Color5",   "color" },
      { ID_COLOR6,   "Color6",   "color" },
      { ID_COLOR7,   "Color7",   "color" },
      { 0 }
   };
   static LWXPanelDataDesc xdata[] = {
      { ID_SHADER,   "Shader",   "string" },
      { ID_COLOR0,   "Color0",   "float" },
      { ID_COLOR1,   "Color1",   "float" },
      { ID_COLOR2,   "Color2",   "float" },
      { ID_COLOR3,   "Color3",   "float" },
      { ID_COLOR4,   "Color4",   "float" },
      { ID_COLOR5,   "Color5",   "float" },
      { ID_COLOR6,   "Color6",   "float" },
      { ID_COLOR7,   "Color7",   "float" },
      { 0 }
   };
   static LWXPanelHint xhint[] = {
      XpLABEL( 0, "SE Shader" ),
      XpBUTNOTIFY( ID_COLOR0, handle_color ),
      XpCHGNOTIFY( ui_chgnotify ),
      XpEND
   };

   LWXPanelID panel;

   if ( panel = xpanf->create( LWXP_VIEW, xctl )) {
      xpanf->hint( panel, 0, xhint );
      xpanf->describe( panel, xdata, (void *(__cdecl *)(void *,unsigned long))ui_get, (enum en_LWXPRefreshCodes (__cdecl *)(void *,unsigned long,void *))ui_set );
      xpanf->viewInst( panel, inst );
      xpanf->setData( panel, 0, inst );
   }

   return panel;
}
Пример #4
0
/*
======================================================================
Interface()

XPanels Interface.  Called when the user presses the "Options"
button.
====================================================================== */
int Atmosphere::Interface( int version, LWInterface *local, void *serverData )
{
	UNUSED(serverData);
	UNUSED(version);

	if ( !txedf ) return AFUNC_BADGLOBAL;
	
	LWXPanelHint hint[] = {
		XpLABEL( 0, "VFog Settings" ),
		XpBUTNOTIFY( ID_TXBT, XPanelInterface::LWXPanelBtnClickFunc ),
		XpSTRLIST( ID_RES, quality ),
		XpSTRLIST( ID_MARCH, render ),

		XpGROUP_( ID_GGRP ),
			XpH( ID_HI ), XpH( ID_LO ), XpH( ID_FA ), XpH( ID_DEN ), XpEND,
		XpGROUP_( ID_SGRP ),
			XpH( ID_LUM ), XpH( ID_OPA ), XpH( ID_BCK ), XpH( ID_COL ), XpEND,
		XpGROUP_( ID_RGRP ),
			XpH( ID_RES ), XpH( ID_TXTR ), XpH( ID_TXBT ), XpEND,

		XpENABLE_( ID_MARCH ),
			XpH( ID_RGRP ), XpEND,
		XpENABLE_MAP_( ID_BCK, bckMap ),
			XpH( ID_COL ), XpEND,

		XpMIN( ID_LUM, 0 ), XpMAX( ID_LUM, 1 ),
		XpMIN( ID_OPA, 0 ), XpMAX( ID_OPA, 1 ),
		XpMIN( ID_FA, 0 ),  XpMAX( ID_FA, 1 ),

		XpEND
	}; // end hint[]
		
	CreateViewXPanel (ctrl_list, data_descrip, hint);

	// FINE because the callback it is in our class
	LW_XPanel.setUserData(this, ID_TXBT);

	local->panel = LW_XPanel.getID();

	local->options = NULL;
	local->command = NULL;

	return AFUNC_OK;
}
Пример #5
0
/*
 * NonModal VIEW Panel Interface
 *
 * NonModal interfaces are created on activation.
 */
int
DentedInterface (long version, GlobalFunc *global, LWInterface *iface,
  void *serverdata )
{
  int			 rc = AFUNC_OK;
  LWXPanelID     panID = NULL;
  Dented		*inst = NULL;

  // These are the control lists and configuration hints
  static LWXPanelControl DT_ctrl_list[] = {
   { OPTS_SCALE,         "Scale",          "float-env" },
   { OPTS_POWER,         "Power",          "float-env" },
   { OPTS_FREQUENCY,     "Frequency",      "float-env" },
   { OPTS_OCTAVES,       "Octaves",        "float-env" },
   { OPTS_FNOISE,        "Noise Type",     "iPopChoice" },
   {0}
  };

  static LWXPanelDataDesc DT_data_descrip[] = {
   { OPTS_SCALE,         "Scale",          "float-env" },
   { OPTS_POWER,         "Power",          "float-env" },
   { OPTS_FREQUENCY,     "Frequency",      "float-env" },
   { OPTS_OCTAVES,       "Octaves",        "float-env" },
   { OPTS_FNOISE,        "Noise Type",     "integer" },
   {0}
  };

  static LWXPanelHint DT_hint[] = {
    XpSTRLIST(OPTS_FNOISE, FNoise),
    XpRANGE(OPTS_SCALE, -10, 10, 1),
    XpRANGE(OPTS_POWER, -5, 5, 1),
    XpRANGE(OPTS_FREQUENCY, -5, 5, 1),
    XpRANGE(OPTS_OCTAVES, 0, 10, 1),
    XpH(OPTS_SCALE), XpEND,
    XpH(OPTS_POWER), XpEND,
    XpH(OPTS_FREQUENCY), XpEND,
    XpH(OPTS_OCTAVES), XpEND,
    XpH(OPTS_FNOISE), XpEND,
    XpLABEL(0,"Dented"),
    XpDESTROYNOTIFY(DT_view_destroy),
    XpEND
  };

  // Check the version
  // NOTE: The interface version is different from handler version
  if ( version != LWINTERFACE_VERSION )
    return (AFUNC_BADVERSION);

  xpfunc = global(LWXPANELFUNCS_GLOBAL, GFUSE_TRANSIENT);

  if ( !xpfunc )
    return AFUNC_BADGLOBAL;

  inst = (Dented *) iface->inst;

  // If we already have an XPanel which has not been destroyed,
  // we can destroy it and create another, or return the existing instance.
  
    // Create panel
    panID = (*xpfunc->create)( LWXP_VIEW, DT_ctrl_list );
    if (panID) {

      // Apply some hints
      (*xpfunc->hint) ( panID, 0, DT_hint );

      // Describe the structure of the data instance to the panel
      (*xpfunc->describe)( panID, DT_data_descrip, DT_view_get, DT_view_set );

      // Now give the data instance to the panel
      (*xpfunc->viewInst)( panID, inst );

      // Set the userdata
      (*xpfunc->setData)(panID, 0, inst);
  	}

    // Set the interface panel pointer
    iface->panel = panID;

  // Return and let LightWave play with the panel :)
  return rc;
}
Пример #6
0
/*
 * NonModal VIEW Panel Interface
 *
 * NonModal interfaces are created on activation.
 */
int
CoriolisInterface (long version, GlobalFunc *global, LWInterface *iface,
  void *serverdata )
{
  int        rc = AFUNC_OK;
  LWXPanelID     panID = NULL;
  Coriolis     *inst = NULL;

  // These are the control lists and configuration hints
  static LWXPanelControl CS_ctrl_list[] = {
	{ OPTS_SCALE,      "Coriolis Scale",   "float-env" },
	{ OPTS_TWIST,      "Coriolis Twist",   "float-env" },
	{ OPTS_OFFSET,     "Coriolis Offset",  "float-env" },
	{ OPTS_INCREMENT,  "Increment",        "float-env" },
	{ OPTS_LACUNARITY, "Lacunarity",       "float-env" },
	{ OPTS_OCTAVES,    "Octaves",          "float-env" },
	{ OPTS_FNOISE,     "Noise Type",       "iPopChoice" },
	{0}
  };

  static LWXPanelDataDesc CS_data_descrip[] = {
	{ OPTS_SCALE,      "Coriolis Scale",   "float-env" },
	{ OPTS_TWIST,      "Coriolis Twist",   "float-env" },
	{ OPTS_OFFSET,     "Coriolis Offset",  "float-env" },
	{ OPTS_INCREMENT,  "Increment",        "float-env" },
	{ OPTS_LACUNARITY, "Lacunarity",       "float-env" },
	{ OPTS_OCTAVES,    "Octaves",          "float-env" },
	{ OPTS_FNOISE,     "Noise Type",       "integer" },
	{0}
  };

  static LWXPanelHint CS_hint[] = {
	 XpRANGE(OPTS_SCALE, -10, 10, 1),
	 XpRANGE(OPTS_TWIST, -5, 5, 1),
	 XpRANGE(OPTS_OFFSET, -5, 5, 1),
	 XpH(OPTS_SCALE), XpEND,
	 XpH(OPTS_TWIST), XpEND,
	 XpH(OPTS_OFFSET), XpEND,
	 XpLABEL(0,"Coriolis"),
	 XpDESTROYNOTIFY(CS_view_destroy),
	 XpEND
  };

  // Check the version
  // NOTE: The interface version is different from handler version
  if ( version != LWINTERFACE_VERSION )
	 return (AFUNC_BADVERSION);

  xpfunc = global(LWXPANELFUNCS_GLOBAL, GFUSE_TRANSIENT);

  if ( !xpfunc )
	 return AFUNC_BADGLOBAL;

  inst = (Coriolis *) iface->inst;

  // If we already have an XPanel which has not been destroyed,
  // we can destroy it and create another, or return the existing instance.

	// Create panel
	 panID = (*xpfunc->create)( LWXP_VIEW, CS_ctrl_list );
	 if (panID) {

	  // Apply some hints
		(*xpfunc->hint) ( panID, 0, CS_hint );
		(*xpfunc->hint) ( panID, 0, OPTS3_hint );

	  // Describe the structure of the data instance to the panel
		(*xpfunc->describe)( panID, CS_data_descrip, CS_view_get, CS_view_set );

		// Now give the data instance to the panel
	  (*xpfunc->viewInst)( panID, inst );

		// Set the userdata
		(*xpfunc->setData)(panID, 0, inst);

	}

	 // Set the interface panel pointer
	 iface->panel = panID;


  // Return and let LightWave play with the panel :)
  return rc;
}
Пример #7
0
int get_user( LWXPanelFuncs *xpanf, double *size, double *center,
   char *surfname, char *vmapname )
{
   LWXPanelID panel;
   int ok = 0;

   enum { ID_SIZE = 0x8001, ID_CENTER, ID_SURFLIST, ID_VMAPNAME };
   LWXPanelControl ctl[] = {
      { ID_SIZE,     "Size",      "distance3"  },
      { ID_CENTER,   "Center",    "distance3"  },
      { ID_SURFLIST, "Surface",   "iPopChoice" },
      { ID_VMAPNAME, "VMap Name", "string"     },
      { 0 }
   };
   LWXPanelDataDesc cdata[] = {
      { ID_SIZE,     "Size",      "distance3" },
      { ID_CENTER,   "Center",    "distance3" },
      { ID_SURFLIST, "Surface",   "integer"   },
      { ID_VMAPNAME, "VMap Name", "string"    },
      { 0 }
   };
   LWXPanelHint hint[] = {
      XpLABEL( 0, "Box Tutorial Part 3" ),
      XpDIVADD( ID_SIZE ),
      XpDIVADD( ID_CENTER ),
      XpSTRLIST( ID_SURFLIST, surflist ),
      XpEND
   };

   panel = xpanf->create( LWXP_FORM, ctl );
   if ( !panel ) return 0;

   xpanf->describe( panel, cdata, NULL, NULL );
   xpanf->hint( panel, 0, hint );
   xpanf->formSet( panel, ID_SIZE, size );
   xpanf->formSet( panel, ID_CENTER, center );
   xpanf->formSet( panel, ID_SURFLIST, 0 );
   xpanf->formSet( panel, ID_VMAPNAME, vmapname );

   ok = xpanf->post( panel );

   if ( ok ) {
      double *d;
      int *i;
      char *a;

      d = xpanf->formGet( panel, ID_SIZE );
      size[ 0 ] = d[ 0 ];
      size[ 1 ] = d[ 1 ];
      size[ 2 ] = d[ 2 ];

      d = xpanf->formGet( panel, ID_CENTER );
      center[ 0 ] = d[ 0 ];
      center[ 1 ] = d[ 1 ];
      center[ 2 ] = d[ 2 ];

      i = xpanf->formGet( panel, ID_SURFLIST );
      strcpy( surfname, surflist[ *i ] );

      a = xpanf->formGet( panel, ID_VMAPNAME );
      strcpy( vmapname, a );
   }

   xpanf->destroy( panel );
   return ok;
}
Пример #8
0
// OpenUI():
//  Opens the user interface.  Returns after the panel has been closed.
bool Nullify_Interface::OpenUI() {
  // Destroy the panel if it hasn't been destroyed yet
  if( panel != NULL ) {
    (*xpanels->destroy)( panel );
    panel = NULL;
  }

  // Create the control array
  static LWXPanelControl controls[] = {
    { NUI_ABOUT,               "About",                       "vButton"  },
    { NUI_PREFIX,              "Prefix With",                 "string"   },
    { NUI_SUFFIX,              "Suffix With",                 "string"   },
    { NUI_NULLIFY_DECENDANTS,  "Nullify Decendants",          "iBoolean" },
    { NUI_REMOVE_BONES,        "Remove Bones",                "iBoolean" },
    { NUI_DISABLE_SHADOWS,     "Disable Shadow Options",      "iBoolean" },
    { NUI_STORE_ORIGINAL_NAME, "Store Original Names",        "iBoolean" },
    { NUI_REMOVE_MORPH_MIXER,  "Remove Morph Mixer",          "iBoolean" },
    { 0 } };

  // Create the data array
  static LWXPanelDataDesc data[] = {
    { NUI_ABOUT,               "About",                       ""        },
    { NUI_PREFIX,              "Prefix With",                 "string"  },
    { NUI_SUFFIX,              "Suffix With",                 "string"  },
    { NUI_NULLIFY_DECENDANTS,  "Nullify Decendants",          "integer" },
    { NUI_REMOVE_BONES,        "Remove Bones",                "integer" },
    { NUI_DISABLE_SHADOWS ,    "Disable Shadow Options",      "integer" },
    { NUI_STORE_ORIGINAL_NAME, "Store Original Names",        "integer" },
    { NUI_REMOVE_MORPH_MIXER,  "Remove Morph Mixer",          "integer" },
    { 0 } };

  // Panel Hints Array
  char title_string[256];
  sprintf( title_string, "Nullify -- %c2000-2001 Joe Angell, TM Productions", 169 );
  static LWXPanelHint panel_hints[] = {
    XpLABEL( 0, title_string ),
    XpGROUP_( NUI_GROUP_NAME ),
      XpH( NUI_PREFIX ),
      XpH( NUI_SUFFIX ),
      XpH( 0 ),

    XpGROUP_( NUI_GROUP_OPTIONS ),
      XpH( NUI_NULLIFY_DECENDANTS ),
      XpH( NUI_REMOVE_BONES ),
      XpH( NUI_DISABLE_SHADOWS ),
      XpH( NUI_REMOVE_MORPH_MIXER ),
      XpH( 0 ),

    XpBUTNOTIFY( NUI_ABOUT, HandleAbout ),

    XpEND };

  // Get XPanels
  xpanels = (LWXPanelFuncs *)global( LWXPANELFUNCS_GLOBAL, GFUSE_TRANSIENT );
  if( xpanels == NULL ) {
    retval = AFUNC_BADGLOBAL;
    return false;
  }

  // Create the Panel
  panel = (*xpanels->create)( LWXP_FORM, controls );
  if( panel == NULL ) {
    (*message->error)( "Nullify Error: Unable to create XPanels interface", NULL );
    is_ok = false;
    return false;
  }

  // Set up other panel data
  (*xpanels->describe)( panel, data, NULL, NULL );
  (*xpanels->hint)( panel, 0, panel_hints );

  // Set up initial values for the panel
  (*xpanels->formSet)( panel, NUI_PREFIX, prefix );
  (*xpanels->formSet)( panel, NUI_SUFFIX, suffix );
  FSETINT( xpanels, panel, NUI_NULLIFY_DECENDANTS,  (nullify_decendants  ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_REMOVE_BONES,        (remove_bones        ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_DISABLE_SHADOWS,     (disable_shadows     ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_STORE_ORIGINAL_NAME, (store_original_name ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_REMOVE_MORPH_MIXER,  (remove_morph_mixer  ? 1 : 0) );

  // Open the panel
  if( (*xpanels->post)( panel ) != 1 )  { // User Cancel
    user_abort = true;
    return false;
  }

  return IsOK();
}
Пример #9
0
// OpenUI():
//  Opens the user interface.  Returns after the panel has been closed.
bool ObjectShadowOptions_Interface::OpenUI() {
  // Destroy the panel if it hasn't been destroyed yet
  if( panel != NULL ) {
    (*xpanels->destroy)( panel );
    panel = NULL;
  }

  // Create the control array
  static LWXPanelControl controls[] = {
    { OUI_ABOUT,               "About",                       "vButton"    },
    { OUI_LIMIT_TO,            "Limit To",                    "iPopChoice" },
    { OUI_MATCH_TOGGLE,        "Match Name",                  "iBoolean"   },
    { OUI_MATCH_STRING,          "Name Contains",               "string"     },
    { OUI_SELF_SHADOW,         "Self Shadow",                 "iBoolean"   },
    { OUI_CAST_SHADOW,         "Cast Shadow",                 "iBoolean"   },
    { OUI_RECEIVE_SHADOW,      "Receive Shadow",              "iBoolean"   },
    { OUI_UNSEEN_BY_RAYS,      "Unseen By Rays",              "iBoolean"   },
    { OUI_UNSEEN_BY_CAMERA,    "Unseen By Camera",            "iBoolean"   },
    { 0 } };

  // Create the data array
  static LWXPanelDataDesc data[] = {
    { OUI_ABOUT,               "About",                       ""           },
    { OUI_LIMIT_TO,            "Limit To",                    "integer"    },
    { OUI_MATCH_TOGGLE,        "Match Name",                  "integer"    },
    { OUI_MATCH_STRING,          "Name Contains",               "string"     },
    { OUI_SELF_SHADOW,         "Self Shadow",                 "integer"    },
    { OUI_CAST_SHADOW,         "Cast Shadow",                 "integer"    },
    { OUI_RECEIVE_SHADOW,      "Receive Shadow",              "integer"    },
    { OUI_UNSEEN_BY_RAYS,      "Unseen By Rays",              "integer"    },
    { OUI_UNSEEN_BY_CAMERA,    "Unseen By Camera",            "integer"    },
    { 0 } };

  // Panel Hints Array
  char title_string[256];
  sprintf( title_string, "ObjectShadowOptions -- %c2001 Foundation Imaging, written by Joe Angell", 169 );
  static LWXPanelHint panel_hints[] = {
    XpLABEL( 0, title_string ),

    XpGROUP_( OUI_GROUP_LIMIT ),
      XpH( OUI_LIMIT_TO ),
      XpH( 0 ),

    XpGROUP_( OUI_GROUP_MATCH ),
      XpH( OUI_MATCH_TOGGLE ),
      XpH( OUI_MATCH_STRING ),
      XpH(0),
    
    XpGROUP_( OUI_GROUP_SHADOW ),
      XpH( OUI_SELF_SHADOW ),
      XpH( OUI_CAST_SHADOW ),
      XpH( OUI_RECEIVE_SHADOW ),
      XpH( 0 ),

    XpGROUP_( OUI_GROUP_RENDER ),
      XpH( OUI_UNSEEN_BY_RAYS ),
      XpH( OUI_UNSEEN_BY_CAMERA ),
      XpH( 0 ),

    XpBUTNOTIFY( OUI_ABOUT, HandleAbout ),

    XpPOPFUNCS(  OUI_LIMIT_TO, LimitCount, LimitName ),

    XpENABLE_( OUI_MATCH_TOGGLE ),
      XpH( OUI_MATCH_STRING ),
      XpH( 0 ),

    XpEND };

  // Get XPanels
  xpanels = (LWXPanelFuncs *)global( LWXPANELFUNCS_GLOBAL, GFUSE_TRANSIENT );
  if( xpanels == NULL ) {
    retval = AFUNC_BADGLOBAL;
    return false;
  }

  // Create the Panel
  panel = (*xpanels->create)( LWXP_FORM, controls );
  if( panel == NULL ) {
    (*message->error)( "Nullify Error: Unable to create XPanels interface", NULL );
    is_ok = false;
    return false;
  }

  // Set up other panel data
  (*xpanels->describe)( panel, data, NULL, NULL );
  (*xpanels->hint)( panel, 0, panel_hints );

  // Set up initial values for the panel
  FSETINT( xpanels, panel, OUI_LIMIT_TO,         limit_to         );
  FSETINT( xpanels, panel, OUI_MATCH_TOGGLE,     match_toggle     );
  FSETINT( xpanels, panel, OUI_SELF_SHADOW,      self_shadow      );
  FSETINT( xpanels, panel, OUI_RECEIVE_SHADOW,   receive_shadow   );
  FSETINT( xpanels, panel, OUI_CAST_SHADOW,      cast_shadow      );
  FSETINT( xpanels, panel, OUI_UNSEEN_BY_CAMERA, unseen_by_camera );
  FSETINT( xpanels, panel, OUI_UNSEEN_BY_RAYS,   unseen_by_rays   );

  (*xpanels->formSet)( panel, OUI_MATCH_STRING, match_string );

  // Open the panel
  if( (*xpanels->post)( panel ) != 1 )  { // User Cancel
    user_abort = true;
    return false;
  }

  return IsOK();
}
Пример #10
0
static LWXPanelID get_panel( AtmosphereData *dat )
{
   static LWXPanelControl ctrl_list[] = {
      { ID_MARCH, "Render Type",        "iPopChoice" },
      { ID_HI,    "Top",                "distance"   },
      { ID_LO,    "Bottom",             "distance"   },
      { ID_FA,    "Falloff",            "percent"    },
      { ID_DEN,   "Nominal Distance",   "distance"   },
      { ID_LUM,   "Luminosity",         "percent"    },
      { ID_OPA,   "Opacity",            "percent"    },
      { ID_BCK,   "Use Backdrop Color", "iBoolean"   },
      { ID_COL,   "Color",              "color"      },
      { ID_RES,   "Quality",            "iPopChoice" },
      { ID_TXTR,  "Use Texture",        "iBoolean"   },
      { ID_TXBT,  "Edit Texture",       "vButton"    },
      { 0 }
   };

   static LWXPanelDataDesc data_descrip[] = {
      { ID_MARCH, "Render Type",        "integer"    },
      { ID_HI,    "Top",                "distance"   },
      { ID_LO,    "Bottom",             "distance"   },
      { ID_FA,    "Falloff",            "percent"    },
      { ID_DEN,   "Nominal Distance",   "distance"   },
      { ID_LUM,   "Luminosity",         "percent"    },
      { ID_OPA,   "Opacity",            "percent"    },
      { ID_BCK,   "Use Backdrop Color", "integer"    },
      { ID_COL,   "Color",              "color"      },
      { ID_RES,   "Quality",            "integer"    },
      { ID_TXTR,  "Use Texture",        "integer"    },
      { ID_TXBT,  "Edit Texture",       NULL         },
      { 0 },
   };

   static char *quality[] = { "Very Low", "Low", "Medium", "Good", "Very Good", NULL };
   static char *render[] = { "Fast Fog", "Ray Marcher", NULL };
   static int bckMap[] = { 1, 0 };

   static LWXPanelHint hint[] = {
      XpLABEL( 0, "VFog Settings" ),
      XpDESTROYNOTIFY( destroy_notify ),
      XpBUTNOTIFY( ID_TXBT, button_event ),
      XpSTRLIST( ID_RES, quality ),
      XpSTRLIST( ID_MARCH, render ),

      XpGROUP_( ID_GGRP ),
         XpH( ID_HI ), XpH( ID_LO ), XpH( ID_FA ), XpH( ID_DEN ), XpEND,
      XpGROUP_( ID_SGRP ),
         XpH( ID_LUM ), XpH( ID_OPA ), XpH( ID_BCK ), XpH( ID_COL ), XpEND,
      XpGROUP_( ID_RGRP ),
         XpH( ID_RES ), XpH( ID_TXTR ), XpH( ID_TXBT ), XpEND,

      XpENABLE_( ID_MARCH ),
         XpH( ID_RGRP ), XpEND,
      XpENABLE_MAP_( ID_BCK, bckMap ),
         XpH( ID_COL ), XpEND,

      XpMIN( ID_LUM, 0 ), XpMAX( ID_LUM, 1 ),
      XpMIN( ID_OPA, 0 ), XpMAX( ID_OPA, 1 ),
      XpMIN( ID_FA, 0 ),  XpMAX( ID_FA, 1 ),

      XpEND
   };

   LWXPanelID panel;


   panel = xpanf->create( LWXP_VIEW, ctrl_list );
   if ( panel ) {
      xpanf->describe( panel, data_descrip, ui_get, ui_set );
      xpanf->hint( panel, 0, hint );
      xpanf->viewInst( panel, dat );
      xpanf->setData( panel, ID_TXBT, dat );
      xpanf->setData( panel, 0, dat );

      if ( !dat->txedID )
         dat->txedID = txedf->subscribe( "FogTexture",
            TEF_ALL - TEF_USEBTN, NULL, NULL, NULL, NULL );
   }

   return panel;
}
Пример #11
0
/* ======================================================================
Interface()
====================================================================== */
int hotdm::Interface( long version, LWInterface *local, void *serverData )
{
	UNUSED(version);
	UNUSED(serverData);
	
	static LWXPanelControl ctrl[] =
	{
		{ID_RESO, "Resolution",					"iSliderText"},
		{ID_GLSC, "Global Scale",				"distance-env"},
		{ID_WAVH, "Wave Height",				"distance-env"},
		{ID_SWAV, "Shortest Wave",				"distance-env"},
		{ID_DCHP, "Use Choppiness",				"iBoolean"},
		{ID_CHOP, "Choppiness",					"distance-env"},
		{ID_WSPD, "Wind Speed (m/s)",			"float-env"},
		{ID_WDIR, "Wind Direction (º)",			"angle-env"},
		{ID_WALG, "Wind Align",					"float-env"},
		{ID_DREF, "Damp Reflections",			"float-env"},
		{ID_ODEP, "Ocean Depth",				"distance-env"},
		{ID_SEED, "Seed",						"integer"},
		{ID_INTP, "Catmull-Rom Interpolation",	"iBoolean"},
		{ID_PRES, "Presets",					"vPopCmd"},
		/* This DOESNT work for displacement plugins, But left the code to see how other controls can be done */
		// {ID_NORM, "Do Normals",					"iBoolean"},
		// {ID_JACB, "Jacobian",	"iBoolean"},
		{ 0 }
	};
  
	static LWXPanelDataDesc desc[] =
	{
		{ID_RESO, "Resolution",					"integer"},
		{ID_GLSC, "Global Scale",				"distance-env"},
		{ID_WAVH, "Wave Height",				"distance-env"},
		{ID_SWAV, "Shortest Wave",				"distance-env"},
		{ID_DCHP, "Use Choppiness",				"integer"},
		{ID_CHOP, "Choppiness",					"distance-env"},
		{ID_WSPD, "Wind Speed (m/s)",			"float-env"},
		{ID_WDIR, "Wind Direction (º)",			"angle-env"},
		{ID_WALG, "Wind Align",					"float-env"},
		{ID_DREF, "Damp Reflections",			"float-env"},
		{ID_ODEP, "Ocean Depth",				"distance-env"},
		{ID_SEED, "Seed",						"integer"},
		{ID_INTP, "Catmull-Rom Interpolation",	"integer"},
		{ID_PRES, "Presets",					"integer"},
		/* This DOESNT work for displacement plugins, But left the code to see how other controls can be done */
		// {ID_NORM, "Do Normals",					"integer"},
		// {ID_JACB, "Jacobian",					"integer"},
		{ 0 }
	};
	
	static LWXPanelHint hints[] = {
		XpLABEL( 0, "HOT Ocean Toolkit" ),
		// Enable Use Choppiness and  Chopinnes controls
		XpENABLE_(ID_DCHP),XpH(ID_CHOP),XpEND,
		/* This DOESNT work for displacement plugins, But left the code to see how other controls can be done */
		// XpENABLE_MAP_(ID_DCHP, nrm_map), XpH(ID_NORM),XpEND,
		
		XpDIVADD( ID_GLSC ), //Separator after Global Scale
		XpDIVADD( ID_SWAV ),
		XpDIVADD( ID_CHOP ),
		XpDIVADD( ID_WALG ),
		XpDIVADD( ID_ODEP ),
		XpDIVADD( ID_INTP ),

		XpMIN( ID_RESO, 1 ), // Resolution
		XpMAX( ID_RESO, 12 ),
		XpSTEP( ID_RESO, 1 ),

		XpMIN( ID_GLSC, 0 ), // Global Scale 
		XpMAX( ID_GLSC, 5000000 ),
		XpSTEP( ID_GLSC, 1 ),

		XpMIN( ID_WAVH, 0 ), // Wave Height
		XpMAX( ID_WAVH, 5000 ),
		XpSTEP( ID_WAVH, 1 ),
		
		XpMIN( ID_SWAV, 0 ), // Shortest Wave
		XpMAX( ID_SWAV, 500 ),
		XpSTEP( ID_SWAV, 1 ),

		XpMIN( ID_CHOP, 0 ), // Choppiness
		XpMAX( ID_CHOP, 50 ),
		XpSTEP( ID_CHOP, 1 ),

		XpMIN( ID_WSPD, 0 ), // Wind Speed
		XpMAX( ID_WSPD, 50000 ),
		XpSTEP( ID_WSPD, 1 ),

		XpMIN( ID_WALG, 0 ), // Wind Align
		XpMAX( ID_WALG, 10 ),
		XpSTEP( ID_WALG, 1 ),

		XpMIN( ID_DREF, 0 ), // Damp Reflections
		XpMAX( ID_DREF, 1 ),
		XpSTEP( ID_DREF, 1 ),

		XpMIN( ID_ODEP, 0 ), // Ocean Depth
		XpMAX( ID_ODEP, 50000 ),
		XpSTEP( ID_ODEP, 1 ),
 
		XpEND
	}; // end hint[]

	CreateViewXPanel (ctrl, desc, hints);
	Preset.Setup(LW_XPanel, ID_PRES);
	local->panel = LW_XPanel.getID();

	return AFUNC_OK;
}