Changeset 104 for cpp/gdk/modelparts.cpp


Ignore:
Timestamp:
07/23/13 18:15:30 (11 years ago)
Author:
sz
Message:

introducing object de/serialization - see serialtest.cpp
the core GDK classes can be now used in multiple threads (ifdef MULTITHREADED)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/gdk/modelparts.cpp

    r81 r104  
    9797                       int _prefinputs,int _prefoutput,int _preflocation,
    9898                       int *_vectordata,bool own_vd,int vhints)
    99         :longname(_props->id),
    100          name(_props->name),
    101          description(_description),
     99        :ownedvectordata(own_vd),
     100         name(_props->name),longname(_props->id),description(_description),
    102101         props(_props),
    103102         prefinputs(_prefinputs),
    104103         prefoutput(_prefoutput),
    105104         preflocation(_preflocation),
    106          vectordata(_vectordata),ownedvectordata(own_vd),
    107          visualhints(vhints),impl(0),active(1),genactive(0)
     105         vectordata(_vectordata),
     106         visualhints(vhints),impl_count(0),/*impl(0),*/active(1),genactive(0)
    108107{}
    109108
     
    114113
    115114NeuroClass::NeuroClass()
    116         :name("Invalid"),props(empty_paramtab),
     115        :ownedvectordata(0),
     116         name("Invalid"),
     117         props(empty_paramtab),
    117118         prefinputs(0), prefoutput(0),
    118          preflocation(0), vectordata(0), ownedvectordata(0),
    119          impl(0), active(1), genactive(0)
     119         preflocation(0), vectordata(0),
     120         visualhints(0),impl_count(0), /*impl(0),*/ active(1), genactive(0)
    120121{}
    121122
     
    176177
    177178Neuro::Neuro(double _state,double _inertia,double _force,double _sigmo)
    178         :state(_state),PartBase(getDefaultStyle())
     179        :PartBase(getDefaultStyle()),state(_state)
    179180#ifdef MODEL_V1_COMPATIBLE
    180181,inertia(_inertia),force(_force),sigmo(_sigmo)
     
    187188myclass=0;
    188189knownclass=1;
     190part_refno=-1; joint_refno=-1;
    189191}
    190192
     
    204206#endif
    205207flags=0;
     208part_refno=-1; joint_refno=-1;
    206209}
    207210
     
    614617///////////////////////////////////////
    615618
    616 const SString& Part::getDefaultStyle()
    617 {static SString s("part"); return s;}
    618 const SString& Joint::getDefaultStyle()
    619 {static SString s("joint"); return s;}
     619SString Part::getDefaultStyle()
     620{return SString("part");}
     621SString Joint::getDefaultStyle()
     622{return SString("joint");}
    620623/*
    621624const SString& Neuro::getDefaultStyle()
     
    624627{static SString s("neuroitem"); return s;}
    625628*/
    626 const SString& Neuro::getDefaultStyle()
    627 {static SString s("neuro"); return s;}
     629SString Neuro::getDefaultStyle()
     630{return SString("neuro");}
    628631
    629632Part::Part():PartBase(getDefaultStyle())
     
    776779};
    777780
    778 static Param staticparam;
    779 
    780 ParamInterface &Part::extraProperties()
    781 {
    782 staticparam.setParamTab(f0_part_xtra_paramtab);
    783 staticparam.select(this);
    784 return staticparam;
    785 }
    786 
    787 ParamInterface &Joint::extraProperties()
    788 {
    789 staticparam.setParamTab(f0_joint_xtra_paramtab);
    790 staticparam.select(this);
    791 return staticparam;
    792 }
    793 
    794 ParamInterface &Neuro::extraProperties()
    795 {
    796 staticparam.setParamTab(f0_neuro_xtra_paramtab);
    797 staticparam.select(this);
    798 return staticparam;
    799 }
    800 
    801 ParamInterface &Part::properties()
    802 {
    803 staticparam.setParamTab(f0_part_paramtab);
    804 staticparam.select(this);
    805 return staticparam;
    806 }
    807 
    808 ParamInterface &Joint::properties()
    809 {
    810 staticparam.setParamTab(usedelta?f0_joint_paramtab:f0_nodeltajoint_paramtab);
    811 staticparam.select(this);
    812 return staticparam;
    813 }
    814 
    815 ParamInterface &Neuro::properties()
    816 {
    817 staticparam.setParamTab(f0_neuro_paramtab);
    818 staticparam.select(this);
    819 return staticparam;
     781Param Part::extraProperties()
     782{
     783return Param(f0_part_xtra_paramtab,this);
     784}
     785
     786Param Joint::extraProperties()
     787{
     788return Param(f0_joint_xtra_paramtab,this);
     789}
     790
     791Param Neuro::extraProperties()
     792{
     793return Param(f0_neuro_xtra_paramtab,this);
     794}
     795
     796Param Part::properties()
     797{
     798return Param(f0_part_paramtab,this);
     799}
     800
     801Param Joint::properties()
     802{
     803return Param(usedelta?f0_joint_paramtab:f0_nodeltajoint_paramtab,this);
     804}
     805
     806Param Neuro::properties()
     807{
     808return Param(f0_neuro_paramtab,this);
    820809}
    821810
Note: See TracChangeset for help on using the changeset viewer.