Commit 809428e4 authored by claes's avatar claes

no_con_obstacle added for CArea objects

parent 7c56bb0d
/*
* Proview $Id: flow.h,v 1.7 2005-09-01 14:56:12 claes Exp $
* Proview $Id: flow.h,v 1.8 2005-10-12 12:56:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -395,6 +395,7 @@ typedef enum {
flow_eSave_NodeClass_nc_name = 300,
flow_eSave_NodeClass_a = 301,
flow_eSave_NodeClass_group = 302,
flow_eSave_NodeClass_no_con_obstacle = 303,
flow_eSave_ConClass_cc_name = 400,
flow_eSave_ConClass_con_type = 401,
flow_eSave_ConClass_corner = 402,
......
/*
* Proview $Id: flow_api.cpp,v 1.3 2005-09-01 14:56:12 claes Exp $
* Proview $Id: flow_api.cpp,v 1.4 2005-10-12 12:56:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -675,3 +675,8 @@ void flow_SetClickSensitivity( flow_tCtx ctx, int value)
{
flow_draw_set_click_sensitivity( ctx, value);
}
void flow_SetNoConObstacle( flow_tNodeClass nc, int no_obstacle)
{
((FlowNodeClass *)nc)->set_no_con_obstacle( no_obstacle);
}
/*
* Proview $Id: flow_api.h,v 1.3 2005-09-01 14:56:12 claes Exp $
* Proview $Id: flow_api.h,v 1.4 2005-10-12 12:56:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -230,6 +230,7 @@ int flow_GetConPointTraceAttr( flow_tObject object, int num, char *trace_attr,
int flow_GetConPoint( flow_tObject object, int num, double *x, double *y,
flow_eDirection *dir);
void flow_SetClickSensitivity( flow_tCtx ctx, int value);
void flow_SetNoConObstacle( flow_tNodeClass nc, int no_obstacle);
#if defined __cplusplus
}
......
/*
* Proview $Id: flow_node.cpp,v 1.4 2005-09-01 14:56:12 claes Exp $
* Proview $Id: flow_node.cpp,v 1.5 2005-10-12 12:56:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -968,7 +968,7 @@ void FlowNode::get_borders()
x_left = y_low = 1e37;
x_right = y_high = -1e37;
get_node_borders();
if ( nc->group == flow_eNodeGroup_Document)
if ( nc->group == flow_eNodeGroup_Document || nc->no_con_obstacle)
{
obst_x_left = obst_y_low = 1e37;
obst_x_right = obst_y_high = -1e37;
......
/*
* Proview $Id: flow_nodeclass.cpp,v 1.4 2005-09-01 14:56:12 claes Exp $
* Proview $Id: flow_nodeclass.cpp,v 1.5 2005-10-12 12:56:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -29,7 +29,7 @@
FlowNodeClass::FlowNodeClass( FlowCtx *flow_ctx, char *name,
flow_eNodeGroup grp)
: ctx(flow_ctx), a(10,10), group(grp)
: ctx(flow_ctx), a(10,10), group(grp), no_con_obstacle(0)
{
strcpy( nc_name, name);
}
......@@ -55,6 +55,7 @@ void FlowNodeClass::save( ofstream& fp, flow_eSaveMode mode)
fp << int(flow_eSave_NodeClass_a) << endl;
a.save( fp, mode);
fp << int(flow_eSave_NodeClass_group) << FSPACE << int(group) << endl;
fp << int(flow_eSave_NodeClass_no_con_obstacle) << FSPACE << no_con_obstacle << endl;
fp << int(flow_eSave_End) << endl;
}
......@@ -76,6 +77,7 @@ void FlowNodeClass::open( ifstream& fp)
break;
case flow_eSave_NodeClass_a: a.open( ctx, fp); break;
case flow_eSave_NodeClass_group: fp >> tmp; group = (flow_eNodeGroup)tmp; break;
case flow_eSave_NodeClass_no_con_obstacle: fp >> no_con_obstacle; break;
case flow_eSave_End: end_found = 1; break;
default:
cout << "FlowNodeClass:open syntax error" << endl;
......@@ -308,18 +310,14 @@ void FlowNodeClass::get_obstacle_borders( double pos_x, double pos_y, double *x_
{
int i;
switch ( group)
{
case flow_eNodeGroup_Document:
for ( i = 0; i < a.a_size; i++)
{
if ( a.a[i]->type() == flow_eObjectType_Rect)
a.a[i]->get_borders(pos_x, pos_y, x_right, x_left, y_high, y_low, node);
}
break;
default:
a.get_borders(pos_x, pos_y, x_right, x_left, y_high, y_low, node);
if ( group == flow_eNodeGroup_Document || no_con_obstacle) {
for ( i = 0; i < a.a_size; i++) {
if ( a.a[i]->type() == flow_eObjectType_Rect)
a.a[i]->get_borders(pos_x, pos_y, x_right, x_left, y_high, y_low, node);
}
}
else
a.get_borders(pos_x, pos_y, x_right, x_left, y_high, y_low, node);
}
void FlowNodeClass::get_object_name( char *name)
......
/*
* Proview $Id: flow_nodeclass.h,v 1.3 2005-09-01 14:56:12 claes Exp $
* Proview $Id: flow_nodeclass.h,v 1.4 2005-10-12 12:56:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -67,10 +67,12 @@ class FlowNodeClass : public FlowArrayElem {
void move_widgets( void *node, int x, int y);
int get_conpoint_trace_attr( int num, char *trace_attr,
flow_eTraceType *type);
void set_no_con_obstacle( int no_obstacle) { no_con_obstacle = no_obstacle;}
FlowCtx *ctx;
FlowArray a;
char nc_name[80];
flow_eNodeGroup group;
int no_con_obstacle;
};
#endif
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