diff --git a/xtt/lib/flow/src/flow_api.cpp b/xtt/lib/flow/src/flow_api.cpp index 9f5269c7e75d5e7b7274ed356062bdf097baeca4..99f44e4b3c484db5d049b04cee66873845a12164 100644 --- a/xtt/lib/flow/src/flow_api.cpp +++ b/xtt/lib/flow/src/flow_api.cpp @@ -1,5 +1,5 @@ /* - * 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 Oxelösund 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; +} + diff --git a/xtt/lib/flow/src/flow_api.h b/xtt/lib/flow/src/flow_api.h index a0ca57ecaaedfe514dfad06487386f020bcee3cb..e8e6eafcad7a08a3d1462f0b283c7f1abfeab4bb 100644 --- a/xtt/lib/flow/src/flow_api.h +++ b/xtt/lib/flow/src/flow_api.h @@ -1,5 +1,5 @@ /* - * 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 Oxelösund 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 } diff --git a/xtt/lib/flow/src/flow_nodeclass.cpp b/xtt/lib/flow/src/flow_nodeclass.cpp index d168fbb1ace1ad5b73709f0274c47472f3cd9e68..ad176a2fa392848804dd59e4c3ff248bfb06291c 100644 --- a/xtt/lib/flow/src/flow_nodeclass.cpp +++ b/xtt/lib/flow/src/flow_nodeclass.cpp @@ -1,5 +1,5 @@ /* - * 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 Oxelösund 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; +} diff --git a/xtt/lib/flow/src/flow_nodeclass.h b/xtt/lib/flow/src/flow_nodeclass.h index b99608be4634623777ba32df3e9fa149c403d1d9..d847084ccb6e8979b52e67ebe0b87607c8681b15 100644 --- a/xtt/lib/flow/src/flow_nodeclass.h +++ b/xtt/lib/flow/src/flow_nodeclass.h @@ -1,5 +1,5 @@ /* - * 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 Oxelösund 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);