/*
Copyright (c) 2024 PTC Inc. and/or Its Subsidiary Companies. All Rights Reserved.
*/
#include <ProToolkit.h>
#include <ProGraphic.h>
#include <ProLayer.h>
#include <ProUtil.h>
#include <TestError.h>
ProError UserScanLayers()
{
ProFileName msgfil;
ProMdl model;
ProName *layer_names;
ProLayer *layers;
ProLayerDisplay *display_status;
int n_layers;
int ll, junk;
ProError err;
ProStringToWstring(msgfil,"msg_ugmodel.txt");
/* PHILIPPE : The Layer examples have to be changed for rev 20
Until then, I make it unavailable */
return (PRO_TK_NO_ERROR);
#if 0
/*-------------------------------------------------------------------------*\
Get handle for the active model.
\*-------------------------------------------------------------------------*/
err=ProMdlCurrentGet(&model);
ERROR_CHECK("UserScanLayers","ProMdlCurrentGet",err);
/*-------------------------------------------------------------------------*\
Get the list of layers.
\*-------------------------------------------------------------------------*/
err=ProMdlLayerNamesGet(model,&layer_names,&n_layers);
ERROR_CHECK("UserScanLayers","ProMdlLayerNamesGet",err);
display_status=(ProLayerDisplay*)calloc(n_layers,sizeof(ProLayerDisplay));
if ( display_status==NULL ) return(PRO_TK_GENERAL_ERROR);
layers=(ProLayer*)calloc(n_layers,sizeof(ProLayer));
if ( layers==NULL ) return(PRO_TK_GENERAL_ERROR);
/*-------------------------------------------------------------------------*\
Convert names to layer structs and get their current display status.
\*-------------------------------------------------------------------------*/
for (ll = 0; ll < n_layers; ll++)
{
layers[ll].owner=model;
ProUtilWstrcpy(layers[ll].layer_name,layer_names[ll]);
ProLayerDisplaystatusGet( &(layers[ll]), &(display_status[ll]) );
}
/*-------------------------------------------------------------------------*\
For each layer ...
\*-------------------------------------------------------------------------*/
for (ll = 0; ll < n_layers; ll++)
{
/*-------------------------------------------------------------------------*\
Set the layer status to BLANK and repaint.
\*-------------------------------------------------------------------------*/
ProLayerDisplaystatusSet( &(layers[ll]), PRO_LAYER_TYPE_BLANK );
ProWindowRepaint(-1);
/*-------------------------------------------------------------------------*\
Report the layer name and prompt to continue.
\*-------------------------------------------------------------------------*/
ProMessageDisplay(msgfil, "USER Items on layer %0w (<CR> to continue)",
layer_names[ll]);
ProMessageIntegerRead(NULL,&junk);
/*-------------------------------------------------------------------------*\
Set its status to DISPLAY and repaint.
\*-------------------------------------------------------------------------*/
ProLayerDisplaystatusSet( &(layers[ll]), PRO_LAYER_TYPE_DISPLAY );
ProWindowRepaint(-1);
}
/*-------------------------------------------------------------------------*\
Return all the display statuses to the original setting.
\*-------------------------------------------------------------------------*/
for (ll = 0; ll < n_layers; ll++)
ProLayerDisplaystatusSet( &(layers[ll]), display_status[ll] );
ProWindowRepaint (-1);
free(display_status);
free(layers);
return(PRO_TK_NO_ERROR);
#endif
}