Commit fcd6c1b7 authored by claes's avatar claes

Load of extern nodeclass (e.g. from ge)

parent 3749b49d
/*
* Proview $Id: flow_api.cpp,v 1.12 2007-11-22 08:51:50 claes Exp $
* Proview $Id: flow_api.cpp,v 1.13 2008-01-17 14:18:55 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -713,3 +713,13 @@ int flow_IsVisible( flow_tCtx ctx, flow_tObject object, flow_eVisible type)
{
return ctx->is_visible( (FlowArrayElem *)object, type);
}
int flow_LoadNodeClass( flow_tCtx ctx, char *fname, flow_tNodeClass *nodeclass)
{
*nodeclass = (flow_tNodeClass) new FlowNodeClass( ctx, "tmp", flow_eNodeGroup_Common);
int sts = (*(FlowNodeClass **)nodeclass)->load( fname);
if ( ODD(sts))
ctx->nodeclass_insert( (FlowArrayElem *) *nodeclass);
return sts;
}
/*
* Proview $Id: flow_api.h,v 1.12 2007-11-22 08:51:50 claes Exp $
* Proview $Id: flow_api.h,v 1.13 2008-01-17 14:18:55 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -240,6 +240,7 @@ void flow_SetNoConObstacle( flow_tNodeClass nc, int no_obstacle);
int flow_GetNextObject( flow_tCtx ctx, flow_tNode object, flow_eDirection dir,
flow_tNode *next);
int flow_IsVisible( flow_tCtx ctx, flow_tObject object, flow_eVisible type);
int flow_LoadNodeClass( flow_tCtx ctx, char *fname, flow_tNodeClass *nodeclass);
#if defined __cplusplus
}
......
/*
* Proview $Id: flow_nodeclass.cpp,v 1.6 2005-10-21 16:11:22 claes Exp $
* Proview $Id: flow_nodeclass.cpp,v 1.7 2008-01-17 14:18:55 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -325,4 +325,16 @@ void FlowNodeClass::get_object_name( char *name)
strcpy( name, nc_name);
}
int FlowNodeClass::load( char *filename)
{
ifstream fp;
fp.open( filename);
if ( !fp)
return FLOW__FILEOPEN;
open( fp);
fp.close();
return FLOW__SUCCESS;
}
/*
* Proview $Id: flow_nodeclass.h,v 1.5 2005-10-21 16:11:22 claes Exp $
* Proview $Id: flow_nodeclass.h,v 1.6 2008-01-17 14:18:55 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -46,6 +46,7 @@ class FlowNodeClass : public FlowArrayElem {
void print( FlowPoint *pos, void *node, int highlight);
void save( ofstream& fp, flow_eSaveMode mode);
void open( ifstream& fp);
int load( char *filename);
void draw( FlowPoint *pos, int highlight, int hot, void *node);
void nav_draw( FlowPoint *pos, int highlight, void *node);
void draw_inverse( FlowPoint *pos, int hot, void *node);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment