[Ktechlab-devel] ItemDocumentData vs Node

P Zoltan zoltan.padrah at gmail.com
Wed Jul 16 13:52:39 UTC 2008


   Hi,

  I'm working on the restructuring the node hierarchy, and after changing  
the Node class, I found the following problem:
in the file itemdocumentdata.cpp, lines 1066 and 1067, the method  
ItemDocumentData::mergeWithDocument tries to create a new connector, with  
some start and end node. The problem is that the Node class doesn't have  
such interface, because it's not known if the node is an electronic or a  
flow node. (addInputConnector and addOutputConnector)
  The "healty" solution would be to inherit two classes from  
ItemDocumentData: one for electronic stuff, and one for flowparts. The  
problem is that this implies a lot of work to do.
  The other, more hacky thing that can be done is to create the needed  
interface as virtual methods in class Node, and for electronic node just  
call the proper interface (so calling addInputConnector ==  
addOutputConnector == addConnector, for an ECNode ). This is more easier,  
but all these functions should be removed when the ItemDocumentClass is  
cleaned up.
  What is your opinion?

  Zoltan




More information about the Ktechlab-devel mailing list