| 1 |
typedefcxx . . $ `<file>/src/Common.cpp`/ unsigned char Bytecxx . . $ Byte#; |
| 2 |
typedef unsigned int uintcxx . . $ uint#; |
| 3 |
|
| 4 |
#include <GL/glew.h> |
| 5 |
#include "CgUtil.h"cxx . . $ `<file>/src/CgUtil.h`/ |
| 6 |
|
| •7 |
#include <locale.h> |
| 8 |
|
| 9 |
//#include <GL/gl.h> |
| 10 |
#include <math.h> |
| 11 |
//#include <GL/glu.h> |
| 12 |
|
| 13 |
#include <vector> |
| 14 |
|
| 15 |
#include <vcg/space/point3.h>cxx . . $ `<file>/vcg/vcg/space/point3.h`/ |
| 16 |
#include <vcg/space/color4.h>cxx . . $ `<file>/vcg/vcg/space/color4.h`/ |
| 17 |
|
| 18 |
#include "gen_normal.h"cxx . . $ `<file>/src/gen_normal.h`/ |
| 19 |
#include <wrap/gui/trackball.h>cxx . . $ `<file>/vcg/wrap/gui/trackball.h`/ |
| 20 |
|
| 21 |
using namespace vcg; |
| 22 |
using namespace std; |
| 23 |
|
| 24 |
#include "CubeMapSamp.h"cxx . . $ `<file>/src/CubeMapSamp.h`/ |
| 25 |
#include "OctaMapSamp.h"cxx . . $ `<file>/src/OctaMapSamp.h`/ |
| 26 |
#include "Mol.h"cxx . . $ `<file>/src/Mol.h`/ |
| 27 |
//#include "AOgpu.h" |
| 28 |
|
| 29 |
#include "Common.h"cxx . . $ `<file>/src/Common.h`/ |
| 30 |
#include "HardSettings.h"cxx . . $ `<file>/src/HardSettings.h`/ |
| 31 |
#include "MyCanvas.h"cxx . . $ `<file>/src/MyCanvas.h`/ |
| 32 |
|
| 33 |
#include "ShadowMap.h"cxx . . $ `<file>/src/ShadowMap.h`/ |
| 34 |
|
| 35 |
extern CgUtilcxx . . $ CgUtil# shadowSettingscxx . . $ shadowSettings.; |
| 36 |
extern CgUtilcxx . . $ CgUtil# shadowSettingsAcccxx . . $ shadowSettingsAcc.; |
| 37 |
|
| 38 |
GeoSettingscxx . . $ GeoSettings# geoSettingscxx . . $ geoSettings.; // singleton |
| 39 |
|
| 40 |
|
| 41 |
extern Molcxx . . $ Mol# molcxx . . $ mol.; |
| 42 |
|
| 43 |
double aniStepcxx . . $ aniStep.=-1; |
| 44 |
|
| 45 |
void setAniStepcxx . . $ setAniStep(ba8836b59fb42830).(double step){ |
| 46 |
aniStepcxx . . $ aniStep.=step; |
| 47 |
} |
| 48 |
|
| 49 |
void stopAnicxx . . $ stopAni(49f6e7a06ebc5aa8).(){ |
| 50 |
aniStepcxx . . $ aniStep.=-1; |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
void GeoSettingscxx . . $ GeoSettings#::Applycxx . . $ GeoSettings#Apply(49f6e7a06ebc5aa8).(){ |
| 55 |
if (molcxx . . $ mol..IsReadycxx . . $ Mol#IsReady(c9857a73d68e59ba).()) { |
| 56 |
if (modecxx . . $ GeoSettings#mode.==BALL_N_STICKScxx . . $ GeoSettings#BALL_N_STICKS.) { |
| 57 |
molcxx . . $ mol..SetBallAndStickscxx . . $ Mol#SetBallAndSticks(9364e6e7bff7660).(stickRadiuscxx . . $ GeoSettings#stickRadius.); |
| 58 |
} |
| 59 |
if (modecxx . . $ GeoSettings#mode.==LICORICEcxx . . $ GeoSettings#LICORICE.) { |
| 60 |
molcxx . . $ mol..SetLicoricecxx . . $ Mol#SetLicorice(9364e6e7bff7660).(licoRadiuscxx . . $ GeoSettings#licoRadius.); |
| 61 |
} |
| 62 |
if (modecxx . . $ GeoSettings#mode.==SPACE_FILLcxx . . $ GeoSettings#SPACE_FILL.) molcxx . . $ mol..SetSpaceFillcxx . . $ Mol#SetSpaceFill(49f6e7a06ebc5aa8).(); |
| 63 |
} |
| 64 |
|
| 65 |
cgSettingscxx . . $ cgSettings..setGeoSettingscxx . . $ CgUtil#setGeoSettings(31d11fe37d1238f2).(*this); |
| 66 |
cgSettingscxx . . $ cgSettings..UpdateShaderscxx . . $ CgUtil#UpdateShaders(49f6e7a06ebc5aa8).(); |
| 67 |
|
| 68 |
UpdateShadowmapcxx . . $ UpdateShadowmap(49f6e7a06ebc5aa8).(); |
| 69 |
|
| 70 |
molcxx . . $ mol..ResetAOcxx . . $ Mol#ResetAO(49f6e7a06ebc5aa8).(); |
| 71 |
} |
| 72 |
|
| 73 |
void SetColModecxx . . $ SetColMode(9364e6e7bff7660).(float mode){ |
| 74 |
molcxx . . $ mol..SetColModecxx . . $ Mol#SetColMode(9364e6e7bff7660).(mode); |
| 75 |
} |
| 76 |
|
| 77 |
void ResetColModecxx . . $ ResetColMode(49f6e7a06ebc5aa8).(){ |
| 78 |
float tmp=molcxx . . $ mol..colModecxx . . $ Mol#colMode.; |
| 79 |
molcxx . . $ mol..colModecxx . . $ Mol#colMode.=-1; |
| 80 |
molcxx . . $ mol..SetColModecxx . . $ Mol#SetColMode(9364e6e7bff7660).(tmp); |
| 81 |
} |
| 82 |
|
| 83 |
float GetColModecxx . . $ GetColMode(9b8c9e39889c762c).(){ |
| 84 |
return molcxx . . $ mol..colModecxx . . $ Mol#colMode.; |
| 85 |
} |
| 86 |
|
| 87 |
void GeoSettingscxx . . $ GeoSettings#::ApplyColorcxx . . $ GeoSettings#ApplyColor(49f6e7a06ebc5aa8).(){ |
| 88 |
cgSettingscxx . . $ cgSettings..setGeoSettingscxx . . $ CgUtil#setGeoSettings(31d11fe37d1238f2).(*this); |
| 89 |
cgSettingscxx . . $ cgSettings..UpdateShaderscxx . . $ CgUtil#UpdateShaders(49f6e7a06ebc5aa8).(); |
| 90 |
} |
| 91 |
|
| 92 |
using namespace vcg; |
| 93 |
using namespace std; |
| 94 |
|
| 95 |
|
| 96 |
// VIS06 presentaiton modes: |
| 97 |
bool draw_ballscxx . . $ draw_balls.=true; |
| 98 |
bool draw_stickscxx . . $ draw_sticks.=true; |
| 99 |
bool draw_wireframe_stickscxx . . $ draw_wireframe_sticks.=false; |
| 100 |
bool draw_wireframe_ballscxx . . $ draw_wireframe_balls.=false; |
| 101 |
|
| 102 |
int winxcxx . . $ winx.=512,winycxx . . $ winy.=winxcxx . . $ winx.; |
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
int CSIZEcxx . . $ CSIZE.; // size (texels) per atom patches |
| 107 |
int BSIZEcxx . . $ BSIZE.; // size (texels) per pond patches |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
vcgcxx . . $ vcg/::Trackballcxx . . $ vcg/Trackball# trackcxx . . $ track.; |
| 112 |
vcgcxx . . $ vcg/::Trackballcxx . . $ vcg/Trackball# lightTrackcxx . . $ lightTrack.; |
| 113 |
bool MovingLightModecxx . . $ MovingLightMode.=false; |
| 114 |
|
| 115 |
|
| 116 |
Molcxx . . $ Mol# molcxx . . $ mol.; |
| 117 |
ShadowMapcxx . . $ ShadowMap# shadowmapcxx . . $ shadowmap.(molcxx . . $ mol.); |
| 118 |
CgUtilcxx . . $ CgUtil# cgSettingscxx . . $ cgSettings.; |
| 119 |
|
| 120 |
int GetCurrentHetatmcxx . . $ GetCurrentHetatm(b126dc7c1de90089).(){ |
| 121 |
return molcxx . . $ mol..nhetatmcxx . . $ Mol#nhetatm.; |
| 122 |
} |
| 123 |
|
| 124 |
int GetCurrentAtmcxx . . $ GetCurrentAtm(b126dc7c1de90089).(){ |
| 125 |
return molcxx . . $ mol..natmcxx . . $ Mol#natm.; |
| 126 |
} |
| 127 |
|
| 128 |
|
| 129 |
//void DrawTmp(); |
| 130 |
|
| 131 |
void UpdateShadowmapcxx . . $ UpdateShadowmap(49f6e7a06ebc5aa8).(){ |
| 132 |
ShadowMapcxx . . $ ShadowMap#::Updatecxx . . $ ShadowMap#Update(49f6e7a06ebc5aa8).(); |
| 133 |
} |
| 134 |
|
| 135 |
|
| 136 |
void drawFramecxx . . $ drawFrame(49f6e7a06ebc5aa8).(); // def later... |
| 137 |
|
| 138 |
Bytecxx . . $ Byte#* GetSnapshotcxx . . $ GetSnapshot(8ac90524f31ad8a9).(int sx, int sy, bool alpha){ |
| 139 |
|
| 140 |
|
| •141 |
//static uint textureSnap = 666; |
| 142 |
//static uint frameSnap; |
| 143 |
|
| 144 |
// set offline rendering |
| 145 |
mainCanvascxx . . $ mainCanvas..RedirectToMemorycxx . . $ MyCanvas#RedirectToMemory(49f6e7a06ebc5aa8).(); |
| 146 |
mainCanvascxx . . $ mainCanvas..SetRescxx . . $ MyCanvas#SetRes(d4f767463ce0a6b3).(sx); |
| 147 |
//hardsx=mainCanvas.GetHardRes(); |
| 148 |
|
| 149 |
if (!mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).()) return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 150 |
|
| 151 |
drawFramecxx . . $ drawFrame(49f6e7a06ebc5aa8).(); |
| 152 |
|
| 153 |
// capture frame |
| 154 |
sx=sy=mainCanvascxx . . $ mainCanvas..GetHardRescxx . . $ MyCanvas#GetHardRes(b126dc7c1de90089).(); |
| 155 |
Bytecxx . . $ Byte#* res=new(Bytecxx . . $ Byte#[sx*sy*4]); |
| 156 |
glReadPixels(0,0,sx,sy,alpha?GL_RGBAcxx . . $ `<external>/18396878532286971346/glew.h:692:9`!:GL_RGBcxx . . $ `<external>/18396878532286971346/glew.h:691:9`!,GL_UNSIGNED_BYTEcxx . . $ `<external>/18396878532286971346/glew.h:648:9`!,res); |
| 157 |
|
| 158 |
|
| 159 |
mainCanvascxx . . $ mainCanvas..RedirectToVideocxx . . $ MyCanvas#RedirectToVideo(49f6e7a06ebc5aa8).(); |
| 160 |
mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 161 |
|
| 162 |
return res; |
| 163 |
|
| 164 |
} |
| 165 |
|
| 166 |
|
| 167 |
void setProjectioncxx . . $ setProjection(d4f767463ce0a6b3).(int res){ |
| 168 |
|
| 169 |
int winx,winy; |
| 170 |
winx=winy=res; |
| 171 |
|
| 172 |
glMatrixMode(GL_PROJECTIONcxx . . $ `<external>/18396878532286971346/glew.h:679:9`!); |
| 173 |
glLoadIdentity(); |
| 174 |
GLfloat nearPlane = 0.01; |
| 175 |
GLfloat farPlane = 10000; |
| 176 |
float size=1.2f; |
| 177 |
float ratio=size*(float)winx / winy; |
| 178 |
if (cgSettingscxx . . $ cgSettings..projmodecxx . . $ CgUtil#projmode.==CgUtilcxx . . $ CgUtil#::PERSPECTIVEcxx . . $ CgUtil#PERSPECTIVE.) { |
| 179 |
gluPerspective(60.0, ratio, nearPlane, farPlane); |
| 180 |
} |
| 181 |
else |
| 182 |
// if(winx<winy) glOrtho(-1,+1,-(float)winy / winx,+(float)winy / winx, 1, 201); |
| 183 |
// else glOrtho(-(float)winx / winy,+(float)winx / winy,-1,+1, 1, 201); |
| 184 |
// if(winx<winy) glOrtho(-size,+size,-ratio,+ratio, 1, 201); |
| 185 |
// else glOrtho(-ratio,+ratio,-size,+size, 1, 201); |
| 186 |
if(winx<winy) glOrtho(-1,+1,-(float)winy / winx,+(float)winy / winx, 1, 201); |
| 187 |
else glOrtho(-(float)winx / winy,+(float)winx / winy,-1,+1, 40-2, 40+200); |
| 188 |
|
| 189 |
glViewport(0, 0, winx,winy); |
| 190 |
|
| 191 |
glMatrixMode(GL_MODELVIEWcxx . . $ `<external>/18396878532286971346/glew.h:678:9`!); |
| 192 |
} |
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
void MakeHiqualityScreencxx . . $ MakeHiqualityScreen(d4f767463ce0a6b3).(int quality){ |
| 198 |
int curres=mainCanvascxx . . $ mainCanvas..GetSoftRescxx . . $ MyCanvas#GetSoftRes(b126dc7c1de90089).(); |
| 199 |
|
| 200 |
mainCanvascxx . . $ mainCanvas..RedirectToMemorycxx . . $ MyCanvas#RedirectToMemory(49f6e7a06ebc5aa8).(); |
| 201 |
|
| 202 |
mainCanvascxx . . $ mainCanvas..SetRescxx . . $ MyCanvas#SetRes(d4f767463ce0a6b3).(curres * quality / 100 ); |
| 203 |
|
| 204 |
if (!mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).()) { |
| 205 |
// something went wrong. Fall-back: do a normal screenshot |
| 206 |
mainCanvascxx . . $ mainCanvas..RedirectToVideocxx . . $ MyCanvas#RedirectToVideo(49f6e7a06ebc5aa8).(); |
| 207 |
mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 208 |
drawFramecxx . . $ drawFrame(49f6e7a06ebc5aa8).(); |
| 209 |
return; |
| 210 |
} |
| 211 |
|
| 212 |
float HSratio = float(mainCanvascxx . . $ mainCanvas..GetSoftRescxx . . $ MyCanvas#GetSoftRes(b126dc7c1de90089).()) / mainCanvascxx . . $ mainCanvas..GetHardRescxx . . $ MyCanvas#GetHardRes(b126dc7c1de90089).(); |
| 213 |
|
| 214 |
drawFramecxx . . $ drawFrame(49f6e7a06ebc5aa8).(); |
| 215 |
|
| 216 |
mainCanvascxx . . $ mainCanvas..RedirectToVideocxx . . $ MyCanvas#RedirectToVideo(49f6e7a06ebc5aa8).(); |
| 217 |
mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 218 |
|
| 219 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!); |
| 220 |
glDisable(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!); |
| 221 |
|
| 222 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE0_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5746:9`!); |
| 223 |
mainCanvascxx . . $ mainCanvas..SetAsTexturecxx . . $ MyCanvas#SetAsTexture(49f6e7a06ebc5aa8).(); |
| 224 |
|
| 225 |
glDisable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 226 |
glDisable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 227 |
|
| 228 |
setProjectioncxx . . $ setProjection(d4f767463ce0a6b3).(mainCanvascxx . . $ mainCanvas..GetSoftRescxx . . $ MyCanvas#GetSoftRes(b126dc7c1de90089).()); |
| 229 |
|
| 230 |
|
| 231 |
glMatrixMode(GL_MODELVIEWcxx . . $ `<external>/18396878532286971346/glew.h:678:9`!); |
| 232 |
//glPushMatrix(); |
| 233 |
glLoadIdentity(); |
| 234 |
|
| 235 |
//glClearColor(1,1,1,1); |
| 236 |
//glClear(GL_COLOR_BUFFER_BIT); |
| 237 |
|
| 238 |
glEnable(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!); |
| 239 |
glDisable(GL_DEPTH_TESTcxx . . $ `<external>/18396878532286971346/glew.h:465:9`!); |
| 240 |
|
| 241 |
|
| 242 |
//glColor3f(1,0.75,0.75); // <= TEST HQ |
| 243 |
glColor3f(1,1,1); |
| 244 |
|
| 245 |
float z=-45; |
| 246 |
|
| 247 |
glBegin(GL_QUADScxx . . $ `<external>/18396878532286971346/glew.h:344:9`!); |
| 248 |
|
| 249 |
glTexCoord2f(0,0);glVertex3f(-1,-1, z); |
| 250 |
glTexCoord2f(HSratio,0);glVertex3f(+1,-1, z); |
| 251 |
glTexCoord2f(HSratio,HSratio);glVertex3f(+1,+1, z); |
| 252 |
glTexCoord2f(0,HSratio);glVertex3f(-1,+1, z); |
| 253 |
glEnd(); |
| 254 |
|
| 255 |
glEnable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 256 |
glEnable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 257 |
glEnable(GL_DEPTH_TESTcxx . . $ `<external>/18396878532286971346/glew.h:465:9`!); |
| 258 |
|
| 259 |
//glMatrixMode(GL_MODELVIEW);glPopMatrix(); |
| 260 |
//glMatrixMode(GL_PROJECTION);glPopMatrix(); |
| 261 |
|
| 262 |
|
| 263 |
} |
| 264 |
|
| 265 |
|
| 266 |
void drawFramecxx . . $ drawFrame(d4f767463ce0a6b3).(int quality){ |
| 267 |
if (quality==100) { |
| 268 |
drawFramecxx . . $ drawFrame(49f6e7a06ebc5aa8).(); |
| 269 |
} else MakeHiqualityScreencxx . . $ MakeHiqualityScreen(d4f767463ce0a6b3).(quality); |
| 270 |
} |
| 271 |
|
| 272 |
|
| 273 |
// pos camera, coordinate polari |
| 274 |
double distcxx . . $ dist.=3.0, alphacxx . . $ alpha.=0.0, betacxx . . $ beta.=0.0; |
| 275 |
|
| 276 |
//vector<Byte> texture(hardSettigs.TSIZE*hardSettigs.TSIZE*3,128); |
| 277 |
|
| 278 |
void QAtomcxx . . $ QAtom#::DrawHalocxx . . $ QAtom#DrawHalo(49f6e7a06ebc5aa8).(){ |
| 279 |
|
| 280 |
if ((!geoSettingscxx . . $ geoSettings..showHetatmcxx . . $ GeoSettings#showHetatm.)&&(hetatomFlagcxx . . $ QAtom#hetatomFlag.)) return; |
| 281 |
|
| 282 |
float s=cgSettingscxx . . $ cgSettings..P_halo_sizecxx . . $ CgUtil#P_halo_size. * 2.5; |
| 283 |
|
| 284 |
glMultiTexCoord2fARBcxx . . $ `<external>/18396878532286971346/glew.h:5829:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!, rcxx . . $ QAtom#r.+s, (rcxx . . $ QAtom#r.+s)*(rcxx . . $ QAtom#r.+s) / (s*s+2*rcxx . . $ QAtom#r.*s)); |
| 285 |
|
| 286 |
glTexCoord2f(+1,+1); |
| 287 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 288 |
|
| 289 |
glTexCoord2f(-1,+1); |
| 290 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 291 |
|
| 292 |
glTexCoord2f(-1,-1); |
| 293 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 294 |
|
| 295 |
glTexCoord2f(+1,-1); |
| 296 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 297 |
|
| 298 |
} |
| 299 |
|
| 300 |
void QAtomcxx . . $ QAtom#::Drawcxx . . $ QAtom#Draw(49f6e7a06ebc5aa8).(){ |
| 301 |
|
| 302 |
if ((!geoSettingscxx . . $ geoSettings..showHetatmcxx . . $ GeoSettings#showHetatm.)&&(hetatomFlagcxx . . $ QAtom#hetatomFlag.)) return; |
| 303 |
|
| 304 |
glColor3f(crcxx . . $ QAtom#cr.,cgcxx . . $ QAtom#cg.,cbcxx . . $ QAtom#cb.); |
| 305 |
glTexCoord2f(txcxx . . $ QAtom#tx./float(moltextureCanvascxx . . $ moltextureCanvas..GetHardRescxx . . $ MyCanvas#GetHardRes(b126dc7c1de90089).()),tycxx . . $ QAtom#ty./float(moltextureCanvascxx . . $ moltextureCanvas..GetHardRescxx . . $ MyCanvas#GetHardRes(b126dc7c1de90089).())); |
| 306 |
|
| 307 |
glNormal3f(+1,+1, rcxx . . $ QAtom#r.); |
| 308 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 309 |
|
| 310 |
glNormal3f(-1,+1, rcxx . . $ QAtom#r.); |
| 311 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 312 |
|
| 313 |
glNormal3f(-1,-1, rcxx . . $ QAtom#r.); |
| 314 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 315 |
|
| 316 |
glNormal3f(+1,-1, rcxx . . $ QAtom#r.); |
| 317 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 318 |
} |
| 319 |
|
| 320 |
void Bondcxx . . $ Bond#::DrawHalocxx . . $ Bond#DrawHalo(49f6e7a06ebc5aa8).(){ |
| 321 |
|
| 322 |
if ((!geoSettingscxx . . $ geoSettings..showHetatmcxx . . $ GeoSettings#showHetatm.)&&(hetatomFlagcxx . . $ Bond#hetatomFlag.)) return; |
| 323 |
|
| 324 |
glTexCoord4f(dircxx . . $ Bond#dir.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],dircxx . . $ Bond#dir.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],dircxx . . $ Bond#dir.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2], 1.0/lenghtcxx . . $ Bond#lenght.); |
| 325 |
|
| 326 |
glNormal3f(+1,+1,0); |
| 327 |
glVertex3f(acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 328 |
glNormal3f(-1,+1,0); |
| 329 |
glVertex3f(acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 330 |
|
| 331 |
glNormal3f(-1,-1,0); |
| 332 |
glVertex3f(bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 333 |
glNormal3f(+1,-1,0); |
| 334 |
glVertex3f(bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 335 |
|
| 336 |
} |
| 337 |
|
| 338 |
void Bondcxx . . $ Bond#::Drawcxx . . $ Bond#Draw(49f6e7a06ebc5aa8).(){ |
| 339 |
|
| 340 |
if ((!geoSettingscxx . . $ geoSettings..showHetatmcxx . . $ GeoSettings#showHetatm.)&&(hetatomFlagcxx . . $ Bond#hetatomFlag.)) return; |
| 341 |
|
| 342 |
// glColor3f(cr,cg,cb); |
| 343 |
// glTexCoord2f(tx/float(TSIZE),ty/float(TSIZE)); |
| 344 |
|
| 345 |
glTexCoord4f(dircxx . . $ Bond#dir.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],dircxx . . $ Bond#dir.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],dircxx . . $ Bond#dir.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2], 1.0/lenghtcxx . . $ Bond#lenght.); |
| 346 |
//glMultiTexCoord3fARB(GL_TEXTURE3_ARB, col1[0],col1[1],col1[2] ); |
| 347 |
glColor3fv(&(col1cxx . . $ Bond#col1.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0])); |
| 348 |
glSecondaryColor3fvcxx . . $ `<external>/18396878532286971346/glew.h:1601:9`!(&col2cxx . . $ Bond#col2.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0]); |
| 349 |
//glMultiTexCoord3fARB(GL_TEXTURE4_ARB, col2[0],col2[1],col2[2] ); |
| 350 |
glMultiTexCoord3fARBcxx . . $ `<external>/18396878532286971346/glew.h:5837:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!, startpcxx . . $ Bond#startp.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],startpcxx . . $ Bond#startp.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],startpcxx . . $ Bond#startp.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2] ); |
| 351 |
glMultiTexCoord2fARBcxx . . $ `<external>/18396878532286971346/glew.h:5829:9`!(GL_TEXTURE2_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5748:9`!, txcxx . . $ Bond#tx./float(moltextureCanvascxx . . $ moltextureCanvas..GetHardRescxx . . $ MyCanvas#GetHardRes(b126dc7c1de90089).()),tycxx . . $ Bond#ty./float(moltextureCanvascxx . . $ moltextureCanvas..GetHardRescxx . . $ MyCanvas#GetHardRes(b126dc7c1de90089).())); |
| 352 |
|
| 353 |
glNormal3f(+1,+1,0); |
| 354 |
glVertex3f(acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 355 |
glNormal3f(-1,+1,0); |
| 356 |
glVertex3f(acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 357 |
|
| 358 |
glNormal3f(-1,-1,0); |
| 359 |
glVertex3f(bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 360 |
glNormal3f(+1,-1,0); |
| 361 |
glVertex3f(bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 362 |
|
| 363 |
} |
| 364 |
|
| 365 |
void QAtomcxx . . $ QAtom#::DrawShadowmapcxx . . $ QAtom#DrawShadowmap(49f6e7a06ebc5aa8).(){ |
| 366 |
|
| 367 |
if ((!geoSettingscxx . . $ geoSettings..showHetatmcxx . . $ GeoSettings#showHetatm.)&&(hetatomFlagcxx . . $ QAtom#hetatomFlag.)) return; |
| 368 |
|
| 369 |
glNormal3f(+1,+1, rcxx . . $ QAtom#r.); |
| 370 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 371 |
|
| 372 |
glNormal3f(-1,+1, rcxx . . $ QAtom#r.); |
| 373 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 374 |
|
| 375 |
glNormal3f(-1,-1, rcxx . . $ QAtom#r.); |
| 376 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 377 |
|
| 378 |
glNormal3f(+1,-1, rcxx . . $ QAtom#r.); |
| 379 |
glVertex3f(pxcxx . . $ QAtom#px.,pycxx . . $ QAtom#py.,pzcxx . . $ QAtom#pz.); |
| 380 |
} |
| 381 |
|
| 382 |
void Bondcxx . . $ Bond#::DrawShadowmapcxx . . $ Bond#DrawShadowmap(49f6e7a06ebc5aa8).(){ |
| 383 |
|
| 384 |
if ((!geoSettingscxx . . $ geoSettings..showHetatmcxx . . $ GeoSettings#showHetatm.)&&(hetatomFlagcxx . . $ Bond#hetatomFlag.)) return; |
| 385 |
|
| 386 |
glTexCoord4f(dircxx . . $ Bond#dir.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],dircxx . . $ Bond#dir.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],dircxx . . $ Bond#dir.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2], 1.0/lenghtcxx . . $ Bond#lenght.); |
| 387 |
|
| 388 |
glNormal3f(+1,+1,0); |
| 389 |
glVertex3f(acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 390 |
glNormal3f(-1,+1,0); |
| 391 |
glVertex3f(acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],acxx . . $ Bond#a.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 392 |
|
| 393 |
glNormal3f(-1,-1,0); |
| 394 |
glVertex3f(bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 395 |
glNormal3f(+1,-1,0); |
| 396 |
glVertex3f(bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1],bcxx . . $ Bond#b.[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]); |
| 397 |
|
| 398 |
} |
| 399 |
|
| 400 |
float extractCurrentScaleFactorcxx . . $ extractCurrentScaleFactor(d342952d81a0f2fb).(float x[4][4]){ |
| 401 |
float det= x[0][0]*x[1][1]*x[2][2] |
| 402 |
-x[0][0]*x[1][2]*x[2][1] |
| 403 |
+x[1][0]*x[2][1]*x[0][2] |
| 404 |
-x[1][0]*x[0][1]*x[2][2] |
| 405 |
+x[2][0]*x[0][1]*x[1][2] |
| 406 |
-x[2][0]*x[1][1]*x[0][2]; |
| 407 |
return powcxx . . $ pow(d59a45cd3bfd2eda).(fabscxx . . $ fabs(fbcf3211dfe1bfd1).(det), 1.0f/3.0f); |
| 408 |
} |
| 409 |
|
| 410 |
float extractCurrentScaleFactorcxx . . $ extractCurrentScaleFactor(9b8c9e39889c762c).(){ |
| 411 |
float x[4][4]; |
| 412 |
glGetFloatv(GL_MODELVIEW_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:485:9`!, &(x[0][0])); |
| 413 |
return extractCurrentScaleFactorcxx . . $ extractCurrentScaleFactor(d342952d81a0f2fb).(x); |
| 414 |
} |
| 415 |
|
| 416 |
void prepareDepthTextureForCurrentViewpointcxx . . $ prepareDepthTextureForCurrentViewpoint(49f6e7a06ebc5aa8).(); |
| 417 |
|
| 418 |
|
| 419 |
void Molcxx . . $ Mol#::DrawHaloscxx . . $ Mol#DrawHalos(49f6e7a06ebc5aa8).(){ |
| 420 |
|
| 421 |
// let's try to aviod THIS! |
| 422 |
prepareDepthTextureForCurrentViewpointcxx . . $ prepareDepthTextureForCurrentViewpoint(49f6e7a06ebc5aa8).(); // hum, unavoidable. |
| 423 |
|
| 424 |
glPushMatrix(); |
| 425 |
glScalef(1/rcxx . . $ Mol#r.,1/rcxx . . $ Mol#r.,1/rcxx . . $ Mol#r.); |
| 426 |
glTranslatef(-pxcxx . . $ Mol#px.,-pycxx . . $ Mol#py.,-pzcxx . . $ Mol#pz.); |
| 427 |
|
| 428 |
float x[4][4], scalef; |
| 429 |
glGetFloatv(GL_MODELVIEW_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:485:9`!, &(x[0][0])); |
| 430 |
|
| 431 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!, 0, |
| 432 |
scalef=extractCurrentScaleFactorcxx . . $ extractCurrentScaleFactor(d342952d81a0f2fb).(x), 0,0,0 |
| 433 |
); |
| 434 |
|
| 435 |
glEnable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 436 |
glEnable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 437 |
|
| 438 |
glDepthMask(false); |
| 439 |
glEnable(GL_BLENDcxx . . $ `<external>/18396878532286971346/glew.h:496:9`!); |
| 440 |
|
| 441 |
if (cgSettingscxx . . $ cgSettings..doingAlphaSnapshotcxx . . $ CgUtil#doingAlphaSnapshot.) |
| 442 |
glBlendFunc(GL_ONEcxx . . $ `<external>/18396878532286971346/glew.h:333:9`!, GL_ONE_MINUS_SRC_ALPHAcxx . . $ `<external>/18396878532286971346/glew.h:370:9`!); |
| 443 |
else |
| 444 |
glBlendFunc(GL_SRC_ALPHAcxx . . $ `<external>/18396878532286971346/glew.h:369:9`!, GL_ONE_MINUS_SRC_ALPHAcxx . . $ `<external>/18396878532286971346/glew.h:370:9`!); |
| 445 |
|
| 446 |
cgSettingscxx . . $ cgSettings..BindHaloShadercxx . . $ CgUtil#BindHaloShader(83c267b20bac841a).( haloCanvascxx . . $ haloCanvas..GetResPow2cxx . . $ MyCanvas#GetResPow2(b126dc7c1de90089).() ); |
| 447 |
|
| 448 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!, 0, |
| 449 |
(100.0+cgSettingscxx . . $ cgSettings..P_halo_awarecxx . . $ CgUtil#P_halo_aware.*1300.0)/scalef/molcxx . . $ mol..rcxx . . $ Mol#r., 0,0,0 |
| 450 |
); |
| 451 |
|
| 452 |
glBegin(GL_QUADScxx . . $ `<external>/18396878532286971346/glew.h:344:9`!); |
| •453 |
for (int i=0; i < (int)atomcxx . . $ Mol#atom..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) atomcxx . . $ Mol#atom.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].DrawHalocxx . . $ QAtom#DrawHalo(49f6e7a06ebc5aa8).(); |
| 454 |
glEnd(); |
| 455 |
|
| 456 |
/* |
| 457 |
glBegin(GL_QUADS); |
| 458 |
for (int i=0; i<bond.size(); i++) bond[i].DrawHalo(); |
| 459 |
glEnd(); |
| 460 |
*/ |
| 461 |
|
| 462 |
glDisable(GL_BLENDcxx . . $ `<external>/18396878532286971346/glew.h:496:9`!); |
| 463 |
cgSettingscxx . . $ cgSettings..BindShaderscxx . . $ CgUtil#BindShaders(49f6e7a06ebc5aa8).(); |
| 464 |
|
| 465 |
glDepthMask(true); |
| 466 |
|
| 467 |
glPopMatrix(); |
| 468 |
|
| 469 |
|
| 470 |
glDisable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 471 |
glDisable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 472 |
} |
| 473 |
|
| 474 |
void Molcxx . . $ Mol#::DrawShadowmapcxx . . $ Mol#DrawShadowmap(b45ddcbc8423892c).(bool invert){ |
| 475 |
glPushMatrix(); |
| 476 |
glScalef(1/rcxx . . $ Mol#r.,1/rcxx . . $ Mol#r.,1/rcxx . . $ Mol#r.); |
| 477 |
glTranslatef(-pxcxx . . $ Mol#px.,-pycxx . . $ Mol#py.,-pzcxx . . $ Mol#pz.); |
| 478 |
|
| 479 |
float x[4][4], scalef; |
| 480 |
glGetFloatv(GL_MODELVIEW_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:485:9`!, &(x[0][0])); |
| 481 |
|
| 482 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!, 0, |
| 483 |
scalef=extractCurrentScaleFactorcxx . . $ extractCurrentScaleFactor(d342952d81a0f2fb).(x),0,0,0 |
| 484 |
); |
| 485 |
|
| 486 |
/*if (invert) { |
| 487 |
glScalef(1,1,-1); |
| 488 |
}*/ |
| 489 |
|
| 490 |
glEnable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 491 |
glEnable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 492 |
|
| 493 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE0_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5746:9`!); |
| 494 |
glDisable(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!); |
| 495 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!); |
| 496 |
glDisable(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!); |
| 497 |
|
| 498 |
|
| 499 |
shadowSettingscxx . . $ shadowSettings..BindShaderscxx . . $ CgUtil#BindShaders(49f6e7a06ebc5aa8).(); |
| 500 |
glBegin(GL_QUADScxx . . $ `<external>/18396878532286971346/glew.h:344:9`!); |
| •501 |
for (int i=0; i < (int)atomcxx . . $ Mol#atom..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) atomcxx . . $ Mol#atom.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].DrawShadowmapcxx . . $ QAtom#DrawShadowmap(49f6e7a06ebc5aa8).(); |
| 502 |
glEnd(); |
| 503 |
|
| 504 |
if (stickscxx . . $ Mol#sticks.) { |
| 505 |
shadowSettingscxx . . $ shadowSettings..BindStickShaderscxx . . $ CgUtil#BindStickShaders(49f6e7a06ebc5aa8).(); |
| 506 |
|
| 507 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!, 0, |
| 508 |
scalef, stick_radiuscxx . . $ stick_radius.,stick_radiuscxx . . $ stick_radius.*2,0 ); |
| 509 |
|
| 510 |
|
| 511 |
glBegin(GL_QUADScxx . . $ `<external>/18396878532286971346/glew.h:344:9`!); |
| •512 |
for (int i=0; i < (int)bondcxx . . $ Mol#bond..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) bondcxx . . $ Mol#bond.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].DrawShadowmapcxx . . $ Bond#DrawShadowmap(49f6e7a06ebc5aa8).(); |
| 513 |
glEnd(); |
| 514 |
} |
| 515 |
glPopMatrix(); |
| 516 |
|
| 517 |
} |
| 518 |
|
| 519 |
void Molcxx . . $ Mol#::Drawcxx . . $ Mol#Draw(49f6e7a06ebc5aa8).(){ |
| 520 |
|
| 521 |
glPushMatrix(); |
| 522 |
glScalef(1/rcxx . . $ Mol#r.,1/rcxx . . $ Mol#r.,1/rcxx . . $ Mol#r.); |
| 523 |
glTranslatef(-pxcxx . . $ Mol#px.,-pycxx . . $ Mol#py.,-pzcxx . . $ Mol#pz.); |
| 524 |
|
| 525 |
|
| 526 |
float x[4][4], scalef; |
| 527 |
glGetFloatv(GL_MODELVIEW_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:485:9`!, &(x[0][0])); |
| 528 |
|
| 529 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!, 0, |
| 530 |
scalef=extractCurrentScaleFactorcxx . . $ extractCurrentScaleFactor(d342952d81a0f2fb).(x),0,0,0 |
| 531 |
); |
| 532 |
|
| 533 |
/* |
| 534 |
glProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 6, |
| 535 |
1.0 / ( scalef*scalef) , 0,0,0 |
| 536 |
);*/ |
| 537 |
/* printf("ScaleFactor= %f, ShadowScaleFactor= %f\n", |
| 538 |
scalef, shadowScaleFactor );*/ |
| 539 |
|
| 540 |
|
| 541 |
glEnable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 542 |
glEnable(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!); |
| 543 |
|
| 544 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE0_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5746:9`!); |
| 545 |
moltextureCanvascxx . . $ moltextureCanvas..SetAsTexturecxx . . $ MyCanvas#SetAsTexture(49f6e7a06ebc5aa8).(); |
| 546 |
|
| 547 |
if (cgSettingscxx . . $ cgSettings..P_shadowstrenghtcxx . . $ CgUtil#P_shadowstrenght.>0) { |
| 548 |
ShadowMapcxx . . $ ShadowMap#::GetCurrentPVMatrixcxx . . $ ShadowMap#GetCurrentPVMatrix(49f6e7a06ebc5aa8).(); |
| 549 |
ShadowMapcxx . . $ ShadowMap#::FeedParameterscxx . . $ ShadowMap#FeedParameters(49f6e7a06ebc5aa8).(); |
| 550 |
} |
| 551 |
|
| 552 |
for (int i=0; i<3; i++) |
| 553 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!, i, |
| 554 |
x[i][0],x[i][1],x[i][2],0 |
| 555 |
); |
| 556 |
|
| 557 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!, 6, |
| 558 |
molcxx . . $ mol..PredictAOcxx . . $ Mol#PredictAO(9b8c9e39889c762c).(),0,0,0 |
| 559 |
); |
| 560 |
|
| 561 |
if (draw_ballscxx . . $ draw_balls.) { |
| 562 |
if (draw_wireframe_ballscxx . . $ draw_wireframe_balls.) { |
| 563 |
glDisable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| •564 |
for (int i=0; i < (int)atomcxx . . $ Mol#atom..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) { |
| 565 |
glColor3f(0,0,1); |
| 566 |
glBegin(GL_LINE_LOOPcxx . . $ `<external>/18396878532286971346/glew.h:336:9`!); |
| 567 |
atomcxx . . $ Mol#atom.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].Drawcxx . . $ QAtom#Draw(49f6e7a06ebc5aa8).(); |
| 568 |
glEnd(); |
| 569 |
} |
| 570 |
} else { |
| 571 |
glEnable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 572 |
glEnable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 573 |
//if (DL_atoms==666) glGenD |
| 574 |
|
| 575 |
glBegin(GL_QUADScxx . . $ `<external>/18396878532286971346/glew.h:344:9`!); |
| •576 |
for (int i=0; i < (int)atomcxx . . $ Mol#atom..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) atomcxx . . $ Mol#atom.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].Drawcxx . . $ QAtom#Draw(49f6e7a06ebc5aa8).(); |
| 577 |
glEnd(); |
| 578 |
|
| 579 |
glDisable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 580 |
glDisable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 581 |
} |
| 582 |
} |
| 583 |
|
| 584 |
|
| 585 |
if (draw_stickscxx . . $ draw_sticks.) |
| 586 |
if (stickscxx . . $ Mol#sticks.) { |
| 587 |
glEnable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 588 |
glEnable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 589 |
cgSettingscxx . . $ cgSettings..BindStickShaderscxx . . $ CgUtil#BindStickShaders(49f6e7a06ebc5aa8).(); |
| 590 |
ShadowMapcxx . . $ ShadowMap#::FeedParameterscxx . . $ ShadowMap#FeedParameters(49f6e7a06ebc5aa8).(); |
| 591 |
for (int i=0; i<3; i++) |
| 592 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!, i, |
| 593 |
x[i][0],x[i][1],x[i][2],0 |
| 594 |
); |
| 595 |
|
| 596 |
/* |
| 597 |
glProgramEnvParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 6, |
| 598 |
1.0 / ( scalef*scalef) , stick_radius,1.0 / ( scalef) ,0 |
| 599 |
);*/ |
| 600 |
|
| 601 |
glEnable(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!); |
| 602 |
|
| 603 |
glProgramEnvParameter4fARBcxx . . $ `<external>/18396878532286971346/glew.h:8260:9`!(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!, 0, |
| 604 |
scalef, stick_radiuscxx . . $ stick_radius.,stick_radiuscxx . . $ stick_radius.*2,0 ); |
| 605 |
|
| 606 |
glColor3f(1,1,1); |
| 607 |
if (draw_wireframe_stickscxx . . $ draw_wireframe_sticks.) { |
| 608 |
glDisable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| •609 |
for (int i=0; i < (int)bondcxx . . $ Mol#bond..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) { |
| 610 |
glColor3f(0,0.6,0.3); |
| 611 |
glBegin(GL_LINE_LOOPcxx . . $ `<external>/18396878532286971346/glew.h:336:9`!); |
| 612 |
bondcxx . . $ Mol#bond.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].Drawcxx . . $ Bond#Draw(49f6e7a06ebc5aa8).(); |
| 613 |
glEnd(); |
| 614 |
} |
| 615 |
} |
| 616 |
else { |
| 617 |
glBegin(GL_QUADScxx . . $ `<external>/18396878532286971346/glew.h:344:9`!); |
| •618 |
for (int i=0; i < (int)bondcxx . . $ Mol#bond..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) bondcxx . . $ Mol#bond.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].Drawcxx . . $ Bond#Draw(49f6e7a06ebc5aa8).(); |
| 619 |
glEnd(); |
| 620 |
} |
| 621 |
cgSettingscxx . . $ cgSettings..BindShaderscxx . . $ CgUtil#BindShaders(49f6e7a06ebc5aa8).(); |
| 622 |
} |
| 623 |
|
| 624 |
glPopMatrix(); |
| 625 |
} |
| 626 |
|
| 627 |
int randomcxx . . $ random(7864480464b09eea).(int max){ |
| 628 |
return randcxx . . $ rand(9efc7249d839d30e).()%max; |
| 629 |
} |
| 630 |
|
| 631 |
/* |
| 632 |
void FillRandomTexture(){ |
| 633 |
int k=0; |
| 634 |
//for (int y=0; y<hardSettigs.TSIZE; y++) |
| 635 |
//for (int x=0; x<hardSettigs.TSIZE; x++) { |
| 636 |
// texture[k++]=128+random(127); |
| 637 |
// texture[k++]=128+random(127); |
| 638 |
// texture[k++]=128+random(127); |
| 639 |
// random(127); |
| 640 |
// |
| 641 |
//} |
| 642 |
} |
| 643 |
|
| 644 |
void FillRedTexture(){ |
| 645 |
int k=0; |
| 646 |
for (int y=0; y<hardSettigs.TSIZE; y++) |
| 647 |
for (int x=0; x<hardSettigs.TSIZE; x++) { |
| 648 |
texture[k++]=255; |
| 649 |
texture[k++]=0; |
| 650 |
texture[k++]=120; |
| 651 |
} |
| 652 |
}*/ |
| 653 |
|
| 654 |
void FillShadedTexturecxx . . $ FillShadedTexture(49f6e7a06ebc5aa8).(){ |
| 655 |
// OctaMapSamp s(CSIZE); |
| 656 |
|
| 657 |
// CubeMapSamp::SetSize(CSIZE); |
| 658 |
// s.Shade(); |
| 659 |
// s.FillTexture(texture,TSIZE); |
| 660 |
} |
| 661 |
|
| 662 |
void drawQuadcxx . . $ drawQuad(7e9a355db6148521).(float x, float y, float z, float r){ |
| 663 |
|
| 664 |
glNormal3f(+1,+1, r); |
| 665 |
glVertex3f(x,y,z); |
| 666 |
|
| 667 |
glNormal3f(-1,+1, r); |
| 668 |
glVertex3f(x,y,z); |
| 669 |
|
| 670 |
glNormal3f(-1,-1, r); |
| 671 |
glVertex3f(x,y,z); |
| 672 |
|
| 673 |
glNormal3f(+1,-1, r); |
| 674 |
glVertex3f(x,y,z); |
| 675 |
} |
| 676 |
|
| 677 |
|
| 678 |
|
| 679 |
Point3fcxx . . $ vcg/Point3f# getGlLightPoscxx . . $ getGlLightPos(89fbfb6f6dabc235).(){ |
| 680 |
float pos[4]; |
| 681 |
glGetLightfv(GL_LIGHT0cxx . . $ `<external>/18396878532286971346/glew.h:764:9`!, GL_POSITIONcxx . . $ `<external>/18396878532286971346/glew.h:638:9`!, pos); |
| 682 |
|
| 683 |
Point3fcxx . . $ vcg/Point3f# L=Point3fcxx . . $ vcg/Point3f#(pos); |
| 684 |
float x[4][4]; |
| 685 |
glGetFloatv(GL_MODELVIEW_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:485:9`!, &(x[0][0])); |
| 686 |
Point3fcxx . . $ vcg/Point3f# rescxx . . $ vcg/Point3#Point3(ca6b6cb9f73ddfb2).( |
| 687 |
L *cxx . . $ vcg/Point3#`operator*`(4a489cdb697f6e61). Point3fcxx . . $ vcg/Point3f#(x[0]), |
| 688 |
L *cxx . . $ vcg/Point3#`operator*`(4a489cdb697f6e61). Point3fcxx . . $ vcg/Point3f#(x[1]), |
| 689 |
L *cxx . . $ vcg/Point3#`operator*`(4a489cdb697f6e61). Point3fcxx . . $ vcg/Point3f#(x[2]) |
| 690 |
); |
| 691 |
res.Normalizecxx . . $ vcg/Point3#Normalize(f55c2490dff4ff58).(); |
| 692 |
|
| 693 |
return -cxx . . $ vcg/Point3#operator-(6f246fd4bb5f10ad).res; |
| 694 |
} |
| 695 |
|
| 696 |
vectorcxx . . $ std/vector#<Point3fcxx . . $ vcg/Point3f#> DirVcxx . . $ DirV.; |
| 697 |
|
| 698 |
void Molcxx . . $ Mol#::ResetAOcxx . . $ Mol#ResetAO(49f6e7a06ebc5aa8).(){ |
| 699 |
AOreadycxx . . $ Mol#AOready.=false; |
| 700 |
AOstartedcxx . . $ Mol#AOstarted.=false; |
| 701 |
AOdoneLvlcxx . . $ Mol#AOdoneLvl.=0; |
| 702 |
} |
| 703 |
|
| 704 |
bool Molcxx . . $ Mol#::DoingAOcxx . . $ Mol#DoingAO(c9857a73d68e59ba).(){ |
| 705 |
if (!readycxx . . $ Mol#ready.) return false; |
| 706 |
if (cgSettingscxx . . $ cgSettings..P_texturecxx . . $ CgUtil#P_texture.==0) return false; |
| 707 |
if (DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()==0) return true; |
| •708 |
return AOdoneLvlcxx . . $ Mol#AOdoneLvl.< (int)DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); |
| 709 |
} |
| 710 |
|
| 711 |
bool Molcxx . . $ Mol#::DecentAOcxx . . $ Mol#DecentAO(c9857a73d68e59ba).(){ |
| 712 |
float k=1; |
| •713 |
if (AOdoneLvlcxx . . $ Mol#AOdoneLvl. >= (int)DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()) return true; |
| 714 |
if (atomcxx . . $ Mol#atom..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()<10) return (AOdoneLvlcxx . . $ Mol#AOdoneLvl.>6*k); |
| 715 |
if (atomcxx . . $ Mol#atom..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()<100) return (AOdoneLvlcxx . . $ Mol#AOdoneLvl.>4*k); |
| 716 |
if (atomcxx . . $ Mol#atom..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()<1000) return (AOdoneLvlcxx . . $ Mol#AOdoneLvl.>2*k); |
| 717 |
if (atomcxx . . $ Mol#atom..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()<10000) return (AOdoneLvlcxx . . $ Mol#AOdoneLvl.>1*k); |
| 718 |
return true; |
| 719 |
} |
| 720 |
|
| 721 |
float Molcxx . . $ Mol#::PredictAOcxx . . $ Mol#PredictAO(9b8c9e39889c762c).(){ |
| 722 |
// Additive prediction |
| 723 |
//return 0.6*(DirV.size()-AOdoneLvl)/float(DirV.size()); |
| 724 |
|
| 725 |
// multiplicative prediction |
| 726 |
if (DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()==0) return 1.0; else { |
| 727 |
float coeff=0.25+(AOdoneLvlcxx . . $ Mol#AOdoneLvl.-1)/20.0; |
| 728 |
if (coeff>1.0f) coeff=1.0f; |
| 729 |
return |
| 730 |
coeff*float(DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()*1.0f) / (AOdoneLvlcxx . . $ Mol#AOdoneLvl./*+DirV.size()*0.3f*/); |
| 731 |
} |
| 732 |
} |
| 733 |
|
| 734 |
|
| 735 |
void Molcxx . . $ Mol#::PrepareAOstartcxx . . $ Mol#PrepareAOstart(49f6e7a06ebc5aa8).(){ |
| 736 |
AOdoneLvlcxx . . $ Mol#AOdoneLvl.=0; |
| 737 |
AOgpu2cxx . . $ AOgpu2#::Resetcxx . . $ AOgpu2#Reset(3446b187c880527c).(*this); |
| 738 |
|
| 739 |
AOstartedcxx . . $ Mol#AOstarted.=true; |
| 740 |
if (DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()==0) { |
| 741 |
// genreate probe views |
| 742 |
GenNormalcxx . . $ vcg/GenNormal#<float>::Uniformcxx . . $ vcg/GenNormal#Uniform(872bc63edec9fdd).(hardSettingscxx . . $ hardSettings..N_VIEW_DIRcxx . . $ HardSettings#N_VIEW_DIR.,DirVcxx . . $ DirV.); |
| 743 |
// mix them! |
| 744 |
int N=DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); |
| 745 |
for (int k=0; k<N/2; k++) { |
| 746 |
int i=randcxx . . $ rand(9efc7249d839d30e).()%N; |
| 747 |
int j=randcxx . . $ rand(9efc7249d839d30e).()%N; |
| 748 |
Point3fcxx . . $ vcg/Point3f# tmp=DirVcxx . . $ vcg/Point3#Point3(5401f57a7bce03f4).[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i]; |
| 749 |
DirVcxx . . $ DirV.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i]=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e).DirVcxx . . $ DirV.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).j]; |
| 750 |
DirVcxx . . $ DirV.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).j]=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e).tmp; |
| 751 |
} |
| 752 |
} |
| 753 |
} |
| 754 |
|
| 755 |
// for testing purposes |
| •756 |
void Molcxx . . $ Mol#::PrepareAOSingleViewcxx . . $ Mol#PrepareAOSingleView(49f6e7a06ebc5aa8).(){ |
| 757 |
static int i=0; |
| 758 |
PrepareAOstartcxx . . $ Mol#PrepareAOstart(49f6e7a06ebc5aa8).(); |
| 759 |
AOgpu2cxx . . $ AOgpu2#::Bindcxx . . $ AOgpu2#Bind(49f6e7a06ebc5aa8).(); |
| 760 |
AOgpu2cxx . . $ AOgpu2# aocxx . . $ AOgpu2#AOgpu2(6a1303b020515adf).(DirVcxx . . $ vcg/Point3#Point3(5401f57a7bce03f4).[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i], *this, 4 ); |
| •761 |
i++; if (i > (int)DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()) i=0; |
| 762 |
AOgpu2cxx . . $ AOgpu2#::UnBindcxx . . $ AOgpu2#UnBind(49f6e7a06ebc5aa8).(); |
| 763 |
AOdoneLvlcxx . . $ Mol#AOdoneLvl.=DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); |
| 764 |
} |
| 765 |
|
| 766 |
bool Molcxx . . $ Mol#::PrepareAOstepcxx . . $ Mol#PrepareAOstep(83c267b20bac841a).(int nsteps){ |
| 767 |
|
| 768 |
if (!DoingAOcxx . . $ Mol#DoingAO(c9857a73d68e59ba).()) return true; |
| 769 |
if (!AOstartedcxx . . $ Mol#AOstarted.) PrepareAOstartcxx . . $ Mol#PrepareAOstart(49f6e7a06ebc5aa8).(); |
| 770 |
|
| 771 |
AOgpu2cxx . . $ AOgpu2#::Bindcxx . . $ AOgpu2#Bind(49f6e7a06ebc5aa8).(); |
| 772 |
if (validViewcxx . . $ validView(fb818b536fe750bb).(DirVcxx . . $ vcg/Point3#Point3(5401f57a7bce03f4).[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).AOdoneLvlcxx . . $ Mol#AOdoneLvl.])) AOgpu2cxx . . $ AOgpu2# aocxx . . $ AOgpu2#AOgpu2(6a1303b020515adf).(DirVcxx . . $ vcg/Point3#Point3(5401f57a7bce03f4).[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).AOdoneLvlcxx . . $ Mol#AOdoneLvl.], *this, DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()); |
| 773 |
AOgpu2cxx . . $ AOgpu2#::UnBindcxx . . $ AOgpu2#UnBind(49f6e7a06ebc5aa8).(); |
| 774 |
|
| 775 |
|
| 776 |
AOdoneLvlcxx . . $ Mol#AOdoneLvl.++; |
| •777 |
return (AOdoneLvlcxx . . $ Mol#AOdoneLvl. >= (int)DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()) ; |
| 778 |
} |
| 779 |
|
| 780 |
void Molcxx . . $ Mol#::PrepareAOallAtOncecxx . . $ Mol#PrepareAOallAtOnce(49f6e7a06ebc5aa8).(){ |
| 781 |
if (AOreadycxx . . $ Mol#AOready.) return; |
| 782 |
|
| 783 |
StartTimecxx . . $ StartTime(49f6e7a06ebc5aa8).(); |
| 784 |
|
| 785 |
while (!PrepareAOstepcxx . . $ Mol#PrepareAOstep(83c267b20bac841a).(1)); |
| 786 |
|
| 787 |
//AOgpu2::GetFinalTexture(texture,*this); |
| 788 |
//refresh(); |
| 789 |
|
| 790 |
FILE *f = fopen("res.txt", "w"); |
| •791 |
long int w=TakeTimecxx . . $ TakeTime(239003bd6de320c1).(f, (char *)"sampled"); |
| 792 |
|
| •793 |
fprintf(f," %d views done in %ld msec (%.2f views x sec), with %d atoms & %d sticks.\n", |
| 794 |
(int)DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(), w, |
| 795 |
(int)DirVcxx . . $ DirV..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()*1000.0/w, (int)this->atomcxx . . $ Mol#atom..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(), |
| 796 |
(int)(this->stickscxx . . $ Mol#sticks.?(this->bondcxx . . $ Mol#bond..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()):0) ); |
| 797 |
fclose(f); |
| 798 |
|
| 799 |
AOreadycxx . . $ Mol#AOready.=true; |
| 800 |
} |
| 801 |
|
| 802 |
void clearFramecxx . . $ clearFrame(49f6e7a06ebc5aa8).() { |
| 803 |
glClearColor( cgSettingscxx . . $ cgSettings..P_bg_color_Rcxx . . $ CgUtil#P_bg_color_R., cgSettingscxx . . $ cgSettings..P_bg_color_Gcxx . . $ CgUtil#P_bg_color_G., cgSettingscxx . . $ cgSettings..P_bg_color_Bcxx . . $ CgUtil#P_bg_color_B., 0.0f); |
| 804 |
|
| 805 |
glClear(GL_COLOR_BUFFER_BITcxx . . $ `<external>/18396878532286971346/glew.h:765:9`! | GL_DEPTH_BUFFER_BITcxx . . $ `<external>/18396878532286971346/glew.h:352:9`!); |
| 806 |
} |
| 807 |
|
| 808 |
void setLightDircxx . . $ setLightDir(8c9d966b9d6d20d).(Point3fcxx . . $ vcg/Point3f# d){ |
| 809 |
float f[4]; |
| 810 |
f[0]=d[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).0]; |
| 811 |
f[1]=d[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).1]; |
| 812 |
f[2]=d[cxx . . $ vcg/Point3#`operator[]`(7a0ef1c7079e8533).2]; |
| 813 |
f[3]=0; |
| 814 |
glLightfv(GL_LIGHT0cxx . . $ `<external>/18396878532286971346/glew.h:764:9`!, GL_POSITIONcxx . . $ `<external>/18396878532286971346/glew.h:638:9`!, f ); |
| 815 |
} |
| 816 |
|
| 817 |
Point3fcxx . . $ vcg/Point3f# getDirFromTrackballcxx . . $ getDirFromTrackball(56d1c8a5e7012d52).(vcgcxx . . $ vcg/::Trackballcxx . . $ vcg/Trackball# &tb){ |
| 818 |
glPushMatrix(); |
| 819 |
gluLookAt(1,-3,-5, 0,0,0, 0,1,0); |
| 820 |
|
| 821 |
tb.centercxx . . $ vcg/Transform#center.=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e).Point3fcxx . . $ vcg/Point3#Point3(ca6b6cb9f73ddfb2).(0, 0, 0); |
| 822 |
tb.radiuscxx . . $ vcg/Transform#radius.= 1; |
| 823 |
|
| 824 |
tb.GetViewcxx . . $ vcg/Trackball#GetView(49f6e7a06ebc5aa8).(); |
| 825 |
tb.Applycxx . . $ vcg/Trackball#Apply(b45ddcbc8423892c).(false); |
| 826 |
|
| •827 |
//float pos[4]={0.0f,0.0f,-1.0f,0.0f}; |
| 828 |
float d[16]; |
| 829 |
glGetFloatv(GL_MODELVIEW_MATRIXcxx . . $ `<external>/18396878532286971346/glew.h:485:9`!,d); |
| 830 |
glPopMatrix(); |
| 831 |
|
| 832 |
Point3fcxx . . $ vcg/Point3f# rescxx . . $ vcg/Point3#Point3(ca6b6cb9f73ddfb2).(-d[8],-d[9],-d[10]); |
| 833 |
res.Normalizecxx . . $ vcg/Point3#Normalize(f55c2490dff4ff58).(); |
| 834 |
return rescxx . . $ vcg/Point3#Point3(5401f57a7bce03f4).; |
| 835 |
|
| 836 |
} |
| 837 |
|
| 838 |
|
| 839 |
void drawLightDircxx . . $ drawLightDir(49f6e7a06ebc5aa8).() |
| 840 |
{ |
| 841 |
glPushMatrix(); |
| 842 |
lightTrackcxx . . $ lightTrack..GetViewcxx . . $ vcg/Trackball#GetView(49f6e7a06ebc5aa8).(); |
| 843 |
lightTrackcxx . . $ lightTrack..Applycxx . . $ vcg/Trackball#Apply(b45ddcbc8423892c).(false); |
| 844 |
#if 0 |
| 845 |
glPushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT); |
| 846 |
glColor3f(1,1,0); |
| 847 |
glDisable(GL_LIGHTING); |
| 848 |
const int lineNum=3; |
| 849 |
glBegin(GL_LINES); |
| 850 |
for(unsigned int i=0;i<=lineNum;++i) |
| 851 |
for(unsigned int j=0;j<=lineNum;++j) { |
| 852 |
glVertex3f(-1.0f+i*2.0/lineNum,-1.0f+j*2.0/lineNum,-2); |
| 853 |
glVertex3f(-1.0f+i*2.0/lineNum,-1.0f+j*2.0/lineNum, 2); |
| 854 |
} |
| 855 |
glEnd(); |
| 856 |
glPopAttrib(); |
| 857 |
#endif |
| 858 |
|
| 859 |
glPopMatrix(); |
| 860 |
} |
| 861 |
|
| 862 |
void drawFramecxx . . $ drawFrame(49f6e7a06ebc5aa8).() { |
| 863 |
|
| •864 |
char* locale; |
| 865 |
locale = setlocale(LC_ALLcxx . . $ `<external>/3736975272097309885/locale.h:41:9`!,NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 866 |
setlocale(LC_ALLcxx . . $ `<external>/3736975272097309885/locale.h:41:9`!,"C"); |
| 867 |
|
| 868 |
cgSettingscxx . . $ cgSettings..MakeShaderscxx . . $ CgUtil#MakeShaders(49f6e7a06ebc5aa8).(); |
| •869 |
|
| 870 |
setlocale(LC_ALLcxx . . $ `<external>/3736975272097309885/locale.h:41:9`!,locale); |
| 871 |
|
| 872 |
if (molcxx . . $ mol..DoingAOcxx . . $ Mol#DoingAO(c9857a73d68e59ba).()) { |
| 873 |
// do at least one more step per rendering |
| 874 |
molcxx . . $ mol..PrepareAOstepcxx . . $ Mol#PrepareAOstep(83c267b20bac841a).(1); |
| 875 |
// continue until decent |
| 876 |
while (!molcxx . . $ mol..DecentAOcxx . . $ Mol#DecentAO(c9857a73d68e59ba).()) molcxx . . $ mol..PrepareAOstepcxx . . $ Mol#PrepareAOstep(83c267b20bac841a).(1); |
| 877 |
} |
| 878 |
|
| 879 |
/*if (cgSettings.UseHalo()>0) { |
| 880 |
// write depth in HaloTexture |
| 881 |
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, haloFrame); |
| 882 |
} else { |
| 883 |
// write depth in depthbuffer |
| 884 |
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); |
| 885 |
}*/ |
| 886 |
|
| 887 |
|
| 888 |
mainCanvascxx . . $ mainCanvas..SetAsOutputcxx . . $ MyCanvas#SetAsOutput(c9857a73d68e59ba).(); |
| 889 |
|
| 890 |
if (cgSettingscxx . . $ cgSettings..doingAlphaSnapshotcxx . . $ CgUtil#doingAlphaSnapshot.) |
| 891 |
glClearColor( cgSettingscxx . . $ cgSettings..P_halo_colcxx . . $ CgUtil#P_halo_col., cgSettingscxx . . $ cgSettings..P_halo_colcxx . . $ CgUtil#P_halo_col., cgSettingscxx . . $ cgSettings..P_halo_colcxx . . $ CgUtil#P_halo_col., 0.0f); |
| 892 |
else |
| 893 |
glClearColor( cgSettingscxx . . $ cgSettings..P_bg_color_Rcxx . . $ CgUtil#P_bg_color_R., cgSettingscxx . . $ cgSettings..P_bg_color_Gcxx . . $ CgUtil#P_bg_color_G., cgSettingscxx . . $ cgSettings..P_bg_color_Bcxx . . $ CgUtil#P_bg_color_B., 0.0f); |
| 894 |
|
| 895 |
glClear(GL_COLOR_BUFFER_BITcxx . . $ `<external>/18396878532286971346/glew.h:765:9`! | GL_DEPTH_BUFFER_BITcxx . . $ `<external>/18396878532286971346/glew.h:352:9`!); |
| 896 |
|
| 897 |
|
| 898 |
glMatrixMode(GL_MODELVIEWcxx . . $ `<external>/18396878532286971346/glew.h:678:9`!); |
| 899 |
glLoadIdentity(); |
| 900 |
|
| 901 |
|
| 902 |
Point3fcxx . . $ vcg/Point3f# lightDircxx . . $ vcg/Point3#Point3(49f6e7a06ebc5aa8).; |
| 903 |
|
| 904 |
if ( cgSettingscxx . . $ cgSettings..P_sem_effectcxx . . $ CgUtil#P_sem_effect. // fixed light dir sem effect |
| 905 |
// || mol.sticks // quick Hack: fixed light dir when bonds |
| 906 |
) |
| 907 |
lightDir=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e). Point3fcxx . . $ vcg/Point3#Point3(ca6b6cb9f73ddfb2).(0,0,1); |
| 908 |
else |
| 909 |
lightDir=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e).getDirFromTrackballcxx . . $ getDirFromTrackball(56d1c8a5e7012d52).(lightTrackcxx . . $ lightTrack.); |
| 910 |
|
| 911 |
setLightDircxx . . $ setLightDir(8c9d966b9d6d20d).( lightDircxx . . $ vcg/Point3#Point3(5401f57a7bce03f4). ); |
| 912 |
|
| 913 |
// gluLookAt(0,0,-3, 0,0,0, 0,1,0); original |
| 914 |
// gluLookAt(0,0,-3, 0,0,0, 0,1,0); ok for tra |
| 915 |
|
| 916 |
gluLookAt(0,0,-40, 0,0,0, 0,1,0); |
| 917 |
if(MovingLightModecxx . . $ MovingLightMode.) drawLightDircxx . . $ drawLightDir(49f6e7a06ebc5aa8).(); |
| 918 |
glColor3f(1,1,1); |
| 919 |
if (1) { |
| 920 |
|
| 921 |
|
| 922 |
|
| 923 |
//track.center=Point3f(0, 0, 0); |
| 924 |
//track.radius= 1; |
| 925 |
//setProjection(); |
| 926 |
|
| 927 |
if (aniStepcxx . . $ aniStep.>=0) |
| 928 |
{ |
| 929 |
double extraRot=360.0*aniStepcxx . . $ aniStep.; |
| 930 |
|
| 931 |
// set extra rotation for GIF animation: |
| 932 |
switch (hardSettingscxx . . $ hardSettings..GIF_ANIMATION_MODEcxx . . $ HardSettings#GIF_ANIMATION_MODE.) { |
| 933 |
default: |
| 934 |
case 0: |
| 935 |
glRotated(-hardSettingscxx . . $ hardSettings..GIF_ROT_SIDEVIEW_ANGLEcxx . . $ HardSettings#GIF_ROT_SIDEVIEW_ANGLE.,1,0,0); |
| 936 |
glRotated(extraRot,0,1,0); |
| 937 |
break; |
| 938 |
case 1: |
| 939 |
glRotated(-extraRot,0,0,1); |
| 940 |
glRotated(hardSettingscxx . . $ hardSettings..GIF_INSP_ANGLEcxx . . $ HardSettings#GIF_INSP_ANGLE.,0,1,0); |
| 941 |
glRotated(extraRot,0,0,1); |
| 942 |
break; |
| 943 |
case 2:{ |
| 944 |
double substep[6]; |
| 945 |
for (int i=0; i<6; i++) { |
| 946 |
substep[i]=(aniStepcxx . . $ aniStep.*6-i)*90.0; |
| 947 |
if (substep[i]<0) substep[i]=0; |
| 948 |
if (substep[i]>90.0) substep[i]=90.0; |
| 949 |
} |
| 950 |
glRotated(-substep[5], 1,0,0); |
| 951 |
glRotated(-substep[4], 0,1,0); |
| 952 |
glRotated(-substep[3], 0,1,0); |
| 953 |
glRotated(-substep[2], 1,0,0); |
| 954 |
glRotated(-substep[1], 0,1,0); |
| 955 |
glRotated(-substep[0], 0,1,0); |
| 956 |
}break; |
| 957 |
} |
| 958 |
} |
| 959 |
|
| 960 |
setProjectioncxx . . $ setProjection(d4f767463ce0a6b3).( mainCanvascxx . . $ mainCanvas..GetVideoSizecxx . . $ MyCanvas#GetVideoSize(b126dc7c1de90089).() ); |
| 961 |
trackcxx . . $ track..GetViewcxx . . $ vcg/Trackball#GetView(49f6e7a06ebc5aa8).(); |
| 962 |
trackcxx . . $ track..Applycxx . . $ vcg/Trackball#Apply(b45ddcbc8423892c).(false); |
| 963 |
setProjectioncxx . . $ setProjection(d4f767463ce0a6b3).( mainCanvascxx . . $ mainCanvas..GetSoftRescxx . . $ MyCanvas#GetSoftRes(b126dc7c1de90089).() ); |
| 964 |
|
| 965 |
|
| 966 |
if (cgSettingscxx . . $ cgSettings..P_use_shadowmapcxx . . $ CgUtil#P_use_shadowmap(c9857a73d68e59ba).()) { |
| 967 |
shadowmapcxx . . $ shadowmap..computeAsTexturecxx . . $ ShadowMap#computeAsTexture(7482869ca8a6e6e6).( getGlLightPoscxx . . $ getGlLightPos(89fbfb6f6dabc235).() , cgSettingscxx . . $ cgSettings..do_use_doubleshadowcxx . . $ CgUtil#do_use_doubleshadow(c9857a73d68e59ba).(), shadowmapCanvascxx . . $ shadowmapCanvas.); |
| 968 |
//shadowmap.computeAsTexture( Point3f(0,1,0) ); |
| 969 |
} |
| 970 |
|
| 971 |
cgSettingscxx . . $ cgSettings..BindShaderscxx . . $ CgUtil#BindShaders(49f6e7a06ebc5aa8).(); |
| 972 |
|
| 973 |
glEnable(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!); |
| 974 |
//glBindTexture(GL_TEXTURE_2D, molTexture); |
| 975 |
|
| 976 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE1_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5747:9`!); |
| 977 |
shadowmapCanvascxx . . $ shadowmapCanvas..SetAsTexturecxx . . $ MyCanvas#SetAsTexture(49f6e7a06ebc5aa8).(); |
| 978 |
|
| 979 |
|
| 980 |
|
| 981 |
molcxx . . $ mol..Drawcxx . . $ Mol#Draw(49f6e7a06ebc5aa8).(); |
| 982 |
// shadowmap.m.DrawShadowmap(false); |
| 983 |
|
| 984 |
|
| 985 |
glDisable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 986 |
glDisable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 987 |
glDisable(GL_BLENDcxx . . $ `<external>/18396878532286971346/glew.h:496:9`!); |
| 988 |
|
| 989 |
if (cgSettingscxx . . $ cgSettings..UseHalocxx . . $ CgUtil#UseHalo(c9857a73d68e59ba).()>0) molcxx . . $ mol..DrawHaloscxx . . $ Mol#DrawHalos(49f6e7a06ebc5aa8).(); |
| 990 |
} |
| 991 |
|
| 992 |
} |
| 993 |
|
| 994 |
void SetTextureAccesscxx . . $ SetTextureAccess(b45ddcbc8423892c).(bool bilinear){ |
| 995 |
glActiveTextureARBcxx . . $ `<external>/18396878532286971346/glew.h:5817:9`!(GL_TEXTURE0_ARBcxx . . $ `<external>/18396878532286971346/glew.h:5746:9`!); |
| 996 |
moltextureCanvascxx . . $ moltextureCanvas..SetAsTexturecxx . . $ MyCanvas#SetAsTexture(49f6e7a06ebc5aa8).(); |
| 997 |
|
| 998 |
|
| 999 |
if (bilinear) { |
| 1000 |
glTexParameteri(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!, GL_TEXTURE_MIN_FILTERcxx . . $ `<external>/18396878532286971346/glew.h:735:9`!, GL_LINEARcxx . . $ `<external>/18396878532286971346/glew.h:729:9`!); |
| 1001 |
glTexParameteri(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!, GL_TEXTURE_MAG_FILTERcxx . . $ `<external>/18396878532286971346/glew.h:734:9`!, GL_LINEARcxx . . $ `<external>/18396878532286971346/glew.h:729:9`!); |
| 1002 |
} |
| 1003 |
else { |
| 1004 |
glTexParameteri(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!, GL_TEXTURE_MIN_FILTERcxx . . $ `<external>/18396878532286971346/glew.h:735:9`!, GL_NEARESTcxx . . $ `<external>/18396878532286971346/glew.h:728:9`!); |
| 1005 |
glTexParameteri(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!, GL_TEXTURE_MAG_FILTERcxx . . $ `<external>/18396878532286971346/glew.h:734:9`!, GL_NEARESTcxx . . $ `<external>/18396878532286971346/glew.h:728:9`!); |
| 1006 |
} |
| 1007 |
glTexParameteri(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!, GL_TEXTURE_WRAP_Scxx . . $ `<external>/18396878532286971346/glew.h:736:9`!, GL_REPEATcxx . . $ `<external>/18396878532286971346/glew.h:739:9`!); |
| 1008 |
glTexParameteri(GL_TEXTURE_2Dcxx . . $ `<external>/18396878532286971346/glew.h:12482:9`!, GL_TEXTURE_WRAP_Tcxx . . $ `<external>/18396878532286971346/glew.h:737:9`!, GL_REPEATcxx . . $ `<external>/18396878532286971346/glew.h:739:9`!); |
| 1009 |
} |
| 1010 |
|
| 1011 |
/* |
| 1012 |
void ReloadTexture(vector<Byte> t, bool bilinear){ |
| 1013 |
// glEnable(GL_TEXTURE); |
| 1014 |
glEnable(GL_TEXTURE_2D); |
| 1015 |
|
| 1016 |
|
| 1017 |
glActiveTextureARB(GL_TEXTURE0_ARB); |
| 1018 |
glBindTexture(GL_TEXTURE_2D, molTexture); |
| 1019 |
|
| 1020 |
glTexImage2D( |
| 1021 |
GL_TEXTURE_2D, |
| 1022 |
0, |
| 1023 |
GL_RGB, |
| 1024 |
//TSIZE,TSIZE, |
| 1025 |
0, |
| 1026 |
GL_RGB, |
| 1027 |
GL_UNSIGNED_BYTE, |
| 1028 |
(void*)&(t[0]) |
| 1029 |
); |
| 1030 |
|
| 1031 |
|
| 1032 |
SetTextureAccess(bilinear); |
| 1033 |
}*/ |
| 1034 |
|
| 1035 |
int initGlcxx . . $ initGl(b126dc7c1de90089).(){ |
| 1036 |
|
| 1037 |
int res=0; |
| 1038 |
glClearDepth(1.0); |
| 1039 |
glDepthFunc(GL_LESScxx . . $ `<external>/18396878532286971346/glew.h:360:9`!); |
| 1040 |
glEnable(GL_DEPTH_TESTcxx . . $ `<external>/18396878532286971346/glew.h:465:9`!); |
| 1041 |
glShadeModel(GL_SMOOTHcxx . . $ `<external>/18396878532286971346/glew.h:703:9`!); |
| 1042 |
|
| 1043 |
float pos[4]={0.0f,0.8f,0.6f,0.0f}; |
| 1044 |
glLightfv(GL_LIGHT0cxx . . $ `<external>/18396878532286971346/glew.h:764:9`!, GL_POSITIONcxx . . $ `<external>/18396878532286971346/glew.h:638:9`!, pos); |
| 1045 |
|
| 1046 |
glEnable(GL_VERTEX_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:8100:9`!); |
| 1047 |
glEnable(GL_FRAGMENT_PROGRAM_ARBcxx . . $ `<external>/18396878532286971346/glew.h:4775:9`!); |
| 1048 |
|
| 1049 |
if (!CgUtilcxx . . $ CgUtil#::initcxx . . $ CgUtil#init(c9857a73d68e59ba).()) res|=ERRGL_NO_GLEWcxx . . $ `src/Common.h:37:9`!; |
| 1050 |
if(!GLEW_ARB_vertex_programcxx . . $ `<external>/18396878532286971346/glew.h:8305:9`! ) res|=ERRGL_NO_VScxx . . $ `src/Common.h:33:9`!; |
| 1051 |
if(!GLEW_ARB_fragment_programcxx . . $ `<external>/18396878532286971346/glew.h:4791:9`! ) res|=ERRGL_NO_FScxx . . $ `src/Common.h:32:9`!; |
| 1052 |
|
| 1053 |
|
| 1054 |
if (!shadowmapcxx . . $ shadowmap..initcxx . . $ ShadowMap#init(c9857a73d68e59ba).()) res|=ERRGL_NO_FBO_SHADOWMAPcxx . . $ `src/Common.h:34:9`!; |
| 1055 |
if (!shadowmapcxx . . $ shadowmap..initHalocxx . . $ ShadowMap#initHalo(c9857a73d68e59ba).()) res|=ERRGL_NO_FBO_HALOcxx . . $ `src/Common.h:35:9`!; |
| 1056 |
|
| 1057 |
if (! AOgpu2cxx . . $ AOgpu2#::initcxx . . $ AOgpu2#init(c9857a73d68e59ba).()) res|=ERRGL_NO_FBO_AOcxx . . $ `src/Common.h:36:9`!; |
| 1058 |
|
| 1059 |
cgSettingscxx . . $ cgSettings..UpdateShaderscxx . . $ CgUtil#UpdateShaders(49f6e7a06ebc5aa8).(); |
| 1060 |
|
| 1061 |
//ReloadTexture(texture, true); |
| 1062 |
return res; |
| 1063 |
|
| 1064 |
} |
| 1065 |
|
| 1066 |
Point3fcxx . . $ vcg/Point3f# RandomUnitVeccxx . . $ RandomUnitVec(89fbfb6f6dabc235).(){ |
| 1067 |
Point3fcxx . . $ vcg/Point3f# kcxx . . $ vcg/Point3#Point3(49f6e7a06ebc5aa8).; |
| 1068 |
do { |
| 1069 |
k=cxx . . $ vcg/Point3#`operator=`(4233705dd3c5533e).Point3fcxx . . $ vcg/Point3#Point3(ca6b6cb9f73ddfb2).( |
| 1070 |
(randomcxx . . $ random(7864480464b09eea).(200)-100)*0.01, |
| 1071 |
(randomcxx . . $ random(7864480464b09eea).(200)-100)*0.01, |
| 1072 |
(randomcxx . . $ random(7864480464b09eea).(200)-100)*0.01 |
| 1073 |
); |
| 1074 |
} while (k.SquaredNormcxx . . $ vcg/Point3#SquaredNorm(8f5363d873dd4781).()>1.0); |
| 1075 |
|
| 1076 |
return kcxx . . $ vcg/Point3#Point3(5401f57a7bce03f4)..Normalizecxx . . $ vcg/Point3#Normalize(f55c2490dff4ff58).(); |
| 1077 |
} |
| 1078 |
|
| 1079 |
long int globaltimecxx . . $ globaltime.,startingtimecxx . . $ startingtime.; |
| 1080 |
|
| 1081 |
void StartTimecxx . . $ StartTime(49f6e7a06ebc5aa8).();/*{ |
| 1082 |
startingtime=globaltime=getTicks(); |
| 1083 |
}*/ |
| 1084 |
|
| 1085 |
long int TakeTimecxx . . $ TakeTime(239003bd6de320c1).(FILE *f , char *st);/*{ |
| 1086 |
long int timen=getTicks(), delta=timen-globaltime; |
| 1087 |
fprintf(f,"%5dmsec: %s\n",delta,st); |
| 1088 |
globaltime=timen; |
| 1089 |
return delta; |
| 1090 |
}*/ |
| 1091 |
/*long int TakeTotalTime(){ |
| 1092 |
long int timen=getTicks(), delta=timen-startingtime; |
| 1093 |
printf("------------------\nTotal time: %5dmsec\n",delta); |
| 1094 |
globaltime=timen; |
| 1095 |
return delta; |
| 1096 |
}*/ |
| 1097 |
|
| 1098 |
float myfabscxx . . $ myfabs(fbcf3211dfe1bfd1).(float a){ |
| 1099 |
return (a<0)?-a:a; |
| 1100 |
} |
| 1101 |
|
| 1102 |
void Cyclecxx . . $ Cycle(b8d3300d42ddd7c9).( float &c, float min, float max, float step){ |
| 1103 |
if (myfabscxx . . $ myfabs(fbcf3211dfe1bfd1).(c-max)<0.02) c=min; |
| 1104 |
else { |
| 1105 |
c+=step; |
| 1106 |
if (c>max) c=max; |
| 1107 |
} |
| 1108 |
} |
| 1109 |
|
| 1110 |
int InitQuteMolcxx . . $ InitQuteMol(5c4306d8553b3696).(const char * filename) |
| 1111 |
{ |
| 1112 |
|
| 1113 |
CubeMapSampcxx . . $ CubeMapSamp#::SetSizecxx . . $ CubeMapSamp#SetSize(d4f767463ce0a6b3).(CSIZEcxx . . $ CSIZE.); |
| 1114 |
OctaMapSampcxx . . $ OctaMapSamp#::SetSizecxx . . $ OctaMapSamp#SetSize(d4f767463ce0a6b3).(CSIZEcxx . . $ CSIZE.); |
| 1115 |
|
| 1116 |
if (filename==NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) filename="porin.pdb"; |
| 1117 |
|
| 1118 |
molcxx . . $ mol..ReadPdbcxx . . $ Mol#ReadPdb(c5f7da30cbc0f4e9).(filename); |
| 1119 |
cgSettingscxx . . $ cgSettings..SetDefaultscxx . . $ CgUtil#SetDefaults(49f6e7a06ebc5aa8).(); |
| 1120 |
// initGl gets called from the GL canvas on startup. It's not |
| 1121 |
// legal to call it before that time because the OpenGL context |
| 1122 |
// does not exist yet. |
| 1123 |
|
| 1124 |
/*if (!initGl()) { |
| 1125 |
printf("failed to initialize! :(\n"); |
| 1126 |
return 0; |
| 1127 |
}*/ |
| 1128 |
|
| 1129 |
//FillRandomTexture(); |
| 1130 |
//mol.DuplicateTexels(texture, TSIZE); |
| 1131 |
//ReloadTexture(texture, bilinear); |
| 1132 |
return 1; |
| 1133 |
} |
| 1134 |
|
| 1135 |
|
| 1136 |
|
| 1137 |
bool SaveImagePPMcxx . . $ SaveImagePPM(db522c3ca90c1).( const char * filename , const Bytecxx . . $ Byte# *im, int sizex, int sizey) |
| 1138 |
{ |
| 1139 |
FILE * fp = fopen(filename,"wb"); |
| 1140 |
if(fp==0) return false; |
| 1141 |
|
| 1142 |
|
| 1143 |
fprintf(fp,"P6\n%d %d\n255\n",sizex,sizey); |
| 1144 |
|
| 1145 |
int k=0; |
| 1146 |
for(int i=0;i<sizex*sizey;++i) |
| 1147 |
{ |
| 1148 |
fwrite(&(im[k++]),1,1,fp); |
| 1149 |
fwrite(&(im[k++]),1,1,fp); |
| 1150 |
fwrite(&(im[k++]),1,1,fp); |
| 1151 |
//k++; |
| 1152 |
} |
| 1153 |
|
| 1154 |
fclose(fp); |
| 1155 |
return true; |
| 1156 |
} |
| 1157 |
|
| 1158 |
bool SaveImagePPMcxx . . $ SaveImagePPM(d912adce17167e4b).( const char * filename , const vectorcxx . . $ std/vector#<Bytecxx . . $ Byte#> &im, int sizex, int sizey){ |
| 1159 |
return |
| 1160 |
SaveImagePPMcxx . . $ SaveImagePPM(db522c3ca90c1).( filename , (Bytecxx . . $ Byte#*)(&im[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).0]), sizex, sizey); |
| 1161 |
} |
| 1162 |
|
| 1163 |
bool LoadImagePPMcxx . . $ LoadImagePPM(65675b50c7937203).( const char * filename , vectorcxx . . $ std/vector#<Bytecxx . . $ Byte#> &im) |
| 1164 |
{ |
| 1165 |
FILE * fp = fopen(filename,"rb"); |
| 1166 |
if(fp==0) return false; |
| 1167 |
|
| 1168 |
int sizex, sizey, res; |
| 1169 |
res=fscanf(fp,"P6\n%d %d\n255\n",&sizex,&sizey); |
| 1170 |
printf("Loading %s (res=%d)...\n",filename, res); |
| 1171 |
if (res!=2) return false; |
| 1172 |
printf(" - size= (%d %d) ...\n",sizex, sizey); |
| 1173 |
|
| 1174 |
int k=0; |
| 1175 |
for(int i=0;i<sizex*sizey;++i) |
| 1176 |
{ |
| 1177 |
fread(&(im[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).k++]),1,1,fp); |
| 1178 |
fread(&(im[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).k++]),1,1,fp); |
| 1179 |
fread(&(im[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).k++]),1,1,fp); |
| 1180 |
} |
| 1181 |
|
| 1182 |
fclose(fp); |
| 1183 |
return true; |
| 1184 |
} |