Changeset 24f03be in tol
- Timestamp:
- Jul 20, 2009, 9:03:57 AM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 64231ec
- Parents:
- cb1355f
- File:
-
- 1 edited
-
tol/btol/set_type/setgra.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/set_type/setgra.cpp
rcb1355f r24f03be 2097 2097 2098 2098 //-------------------------------------------------------------------- 2099 BSyntaxObject* CopyCode(BSyntaxObject* obj) 2100 { 2101 BCode cod; 2102 cod.Replicate(Code(obj)); 2103 return(new BContensCode("",cod,"")); 2104 }; 2105 /* 2106 //-------------------------------------------------------------------- 2107 BSyntaxObject* CopyNameBlock(BSyntaxObject* obj,const BArray<BDat>& p,BInt& pos) 2108 { 2109 BUseerNameBlock* unb = (BUseerNameBlock*)obj 2110 BNameBlock mat = unb->Contens(); 2111 if(p.Size()) 2112 { 2113 for(BInt i=0; i<mat.Rows(); i++) 2114 { 2115 for(BInt j=0; j<mat.Columns(); j++) 2116 { 2117 mat(i,j) = p[pos++]; 2118 } 2119 } 2120 } 2121 return(new BContensMat("",mat,"")); 2122 }; 2123 */ 2124 2125 //-------------------------------------------------------------------- 2099 2126 BSyntaxObject* CopySet(BSyntaxObject* obj,const BArray<BDat>& p,BInt& pos); 2100 2127 … … 2102 2129 void DeepCopy(const BSet& sample,BSet& copy,const BArray<BDat>& p,BInt& pos) 2103 2130 { 2104 BList* lst = NIL; 2105 BList* aux = NIL; 2106 BInt i; 2107 for(i=1; i<=sample.Card(); i++) 2108 { 2109 if(sample[i]) 2110 { 2111 BSyntaxObject* obj = NIL; 2112 BGrammar* gra = sample[i]->Grammar(); 2113 if(gra==GraReal ()) { obj = CopyReal (sample[i],p,pos); } 2114 else if(gra==GraPolyn ()) { obj = CopyPolyn (sample[i],p,pos); } 2115 else if(gra==GraRatio ()) { obj = CopyRatio (sample[i],p,pos); } 2116 else if(gra==GraMatrix ()) { obj = CopyMatrix (sample[i],p,pos); } 2117 else if(gra==GraSet ()) { obj = CopySet (sample[i],p,pos); } 2118 else { obj = sample[i]->CopyContens (); } 2119 LstFastAppend(lst,aux,obj); 2120 } 2121 } 2122 copy.RobStruct(lst,sample.Struct(),sample.SubType()); 2131 BList* lst = NIL; 2132 BList* aux = NIL; 2133 BInt i; 2134 for(i=1; i<=sample.Card(); i++) 2135 { 2136 if(sample[i]) 2137 { 2138 BSyntaxObject* obj = NIL; 2139 BGrammar* gra = sample[i]->Grammar(); 2140 if(gra==GraReal ()) { obj = CopyReal (sample[i],p,pos); } 2141 else if(gra==GraPolyn ()) { obj = CopyPolyn (sample[i],p,pos); } 2142 else if(gra==GraRatio ()) { obj = CopyRatio (sample[i],p,pos); } 2143 else if(gra==GraMatrix ()) { obj = CopyMatrix (sample[i],p,pos); } 2144 else if(gra==GraSet ()) { obj = CopySet (sample[i],p,pos); } 2145 else if(gra==GraCode ()) { obj = CopyCode (sample[i]); } 2146 else { obj = sample[i]->CopyContens (); } 2147 if(obj && !obj->HasName()) 2148 { 2149 obj->PutName(sample[i]->Name()); 2150 } 2151 LstFastAppend(lst,aux,obj); 2152 } 2153 } 2154 copy.RobStruct(lst,sample.Struct(),sample.SubType()); 2155 if(sample.HasIndexByName()) 2156 { 2157 copy.SetIndexByName(); 2158 } 2123 2159 }; 2160 2124 2161 2125 2162 //--------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.
