1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120 |
- using TEAMModelOS.Service.Model.PowerPoint;
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Xml;
- namespace TEAMModelOS.Service.Services.PowerPoint.Implement
- {
- public class ShapeSvg
- {
- /// <summary>
- /// 预设完整的
- /// https://docs.microsoft.com/zh-cn/dotnet/api/documentformat.openxml.drawing.shapetypevalues?view=openxml-2.8.1
- /// 具体算法https://meshesha.js.org/presetShapeDefinitions/
- /// </summary>
- //TODO 图形中还存在 连接符 曲线 画成直线
- private const double px9d6 = 96.00, px72 = 72.00, px91d4400 = 914400.00, px12700 = 12700.00;
- private const int degree = 4;
- delegate Svg GenShapeDelegate(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border);
- public static Svg GenShapeSvg(XmlNode node, int order, XmlNode shapeType, int isFlipV, Position position, bool grndFillFlg, bool imgFillFlg, Fill Fill, Border shapeBorder, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- string shapType = shapeType.Value;
- double w = position.cx;
- double h = position.cy;
- GenShapeDelegate genShapeDelegate;
- Svg resultSvg = null;
- Border border = new Border
- {
- type = shapeBorder.type,
- width = shapeBorder.width,
- stroke = shapeBorder.stroke,
- color = shapeBorder.color,
- };
- if (string.IsNullOrEmpty(shapeBorder.color))
- {
- border.color = "FFFFFF";
- }
- string fillColor;
- if (Fill != null && Fill.color != null && Fill.color.Equals("none"))
- {
- fillColor = Fill.color;
- }
- else if (Fill != null && Fill.color != null && !Fill.color.Equals("none"))
- {
- fillColor = "#" + Fill.color;
- }
- else { fillColor = "none"; }
- switch (shapType)
- {
- case "rect":
- genShapeDelegate = Rect;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartProcess":
- genShapeDelegate = FlowChartProcess;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartPredefinedProcess":
- genShapeDelegate = FlowChartInternalStorage;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartInternalStorage":
- genShapeDelegate = FlowChartInternalStorage;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonBlank":
- genShapeDelegate = ActionButtonBlank;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartCollate":
- genShapeDelegate = FlowChartCollate;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartDocument":
- genShapeDelegate = FlowChartDocument;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartMultidocument":
- genShapeDelegate = FlowChartMultidocument;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonBackPrevious":
- genShapeDelegate = ActionButtonBackPrevious;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonBeginning":
- genShapeDelegate = ActionButtonBeginning;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonDocument":
- genShapeDelegate = ActionButtonDocument;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonEnd":
- genShapeDelegate = ActionButtonEnd;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonForwardNext":
- genShapeDelegate = ActionButtonForwardNext;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonHelp":
- genShapeDelegate = ActionButtonHelp;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonHome":
- genShapeDelegate = ActionButtonHome;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonInformation":
- genShapeDelegate = ActionButtonInformation;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonMovie":
- genShapeDelegate = ActionButtonMovie;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonReturn":
- genShapeDelegate = ActionButtonReturn;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "actionButtonSound":
- genShapeDelegate = ActionButtonSound;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "irregularSeal1":
- genShapeDelegate = IrregularSeal1;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "irregularSeal2":
- genShapeDelegate = IrregularSeal2;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartTerminator":
- genShapeDelegate = FlowChartTerminator;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartPunchedTape":
- genShapeDelegate = FlowChartPunchedTape;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartOnlineStorage":
- genShapeDelegate = FlowChartOnlineStorage;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartDisplay":
- genShapeDelegate = FlowChartDisplay;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartDelay":
- genShapeDelegate = FlowChartDelay;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartMagneticTape":
- genShapeDelegate = FlowChartMagneticTape;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "ellipse":
- genShapeDelegate = Ellipse;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartConnector":
- genShapeDelegate = FlowChartConnector;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartSummingJunction":
- genShapeDelegate = FlowChartSummingJunction;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartOr":
- genShapeDelegate = FlowChartOr;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "roundRect":
- genShapeDelegate = RoundRect;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "round1Rect":
- genShapeDelegate = Round1Rect;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "round2DiagRect":
- genShapeDelegate = Round2DiagRect;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "round2SameRect":
- genShapeDelegate = Round2SameRect;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "snip1Rect":
- genShapeDelegate = Snip1Rect;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "snip2DiagRect":
- genShapeDelegate = Snip2DiagRect;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "snip2SameRect":
- genShapeDelegate = Snip2SameRect;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartAlternateProcess":
- genShapeDelegate = FlowChartAlternateProcess;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartPunchedCard":
- genShapeDelegate = FlowChartPunchedCard;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "snipRoundRect":
- genShapeDelegate = SnipRoundRect;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "bentConnector2":
- resultSvg = BentConnector2(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, order, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- break;
- case "rtTriangle":
- genShapeDelegate = RtTriangle;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "triangle":
- genShapeDelegate = Triangle;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartExtract":
- genShapeDelegate = FlowChartExtract;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartMerge":
- genShapeDelegate = FlowChartMerge;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "diamond":
- genShapeDelegate = Diamond;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartDecision":
- genShapeDelegate = FlowChartDecision;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartSort":
- genShapeDelegate = FlowChartSort;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "trapezoid":
- genShapeDelegate = Trapezoid;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartManualOperation":
- genShapeDelegate = FlowChartManualOperation;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartManualInput":
- genShapeDelegate = FlowChartManualInput;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "parallelogram":
- genShapeDelegate = Parallelogram;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartInputOutput":
- genShapeDelegate = FlowChartInputOutput;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "pentagon":
- genShapeDelegate = Pentagon;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "hexagon":
- genShapeDelegate = Hexagon;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartPreparation":
- genShapeDelegate = FlowChartPreparation;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "heptagon":
- genShapeDelegate = Heptagon;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "octagon":
- genShapeDelegate = Octagon;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "decagon":
- genShapeDelegate = Decagon;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "dodecagon":
- genShapeDelegate = Dodecagon;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "star4":
- genShapeDelegate = Star4;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "star5":
- genShapeDelegate = Star5;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "star6":
- genShapeDelegate = Star6;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "star7":
- genShapeDelegate = Star7;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "star8":
- genShapeDelegate = Star8;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "star10":
- genShapeDelegate = Star10;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "star12":
- genShapeDelegate = Star12;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "star16":
- genShapeDelegate = Star16;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "star24":
- genShapeDelegate = Star24;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "star32":
- genShapeDelegate = Star32;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "pie":
- genShapeDelegate = Pie;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "pieWedge":
- genShapeDelegate = PieWedge;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "arc":
- genShapeDelegate = Arc;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "chord":
- genShapeDelegate = Chord;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "frame":
- genShapeDelegate = Frame;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "donut":
- genShapeDelegate = Donut;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "noSmoking":
- genShapeDelegate = NoSmoking;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "halfFrame":
- genShapeDelegate = HalfFrame;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "blockArc":
- genShapeDelegate = BlockArc;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "bracePair":
- genShapeDelegate = BracePair;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftBrace":
- genShapeDelegate = LeftBrace;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "rightBrace":
- genShapeDelegate = RightBrace;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "bracketPair":
- genShapeDelegate = BracketPair;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftBracket":
- genShapeDelegate = LeftBracket;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "rightBracket":
- genShapeDelegate = RightBracket;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "moon":
- genShapeDelegate = Moon;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "corner":
- genShapeDelegate = Corner;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "diagStripe":
- genShapeDelegate = DiagStripe;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "gear6":
- genShapeDelegate = Gear6;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "gear9":
- genShapeDelegate = Gear9;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "bentConnector3":
- resultSvg = BentConnector3(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, order, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- break;
- case "plus":
- genShapeDelegate = Plus;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "teardrop":
- genShapeDelegate = Teardrop;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "plaque":
- genShapeDelegate = Plaque;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "sun":
- genShapeDelegate = Sun;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "heart":
- genShapeDelegate = Heart;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "lightningBolt":
- genShapeDelegate = LightningBolt;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "cube":
- genShapeDelegate = Cube;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "bevel":
- genShapeDelegate = Bevel;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "foldedCorner":
- genShapeDelegate = FoldedCorner;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "cloud":
- genShapeDelegate = Cloud;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "cloudCallout":
- genShapeDelegate = CloudCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "smileyFace":
- genShapeDelegate = SmileyFace;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "verticalScroll":
- genShapeDelegate = VerticalScroll;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "horizontalScroll":
- genShapeDelegate = HorizontalScroll;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "wedgeEllipseCallout":
- genShapeDelegate = WedgeEllipseCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "wedgeRectCallout":
- genShapeDelegate = WedgeRectCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "wedgeRoundRectCallout":
- genShapeDelegate = WedgeRoundRectCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "accentBorderCallout1":
- genShapeDelegate = AccentBorderCallout1;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "accentBorderCallout2":
- genShapeDelegate = AccentBorderCallout2;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "accentBorderCallout3":
- genShapeDelegate = AccentBorderCallout3;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "borderCallout1":
- genShapeDelegate = BorderCallout1;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "borderCallout2":
- genShapeDelegate = BorderCallout2;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "borderCallout3":
- genShapeDelegate = BorderCallout3;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "accentCallout1":
- genShapeDelegate = AccentCallout1;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "accentCallout2":
- genShapeDelegate = AccentCallout2;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "accentCallout3":
- genShapeDelegate = AccentCallout3;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "callout1":
- genShapeDelegate = Callout1;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "callout2":
- genShapeDelegate = Callout2;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "callout3":
- genShapeDelegate = Callout3;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftRightRibbon":
- genShapeDelegate = LeftRightRibbon;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "ribbon":
- genShapeDelegate = Ribbon;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "ribbon2":
- genShapeDelegate = Ribbon2;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "doubleWave":
- genShapeDelegate = DoubleWave;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "wave":
- genShapeDelegate = Wave;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "ellipseRibbon":
- genShapeDelegate = EllipseRibbon;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "ellipseRibbon2":
- genShapeDelegate = EllipseRibbon2;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "line":
- resultSvg = Line(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, order, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- break;
- case "straightConnector1":
- resultSvg = StraightConnector1(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, order, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- break;
- case "bentConnector4":
- resultSvg = BentConnector4(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, order, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- break;
- case "bentConnector5":
- resultSvg = BentConnector5(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, order, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- break;
- case "curvedConnector2":
- resultSvg = CurvedConnector2(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, order, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- break;
- case "curvedConnector3":
- resultSvg = CurvedConnector3(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, order, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- break;
- case "curvedConnector4":
- resultSvg = CurvedConnector4(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, order, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- break;
- case "curvedConnector5":
- resultSvg = CurvedConnector5(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, order, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- break;
- case "rightArrow":
- genShapeDelegate = RightArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftArrow":
- genShapeDelegate = LeftArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "downArrow":
- genShapeDelegate = DownArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartOffpageConnector":
- genShapeDelegate = FlowChartOffpageConnector;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "upArrow":
- genShapeDelegate = UpArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftRightArrow":
- genShapeDelegate = LeftRightArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "upDownArrow":
- genShapeDelegate = UpDownArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "quadArrow":
- genShapeDelegate = QuadArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftRightUpArrow":
- genShapeDelegate = LeftRightUpArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftUpArrow":
- genShapeDelegate = LeftUpArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "bentUpArrow":
- genShapeDelegate = BentUpArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "bentArrow":
- genShapeDelegate = BentArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "uturnArrow":
- genShapeDelegate = UturnArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "stripedRightArrow":
- genShapeDelegate = StripedRightArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "notchedRightArrow":
- genShapeDelegate = NotchedRightArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "homePlate":
- genShapeDelegate = HomePlate;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "chevron":
- genShapeDelegate = Chevron;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "rightArrowCallout":
- genShapeDelegate = RightArrowCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "downArrowCallout":
- genShapeDelegate = DownArrowCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftArrowCallout":
- genShapeDelegate = LeftArrowCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "upArrowCallout":
- genShapeDelegate = UpArrowCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftRightArrowCallout":
- genShapeDelegate = LeftRightArrowCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "quadArrowCallout":
- genShapeDelegate = QuadArrowCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "curvedDownArrow":
- genShapeDelegate = CurvedDownArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "curvedLeftArrow":
- genShapeDelegate = CurvedLeftArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "curvedRightArrow":
- genShapeDelegate = CurvedRightArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "curvedUpArrow":
- genShapeDelegate = CurvedUpArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "mathDivide":
- genShapeDelegate = MathDivide;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "mathEqual":
- genShapeDelegate = MathEqual;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "mathMinus":
- genShapeDelegate = MathMinus;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "mathMultiply":
- genShapeDelegate = MathMultiply;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "mathNotEqual":
- genShapeDelegate = MathNotEqual;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "mathPlus":
- genShapeDelegate = MathPlus;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "can":
- genShapeDelegate = Can;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartMagneticDisk":
- genShapeDelegate = FlowChartMagneticDisk;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartMagneticDrum":
- genShapeDelegate = FlowChartMagneticDrum;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "swooshArrow":
- genShapeDelegate = SwooshArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "circularArrow":
- genShapeDelegate = CircularArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftCircularArrow":
- genShapeDelegate = LeftCircularArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "leftRightCircularArrow":
- genShapeDelegate = LeftRightCircularArrow;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "chartPlus":
- genShapeDelegate = ChartPlus;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "chartStar":
- genShapeDelegate = ChartStar;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "chartX":
- genShapeDelegate = ChartX;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "cornerTabs":
- genShapeDelegate = CornerTabs;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "flowChartOfflineStorage":
- genShapeDelegate = FlowChartOfflineStorage;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "folderCorner":
- genShapeDelegate = FolderCorner;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "funnel":
- genShapeDelegate = Funnel;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "lineInv":
- genShapeDelegate = LineInv;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "nonIsoscelesTrapezoid":
- genShapeDelegate = NonIsoscelesTrapezoid;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "plaqueTabs":
- genShapeDelegate = PlaqueTabs;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "squareTabs":
- genShapeDelegate = SquareTabs;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- case "upDownArrowCallout":
- genShapeDelegate = UpDownArrowCallout;
- resultSvg = genShapeDelegate(node, shapType, w, h, imgFillFlg, grndFillFlg, order, fillColor, border);
- break;
- default:
- break;
- }
- return resultSvg;
- }
- /// <summary>
- /// 矩形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Rect(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- List<SvgShape> shapes = new List<SvgShape>();
- //string result = "";
- //result += "<rect x='0' y='0' width='" + w + "' height='" + h + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- shapes.Add(new Rect
- {
- type = "rect",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- x = "0",
- y = "0",
- width = System.Math.Round(w, degree) + "",
- height = System.Math.Round(h, degree) + "",
- });
- if (shapType == "flowChartPredefinedProcess")
- {
- shapes.Add(new Rect
- {
- type = "rect",
- //Fill = "none",
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- x = System.Math.Round((w * (1 / 8.00)), degree) + "",
- y = "0",
- width = System.Math.Round((w * (6 / 8.00)), degree) + "",
- height = h + "",
- });
- // result += "<rect x='" + w * (1 / 8.00) + "' y='0' width='" + w * (6 / 8.00) + "' height='" + h + "' fill='none' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- }
- else if (shapType == "flowChartInternalStorage")
- {
- shapes.Add(new Polyline
- {
- type = "polyline",
- //Fill = "none",
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points = System.Math.Round(w * (1 / 8.00), degree) + " 0," + System.Math.Round(w * (1 / 8.00), degree) + " " + System.Math.Round(h, degree),
- });
- shapes.Add(new Polyline
- {
- type = "polyline",
- //Fill = "none",
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points = "0 " + System.Math.Round(h * (1 / 8.00), degree) + "," + System.Math.Round(w, degree) + " " + System.Math.Round(h * (1 / 8.00), degree),
- });
- // result += " <polyline points='" + w * (1 / 8.00) + " 0," + w * (1 / 8.00) + " " + h + "' fill='none' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- // result += " <polyline points='0 " + h * (1 / 8.00) + "," + w + " " + h * (1 / 8.00) + "' fill='none' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- }
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:过程
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartProcess(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Rect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg FowChartPredefinedProcess(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Rect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 流程图:内部贮存
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartInternalStorage(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Rect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 动作按钮:空白
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonBlank(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Rect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg FlowChartCollate(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- w = System.Math.Round(w, degree);
- h = System.Math.Round(h, degree);
- // string result = "";
- string d = "M 0,0" +
- " L" + w + "," + 0 +
- " L" + 0 + "," + h +
- " L" + w + "," + h +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:文档
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartDocument(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- object y1, y2, y3, x1;
- x1 = System.Math.Round(w * 10800 / 21600.00, degree);
- y1 = System.Math.Round(h * 17322 / 21600.00, degree);
- y2 = System.Math.Round(h * 20172 / 21600.00, degree);
- y3 = System.Math.Round(h * 23922 / 21600.00, degree);
- w = System.Math.Round(w, degree);
- h = System.Math.Round(h, degree);
- string d = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + y1 +
- " C" + x1 + "," + y1 + " " + x1 + "," + y3 + " " + 0 + "," + y2 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:多文档
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartMultidocument(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- object y1, y2, y3, y4, y5, y6, y7, y8, y9, x1, x2, x3, x4, x5, x6, x7;
- y1 = System.Math.Round(h * 18022 / 21600.00, degree);
- y2 = System.Math.Round(h * 3675 / 21600.00, degree);
- y3 = System.Math.Round(h * 23542 / 21600.00, degree);
- y4 = System.Math.Round(h * 1815 / 21600.00, degree);
- y5 = System.Math.Round(h * 16252 / 21600.00, degree);
- y6 = System.Math.Round(h * 16352 / 21600.00, degree);
- y7 = System.Math.Round(h * 14392 / 21600.00, degree);
- y8 = System.Math.Round(h * 20782 / 21600.00, degree);
- y9 = System.Math.Round(h * 14467 / 21600.00, degree);
- x1 = System.Math.Round(w * 1532 / 21600.00, degree);
- x2 = System.Math.Round(w * 20000 / 21600.00, degree);
- x3 = System.Math.Round(w * 9298 / 21600.00, degree);
- x4 = System.Math.Round(w * 19298 / 21600.00, degree);
- x5 = System.Math.Round(w * 18595 / 21600.00, degree);
- x6 = System.Math.Round(w * 2972 / 21600.00, degree);
- x7 = System.Math.Round(w * 20800 / 21600.00, degree);
- w = System.Math.Round(w, degree);
- h = System.Math.Round(h, degree);
- string d = "M" + 0 + "," + y2 +
- " L" + x5 + "," + y2 +
- " L" + x5 + "," + y1 +
- " C" + x3 + "," + y1 + " " + x3 + "," + y3 + " " + 0 + "," + y8 +
- " z" +
- "M" + x1 + "," + y2 +
- " L" + x1 + "," + y4 +
- " L" + x2 + "," + y4 +
- " L" + x2 + "," + y5 +
- " C" + x4 + "," + y5 + " " + x5 + "," + y6 + " " + x5 + "," + y6 +
- "M" + x6 + "," + y4 +
- " L" + x6 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + y7 +
- " C" + x7 + "," + y7 + " " + x2 + "," + y9 + " " + x2 + "," + y9;
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static string ShapeStar(double adj, double starNum)
- {
- var innerRadius = adj; /*1-100*/
- var outerRadius = 100;//star.outerRadius;
- var numPoints = starNum;/*1-100*/
- var center = System.Math.Max(innerRadius, outerRadius);
- var angle = System.Math.PI / numPoints;
- var points = "";
- for (var i = 0; i < numPoints * 2; i++)
- {
- var radius = ((i % 2) > 0) ? innerRadius : outerRadius;
- points += System.Math.Round(center + radius * System.Math.Sin(i * angle), degree) + ",";
- points += System.Math.Round(center - radius * System.Math.Cos(i * angle), degree) + ",";
- // points.push(center + radius * System.Math.Sin(i * angle));
- // points.push(center - radius * System.Math.Cos(i * angle));
- }
- points = points.Substring(0, points.Length - 1);
- return points;
- }
- private static List<string> ShapePie(double H, double w, double adj1, double adj2, bool isClose)
- {
- List<string> list = new List<string>();
- double pieVal = adj2;
- double piAngle = adj1;
- double size = H;
- double radius = (size / 2);
- double value = pieVal - piAngle;
- if (value < 0)
- {
- value = 360 + value;
- }
- //console.log("value: ",value)
- value = System.Math.Min(System.Math.Max(value, 0), 360);
- //calculate x,y coordinates of the point on the circle to draw the arc to.
- var x = System.Math.Round(System.Math.Cos((2 * System.Math.PI) / (360.00 / value)), degree);
- var y = System.Math.Round(System.Math.Sin((2 * System.Math.PI) / (360.00 / value)), degree);
- //d is a string that describes the path of the slice.
- int longArc;
- string d, rot;
- radius = System.Math.Round(radius, degree);
- if (isClose)
- {
- longArc = (value <= 180) ? 0 : 1;
- d = "M" + radius + "," + radius + " L" + radius + "," + 0 + " A" + radius + "," + radius + " 0 " + longArc + ",1 " + (radius + y * radius) + "," + (radius - x * radius) + " z";
- rot = "rotate(" + (piAngle - 270) + ", " + radius + ", " + radius + ")";
- }
- else
- {
- longArc = (value <= 180) ? 0 : 1;
- var radius1 = radius;
- var radius2 = System.Math.Round(w / 2, degree);
- d = "M" + radius1 + "," + 0 + " A" + radius2 + "," + radius1 + " 0 " + longArc + ",1 " + (radius2 + y * radius2) + "," + (radius1 - x * radius1);
- rot = "rotate(" + (piAngle + 90) + ", " + radius + ", " + radius + ")";
- }
- list.Add(d);
- list.Add(rot);
- return list;
- }
- private static string ShapeGear(double w, double h, double points)
- {
- double innerRadius = h;//gear.innerRadius;
- double outerRadius = 1.5 * innerRadius;
- double cx = outerRadius;//Math.max(innerRadius, outerRadius), // center x
- double cy = outerRadius;//Math.max(innerRadius, outerRadius), // center y
- double notches = points;//gear.points, // num. of notches
- double radiusO = outerRadius; // outer radius
- double radiusI = innerRadius; // inner radius
- double taperO = 50.00; // outer taper %
- double taperI = 35.00; // inner taper %
- // pre-calculate values for loop
- double pi2 = 2 * System.Math.PI; // cache 2xPI (360deg)
- double angle = pi2 / (notches * 2); // angle between notches
- double taperAI = angle * taperI * 0.005; // inner taper offset (100% = half notch)
- double taperAO = angle * taperO * 0.005; // outer taper offset
- double a = angle; // iterator (angle)
- bool toggle = false;
- // move to starting point
- var d = " M" + System.Math.Round((cx + radiusO * System.Math.Cos(taperAO)), degree) + " " + System.Math.Round((cy + radiusO * System.Math.Sin(taperAO)), degree);
- // loop
- for (; a <= pi2 + angle; a += angle)
- {
- // draw inner to outer line
- if (toggle)
- {
- d += " L" + System.Math.Round((cx + radiusI * System.Math.Cos(a - taperAI)), degree) + "," + System.Math.Round((cy + radiusI * System.Math.Sin(a - taperAI)), degree);
- d += " L" + (cx + radiusO * System.Math.Cos(a + taperAO)) + "," + (cy + radiusO * System.Math.Sin(a + taperAO));
- }
- else
- { // draw outer to inner line
- d += " L" + System.Math.Round((cx + radiusO * System.Math.Cos(a - taperAO)), degree) + "," + System.Math.Round((cy + radiusO * System.Math.Sin(a - taperAO)), degree); // outer line
- d += " L" + System.Math.Round((cx + radiusI * System.Math.Cos(a + taperAI)), degree) + "," + System.Math.Round((cy + radiusI * System.Math.Sin(a + taperAI)), degree);// inner line
- }
- // switch level
- toggle = !toggle;
- }
- // close the final line
- d += " ";
- return d;
- }
- private static string ShapeSnipRoundRect(double w, double h, double adj1, double adj2, string shapeType, string adjType)
- {
- /*
- shapeType: snip,round
- adjType: cornr1,cornr2,cornrAll,diag
- */
- double adjA = 0.0, adjB = 0.0, adjC = 0.0, adjD = 0.0;
- if (adjType == "cornr1")
- {
- adjA = 0;
- adjB = 0;
- adjC = 0;
- adjD = adj1;
- }
- else if (adjType == "cornr2")
- {
- adjA = adj1;
- adjB = adj2;
- adjC = adj2;
- adjD = adj1;
- }
- else if (adjType == "cornrAll")
- {
- adjA = adj1;
- adjB = adj1;
- adjC = adj1;
- adjD = adj1;
- }
- else if (adjType == "diag")
- {
- adjA = adj1;
- adjB = adj2;
- adjC = adj1;
- adjD = adj2;
- }
- //d is a string that describes the path of the slice.
- var d = "";
- if (shapeType == "round")
- {
- d = "M0" + "," + (h / 2 + (1 - adjB) * (h / 2)) + " Q" + 0 + "," + h + " " + adjB * (w / 2) + "," + h + " L" + (w / 2 + (1 - adjC) * (w / 2)) + "," + h +
- " Q" + w + "," + h + " " + w + "," + (h / 2 + (h / 2) * (1 - adjC)) + "L" + w + "," + (h / 2) * adjD +
- " Q" + w + "," + 0 + " " + (w / 2 + (w / 2) * (1 - adjD)) + ",0 L" + (w / 2) * adjA + ",0" +
- " Q" + 0 + "," + 0 + " 0," + (h / 2) * (adjA) + " z";
- }
- else if (shapeType == "snip")
- {
- d = "M0" + "," + adjA * (h / 2) + " L0" + "," + (h / 2 + (h / 2) * (1 - adjB)) + "L" + adjB * (w / 2) + "," + h +
- " L" + (w / 2 + (w / 2) * (1 - adjC)) + "," + h + "L" + w + "," + (h / 2 + (h / 2) * (1 - adjC)) +
- " L" + w + "," + adjD * (h / 2) + "L" + (w / 2 + (w / 2) * (1 - adjD)) + ",0 L" + ((w / 2) * adjA) + ",0 z";
- }
- return d;
- }
- public static string ShapeArc(double cX, double cY, double rX, double rY, double stAng, double endAng, bool isClose)
- {
- string dData = "";
- var angle = stAng;
- if (endAng >= stAng)
- {
- while (angle <= endAng)
- {
- var radians = angle * (System.Math.PI / 180); // convert degree to radians
- var x = cX + System.Math.Cos(radians) * rX;
- var y = cY + System.Math.Sin(radians) * rY;
- if (angle == stAng)
- {
- dData = " M" + System.Math.Round(x, degree) + " " + System.Math.Round(y, degree);
- }
- dData += " L" + System.Math.Round(x, degree) + " " + System.Math.Round(y, degree);
- angle++;
- }
- }
- else
- {
- while (angle > endAng)
- {
- var radians = angle * (System.Math.PI / 180); // convert degree to radians
- var x = cX + System.Math.Cos(radians) * rX;
- var y = cY + System.Math.Sin(radians) * rY;
- if (angle == stAng)
- {
- dData = " M " + System.Math.Round(x, degree) + " " + System.Math.Round(y, degree);
- }
- dData += " L " + System.Math.Round(x, degree) + " " + System.Math.Round(y, degree);
- angle--;
- }
- }
- dData += (isClose ? " z" : "");
- return dData;
- }
- /// <summary>
- /// 动作按钮:后退或前一项
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonBackPrevious(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g10, g11, g12;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g10 = vc + dx2;
- g11 = hc - dx2;
- g12 = hc + dx2;
- string d = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- "M" + g11 + "," + vc +
- " L" + g12 + "," + g9 +
- " L" + g12 + "," + g10 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 动作按钮:转到开头
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonBeginning(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- //string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g10, g11, g12, g13, g14, g15, g16, g17;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g10 = vc + dx2;
- g11 = hc - dx2;
- g12 = hc + dx2;
- g13 = ss * 3 / 4;
- g14 = g13 / 8;
- g15 = g13 / 4;
- g16 = g11 + g14;
- g17 = g11 + g15;
- string d = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- "M" + g17 + "," + vc +
- " L" + g12 + "," + g9 +
- " L" + g12 + "," + g10 +
- " z" +
- "M" + g16 + "," + g9 +
- " L" + g11 + "," + g9 +
- " L" + g11 + "," + g10 +
- " L" + g16 + "," + g10 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 动作按钮:文档
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonDocument(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- //string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g10, dx1, g11, g12, g13, g14, g15;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g10 = vc + dx2;
- dx1 = ss * 9 / 32;
- g11 = hc - dx1;
- g12 = hc + dx1;
- g13 = ss * 3 / 16;
- g14 = g12 - g13;
- g15 = g9 + g13;
- string d = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- "M" + g11 + "," + g9 +
- " L" + g14 + "," + g9 +
- " L" + g12 + "," + g15 +
- " L" + g12 + "," + g10 +
- " L" + g11 + "," + g10 +
- " z" +
- "M" + g14 + "," + g9 +
- " L" + g14 + "," + g15 +
- " L" + g12 + "," + g15 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 动作按钮:转到结尾
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonEnd(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g10, g11, g12, g13, g14, g15, g16, g17;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g10 = vc + dx2;
- g11 = hc - dx2;
- g12 = hc + dx2;
- g13 = ss * 3 / 4;
- g14 = g13 * 3 / 4;
- g15 = g13 * 7 / 8;
- g16 = g11 + g14;
- g17 = g11 + g15;
- string d = "M" + 0 + "," + h +
- " L" + w + "," + h +
- " L" + w + "," + 0 +
- " L" + 0 + "," + 0 +
- " z" +
- " M" + g17 + "," + g9 +
- " L" + g12 + "," + g9 +
- " L" + g12 + "," + g10 +
- " L" + g17 + "," + g10 +
- " z" +
- " M" + g16 + "," + vc +
- " L" + g11 + "," + g9 +
- " L" + g11 + "," + g10 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 动作按钮:前进或下一项
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonForwardNext(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g10, g11, g12;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g10 = vc + dx2;
- g11 = hc - dx2;
- g12 = hc + dx2;
- string d = "M" + 0 + "," + h +
- " L" + w + "," + h +
- " L" + w + "," + 0 +
- " L" + 0 + "," + 0 +
- " z" +
- " M" + g12 + "," + vc +
- " L" + g11 + "," + g9 +
- " L" + g11 + "," + g10 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 动作按钮:帮助
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonHelp(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g11, g13, g14, g15, g16, g19, g20, g21, g23, g24, g27, g29, g30, g31, g33, g36, g37, g41, g42;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g11 = hc - dx2;
- g13 = ss * 3 / 4;
- g14 = g13 / 7;
- g15 = g13 * 3 / 14;
- g16 = g13 * 2 / 7;
- g19 = g13 * 3 / 7;
- g20 = g13 * 4 / 7;
- g21 = g13 * 17 / 28;
- g23 = g13 * 21 / 28;
- g24 = g13 * 11 / 14;
- g27 = g9 + g16;
- g29 = g9 + g21;
- g30 = g9 + g23;
- g31 = g9 + g24;
- g33 = g11 + g15;
- g36 = g11 + g19;
- g37 = g11 + g20;
- g41 = g13 / 14;
- g42 = g13 * 3 / 28;
- double cX1 = g33 + g16;
- double cX2 = g36 + g14;
- double cY3 = g31 + g42;
- double cX4 = (g37 + g36 + g16) / 2;
- string d = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- "M" + g33 + "," + g27 +
- ShapeArc(cX1, g27, g16, g16, 180, 360, false).Replace("M", "L") +
- ShapeArc(cX4, g27, g14, g15, 0, 90, false).Replace("M", "L") +
- ShapeArc(cX4, g29, g41, g42, 270, 180, false).Replace("M", "L") +
- " L" + g37 + "," + g30 +
- " L" + g36 + "," + g30 +
- " L" + g36 + "," + g29 +
- ShapeArc(cX2, g29, g14, g15, 180, 270, false).Replace("M", "L") +
- ShapeArc(g37, g27, g41, g42, 90, 0, false).Replace("M", "L") +
- ShapeArc(cX1, g27, g14, g14, 0, -180, false).Replace("M", "L") +
- " z" +
- "M" + hc + "," + g31 +
- ShapeArc(hc, cY3, g42, g42, 270, 630, false).Replace("M", "L") +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 动作按钮:转到主页
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonHome(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g10, g11, g12, g13, g14, g15, g16, g17, g18, g19, g20, g21, g22, g23, g24, g25, g26, g27, g28, g29, g30, g31, g32, g33;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g10 = vc + dx2;
- g11 = hc - dx2;
- g12 = hc + dx2;
- g13 = ss * 3 / 4;
- g14 = g13 / 16;
- g15 = g13 / 8;
- g16 = g13 * 3 / 16;
- g17 = g13 * 5 / 16;
- g18 = g13 * 7 / 16;
- g19 = g13 * 9 / 16;
- g20 = g13 * 11 / 16;
- g21 = g13 * 3 / 4;
- g22 = g13 * 13 / 16;
- g23 = g13 * 7 / 8;
- g24 = g9 + g14;
- g25 = g9 + g16;
- g26 = g9 + g17;
- g27 = g9 + g21;
- g28 = g11 + g15;
- g29 = g11 + g18;
- g30 = g11 + g19;
- g31 = g11 + g20;
- g32 = g11 + g22;
- g33 = g11 + g23;
- string d = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- " M" + hc + "," + g9 +
- " L" + g11 + "," + vc +
- " L" + g28 + "," + vc +
- " L" + g28 + "," + g10 +
- " L" + g33 + "," + g10 +
- " L" + g33 + "," + vc +
- " L" + g12 + "," + vc +
- " L" + g32 + "," + g26 +
- " L" + g32 + "," + g24 +
- " L" + g31 + "," + g24 +
- " L" + g31 + "," + g25 +
- " z" +
- " M" + g29 + "," + g27 +
- " L" + g30 + "," + g27 +
- " L" + g30 + "," + g10 +
- " L" + g29 + "," + g10 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 动作按钮:获取信息
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonInformation(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g11, g13, g14, g17, g18, g19, g20, g22, g23, g24, g25, g28, g29, g30, g31, g32, g34, g35, g37, g38;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g11 = hc - dx2;
- g13 = ss * 3 / 4;
- g14 = g13 / 32;
- g17 = g13 * 5 / 16;
- g18 = g13 * 3 / 8;
- g19 = g13 * 13 / 32;
- g20 = g13 * 19 / 32;
- g22 = g13 * 11 / 16;
- g23 = g13 * 13 / 16;
- g24 = g13 * 7 / 8;
- g25 = g9 + g14;
- g28 = g9 + g17;
- g29 = g9 + g18;
- g30 = g9 + g23;
- g31 = g9 + g24;
- g32 = g11 + g17;
- g34 = g11 + g19;
- g35 = g11 + g20;
- g37 = g11 + g22;
- g38 = g13 * 3 / 32;
- double cY1 = g9 + dx2;
- double cY2 = g25 + g38;
- string d = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- "M" + hc + "," + g9 +
- ShapeArc(hc, cY1, dx2, dx2, 270, 630, false).Replace("M", "L") +
- " z" +
- "M" + hc + "," + g25 +
- ShapeArc(hc, cY2, g38, g38, 270, 630, false).Replace("M", "L") +
- "M" + g32 + "," + g28 +
- " L" + g35 + "," + g28 +
- " L" + g35 + "," + g30 +
- " L" + g37 + "," + g30 +
- " L" + g37 + "," + g31 +
- " L" + g32 + "," + g31 +
- " L" + g32 + "," + g30 +
- " L" + g34 + "," + g30 +
- " L" + g34 + "," + g29 +
- " L" + g32 + "," + g29 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 动作按钮:视频
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonMovie(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g10, g11, g12, g13, g14, g15, g16, g17, g18, g19, g20, g21, g22, g23, g24, g25, g26, g27,
- g28, g29, g30, g31, g32, g33, g34, g35, g36, g37, g38, g39, g40, g41, g42, g43, g44, g45, g46, g47, g48;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g10 = vc + dx2;
- g11 = hc - dx2;
- g12 = hc + dx2;
- g13 = ss * 3 / 4;
- g14 = g13 * 1455 / 21600.00;
- g15 = g13 * 1905 / 21600.00;
- g16 = g13 * 2325 / 21600.00;
- g17 = g13 * 16155 / 21600.00;
- g18 = g13 * 17010 / 21600.00;
- g19 = g13 * 19335 / 21600.00;
- g20 = g13 * 19725 / 21600.00;
- g21 = g13 * 20595 / 21600.00;
- g22 = g13 * 5280 / 21600.00;
- g23 = g13 * 5730 / 21600.00;
- g24 = g13 * 6630 / 21600.00;
- g25 = g13 * 7492 / 21600.00;
- g26 = g13 * 9067 / 21600.00;
- g27 = g13 * 9555 / 21600.00;
- g28 = g13 * 13342 / 21600.00;
- g29 = g13 * 14580 / 21600.00;
- g30 = g13 * 15592 / 21600.00;
- g31 = g11 + g14;
- g32 = g11 + g15;
- g33 = g11 + g16;
- g34 = g11 + g17;
- g35 = g11 + g18;
- g36 = g11 + g19;
- g37 = g11 + g20;
- g38 = g11 + g21;
- g39 = g9 + g22;
- g40 = g9 + g23;
- g41 = g9 + g24;
- g42 = g9 + g25;
- g43 = g9 + g26;
- g44 = g9 + g27;
- g45 = g9 + g28;
- g46 = g9 + g29;
- g47 = g9 + g30;
- g48 = g9 + g31;
- string d = "M" + 0 + "," + h +
- " L" + w + "," + h +
- " L" + w + "," + 0 +
- " L" + 0 + "," + 0 +
- " z" +
- "M" + g11 + "," + g39 +
- " L" + g11 + "," + g44 +
- " L" + g31 + "," + g44 +
- " L" + g32 + "," + g43 +
- " L" + g33 + "," + g43 +
- " L" + g33 + "," + g47 +
- " L" + g35 + "," + g47 +
- " L" + g35 + "," + g45 +
- " L" + g36 + "," + g45 +
- " L" + g38 + "," + g46 +
- " L" + g12 + "," + g46 +
- " L" + g12 + "," + g41 +
- " L" + g38 + "," + g41 +
- " L" + g37 + "," + g42 +
- " L" + g35 + "," + g42 +
- " L" + g35 + "," + g41 +
- " L" + g34 + "," + g40 +
- " L" + g32 + "," + g40 +
- " L" + g31 + "," + g39 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 动作按钮:上一张
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonReturn(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g10, g11, g12, g13, g14, g15, g16, g17, g18, g19, g20, g21, g22, g23, g24, g25, g26, g27;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g10 = vc + dx2;
- g11 = hc - dx2;
- g12 = hc + dx2;
- g13 = ss * 3 / 4;
- g14 = g13 * 7 / 8;
- g15 = g13 * 3 / 4;
- g16 = g13 * 5 / 8;
- g17 = g13 * 3 / 8;
- g18 = g13 / 4;
- g19 = g9 + g15;
- g20 = g9 + g16;
- g21 = g9 + g18;
- g22 = g11 + g14;
- g23 = g11 + g15;
- g24 = g11 + g16;
- g25 = g11 + g17;
- g26 = g11 + g18;
- g27 = g13 / 8;
- double cX1 = g24 - g27;
- double cY2 = g19 - g27;
- double cX3 = g11 + g17;
- double cY4 = g10 - g17;
- string d = "M" + 0 + "," + h +
- " L" + w + "," + h +
- " L" + w + "," + 0 +
- " L" + 0 + "," + 0 +
- " z" +
- " M" + g12 + "," + g21 +
- " L" + g23 + "," + g9 +
- " L" + hc + "," + g21 +
- " L" + g24 + "," + g21 +
- " L" + g24 + "," + g20 +
- ShapeArc(cX1, g20, g27, g27, 0, 90, false).Replace("M", "L") +
- " L" + g25 + "," + g19 +
- ShapeArc(g25, cY2, g27, g27, 90, 180, false).Replace("M", "L") +
- " L" + g26 + "," + g21 +
- " L" + g11 + "," + g21 +
- " L" + g11 + "," + g20 +
- ShapeArc(cX3, g20, g17, g17, 180, 90, false).Replace("M", "L") +
- " L" + hc + "," + g10 +
- ShapeArc(hc, cY4, g17, g17, 90, 0, false).Replace("M", "L") +
- " L" + g22 + "," + g21 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 动作按钮:声音
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ActionButtonSound(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double hc = w / 2, vc = h / 2, ss = System.Math.Min(w, h);
- double dx2, g9, g10, g11, g12, g13, g14, g15, g16, g17, g18, g19, g20, g21, g22, g23, g24, g25, g26;
- dx2 = ss * 3 / 8;
- g9 = vc - dx2;
- g10 = vc + dx2;
- g11 = hc - dx2;
- g12 = hc + dx2;
- g13 = ss * 3 / 4;
- g14 = g13 / 8;
- g15 = g13 * 5 / 16;
- g16 = g13 * 5 / 8;
- g17 = g13 * 11 / 16;
- g18 = g13 * 3 / 4;
- g19 = g13 * 7 / 8;
- g20 = g9 + g14;
- g21 = g9 + g15;
- g22 = g9 + g17;
- g23 = g9 + g19;
- g24 = g11 + g15;
- g25 = g11 + g16;
- g26 = g11 + g18;
- string d = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- " M" + g11 + "," + g21 +
- " L" + g24 + "," + g21 +
- " L" + g25 + "," + g9 +
- " L" + g25 + "," + g10 +
- " L" + g24 + "," + g22 +
- " L" + g11 + "," + g22 +
- " z" +
- " M" + g26 + "," + g21 +
- " L" + g12 + "," + g20 +
- " M" + g26 + "," + vc +
- " L" + g12 + "," + vc +
- " M" + g26 + "," + g22 +
- " L" + g12 + "," + g23;
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 爆炸形:8 pt
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg IrregularSeal1(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- string d = "";
- if (shapType == "irregularSeal1")
- {
- d = "M" + w * 10800 / 21600 + "," + h * 5800 / 21600 +
- " L" + w * 14522 / 21600 + "," + 0 +
- " L" + w * 14155 / 21600 + "," + h * 5325 / 21600 +
- " L" + w * 18380 / 21600 + "," + h * 4457 / 21600 +
- " L" + w * 16702 / 21600 + "," + h * 7315 / 21600 +
- " L" + w * 21097 / 21600 + "," + h * 8137 / 21600 +
- " L" + w * 17607 / 21600 + "," + h * 10475 / 21600 +
- " L" + w + "," + h * 13290 / 21600 +
- " L" + w * 16837 / 21600 + "," + h * 12942 / 21600 +
- " L" + w * 18145 / 21600 + "," + h * 18095 / 21600 +
- " L" + w * 14020 / 21600 + "," + h * 14457 / 21600 +
- " L" + w * 13247 / 21600 + "," + h * 19737 / 21600 +
- " L" + w * 10532 / 21600 + "," + h * 14935 / 21600 +
- " L" + w * 8485 / 21600 + "," + h +
- " L" + w * 7715 / 21600 + "," + h * 15627 / 21600 +
- " L" + w * 4762 / 21600 + "," + h * 17617 / 21600 +
- " L" + w * 5667 / 21600 + "," + h * 13937 / 21600 +
- " L" + w * 135 / 21600 + "," + h * 14587 / 21600 +
- " L" + w * 3722 / 21600 + "," + h * 11775 / 21600 +
- " L" + 0 + "," + h * 8615 / 21600 +
- " L" + w * 4627 / 21600 + "," + h * 7617 / 21600 +
- " L" + w * 370 / 21600 + "," + h * 2295 / 21600 +
- " L" + w * 7312 / 21600 + "," + h * 6320 / 21600 +
- " L" + w * 8352 / 21600 + "," + h * 2295 / 21600 +
- " z";
- }
- else if (shapType == "irregularSeal2")
- {
- d = "M" + w * 11462 / 21600 + "," + h * 4342 / 21600 +
- " L" + w * 14790 / 21600 + "," + 0 +
- " L" + w * 14525 / 21600 + "," + h * 5777 / 21600 +
- " L" + w * 18007 / 21600 + "," + h * 3172 / 21600 +
- " L" + w * 16380 / 21600 + "," + h * 6532 / 21600 +
- " L" + w + "," + h * 6645 / 21600 +
- " L" + w * 16985 / 21600 + "," + h * 9402 / 21600 +
- " L" + w * 18270 / 21600 + "," + h * 11290 / 21600 +
- " L" + w * 16380 / 21600 + "," + h * 12310 / 21600 +
- " L" + w * 18877 / 21600 + "," + h * 15632 / 21600 +
- " L" + w * 14640 / 21600 + "," + h * 14350 / 21600 +
- " L" + w * 14942 / 21600 + "," + h * 17370 / 21600 +
- " L" + w * 12180 / 21600 + "," + h * 15935 / 21600 +
- " L" + w * 11612 / 21600 + "," + h * 18842 / 21600 +
- " L" + w * 9872 / 21600 + "," + h * 17370 / 21600 +
- " L" + w * 8700 / 21600 + "," + h * 19712 / 21600 +
- " L" + w * 7527 / 21600 + "," + h * 18125 / 21600 +
- " L" + w * 4917 / 21600 + "," + h +
- " L" + w * 4805 / 21600 + "," + h * 18240 / 21600 +
- " L" + w * 1285 / 21600 + "," + h * 17825 / 21600 +
- " L" + w * 3330 / 21600 + "," + h * 15370 / 21600 +
- " L" + 0 + "," + h * 12877 / 21600 +
- " L" + w * 3935 / 21600 + "," + h * 11592 / 21600 +
- " L" + w * 1172 / 21600 + "," + h * 8270 / 21600 +
- " L" + w * 5372 / 21600 + "," + h * 7817 / 21600 +
- " L" + w * 4502 / 21600 + "," + h * 3625 / 21600 +
- " L" + w * 8550 / 21600 + "," + h * 6382 / 21600 +
- " L" + w * 9722 / 21600 + "," + h * 1887 / 21600 +
- " z";
- }
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 爆炸形:14 pt
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg IrregularSeal2(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return IrregularSeal1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg FlowChartTerminator(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double x1, x2, y1;
- int cd2 = 180, cd4 = 90, c3d4 = 270;
- x1 = w * 3475 / 21600.00;
- x2 = w * 18125 / 21600.00;
- y1 = h * 10800 / 21600.00;
- //path attrs: w = 21600; h = 21600;
- string d = "M" + x1 + "," + 0 +
- " L" + x2 + "," + 0 +
- ShapeArc(x2, h / 2, x1, y1, c3d4, c3d4 + cd2, false).Replace("M", "L") +
- " L" + x1 + "," + h +
- ShapeArc(x1, h / 2, x1, y1, cd4, cd4 + cd2, false).Replace("M", "L") +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:资料袋
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartPunchedTape(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double x1, y1, y2;
- int cd2 = 180;
- x1 = w * 5 / 20;
- y1 = h * 2 / 20;
- y2 = h * 18 / 20;
- string d = "M" + 0 + "," + y1 +
- ShapeArc(x1, y1, x1, y1, cd2, 0, false).Replace("M", "L") +
- ShapeArc(w * (3 / 4.00), y1, x1, y1, cd2, 360, false).Replace("M", "L") +
- " L" + w + "," + y2 +
- ShapeArc(w * (3 / 4.00), y2, x1, y1, 0, -cd2, false).Replace("M", "L") +
- ShapeArc(x1, y2, x1, y1, 0, cd2, false).Replace("M", "L") +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图: 存储数据
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartOnlineStorage(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double x1, y1;
- int c3d4 = 270, cd4 = 90;
- x1 = w * 1 / 6;
- y1 = h * 3 / 6;
- string d = "M" + x1 + "," + 0 +
- " L" + w + "," + 0 +
- ShapeArc(w, h / 2, x1, y1, c3d4, 90, false).Replace("M", "L") +
- " L" + x1 + "," + h +
- ShapeArc(x1, h / 2, x1, y1, cd4, 270, false).Replace("M", "L") +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:显示
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartDisplay(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double x1, x2, y1;
- int c3d4 = 270, cd2 = 180;
- x1 = w * 1 / 6;
- x2 = w * 5 / 6;
- y1 = h * 3 / 6;
- //path attrs: w = 6; h = 6;
- string d = "M" + 0 + "," + y1 +
- " L" + x1 + "," + 0 +
- " L" + x2 + "," + 0 +
- ShapeArc(w, h / 2, x1, y1, c3d4, c3d4 + cd2, false).Replace("M", "L") +
- " L" + x1 + "," + h +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg FlowChartDelay(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double wd2 = w / 2, hd2 = h / 2;
- int cd2 = 180, c3d4 = 270, cd4 = 90;
- string d = "M" + 0 + "," + 0 +
- " L" + wd2 + "," + 0 +
- ShapeArc(wd2, hd2, wd2, hd2, c3d4, c3d4 + cd2, false).Replace("M", "L") +
- " L" + 0 + "," + h +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:顺序访问存储器
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartMagneticTape(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double wd2 = w / 2, hd2 = h / 2;
- int cd2 = 180, c3d4 = 270, cd4 = 90;
- double idy, ib, ang1;
- idy = hd2 * System.Math.Sin(System.Math.PI / 4);
- ib = hd2 + idy;
- ang1 = System.Math.Atan(h / w);
- double ang1Dg = ang1 * 180 / System.Math.PI;
- string d = "M" + wd2 + "," + h +
- ShapeArc(wd2, hd2, wd2, hd2, cd4, cd2, false).Replace("M", "L") +
- ShapeArc(wd2, hd2, wd2, hd2, cd2, c3d4, false).Replace("M", "L") +
- ShapeArc(wd2, hd2, wd2, hd2, c3d4, 360, false).Replace("M", "L") +
- ShapeArc(wd2, hd2, wd2, hd2, 0, (int)ang1Dg, false).Replace("M", "L") +
- " L" + w + "," + ib +
- " L" + w + "," + h +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 椭圆
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Ellipse(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- //todo
- // string result = "";
- // result += "<ellipse cx='" + (w / 2) + "' cy='" + (h / 2) + "' rx='" + (w / 2) + "' ry='" + (h / 2) + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Ellipse {
- type = "ellipse",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- cx=(w / 2)+"",
- cy=(h / 2)+"",
- rx=(w / 2)+"",
- ry= (h / 2)+""
- } };
- if (shapType == "flowChartOr")
- {
- // result += " <polyline points='" + w / 2 + " " + 0 + "," + w / 2 + " " + h + "' fill='none' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- shapes.Add(new Polyline
- {
- type = "polyline",
- //Fill = "none",
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points = (w / 2 + " " + 0 + "," + w / 2) + "",
- });
- // result += " <polyline points='" + 0 + " " + h / 2 + "," + w + " " + h / 2 + "' fill='none' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- shapes.Add(new Polyline
- {
- type = "polyline",
- //Fill = "none",
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points = (0 + " " + h / 2 + "," + w + " " + h / 2) + "",
- });
- }
- else if (shapType == "flowChartSummingJunction")
- {
- double idx, idy, il, ir, it, ib, hc = w / 2, vc = h / 2, wd2 = w / 2, hd2 = h / 2;
- double angVal = System.Math.PI / 4;
- idx = wd2 * System.Math.Cos(angVal);
- idy = hd2 * System.Math.Sin(angVal);
- il = hc - idx;
- ir = hc + idx;
- it = vc - idy;
- ib = vc + idy;
- // result += " <polyline points='" + il + " " + it + "," + ir + " " + ib + "' fill='none' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- shapes.Add(new Polyline
- {
- type = "polyline",
- //Fill = "none",
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points = (il + " " + it + "," + ir + " " + ib) + "",
- });
- // result += " <polyline points='" + ir + " " + it + "," + il + " " + ib + "' fill='none' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- shapes.Add(new Polyline
- {
- type = "polyline",
- //Fill = "none",
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points = (ir + " " + it + "," + il + " " + ib) + "",
- });
- }
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:接点
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartConnector(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Ellipse(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- /// <summary>
- /// 流程图: 汇总链接
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartSummingJunction(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Ellipse(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- /// <summary>
- /// 流程图: 或者
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartOr(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Ellipse(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- /// <summary>
- /// 矩形:圆角 有偏差
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg RoundRect(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 0.0;// = 0.33334;
- double sAdj2_val = 0.0;// = 0.33334;
- string shpTyp = "";
- string adjTyp = "";
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- var sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj")
- {
- XmlNode sAdj = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = double.Parse(sAdj.Value.Substring(4)) / 50000.00;
- }
- else if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = double.Parse(sAdj1.Value.Substring(4)) / 50000.00;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj2_val = double.Parse(sAdj2.Value.Substring(4)) / 50000.00;
- }
- }
- //console.log("shapType: ",shapType,",node: ",node )
- string tranglRott = "";
- string transform = "";
- switch (shapType)
- {
- case "roundRect":
- case "flowChartAlternateProcess":
- shpTyp = "round";
- adjTyp = "cornrAll";
- if (sAdj1_val == 0.0) sAdj1_val = 0.33334;
- sAdj2_val = 0;
- break;
- case "round1Rect":
- shpTyp = "round";
- adjTyp = "cornr1";
- if (sAdj1_val == 0.0) sAdj1_val = 0.33334;
- sAdj2_val = 0;
- break;
- case "round2DiagRect":
- shpTyp = "round";
- adjTyp = "diag";
- if (sAdj1_val == 0.0) sAdj1_val = 0.33334;
- if (sAdj2_val == 0.0) sAdj2_val = 0;
- break;
- case "round2SameRect":
- shpTyp = "round";
- adjTyp = "cornr2";
- if (sAdj1_val == 0.0) sAdj1_val = 0.33334;
- if (sAdj2_val == 0.0) sAdj2_val = 0;
- break;
- case "snip1Rect":
- case "flowChartPunchedCard":
- shpTyp = "snip";
- adjTyp = "cornr1";
- if (sAdj1_val == 0.0) sAdj1_val = 0.33334;
- sAdj2_val = 0;
- if (shapType == "flowChartPunchedCard")
- {
- tranglRott = "transform='translate(" + w + ",0) scale(-1,1)'";
- transform = "translate(" + w + ",0) scale(-1,1)";
- }
- break;
- case "snip2DiagRect":
- shpTyp = "snip";
- adjTyp = "diag";
- if (sAdj1_val == 0.0) sAdj1_val = 0;
- if (sAdj2_val == 0.0) sAdj2_val = 0.33334;
- break;
- case "snip2SameRect":
- shpTyp = "snip";
- adjTyp = "cornr2";
- if (sAdj1_val == 0.0) sAdj1_val = 0.33334;
- if (sAdj2_val == 0.0) sAdj2_val = 0;
- break;
- }
- string d_val = ShapeSnipRoundRect(w, h, sAdj1_val, sAdj2_val, shpTyp, adjTyp);
- // result += "<path " + tranglRott + " d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- transform=transform
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 单圆角
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Round1Rect(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return RoundRect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- /// <summary>
- /// 对角圆角
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Round2DiagRect(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return RoundRect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- /// <summary>
- /// 圆顶角
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Round2SameRect(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return RoundRect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- /// <summary>
- /// 矩形:减去单角
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Snip1Rect(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return RoundRect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- private static Svg Snip2DiagRect(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return RoundRect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- /// <summary>
- /// snip2SameRect 矩形:减去左右顶角 不标准
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Snip2SameRect(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return RoundRect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- /// <summary>
- /// 流程图:可选过程
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartAlternateProcess(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return RoundRect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- /// <summary>
- /// 流程图:卡片
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartPunchedCard(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return RoundRect(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border)
- ;
- }
- /// <summary>
- /// 矩形:一哥圆顶角 减去另一个顶角 不标准
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg SnipRoundRect(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 0.33334, sAdj2_val = 0.33334;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = double.Parse(sAdj1.Value.Substring(4)) / 50000.00;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj2_val = double.Parse(sAdj2.Value.Substring(4)) / 50000.00;
- }
- }
- }
- string d_val = "M0," + h + " L" + w + "," + h + " L" + w + "," + (h / 2) * sAdj2_val +
- " L" + (w / 2 + (w / 2) * (1 - sAdj2_val)) + ",0 L" + (w / 2) * sAdj1_val + ",0 Q0,0 0," + (h / 2) * sAdj1_val + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg BentConnector2(XmlNode node, string shapType, double w, double h, int isFlipV, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- // string result = "";
- string d = "";
- if (isFlipV == 1)
- {
- d = "M 0 " + w + " L " + h + " " + w + " L " + h + " 0";
- }
- else
- {
- d = "M " + w + " 0 L " + w + " " + h + " L 0 " + h;
- }
- // result += "<path d='" + d + "' stroke='#" + border.Color +
- // "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' fill='none' ";
- // if (headEndNodeAttrs != null && (headEndNodeAttrs.GetTextByPath("@type").Value == "triangle" || headEndNodeAttrs.GetTextByPath("@type").Value == "arrow"))
- // {
- // result += "marker-start='url(#markerTriangle_" + shpId + ")' ";
- // }
- // if (tailEndNodeAttrs != null && (tailEndNodeAttrs.GetTextByPath("@type").Value == "triangle" || tailEndNodeAttrs.GetTextByPath("@type").Value == "arrow"))
- // {
- // result += "marker-end='url(#markerTriangle_" + shpId + ")' ";
- // }
- // result += "/>";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- start=headEndNodeAttrs!=null&&headEndNodeAttrs.GetTextByPath("@type")!=null?headEndNodeAttrs.GetTextByPath("@type").Value:null,
- end=tailEndNodeAttrs!=null&&tailEndNodeAttrs.GetTextByPath("@type")!=null?tailEndNodeAttrs.GetTextByPath("@type").Value:null,
- //MarkerStart="url(#markerTriangle_" + shpId + ")",
- //MarkerEnd="url(#markerTriangle_" + shpId + ")"
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 直角三角形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg RtTriangle(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- // result += " <polygon points='0 0,0 " + h + "," + w + " " + h + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points ="0 0,0 " + h + "," + w + " " + h
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 等腰三角形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Triangle(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double shapAdjst_val = 0.5;
- if (shapAdjst != null)
- {
- shapAdjst_val = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400 * 10;
- //console.log("w: "+w+"\nh: "+h+"\nshapAdjst: "+shapAdjst+"\nshapAdjst_val: "+shapAdjst_val);
- }
- string tranglRott = "";
- string transform = "";
- if (shapType == "flowChartMerge")
- {
- tranglRott = "transform='rotate(180 " + w / 2 + "," + h / 2 + ")'";
- transform = "rotate(180 " + w / 2 + "," + h / 2 + ")";
- }
- // result += " <polygon " + tranglRott + " points='" + (w * shapAdjst_val) + " 0,0 " + h + "," + w + " " + h + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points =(w * shapAdjst_val) + " 0,0 " + h + "," + w + " " + h,
- transform=transform
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图: 摘录
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartExtract(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Triangle(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 流程图: 合并
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartMerge(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Triangle(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 菱形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Diamond(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- // result += " <polygon points='" + (w / 2) + " 0,0 " + (h / 2) + "," + (w / 2) + " " + h + "," + w + " " + (h / 2) + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points =(w / 2) + " 0,0 " + (h / 2) + "," + (w / 2) + " " + h + "," + w + " " + (h / 2),
- } };
- if (shapType == "flowChartSort")
- {
- // result += " <polyline points='0 " + h / 2 + "," + w + " " + h / 2 + "' fill='none' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- shapes.Add(new Polyline
- {
- type = "polyline",
- //Fill = "none",
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points = "0 " + h / 2 + "," + w + " " + h / 2
- });
- }
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:决策
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartDecision(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Diamond(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 流程图: 排序
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartSort(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Diamond(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 梯形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Trapezoid(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- //string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adjst_val = 0.2;
- double max_adj_const = 0.7407;
- if (shapAdjst != null)
- {
- double adjst = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400 * 10;
- adjst_val = (adjst * 0.5) / max_adj_const;
- // console.log("w: "+w+"\nh: "+h+"\nshapAdjst: "+shapAdjst+"\nadjst_val: "+adjst_val);
- }
- double cnstVal = 0;
- string tranglRott = "";
- string transform = "";
- if (shapType == "flowChartManualOperation")
- {
- tranglRott = "transform='rotate(180 " + w / 2 + "," + h / 2 + ")'";
- transform = "rotate(180 " + w / 2 + "," + h / 2 + ")";
- }
- if (shapType == "flowChartManualInput")
- {
- adjst_val = 0;
- cnstVal = h / 5;
- }
- // result += " <polygon " + tranglRott + " points='" + (w * adjst_val) + " " + cnstVal + ",0 " + h + "," + w + " " + h + "," + (1 - adjst_val) * w + " 0' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points = (w * adjst_val) + " " + cnstVal + ",0 " + h + "," + w + " " + h ,
- transform=transform
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:手动操作
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartManualOperation(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Trapezoid(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 流程图:手动输入
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartManualInput(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Trapezoid(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 平行四边形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Parallelogram(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adjst_val = 0.25;
- double max_adj_const;
- if (w > h)
- {
- max_adj_const = w / h;
- }
- else
- {
- max_adj_const = h / w;
- }
- if (shapAdjst != null)
- {
- double adjst = double.Parse(shapAdjst.Value.Substring(4)) / 100000.00;
- adjst_val = adjst / max_adj_const;
- //console.log("w: "+w+"\nh: "+h+"\nadjst: "+adjst_val+"\nmax_adj_const: "+max_adj_const);
- }
- // result += " <polygon points='" + adjst_val * w + " 0,0 " + h + "," + (1 - adjst_val) * w + " " + h + "," + w + " 0' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points = adjst_val * w + " 0,0 " + h + "," + (1 - adjst_val) * w + " " + h + "," + w + " 0",
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:数据
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartInputOutput(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Parallelogram(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Pentagon(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- // result += " <polygon points='" + (0.5 * w) + " 0,0 " + (0.375 * h) + "," + (0.15 * w) + " " + h + "," + 0.85 * w + " " + h + "," + w + " " + 0.375 * h + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points = (0.5 * w) + " 0,0 " + (0.375 * h) + "," + (0.15 * w) + " " + h + "," + 0.85 * w + " " + h + "," + w + " " + 0.375 * h,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 六边形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Hexagon(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 25000 * px9d6 / px91d4400;
- double vf = 115470 * px9d6 / px91d4400; ;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double angVal1 = 60 * System.Math.PI / 180;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double maxAdj, a, shd2, x1, x2, dy1, y1, y2, vc = h / 2, hd2 = h / 2;
- double ss = System.Math.Min(w, h);
- maxAdj = cnstVal1 * w / ss;
- a = (adj < 0) ? 0 : (adj > maxAdj) ? maxAdj : adj;
- shd2 = hd2 * vf / cnstVal2;
- x1 = ss * a / cnstVal2;
- x2 = w - x1;
- dy1 = shd2 * System.Math.Sin(angVal1);
- y1 = vc - dy1;
- y2 = vc + dy1;
- string d = "M" + 0 + "," + vc +
- " L" + x1 + "," + y1 +
- " L" + x2 + "," + y1 +
- " L" + w + "," + vc +
- " L" + x2 + "," + y2 +
- " L" + x1 + "," + y2 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d = d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg FlowChartPreparation(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Hexagon(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 七边形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Heptagon(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- // result += " <polygon points='" + (0.5 * w) + " 0," + w / 8 + " " + h / 4 + ",0 " + (5 / 8.00) * h + "," + w / 4 + " " + h + "," + (3 / 4.00) * w + " " + h + "," +
- // w + " " + (5 / 8.00) * h + "," + (7 / 8.00) * w + " " + h / 4 + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points=(0.5 * w) + " 0," + w / 8 + " " + h / 4 + ",0 " + (5 / 8.00) * h + "," + w / 4 + " " + h + "," + (3 / 4.00) * w + " " + h + "," +
- w + " " + (5 / 8.00) * h + "," + (7/ 8.00) * w + " " + h / 4
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 八边形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Octagon(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj1 = 0.25;
- if (shapAdjst != null)
- {
- adj1 = double.Parse(shapAdjst.Value.Substring(4)) / 100000.00;
- }
- double adj2 = (1 - adj1);
- //console.log("adj1: "+adj1+"\nadj2: "+adj2);
- // result += " <polygon points='" + adj1 * w + " 0,0 " + adj1 * h + ",0 " + adj2 * h + "," + adj1 * w + " " + h + "," + adj2 * w + " " + h + "," +
- // / w + " " + adj2 * h + "," + w + " " + adj1 * h + "," + adj2 * w + " 0' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points=adj1 * w + " 0,0 " + adj1 * h + ",0 " + adj2 * h + "," + adj1 * w + " " + h + "," + adj2 * w + " " + h + "," +
- w + " " + adj2 * h + "," + w + " " + adj1 * h + "," + adj2 * w + " 0"
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 十边形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Decagon(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- // result += " <polygon points='" + (3 / 8.00) * w + " 0," + w / 8 + " " + h / 8 + ",0 " + h / 2 + "," + w / 8 + " " + (7 / 8.00) * h + "," + (3 / 8.00) * w + " " + h + "," +
- // (5 / 8.00) * w + " " + h + "," + (7 / 8.00) * w + " " + (7 / 8.00) * h + "," + w + " " + h / 2 + "," + (7 / 8.00) * w + " " + h / 8 + "," + (5 / 8.00) * w + " 0' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points=(3/ 8.00) * w + " 0," + w / 8 + " " + h / 8 + ",0 " + h / 2 + "," + w / 8 + " " + (7/ 8.00) * h + "," + (3/ 8.00) * w + " " + h + "," +
- (5 / 8.00) * w + " " + h + "," + (7/ 8.00) * w + " " + (7/ 8.00) * h + "," + w + " " + h / 2 + "," + (7/ 8.00) * w + " " + h / 8 + "," + (5 / 8.00) * w + " 0"
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 十二边形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Dodecagon(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- // result += " <polygon points='" + (3 / 8.00) * w + " 0," + w / 8 + " " + h / 8 + ",0 " + (3 / 8.00) * h + ",0 " + (5 / 8.00) * h + "," + w / 8 + " " + (7 / 8.00) * h + "," + (3 / 8.00) * w + " " + h + "," +
- // (5 / 8.00) * w + " " + h + "," + (7 / 8.00) * w + " " + (7 / 8.00) * h + "," + w + " " + (5 / 8.00) * h + "," + w + " " + (3 / 8.00) * h + "," + (7 / 8.00) * w + " " + h / 8 + "," + (5 / 8.00) * w + " 0' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points=(3/ 8.00) * w + " 0," + w / 8 + " " + h / 8 + ",0 " + (3/ 8.00) * h + ",0 " + (5 / 8.00) * h + "," + w / 8 + " " + (7/ 8.00) * h + "," + (3/ 8.00) * w + " " + h + "," +
- (5 / 8.00) * w + " " + h + "," + (7/ 8.00) * w + " " + (7/ 8.00) * h + "," + w + " " + (5 / 8.00) * h + "," + w + " " + (3/ 8.00) * h + "," + (7/ 8.00) * w + " " + h / 8 + "," + (5 / 8.00) * w + " 0"
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg Star4(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");//[0]["attrs"]["fmla"];
- string starNum = shapType.Substring(4);
- double adj = 0.0;
- switch (starNum)
- {
- case "4":
- adj = 30;
- break;
- case "5":
- adj = 40;
- break;
- case "6":
- adj = 60;
- break;
- case "7":
- adj = 70;
- break;
- case "8":
- adj = 77;
- break;
- case "10":
- adj = 86;
- break;
- case "12":
- case "16":
- case "24":
- case "32":
- adj = 75;
- break;
- }
- if (shapAdjst != null && shapAdjst.Count>0)
- {
- XmlNode shapAdjst1 = ShapeHelper.GetTextByPath(shapAdjst[0], "@fmla");
- if (shapAdjst1 != null)
- {
- adj = 2 * double.Parse(shapAdjst1.Value.Substring(4)) / 1000.00;
- }
- }
- string points = ShapeStar(adj, double.Parse(starNum));
- // result += " <polygon points='" + points + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points=points
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 星形:五角
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Star5(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Star4(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Star6(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Star4(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Star7(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Star4(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Star8(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Star4(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Star10(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Star4(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Star12(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Star4(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Star16(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Star4(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Star24(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Star4(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Star32(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Star4(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 不完整圆
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Pie(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 0.0, adj2 = 0.0, H = 0.0;
- bool isClose = false;
- if (shapType == "pie")
- {
- adj1 = 0;
- adj2 = 270;
- H = h;
- isClose = true;
- }
- else if (shapType == "pieWedge")
- {
- adj1 = 180;
- adj2 = 270;
- H = 2 * h;
- isClose = true;
- }
- else if (shapType == "arc")
- {
- adj1 = 270;
- adj2 = 0;
- H = h;
- isClose = false;
- }
- if (shapAdjst != null)
- {
- for (int i = 0; i < shapAdjst.Count; i++)
- {
- var shapAdjst1 = ShapeHelper.GetTextByPath(shapAdjst[i], "@fmla");
- if (i == 0) adj1 = double.Parse(shapAdjst1.Value.Substring(4)) / 60000.00;
- else if (i == 1) adj2 = double.Parse(shapAdjst1.Value.Substring(4)) / 60000.00;
- }
- }
- List<string> pieVals = ShapePie(H, w, adj1, adj2, isClose);
- //console.log("shapType: ",shapType,"\nimgFillFlg: ",imgFillFlg,"\ngrndFillFlg: ",grndFillFlg,"\nshpId: ",shpId,"\nfillColor: ",fillColor);
- // result += "<path d='" + pieVals[0] + "' transform='" + pieVals[1] + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=pieVals[0],
- transform= pieVals[1]
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg PieWedge(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Pie(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 弧形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Arc(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Pie(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 弦形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Chord(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 45;
- double sAdj2_val = 270;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = double.Parse(sAdj1.Value.Substring(4)) / 60000.00;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj2_val = double.Parse(sAdj2.Value.Substring(4)) / 60000.00;
- }
- }
- }
- double hR = h / 2;
- double wR = w / 2;
- string d_val = ShapeArc(wR, hR, wR, hR, sAdj1_val, sAdj2_val, true);
- //console.log("shapType: ",shapType,", sAdj1_val: ",sAdj1_val,", sAdj2_val: ",sAdj2_val)
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 图文框
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Frame(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj1 = 12500 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- adj1 = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double a1, x1, x4, y4;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > cnstVal1) a1 = cnstVal1;
- else a1 = adj1;
- x1 = System.Math.Min(w, h) * a1 / cnstVal2;
- x4 = w - x1;
- y4 = h - x1;
- string d = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- "M" + x1 + "," + x1 +
- " L" + x1 + "," + y4 +
- " L" + x4 + "," + y4 +
- " L" + x4 + "," + x1 +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg Donut(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 25000 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double a, dr, iwd2, ihd2;
- if (adj < 0) a = 0;
- else if (adj > cnstVal1) a = cnstVal1;
- else a = adj;
- dr = System.Math.Min(w, h) * a / cnstVal2;
- iwd2 = w / 2 - dr;
- ihd2 = h / 2 - dr;
- string d = "M" + 0 + "," + h / 2 +
- ShapeArc(w / 2, h / 2, w / 2, h / 2, 180, 270, false).Replace("M", "L") +
- ShapeArc(w / 2, h / 2, w / 2, h / 2, 270, 360, false).Replace("M", "L") +
- ShapeArc(w / 2, h / 2, w / 2, h / 2, 0, 90, false).Replace("M", "L") +
- ShapeArc(w / 2, h / 2, w / 2, h / 2, 90, 180, false).Replace("M", "L") +
- " z" +
- "M" + dr + "," + h / 2 +
- ShapeArc(w / 2, h / 2, iwd2, ihd2, 180, 90, false).Replace("M", "L") +
- ShapeArc(w / 2, h / 2, iwd2, ihd2, 90, 0, false).Replace("M", "L") +
- ShapeArc(w / 2, h / 2, iwd2, ihd2, 0, -90, false).Replace("M", "L") +
- ShapeArc(w / 2, h / 2, iwd2, ihd2, 270, 180, false).Replace("M", "L") +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg NoSmoking(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- //string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 18750 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double a, dr, iwd2, ihd2, ang, ang2rad, ct, st, m, n, drd2, dang, dang2, swAng, t3, stAng1, stAng2;
- if (adj < 0) a = 0;
- else if (adj > cnstVal1) a = cnstVal1;
- else a = adj;
- dr = System.Math.Min(w, h) * a / cnstVal2;
- iwd2 = w / 2 - dr;
- ihd2 = h / 2 - dr;
- ang = System.Math.Atan(h / w);
- //ang2rad = ang*Math.PI/180;
- ct = ihd2 * System.Math.Cos(ang);
- st = iwd2 * System.Math.Sin(ang);
- m = System.Math.Sqrt(ct * ct + st * st); //"mod ct st 0"
- n = iwd2 * ihd2 / m;
- drd2 = dr / 2;
- dang = System.Math.Atan(drd2 / n);
- dang2 = dang * 2;
- swAng = -System.Math.PI + dang2;
- //t3 = System.Math.Atan(h/w);
- stAng1 = ang - dang;
- stAng2 = stAng1 - System.Math.PI;
- double ct1, st1, m1, n1, dx1, dy1, x1, x2, y1, y2;
- ct1 = ihd2 * System.Math.Cos(stAng1);
- st1 = iwd2 * System.Math.Sin(stAng1);
- m1 = System.Math.Sqrt(ct1 * ct1 + st1 * st1); //"mod ct1 st1 0"
- n1 = iwd2 * ihd2 / m1;
- dx1 = n1 * System.Math.Cos(stAng1);
- dy1 = n1 * System.Math.Sin(stAng1);
- x1 = w / 2 + dx1;
- y1 = h / 2 + dy1;
- x2 = w / 2 - dx1;
- y2 = h / 2 - dy1;
- double stAng1deg = stAng1 * 180 / System.Math.PI;
- double stAng2deg = stAng2 * 180 / System.Math.PI;
- double swAng2deg = swAng * 180 / System.Math.PI;
- string d = "M" + 0 + "," + h / 2 +
- ShapeArc(w / 2, h / 2, w / 2, h / 2, 180, 270, false).Replace("M", "L") +
- ShapeArc(w / 2, h / 2, w / 2, h / 2, 270, 360, false).Replace("M", "L") +
- ShapeArc(w / 2, h / 2, w / 2, h / 2, 0, 90, false).Replace("M", "L") +
- ShapeArc(w / 2, h / 2, w / 2, h / 2, 90, 180, false).Replace("M", "L") +
- " z" +
- "M" + x1 + "," + y1 +
- ShapeArc(w / 2, h / 2, iwd2, ihd2, stAng1deg, (stAng1deg + swAng2deg), false).Replace("M", "L") +
- " z" +
- "M" + x2 + "," + y2 +
- ShapeArc(w / 2, h / 2, iwd2, ihd2, stAng2deg, (stAng2deg + swAng2deg), false).Replace("M", "L") +
- " z";
- //console.log("adj: ",adj,"x1:",x1,",y1:",y1," x2:",x2,",y2:",y2,",stAng1:",stAng1,",stAng1deg:",stAng1deg,",stAng2:",stAng2,",stAng2deg:",stAng2deg,",swAng:",swAng,",swAng2deg:",swAng2deg)
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 半闭框
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg HalfFrame(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 3.5;
- double sAdj2_val = 3.5;
- double cnsVal = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj2_val = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double minWH = System.Math.Min(w, h);
- double maxAdj2 = (cnsVal * w) / minWH;
- double a1, a2;
- if (sAdj2_val < 0) a2 = 0;
- else if (sAdj2_val > maxAdj2) a2 = maxAdj2;
- else a2 = sAdj2_val;
- double x1 = (minWH * a2) / cnsVal;
- double g1 = h * x1 / w;
- double g2 = h - g1;
- double maxAdj1 = (cnsVal * g2) / minWH;
- if (sAdj1_val < 0) a1 = 0;
- else if (sAdj1_val > maxAdj1) a1 = maxAdj1;
- else a1 = sAdj1_val;
- double y1 = minWH * a1 / cnsVal;
- double dx2 = y1 * w / h;
- double x2 = w - dx2;
- double dy2 = x1 * h / w;
- double y2 = h - dy2;
- string d = "M0,0" +
- " L" + w + "," + 0 +
- " L" + x2 + "," + y1 +
- " L" + x1 + "," + y1 +
- " L" + x1 + "," + y2 +
- " L0," + h + " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- //console.log("w: ",w,", h: ",h,", sAdj1_val: ",sAdj1_val,", sAdj2_val: ",sAdj2_val,",maxAdj1: ",maxAdj1,",maxAdj2: ",maxAdj2)
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 空心弧
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg BlockArc(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 180;
- double adj2 = 0;
- double adj3 = 25000 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) / 60000.00;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) / 60000.00;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double stAng, istAng, a3, sw11, sw12, swAng, iswAng;
- double cd1 = 360;
- if (adj1 < 0) stAng = 0;
- else if (adj1 > cd1) stAng = cd1;
- else stAng = adj1; //180
- if (adj2 < 0) istAng = 0;
- else if (adj2 > cd1) istAng = cd1;
- else istAng = adj2;//0
- if (adj3 < 0) a3 = 0;
- else if (adj3 > cnstVal1) a3 = cnstVal1;
- else a3 = adj3;
- sw11 = istAng - stAng; // -180
- sw12 = sw11 + cd1; //180
- swAng = (sw11 > 0) ? sw11 : sw12; //180
- iswAng = -swAng; //-180
- double endAng = stAng + swAng;
- double iendAng = istAng + iswAng;
- double wt1, ht1, dx1, dy1, x1, y1, stRd, istRd, wd2, hd2, hc, vc;
- stRd = stAng * (System.Math.PI) / 180;
- istRd = istAng * (System.Math.PI) / 180;
- wd2 = w / 2;
- hd2 = h / 2;
- hc = w / 2;
- vc = h / 2;
- if (stAng > 90 && stAng < 270)
- {
- wt1 = wd2 * (System.Math.Sin((System.Math.PI) / 2 - stRd));
- ht1 = hd2 * (System.Math.Cos((System.Math.PI) / 2 - stRd));
- dx1 = wd2 * (System.Math.Cos(System.Math.Atan(ht1 / wt1)));
- dy1 = hd2 * (System.Math.Sin(System.Math.Atan(ht1 / wt1)));
- x1 = hc - dx1;
- y1 = vc - dy1;
- }
- else
- {
- wt1 = wd2 * (System.Math.Sin(stRd));
- ht1 = hd2 * (System.Math.Cos(stRd));
- dx1 = wd2 * (System.Math.Cos(System.Math.Atan(wt1 / ht1)));
- dy1 = hd2 * (System.Math.Sin(System.Math.Atan(wt1 / ht1)));
- x1 = hc + dx1;
- y1 = vc + dy1;
- }
- double dr, iwd2, ihd2, wt2, ht2, dx2, dy2, x2, y2;
- dr = System.Math.Min(w, h) * a3 / cnstVal2;
- iwd2 = wd2 - dr;
- ihd2 = hd2 - dr;
- //console.log("stAng: ",stAng," swAng: ",swAng ," endAng:",endAng)
- if ((endAng <= 450 && endAng > 270) || ((endAng >= 630 && endAng < 720)))
- {
- wt2 = iwd2 * (System.Math.Sin(istRd));
- ht2 = ihd2 * (System.Math.Cos(istRd));
- dx2 = iwd2 * (System.Math.Cos(System.Math.Atan(wt2 / ht2)));
- dy2 = ihd2 * (System.Math.Sin(System.Math.Atan(wt2 / ht2)));
- x2 = hc + dx2;
- y2 = vc + dy2;
- }
- else
- {
- wt2 = iwd2 * (System.Math.Sin((System.Math.PI) / 2 - istRd));
- ht2 = ihd2 * (System.Math.Cos((System.Math.PI) / 2 - istRd));
- dx2 = iwd2 * (System.Math.Cos(System.Math.Atan(ht2 / wt2)));
- dy2 = ihd2 * (System.Math.Sin(System.Math.Atan(ht2 / wt2)));
- x2 = hc - dx2;
- y2 = vc - dy2;
- }
- string d = "M" + x1 + "," + y1 +
- ShapeArc(wd2, hd2, wd2, hd2, stAng, endAng, false).Replace("M", "L") +
- " L" + x2 + "," + y2 +
- ShapeArc(wd2, hd2, iwd2, ihd2, istAng, iendAng, false).Replace("M", "L") +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 双大括号
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg BracePair(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 8333 * px9d6 / px91d4400;
- double cnstVal1 = 25000 * px9d6 / px91d4400;
- double cnstVal2 = 50000 * px9d6 / px91d4400;
- double cnstVal3 = 100000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double vc = h / 2, cd = 360, cd2 = 180, cd4 = 90, c3d4 = 270, a, x1, x2, x3, x4, y2, y3, y4;
- if (adj < 0) a = 0;
- else if (adj > cnstVal1) a = cnstVal1;
- else a = adj;
- double minWH = System.Math.Min(w, h);
- x1 = minWH * a / cnstVal3;
- x2 = minWH * a / cnstVal2;
- x3 = w - x2;
- x4 = w - x1;
- y2 = vc - x1;
- y3 = vc + x1;
- y4 = h - x1;
- //console.log("w:",w," h:",h," x1:",x1," x2:",x2," x3:",x3," x4:",x4," y2:",y2," y3:",y3," y4:",y4)
- string d = "M" + x2 + "," + h +
- ShapeArc(x2, y4, x1, x1, cd4, cd2, false).Replace("M", "L") +
- " L" + x1 + "," + y3 +
- ShapeArc(0, y3, x1, x1, 0, (-cd4), false).Replace("M", "L") +
- ShapeArc(0, y2, x1, x1, cd4, 0, false).Replace("M", "L") +
- " L" + x1 + "," + x1 +
- ShapeArc(x2, x1, x1, x1, cd2, c3d4, false).Replace("M", "L") +
- " M" + x3 + "," + 0 +
- ShapeArc(x3, x1, x1, x1, c3d4, cd, false).Replace("M", "L") +
- " L" + x4 + "," + y2 +
- ShapeArc(w, y2, x1, x1, cd2, cd4, false).Replace("M", "L") +
- ShapeArc(w, y3, x1, x1, c3d4, cd2, false).Replace("M", "L") +
- " L" + x4 + "," + y4 +
- ShapeArc(x3, y4, x1, x1, 0, cd4, false).Replace("M", "L");
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg LeftBrace(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 8333 * px9d6 / px91d4400;
- double adj2 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, cd2 = 180, cd4 = 90, c3d4 = 270, a1, a2, q1, q2, q3, y1, y2, y3, y4;
- if (adj2 < 0) a2 = 0;
- else if (adj2 > cnstVal2) a2 = cnstVal2;
- else a2 = adj2;
- double minWH = System.Math.Min(w, h);
- q1 = cnstVal2 - a2;
- if (q1 < a2) q2 = q1;
- else q2 = a2;
- q3 = q2 / 2;
- double maxAdj1 = q3 * h / minWH;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > maxAdj1) a1 = maxAdj1;
- else a1 = adj1;
- y1 = minWH * a1 / cnstVal2;
- y3 = h * a2 / cnstVal2;
- y2 = y3 - y1;
- y4 = y3 + y1;
- //console.log("w:",w," h:",h," q1:",q1," q2:",q2," q3:",q3," y1:",y1," y3:",y3," y4:",y4," maxAdj1:",maxAdj1)
- string d = "M" + w + "," + h +
- ShapeArc(w, h - y1, w / 2, y1, cd4, cd2, false).Replace("M", "L") +
- " L" + w / 2 + "," + y4 +
- ShapeArc(0, y4, w / 2, y1, 0, (-cd4), false).Replace("M", "L") +
- ShapeArc(0, y2, w / 2, y1, cd4, 0, false).Replace("M", "L") +
- " L" + w / 2 + "," + y1 +
- ShapeArc(w, y1, w / 2, y1, cd2, c3d4, false).Replace("M", "L");
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg RightBrace(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 8333 * px9d6 / px91d4400;
- double adj2 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Equals("adj1"))
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Equals("adj2"))
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, cd = 360, cd2 = 180, cd4 = 90, c3d4 = 270, a1, a2, q1, q2, q3, y1, y2, y3, y4;
- if (adj2 < 0) a2 = 0;
- else if (adj2 > cnstVal2) a2 = cnstVal2;
- else a2 = adj2;
- double minWH = System.Math.Min(w, h);
- q1 = cnstVal2 - a2;
- if (q1 < a2) q2 = q1;
- else q2 = a2;
- q3 = q2 / 2;
- double maxAdj1 = q3 * h / minWH;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > maxAdj1) a1 = maxAdj1;
- else a1 = adj1;
- y1 = minWH * a1 / cnstVal2;
- y3 = h * a2 / cnstVal2;
- y2 = y3 - y1;
- y4 = h - y1;
- //console.log("w:",w," h:",h," q1:",q1," q2:",q2," q3:",q3," y1:",y1," y2:",y2," y3:",y3," y4:",y4," maxAdj1:",maxAdj1)
- string d = "M" + 0 + "," + 0 +
- ShapeArc(0, y1, w / 2, y1, c3d4, cd, false).Replace("M", "L") +
- " L" + w / 2 + "," + y2 +
- ShapeArc(w, y2, w / 2, y1, cd2, cd4, false).Replace("M", "L") +
- ShapeArc(w, y3 + y1, w / 2, y1, c3d4, cd2, false).Replace("M", "L") +
- " L" + w / 2 + "," + y4 +
- ShapeArc(0, y4, w / 2, y1, 0, cd4, false).Replace("M", "L");
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg BracketPair(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 16667 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double r = w, b = h, cd2 = 180, cd4 = 90, c3d4 = 270, a, x1, x2, y2;
- if (adj < 0) a = 0;
- else if (adj > cnstVal1) a = cnstVal1;
- else a = adj;
- x1 = System.Math.Min(w, h) * a / cnstVal2;
- x2 = r - x1;
- y2 = b - x1;
- //console.log("w:",w," h:",h," x1:",x1," x2:",x2," y2:",y2)
- string d = ShapeArc(x1, x1, x1, x1, c3d4, cd2, false) +
- ShapeArc(x1, y2, x1, x1, cd2, cd4, false).Replace("M", "L") +
- ShapeArc(x2, x1, x1, x1, c3d4, (c3d4 + cd4), false) +
- ShapeArc(x2, y2, x1, x1, 0, cd4, false).Replace("M", "L");
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 左中括号
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg LeftBracket(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 8333 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double maxAdj = cnstVal1 * h / System.Math.Min(w, h);
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double r = w, b = h, cd2 = 180, cd4 = 90, c3d4 = 270, a, y1, y2;
- if (adj < 0) a = 0;
- else if (adj > maxAdj) a = maxAdj;
- else a = adj;
- y1 = System.Math.Min(w, h) * a / cnstVal2;
- if (y1 > w) y1 = w;
- y2 = b - y1;
- string d = "M" + r + "," + b +
- ShapeArc(y1, y2, y1, y1, cd4, cd2, false).Replace("M", "L") +
- " L" + 0 + "," + y1 +
- ShapeArc(y1, y1, y1, y1, cd2, c3d4, false).Replace("M", "L") +
- " L" + r + "," + 0;
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 右中括号
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg RightBracket(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 8333 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double maxAdj = cnstVal1 * h / System.Math.Min(w, h);
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double cd = 360, cd2 = 180, cd4 = 90, c3d4 = 270, a, y1, y2, y3;
- if (adj < 0) a = 0;
- else if (adj > maxAdj) a = maxAdj;
- else a = adj;
- y1 = System.Math.Min(w, h) * a / cnstVal2;
- y2 = h - y1;
- y3 = w - y1;
- //console.log("w:",w," h:",h," y1:",y1," y2:",y2," y3:",y3)
- string d = "M" + 0 + "," + h +
- ShapeArc(y3, y2, y1, y1, cd4, 0, false).Replace("M", "L") +
- //" L"+ r + "," + y2 +
- " L" + w + "," + h / 2 +
- ShapeArc(y3, y1, y1, y1, cd, c3d4, false).Replace("M", "L") +
- " L" + 0 + "," + 0;
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg Moon(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 0.5;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) / 100000.00;//*96/px91d4400;;
- }
- double hd2, cd2, cd4;
- hd2 = h / 2;
- cd2 = 180;
- cd4 = 90;
- double adj2 = (1 - adj) * w;
- string d = "M" + w + "," + h +
- ShapeArc(w, hd2, w, hd2, cd4, (cd4 + cd2), false).Replace("M", "L") +
- ShapeArc(w, hd2, adj2, hd2, (cd4 + cd2), cd4, false).Replace("M", "L") +
- " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// L形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Corner(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- //string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 50000 * px9d6 / px91d4400;
- double sAdj2_val = 50000 * px9d6 / px91d4400;
- double cnsVal = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj2_val = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double minWH = System.Math.Min(w, h);
- double maxAdj1 = cnsVal * h / minWH;
- double maxAdj2 = cnsVal * w / minWH;
- double a1, a2, x1, dy1, y1;
- if (sAdj1_val < 0) a1 = 0;
- else if (sAdj1_val > maxAdj1) a1 = maxAdj1;
- else a1 = sAdj1_val;
- if (sAdj2_val < 0) a2 = 0;
- else if (sAdj2_val > maxAdj2) a2 = maxAdj2;
- else a2 = sAdj2_val;
- x1 = minWH * a2 / cnsVal;
- dy1 = minWH * a1 / cnsVal;
- y1 = h - dy1;
- string d = "M0,0" +
- " L" + x1 + "," + 0 +
- " L" + x1 + "," + y1 +
- " L" + w + "," + y1 +
- " L" + w + "," + h +
- " L0," + h + " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 斜纹
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg DiagStripe(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double sAdj1_val = 50000 * px9d6 / px91d4400;
- double cnsVal = 100000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- sAdj1_val = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double a1, x2, y2;
- if (sAdj1_val < 0) a1 = 0;
- else if (sAdj1_val > cnsVal) a1 = cnsVal;
- else a1 = sAdj1_val;
- x2 = w * a1 / cnsVal;
- y2 = h * a1 / cnsVal;
- string d = "M" + 0 + "," + y2 +
- " L" + x2 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + 0 + "," + h + " z";
- // result += "<path d='" + d + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg Gear6(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- var gearNum = shapType.Substring(4);
- string d;
- if (gearNum == "6")
- {
- d = ShapeGear(w, h / 3.5, double.Parse(gearNum));
- }
- else
- { //gearNum=="9"
- d = ShapeGear(w, h / 3.5, double.Parse(gearNum));
- }
- // result += "<path d='" + d + "' transform='rotate(20," + (3 / 7.00) * h + "," + (3 / 7.00) * h + ")' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- // Fill = (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d,
- transform="rotate(20," + (3 / 7.00) * h + "," + (3 / 7.00) * h + ")"
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg Gear9(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Gear6(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 连接符:肘形 没有显示
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="isFlipV"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <param name="headEndNodeAttrs"></param>
- /// <param name="tailEndNodeAttrs"></param>
- /// <returns></returns>
- private static Svg BentConnector3(XmlNode node, string shapType, double w, double h, int isFlipV, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- var shapAdjst_val = 0.5;
- string points = "";
- // string MarkerStart = "";
- // string MarkerEnd = "";
- if (shapAdjst != null)
- {
- shapAdjst_val = double.Parse(shapAdjst.Value.Substring(4)) / 100000.00;
- if (isFlipV == 1)
- {
- // / result += " <polyline points='" + w + " 0," + ((1 - shapAdjst_val) * w) + " 0," + ((1 - shapAdjst_val) * w) + " " + h + ",0 " + h + "' fill='transparent'" +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' ";
- points = w + " 0," + ((1 - shapAdjst_val) * w) + " 0," + ((1 - shapAdjst_val) * w) + " " + h + ",0 " + h;
- }
- else
- {
- // result += " <polyline points='0 0," + (shapAdjst_val) * w + " 0," + (shapAdjst_val) * w + " " + h + "," + w + " " + h + "' fill='transparent'" +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' ";
- points = "0 0," + (shapAdjst_val) * w + " 0," + (shapAdjst_val) * w + " " + h + "," + w + " " + h;
- }
- // if (headEndNodeAttrs != null && (headEndNodeAttrs.GetTextByPath("@type").Value == "triangle" || headEndNodeAttrs.GetTextByPath("@type").Value == "arrow"))
- // {
- // result += "marker-start='url(#markerTriangle_" + shpId + ")' ";
- // MarkerStart = "url(#markerTriangle_" + shpId + ")";
- // }
- //if (tailEndNodeAttrs != null && (tailEndNodeAttrs.GetTextByPath("@type").Value == "triangle" || tailEndNodeAttrs.GetTextByPath("@type").Value == "arrow"))
- // {
- // result += "marker-end='url(#markerTriangle_" + shpId + ")' ";
- // MarkerEnd = "url(#markerTriangle_" + shpId + ")";
- // }
- // result += "/>";
- }
- List<SvgShape> shapes = new List<SvgShape>() {new Polyline {
- type = "polyline",
- //Fill = "transparent",
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points=points,
- start=headEndNodeAttrs!=null&&headEndNodeAttrs.GetTextByPath("@type")!=null?headEndNodeAttrs.GetTextByPath("@type").Value:null,
- end=tailEndNodeAttrs!=null&&tailEndNodeAttrs.GetTextByPath("@type")!=null?tailEndNodeAttrs.GetTextByPath("@type").Value:null,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 十字形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Plus(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj1 = 0.25;
- if (shapAdjst != null)
- {
- adj1 = double.Parse(shapAdjst.Value.Substring(4)) / 100000.00;
- }
- double adj2 = (1 - adj1);
- // result += " <polygon points='" + adj1 * w + " 0," + adj1 * w + " " + adj1 * h + ",0 " + adj1 * h + ",0 " + adj2 * h + "," +
- // adj1 * w + " " + adj2 * h + "," + adj1 * w + " " + h + "," + adj2 * w + " " + h + "," + adj2 * w + " " + adj2 * h + "," + w + " " + adj2 * h + "," +
- // +w + " " + adj1 * h + "," + adj2 * w + " " + adj1 * h + "," + adj2 * w + " 0' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points=adj1 * w + " 0," + adj1 * w + " " + adj1 * h + ",0 " + adj1 * h + ",0 " + adj2 * h + "," +
- adj1 * w + " " + adj2 * h + "," + adj1 * w + " " + h + "," + adj2 * w + " " + h + "," + adj2 * w + " " + adj2 * h + "," + w + " " + adj2 * h + "," +
- +w + " " + adj1 * h + "," + adj2 * w + " " + adj1 * h + "," + adj2 * w + " 0",
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg Teardrop(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj1 = 100000 * px9d6 / px91d4400;
- double cnsVal1 = adj1;
- double cnsVal2 = 200000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- adj1 = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double a1, r2, tw, th, sw, sh, dx1, dy1, x1, y1, x2, y2, rd45;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > cnsVal2) a1 = cnsVal2;
- else a1 = adj1;
- r2 = System.Math.Sqrt(2);
- tw = r2 * (w / 2);
- th = r2 * (h / 2);
- sw = (tw * a1) / cnsVal1;
- sh = (th * a1) / cnsVal1;
- rd45 = (45 * (System.Math.PI) / 180);
- dx1 = sw * (System.Math.Cos(rd45));
- dy1 = sh * (System.Math.Cos(rd45));
- x1 = (w / 2) + dx1;
- y1 = (h / 2) - dy1;
- x2 = ((w / 2) + x1) / 2;
- y2 = ((h / 2) + y1) / 2;
- string d_val = ShapeArc(w / 2, h / 2, w / 2, h / 2, 180, 270, false) +
- "Q " + x2 + ",0 " + x1 + "," + y1 +
- "Q " + w + "," + y2 + " " + w + "," + h / 2 +
- ShapeArc(w / 2, h / 2, w / 2, h / 2, 0, 90, false).Replace("M", "L") +
- ShapeArc(w / 2, h / 2, w / 2, h / 2, 90, 180, false).Replace("M", "L") + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- // console.log("shapAdjst: ",shapAdjst,", adj1: ",adj1);
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 缺角矩形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Plaque(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj1 = 16667 * px9d6 / px91d4400;
- double cnsVal1 = 50000 * px9d6 / px91d4400;
- double cnsVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- adj1 = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double a1, x1, x2, y2;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > cnsVal1) a1 = cnsVal1;
- else a1 = adj1;
- x1 = System.Math.Round(a1 * (System.Math.Min(w, h)) / cnsVal2, degree);
- x2 = System.Math.Round(w - x1, degree);
- y2 = System.Math.Round(h - x1, degree);
- string d_val = "M0," + x1 +
- ShapeArc(0, 0, x1, x1, 90, 0, false).Replace("M", "L") +
- " L" + x2 + "," + 0 +
- ShapeArc(w, 0, x1, x1, 180, 90, false).Replace("M", "L") +
- " L" + w + "," + y2 +
- ShapeArc(w, h, x1, x1, 270, 180, false).Replace("M", "L") +
- " L" + x1 + "," + h +
- ShapeArc(0, h, x1, x1, 0, -90, false).Replace("M", "L") + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 太阳形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Sun(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double refr = px9d6 / px91d4400;
- double adj1 = 25000 * refr;
- double cnstVal1 = 12500 * refr;
- double cnstVal2 = 46875 * refr;
- if (shapAdjst != null)
- {
- adj1 = double.Parse(shapAdjst.Value.Substring(4)) * refr;
- }
- double a1;
- if (adj1 < cnstVal1) a1 = cnstVal1;
- else if (adj1 > cnstVal2) a1 = cnstVal2;
- else a1 = adj1;
- double cnstVa3 = 50000 * refr;
- double cnstVa4 = 100000 * refr;
- double g0 = cnstVa3 - a1,
- g1 = g0 * (30274 * refr) / (32768 * refr),
- g2 = g0 * (12540 * refr) / (32768 * refr),
- g3 = g1 + cnstVa3,
- g4 = g2 + cnstVa3,
- g5 = cnstVa3 - g1,
- g6 = cnstVa3 - g2,
- g7 = g0 * (23170 * refr) / (32768 * refr),
- g8 = cnstVa3 + g7,
- g9 = cnstVa3 - g7,
- g10 = g5 * 3 / 4,
- g11 = g6 * 3 / 4,
- g12 = g10 + 3662 * refr,
- g13 = g11 + 36620 * refr,
- g14 = g11 + 12500 * refr,
- g15 = cnstVa4 - g10,
- g16 = cnstVa4 - g12,
- g17 = cnstVa4 - g13,
- g18 = cnstVa4 - g14,
- ox1 = w * (18436 * refr) / (21600 * refr),
- oy1 = h * (3163 * refr) / (21600 * refr),
- ox2 = w * (3163 * refr) / (21600 * refr),
- oy2 = h * (18436 * refr) / (21600 * refr),
- x8 = w * g8 / cnstVa4,
- x9 = w * g9 / cnstVa4,
- x10 = w * g10 / cnstVa4,
- x12 = w * g12 / cnstVa4,
- x13 = w * g13 / cnstVa4,
- x14 = w * g14 / cnstVa4,
- x15 = w * g15 / cnstVa4,
- x16 = w * g16 / cnstVa4,
- x17 = w * g17 / cnstVa4,
- x18 = w * g18 / cnstVa4,
- x19 = w * a1 / cnstVa4,
- wR = w * g0 / cnstVa4,
- hR = h * g0 / cnstVa4,
- y8 = h * g8 / cnstVa4,
- y9 = h * g9 / cnstVa4,
- y10 = h * g10 / cnstVa4,
- y12 = h * g12 / cnstVa4,
- y13 = h * g13 / cnstVa4,
- y14 = h * g14 / cnstVa4,
- y15 = h * g15 / cnstVa4,
- y16 = h * g16 / cnstVa4,
- y17 = h * g17 / cnstVa4,
- y18 = h * g18 / cnstVa4;
- string d_val = "M" + w + "," + h / 2 +
- " L" + x15 + "," + y18 +
- " L" + x15 + "," + y14 +
- "z" +
- " M" + ox1 + "," + oy1 +
- " L" + x16 + "," + y17 +
- " L" + x13 + "," + y12 +
- "z" +
- " M" + w / 2 + "," + 0 +
- " L" + x18 + "," + y10 +
- " L" + x14 + "," + y10 +
- "z" +
- " M" + ox2 + "," + oy1 +
- " L" + x17 + "," + y12 +
- " L" + x12 + "," + y17 +
- "z" +
- " M" + 0 + "," + h / 2 +
- " L" + x10 + "," + y14 +
- " L" + x10 + "," + y18 +
- "z" +
- " M" + ox2 + "," + oy2 +
- " L" + x12 + "," + y13 +
- " L" + x17 + "," + y16 +
- "z" +
- " M" + w / 2 + "," + h +
- " L" + x14 + "," + y15 +
- " L" + x18 + "," + y15 +
- "z" +
- " M" + ox1 + "," + oy2 +
- " L" + x13 + "," + y16 +
- " L" + x16 + "," + y13 +
- " z" +
- " M" + x19 + "," + h / 2 +
- ShapeArc(w / 2, h / 2, wR, hR, 180, 540, false).Replace("M", "L") +
- " z";
- //console.log("adj1: ",adj1,d_val);
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg Heart(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double dx1, dx2, x1, x2, x3, x4, y1;
- dx1 = w * 49 / 48;
- dx2 = w * 10 / 48;
- x1 = w / 2 - dx1;
- x2 = w / 2 - dx2;
- x3 = w / 2 + dx2;
- x4 = w / 2 + dx1;
- y1 = -h / 3;
- string d_val = "M" + w / 2 + "," + h / 4 +
- "C" + x3 + "," + y1 + " " + x4 + "," + h / 4 + " " + w / 2 + "," + h +
- "C" + x1 + "," + h / 4 + " " + x2 + "," + y1 + " " + w / 2 + "," + h / 4 + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 闪电形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg LightningBolt(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double x1 = w * 5022 / 21600.00,
- x2 = w * 11050 / 21600.00,
- x3 = w * 8472 / 21600.00,
- x4 = w * 8757 / 21600.00,
- x5 = w * 10012 / 21600.00,
- x6 = w * 14767 / 21600.00,
- x7 = w * 12222 / 21600.00,
- x8 = w * 12860 / 21600.00,
- x9 = w * 13917 / 21600.00,
- x10 = w * 7602 / 21600.00,
- x11 = w * 16577 / 21600.00,
- y1 = h * 3890 / 21600.00,
- y2 = h * 6080 / 21600.00,
- y3 = h * 6797 / 21600.00,
- y4 = h * 7437 / 21600.00,
- y5 = h * 12877 / 21600.00,
- y6 = h * 9705 / 21600.00,
- y7 = h * 12007 / 21600.00,
- y8 = h * 13987 / 21600.00,
- y9 = h * 8382 / 21600.00,
- y10 = h * 14277 / 21600.00,
- y11 = h * 14915 / 21600.00;
- string d_val = "M" + x3 + "," + 0 +
- " L" + x8 + "," + y2 +
- " L" + x2 + "," + y3 +
- " L" + x11 + "," + y7 +
- " L" + x6 + "," + y5 +
- " L" + w + "," + h +
- " L" + x5 + "," + y11 +
- " L" + x7 + "," + y8 +
- " L" + x1 + "," + y6 +
- " L" + x10 + "," + y9 +
- " L" + 0 + "," + y1 + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 立方体
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Cube(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double refr = px9d6 / px91d4400;
- double adj = 25000 * refr;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * refr;
- }
- string d_val = "";
- double cnstVal2 = 100000 * refr;
- double ss = System.Math.Min(w, h);
- double a, y1, y4, x4;
- a = (adj < 0) ? 0 : (adj > cnstVal2) ? cnstVal2 : adj;
- y1 = ss * a / cnstVal2;
- y4 = h - y1;
- x4 = w - y1;
- d_val = "M" + 0 + "," + y1 +
- " L" + y1 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + y4 +
- " L" + x4 + "," + h +
- " L" + 0 + "," + h +
- " z" +
- "M" + 0 + "," + y1 +
- " L" + x4 + "," + y1 +
- " M" + x4 + "," + y1 +
- " L" + w + "," + 0 +
- "M" + x4 + "," + y1 +
- " L" + x4 + "," + h;
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 矩形:棱台
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Bevel(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double refr = px9d6 / px91d4400;
- double adj = 12500 * refr;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * refr;
- }
- string d_val = "";
- double cnstVal1 = 50000 * refr;
- double cnstVal2 = 100000 * refr;
- double ss = System.Math.Min(w, h);
- double a, x1, x2, y2;
- a = (adj < 0) ? 0 : (adj > cnstVal1) ? cnstVal1 : adj;
- x1 = ss * a / cnstVal2;
- x2 = w - x1;
- y2 = h - x1;
- d_val = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- " M" + x1 + "," + x1 +
- " L" + x2 + "," + x1 +
- " L" + x2 + "," + y2 +
- " L" + x1 + "," + y2 +
- " z" +
- " M" + 0 + "," + 0 +
- " L" + x1 + "," + x1 +
- " M" + 0 + "," + h +
- " L" + x1 + "," + y2 +
- " M" + w + "," + 0 +
- " L" + x2 + "," + x1 +
- " M" + w + "," + h +
- " L" + x2 + "," + y2;
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 折角矩形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FoldedCorner(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double refr = px9d6 / px91d4400;
- double adj = 16667 * refr;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * refr;
- }
- string d_val = "";
- double cnstVal1 = 50000 * refr;
- double cnstVal2 = 100000 * refr;
- double ss = System.Math.Min(w, h);
- double a, dy2, dy1, x1, x2, y2, y1;
- a = (adj < 0) ? 0 : (adj > cnstVal1) ? cnstVal1 : adj;
- dy2 = ss * a / cnstVal2;
- dy1 = dy2 / 5;
- x1 = w - dy2;
- x2 = x1 + dy1;
- y2 = h - dy2;
- y1 = y2 + dy1;
- d_val = "M" + x1 + "," + h +
- " L" + x2 + "," + y1 +
- " L" + w + "," + y2 +
- " L" + x1 + "," + h +
- " L" + 0 + "," + h +
- " L" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + y2;
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 云形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Cloud(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- double x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11,
- rx1, rx2, rx3, rx4, rx5, rx6, rx7, rx8, rx9, rx10, rx11, ry1, ry2, ry3, ry4, ry5, ry6, ry7, ry8, ry9, ry10, ry11;
- x0 = w * 3900 / 43200; ;
- x1 = w * 4693 / 43200;
- x2 = w * 6928 / 43200;
- x3 = w * 16478 / 43200;
- x4 = w * 28827 / 43200;
- x5 = w * 34129 / 43200;
- x6 = w * 41798 / 43200;
- x7 = w * 38324 / 43200;
- x8 = w * 29078 / 43200;
- x9 = w * 22141 / 43200;
- x10 = w * 14000 / 43200;
- x11 = w * 4127 / 43200;
- y0 = h * 14370 / 43200;
- y1 = h * 26177 / 43200;
- y2 = h * 34899 / 43200;
- y3 = h * 39090 / 43200;
- y4 = h * 34751 / 43200;
- y5 = h * 22954 / 43200;
- y6 = h * 15354 / 43200;
- y7 = h * 5426 / 43200;
- y8 = h * 3952 / 43200;
- y9 = h * 4720 / 43200;
- y10 = h * 5192 / 43200;
- y11 = h * 15789 / 43200;
- //Path:
- //(path attrs: w = 43200; h = 43200; )
- double rX1 = w * 6753 / 43200.00, rY1 = h * 9190 / 43200.00, rX2 = w * 5333 / 43200.00, rY2 = h * 7267 / 43200.00, rX3 = w * 4365 / 43200.00,
- rY3 = h * 5945 / 43200.00, rX4 = w * 4857 / 43200.00, rY4 = h * 6595 / 43200.00, rY5 = h * 7273 / 43200.00, rX6 = w * 6775 / 43200.00,
- rY6 = h * 9220 / 43200.00, rX7 = w * 5785 / 43200.00, rY7 = h * 7867 / 43200.00, rX8 = w * 6752 / 43200.00, rY8 = h * 9215 / 43200.00,
- rX9 = w * 7720 / 43200.00, rY9 = h * 10543 / 43200.00, rX10 = w * 4360.00 / 43200.00, rY10 = h * 5918 / 43200.00, rX11 = w * 4345 / 43200;
- double sA1 = -11429249 / 60000.00, wA1 = 7426832 / 60000.00, sA2 = -8646143 / 60000.00, wA2 = 5396714 / 60000.00, sA3 = -8748475 / 60000.00,
- wA3 = 5983381 / 60000.00, sA4 = -7859164 / 60000.00, wA4 = 7034504 / 60000.00, sA5 = -4722533 / 60000.00, wA5 = 6541615 / 60000.00,
- sA6 = -2776035 / 60000.00, wA6 = 7816140 / 60000.00, sA7 = 37501 / 60000.00, wA7 = 6842000 / 60000.00, sA8 = 1347096 / 60000.00,
- wA8 = 6910353 / 60000.00, sA9 = 3974558 / 60000.00, wA9 = 4542661 / 60000.00, sA10 = -16496525 / 60000.00, wA10 = 8804134 / 60000.00,
- sA11 = -14809710 / 60000.00, wA11 = 9151131 / 60000.00;
- double cX0, cX1, cX2, cX3, cX4, cX5, cX6, cX7, cX8, cX9, cX10, cY0, cY1, cY2, cY3, cY4, cY5, cY6, cY7, cY8, cY9, cY10;
- string arc1, arc2, arc3, arc4, arc5, arc6, arc7, arc8, arc9, arc10, arc11;
- string[] lxy1, lxy2, lxy3, lxy4, lxy5, lxy6, lxy7, lxy8, lxy9, lxy10;
- cX0 = x0 - rX1 * System.Math.Cos(sA1 * System.Math.PI / 180);
- cY0 = y0 - rY1 * System.Math.Sin(sA1 * System.Math.PI / 180);
- arc1 = ShapeArc(cX0, cY0, rX1, rY1, sA1, sA1 + wA1, false).Replace("M", "L");
- lxy1 = arc1.Substring(arc1.LastIndexOf("L") + 1).Split(" ");
- cX1 = double.Parse(lxy1[0]) - rX2 * System.Math.Cos(sA2 * System.Math.PI / 180);
- cY1 = double.Parse(lxy1[1]) - rY2 * System.Math.Sin(sA2 * System.Math.PI / 180);
- arc2 = ShapeArc(cX1, cY1, rX2, rY2, sA2, sA2 + wA2, false).Replace("M", "L");
- lxy2 = arc2.Substring(arc2.LastIndexOf("L") + 1).Split(" ");
- cX2 = double.Parse(lxy2[0]) - rX3 * System.Math.Cos(sA3 * System.Math.PI / 180);
- cY2 = double.Parse(lxy2[1]) - rY3 * System.Math.Sin(sA3 * System.Math.PI / 180);
- arc3 = ShapeArc(cX2, cY2, rX3, rY3, sA3, sA3 + wA3, false).Replace("M", "L");
- lxy3 = arc3.Substring(arc3.LastIndexOf("L") + 1).Split(" ");
- cX3 = double.Parse(lxy3[0]) - rX4 * System.Math.Cos(sA4 * System.Math.PI / 180);
- cY3 = double.Parse(lxy3[1]) - rY4 * System.Math.Sin(sA4 * System.Math.PI / 180);
- arc4 = ShapeArc(cX3, cY3, rX4, rY4, sA4, sA4 + wA4, false).Replace("M", "L");
- lxy4 = arc4.Substring(arc4.LastIndexOf("L") + 1).Split(" ");
- cX4 = double.Parse(lxy4[0]) - rX2 * System.Math.Cos(sA5 * System.Math.PI / 180);
- cY4 = double.Parse(lxy4[1]) - rY5 * System.Math.Sin(sA5 * System.Math.PI / 180);
- arc5 = ShapeArc(cX4, cY4, rX2, rY5, sA5, sA5 + wA5, false).Replace("M", "L");
- lxy5 = arc5.Substring(arc5.LastIndexOf("L") + 1).Split(" ");
- cX5 = double.Parse(lxy5[0]) - rX6 * System.Math.Cos(sA6 * System.Math.PI / 180);
- cY5 = double.Parse(lxy5[1]) - rY6 * System.Math.Sin(sA6 * System.Math.PI / 180);
- arc6 = ShapeArc(cX5, cY5, rX6, rY6, sA6, sA6 + wA6, false).Replace("M", "L");
- lxy6 = arc6.Substring(arc6.LastIndexOf("L") + 1).Split(" ");
- cX6 = double.Parse(lxy6[0]) - rX7 * System.Math.Cos(sA7 * System.Math.PI / 180);
- cY6 = double.Parse(lxy6[1]) - rY7 * System.Math.Sin(sA7 * System.Math.PI / 180);
- arc7 = ShapeArc(cX6, cY6, rX7, rY7, sA7, sA7 + wA7, false).Replace("M", "L");
- lxy7 = arc7.Substring(arc7.LastIndexOf("L") + 1).Split(" ");
- cX7 = double.Parse(lxy7[0]) - rX8 * System.Math.Cos(sA8 * System.Math.PI / 180);
- cY7 = double.Parse(lxy7[1]) - rY8 * System.Math.Sin(sA8 * System.Math.PI / 180);
- arc8 = ShapeArc(cX7, cY7, rX8, rY8, sA8, sA8 + wA8, false).Replace("M", "L");
- lxy8 = arc8.Substring(arc8.LastIndexOf("L") + 1).Split(" ");
- cX8 = double.Parse(lxy8[0]) - rX9 * System.Math.Cos(sA9 * System.Math.PI / 180);
- cY8 = double.Parse(lxy8[1]) - rY9 * System.Math.Sin(sA9 * System.Math.PI / 180);
- arc9 = ShapeArc(cX8, cY8, rX9, rY9, sA9, sA9 + wA9, false).Replace("M", "L");
- lxy9 = arc9.Substring(arc9.LastIndexOf("L") + 1).Split(" ");
- cX9 = double.Parse(lxy9[0]) - rX10 * System.Math.Cos(sA10 * System.Math.PI / 180);
- cY9 = double.Parse(lxy9[1]) - rY10 * System.Math.Sin(sA10 * System.Math.PI / 180);
- arc10 = ShapeArc(cX9, cY9, rX10, rY10, sA10, sA10 + wA10, false).Replace("M", "L");
- lxy10 = arc10.Substring(arc10.LastIndexOf("L") + 1).Split(" ");
- cX10 = double.Parse(lxy10[0]) - rX11 * System.Math.Cos(sA11 * System.Math.PI / 180);
- cY10 = double.Parse(lxy10[1]) - rY3 * System.Math.Sin(sA11 * System.Math.PI / 180);
- arc11 = ShapeArc(cX10, cY10, rX11, rY3, sA11, sA11 + wA11, false).Replace("M", "L");
- string d1 = "M" + x0 + "," + y0 +
- arc1 +
- arc2 +
- arc3 +
- arc4 +
- arc5 +
- arc6 +
- arc7 +
- arc8 +
- arc9 +
- arc10 +
- arc11 +
- " z";
- if (shapType == "cloudCallout")
- {
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double refr = px9d6 / px91d4400;
- double adj1 = -20833 * refr;
- double adj2 = 62500 * refr;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * refr;
- }
- }
- }
- string d_val = "";
- double cnstVal2 = 100000 * refr;
- double ss = System.Math.Min(w, h);
- double wd2 = w / 2, hd2 = h / 2;
- double dxPos, dyPos, xPos, yPos, ht, wt, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11, g12, g13, g14, g15, g16,
- g17, g18, g19, g20, g21, g22, g23, g24, g25, g26, x23, x24, x25;
- dxPos = w * adj1 / cnstVal2;
- dyPos = h * adj2 / cnstVal2;
- xPos = wd2 + dxPos;
- yPos = hd2 + dyPos;
- ht = hd2 * System.Math.Cos(System.Math.Atan(dyPos / dxPos));
- wt = wd2 * System.Math.Sin(System.Math.Atan(dyPos / dxPos));
- g2 = wd2 * System.Math.Cos(System.Math.Atan(wt / ht));
- g3 = hd2 * System.Math.Sin(System.Math.Atan(wt / ht));
- //console.log("adj1: ",adj1,"adj2: ",adj2)
- if (adj1 >= 0)
- {
- g4 = wd2 + g2;
- g5 = hd2 + g3;
- }
- else
- {
- g4 = wd2 - g2;
- g5 = hd2 - g3;
- }
- g6 = g4 - xPos;
- g7 = g5 - yPos;
- g8 = System.Math.Sqrt(g6 * g6 + g7 * g7);
- g9 = ss * 6600 / 21600.00;
- g10 = g8 - g9;
- g11 = g10 / 3;
- g12 = ss * 1800 / 21600.00;
- g13 = g11 + g12;
- g14 = g13 * g6 / g8;
- g15 = g13 * g7 / g8;
- g16 = g14 + xPos;
- g17 = g15 + yPos;
- g18 = ss * 4800 / 21600.00;
- g19 = g11 * 2;
- g20 = g18 + g19;
- g21 = g20 * g6 / g8;
- g22 = g20 * g7 / g8;
- g23 = g21 + xPos;
- g24 = g22 + yPos;
- g25 = ss * 1200 / 21600.00;
- g26 = ss * 600 / 21600.00;
- x23 = xPos + g26;
- x24 = g16 + g25;
- x25 = g23 + g12;
- d_val = //" M" + x23 + "," + yPos +
- ShapeArc(x23 - g26, yPos, g26, g26, 0, 360, false) + //.Replace("M","L") +
- " z" +
- " M" + x24 + "," + g17 +
- ShapeArc(x24 - g25, g17, g25, g25, 0, 360, false).Replace("M", "L") +
- " z" +
- " M" + x25 + "," + g24 +
- ShapeArc(x25 - g12, g24, g12, g12, 0, 360, false).Replace("M", "L") +
- " z";
- d1 += d_val;
- }
- // result += "<path d='" + d1 + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d1,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 思想气泡:云
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg CloudCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Cloud(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 笑脸
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg SmileyFace(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double refr = px9d6 / px91d4400;
- double adj = 4653 * refr;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * refr;
- }
- string d_val = "";
- double cnstVal1 = 50000 * refr;
- double cnstVal2 = 100000 * refr;
- double cnstVal3 = 4653 * refr;
- double ss = System.Math.Min(w, h);
- double a, x1, x2, x3, x4, y1, y3, dy2, y2, y4, dy3, y5, wR, hR, wd2, hd2;
- wd2 = w / 2;
- hd2 = h / 2;
- a = (adj < -cnstVal3) ? -cnstVal3 : (adj > cnstVal3) ? cnstVal3 : adj;
- x1 = w * 4969 / 21699;
- x2 = w * 6215 / 21600.00;
- x3 = w * 13135 / 21600.00;
- x4 = w * 16640 / 21600.00;
- y1 = h * 7570 / 21600.00;
- y3 = h * 16515 / 21600.00;
- dy2 = h * a / cnstVal2;
- y2 = y3 - dy2;
- y4 = y3 + dy2;
- dy3 = h * a / cnstVal1;
- y5 = y4 + dy3;
- wR = w * 1125 / 21600.00;
- hR = h * 1125 / 21600.00;
- double cX1 = x2 - wR * System.Math.Cos(System.Math.PI);
- double cY1 = y1 - hR * System.Math.Sin(System.Math.PI);
- double cX2 = x3 - wR * System.Math.Cos(System.Math.PI);
- d_val = //eyes
- ShapeArc(cX1, cY1, wR, hR, 180, 540, false) +
- ShapeArc(cX2, cY1, wR, hR, 180, 540, false) +
- //mouth
- " M" + x1 + "," + y2 +
- " Q" + wd2 + "," + y5 + " " + x4 + "," + y2 +
- " Q" + wd2 + "," + y5 + " " + x1 + "," + y2 +
- //head
- " M" + 0 + "," + hd2 +
- ShapeArc(wd2, hd2, wd2, hd2, 180, 540, false).Replace("M", "L") +
- " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 卷形:垂直
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg VerticalScroll(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- //string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double refr = px9d6 / px91d4400;
- double adj = 12500 * refr;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * refr;
- }
- string d_val = "";
- double cnstVal1 = 25000 * refr;
- double cnstVal2 = 100000 * refr;
- double ss = System.Math.Min(w, h);
- double t = 0, l = 0, b = h, r = w;
- double a, ch, ch2, ch4;
- a = (adj < 0) ? 0 : (adj > cnstVal1) ? cnstVal1 : adj;
- ch = ss * a / cnstVal2;
- ch2 = ch / 2;
- ch4 = ch / 4;
- if (shapType == "verticalScroll")
- {
- double x3, x4, x6, x7, x5, y3, y4;
- x3 = ch + ch2;
- x4 = ch + ch;
- x6 = r - ch;
- x7 = r - ch2;
- x5 = x6 - ch2;
- y3 = b - ch;
- y4 = b - ch2;
- d_val = "M" + ch + "," + y3 +
- " L" + ch + "," + ch2 +
- ShapeArc(x3, ch2, ch2, ch2, 180, 270, false).Replace("M", "L") +
- " L" + x7 + "," + t +
- ShapeArc(x7, ch2, ch2, ch2, 270, 450, false).Replace("M", "L") +
- " L" + x6 + "," + ch +
- " L" + x6 + "," + y4 +
- ShapeArc(x5, y4, ch2, ch2, 0, 90, false).Replace("M", "L") +
- " L" + ch2 + "," + b +
- ShapeArc(ch2, y4, ch2, ch2, 90, 270, false).Replace("M", "L") +
- " z" +
- " M" + x3 + "," + t +
- ShapeArc(x3, ch2, ch2, ch2, 270, 450, false).Replace("M", "L") +
- ShapeArc(x3, x3 / 2, ch4, ch4, 90, 270, false).Replace("M", "L") +
- " L" + x4 + "," + ch2 +
- " M" + x6 + "," + ch +
- " L" + x3 + "," + ch +
- " M" + ch + "," + y4 +
- ShapeArc(ch2, y4, ch2, ch2, 0, 270, false).Replace("M", "L") +
- ShapeArc(ch2, (y4 + y3) / 2, ch4, ch4, 270, 450, false).Replace("M", "L") +
- " z" +
- " M" + ch + "," + y4 +
- " L" + ch + "," + y3;
- }
- else if (shapType == "horizontalScroll")
- {
- double y3, y4, y6, y7, y5, x3, x4;
- y3 = ch + ch2;
- y4 = ch + ch;
- y6 = b - ch;
- y7 = b - ch2;
- y5 = y6 - ch2;
- x3 = r - ch;
- x4 = r - ch2;
- d_val = "M" + l + "," + y3 +
- ShapeArc(ch2, y3, ch2, ch2, 180, 270, false).Replace("M", "L") +
- " L" + x3 + "," + ch +
- " L" + x3 + "," + ch2 +
- ShapeArc(x4, ch2, ch2, ch2, 180, 360, false).Replace("M", "L") +
- " L" + r + "," + y5 +
- ShapeArc(x4, y5, ch2, ch2, 0, 90, false).Replace("M", "L") +
- " L" + ch + "," + y6 +
- " L" + ch + "," + y7 +
- ShapeArc(ch2, y7, ch2, ch2, 0, 180, false).Replace("M", "L") +
- " z" +
- "M" + x4 + "," + ch +
- ShapeArc(x4, ch2, ch2, ch2, 90, -180, false).Replace("M", "L") +
- ShapeArc((x3 + x4) / 2, ch2, ch4, ch4, 180, 0, false).Replace("M", "L") +
- " z" +
- " M" + x4 + "," + ch +
- " L" + x3 + "," + ch +
- " M" + ch2 + "," + y4 +
- " L" + ch2 + "," + y3 +
- ShapeArc(y3 / 2, y3, ch4, ch4, 180, 360, false).Replace("M", "L") +
- ShapeArc(ch2, y3, ch2, ch2, 0, 180, false).Replace("M", "L") +
- " M" + ch + "," + y3 +
- " L" + ch + "," + y6;
- }
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 卷形:水平
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg HorizontalScroll(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double refr = px9d6 / px91d4400;
- double adj = 12500 * refr;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * refr;
- }
- string d_val = "";
- double cnstVal1 = 25000 * refr;
- double cnstVal2 = 100000 * refr;
- double ss = System.Math.Min(w, h);
- double t = 0, l = 0, b = h, r = w;
- double a, ch, ch2, ch4;
- a = (adj < 0) ? 0 : (adj > cnstVal1) ? cnstVal1 : adj;
- ch = ss * a / cnstVal2;
- ch2 = ch / 2;
- ch4 = ch / 4;
- if (shapType == "verticalScroll")
- {
- double x3, x4, x6, x7, x5, y3, y4;
- x3 = ch + ch2;
- x4 = ch + ch;
- x6 = r - ch;
- x7 = r - ch2;
- x5 = x6 - ch2;
- y3 = b - ch;
- y4 = b - ch2;
- d_val = "M" + ch + "," + y3 +
- " L" + ch + "," + ch2 +
- ShapeArc(x3, ch2, ch2, ch2, 180, 270, false).Replace("M", "L") +
- " L" + x7 + "," + t +
- ShapeArc(x7, ch2, ch2, ch2, 270, 450, false).Replace("M", "L") +
- " L" + x6 + "," + ch +
- " L" + x6 + "," + y4 +
- ShapeArc(x5, y4, ch2, ch2, 0, 90, false).Replace("M", "L") +
- " L" + ch2 + "," + b +
- ShapeArc(ch2, y4, ch2, ch2, 90, 270, false).Replace("M", "L") +
- " z" +
- " M" + x3 + "," + t +
- ShapeArc(x3, ch2, ch2, ch2, 270, 450, false).Replace("M", "L") +
- ShapeArc(x3, x3 / 2, ch4, ch4, 90, 270, false).Replace("M", "L") +
- " L" + x4 + "," + ch2 +
- " M" + x6 + "," + ch +
- " L" + x3 + "," + ch +
- " M" + ch + "," + y4 +
- ShapeArc(ch2, y4, ch2, ch2, 0, 270, false).Replace("M", "L") +
- ShapeArc(ch2, (y4 + y3) / 2, ch4, ch4, 270, 450, false).Replace("M", "L") +
- " z" +
- " M" + ch + "," + y4 +
- " L" + ch + "," + y3;
- }
- else if (shapType == "horizontalScroll")
- {
- double y3, y4, y6, y7, y5, x3, x4;
- y3 = ch + ch2;
- y4 = ch + ch;
- y6 = b - ch;
- y7 = b - ch2;
- y5 = y6 - ch2;
- x3 = r - ch;
- x4 = r - ch2;
- d_val = "M" + l + "," + y3 +
- ShapeArc(ch2, y3, ch2, ch2, 180, 270, false).Replace("M", "L") +
- " L" + x3 + "," + ch +
- " L" + x3 + "," + ch2 +
- ShapeArc(x4, ch2, ch2, ch2, 180, 360, false).Replace("M", "L") +
- " L" + r + "," + y5 +
- ShapeArc(x4, y5, ch2, ch2, 0, 90, false).Replace("M", "L") +
- " L" + ch + "," + y6 +
- " L" + ch + "," + y7 +
- ShapeArc(ch2, y7, ch2, ch2, 0, 180, false).Replace("M", "L") +
- " z" +
- "M" + x4 + "," + ch +
- ShapeArc(x4, ch2, ch2, ch2, 90, -180, false).Replace("M", "L") +
- ShapeArc((x3 + x4) / 2, ch2, ch4, ch4, 180, 0, false).Replace("M", "L") +
- " z" +
- " M" + x4 + "," + ch +
- " L" + x3 + "," + ch +
- " M" + ch2 + "," + y4 +
- " L" + ch2 + "," + y3 +
- ShapeArc(y3 / 2, y3, ch4, ch4, 180, 360, false).Replace("M", "L") +
- ShapeArc(ch2, y3, ch2, ch2, 0, 180, false).Replace("M", "L") +
- " M" + ch + "," + y3 +
- " L" + ch + "," + y6;
- }
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 对话气泡:椭圆形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg WedgeEllipseCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double refr = px9d6 / px91d4400;
- double adj1 = -20833 * refr;
- double adj2 = 62500 * refr;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * refr;
- }
- }
- }
- string d_val = "";
- double cnstVal1 = 100000 * px9d6 / px91d4400;
- double angVal1 = 11 * System.Math.PI / 180;
- double ss = System.Math.Min(w, h);
- double dxPos, dyPos, xPos, yPos, sdx, sdy, pang, stAng, enAng, dx1 = 0.0, dy1, x1, y1, dx2, dy2,
- x2, y2, stAng1, enAng1, swAng1, swAng2, swAng,
- vc = h / 2, hc = w / 2;
- dxPos = w * adj1 / cnstVal1;
- dyPos = h * adj2 / cnstVal1;
- xPos = hc + dxPos;
- yPos = vc + dyPos;
- sdx = dxPos * h;
- sdy = dyPos * w;
- pang = System.Math.Atan(sdy / sdx);
- stAng = pang + angVal1;
- enAng = pang - angVal1;
- /* console.log("dxPos: ", dxPos, "dyPos: ", dyPos);
- dx1 = hc * System.Math.Cos(stAng);*/
- dy1 = vc * System.Math.Sin(stAng);
- dx2 = hc * System.Math.Cos(enAng);
- dy2 = vc * System.Math.Sin(enAng);
- if (dxPos >= 0)
- {
- x1 = hc + dx1;
- y1 = vc + dy1;
- x2 = hc + dx2;
- y2 = vc + dy2;
- }
- else
- {
- x1 = hc - dx1;
- y1 = vc - dy1;
- x2 = hc - dx2;
- y2 = vc - dy2;
- }
- /*
- //stAng = pang+angVal1;
- //enAng = pang-angVal1;
- //dx1 = hc*Math.Cos(stAng);
- //dy1 = vc*Math.Sin(stAng);
- x1 = hc+dx1;
- y1 = vc+dy1;
- dx2 = hc*Math.Cos(enAng);
- dy2 = vc*Math.Sin(enAng);
- x2 = hc+dx2;
- y2 = vc+dy2;
- stAng1 = System.Math.Atan(dy1/dx1);
- enAng1 = System.Math.Atan(dy2/dx2);
- swAng1 = enAng1-stAng1;
- swAng2 = swAng1+2*Math.PI;
- swAng = (swAng1 > 0)?swAng1:swAng2;
- double stAng1Dg = stAng1*180/Math.PI;
- double swAngDg = swAng*180/Math.PI;
- double endAng = stAng1Dg + swAngDg;
- */
- d_val = "M" + x1 + "," + y1 +
- " L" + xPos + "," + yPos +
- " L" + x2 + "," + y2 +
- //" z" +
- ShapeArc(hc, vc, hc, vc, 0, 360, true);// +
- //ShapeArc(hc,vc,hc,vc,stAng1Dg,stAng1Dg+swAngDg,false).Replace("M","L") +
- //" z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 对话气泡:矩形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg WedgeRectCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double refr = px9d6 / px91d4400;
- double adj1 = -20833 * refr;
- double adj2 = 62500 * refr;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * refr;
- }
- }
- }
- string d_val = "";
- double cnstVal1 = 100000 * px9d6 / px91d4400;
- double dxPos, dyPos, xPos, yPos, dx, dy, dq, ady, adq, dz, xg1, xg2, x1, x2,
- yg1, yg2, y1, y2, t1, xl, t2, xt, t3, xr, t4, xb, t5, yl, t6, yt, t7, yr, t8, yb,
- vc = h / 2, hc = w / 2;
- dxPos = w * adj1 / cnstVal1;
- dyPos = h * adj2 / cnstVal1;
- xPos = hc + dxPos;
- yPos = vc + dyPos;
- dx = xPos - hc;
- dy = yPos - vc;
- dq = dxPos * h / w;
- ady = System.Math.Abs(dyPos);
- adq = System.Math.Abs(dq);
- dz = ady - adq;
- xg1 = (dxPos > 0) ? 7 : 2;
- xg2 = (dxPos > 0) ? 10 : 5;
- x1 = w * xg1 / 12;
- x2 = w * xg2 / 12;
- yg1 = (dyPos > 0) ? 7 : 2;
- yg2 = (dyPos > 0) ? 10 : 5;
- y1 = h * yg1 / 12;
- y2 = h * yg2 / 12;
- t1 = (dxPos > 0) ? 0 : xPos;
- xl = (dz > 0) ? 0 : t1;
- t2 = (dyPos > 0) ? x1 : xPos;
- xt = (dz > 0) ? t2 : x1;
- t3 = (dxPos > 0) ? xPos : w;
- xr = (dz > 0) ? w : t3;
- t4 = (dyPos > 0) ? xPos : x1;
- xb = (dz > 0) ? t4 : x1;
- t5 = (dxPos > 0) ? y1 : yPos;
- yl = (dz > 0) ? y1 : t5;
- t6 = (dyPos > 0) ? 0 : yPos;
- yt = (dz > 0) ? t6 : 0;
- t7 = (dxPos > 0) ? yPos : y1;
- yr = (dz > 0) ? y1 : t7;
- t8 = (dyPos > 0) ? yPos : h;
- yb = (dz > 0) ? t8 : h;
- d_val = "M" + 0 + "," + 0 +
- " L" + x1 + "," + 0 +
- " L" + xt + "," + yt +
- " L" + x2 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + y1 +
- " L" + xr + "," + yr +
- " L" + w + "," + y2 +
- " L" + w + "," + h +
- " L" + x2 + "," + h +
- " L" + xb + "," + yb +
- " L" + x1 + "," + h +
- " L" + 0 + "," + h +
- " L" + 0 + "," + y2 +
- " L" + xl + "," + yl +
- " L" + 0 + "," + y1 +
- " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 对话气泡:圆角矩形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg WedgeRoundRectCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double refr = px9d6 / px91d4400;
- double adj1 = -20833 * refr;
- double adj2 = 62500 * refr;
- double adj3 = 16667 * refr;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * refr;
- }
- }
- }
- string d_val = "";
- double cnstVal1 = 100000 * px9d6 / px91d4400;
- double ss = System.Math.Min(w, h);
- double dxPos, dyPos, xPos, yPos, dq, ady, adq, dz, xg1, xg2, x1, x2, yg1, yg2, y1, y2,
- t1, xl, t2, xt, t3, xr, t4, xb, t5, yl, t6, yt, t7, yr, t8, yb, u1, u2, v2,
- vc = h / 2, hc = w / 2;
- dxPos = w * adj1 / cnstVal1;
- dyPos = h * adj2 / cnstVal1;
- xPos = hc + dxPos;
- yPos = vc + dyPos;
- dq = dxPos * h / w;
- ady = System.Math.Abs(dyPos);
- adq = System.Math.Abs(dq);
- dz = ady - adq;
- xg1 = (dxPos > 0) ? 7 : 2;
- xg2 = (dxPos > 0) ? 10 : 5;
- x1 = w * xg1 / 12;
- x2 = w * xg2 / 12;
- yg1 = (dyPos > 0) ? 7 : 2;
- yg2 = (dyPos > 0) ? 10 : 5;
- y1 = h * yg1 / 12;
- y2 = h * yg2 / 12;
- t1 = (dxPos > 0) ? 0 : xPos;
- xl = (dz > 0) ? 0 : t1;
- t2 = (dyPos > 0) ? x1 : xPos;
- xt = (dz > 0) ? t2 : x1;
- t3 = (dxPos > 0) ? xPos : w;
- xr = (dz > 0) ? w : t3;
- t4 = (dyPos > 0) ? xPos : x1;
- xb = (dz > 0) ? t4 : x1;
- t5 = (dxPos > 0) ? y1 : yPos;
- yl = (dz > 0) ? y1 : t5;
- t6 = (dyPos > 0) ? 0 : yPos;
- yt = (dz > 0) ? t6 : 0;
- t7 = (dxPos > 0) ? yPos : y1;
- yr = (dz > 0) ? y1 : t7;
- t8 = (dyPos > 0) ? yPos : h;
- yb = (dz > 0) ? t8 : h;
- u1 = ss * adj3 / cnstVal1;
- u2 = w - u1;
- v2 = h - u1;
- d_val = "M" + 0 + "," + u1 +
- ShapeArc(u1, u1, u1, u1, 180, 270, false).Replace("M", "L") +
- " L" + x1 + "," + 0 +
- " L" + xt + "," + yt +
- " L" + x2 + "," + 0 +
- " L" + u2 + "," + 0 +
- ShapeArc(u2, u1, u1, u1, 270, 360, false).Replace("M", "L") +
- " L" + w + "," + y1 +
- " L" + xr + "," + yr +
- " L" + w + "," + y2 +
- " L" + w + "," + v2 +
- ShapeArc(u2, v2, u1, u1, 0, 90, false).Replace("M", "L") +
- " L" + x2 + "," + h +
- " L" + xb + "," + yb +
- " L" + x1 + "," + h +
- " L" + u1 + "," + h +
- ShapeArc(u1, v2, u1, u1, 90, 180, false).Replace("M", "L") +
- " L" + 0 + "," + y2 +
- " L" + xl + "," + yl +
- " L" + 0 + "," + y1 +
- " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg AccentBorderCallout1(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double refr = px9d6 / px91d4400;
- double adj1 = 18750 * refr;
- double adj2 = -8333 * refr;
- double adj3 = 18750 * refr;
- double adj4 = -16667 * refr;
- double adj5 = 100000 * refr;
- double adj6 = -16667 * refr;
- double adj7 = 112963 * refr;
- double adj8 = -8333 * refr;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = double.Parse(sAdj4.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj5")
- {
- XmlNode sAdj5 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj5 = double.Parse(sAdj5.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj6")
- {
- XmlNode sAdj6 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj6 = double.Parse(sAdj6.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj7")
- {
- XmlNode sAdj7 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj7 = double.Parse(sAdj7.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj8")
- {
- XmlNode sAdj8 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj8 = double.Parse(sAdj8.Value.Substring(4)) * refr;
- }
- }
- }
- string d_val = "";
- double cnstVal1 = 100000 * refr;
- bool isBorder = true;
- switch (shapType)
- {
- case "borderCallout1":
- case "callout1":
- if (shapType == "borderCallout1")
- {
- isBorder = true;
- }
- else
- {
- isBorder = false;
- }
- if (shapAdjst_ary == null || shapAdjst_ary.Count==0)
- {
- adj1 = 18750 * refr;
- adj2 = -8333 * refr;
- adj3 = 112500 * refr;
- adj4 = -38333 * refr;
- }
- double y1, x1, y2, x2;
- y1 = h * adj1 / cnstVal1;
- x1 = w * adj2 / cnstVal1;
- y2 = h * adj3 / cnstVal1;
- x2 = w * adj4 / cnstVal1;
- d_val = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- " M" + x1 + "," + y1 +
- " L" + x2 + "," + y2;
- break;
- case "borderCallout2":
- case "callout2":
- if (shapType == "borderCallout2")
- {
- isBorder = true;
- }
- else
- {
- isBorder = false;
- }
- if (shapAdjst_ary == null || shapAdjst_ary.Count == 0)
- {
- adj1 = 18750 * refr;
- adj2 = -8333 * refr;
- adj3 = 18750 * refr;
- adj4 = -16667 * refr;
- adj5 = 112500 * refr;
- adj6 = -46667 * refr;
- }
- double y3, x3;
- y1 = h * adj1 / cnstVal1;
- x1 = w * adj2 / cnstVal1;
- y2 = h * adj3 / cnstVal1;
- x2 = w * adj4 / cnstVal1;
- y3 = h * adj5 / cnstVal1;
- x3 = w * adj6 / cnstVal1;
- d_val = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- " M" + x1 + "," + y1 +
- " L" + x2 + "," + y2 +
- " L" + x3 + "," + y3 +
- " L" + x2 + "," + y2;
- break;
- case "borderCallout3":
- case "callout3":
- if (shapType == "borderCallout3")
- {
- isBorder = true;
- }
- else
- {
- isBorder = false;
- }
- if (shapAdjst_ary == null || shapAdjst_ary.Count == 0)
- {
- adj1 = 18750 * refr;
- adj2 = -8333 * refr;
- adj3 = 18750 * refr;
- adj4 = -16667 * refr;
- adj5 = 100000 * refr;
- adj6 = -16667 * refr;
- adj7 = 112963 * refr;
- adj8 = -8333 * refr;
- }
- double y4, x4;
- y1 = h * adj1 / cnstVal1;
- x1 = w * adj2 / cnstVal1;
- y2 = h * adj3 / cnstVal1;
- x2 = w * adj4 / cnstVal1;
- y3 = h * adj5 / cnstVal1;
- x3 = w * adj6 / cnstVal1;
- y4 = h * adj7 / cnstVal1;
- x4 = w * adj8 / cnstVal1;
- d_val = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- " M" + x1 + "," + y1 +
- " L" + x2 + "," + y2 +
- " L" + x3 + "," + y3 +
- " L" + x4 + "," + y4 +
- " L" + x3 + "," + y3 +
- " L" + x2 + "," + y2;
- break;
- case "accentBorderCallout1":
- case "accentCallout1":
- if (shapType == "accentBorderCallout1")
- {
- isBorder = true;
- }
- else
- {
- isBorder = false;
- }
- if (shapAdjst_ary == null || shapAdjst_ary.Count == 0)
- {
- adj1 = 18750 * refr;
- adj2 = -8333 * refr;
- adj3 = 112500 * refr;
- adj4 = -38333 * refr;
- }
- y1 = h * adj1 / cnstVal1;
- x1 = w * adj2 / cnstVal1;
- y2 = h * adj3 / cnstVal1;
- x2 = w * adj4 / cnstVal1;
- d_val = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- " M" + x1 + "," + y1 +
- " L" + x2 + "," + y2 +
- " M" + x1 + "," + 0 +
- " L" + x1 + "," + h;
- break;
- case "accentBorderCallout2":
- case "accentCallout2":
- if (shapType == "accentBorderCallout2")
- {
- isBorder = true;
- }
- else
- {
- isBorder = false;
- }
- if (shapAdjst_ary == null || shapAdjst_ary.Count == 0)
- {
- adj1 = 18750 * refr;
- adj2 = -8333 * refr;
- adj3 = 18750 * refr;
- adj4 = -16667 * refr;
- adj5 = 112500 * refr;
- adj6 = -46667 * refr;
- }
- y1 = h * adj1 / cnstVal1;
- x1 = w * adj2 / cnstVal1;
- y2 = h * adj3 / cnstVal1;
- x2 = w * adj4 / cnstVal1;
- y3 = h * adj5 / cnstVal1;
- x3 = w * adj6 / cnstVal1;
- d_val = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- " M" + x1 + "," + y1 +
- " L" + x2 + "," + y2 +
- " L" + x3 + "," + y3 +
- " L" + x2 + "," + y2 +
- " M" + x1 + "," + 0 +
- " L" + x1 + "," + h;
- break;
- case "accentBorderCallout3":
- case "accentCallout3":
- if (shapType == "accentBorderCallout3")
- {
- isBorder = true;
- }
- else
- {
- isBorder = false;
- }
- isBorder = true;
- if (shapAdjst_ary == null || shapAdjst_ary.Count == 0)
- {
- adj1 = 18750 * refr;
- adj2 = -8333 * refr;
- adj3 = 18750 * refr;
- adj4 = -16667 * refr;
- adj5 = 100000 * refr;
- adj6 = -16667 * refr;
- adj7 = 112963 * refr;
- adj8 = -8333 * refr;
- }
- y1 = h * adj1 / cnstVal1;
- x1 = w * adj2 / cnstVal1;
- y2 = h * adj3 / cnstVal1;
- x2 = w * adj4 / cnstVal1;
- y3 = h * adj5 / cnstVal1;
- x3 = w * adj6 / cnstVal1;
- y4 = h * adj7 / cnstVal1;
- x4 = w * adj8 / cnstVal1;
- d_val = "M" + 0 + "," + 0 +
- " L" + w + "," + 0 +
- " L" + w + "," + h +
- " L" + 0 + "," + h +
- " z" +
- " M" + x1 + "," + y1 +
- " L" + x2 + "," + y2 +
- " L" + x3 + "," + y3 +
- " L" + x4 + "," + y4 +
- " L" + x3 + "," + y3 +
- " L" + x2 + "," + y2 +
- " M" + x1 + "," + 0 +
- " L" + x1 + "," + h;
- break;
- }
- // console.log("shapType: ", shapType, ",isBorder:", isBorder);
- //if(isBorder){
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- //}else{
- // result += "<path d='"+d_val+"' fill='" + (!imgFillFlg?(grndFillFlg?"url(#linGrd_"+shpId+")":fillColor):"url(#imgPtrn_"+shpId+")") +
- // "' stroke='none' />";
- //}
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg AccentBorderCallout2(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg AccentBorderCallout3(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 标注:线形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg BorderCallout1(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg BorderCallout2(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg BorderCallout3(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 标注:线形(带强调线)
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg AccentCallout1(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg AccentCallout2(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg AccentCallout3(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Callout1(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Callout2(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Callout3(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return AccentBorderCallout1(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg LeftRightRibbon(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double refr = px9d6 / px91d4400;
- double adj1 = 50000 * refr;
- double adj2 = 50000 * refr;
- double adj3 = 16667 * refr;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * refr;
- }
- }
- }
- string d_val = "";
- double cnstVal1 = 33333 * refr;
- double cnstVal2 = 100000 * refr;
- double cnstVal3 = 200000 * refr;
- double cnstVal4 = 400000 * refr;
- double ss = System.Math.Min(w, h);
- double a3, maxAdj1, a1, w1, maxAdj2, a2, x1, x4, dy1, dy2, ly1, ry4, ly2, ry3, ly4, ry1,
- ly3, ry2, hR, x2, x3, y1, y2, wd32 = w / 32, vc = h / 2, hc = w / 2;
- a3 = (adj3 < 0) ? 0 : (adj3 > cnstVal1) ? cnstVal1 : adj3;
- maxAdj1 = cnstVal2 - a3;
- a1 = (adj1 < 0) ? 0 : (adj1 > maxAdj1) ? maxAdj1 : adj1;
- w1 = hc - wd32;
- maxAdj2 = cnstVal2 * w1 / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- x1 = ss * a2 / cnstVal2;
- x4 = w - x1;
- dy1 = h * a1 / cnstVal3;
- dy2 = h * a3 / -cnstVal3;
- ly1 = vc + dy2 - dy1;
- ry4 = vc + dy1 - dy2;
- ly2 = ly1 + dy1;
- ry3 = h - ly2;
- ly4 = ly2 * 2;
- ry1 = h - ly4;
- ly3 = ly4 - ly1;
- ry2 = h - ly3;
- hR = a3 * ss / cnstVal4;
- x2 = hc - wd32;
- x3 = hc + wd32;
- y1 = ly1 + hR;
- y2 = ry2 - hR;
- d_val = "M" + 0 + "," + ly2 +
- "L" + x1 + "," + 0 +
- "L" + x1 + "," + ly1 +
- "L" + hc + "," + ly1 +
- ShapeArc(hc, y1, wd32, hR, 270, 450, false).Replace("M", "L") +
- ShapeArc(hc, y2, wd32, hR, 270, 90, false).Replace("M", "L") +
- "L" + x4 + "," + ry2 +
- "L" + x4 + "," + ry1 +
- "L" + w + "," + ry3 +
- "L" + x4 + "," + h +
- "L" + x4 + "," + ry4 +
- "L" + hc + "," + ry4 +
- ShapeArc(hc, ry4 - hR, wd32, hR, 90, 180, false).Replace("M", "L") +
- "L" + x2 + "," + ly3 +
- "L" + x1 + "," + ly3 +
- "L" + x1 + "," + ly4 +
- " z" +
- "M" + x3 + "," + y1 +
- "L" + x3 + "," + ry2 +
- "M" + x2 + "," + y2 +
- "L" + x2 + "," + ly3;
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 带形:前凸
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Ribbon(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 16667 * px9d6 / px91d4400;
- double adj2 = 50000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- string d_val = "";
- double cnstVal1 = 25000 * px9d6 / px91d4400;
- double cnstVal2 = 33333 * px9d6 / px91d4400;
- double cnstVal3 = 75000 * px9d6 / px91d4400;
- double cnstVal4 = 100000 * px9d6 / px91d4400;
- double cnstVal5 = 200000 * px9d6 / px91d4400;
- double cnstVal6 = 400000 * px9d6 / px91d4400;
- double hc = w / 2, t = 0, l = 0, b = h, r = w, wd8 = w / 8, wd32 = w / 32;
- double a1, a2, x10, dx2, x2, x9, x3, x8, x5, x6, x4, x7, y1, y2, y4, y3, hR, y6;
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal2) ? cnstVal2 : adj1;
- a2 = (adj2 < cnstVal1) ? cnstVal1 : (adj2 > cnstVal3) ? cnstVal3 : adj2;
- x10 = r - wd8;
- dx2 = w * a2 / cnstVal5;
- x2 = hc - dx2;
- x9 = hc + dx2;
- x3 = x2 + wd32;
- x8 = x9 - wd32;
- x5 = x2 + wd8;
- x6 = x9 - wd8;
- x4 = x5 - wd32;
- x7 = x6 + wd32;
- hR = h * a1 / cnstVal6;
- if (shapType == "ribbon2")
- {
- double dy1, dy2, y7;
- dy1 = h * a1 / cnstVal5;
- y1 = b - dy1;
- dy2 = h * a1 / cnstVal4;
- y2 = b - dy2;
- y4 = t + dy2;
- y3 = (y4 + b) / 2;
- y6 = b - hR;///////////////////
- y7 = y1 - hR;
- d_val = "M" + l + "," + b +
- " L" + wd8 + "," + y3 +
- " L" + l + "," + y4 +
- " L" + x2 + "," + y4 +
- " L" + x2 + "," + hR +
- ShapeArc(x3, hR, wd32, hR, 180, 270, false).Replace("M", "L") +
- " L" + x8 + "," + t +
- ShapeArc(x8, hR, wd32, hR, 270, 360, false).Replace("M", "L") +
- " L" + x9 + "," + y4 +
- " L" + x9 + "," + y4 +
- " L" + r + "," + y4 +
- " L" + x10 + "," + y3 +
- " L" + r + "," + b +
- " L" + x7 + "," + b +
- ShapeArc(x7, y6, wd32, hR, 90, 270, false).Replace("M", "L") +
- " L" + x8 + "," + y1 +
- ShapeArc(x8, y7, wd32, hR, 90, -90, false).Replace("M", "L") +
- " L" + x3 + "," + y2 +
- ShapeArc(x3, y7, wd32, hR, 270, 90, false).Replace("M", "L") +
- " L" + x4 + "," + y1 +
- ShapeArc(x4, y6, wd32, hR, 270, 450, false).Replace("M", "L") +
- " z" +
- " M" + x5 + "," + y2 +
- " L" + x5 + "," + y6 +
- "M" + x6 + "," + y6 +
- " L" + x6 + "," + y2 +
- "M" + x2 + "," + y7 +
- " L" + x2 + "," + y4 +
- "M" + x9 + "," + y4 +
- " L" + x9 + "," + y7;
- }
- else if (shapType == "ribbon")
- {
- double y5;
- y1 = h * a1 / cnstVal5;
- y2 = h * a1 / cnstVal4;
- y4 = b - y2;
- y3 = y4 / 2;
- y5 = b - hR; ///////////////////////
- y6 = y2 - hR;
- d_val = "M" + l + "," + t +
- " L" + x4 + "," + t +
- ShapeArc(x4, hR, wd32, hR, 270, 450, false).Replace("M", "L") +
- " L" + x3 + "," + y1 +
- ShapeArc(x3, y6, wd32, hR, 270, 90, false).Replace("M", "L") +
- " L" + x8 + "," + y2 +
- ShapeArc(x8, y6, wd32, hR, 90, -90, false).Replace("M", "L") +
- " L" + x7 + "," + y1 +
- ShapeArc(x7, hR, wd32, hR, 90, 270, false).Replace("M", "L") +
- " L" + r + "," + t +
- " L" + x10 + "," + y3 +
- " L" + r + "," + y4 +
- " L" + x9 + "," + y4 +
- " L" + x9 + "," + y5 +
- ShapeArc(x8, y5, wd32, hR, 0, 90, false).Replace("M", "L") +
- " L" + x3 + "," + b +
- ShapeArc(x3, y5, wd32, hR, 90, 180, false).Replace("M", "L") +
- " L" + x2 + "," + y4 +
- " L" + l + "," + y4 +
- " L" + wd8 + "," + y3 +
- " z" +
- " M" + x5 + "," + hR +
- " L" + x5 + "," + y2 +
- "M" + x6 + "," + y2 +
- " L" + x6 + "," + hR +
- "M" + x2 + "," + y4 +
- " L" + x2 + "," + y6 +
- "M" + x9 + "," + y6 +
- " L" + x9 + "," + y4;
- }
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 带形:上凸
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Ribbon2(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Ribbon(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 双波形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg DoubleWave(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = (shapType == "doubleWave") ? 6250 * px9d6 / px91d4400 : 12500 * px9d6 / px91d4400;
- double adj2 = 0;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- string d_val = "";
- double cnstVal2 = -10000 * px9d6 / px91d4400;
- double cnstVal3 = 50000 * px9d6 / px91d4400;
- double cnstVal4 = 100000 * px9d6 / px91d4400;
- double hc = w / 2, l = 0, b = h, r = w, wd8 = w / 8, wd32 = w / 32;
- if (shapType == "doubleWave")
- {
- double cnstVal1 = 12500 * px9d6 / px91d4400;
- double a1, a2, y1, dy2, y2, y3, y4, y5, y6, of2, dx2, x2, dx8, x8, dx3, x3, dx4, x4, x5, x6, x7, x9, x15, x10, x11, x12, x13, x14;
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal1) ? cnstVal1 : adj1;
- a2 = (adj2 < cnstVal2) ? cnstVal2 : (adj2 > cnstVal4) ? cnstVal4 : adj2;
- y1 = h * a1 / cnstVal4;
- dy2 = y1 * 10 / 3;
- y2 = y1 - dy2;
- y3 = y1 + dy2;
- y4 = b - y1;
- y5 = y4 - dy2;
- y6 = y4 + dy2;
- of2 = w * a2 / cnstVal3;
- dx2 = (of2 > 0) ? 0 : of2;
- x2 = l - dx2;
- dx8 = (of2 > 0) ? of2 : 0;
- x8 = r - dx8;
- dx3 = (dx2 + x8) / 6;
- x3 = x2 + dx3;
- dx4 = (dx2 + x8) / 3;
- x4 = x2 + dx4;
- x5 = (x2 + x8) / 2;
- x6 = x5 + dx3;
- x7 = (x6 + x8) / 2;
- x9 = l + dx8;
- x15 = r + dx2;
- x10 = x9 + dx3;
- x11 = x9 + dx4;
- x12 = (x9 + x15) / 2;
- x13 = x12 + dx3;
- x14 = (x13 + x15) / 2;
- d_val = "M" + x2 + "," + y1 +
- " C" + x3 + "," + y2 + " " + x4 + "," + y3 + " " + x5 + "," + y1 +
- " C" + x6 + "," + y2 + " " + x7 + "," + y3 + " " + x8 + "," + y1 +
- " L" + x15 + "," + y4 +
- " C" + x14 + "," + y6 + " " + x13 + "," + y5 + " " + x12 + "," + y4 +
- " C" + x11 + "," + y6 + " " + x10 + "," + y5 + " " + x9 + "," + y4 +
- " z";
- }
- else if (shapType == "wave")
- {
- double cnstVal5 = 20000 * px9d6 / px91d4400;
- double a1, a2, y1, dy2, y2, y3, y4, y5, y6, of2, dx2, x2, dx5, x5, dx3, x3, x4, x6, x10, x7, x8;
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal5) ? cnstVal5 : adj1;
- a2 = (adj2 < cnstVal2) ? cnstVal2 : (adj2 > cnstVal4) ? cnstVal4 : adj2;
- y1 = h * a1 / cnstVal4;
- dy2 = y1 * 10 / 3;
- y2 = y1 - dy2;
- y3 = y1 + dy2;
- y4 = b - y1;
- y5 = y4 - dy2;
- y6 = y4 + dy2;
- of2 = w * a2 / cnstVal3;
- dx2 = (of2 > 0) ? 0 : of2;
- x2 = l - dx2;
- dx5 = (of2 > 0) ? of2 : 0;
- x5 = r - dx5;
- dx3 = (dx2 + x5) / 3;
- x3 = x2 + dx3;
- x4 = (x3 + x5) / 2;
- x6 = l + dx5;
- x10 = r + dx2;
- x7 = x6 + dx3;
- x8 = (x7 + x10) / 2;
- d_val = "M" + x2 + "," + y1 +
- " C" + x3 + "," + y2 + " " + x4 + "," + y3 + " " + x5 + "," + y1 +
- " L" + x10 + "," + y4 +
- " C" + x8 + "," + y6 + " " + x7 + "," + y5 + " " + x6 + "," + y4 +
- " z";
- }
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 波形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Wave(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return DoubleWave(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 带形:前凸弯
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg EllipseRibbon(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 50000 * px9d6 / px91d4400;
- double adj3 = 12500 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- string d_val = "";
- double cnstVal1 = 25000 * px9d6 / px91d4400;
- double cnstVal3 = 75000 * px9d6 / px91d4400;
- double cnstVal4 = 100000 * px9d6 / px91d4400;
- double cnstVal5 = 200000 * px9d6 / px91d4400;
- double hc = w / 2, t = 0, l = 0, b = h, r = w, wd8 = w / 8;
- double a1, a2, q10, q11, q12, minAdj3, a3, dx2, x2, x3, x4, x5, x6, dy1, f1, q1, q2,
- cx1, cx2, dy3, q3, q4, q5, rh, q8, cx4, q9, cx5;
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal4) ? cnstVal4 : adj1;
- a2 = (adj2 < cnstVal1) ? cnstVal1 : (adj2 > cnstVal3) ? cnstVal3 : adj2;
- q10 = cnstVal4 - a1;
- q11 = q10 / 2;
- q12 = a1 - q11;
- minAdj3 = (0 > q12) ? 0 : q12;
- a3 = (adj3 < minAdj3) ? minAdj3 : (adj3 > a1) ? a1 : adj3;
- dx2 = w * a2 / cnstVal5;
- x2 = hc - dx2;
- x3 = x2 + wd8;
- x4 = r - x3;
- x5 = r - x2;
- x6 = r - wd8;
- dy1 = h * a3 / cnstVal4;
- f1 = 4 * dy1 / w;
- q1 = x3 * x3 / w;
- q2 = x3 - q1;
- cx1 = x3 / 2;
- cx2 = r - cx1;
- q1 = h * a1 / cnstVal4;
- dy3 = q1 - dy1;
- q3 = x2 * x2 / w;
- q4 = x2 - q3;
- q5 = f1 * q4;
- rh = b - q1;
- q8 = dy1 * 14 / 16;
- cx4 = x2 / 2;
- q9 = f1 * cx4;
- cx5 = r - cx4;
- if (shapType == "ellipseRibbon")
- {
- double y1, cy1, y3, q6, q7, cy3, y2, y5, y6,
- cy4, cy6, y7, cy7, y8;
- y1 = f1 * q2;
- cy1 = f1 * cx1;
- y3 = q5 + dy3;
- q6 = dy1 + dy3 - y3;
- q7 = q6 + dy1;
- cy3 = q7 + dy3;
- y2 = (q8 + rh) / 2;
- y5 = q5 + rh;
- y6 = y3 + rh;
- cy4 = q9 + rh;
- cy6 = cy3 + rh;
- y7 = y1 + dy3;
- cy7 = q1 + q1 - y7;
- y8 = b - dy1;
- //
- d_val = "M" + l + "," + t +
- " Q" + cx1 + "," + cy1 + " " + x3 + "," + y1 +
- " L" + x2 + "," + y3 +
- " Q" + hc + "," + cy3 + " " + x5 + "," + y3 +
- " L" + x4 + "," + y1 +
- " Q" + cx2 + "," + cy1 + " " + r + "," + t +
- " L" + x6 + "," + y2 +
- " L" + r + "," + rh +
- " Q" + cx5 + "," + cy4 + " " + x5 + "," + y5 +
- " L" + x5 + "," + y6 +
- " Q" + hc + "," + cy6 + " " + x2 + "," + y6 +
- " L" + x2 + "," + y5 +
- " Q" + cx4 + "," + cy4 + " " + l + "," + rh +
- " L" + wd8 + "," + y2 +
- " z" +
- "M" + x2 + "," + y5 +
- " L" + x2 + "," + y3 +
- "M" + x5 + "," + y3 +
- " L" + x5 + "," + y5 +
- "M" + x3 + "," + y1 +
- " L" + x3 + "," + y7 +
- "M" + x4 + "," + y7 +
- " L" + x4 + "," + y1;
- }
- else if (shapType == "ellipseRibbon2")
- {
- double u1, y1, cu1, cy1, u3, y3, q6, q7, cu3, cy3, u2, y2,
- u5, y5, u6, y6, cu4, cy4, cu6, cy6, u7, y7, cu7, cy7;
- u1 = f1 * q2;
- y1 = b - u1;
- cu1 = f1 * cx1;
- cy1 = b - cu1;
- u3 = q5 + dy3;
- y3 = b - u3;
- q6 = dy1 + dy3 - u3;
- q7 = q6 + dy1;
- cu3 = q7 + dy3;
- cy3 = b - cu3;
- u2 = (q8 + rh) / 2;
- y2 = b - u2;
- u5 = q5 + rh;
- y5 = b - u5;
- u6 = u3 + rh;
- y6 = b - u6;
- cu4 = q9 + rh;
- cy4 = b - cu4;
- cu6 = cu3 + rh;
- cy6 = b - cu6;
- u7 = u1 + dy3;
- y7 = b - u7;
- cu7 = q1 + q1 - u7;
- cy7 = b - cu7;
- //
- d_val = "M" + l + "," + b +
- " L" + wd8 + "," + y2 +
- " L" + l + "," + q1 +
- " Q" + cx4 + "," + cy4 + " " + x2 + "," + y5 +
- " L" + x2 + "," + y6 +
- " Q" + hc + "," + cy6 + " " + x5 + "," + y6 +
- " L" + x5 + "," + y5 +
- " Q" + cx5 + "," + cy4 + " " + r + "," + q1 +
- " L" + x6 + "," + y2 +
- " L" + r + "," + b +
- " Q" + cx2 + "," + cy1 + " " + x4 + "," + y1 +
- " L" + x5 + "," + y3 +
- " Q" + hc + "," + cy3 + " " + x2 + "," + y3 +
- " L" + x3 + "," + y1 +
- " Q" + cx1 + "," + cy1 + " " + l + "," + b +
- " z" +
- "M" + x2 + "," + y3 +
- " L" + x2 + "," + y5 +
- "M" + x5 + "," + y5 +
- " L" + x5 + "," + y3 +
- "M" + x3 + "," + y7 +
- " L" + x3 + "," + y1 +
- "M" + x4 + "," + y1 +
- " L" + x4 + "," + y7;
- }
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d=d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 带形:上凸弯
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg EllipseRibbon2(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return EllipseRibbon(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 直线 Line
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="isFlipV"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <param name="headEndNodeAttrs"></param>
- /// <param name="tailEndNodeAttrs"></param>
- /// <returns></returns>
- private static Svg Line(XmlNode node, string shapType, double w, double h, int isFlipV, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- // string result = "";
- string X1 = "", X2 = "", Y1 = "", Y2 = "";// MarkerStart = "", MarkerEnd = "";
- if (isFlipV == 1)
- {
- // result += "<line x1='" + w + "' y1='0' x2='0' y2='" + h + "' stroke='#" + border.Color +
- // "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' ";
- X1 = w + "";
- X2 = "0";
- Y1 = "0";
- Y2 = h + "";
- }
- else
- {
- // result += "<line x1='0' y1='0' x2='" + w + "' y2='" + h + "' stroke='#" + border.Color +
- // "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' ";
- X1 = "0";
- X2 = w + "";
- Y1 = "0";
- Y2 = h + "";
- }
- // if (headEndNodeAttrs != null && (headEndNodeAttrs.GetTextByPath("@type").Value == "triangle" || headEndNodeAttrs.GetTextByPath("@type").Value == "arrow"))
- // {
- // MarkerStart = "url(#markerTriangle_" + shpId + ")";
- // result += "marker-start='url(#markerTriangle_" + shpId + ")' ";
- //}
- //if (tailEndNodeAttrs != null && (tailEndNodeAttrs.GetTextByPath("@type").Value == "triangle" || tailEndNodeAttrs.GetTextByPath("@type").Value == "arrow"))
- //{
- // MarkerEnd = "url(#markerTriangle_" + shpId + ")";
- // result += "marker-end='url(#markerTriangle_" + shpId + ")' ";
- //}
- //result += "/>";
- List<SvgShape> shapes = new List<SvgShape>() {new Line {
- type = "line",
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- start=headEndNodeAttrs!=null&&headEndNodeAttrs.GetTextByPath("@type")!=null?headEndNodeAttrs.GetTextByPath("@type").Value:null,
- end=tailEndNodeAttrs!=null&&tailEndNodeAttrs.GetTextByPath("@type")!=null?tailEndNodeAttrs.GetTextByPath("@type").Value:null,
- x1=X1,
- x2=X2,
- y1=Y1,
- y2=Y2
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 直线箭头
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="isFlipV"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <param name="headEndNodeAttrs"></param>
- /// <param name="tailEndNodeAttrs"></param>
- /// <returns></returns>
- private static Svg StraightConnector1(XmlNode node, string shapType, double w, double h, int isFlipV, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- return Line(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, shpId, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- }
- private static Svg BentConnector4(XmlNode node, string shapType, double w, double h, int isFlipV, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- return Line(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, shpId, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- }
- private static Svg BentConnector5(XmlNode node, string shapType, double w, double h, int isFlipV, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- return Line(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, shpId, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- }
- private static Svg CurvedConnector2(XmlNode node, string shapType, double w, double h, int isFlipV, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- return Line(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, shpId, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- }
- /// <summary>
- /// curvedConnector3 连接符:曲线 变成直线 没有弯曲
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="isFlipV"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <param name="headEndNodeAttrs"></param>
- /// <param name="tailEndNodeAttrs"></param>
- /// <returns></returns>
- private static Svg CurvedConnector3(XmlNode node, string shapType, double w, double h, int isFlipV, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj1 = 50000 ;
- if (shapAdjst != null)
- {
- adj1 = double.Parse(shapAdjst.Value.Substring(4));
- }
- //double per = adj1 / 100000.0;
- //var x2 = w * per ;
- //var d = "M" +0 + "," +0;
- //double cx = x2, cy = h / 2.0;
- //d += " q "+cx+",0 "+cx+","+cy+" q "+"0,"+cy+" "+(w - x2)+","+cy;
- var x2 = w * adj1 / 100000.0;
- var x1 = (0 + x2) / 2;
- var x3 = (w + x2) / 2;
- var y3 = h * 3 / 4.0;
- var d = "M" +0 + "," +0;
- d += " C " + x1 + "," + 0 + " " + x2 + "," + h / 4.0 + " " + x2 + "," + h / 2;
- d += " C " + x2 + "," + y3 + " " + x3 + "," + h + " " + w + "," + h;
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- d=d,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg CurvedConnector4(XmlNode node, string shapType, double w, double h, int isFlipV, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- return Line(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, shpId, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- }
- private static Svg CurvedConnector5(XmlNode node, string shapType, double w, double h, int isFlipV, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border, XmlNode headEndNodeAttrs, XmlNode tailEndNodeAttrs)
- {
- return Line(node, shapType, w, h, isFlipV, imgFillFlg, grndFillFlg, shpId, fillColor, border, headEndNodeAttrs, tailEndNodeAttrs);
- }
- /// <summary>
- /// 箭头:右
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg RightArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 0.25;//0.5;
- double sAdj2_val = 0.5;
- double max_sAdj2_const = w / h;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = 0.5 - (double.Parse(sAdj1.Value.Substring(4)) / 200000.00);
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- double sAdj2_val2 = double.Parse(sAdj2.Value.Substring(4)) / 100000.00;
- sAdj2_val = 1 - ((sAdj2_val2) / max_sAdj2_const);
- }
- }
- }
- //console.log("w: "+w+"\nh: "+h+"\nsAdj1: "+sAdj1_val+"\nsAdj2: "+sAdj2_val);
- // result += " <polygon points='" + w + " " + h / 2 + "," + sAdj2_val * w + " 0," + sAdj2_val * w + " " + sAdj1_val * h + ",0 " + sAdj1_val * h +
- // ",0 " + (1 - sAdj1_val) * h + "," + sAdj2_val * w + " " + (1 - sAdj1_val) * h + ", " + sAdj2_val * w + " " + h + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points= w + " " + h / 2 + "," + sAdj2_val * w + " 0," + sAdj2_val * w + " " + sAdj1_val * h + ",0 " + sAdj1_val * h +
- ",0 " + (1 - sAdj1_val) * h + "," + sAdj2_val * w + " " + (1 - sAdj1_val) * h + ", " + sAdj2_val * w + " " + h,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:左
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg LeftArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 0.25;//0.5;
- double sAdj2_val = 0.5;
- double max_sAdj2_const = w / h;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = 0.5 - (double.Parse(sAdj1.Value.Substring(4)) / 200000.00);
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- double sAdj2_val2 = double.Parse(sAdj2.Value.Substring(4)) / 100000.00;
- sAdj2_val = (sAdj2_val2) / max_sAdj2_const;
- }
- }
- }
- //console.log("w: "+w+"\nh: "+h+"\nsAdj1: "+sAdj1_val+"\nsAdj2: "+sAdj2_val);
- // result += " <polygon points='0 " + h / 2 + "," + sAdj2_val * w + " " + h + "," + sAdj2_val * w + " " + (1 - sAdj1_val) * h + "," + w + " " + (1 - sAdj1_val) * h +
- // "," + w + " " + sAdj1_val * h + "," + sAdj2_val * w + " " + sAdj1_val * h + ", " + sAdj2_val * w + " 0' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points= "0 "+ h / 2 + "," + sAdj2_val * w + " " + h + "," + sAdj2_val * w + " " + (1 - sAdj1_val) * h + "," + w + " " + (1 - sAdj1_val) * h +
- "," + w + " " + sAdj1_val * h + "," + sAdj2_val * w + " " + sAdj1_val * h + ", " + sAdj2_val * w + " 0",
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:下
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg DownArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 0.25;//0.5;
- double sAdj2_val = 0.5;
- double max_sAdj2_const = h / w;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = double.Parse(sAdj1.Value.Substring(4)) / 200000.00;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- double sAdj2_val2 = double.Parse(sAdj2.Value.Substring(4)) / 100000.00;
- sAdj2_val = (sAdj2_val2) / max_sAdj2_const;
- }
- }
- }
- if (shapType == "flowChartOffpageConnector")
- {
- sAdj1_val = 0.5;
- sAdj2_val = 0.212;
- }
- // result += " <polygon points='" + (0.5 - sAdj1_val) * w + " 0," + (0.5 - sAdj1_val) * w + " " + (1 - sAdj2_val) * h + ",0 " + (1 - sAdj2_val) * h + "," + (w / 2) + " " + h +
- // "," + w + " " + (1 - sAdj2_val) * h + "," + (0.5 + sAdj1_val) * w + " " + (1 - sAdj2_val) * h + ", " + (0.5 + sAdj1_val) * w + " 0' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points= (0.5 - sAdj1_val) * w + " 0," + (0.5 - sAdj1_val) * w + " " + (1 - sAdj2_val) * h + ",0 " + (1 - sAdj2_val) * h + "," + (w / 2) + " " + h +
- "," + w + " " + (1 - sAdj2_val) * h + "," + (0.5 + sAdj1_val) * w + " " + (1 - sAdj2_val) * h + ", " + (0.5 + sAdj1_val) * w + " 0",
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:离页连接符
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartOffpageConnector(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return DownArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 箭头:上
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg UpArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 0.25;//0.5;
- double sAdj2_val = 0.5;
- double max_sAdj2_const = h / w;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = double.Parse(sAdj1.Value.Substring(4)) / 200000.00;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- double sAdj2_val2 = double.Parse(sAdj2.Value.Substring(4)) / 100000.00;
- sAdj2_val = (sAdj2_val2) / max_sAdj2_const;
- }
- }
- }
- // result += " <polygon points='" + (w / 2) + " 0,0 " + sAdj2_val * h + "," + (0.5 - sAdj1_val) * w + " " + sAdj2_val * h + "," + (0.5 - sAdj1_val) * w + " " + h +
- // "," + (0.5 + sAdj1_val) * w + " " + h + "," + (0.5 + sAdj1_val) * w + " " + sAdj2_val * h + ", " + w + " " + sAdj2_val * h + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points= (w / 2) + " 0,0 " + sAdj2_val * h + "," + (0.5 - sAdj1_val) * w + " " + sAdj2_val * h + "," + (0.5 - sAdj1_val) * w + " " + h +
- "," + (0.5 + sAdj1_val) * w + " " + h + "," + (0.5 + sAdj1_val) * w + " " + sAdj2_val * h + ", " + w + " " + sAdj2_val * h,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:左右
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg LeftRightArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 0.25;
- double sAdj2_val = 0.25;
- double max_sAdj2_const = w / h;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = 0.5 - (double.Parse(sAdj1.Value.Substring(4)) / 200000.00);
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- double sAdj2_val2 = double.Parse(sAdj2.Value.Substring(4)) / 100000.00;
- sAdj2_val = (sAdj2_val2) / max_sAdj2_const;
- }
- }
- }
- //console.log("w: "+w+"\nh: "+h+"\nsAdj1: "+sAdj1_val+"\nsAdj2: "+sAdj2_val);
- // result += " <polygon points='0 " + h / 2 + "," + sAdj2_val * w + " " + h + "," + sAdj2_val * w + " " + (1 - sAdj1_val) * h + "," + (1 - sAdj2_val) * w + " " + (1 - sAdj1_val) * h +
- // "," + (1 - sAdj2_val) * w + " " + h + "," + w + " " + h / 2 + ", " + (1 - sAdj2_val) * w + " 0," + (1 - sAdj2_val) * w + " " + sAdj1_val * h + "," +
- // sAdj2_val * w + " " + sAdj1_val * h + "," + sAdj2_val * w + " 0' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points= "0 " + h / 2 + "," + sAdj2_val * w + " " + h + "," + sAdj2_val * w + " " + (1 - sAdj1_val) * h + "," + (1 - sAdj2_val) * w + " " + (1 - sAdj1_val) * h +
- "," + (1 - sAdj2_val) * w + " " + h + "," + w + " " + h / 2 + ", " + (1 - sAdj2_val) * w + " 0," + (1 - sAdj2_val) * w + " " + sAdj1_val * h + "," +
- sAdj2_val * w + " " + sAdj1_val * h + "," + sAdj2_val * w + " 0",
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg UpDownArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double sAdj1_val = 0.25;
- double sAdj2_val = 0.25;
- double max_sAdj2_const = h / w;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- sAdj1_val = 0.5 - (double.Parse(sAdj1.Value.Substring(4)) / 200000.00);
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- double sAdj2_val2 = double.Parse(sAdj2.Value.Substring(4)) / 100000.00;
- sAdj2_val = (sAdj2_val2) / max_sAdj2_const;
- }
- }
- }
- //console.log("w: "+w+"\nh: "+h+"\nsAdj1: "+sAdj1_val+"\nsAdj2: "+sAdj2_val);
- // result += " <polygon points='" + w / 2 + " 0,0 " + sAdj2_val * h + "," + sAdj1_val * w + " " + sAdj2_val * h + "," + sAdj1_val * w + " " + (1 - sAdj2_val) * h +
- // ",0 " + (1 - sAdj2_val) * h + "," + w / 2 + " " + h + ", " + w + " " + (1 - sAdj2_val) * h + "," + (1 - sAdj1_val) * w + " " + (1 - sAdj2_val) * h + "," +
- // (1 - sAdj1_val) * w + " " + sAdj2_val * h + "," + w + " " + sAdj2_val * h + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
- type = "polygon",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- points= w / 2 + " 0,0 " + sAdj2_val * h + "," + sAdj1_val * w + " " + sAdj2_val * h + "," + sAdj1_val * w + " " + (1 - sAdj2_val) * h +
- ",0 " + (1 - sAdj2_val) * h + "," + w / 2 + " " + h + ", " + w + " " + (1 - sAdj2_val) * h + "," + (1 - sAdj1_val) * w + " " + (1 - sAdj2_val) * h + "," +
- (1 - sAdj1_val) * w + " " + sAdj2_val * h + "," + w + " " + sAdj2_val * h ,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:十字
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg QuadArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- //string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 22500 * px9d6 / px91d4400;
- double adj2 = 22500 * px9d6 / px91d4400;
- double adj3 = 22500 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, a1, a2, a3, q1, x1, x2, dx2, x3, dx3, x4, x5, x6, y2, y3, y4, y5, y6, maxAdj1, maxAdj3;
- double minWH = System.Math.Min(w, h);
- if (adj2 < 0) a2 = 0;
- else if (adj2 > cnstVal1) a2 = cnstVal1;
- else a2 = adj2;
- maxAdj1 = 2 * a2;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > maxAdj1) a1 = maxAdj1;
- else a1 = adj1;
- q1 = cnstVal2 - maxAdj1;
- maxAdj3 = q1 / 2;
- if (adj3 < 0) a3 = 0;
- else if (adj3 > maxAdj3) a3 = maxAdj3;
- else a3 = adj3;
- x1 = minWH * a3 / cnstVal2;
- dx2 = minWH * a2 / cnstVal2;
- x2 = hc - dx2;
- x5 = hc + dx2;
- dx3 = minWH * a1 / cnstVal3;
- x3 = hc - dx3;
- x4 = hc + dx3;
- x6 = w - x1;
- y2 = vc - dx2;
- y5 = vc + dx2;
- y3 = vc - dx3;
- y4 = vc + dx3;
- y6 = h - x1;
- string d_val = "M" + 0 + "," + vc +
- " L" + x1 + "," + y2 +
- " L" + x1 + "," + y3 +
- " L" + x3 + "," + y3 +
- " L" + x3 + "," + x1 +
- " L" + x2 + "," + x1 +
- " L" + hc + "," + 0 +
- " L" + x5 + "," + x1 +
- " L" + x4 + "," + x1 +
- " L" + x4 + "," + y3 +
- " L" + x6 + "," + y3 +
- " L" + x6 + "," + y2 +
- " L" + w + "," + vc +
- " L" + x6 + "," + y5 +
- " L" + x6 + "," + y4 +
- " L" + x4 + "," + y4 +
- " L" + x4 + "," + y6 +
- " L" + x5 + "," + y6 +
- " L" + hc + "," + h +
- " L" + x2 + "," + y6 +
- " L" + x3 + "," + y6 +
- " L" + x3 + "," + y4 +
- " L" + x1 + "," + y4 +
- " L" + x1 + "," + y5 + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg LeftRightUpArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- //string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 25000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, a1, a2, a3, q1, x1, x2, dx2, x3, dx3, x4, x5, x6, y2, dy2, y3, y4, y5, maxAdj1, maxAdj3;
- double minWH = System.Math.Min(w, h);
- if (adj2 < 0) a2 = 0;
- else if (adj2 > cnstVal1) a2 = cnstVal1;
- else a2 = adj2;
- maxAdj1 = 2 * a2;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > maxAdj1) a1 = maxAdj1;
- else a1 = adj1;
- q1 = cnstVal2 - maxAdj1;
- maxAdj3 = q1 / 2;
- if (adj3 < 0) a3 = 0;
- else if (adj3 > maxAdj3) a3 = maxAdj3;
- else a3 = adj3;
- x1 = minWH * a3 / cnstVal2;
- dx2 = minWH * a2 / cnstVal2;
- x2 = hc - dx2;
- x5 = hc + dx2;
- dx3 = minWH * a1 / cnstVal3;
- x3 = hc - dx3;
- x4 = hc + dx3;
- x6 = w - x1;
- dy2 = minWH * a2 / cnstVal1;
- y2 = h - dy2;
- y4 = h - dx2;
- y3 = y4 - dx3;
- y5 = y4 + dx3;
- string d_val = "M" + 0 + "," + y4 +
- " L" + x1 + "," + y2 +
- " L" + x1 + "," + y3 +
- " L" + x3 + "," + y3 +
- " L" + x3 + "," + x1 +
- " L" + x2 + "," + x1 +
- " L" + hc + "," + 0 +
- " L" + x5 + "," + x1 +
- " L" + x4 + "," + x1 +
- " L" + x4 + "," + y3 +
- " L" + x6 + "," + y3 +
- " L" + x6 + "," + y2 +
- " L" + w + "," + y4 +
- " L" + x6 + "," + h +
- " L" + x6 + "," + y5 +
- " L" + x1 + "," + y5 +
- " L" + x1 + "," + h + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:直角双向
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg LeftUpArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 25000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, a1, a2, a3, x1, x2, dx2, dx4, dx3, x3, x4, x5, y2, y3, y4, y5, maxAdj1, maxAdj3;
- double minWH = System.Math.Min(w, h);
- if (adj2 < 0) a2 = 0;
- else if (adj2 > cnstVal1) a2 = cnstVal1;
- else a2 = adj2;
- maxAdj1 = 2 * a2;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > maxAdj1) a1 = maxAdj1;
- else a1 = adj1;
- maxAdj3 = cnstVal2 - maxAdj1;
- if (adj3 < 0) a3 = 0;
- else if (adj3 > maxAdj3) a3 = maxAdj3;
- else a3 = adj3;
- x1 = minWH * a3 / cnstVal2;
- dx2 = minWH * a2 / cnstVal1;
- x2 = w - dx2;
- y2 = h - dx2;
- dx4 = minWH * a2 / cnstVal2;
- x4 = w - dx4;
- y4 = h - dx4;
- dx3 = minWH * a1 / cnstVal3;
- x3 = x4 - dx3;
- x5 = x4 + dx3;
- y3 = y4 - dx3;
- y5 = y4 + dx3;
- string d_val = "M" + 0 + "," + y4 +
- " L" + x1 + "," + y2 +
- " L" + x1 + "," + y3 +
- " L" + x3 + "," + y3 +
- " L" + x3 + "," + x1 +
- " L" + x2 + "," + x1 +
- " L" + x4 + "," + 0 +
- " L" + w + "," + x1 +
- " L" + x5 + "," + x1 +
- " L" + x5 + "," + y5 +
- " L" + x1 + "," + y5 +
- " L" + x1 + "," + h + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg BentUpArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 25000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, a1, a2, a3, dx1, x1, dx2, x2, dx3, x3, x4, y1, y2, dy2, maxAdj3 = 0.0;
- double minWH = System.Math.Min(w, h);
- if (adj1 < 0) a1 = 0;
- else if (adj1 > cnstVal1) a1 = cnstVal1;
- else a1 = adj1;
- if (adj2 < 0) a2 = 0;
- else if (adj2 > cnstVal1) a2 = cnstVal1;
- else a2 = adj2;
- if (adj3 < 0) a3 = 0;
- else if (adj3 > maxAdj3) a3 = maxAdj3;
- else a3 = adj3;
- y1 = minWH * a3 / cnstVal2;
- dx1 = minWH * a2 / cnstVal1;
- x1 = w - dx1;
- dx3 = minWH * a2 / cnstVal2;
- x3 = w - dx3;
- dx2 = minWH * a1 / cnstVal3;
- x2 = x3 - dx2;
- x4 = x3 + dx2;
- dy2 = minWH * a1 / cnstVal2;
- y2 = h - dy2;
- string d_val = "M" + 0 + "," + y2 +
- " L" + x2 + "," + y2 +
- " L" + x2 + "," + y1 +
- " L" + x1 + "," + y1 +
- " L" + x3 + "," + 0 +
- " L" + w + "," + y1 +
- " L" + x4 + "," + y1 +
- " L" + x4 + "," + h +
- " L" + 0 + "," + h + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:圆角右
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg BentArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 25000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double adj4 = 43750 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = double.Parse(sAdj4.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double a1, a2, a3, a4, x3, x4, y3, y4, y5, y6, maxAdj1, maxAdj4;
- double minWH = System.Math.Min(w, h);
- if (adj2 < 0) a2 = 0;
- else if (adj2 > cnstVal1) a2 = cnstVal1;
- else a2 = adj2;
- maxAdj1 = 2 * a2;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > maxAdj1) a1 = maxAdj1;
- else a1 = adj1;
- if (adj3 < 0) a3 = 0;
- else if (adj3 > cnstVal1) a3 = cnstVal1;
- else a3 = adj3;
- double th, aw2, th2, dh2, ah, bw, bh, bs, bd, bd3, bd2;
- th = minWH * a1 / cnstVal2;
- aw2 = minWH * a2 / cnstVal2;
- th2 = th / 2;
- dh2 = aw2 - th2;
- ah = minWH * a3 / cnstVal2;
- bw = w - ah;
- bh = h - dh2;
- bs = (bw < bh) ? bw : bh;
- maxAdj4 = cnstVal2 * bs / minWH;
- if (adj4 < 0) a4 = 0;
- else if (adj4 > maxAdj4) a4 = maxAdj4;
- else a4 = adj4;
- bd = minWH * a4 / cnstVal2;
- bd3 = bd - th;
- bd2 = (bd3 > 0) ? bd3 : 0;
- x3 = th + bd2;
- x4 = w - ah;
- y3 = dh2 + th;
- y4 = y3 + dh2;
- y5 = dh2 + bd;
- y6 = y3 + bd2;
- string d_val = "M" + 0 + "," + h +
- " L" + 0 + "," + y5 +
- ShapeArc(bd, y5, bd, bd, 180, 270, false).Replace("M", "L") +
- " L" + x4 + "," + dh2 +
- " L" + x4 + "," + 0 +
- " L" + w + "," + aw2 +
- " L" + x4 + "," + y4 +
- " L" + x4 + "," + y3 +
- " L" + x3 + "," + y3 +
- ShapeArc(x3, y6, bd2, bd2, 270, 180, false).Replace("M", "L") +
- " L" + th + "," + h + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:手杖形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg UturnArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 25000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double adj4 = 43750 * px9d6 / px91d4400;
- double adj5 = 75000 * px9d6 / px91d4400;
- double cnstVal1 = 25000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = double.Parse(sAdj4.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj5")
- {
- XmlNode sAdj5 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj5 = double.Parse(sAdj5.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double a1, a2, a3, a4, a5, q1, q2, q3, x3, x4, x5, x6, x7, x8, x9, y4, y5, minAdj5, maxAdj1, maxAdj3, maxAdj4;
- double minWH = System.Math.Min(w, h);
- if (adj2 < 0) a2 = 0;
- else if (adj2 > cnstVal1) a2 = cnstVal1;
- else a2 = adj2;
- maxAdj1 = 2 * a2; ;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > maxAdj1) a1 = maxAdj1;
- else a1 = adj1;
- q2 = a1 * minWH / h;
- q3 = cnstVal2 - q2;
- maxAdj3 = q3 * h / minWH;
- if (adj3 < 0) a3 = 0;
- else if (adj3 > maxAdj3) a3 = maxAdj3;
- else a3 = adj3;
- q1 = a3 + a1;
- minAdj5 = q1 * minWH / h;
- if (adj5 < minAdj5) a5 = minAdj5;
- else if (adj5 > cnstVal2) a5 = cnstVal2;
- else a5 = adj5;
- double th, aw2, th2, dh2, ah, bw, bs, bd, bd3, bd2, cx;
- th = minWH * a1 / cnstVal2;
- aw2 = minWH * a2 / cnstVal2;
- th2 = th / 2;
- dh2 = aw2 - th2;
- y5 = h * a5 / cnstVal2;
- ah = minWH * a3 / cnstVal2;
- y4 = y5 - ah;
- x9 = w - dh2;
- bw = x9 / 2;
- bs = (bw < y4) ? bw : y4;
- maxAdj4 = cnstVal2 * bs / minWH;
- if (adj4 < 0) a4 = 0;
- else if (adj4 > maxAdj4) a4 = maxAdj4;
- else a4 = adj4;
- bd = minWH * a4 / cnstVal2;
- bd3 = bd - th;
- bd2 = (bd3 > 0) ? bd3 : 0;
- x3 = th + bd2;
- x8 = w - aw2;
- x6 = x8 - aw2;
- x7 = x6 + dh2;
- x4 = x9 - bd;
- x5 = x7 - bd2;
- cx = (th + x7) / 2;
- double cy = (y4 + th) / 2;
- string d_val = "M" + 0 + "," + h +
- " L" + 0 + "," + bd +
- ShapeArc(bd, bd, bd, bd, 180, 270, false).Replace("M", "L") +
- " L" + x4 + "," + 0 +
- ShapeArc(x4, bd, bd, bd, 270, 360, false).Replace("M", "L") +
- " L" + x9 + "," + y4 +
- " L" + w + "," + y4 +
- " L" + x8 + "," + y5 +
- " L" + x6 + "," + y4 +
- " L" + x7 + "," + y4 +
- " L" + x7 + "," + x3 +
- ShapeArc(x5, x3, bd2, bd2, 0, -90, false).Replace("M", "L") +
- " L" + x3 + "," + th +
- ShapeArc(x3, x3, bd2, bd2, 270, 180, false).Replace("M", "L") +
- " L" + th + "," + h + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:虚尾
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg StripedRightArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 50000 * px9d6 / px91d4400;
- double adj2 = 50000 * px9d6 / px91d4400;
- double cnstVal1 = 100000 * px9d6 / px91d4400;
- double cnstVal2 = 200000 * px9d6 / px91d4400;
- double cnstVal3 = 84375 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double a1, a2, x4, x5, dx5, x6, dx6, y1, dy1, y2, maxAdj2, vc = h / 2;
- double minWH = System.Math.Min(w, h);
- maxAdj2 = cnstVal3 * w / minWH;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > cnstVal1) a1 = cnstVal1;
- else a1 = adj1;
- if (adj2 < 0) a2 = 0;
- else if (adj2 > maxAdj2) a2 = maxAdj2;
- else a2 = adj2;
- x4 = minWH * 5 / 32;
- dx5 = minWH * a2 / cnstVal1;
- x5 = w - dx5;
- dy1 = h * a1 / cnstVal2;
- y1 = vc - dy1;
- y2 = vc + dy1;
- //dx6 = dy1*dx5/hd2;
- //x6 = w-dx6;
- double ssd8 = minWH / 8,
- ssd16 = minWH / 16,
- ssd32 = minWH / 32;
- string d_val = "M" + 0 + "," + y1 +
- " L" + ssd32 + "," + y1 +
- " L" + ssd32 + "," + y2 +
- " L" + 0 + "," + y2 + " z" +
- " M" + ssd16 + "," + y1 +
- " L" + ssd8 + "," + y1 +
- " L" + ssd8 + "," + y2 +
- " L" + ssd16 + "," + y2 + " z" +
- " M" + x4 + "," + y1 +
- " L" + x5 + "," + y1 +
- " L" + x5 + "," + 0 +
- " L" + w + "," + vc +
- " L" + x5 + "," + h +
- " L" + x5 + "," + y2 +
- " L" + x4 + "," + y2 + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:燕尾形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg NotchedRightArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 50000 * px9d6 / px91d4400;
- double adj2 = 50000 * px9d6 / px91d4400;
- double cnstVal1 = 100000 * px9d6 / px91d4400;
- double cnstVal2 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double a1, a2, x1, x2, dx2, y1, dy1, y2, maxAdj2, vc = h / 2, hd2 = vc;
- double minWH = System.Math.Min(w, h);
- maxAdj2 = cnstVal1 * w / minWH;
- if (adj1 < 0) a1 = 0;
- else if (adj1 > cnstVal1) a1 = cnstVal1;
- else a1 = adj1;
- if (adj2 < 0) a2 = 0;
- else if (adj2 > maxAdj2) a2 = maxAdj2;
- else a2 = adj2;
- dx2 = minWH * a2 / cnstVal1;
- x2 = w - dx2;
- dy1 = h * a1 / cnstVal2;
- y1 = vc - dy1;
- y2 = vc + dy1;
- x1 = dy1 * dx2 / hd2;
- string d_val = "M" + 0 + "," + y1 +
- " L" + x2 + "," + y1 +
- " L" + x2 + "," + 0 +
- " L" + w + "," + vc +
- " L" + x2 + "," + h +
- " L" + x2 + "," + y2 +
- " L" + 0 + "," + y2 +
- " L" + x1 + "," + vc + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:五边形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg HomePlate(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 50000 * px9d6 / px91d4400;
- double cnstVal1 = 100000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double a, x1, dx1, maxAdj, vc = h / 2;
- double minWH = System.Math.Min(w, h);
- maxAdj = cnstVal1 * w / minWH;
- if (adj < 0) a = 0;
- else if (adj > maxAdj) a = maxAdj;
- else a = adj;
- dx1 = minWH * a / cnstVal1; ;
- x1 = w - dx1;
- string d_val = "M" + 0 + "," + 0 +
- " L" + x1 + "," + 0 +
- " L" + w + "," + vc +
- " L" + x1 + "," + h +
- " L" + 0 + "," + h + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:V形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Chevron(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 50000 * px9d6 / px91d4400;
- double cnstVal1 = 100000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double a, x1, dx1, x2, maxAdj, vc = h / 2;
- double minWH = System.Math.Min(w, h);
- maxAdj = cnstVal1 * w / minWH;
- if (adj < 0) a = 0;
- else if (adj > maxAdj) a = maxAdj;
- else a = adj;
- x1 = minWH * a / cnstVal1;
- x2 = w - x1;
- string d_val = "M" + 0 + "," + 0 +
- " L" + x2 + "," + 0 +
- " L" + w + "," + vc +
- " L" + x2 + "," + h +
- " L" + 0 + "," + h +
- " L" + x1 + "," + vc + " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 标注:右箭头
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg RightArrowCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 25000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double adj4 = 64977 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = double.Parse(sAdj4.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double maxAdj2, a2, maxAdj1, a1, maxAdj3, a3, q2, maxAdj4, a4, dy1, dy2, y1, y2, y3, y4, dx3, x3, x2, x1;
- double vc = h / 2, r = w, b = h, l = 0, t = 0;
- double ss = System.Math.Min(w, h);
- maxAdj2 = cnstVal1 * h / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- maxAdj1 = a2 * 2;
- a1 = (adj1 < 0) ? 0 : (adj1 > maxAdj1) ? maxAdj1 : adj1;
- maxAdj3 = cnstVal2 * w / ss;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- q2 = a3 * ss / w;
- maxAdj4 = cnstVal2 - q2;
- a4 = (adj4 < 0) ? 0 : (adj4 > maxAdj4) ? maxAdj4 : adj4;
- dy1 = ss * a2 / cnstVal2;
- dy2 = ss * a1 / cnstVal3;
- y1 = vc - dy1;
- y2 = vc - dy2;
- y3 = vc + dy2;
- y4 = vc + dy1;
- dx3 = ss * a3 / cnstVal2;
- x3 = r - dx3;
- x2 = w * a4 / cnstVal2;
- x1 = x2 / 2;
- string d_val = "M" + l + "," + t +
- " L" + x2 + "," + t +
- " L" + x2 + "," + y2 +
- " L" + x3 + "," + y2 +
- " L" + x3 + "," + y1 +
- " L" + r + "," + vc +
- " L" + x3 + "," + y4 +
- " L" + x3 + "," + y3 +
- " L" + x2 + "," + y3 +
- " L" + x2 + "," + b +
- " L" + l + "," + b +
- " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 标注:下箭头
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg DownArrowCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 25000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double adj4 = 64977 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = double.Parse(sAdj4.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double maxAdj2, a2, maxAdj1, a1, maxAdj3, a3, q2, maxAdj4, a4, dx1, dx2, x1, x2, x3, x4, dy3, y3, y2, y1;
- double hc = w / 2, r = w, b = h, l = 0, t = 0;
- double ss = System.Math.Min(w, h);
- maxAdj2 = cnstVal1 * w / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- maxAdj1 = a2 * 2;
- a1 = (adj1 < 0) ? 0 : (adj1 > maxAdj1) ? maxAdj1 : adj1;
- maxAdj3 = cnstVal2 * h / ss;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- q2 = a3 * ss / h;
- maxAdj4 = cnstVal2 - q2;
- a4 = (adj4 < 0) ? 0 : (adj4 > maxAdj4) ? maxAdj4 : adj4;
- dx1 = ss * a2 / cnstVal2;
- dx2 = ss * a1 / cnstVal3;
- x1 = hc - dx1;
- x2 = hc - dx2;
- x3 = hc + dx2;
- x4 = hc + dx1;
- dy3 = ss * a3 / cnstVal2;
- y3 = b - dy3;
- y2 = h * a4 / cnstVal2;
- y1 = y2 / 2;
- string d_val = "M" + l + "," + t +
- " L" + r + "," + t +
- " L" + r + "," + y2 +
- " L" + x3 + "," + y2 +
- " L" + x3 + "," + y3 +
- " L" + x4 + "," + y3 +
- " L" + hc + "," + b +
- " L" + x1 + "," + y3 +
- " L" + x2 + "," + y3 +
- " L" + x2 + "," + y2 +
- " L" + l + "," + y2 +
- " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 标注:左箭头
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg LeftArrowCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 25000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double adj4 = 64977 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = double.Parse(sAdj4.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double maxAdj2, a2, maxAdj1, a1, maxAdj3, a3, q2, maxAdj4, a4, dy1, dy2, y1, y2, y3, y4, x1, dx2, x2, x3;
- double vc = h / 2, r = w, b = h, l = 0, t = 0;
- double ss = System.Math.Min(w, h);
- maxAdj2 = cnstVal1 * h / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- maxAdj1 = a2 * 2;
- a1 = (adj1 < 0) ? 0 : (adj1 > maxAdj1) ? maxAdj1 : adj1;
- maxAdj3 = cnstVal2 * w / ss;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- q2 = a3 * ss / w;
- maxAdj4 = cnstVal2 - q2;
- a4 = (adj4 < 0) ? 0 : (adj4 > maxAdj4) ? maxAdj4 : adj4;
- dy1 = ss * a2 / cnstVal2;
- dy2 = ss * a1 / cnstVal3;
- y1 = vc - dy1;
- y2 = vc - dy2;
- y3 = vc + dy2;
- y4 = vc + dy1;
- x1 = ss * a3 / cnstVal2;
- dx2 = w * a4 / cnstVal2;
- x2 = r - dx2;
- x3 = (x2 + r) / 2;
- string d_val = "M" + l + "," + vc +
- " L" + x1 + "," + y1 +
- " L" + x1 + "," + y2 +
- " L" + x2 + "," + y2 +
- " L" + x2 + "," + t +
- " L" + r + "," + t +
- " L" + r + "," + b +
- " L" + x2 + "," + b +
- " L" + x2 + "," + y3 +
- " L" + x1 + "," + y3 +
- " L" + x1 + "," + y4 +
- " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 标注:上箭头
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg UpArrowCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 25000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double adj4 = 64977 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = double.Parse(sAdj4.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double maxAdj2, a2, maxAdj1, a1, maxAdj3, a3, q2, maxAdj4, a4, dx1, dx2, x1, x2, x3, x4, y1, dy2, y2, y3;
- double hc = w / 2, r = w, b = h, l = 0, t = 0;
- double ss = System.Math.Min(w, h);
- maxAdj2 = cnstVal1 * w / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- maxAdj1 = a2 * 2;
- a1 = (adj1 < 0) ? 0 : (adj1 > maxAdj1) ? maxAdj1 : adj1;
- maxAdj3 = cnstVal2 * h / ss;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- q2 = a3 * ss / h;
- maxAdj4 = cnstVal2 - q2;
- a4 = (adj4 < 0) ? 0 : (adj4 > maxAdj4) ? maxAdj4 : adj4;
- dx1 = ss * a2 / cnstVal2;
- dx2 = ss * a1 / cnstVal3;
- x1 = hc - dx1;
- x2 = hc - dx2;
- x3 = hc + dx2;
- x4 = hc + dx1;
- y1 = ss * a3 / cnstVal2;
- dy2 = h * a4 / cnstVal2;
- y2 = b - dy2;
- y3 = (y2 + b) / 2;
- string d_val = "M" + l + "," + y2 +
- " L" + x2 + "," + y2 +
- " L" + x2 + "," + y1 +
- " L" + x1 + "," + y1 +
- " L" + hc + "," + t +
- " L" + x4 + "," + y1 +
- " L" + x3 + "," + y1 +
- " L" + x3 + "," + y2 +
- " L" + r + "," + y2 +
- " L" + r + "," + b +
- " L" + l + "," + b +
- " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 标注:左右箭头
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg LeftRightArrowCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 25000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double adj4 = 48123 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = double.Parse(sAdj4.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double maxAdj2, a2, maxAdj1, a1, maxAdj3, a3, q2, maxAdj4, a4, dy1, dy2, y1, y2, y3, y4, x1, x4, dx2, x2, x3;
- double vc = h / 2, hc = w / 2, r = w, b = h, l = 0, t = 0, wd2 = w / 2;
- double ss = System.Math.Min(w, h);
- maxAdj2 = cnstVal1 * h / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- maxAdj1 = a2 * 2;
- a1 = (adj1 < 0) ? 0 : (adj1 > maxAdj1) ? maxAdj1 : adj1;
- maxAdj3 = cnstVal1 * w / ss;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- q2 = a3 * ss / wd2;
- maxAdj4 = cnstVal2 - q2;
- a4 = (adj4 < 0) ? 0 : (adj4 > maxAdj4) ? maxAdj4 : adj4;
- dy1 = ss * a2 / cnstVal2;
- dy2 = ss * a1 / cnstVal3;
- y1 = vc - dy1;
- y2 = vc - dy2;
- y3 = vc + dy2;
- y4 = vc + dy1;
- x1 = ss * a3 / cnstVal2;
- x4 = r - x1;
- dx2 = w * a4 / cnstVal3;
- x2 = hc - dx2;
- x3 = hc + dx2;
- string d_val = "M" + l + "," + vc +
- " L" + x1 + "," + y1 +
- " L" + x1 + "," + y2 +
- " L" + x2 + "," + y2 +
- " L" + x2 + "," + t +
- " L" + x3 + "," + t +
- " L" + x3 + "," + y2 +
- " L" + x4 + "," + y2 +
- " L" + x4 + "," + y1 +
- " L" + r + "," + vc +
- " L" + x4 + "," + y4 +
- " L" + x4 + "," + y3 +
- " L" + x3 + "," + y3 +
- " L" + x3 + "," + b +
- " L" + x2 + "," + b +
- " L" + x2 + "," + y3 +
- " L" + x1 + "," + y3 +
- " L" + x1 + "," + y4 +
- " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 标注:十字箭头
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg QuadArrowCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 18515 * px9d6 / px91d4400;
- double adj2 = 18515 * px9d6 / px91d4400;
- double adj3 = 18515 * px9d6 / px91d4400;
- double adj4 = 48123 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = double.Parse(sAdj4.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, r = w, b = h, l = 0, t = 0;
- double ss = System.Math.Min(w, h);
- double a2, maxAdj1, a1, maxAdj3, a3, q2, maxAdj4, a4, dx2, dx3, ah, dx1, dy1, x8, x2, x7, x3, x6, x4, x5, y8, y2, y7, y3, y6, y4, y5;
- a2 = (adj2 < 0) ? 0 : (adj2 > cnstVal1) ? cnstVal1 : adj2;
- maxAdj1 = a2 * 2;
- a1 = (adj1 < 0) ? 0 : (adj1 > maxAdj1) ? maxAdj1 : adj1;
- maxAdj3 = cnstVal1 - a2;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- q2 = a3 * 2;
- maxAdj4 = cnstVal2 - q2;
- a4 = (adj4 < a1) ? a1 : (adj4 > maxAdj4) ? maxAdj4 : adj4;
- dx2 = ss * a2 / cnstVal2;
- dx3 = ss * a1 / cnstVal3;
- ah = ss * a3 / cnstVal2;
- dx1 = w * a4 / cnstVal3;
- dy1 = h * a4 / cnstVal3;
- x8 = r - ah;
- x2 = hc - dx1;
- x7 = hc + dx1;
- x3 = hc - dx2;
- x6 = hc + dx2;
- x4 = hc - dx3;
- x5 = hc + dx3;
- y8 = b - ah;
- y2 = vc - dy1;
- y7 = vc + dy1;
- y3 = vc - dx2;
- y6 = vc + dx2;
- y4 = vc - dx3;
- y5 = vc + dx3;
- string d_val = "M" + l + "," + vc +
- " L" + ah + "," + y3 +
- " L" + ah + "," + y4 +
- " L" + x2 + "," + y4 +
- " L" + x2 + "," + y2 +
- " L" + x4 + "," + y2 +
- " L" + x4 + "," + ah +
- " L" + x3 + "," + ah +
- " L" + hc + "," + t +
- " L" + x6 + "," + ah +
- " L" + x5 + "," + ah +
- " L" + x5 + "," + y2 +
- " L" + x7 + "," + y2 +
- " L" + x7 + "," + y4 +
- " L" + x8 + "," + y4 +
- " L" + x8 + "," + y3 +
- " L" + r + "," + vc +
- " L" + x8 + "," + y6 +
- " L" + x8 + "," + y5 +
- " L" + x7 + "," + y5 +
- " L" + x7 + "," + y7 +
- " L" + x5 + "," + y7 +
- " L" + x5 + "," + y8 +
- " L" + x6 + "," + y8 +
- " L" + hc + "," + b +
- " L" + x3 + "," + y8 +
- " L" + x4 + "," + y8 +
- " L" + x4 + "," + y7 +
- " L" + x2 + "," + y7 +
- " L" + x2 + "," + y5 +
- " L" + ah + "," + y5 +
- " L" + ah + "," + y6 +
- " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:上弧形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg CurvedDownArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 50000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, wd2 = w / 2, r = w, b = h, l = 0, t = 0, c3d4 = 270, cd2 = 180, cd4 = 90;
- double ss = System.Math.Min(w, h);
- double maxAdj2, a2, a1, th, aw, q1, wR, q7, q8, q9, q10, q11, idy, maxAdj3, a3, ah, x3, q2, q3, q4, q5, dx, x5, x7, q6, dh, x4, x8, aw2, x6, y1, swAng, mswAng, iy, ix, q12, dang2, stAng, stAng2, swAng2, swAng3;
- maxAdj2 = cnstVal1 * w / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal2) ? cnstVal2 : adj1;
- th = ss * a1 / cnstVal2;
- aw = ss * a2 / cnstVal2;
- q1 = (th + aw) / 4;
- wR = wd2 - q1;
- q7 = wR * 2;
- q8 = q7 * q7;
- q9 = th * th;
- q10 = q8 - q9;
- q11 = System.Math.Sqrt(q10);
- idy = q11 * h / q7;
- maxAdj3 = cnstVal2 * idy / ss;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- ah = ss * adj3 / cnstVal2;
- x3 = wR + th;
- q2 = h * h;
- q3 = ah * ah;
- q4 = q2 - q3;
- q5 = System.Math.Sqrt(q4);
- dx = q5 * wR / h;
- x5 = wR + dx;
- x7 = x3 + dx;
- q6 = aw - th;
- dh = q6 / 2;
- x4 = x5 - dh;
- x8 = x7 + dh;
- aw2 = aw / 2;
- x6 = r - aw2;
- y1 = b - ah;
- swAng = System.Math.Atan(dx / ah);
- double swAngDeg = swAng * 180 / System.Math.PI;
- mswAng = -swAngDeg;
- iy = b - idy;
- ix = (wR + x3) / 2;
- q12 = th / 2;
- dang2 = System.Math.Atan(q12 / idy);
- double dang2Deg = dang2 * 180 / System.Math.PI;
- stAng = c3d4 + swAngDeg;
- stAng2 = c3d4 - dang2Deg;
- swAng2 = dang2Deg - cd4;
- swAng3 = cd4 + dang2Deg;
- //double cX = x5 - System.Math.Cos(stAng*Math.PI/180) * wR;
- //double cY = y1 - System.Math.Sin(stAng*Math.PI/180) * h;
- string d_val = "M" + x6 + "," + b +
- " L" + x4 + "," + y1 +
- " L" + x5 + "," + y1 +
- ShapeArc(wR, h, wR, h, stAng, (stAng + mswAng), false).Replace("M", "L") +
- " L" + x3 + "," + t +
- ShapeArc(x3, h, wR, h, c3d4, (c3d4 + swAngDeg), false).Replace("M", "L") +
- " L" + (x5 + th) + "," + y1 +
- " L" + x8 + "," + y1 +
- " z" +
- "M" + x3 + "," + t +
- ShapeArc(x3, h, wR, h, stAng2, (stAng2 + swAng2), false).Replace("M", "L") +
- ShapeArc(wR, h, wR, h, cd2, (cd2 + swAng3), false).Replace("M", "L");
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg CurvedLeftArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 50000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, hd2 = h / 2, r = w, b = h, l = 0, t = 0, c3d4 = 270, cd2 = 180, cd4 = 90;
- double ss = System.Math.Min(w, h);
- double maxAdj2, a2, a1, th, aw, q1, hR, q7, q8, q9, q10, q11, idx, maxAdj3, a3, ah, y3, q2, q3, q4, q5, dy, y5, y7, q6, dh, y4, y8, aw2, y6, x1, swAng, mswAng, ix, iy, q12, dang2, swAng2, swAng3, stAng3;
- maxAdj2 = cnstVal1 * h / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- a1 = (adj1 < 0) ? 0 : (adj1 > a2) ? a2 : adj1;
- th = ss * a1 / cnstVal2;
- aw = ss * a2 / cnstVal2;
- q1 = (th + aw) / 4;
- hR = hd2 - q1;
- q7 = hR * 2;
- q8 = q7 * q7;
- q9 = th * th;
- q10 = q8 - q9;
- q11 = System.Math.Sqrt(q10);
- idx = q11 * w / q7;
- maxAdj3 = cnstVal2 * idx / ss;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- ah = ss * a3 / cnstVal2;
- y3 = hR + th;
- q2 = w * w;
- q3 = ah * ah;
- q4 = q2 - q3;
- q5 = System.Math.Sqrt(q4);
- dy = q5 * hR / w;
- y5 = hR + dy;
- y7 = y3 + dy;
- q6 = aw - th;
- dh = q6 / 2;
- y4 = y5 - dh;
- y8 = y7 + dh;
- aw2 = aw / 2;
- y6 = b - aw2;
- x1 = l + ah;
- swAng = System.Math.Atan(dy / ah);
- mswAng = -swAng;
- ix = l + idx;
- iy = (hR + y3) / 2;
- q12 = th / 2;
- dang2 = System.Math.Atan(q12 / idx);
- swAng2 = dang2 - swAng;
- swAng3 = swAng + dang2;
- stAng3 = -dang2;
- double swAngDg, swAng2Dg, swAng3Dg, stAng3dg;
- swAngDg = swAng * 180 / System.Math.PI;
- swAng2Dg = swAng2 * 180 / System.Math.PI;
- swAng3Dg = swAng3 * 180 / System.Math.PI;
- stAng3dg = stAng3 * 180 / System.Math.PI;
- string d_val = "M" + r + "," + y3 +
- ShapeArc(l, hR, w, hR, 0, -cd4, false).Replace("M", "L") +
- " L" + l + "," + t +
- ShapeArc(l, y3, w, hR, c3d4, (c3d4 + cd4), false).Replace("M", "L") +
- " L" + r + "," + y3 +
- ShapeArc(l, y3, w, hR, 0, swAngDg, false).Replace("M", "L") +
- " L" + x1 + "," + y7 +
- " L" + x1 + "," + y8 +
- " L" + l + "," + y6 +
- " L" + x1 + "," + y4 +
- " L" + x1 + "," + y5 +
- ShapeArc(l, hR, w, hR, swAngDg, (swAngDg + swAng2Dg), false).Replace("M", "L") +
- ShapeArc(l, hR, w, hR, 0, -cd4, false).Replace("M", "L") +
- ShapeArc(l, y3, w, hR, c3d4, (c3d4 + cd4), false).Replace("M", "L");
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:左弧形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg CurvedRightArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 50000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, hd2 = h / 2, r = w, b = h, l = 0, t = 0, c3d4 = 270, cd2 = 180, cd4 = 90;
- double ss = System.Math.Min(w, h);
- double maxAdj2, a2, a1, th, aw, q1, hR, q7, q8, q9, q10, q11, idx, maxAdj3, a3, ah, y3, q2, q3, q4, q5, dy, y5, y7, q6, dh, y4, y8, aw2, y6, x1, swAng, stAng, mswAng, ix, iy, q12, dang2, swAng2, swAng3, stAng3;
- maxAdj2 = cnstVal1 * h / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- a1 = (adj1 < 0) ? 0 : (adj1 > a2) ? a2 : adj1;
- th = ss * a1 / cnstVal2;
- aw = ss * a2 / cnstVal2;
- q1 = (th + aw) / 4;
- hR = hd2 - q1;
- q7 = hR * 2;
- q8 = q7 * q7;
- q9 = th * th;
- q10 = q8 - q9;
- q11 = System.Math.Sqrt(q10);
- idx = q11 * w / q7;
- maxAdj3 = cnstVal2 * idx / ss;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- ah = ss * a3 / cnstVal2;
- y3 = hR + th;
- q2 = w * w;
- q3 = ah * ah;
- q4 = q2 - q3;
- q5 = System.Math.Sqrt(q4);
- dy = q5 * hR / w;
- y5 = hR + dy;
- y7 = y3 + dy;
- q6 = aw - th;
- dh = q6 / 2;
- y4 = y5 - dh;
- y8 = y7 + dh;
- aw2 = aw / 2;
- y6 = b - aw2;
- x1 = r - ah;
- swAng = System.Math.Atan(dy / ah);
- stAng = System.Math.PI + 0 - swAng;
- mswAng = -swAng;
- ix = r - idx;
- iy = (hR + y3) / 2;
- q12 = th / 2;
- dang2 = System.Math.Atan(q12 / idx);
- swAng2 = dang2 - System.Math.PI / 2;
- swAng3 = System.Math.PI / 2 + dang2;
- stAng3 = System.Math.PI - dang2;
- double stAngDg, mswAngDg, swAngDg, swAng2dg;
- stAngDg = stAng * 180 / System.Math.PI;
- mswAngDg = mswAng * 180 / System.Math.PI;
- swAngDg = swAng * 180 / System.Math.PI;
- swAng2dg = swAng2 * 180 / System.Math.PI;
- string d_val = "M" + l + "," + hR +
- ShapeArc(w, hR, w, hR, cd2, cd2 + mswAngDg, false).Replace("M", "L") +
- " L" + x1 + "," + y5 +
- " L" + x1 + "," + y4 +
- " L" + r + "," + y6 +
- " L" + x1 + "," + y8 +
- " L" + x1 + "," + y7 +
- ShapeArc(w, y3, w, hR, stAngDg, stAngDg + swAngDg, false).Replace("M", "L") +
- " L" + l + "," + hR +
- ShapeArc(w, hR, w, hR, cd2, cd2 + cd4, false).Replace("M", "L") +
- " L" + r + "," + th +
- ShapeArc(w, y3, w, hR, c3d4, c3d4 + swAng2dg, false).Replace("M", "L")
- ;
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- //"' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:下弧形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg CurvedUpArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 25000 * px9d6 / px91d4400;
- double adj2 = 50000 * px9d6 / px91d4400;
- double adj3 = 25000 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, wd2 = w / 2, r = w, b = h, l = 0, t = 0, c3d4 = 270, cd2 = 180, cd4 = 90;
- double ss = System.Math.Min(w, h);
- double maxAdj2, a2, a1, th, aw, q1, wR, q7, q8, q9, q10, q11, idy, maxAdj3, a3, ah, x3, q2, q3, q4, q5, dx, x5, x7, q6, dh, x4, x8, aw2, x6, y1, swAng, mswAng, iy, ix, q12, dang2, swAng2, mswAng2, stAng3, swAng3, stAng2;
- maxAdj2 = cnstVal1 * w / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal2) ? cnstVal2 : adj1;
- th = ss * a1 / cnstVal2;
- aw = ss * a2 / cnstVal2;
- q1 = (th + aw) / 4;
- wR = wd2 - q1;
- q7 = wR * 2;
- q8 = q7 * q7;
- q9 = th * th;
- q10 = q8 - q9;
- q11 = System.Math.Sqrt(q10);
- idy = q11 * h / q7;
- maxAdj3 = cnstVal2 * idy / ss;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- ah = ss * adj3 / cnstVal2;
- x3 = wR + th;
- q2 = h * h;
- q3 = ah * ah;
- q4 = q2 - q3;
- q5 = System.Math.Sqrt(q4);
- dx = q5 * wR / h;
- x5 = wR + dx;
- x7 = x3 + dx;
- q6 = aw - th;
- dh = q6 / 2;
- x4 = x5 - dh;
- x8 = x7 + dh;
- aw2 = aw / 2;
- x6 = r - aw2;
- y1 = t + ah;
- swAng = System.Math.Atan(dx / ah);
- mswAng = -swAng;
- iy = t + idy;
- ix = (wR + x3) / 2;
- q12 = th / 2;
- dang2 = System.Math.Atan(q12 / idy);
- swAng2 = dang2 - swAng;
- mswAng2 = -swAng2;
- stAng3 = System.Math.PI / 2 - swAng;
- swAng3 = swAng + dang2;
- stAng2 = System.Math.PI / 2 - dang2;
- double stAng2dg, swAng2dg, swAngDg, stAng3dg;
- stAng2dg = stAng2 * 180 / System.Math.PI;
- swAng2dg = swAng2 * 180 / System.Math.PI;
- stAng3dg = stAng3 * 180 / System.Math.PI;
- swAngDg = swAng * 180 / System.Math.PI;
- string d_val = //"M" + ix + "," +iy +
- ShapeArc(wR, 0, wR, h, stAng2dg, stAng2dg + swAng2dg, false) + //.Replace("M","L") +
- " L" + x5 + "," + y1 +
- " L" + x4 + "," + y1 +
- " L" + x6 + "," + t +
- " L" + x8 + "," + y1 +
- " L" + x7 + "," + y1 +
- ShapeArc(x3, 0, wR, h, stAng3dg, stAng3dg + swAngDg, false).Replace("M", "L") +
- " L" + wR + "," + b +
- ShapeArc(wR, 0, wR, h, cd4, cd2, false).Replace("M", "L") +
- " L" + th + "," + t +
- ShapeArc(x3, 0, wR, h, cd2, cd4, false).Replace("M", "L") +
- "";
- //result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg MathDivide(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 0.0;
- double adj2 = 0.0;
- double adj3 = 0.0;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4));
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4));
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = double.Parse(sAdj3.Value.Substring(4));
- }
- }
- }
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double cnstVal3 = 200000 * px9d6 / px91d4400;
- string dVal = "";
- double hc = w / 2, vc = h / 2, hd2 = h / 2;
- if (shapType == "mathNotEqual")
- {
- if (shapAdjst_ary == null|| shapAdjst_ary.Count==0)
- {
- adj1 = 23520 * px9d6 / px91d4400;
- adj2 = 110 * System.Math.PI / 180;
- adj3 = 11760 * px9d6 / px91d4400;
- }
- else
- {
- adj1 = adj1 * px9d6 / px91d4400;
- adj2 = (adj2 / 60000.00) * System.Math.PI / 180;
- adj3 = adj3 * px9d6 / px91d4400;
- }
- double a1, crAng, a2a1, maxAdj3, a3, dy1, dy2, dx1, x1, x8, y2, y3, y1, y4,
- cadj2, xadj2, len, bhw, bhw2, x7, dx67, x6, dx57, x5, dx47, x4, dx37,
- x3, dx27, x2, rx7, rx6, rx5, rx4, rx3, rx2, dx7, rxt, lxt, rx, lx,
- dy3, dy4, ry, ly, dlx, drx, dly, dry, xC1, xC2, yC1, yC2, yC3, yC4;
- double angVal1 = 70 * System.Math.PI / 180, angVal2 = 110 * System.Math.PI / 180;
- double cnstVal4 = 73490 * px9d6 / px91d4400;
- //double cd4 = 90;
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal1) ? cnstVal1 : adj1;
- crAng = (adj2 < angVal1) ? angVal1 : (adj2 > angVal2) ? angVal2 : adj2;
- a2a1 = a1 * 2;
- maxAdj3 = cnstVal2 - a2a1;
- a3 = (adj3 < 0) ? 0 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- dy1 = h * a1 / cnstVal2;
- dy2 = h * a3 / cnstVal3;
- dx1 = w * cnstVal4 / cnstVal3;
- x1 = hc - dx1;
- x8 = hc + dx1;
- y2 = vc - dy2;
- y3 = vc + dy2;
- y1 = y2 - dy1;
- y4 = y3 + dy1;
- cadj2 = crAng - System.Math.PI / 2;
- xadj2 = hd2 * System.Math.Tan(cadj2);
- len = System.Math.Sqrt(xadj2 * xadj2 + hd2 * hd2);
- bhw = len * dy1 / hd2;
- bhw2 = bhw / 2;
- x7 = hc + xadj2 - bhw2;
- dx67 = xadj2 * y1 / hd2;
- x6 = x7 - dx67;
- dx57 = xadj2 * y2 / hd2;
- x5 = x7 - dx57;
- dx47 = xadj2 * y3 / hd2;
- x4 = x7 - dx47;
- dx37 = xadj2 * y4 / hd2;
- x3 = x7 - dx37;
- dx27 = xadj2 * 2;
- x2 = x7 - dx27;
- rx7 = x7 + bhw;
- rx6 = x6 + bhw;
- rx5 = x5 + bhw;
- rx4 = x4 + bhw;
- rx3 = x3 + bhw;
- rx2 = x2 + bhw;
- dx7 = dy1 * hd2 / len;
- rxt = x7 + dx7;
- lxt = rx7 - dx7;
- rx = (cadj2 > 0) ? rxt : rx7;
- lx = (cadj2 > 0) ? x7 : lxt;
- dy3 = dy1 * xadj2 / len;
- dy4 = -dy3;
- ry = (cadj2 > 0) ? dy3 : 0;
- ly = (cadj2 > 0) ? 0 : dy4;
- dlx = w - rx;
- drx = w - lx;
- dly = h - ry;
- dry = h - ly;
- xC1 = (rx + lx) / 2;
- xC2 = (drx + dlx) / 2;
- yC1 = (ry + ly) / 2;
- yC2 = (y1 + y2) / 2;
- yC3 = (y3 + y4) / 2;
- yC4 = (dry + dly) / 2;
- dVal = "M" + x1 + "," + y1 +
- " L" + x6 + "," + y1 +
- " L" + lx + "," + ly +
- " L" + rx + "," + ry +
- " L" + rx6 + "," + y1 +
- " L" + x8 + "," + y1 +
- " L" + x8 + "," + y2 +
- " L" + rx5 + "," + y2 +
- " L" + rx4 + "," + y3 +
- " L" + x8 + "," + y3 +
- " L" + x8 + "," + y4 +
- " L" + rx3 + "," + y4 +
- " L" + drx + "," + dry +
- " L" + dlx + "," + dly +
- " L" + x3 + "," + y4 +
- " L" + x1 + "," + y4 +
- " L" + x1 + "," + y3 +
- " L" + x4 + "," + y3 +
- " L" + x5 + "," + y2 +
- " L" + x1 + "," + y2 +
- " z";
- }
- else if (shapType == "mathDivide")
- {
- if (shapAdjst_ary == null || shapAdjst_ary.Count==0)
- {
- adj1 = 23520 * px9d6 / px91d4400;
- adj2 = 5880 * px9d6 / px91d4400;
- adj3 = 11760 * px9d6 / px91d4400;
- }
- else
- {
- adj1 = adj1 * px9d6 / px91d4400;
- adj2 = adj2 * px9d6 / px91d4400;
- adj3 = adj3 * px9d6 / px91d4400;
- }
- double a1, ma1, ma3h, ma3w, maxAdj3, a3, m4a3, maxAdj2, a2, dy1, yg, rad, dx1,
- y3, y4, a, y2, y1, y5, x1, x3, x2;
- double cnstVal4 = 1000 * px9d6 / px91d4400;
- double cnstVal5 = 36745 * px9d6 / px91d4400;
- double cnstVal6 = 73490 * px9d6 / px91d4400;
- a1 = (adj1 < cnstVal4) ? cnstVal4 : (adj1 > cnstVal5) ? cnstVal5 : adj1;
- ma1 = -a1;
- ma3h = (cnstVal6 + ma1) / 4;
- ma3w = cnstVal5 * w / h;
- maxAdj3 = (ma3h < ma3w) ? ma3h : ma3w;
- a3 = (adj3 < cnstVal4) ? cnstVal4 : (adj3 > maxAdj3) ? maxAdj3 : adj3;
- m4a3 = -4 * a3;
- maxAdj2 = cnstVal6 + m4a3 - a1;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- dy1 = h * a1 / cnstVal3;
- yg = h * a2 / cnstVal2;
- rad = h * a3 / cnstVal2;
- dx1 = w * cnstVal6 / cnstVal3;
- y3 = vc - dy1;
- y4 = vc + dy1;
- a = yg + rad;
- y2 = y3 - a;
- y1 = y2 - rad;
- y5 = h - y1;
- x1 = hc - dx1;
- x3 = hc + dx1;
- x2 = hc - rad;
- double cd4 = 90, c3d4 = 270;
- double cX1 = hc - System.Math.Cos(c3d4 * System.Math.PI / 180) * rad;
- double cY1 = y1 - System.Math.Sin(c3d4 * System.Math.PI / 180) * rad;
- double cX2 = hc - System.Math.Cos(System.Math.PI / 2) * rad;
- double cY2 = y5 - System.Math.Sin(System.Math.PI / 2) * rad;
- dVal = "M" + hc + "," + y1 +
- ShapeArc(cX1, cY1, rad, rad, c3d4, c3d4 + 360, false).Replace("M", "L") +
- " z" +
- " M" + hc + "," + y5 +
- ShapeArc(cX2, cY2, rad, rad, cd4, cd4 + 360, false).Replace("M", "L") +
- " z" +
- " M" + x1 + "," + y3 +
- " L" + x3 + "," + y3 +
- " L" + x3 + "," + y4 +
- " L" + x1 + "," + y4 +
- " z";
- }
- else if (shapType == "mathEqual")
- {
- if (shapAdjst_ary == null || shapAdjst_ary.Count== 0)
- {
- adj1 = 23520 * px9d6 / px91d4400;
- adj2 = 11760 * px9d6 / px91d4400;
- }
- else
- {
- adj1 = adj1 * px9d6 / px91d4400;
- adj2 = adj2 * px9d6 / px91d4400;
- }
- double cnstVal5 = 36745 * px9d6 / px91d4400;
- double cnstVal6 = 73490 * px9d6 / px91d4400;
- double a1, a2a1, mAdj2, a2, dy1, dy2, dx1, y2, y3, y1, y4, x1, x2, yC1, yC2;
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal5) ? cnstVal5 : adj1;
- a2a1 = a1 * 2;
- mAdj2 = cnstVal2 - a2a1;
- a2 = (adj2 < 0) ? 0 : (adj2 > mAdj2) ? mAdj2 : adj2;
- dy1 = h * a1 / cnstVal2;
- dy2 = h * a2 / cnstVal3;
- dx1 = w * cnstVal6 / cnstVal3;
- y2 = vc - dy2;
- y3 = vc + dy2;
- y1 = y2 - dy1;
- y4 = y3 + dy1;
- x1 = hc - dx1;
- x2 = hc + dx1;
- yC1 = (y1 + y2) / 2;
- yC2 = (y3 + y4) / 2;
- dVal = "M" + x1 + "," + y1 +
- " L" + x2 + "," + y1 +
- " L" + x2 + "," + y2 +
- " L" + x1 + "," + y2 +
- " z" +
- "M" + x1 + "," + y3 +
- " L" + x2 + "," + y3 +
- " L" + x2 + "," + y4 +
- " L" + x1 + "," + y4 +
- " z";
- }
- else if (shapType == "mathMinus")
- {
- if (shapAdjst_ary == null ||shapAdjst_ary.Count == 0)
- {
- adj1 = 23520 * px9d6 / px91d4400;
- }
- else
- {
- adj1 = adj1 * px9d6 / px91d4400;
- }
- double cnstVal6 = 73490 * px9d6 / px91d4400;
- double a1, dy1, dx1, y1, y2, x1, x2;
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal2) ? cnstVal2 : adj1;
- dy1 = h * a1 / cnstVal3;
- dx1 = w * cnstVal6 / cnstVal3;
- y1 = vc - dy1;
- y2 = vc + dy1;
- x1 = hc - dx1;
- x2 = hc + dx1;
- dVal = "M" + x1 + "," + y1 +
- " L" + x2 + "," + y1 +
- " L" + x2 + "," + y2 +
- " L" + x1 + "," + y2 +
- " z";
- }
- else if (shapType == "mathMultiply")
- {
- if (shapAdjst_ary == null || shapAdjst_ary.Count == 0)
- {
- adj1 = 23520 * px9d6 / px91d4400;
- }
- else
- {
- adj1 = adj1 * px9d6 / px91d4400;
- }
- double cnstVal6 = 51965 * px9d6 / px91d4400;
- double a1, th, a, sa, ca, ta, dl, rw, lM, xM, yM, dxAM, dyAM,
- xA, yA, xB, yB, xBC, yBC, yC, xD, xE, yFE, xFE, xF, xL, yG, yH, yI, xC2, yC3;
- double ss = System.Math.Min(w, h);
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal6) ? cnstVal6 : adj1;
- th = ss * a1 / cnstVal2;
- a = System.Math.Atan(h / w);
- sa = 1 * System.Math.Sin(a);
- ca = 1 * System.Math.Cos(a);
- ta = 1 * System.Math.Tan(a);
- dl = System.Math.Sqrt(w * w + h * h);
- rw = dl * cnstVal6 / cnstVal2;
- lM = dl - rw;
- xM = ca * lM / 2;
- yM = sa * lM / 2;
- dxAM = sa * th / 2;
- dyAM = ca * th / 2;
- xA = xM - dxAM;
- yA = yM + dyAM;
- xB = xM + dxAM;
- yB = yM - dyAM;
- xBC = hc - xB;
- yBC = xBC * ta;
- yC = yBC + yB;
- xD = w - xB;
- xE = w - xA;
- yFE = vc - yA;
- xFE = yFE / ta;
- xF = xE - xFE;
- xL = xA + xFE;
- yG = h - yA;
- yH = h - yB;
- yI = h - yC;
- xC2 = w - xM;
- yC3 = h - yM;
- dVal = "M" + xA + "," + yA +
- " L" + xB + "," + yB +
- " L" + hc + "," + yC +
- " L" + xD + "," + yB +
- " L" + xE + "," + yA +
- " L" + xF + "," + vc +
- " L" + xE + "," + yG +
- " L" + xD + "," + yH +
- " L" + hc + "," + yI +
- " L" + xB + "," + yH +
- " L" + xA + "," + yG +
- " L" + xL + "," + vc +
- " z";
- }
- else if (shapType == "mathPlus")
- {
- if (shapAdjst_ary == null || shapAdjst_ary.Count == 0)
- {
- adj1 = 23520 * px9d6 / px91d4400;
- }
- else
- {
- adj1 = adj1 * px9d6 / px91d4400;
- }
- double cnstVal6 = 73490 * px9d6 / px91d4400;
- double ss = System.Math.Min(w, h);
- double a1, dx1, dy1, dx2, x1, x2, x3, x4, y1, y2, y3, y4;
- a1 = (adj1 < 0) ? 0 : (adj1 > cnstVal6) ? cnstVal6 : adj1;
- dx1 = w * cnstVal6 / cnstVal3;
- dy1 = h * cnstVal6 / cnstVal3;
- dx2 = ss * a1 / cnstVal3;
- x1 = hc - dx1;
- x2 = hc - dx2;
- x3 = hc + dx2;
- x4 = hc + dx1;
- y1 = vc - dy1;
- y2 = vc - dx2;
- y3 = vc + dx2;
- y4 = vc + dy1;
- dVal = "M" + x1 + "," + y2 +
- " L" + x2 + "," + y2 +
- " L" + x2 + "," + y1 +
- " L" + x3 + "," + y1 +
- " L" + x3 + "," + y2 +
- " L" + x4 + "," + y2 +
- " L" + x4 + "," + y3 +
- " L" + x3 + "," + y3 +
- " L" + x3 + "," + y4 +
- " L" + x2 + "," + y4 +
- " L" + x2 + "," + y3 +
- " L" + x1 + "," + y3 +
- " z";
- }
- // result += "<path d='" + dVal + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- //console.log(shapType);
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= dVal,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 等号
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg MathEqual(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return MathDivide(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 减号
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg MathMinus(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return MathDivide(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 乘号
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg MathMultiply(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return MathDivide(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 不等号
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg MathNotEqual(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return MathDivide(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 加号
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg MathPlus(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return MathDivide(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 圆柱体
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg Can(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
- double adj = 25000 * px9d6 / px91d4400;
- double cnstVal1 = 50000 * px9d6 / px91d4400;
- double cnstVal2 = 200000 * px9d6 / px91d4400;
- if (shapAdjst != null)
- {
- adj = double.Parse(shapAdjst.Value.Substring(4)) * px9d6 / px91d4400;
- }
- double ss = System.Math.Min(w, h);
- double maxAdj, a, y1, y2, y3;
- string dVal = "";
- if (shapType == "flowChartMagneticDisk" || shapType == "flowChartMagneticDrum")
- {
- adj = 50000 * px9d6 / px91d4400;
- }
- maxAdj = cnstVal1 * h / ss;
- a = (adj < 0) ? 0 : (adj > maxAdj) ? maxAdj : adj;
- y1 = ss * a / cnstVal2;
- y2 = y1 + y1;
- y3 = h - y1;
- double cd2 = 180, wd2 = w / 2;
- string tranglRott = "";
- string transform = "";
- if (shapType == "flowChartMagneticDrum")
- {
- tranglRott = "transform='rotate(90 " + w / 2 + "," + h / 2 + ")'";
- transform = "rotate(90 " + w / 2 + "," + h / 2 + ")";
- }
- dVal = ShapeArc(wd2, y1, wd2, y1, 0, cd2, false) +
- ShapeArc(wd2, y1, wd2, y1, cd2, cd2 + cd2, false).Replace("M", "L") +
- " L" + w + "," + y3 +
- ShapeArc(wd2, y3, wd2, y1, 0, cd2, false).Replace("M", "L") +
- " L" + 0 + "," + y1;
- // result += "<path " + tranglRott + " d='" + dVal + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- transform=transform,
- d= dVal,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 流程图:磁盘
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartMagneticDisk(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Can(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- /// <summary>
- /// 流程图:直接访问存储器
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg FlowChartMagneticDrum(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return Can(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg SwooshArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double refr = px9d6 / px91d4400;
- double adj1 = 25000 * refr;
- double adj2 = 16667 * refr;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * refr;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = double.Parse(sAdj2.Value.Substring(4)) * refr;
- }
- }
- }
- double cnstVal1 = 1 * refr;
- double cnstVal2 = 70000 * refr;
- double cnstVal3 = 75000 * refr;
- double cnstVal4 = 100000 * refr;
- double ss = System.Math.Min(w, h);
- double ssd8 = ss / 8;
- double hd6 = h / 6;
- double a1, maxAdj2, a2, ad1, ad2, xB, yB, alfa, dx0, xC, dx1, yF, xF, xE, yE, dy2, dy22, dy3, yD, dy4, yP1, xP1, dy5, yP2, xP2;
- a1 = (adj1 < cnstVal1) ? cnstVal1 : (adj1 > cnstVal3) ? cnstVal3 : adj1;
- maxAdj2 = cnstVal2 * w / ss;
- a2 = (adj2 < 0) ? 0 : (adj2 > maxAdj2) ? maxAdj2 : adj2;
- ad1 = h * a1 / cnstVal4;
- ad2 = ss * a2 / cnstVal4;
- xB = w - ad2;
- yB = ssd8;
- alfa = (System.Math.PI / 2) / 14;
- dx0 = ssd8 * System.Math.Tan(alfa);
- xC = xB - dx0;
- dx1 = ad1 * System.Math.Tan(alfa);
- yF = yB + ad1;
- xF = xB + dx1;
- xE = xF + dx0;
- yE = yF + ssd8;
- dy2 = yE - 0;
- dy22 = dy2 / 2;
- dy3 = h / 20;
- yD = dy22 - dy3;
- dy4 = hd6;
- yP1 = hd6 + dy4;
- xP1 = w / 6;
- dy5 = hd6 / 2;
- yP2 = yF + dy5;
- xP2 = w / 4;
- string dVal = "M" + 0 + "," + h +
- " Q" + xP1 + "," + yP1 + " " + xB + "," + yB +
- " L" + xC + "," + 0 +
- " L" + w + "," + yD +
- " L" + xE + "," + yE +
- " L" + xF + "," + yF +
- " Q" + xP2 + "," + yP2 + " " + 0 + "," + h +
- " z";
- // result += "<path d='" + dVal + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= dVal,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// 箭头:环形
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg CircularArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 12500 * px9d6 / px91d4400;
- double adj2 = (1142319 / 60000.00) * System.Math.PI / 180;
- double adj3 = (20457681 / 60000.00) * System.Math.PI / 180;
- double adj4 = (10800000 / 60000.00) * System.Math.PI / 180;
- double adj5 = 12500 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = (double.Parse(sAdj2.Value.Substring(4)) / 60000.00) * System.Math.PI / 180;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = (double.Parse(sAdj3.Value.Substring(4)) / 60000.00) * System.Math.PI / 180;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = (double.Parse(sAdj4.Value.Substring(4)) / 60000.00) * System.Math.PI / 180;
- }
- else if (sAdj_name.Value == "adj5")
- {
- XmlNode sAdj5 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj5 = double.Parse(sAdj5.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, r = w, b = h, l = 0, t = 0, wd2 = w / 2, hd2 = h / 2;
- double ss = System.Math.Min(w, h);
- double a5, maxAdj1, a1, enAng, stAng, th, thh, th2, rw1, rh1, rw2, rh2, rw3, rh3, wtH, htH, dxH,
- dyH, xH, yH, rI, u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11, u12, u13, u14, u15, u16, u17,
- u18, u19, u20, u21, maxAng, aAng, ptAng, wtA, htA, dxA, dyA, xA, yA, wtE, htE, dxE, dyE, xE, yE,
- dxG, dyG, xG, yG, dxB, dyB, xB, yB, sx1, sy1, sx2, sy2, rO, x1O, y1O, x2O, y2O, dxO, dyO, dO,
- q1, q2, DO, q3, q4, q5, q6, q7, q8, sdelO, ndyO, sdyO, q9, q10, q11, dxF1, q12, dxF2, adyO,
- q13, q14, dyF1, q15, dyF2, q16, q17, q18, q19, q20, q21, q22, dxF, dyF, sdxF, sdyF, xF, yF,
- x1I, y1I, x2I, y2I, dxI, dyI, dI, v1, v2, DI, v3, v4, v5, v6, v7, v8, sdelI, v9, v10, v11,
- dxC1, v12, dxC2, adyI, v13, v14, dyC1, v15, dyC2, v16, v17, v18, v19, v20, v21, v22, dxC, dyC,
- sdxC, sdyC, xC, yC, ist0, ist1, istAng, isw1, isw2, iswAng, p1, p2, p3, p4, p5, xGp, yGp,
- xBp, yBp, en0, en1, en2, sw0, sw1, swAng;
- double cnstVal1 = 25000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double rdAngVal1 = (1 / 60000.00) * System.Math.PI / 180;
- double rdAngVal2 = (21599999 / 60000.00) * System.Math.PI / 180;
- double rdAngVal3 = 2 * System.Math.PI;
- double cd2 = 180;
- a5 = (adj5 < 0) ? 0 : (adj5 > cnstVal1) ? cnstVal1 : adj5;
- maxAdj1 = a5 * 2;
- a1 = (adj1 < 0) ? 0 : (adj1 > maxAdj1) ? maxAdj1 : adj1;
- enAng = (adj3 < rdAngVal1) ? rdAngVal1 : (adj3 > rdAngVal2) ? rdAngVal2 : adj3;
- stAng = (adj4 < 0) ? 0 : (adj4 > rdAngVal2) ? rdAngVal2 : adj4; //////////////////////////////////////////
- th = ss * a1 / cnstVal2;
- thh = ss * a5 / cnstVal2;
- th2 = th / 2;
- rw1 = wd2 + th2 - thh;
- rh1 = hd2 + th2 - thh;
- rw2 = rw1 - th;
- rh2 = rh1 - th;
- rw3 = rw2 + th2;
- rh3 = rh2 + th2;
- wtH = rw3 * System.Math.Sin(enAng);
- htH = rh3 * System.Math.Cos(enAng);
- //dxH = rw3*Math.Cos(System.Math.Atan(wtH/htH));
- //dyH = rh3*Math.Sin(System.Math.Atan(wtH/htH));
- dxH = rw3 * System.Math.Cos(System.Math.Atan2(wtH, htH));
- dyH = rh3 * System.Math.Sin(System.Math.Atan2(wtH, htH));
- xH = hc + dxH;
- yH = vc + dyH;
- rI = (rw2 < rh2) ? rw2 : rh2;
- u1 = dxH * dxH;
- u2 = dyH * dyH;
- u3 = rI * rI;
- u4 = u1 - u3;
- u5 = u2 - u3;
- u6 = u4 * u5 / u1;
- u7 = u6 / u2;
- u8 = 1 - u7;
- u9 = System.Math.Sqrt(u8);
- u10 = u4 / dxH;
- u11 = u10 / dyH;
- u12 = (1 + u9) / u11;
- //u13 = System.Math.Atan(u12/1);
- u13 = System.Math.Atan2(u12, 1);
- u14 = u13 + rdAngVal3;
- u15 = (u13 > 0) ? u13 : u14;
- u16 = u15 - enAng;
- u17 = u16 + rdAngVal3;
- u18 = (u16 > 0) ? u16 : u17;
- u19 = u18 - cd2;
- u20 = u18 - rdAngVal3;
- u21 = (u19 > 0) ? u20 : u18;
- maxAng = System.Math.Abs(u21);
- aAng = (adj2 < 0) ? 0 : (adj2 > maxAng) ? maxAng : adj2;
- ptAng = enAng + aAng;
- wtA = rw3 * System.Math.Sin(ptAng);
- htA = rh3 * System.Math.Cos(ptAng);
- //dxA = rw3*Math.Cos(System.Math.Atan(wtA/htA));
- //dyA = rh3*Math.Sin(System.Math.Atan(wtA/htA));
- dxA = rw3 * System.Math.Cos(System.Math.Atan2(wtA, htA));
- dyA = rh3 * System.Math.Sin(System.Math.Atan2(wtA, htA));
- xA = hc + dxA;
- yA = vc + dyA;
- wtE = rw1 * System.Math.Sin(stAng);
- htE = rh1 * System.Math.Cos(stAng);
- //dxE = rw1*Math.Cos(System.Math.Atan(wtE/htE));
- //dyE = rh1*Math.Sin(System.Math.Atan(wtE/htE));
- dxE = rw1 * System.Math.Cos(System.Math.Atan2(wtE, htE));
- dyE = rh1 * System.Math.Sin(System.Math.Atan2(wtE, htE));
- xE = hc + dxE;
- yE = vc + dyE;
- dxG = thh * System.Math.Cos(ptAng);
- dyG = thh * System.Math.Sin(ptAng);
- xG = xH + dxG;
- yG = yH + dyG;
- dxB = thh * System.Math.Cos(ptAng);
- dyB = thh * System.Math.Sin(ptAng);
- xB = xH - dxB;
- yB = yH - dyB;
- sx1 = xB - hc;
- sy1 = yB - vc;
- sx2 = xG - hc;
- sy2 = yG - vc;
- rO = (rw1 < rh1) ? rw1 : rh1;
- x1O = sx1 * rO / rw1;
- y1O = sy1 * rO / rh1;
- x2O = sx2 * rO / rw1;
- y2O = sy2 * rO / rh1;
- dxO = x2O - x1O;
- dyO = y2O - y1O;
- dO = System.Math.Sqrt(dxO * dxO + dyO * dyO);
- q1 = x1O * y2O;
- q2 = x2O * y1O;
- DO = q1 - q2;
- q3 = rO * rO;
- q4 = dO * dO;
- q5 = q3 * q4;
- q6 = DO * DO;
- q7 = q5 - q6;
- q8 = (q7 > 0) ? q7 : 0;
- sdelO = System.Math.Sqrt(q8);
- ndyO = dyO * -1;
- sdyO = (ndyO > 0) ? -1 : 1;
- q9 = sdyO * dxO;
- q10 = q9 * sdelO;
- q11 = DO * dyO;
- dxF1 = (q11 + q10) / q4;
- q12 = q11 - q10;
- dxF2 = q12 / q4;
- adyO = System.Math.Abs(dyO);
- q13 = adyO * sdelO;
- q14 = DO * dxO / -1;
- dyF1 = (q14 + q13) / q4;
- q15 = q14 - q13;
- dyF2 = q15 / q4;
- q16 = x2O - dxF1;
- q17 = x2O - dxF2;
- q18 = y2O - dyF1;
- q19 = y2O - dyF2;
- q20 = System.Math.Sqrt(q16 * q16 + q18 * q18);
- q21 = System.Math.Sqrt(q17 * q17 + q19 * q19);
- q22 = q21 - q20;
- dxF = (q22 > 0) ? dxF1 : dxF2;
- dyF = (q22 > 0) ? dyF1 : dyF2;
- sdxF = dxF * rw1 / rO;
- sdyF = dyF * rh1 / rO;
- xF = hc + sdxF;
- yF = vc + sdyF;
- x1I = sx1 * rI / rw2;
- y1I = sy1 * rI / rh2;
- x2I = sx2 * rI / rw2;
- y2I = sy2 * rI / rh2;
- dxI = x2I - x1I;
- dyI = y2I - y1I;
- dI = System.Math.Sqrt(dxI * dxI + dyI * dyI);
- v1 = x1I * y2I;
- v2 = x2I * y1I;
- DI = v1 - v2;
- v3 = rI * rI;
- v4 = dI * dI;
- v5 = v3 * v4;
- v6 = DI * DI;
- v7 = v5 - v6;
- v8 = (v7 > 0) ? v7 : 0;
- sdelI = System.Math.Sqrt(v8);
- v9 = sdyO * dxI;
- v10 = v9 * sdelI;
- v11 = DI * dyI;
- dxC1 = (v11 + v10) / v4;
- v12 = v11 - v10;
- dxC2 = v12 / v4;
- adyI = System.Math.Abs(dyI);
- v13 = adyI * sdelI;
- v14 = DI * dxI / -1;
- dyC1 = (v14 + v13) / v4;
- v15 = v14 - v13;
- dyC2 = v15 / v4;
- v16 = x1I - dxC1;
- v17 = x1I - dxC2;
- v18 = y1I - dyC1;
- v19 = y1I - dyC2;
- v20 = System.Math.Sqrt(v16 * v16 + v18 * v18);
- v21 = System.Math.Sqrt(v17 * v17 + v19 * v19);
- v22 = v21 - v20;
- dxC = (v22 > 0) ? dxC1 : dxC2;
- dyC = (v22 > 0) ? dyC1 : dyC2;
- sdxC = dxC * rw2 / rI;
- sdyC = dyC * rh2 / rI;
- xC = hc + sdxC;
- yC = vc + sdyC;
- //ist0 = System.Math.Atan(sdyC/sdxC);
- ist0 = System.Math.Atan2(sdyC, sdxC);
- ist1 = ist0 + rdAngVal3;
- istAng = (ist0 > 0) ? ist0 : ist1;
- isw1 = stAng - istAng;
- isw2 = isw1 - rdAngVal3;
- iswAng = (isw1 > 0) ? isw2 : isw1;
- p1 = xF - xC;
- p2 = yF - yC;
- p3 = System.Math.Sqrt(p1 * p1 + p2 * p2);
- p4 = p3 / 2;
- p5 = p4 - thh;
- xGp = (p5 > 0) ? xF : xG;
- yGp = (p5 > 0) ? yF : yG;
- xBp = (p5 > 0) ? xC : xB;
- yBp = (p5 > 0) ? yC : yB;
- //en0 = System.Math.Atan(sdyF/sdxF);
- en0 = System.Math.Atan2(sdyF, sdxF);
- en1 = en0 + rdAngVal3;
- en2 = (en0 > 0) ? en0 : en1;
- sw0 = en2 - stAng;
- sw1 = sw0 + rdAngVal3;
- swAng = (sw0 > 0) ? sw0 : sw1;
- double strtAng = stAng * 180 / System.Math.PI;
- double endAng = strtAng + (swAng * 180 / System.Math.PI);
- double stiAng = istAng * 180 / System.Math.PI;
- double swiAng = iswAng * 180 / System.Math.PI;
- double ediAng = stiAng + swiAng;
- string d_val = ShapeArc(w / 2, h / 2, rw1, rh1, strtAng, endAng, false) +
- " L" + xGp + "," + yGp +
- " L" + xA + "," + yA +
- " L" + xBp + "," + yBp +
- " L" + xC + "," + yC +
- ShapeArc(w / 2, h / 2, rw2, rh2, stiAng, ediAng, false).Replace("M", "L") +
- " z";
- // result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
- // "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),
- // Stroke = "#" + border.Color,
- // StrokeWidth = border.Width + "",
- // StrokeDasharray = border.Stroke,
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- private static Svg LeftCircularArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = "";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 12500 * px9d6 / px91d4400;
- double adj2 = (-1142319 / 60000.00) * System.Math.PI / 180;
- double adj3 = (1142319 / 60000.00) * System.Math.PI / 180;
- double adj4 = (10800000 / 60000.00) * System.Math.PI / 180;
- double adj5 = 12500 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = (double.Parse(sAdj2.Value.Substring(4)) / 60000.00) * System.Math.PI / 180;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = (double.Parse(sAdj3.Value.Substring(4)) / 60000.00) * System.Math.PI / 180;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = (double.Parse(sAdj4.Value.Substring(4)) / 60000.00) * System.Math.PI / 180;
- }
- else if (sAdj_name.Value == "adj5")
- {
- XmlNode sAdj5 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj5 = double.Parse(sAdj5.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, r = w, b = h, l = 0, t = 0, wd2 = w / 2, hd2 = h / 2;
- double ss = System.Math.Min(w, h);
- double cnstVal1 = 25000 * px9d6 / px91d4400;
- double cnstVal2 = 100000 * px9d6 / px91d4400;
- double rdAngVal1 = (1 / 60000.00) * System.Math.PI / 180;
- double rdAngVal2 = (21599999 / 60000.00) * System.Math.PI / 180;
- double rdAngVal3 = 2 * System.Math.PI;
- double a5, maxAdj1, a1, enAng, stAng, th, thh, th2, rw1, rh1, rw2, rh2, rw3, rh3, wtH, htH, dxH, dyH, xH, yH, rI,
- u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11, u12, u13, u14, u15, u16, u17, u18, u19, u20, u21, u22,
- minAng, u23, a2, aAng, ptAng, wtA, htA, dxA, dyA, xA, yA, wtE, htE, dxE, dyE, xE, yE, wtD, htD, dxD, dyD,
- xD, yD, dxG, dyG, xG, yG, dxB, dyB, xB, yB, sx1, sy1, sx2, sy2, rO, x1O, y1O, x2O, y2O, dxO, dyO, dO,
- q1, q2, DO, q3, q4, q5, q6, q7, q8, sdelO, ndyO, sdyO, q9, q10, q11, dxF1, q12, dxF2, adyO, q13, q14, dyF1,
- q15, dyF2, q16, q17, q18, q19, q20, q21, q22, dxF, dyF, sdxF, sdyF, xF, yF, x1I, y1I, x2I, y2I, dxI, dyI, dI,
- v1, v2, DI, v3, v4, v5, v6, v7, v8, sdelI, v9, v10, v11, dxC1, v12, dxC2, adyI, v13, v14, dyC1, v15, dyC2, v16,
- v17, v18, v19, v20, v21, v22, dxC, dyC, sdxC, sdyC, xC, yC, ist0, ist1, istAng0, isw1, isw2, iswAng0, istAng,
- iswAng, p1, p2, p3, p4, p5, xGp, yGp, xBp, yBp, en0, en1, en2, sw0, sw1, swAng, stAng0;
- double cd2 = 180;
- a5 = (adj5 < 0) ? 0 : (adj5 > cnstVal1) ? cnstVal1 : adj5;
- maxAdj1 = a5 * 2;
- a1 = (adj1 < 0) ? 0 : (adj1 > maxAdj1) ? maxAdj1 : adj1;
- enAng = (adj3 < rdAngVal1) ? rdAngVal1 : (adj3 > rdAngVal2) ? rdAngVal2 : adj3;
- stAng = (adj4 < 0) ? 0 : (adj4 > rdAngVal2) ? rdAngVal2 : adj4;
- th = ss * a1 / cnstVal2;
- thh = ss * a5 / cnstVal2;
- th2 = th / 2;
- rw1 = wd2 + th2 - thh;
- rh1 = hd2 + th2 - thh;
- rw2 = rw1 - th;
- rh2 = rh1 - th;
- rw3 = rw2 + th2;
- rh3 = rh2 + th2;
- wtH = rw3 * System.Math.Sin(enAng);
- htH = rh3 * System.Math.Cos(enAng);
- dxH = rw3 * System.Math.Cos(System.Math.Atan2(wtH, htH));
- dyH = rh3 * System.Math.Sin(System.Math.Atan2(wtH, htH));
- xH = hc + dxH;
- yH = vc + dyH;
- rI = (rw2 < rh2) ? rw2 : rh2;
- u1 = dxH * dxH;
- u2 = dyH * dyH;
- u3 = rI * rI;
- u4 = u1 - u3;
- u5 = u2 - u3;
- u6 = u4 * u5 / u1;
- u7 = u6 / u2;
- u8 = 1 - u7;
- u9 = System.Math.Sqrt(u8);
- u10 = u4 / dxH;
- u11 = u10 / dyH;
- u12 = (1 + u9) / u11;
- u13 = System.Math.Atan2(u12, 1);
- u14 = u13 + rdAngVal3;
- u15 = (u13 > 0) ? u13 : u14;
- u16 = u15 - enAng;
- u17 = u16 + rdAngVal3;
- u18 = (u16 > 0) ? u16 : u17;
- u19 = u18 - cd2;
- u20 = u18 - rdAngVal3;
- u21 = (u19 > 0) ? u20 : u18;
- u22 = System.Math.Abs(u21);
- minAng = u22 * -1;
- u23 = System.Math.Abs(adj2);
- a2 = u23 * -1;
- aAng = (a2 < minAng) ? minAng : (a2 > 0) ? 0 : a2;
- ptAng = enAng + aAng;
- wtA = rw3 * System.Math.Sin(ptAng);
- htA = rh3 * System.Math.Cos(ptAng);
- dxA = rw3 * System.Math.Cos(System.Math.Atan2(wtA, htA));
- dyA = rh3 * System.Math.Sin(System.Math.Atan2(wtA, htA));
- xA = hc + dxA;
- yA = vc + dyA;
- wtE = rw1 * System.Math.Sin(stAng);
- htE = rh1 * System.Math.Cos(stAng);
- dxE = rw1 * System.Math.Cos(System.Math.Atan2(wtE, htE));
- dyE = rh1 * System.Math.Sin(System.Math.Atan2(wtE, htE));
- xE = hc + dxE;
- yE = vc + dyE;
- wtD = rw2 * System.Math.Sin(stAng);
- htD = rh2 * System.Math.Cos(stAng);
- dxD = rw2 * System.Math.Cos(System.Math.Atan2(wtD, htD));
- dyD = rh2 * System.Math.Sin(System.Math.Atan2(wtD, htD));
- xD = hc + dxD;
- yD = vc + dyD;
- dxG = thh * System.Math.Cos(ptAng);
- dyG = thh * System.Math.Sin(ptAng);
- xG = xH + dxG;
- yG = yH + dyG;
- dxB = thh * System.Math.Cos(ptAng);
- dyB = thh * System.Math.Sin(ptAng);
- xB = xH - dxB;
- yB = yH - dyB;
- sx1 = xB - hc;
- sy1 = yB - vc;
- sx2 = xG - hc;
- sy2 = yG - vc;
- rO = (rw1 < rh1) ? rw1 : rh1;
- x1O = sx1 * rO / rw1;
- y1O = sy1 * rO / rh1;
- x2O = sx2 * rO / rw1;
- y2O = sy2 * rO / rh1;
- dxO = x2O - x1O;
- dyO = y2O - y1O;
- dO = System.Math.Sqrt(dxO * dxO + dyO * dyO);
- q1 = x1O * y2O;
- q2 = x2O * y1O;
- DO = q1 - q2;
- q3 = rO * rO;
- q4 = dO * dO;
- q5 = q3 * q4;
- q6 = DO * DO;
- q7 = q5 - q6;
- q8 = (q7 > 0) ? q7 : 0;
- sdelO = System.Math.Sqrt(q8);
- ndyO = dyO * -1;
- sdyO = (ndyO > 0) ? -1 : 1;
- q9 = sdyO * dxO;
- q10 = q9 * sdelO;
- q11 = DO * dyO;
- dxF1 = (q11 + q10) / q4;
- q12 = q11 - q10;
- dxF2 = q12 / q4;
- adyO = System.Math.Abs(dyO);
- q13 = adyO * sdelO;
- q14 = DO * dxO / -1;
- dyF1 = (q14 + q13) / q4;
- q15 = q14 - q13;
- dyF2 = q15 / q4;
- q16 = x2O - dxF1;
- q17 = x2O - dxF2;
- q18 = y2O - dyF1;
- q19 = y2O - dyF2;
- q20 = System.Math.Sqrt(q16 * q16 + q18 * q18);
- q21 = System.Math.Sqrt(q17 * q17 + q19 * q19);
- q22 = q21 - q20;
- dxF = (q22 > 0) ? dxF1 : dxF2;
- dyF = (q22 > 0) ? dyF1 : dyF2;
- sdxF = dxF * rw1 / rO;
- sdyF = dyF * rh1 / rO;
- xF = hc + sdxF;
- yF = vc + sdyF;
- x1I = sx1 * rI / rw2;
- y1I = sy1 * rI / rh2;
- x2I = sx2 * rI / rw2;
- y2I = sy2 * rI / rh2;
- dxI = x2I - x1I;
- dyI = y2I - y1I;
- dI = System.Math.Sqrt(dxI * dxI + dyI * dyI);
- v1 = x1I * y2I;
- v2 = x2I * y1I;
- DI = v1 - v2;
- v3 = rI * rI;
- v4 = dI * dI;
- v5 = v3 * v4;
- v6 = DI * DI;
- v7 = v5 - v6;
- v8 = (v7 > 0) ? v7 : 0;
- sdelI = System.Math.Sqrt(v8);
- v9 = sdyO * dxI;
- v10 = v9 * sdelI;
- v11 = DI * dyI;
- dxC1 = (v11 + v10) / v4;
- v12 = v11 - v10;
- dxC2 = v12 / v4;
- adyI = System.Math.Abs(dyI);
- v13 = adyI * sdelI;
- v14 = DI * dxI / -1;
- dyC1 = (v14 + v13) / v4;
- v15 = v14 - v13;
- dyC2 = v15 / v4;
- v16 = x1I - dxC1;
- v17 = x1I - dxC2;
- v18 = y1I - dyC1;
- v19 = y1I - dyC2;
- v20 = System.Math.Sqrt(v16 * v16 + v18 * v18);
- v21 = System.Math.Sqrt(v17 * v17 + v19 * v19);
- v22 = v21 - v20;
- dxC = (v22 > 0) ? dxC1 : dxC2;
- dyC = (v22 > 0) ? dyC1 : dyC2;
- sdxC = dxC * rw2 / rI;
- sdyC = dyC * rh2 / rI;
- xC = hc + sdxC;
- yC = vc + sdyC;
- ist0 = System.Math.Atan2(sdyC, sdxC);
- ist1 = ist0 + rdAngVal3;
- istAng0 = (ist0 > 0) ? ist0 : ist1;
- isw1 = stAng - istAng0;
- isw2 = isw1 + rdAngVal3;
- iswAng0 = (isw1 > 0) ? isw1 : isw2;
- istAng = istAng0 + iswAng0;
- iswAng = -iswAng0;
- p1 = xF - xC;
- p2 = yF - yC;
- p3 = System.Math.Sqrt(p1 * p1 + p2 * p2);
- p4 = p3 / 2;
- p5 = p4 - thh;
- xGp = (p5 > 0) ? xF : xG;
- yGp = (p5 > 0) ? yF : yG;
- xBp = (p5 > 0) ? xC : xB;
- yBp = (p5 > 0) ? yC : yB;
- en0 = System.Math.Atan2(sdyF, sdxF);
- en1 = en0 + rdAngVal3;
- en2 = (en0 > 0) ? en0 : en1;
- sw0 = en2 - stAng;
- sw1 = sw0 - rdAngVal3;
- swAng = (sw0 > 0) ? sw1 : sw0;
- stAng0 = stAng + swAng;
- double strtAng = stAng0 * 180 / System.Math.PI;
- double endAng = stAng * 180 / System.Math.PI;
- double stiAng = istAng * 180 / System.Math.PI;
- double swiAng = iswAng * 180 / System.Math.PI;
- double ediAng = stiAng + swiAng;
- string d_val = "M" + xE + "," + yE +
- " L" + xD + "," + yD +
- ShapeArc(w / 2, h / 2, rw2, rh2, stiAng, ediAng, false).Replace("M", "L") +
- " L" + xBp + "," + yBp +
- " L" + xA + "," + yA +
- " L" + xGp + "," + yGp +
- " L" + xF + "," + yF +
- ShapeArc(w / 2, h / 2, rw1, rh1, strtAng, endAng, false).Replace("M", "L") +
- " z";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
-
- private static Svg LeftRightCircularArrow(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- // string result = shapType + "-unsupported shape type.";
- XmlNodeList shapAdjst_ary = ShapeHelper.GetTextByPathList(node, "p:spPr/a:prstGeom/a:avLst/a:gd");
- double adj1 = 12500 * px9d6 / px91d4400;
- double adj2 = (-1142319 / 60000.00) * System.Math.PI / 180;
- double adj3 = (1142319 / 60000.00) * System.Math.PI / 180;
- double adj4 = (10800000 / 60000.00) * System.Math.PI / 180;
- double adj5 = 12500 * px9d6 / px91d4400;
- if (shapAdjst_ary != null)
- {
- for (int i = 0; i < shapAdjst_ary.Count; i++)
- {
- XmlNode sAdj_name = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@name");
- if (sAdj_name.Value == "adj1")
- {
- XmlNode sAdj1 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj1 = double.Parse(sAdj1.Value.Substring(4)) * px9d6 / px91d4400;
- }
- else if (sAdj_name.Value == "adj2")
- {
- XmlNode sAdj2 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj2 = (double.Parse(sAdj2.Value.Substring(4)) / 60000.00) * System.Math.PI / 180;
- }
- else if (sAdj_name.Value == "adj3")
- {
- XmlNode sAdj3 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj3 = (double.Parse(sAdj3.Value.Substring(4)) / 60000.00) * System.Math.PI / 180;
- }
- else if (sAdj_name.Value == "adj4")
- {
- XmlNode sAdj4 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj4 = (double.Parse(sAdj4.Value.Substring(4)) / 60000.00) * System.Math.PI / 180;
- }
- else if (sAdj_name.Value == "adj5")
- {
- XmlNode sAdj5 = ShapeHelper.GetTextByPath(shapAdjst_ary[i], "@fmla");
- adj5 = double.Parse(sAdj5.Value.Substring(4)) * px9d6 / px91d4400;
- }
- }
- }
- double vc = h / 2, hc = w / 2, r = w, b = h, l = 0, t = 0, wd2 = w / 2, hd2 = h / 2;
- double a5, maxAdj1, a1, enAng, stAng, th, thh, th2, rw1, rh1, rw2, rh2, rw3, rh3, wtH,
- htH, dxH, dyH, xH, yH, rI, u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11, u12, u13,
- u14, u15, u16, u17, u18, u19, u20, u21, maxAng, aAng, ptAng, wtA, htA, dxA, dyA, xA,
- yA, dxG, dyG, xG, yG, dxB, dyB, xB, yB, sx1, sy1, sx2, sy2, rO, x1O, y1O, x2O, y2O, dxO,
- dyO, dO, q1, q2, DO, q3, q4, q5, q6, q7, q8, sdelO, ndyO, sdyO, q9, q10, q11, dxF1, q12,
- dxF2, adyO, q13, q14, dyF1, q15, dyF2, q16, q17, q18, q19, q20, q21, q22, dxF, dyF, sdxF,
- sdyF, xF, yF, x1I, y1I, x2I, y2I, dxI, dyI, dI, v1, v2, DI, v3, v4, v5, v6, v7, v8, sdelI,
- v9, v10, v11, dxC1, v12, dxC2, adyI, v13, v14, dyC1, v15, dyC2, v16, v17, v18, v19, v20, v21,
- v22, dxC, dyC, sdxC, sdyC, xC, yC, wtI, htI, xI, yI, lptAng, wtL, htL, dxL, dyL, xL,
- yL, dxK, dyK, xK, yK, dxJ, dyJ, xJ, yJ, p1, p2, p3, p4, p5, xGp, yGp, xBp, yBp, en0, en1, en2,
- od0, od1, od2, st0, st1, st2, sw0, sw1, swAng, ist0, ist1, istAng, id0, id1, id2, ien0, ien1, ien2,
- isw1, isw2, iswAng, wtE, htE, dxE, dyE, xE, yE, wtD, htD, dxD, dyD, xD, yD, xKp, yKp, xJp, yJp, aL,
- aA, aB, aJ, idx, idy, il, ir, it, ib;
- var ss =System.Math.Min(w, h);
- var cd2 = 180.0;
- var cd4 = 90.0;
- a5 = (adj5 < 0) ? 0 : (adj5 > 25000) ? 25000 : adj5;
- maxAdj1 = a5 * 2;
- a1 = (adj1 < 0) ? 0 : (adj1 > maxAdj1) ? maxAdj1 : adj1;
- enAng = (adj3 < 1) ? 1 : (adj3 > 21599999) ? 21599999 : adj3;
- stAng = (adj4 < 0) ? 0 : (adj4 > 21599999) ? 21599999 : adj4;
- th = ss * a1 / 100000;
- thh = ss * a5 / 100000;
- th2 = th / 2;
- rw1 = wd2 + th2 - thh;
- rh1 = hd2 + th2 - thh;
- rw2 = rw1 - th;
- rh2 = rh1 - th;
- rw3 = rw2 + th2;
- rh3 = rh2 + th2;
- wtH = rw3 * System. Math.Sin(enAng);
- htH = rh3 * System. Math.Cos(enAng);
- dxH = rw3 * System. Math.Cos(System.Math.Atan2(wtH, htH));
- dyH = rh3 * System. Math.Sin(System.Math.Atan2(wtH, htH));
- xH = hc + dxH;
- yH = vc + dyH;
- rI = (rw2 < rh2) ? rw2 : rh2;
- u1 = dxH * dxH;
- u2 = dyH * dyH;
- u3 = rI * rI;
- u4 = u1 - u3;
- u5 = u2 - u3;
- u6 = u4 * u5 / u1;
- u7 = u6 / u2;
- u8 = 1 - u7;
- u9 = System.Math.Sqrt(u8);
- u10 = u4 / dxH;
- u11 = u10 / dyH;
- u12 = (1 + u9) / u11;
- u13 = System.Math.Atan2(u12, 1);
- u14 = u13 + 21600000;
- u15 = (u13 > 0) ? u13 : u14;
- u16 = u15 - enAng;
- u17 = u16 + 21600000;
- u18 = (u16 > 0) ? u16 : u17;
- u19 = u18 - cd2;
- u20 = u18 - 21600000;
- u21 = (u19 > 0) ? u20 : u18;
- maxAng = System.Math.Abs(u21);
- aAng = (adj2 < 0) ? 0 : (adj2 > maxAng) ? maxAng : adj2;
- ptAng = enAng + aAng;
- wtA = rw3 * System. Math.Sin(ptAng);
- htA = rh3 * System. Math.Cos(ptAng);
- dxA = rw3 * System. Math.Cos(System.Math.Atan2(wtA, htA));
- dyA = rh3 * System. Math.Sin(System.Math.Atan2(wtA, htA));
- xA = hc + dxA;
- yA = vc + dyA;
- dxG = thh * System. Math.Cos(ptAng);
- dyG = thh * System. Math.Sin(ptAng);
- xG = xH + dxG;
- yG = yH + dyG;
- dxB = thh * System. Math.Cos(ptAng);
- dyB = thh * System. Math.Sin(ptAng);
- xB = xH - dxB;
- yB = yH - dyB;
- sx1 = xB - hc;
- sy1 = yB - vc;
- sx2 = xG - hc;
- sy2 = yG - vc;
- rO = (rw1 < rh1) ? rw1 : rh1;
- x1O = sx1 * rO / rw1;
- y1O = sy1 * rO / rh1;
- x2O = sx2 * rO / rw1;
- y2O = sy2 * rO / rh1;
- dxO = x2O - x1O;
- dyO = y2O - y1O;
- dO = System.Math.Sqrt(dxO * dxO + dyO * dyO);
- q1 = x1O * y2O;
- q2 = x2O * y1O;
- DO = q1 - q2;
- q3 = rO * rO;
- q4 = dO * dO;
- q5 = q3 * q4;
- q6 = DO * DO;
- q7 = q5 - q6;
- q8 = (q7 > 0) ? q7 : 0;
- sdelO = System.Math.Sqrt(q8);
- ndyO = dyO * -1;
- sdyO = (ndyO > 0) ? -1 : 1;
- q9 = sdyO * dxO;
- q10 = q9 * sdelO;
- q11 = DO * dyO;
- dxF1 = (q11 + q10) / q4;
- q12 = q11 - q10;
- dxF2 = q12 / q4;
- adyO = System.Math.Abs(dyO);
- q13 = adyO * sdelO;
- q14 = DO * dxO / -1;
- dyF1 = (q14 + q13) / q4;
- q15 = q14 - q13;
- dyF2 = q15 / q4;
- q16 = x2O - dxF1;
- q17 = x2O - dxF2;
- q18 = y2O - dyF1;
- q19 = y2O - dyF2;
- q20 = System.Math.Sqrt(q16 * q16 + q18 * q18);
- q21 = System.Math.Sqrt(q17 * q17 + q19 * q19);
- q22 = q21 - q20;
- dxF = (q22 > 0) ? dxF1 : dxF2;
- dyF = (q22 > 0) ? dyF1 : dyF2;
- sdxF = dxF * rw1 / rO;
- sdyF = dyF * rh1 / rO;
- xF = hc + sdxF;
- yF = vc + sdyF;
- x1I = sx1 * rI / rw2;
- y1I = sy1 * rI / rh2;
- x2I = sx2 * rI / rw2;
- y2I = sy2 * rI / rh2;
- dxI = x2I - x1I;
- dyI = y2I - y1I;
- dI = System.Math.Sqrt(dxI * dxI + dyI * dyI);
- v1 = x1I * y2I;
- v2 = x2I * y1I;
- DI = v1 - v2;
- v3 = rI * rI;
- v4 = dI * dI;
- v5 = v3 * v4;
- v6 = DI * DI;
- v7 = v5 - v6;
- v8 = (v7 > 0) ? v7 : 0;
- sdelI = System.Math.Sqrt(v8);
- v9 = sdyO * dxI;
- v10 = v9 * sdelI;
- v11 = DI * dyI;
- dxC1 = (v11 + v10) / v4;
- v12 = v11 - v10;
- dxC2 = v12 / v4;
- adyI = System.Math.Abs(dyI);
- v13 = adyI * sdelI;
- v14 = DI * dxI / -1;
- dyC1 = (v14 + v13) / v4;
- v15 = v14 - v13;
- dyC2 = v15 / v4;
- v16 = x1I - dxC1;
- v17 = x1I - dxC2;
- v18 = y1I - dyC1;
- v19 = y1I - dyC2;
- v20 = System.Math.Sqrt(v16 * v16 + v18 * v18);
- v21 = System.Math.Sqrt(v17 * v17 + v19 * v19);
- v22 = v21 - v20;
- dxC = (v22 > 0) ? dxC1 : dxC2;
- dyC = (v22 > 0) ? dyC1 : dyC2;
- sdxC = dxC * rw2 / rI;
- sdyC = dyC * rh2 / rI;
- xC = hc + sdxC;
- yC = vc + sdyC;
- wtI = rw3 * System. Math.Sin(stAng);
- htI = rh3 * System. Math.Cos(stAng);
- dxI = rw3 * System. Math.Cos(System.Math.Atan2(wtI, htI));
- dyI = rh3 * System. Math.Sin(System.Math.Atan2(wtI, htI));
- xI = hc + dxI;
- yI = vc + dyI;
- lptAng = stAng - aAng;
- wtL = rw3 * System. Math.Sin(lptAng);
- htL = rh3 * System. Math.Cos(lptAng);
- dxL = rw3 * System. Math.Cos(System.Math.Atan2(wtL, htL));
- dyL = rh3 * System. Math.Sin(System.Math.Atan2(wtL, htL));
- xL = hc + dxL;
- yL = vc + dyL;
- dxK = thh * System. Math.Cos(lptAng);
- dyK = thh * System. Math.Sin(lptAng);
- xK = xI + dxK;
- yK = yI + dyK;
- dxJ = thh * System. Math.Cos(lptAng);
- dyJ = thh * System. Math.Sin(lptAng);
- xJ = xI - dxJ;
- yJ = yI - dyJ;
- p1 = xF - xC;
- p2 = yF - yC;
- p3 = System.Math.Sqrt(p1 * p1 + p2 * p2);
- p4 = p3 / 2;
- p5 = p4 - thh;
- xGp = (p5 > 0) ? xF : xG;
- yGp = (p5 > 0) ? yF : yG;
- xBp = (p5 > 0) ? xC : xB;
- yBp = (p5 > 0) ? yC : yB;
- en0 = System.Math.Atan2(sdyF, sdxF);
- en1 = en0 + 21600000;
- en2 = (en0 > 0) ? en0 : en1;
- od0 = en2 - enAng;
- od1 = od0 + 21600000;
- od2 = (od0 > 0) ? od0 : od1;
- st0 = stAng - od2;
- st1 = st0 + 21600000;
- st2 = (st0 > 0) ? st0 : st1;
- sw0 = en2 - st2;
- sw1 = sw0 + 21600000;
- swAng = (sw0 > 0) ? sw0 : sw1;
- ist0 = System.Math.Atan2(sdyC, sdxC);
- ist1 = ist0 + 21600000;
- istAng = (ist0 > 0) ? ist0 : ist1;
- id0 = istAng - enAng;
- id1 = id0 - 21600000;
- id2 = (id0 > 0) ? id1 : id0;
- ien0 = stAng - id2;
- ien1 = ien0 - 21600000;
- ien2 = (ien1 > 0) ? ien1 : ien0;
- isw1 = ien2 - istAng;
- isw2 = isw1 - 21600000;
- iswAng = (isw1 > 0) ? isw2 : isw1;
- wtE = rw1 *System. Math.Sin(st2);
- htE = rh1 * System.Math.Cos(st2);
- dxE = rw1 * System. Math.Cos(System.Math.Atan2(wtE, htE));
- dyE = rh1 * System. Math.Sin(System.Math.Atan2(wtE, htE));
- xE = hc + dxE;
- yE = vc + dyE;
- wtD = rw2 * System. Math.Sin(ien2);
- htD = rh2 * System. Math.Cos(ien2);
- dxD = rw2 * System. Math.Cos(System.Math.Atan2(wtD, htD));
- dyD = rh2 * System. Math.Sin(System.Math.Atan2(wtD, htD));
- xD = hc + dxD;
- yD = vc + dyD;
- xKp = (p5 > 0) ? xE : xK;
- yKp = (p5 > 0) ? yE : yK;
- xJp = (p5 > 0) ? xD : xJ;
- yJp = (p5 > 0) ? yD : yJ;
- aL = lptAng - cd4;
- aA = ptAng + cd4;
- aB = ptAng + cd2;
- aJ = lptAng + cd2;
- idx = rw1 * System. Math.Cos(2700000);
- idy = rh1 * System. Math.Sin(2700000);
- il = hc - idx;
- ir = hc + idx;
- it = vc - idy;
- ib = vc + idy;
- /*
- *
- moveTo: xL,yL;
- lineTo: xKp,yKp;
- lineTo: xE,yE;
- arcTo: rX=rw1 rY=rh1 stAng=st2 swAng=swAng;
- lineTo: xGp,yGp;
- lineTo: xA,yA;
- lineTo: xBp,yBp;
- lineTo: xC,yC;
- arcTo: rX=rw2 rY=rh2 stAng=istAng swAng=iswAng;
- lineTo: xJp,yJp;
- close;
- */
- double strtAng = stAng * 180 / System.Math.PI;
- double endAng = stAng * 180 / System.Math.PI;
- double stiAng = istAng * 180 / System.Math.PI;
- double swiAng = iswAng * 180 / System.Math.PI;
- double ediAng = stiAng + swiAng;
- string d_val = "M" + xL + "," + yL +
- " L" + xKp + "," + yKp +
- ShapeArc(w / 2, h / 2, rw1, rh1, stAng * 180 / System.Math.PI, swAng * 180 / System.Math.PI, false).Replace("M", "L") +
- " L" + xGp + "," + yGp +
- " L" + xA + "," + yA +
- " L" + xBp + "," + yBp +
- " L" + xC + "," + yC +
- ShapeArc(w / 2, h / 2, rw2, rh2, stAng * 180 / System.Math.PI, swAng * 180 / System.Math.PI, false).Replace("M", "L") +
- " z";
- List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
- type = "path",
- d= d_val,
- } };
- return new Svg { /*SvgData = result,*/ svgShape = shapes };
- }
- /// <summary>
- /// https://meshesha.js.org/presetShapeDefinitions/
- /// https://docs.microsoft.com/zh-cn/dotnet/api/documentformat.openxml.drawing.shapetypevalues?view=openxml-2.8.1
- /// </summary>
- /// <param name="node"></param>
- /// <param name="shapType"></param>
- /// <param name="w"></param>
- /// <param name="h"></param>
- /// <param name="imgFillFlg"></param>
- /// <param name="grndFillFlg"></param>
- /// <param name="shpId"></param>
- /// <param name="fillColor"></param>
- /// <param name="border"></param>
- /// <returns></returns>
- private static Svg ChartPlus(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg ChartStar(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg ChartX(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg CornerTabs(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg FlowChartOfflineStorage(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg FolderCorner(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg Funnel(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg LineInv(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg NonIsoscelesTrapezoid(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg PlaqueTabs(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg SquareTabs(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- private static Svg UpDownArrowCallout(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
- {
- return LeftRightCircularArrow(node, shapType, w, h, imgFillFlg, grndFillFlg, shpId, fillColor, border);
- }
- }
- }
|