blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905
values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 115
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6e534ee1d749f997bcc0c393d7de97194049ade3 | 2a27047e4438eaf56eef7acfadf584bba3f6b491 | /speexbuild/AGC.cpp | f791b524f3d75fc60eddfd4c9de286aabc7cda1b | [] | no_license | rok-kek/mumble | 22482521febca3e3e80f9dfc1338b17ad562ea20 | 94162697d34181549263822ab03b3c87300d456d | refs/heads/master | 2021-01-24T04:07:47.647789 | 2012-07-16T16:45:18 | 2012-07-16T16:45:18 | 5,070,225 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,579 | cpp | #include <QtCore>
#ifdef Q_OS_WIN
#define _WIN32_IE 0x0600
#include <windows.h>
#include <shellapi.h>
#define CALLGRIND_START_INSTRUMENTATION
#define CALLGRIND_STOP_INSTRUMENTATION
#define CALLGRIND_ZERO_STATS
#else
#include <valgrind/callgrind.h>
#endif
#include <math.h>
#include <speex/speex.h>
#include <speex/speex_preprocess.h>
#include "Timer.h"
template<class T>
static inline double veccomp(const QVector<T> &a, const QVector<T> &b, const char *n) {
long double rms = 0.0;
long double gdiff = 0.0;
if (a.size() != b.size()) {
qFatal("%s: %d <=> %d", n, a.size(), b.size());
}
for (int i=0;i<a.size();++i) {
double diff = fabs(a[i] - b[i]);
rms += diff * diff;
if (diff > gdiff)
gdiff = diff;
#ifdef EXACT
if (a[i] != b[i]) {
#else
union { T tv;
uint32_t uv;
} v1, v2;
v1.uv = v2.uv = 0;
v1.tv = a[i];
v2.tv = b[i];
if (fabsf(a[i] - b[i]) > 1000) {
qWarning("%08x %08x %08x", v1.uv, v2.uv, v1.uv ^ v2.uv);
#endif
qFatal("%s: Offset %d: %.10g <=> %.10g", n, i, static_cast<double>(a[i]), static_cast<double>(b[i]));
}
}
return gdiff;
return sqrt(rms / a.size());
}
int main(int argc, char **argv) {
CALLGRIND_STOP_INSTRUMENTATION;
CALLGRIND_ZERO_STATS;
QCoreApplication a(argc, argv);
QFile f((argc >= 2) ? argv[1] : "wb_male.wav");
if (! f.open(QIODevice::ReadOnly)) {
qFatal("Failed to open file!");
}
f.seek(36 + 8);
QFile o("output.agc");
if (! o.open(QIODevice::WriteOnly))
qFatal("Failed to open out file!");
QFile vf("verify.agc");
if (! vf.open(QIODevice::ReadOnly))
qWarning("No verify!");
QDataStream out(&o);
QDataStream verify(&vf);
static const int iFrameSize = 320;
int iarg;
SpeexPreprocessState *spp = speex_preprocess_state_init(iFrameSize, 16000);
iarg = 0;
speex_preprocess_ctl(spp, SPEEX_PREPROCESS_SET_VAD, &iarg);
speex_preprocess_ctl(spp, SPEEX_PREPROCESS_SET_DENOISE, &iarg);
speex_preprocess_ctl(spp, SPEEX_PREPROCESS_SET_AGC, &iarg);
speex_preprocess_ctl(spp, SPEEX_PREPROCESS_SET_DEREVERB, &iarg);
iarg = 1;
speex_preprocess_ctl(spp, SPEEX_PREPROCESS_SET_AGC, &iarg);
iarg = 21747;
speex_preprocess_ctl(spp, SPEEX_PREPROCESS_SET_AGC_TARGET, &iarg);
QVector<QByteArray> v;
while (1) {
QByteArray qba = f.read(iFrameSize * sizeof(short));
if (qba.size() != iFrameSize * sizeof(short))
break;
v.append(qba);
}
int nframes = v.size();
qWarning("Ready to process %d frames of %d samples", nframes, iFrameSize);
QVector<short *> qvIn;
QVector<short> sIn(nframes * iFrameSize);
for (int i=0;i<nframes;i++) {
const short *ptr = reinterpret_cast<const short *>(v[i].constData());
short *s = sIn.data() + i * iFrameSize;
for (int j=0;j<iFrameSize;++j)
s[j] = ptr[j];
qvIn.append(s);
}
#ifdef Q_OS_WIN
if (!SetPriorityClass(GetCurrentProcess(),REALTIME_PRIORITY_CLASS))
qWarning("Application: Failed to set priority!");
#endif
Timer t;
t.restart();
CALLGRIND_START_INSTRUMENTATION;
for (int i=0;i<nframes;i++) {
speex_preprocess_run(spp, qvIn[i]);
int v;
speex_preprocess_ctl(spp, SPEEX_PREPROCESS_GET_AGC_GAIN, &v);
qWarning("%d %d", i, v);
}
CALLGRIND_STOP_INSTRUMENTATION;
quint64 e = t.elapsed();
#ifdef Q_OS_WIN
if (!SetPriorityClass(GetCurrentProcess(),NORMAL_PRIORITY_CLASS))
qWarning("Application: Failed to reset priority!");
#endif
qWarning("Used %llu usec", e);
qWarning("%.2f times realtime", (20000ULL * nframes) / (e * 1.0));
if (! RUNNING_ON_VALGRIND) {
out << sIn;
if (vf.isOpen()) {
QVector<short> vIn;
verify >> vIn;
veccomp(vIn, sIn, "AGC");
}
}
return 0;
}
| [
"slicer@users.sourceforge.net"
] | slicer@users.sourceforge.net |
9e023ee139f733d10e7b84a3c12bf61eaefe144a | f8a7792165ac068e5f5dfd42ca749f0d628ce3e5 | /src/UnitTest/TestArray.h | b619b4b159618bf1716872f85365e300025373ec | [
"BSD-2-Clause"
] | permissive | evan-charmworks/quinoa | 437d1d628abdef557de8dfbe5996a34edb522c54 | 2e6cd4e4eb9a535a94d89000de3274ce5c9cb40c | refs/heads/master | 2020-03-19T08:37:29.765248 | 2018-05-02T02:55:08 | 2018-05-02T02:55:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 683 | h | // *****************************************************************************
/*!
\file src/UnitTest/TestArray.h
\copyright 2012-2015, J. Bakosi, 2016-2018, Los Alamos National Security, LLC.
\brief Simple test Charm++ array for testing arrays
\details Simple test Charm++ array for testing arrays.
*/
// *****************************************************************************
#ifndef TestArray_h
#define TestArray_h
namespace tut {
//! Charm++ chare array definition for testing arrays
class TestArray : public CBase_TestArray {
public:
explicit TestArray() {}
explicit TestArray( CkMigrateMessage* ) {}
};
} // tut::
#endif // TestArray_h
| [
"jbakosi@lanl.gov"
] | jbakosi@lanl.gov |
8d80738344da9f3d61f07f1e88252082c9b7fa67 | 19dca364006ce21b1c46263a9fbb2db85db0d213 | /src/cube.h | 2a14ce9bd231e59ba18789c03ed756e64544393d | [] | no_license | Volian0/RetroKostki | 970947cd1b5b66d5a30726d6065add4507002819 | 1711b2f5830b64fda7cbb3e5354f84c7eaf91532 | refs/heads/master | 2023-06-06T05:26:08.060767 | 2021-06-26T20:25:27 | 2021-06-26T20:25:27 | 379,826,274 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 472 | h | #pragma once
#include <glm/glm.hpp>
#include <string>
#include <vector>
#include <map>
#include <optional>
#include "texture.h"
extern void render_cube(glm::vec3 pos, Texture* texture, class Shader* shader, double delta);
struct Cube
{
glm::vec3 pos;
Texture* texture;
inline void render(class Shader* shader)
{
render_cube(pos, texture, shader, anim_tp);
}
//bool discovered = true;
bool is_static = false;
double anim_tp = 0.0;
//uint8_t offset = 0;
}; | [
"bobrowy@outlook.com"
] | bobrowy@outlook.com |
32e9de3007a082dadca1f618de8f574f222640ab | 99ff452bd377cd6ebcc7327c7a38d23e472b9ede | /src/leakDetector/displayMemLeak.cpp | 8a8fa20032c83d6f0ee430daea9ecc0f9f66e5db | [] | no_license | Fu188/process_memory_tracker | a2f5d880777f0a363a35391fd0d9f6055cec9a9b | 81442569c566fa8aef8056539737e710c6ed2fff | refs/heads/main | 2023-05-06T12:05:09.916011 | 2021-05-30T06:18:06 | 2021-05-30T06:18:06 | 362,410,845 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,792 | cpp | # include <iostream>
# include <string>
# include <vector>
# include <time.h>
# include "MemLeakDetector.hpp"
# include "displayMemLeak.hpp"
# include "../memStat/display.hpp"
const float LEAKSAFE = 10;
const float LEAKWARN = 20;
const float LEAKDANGER = 30;
int leakSize = 0;
int checkArgsMemLeak(int displayNum, int sortRegulation) {
if (displayNum < 1 || displayNum > 10) {
ForeGroundColor FGColor = FG_GREEN;
setForeGoundColor(FG_GREEN);
setFontBold();
printf("Display Number should be in range [1,10].\n");
resetDisplay();
return 0;
}
if (sortRegulation < 0 || sortRegulation >2) {
ForeGroundColor FGColor = FG_GREEN;
setForeGoundColor(FG_GREEN);
setFontBold();
printf("Sort Regulation should be in (0, 2).\n");
printf("0: Sort by Name 1: Sort by Size/FD 2: Sort by Time\n");
resetDisplay();
return 0;
}
return 1;
}
void displayHelpMemLeak(){
ForeGroundColor FGColor = FG_GREEN;
setForeGoundColor(FG_GREEN);
setFontBold();
printf("You can use -n or -s to show the result.\n");
printf("Use -n to set the number of displayed item. Range: [1, 10].\n");
printf("Use -s to set the sort regulation. Range: [0, 2].\n");
printf("0: Sort by Name 1: Sort by Size 2: Sort by Time\n");
resetDisplay();
}
void displayTitleMemLeak(){
BackGroundColor BGColor = BG_BLACK;
ForeGroundColor FGColor = FG_WHITE;
moveCursorLineHead();
setFontBold();
setBackGroundColor(BGColor);
setForeGoundColor(FGColor);
printf ("%15s%15s%15s%15s%15s",
"NAME-MEM","LINE","SIZE","TIME","ADDRESS");
resetDisplay();
printf("\n");
}
void displayEachMem(vector<Mem_info> (*memLeakFunc)(), int displayNum) {
time_t nowtime = time(NULL);
vector<Mem_info> memLeakList = (*memLeakFunc)();
leakSize = memLeakList.size();
// printf("inside:%d\n",leakSize);
for (int i=0;i<displayNum && i<leakSize;++i){
time_t second = nowtime-memLeakList[i].start;
displayMemoryLeak(memLeakList[i], second);
}
}
void displayMemoryLeak(Mem_info leak, time_t second){
BackGroundColor BGColor = BG_GREEN;
ForeGroundColor FGColor = FG_BLACK;
if (second > LEAKDANGER) {
setFlash();
BGColor = BG_RED;
} else if (second > LEAKWARN) {
BGColor = BG_RED;
} else if (second > LEAKSAFE) {
BGColor = BG_YELLOW;
} else {
BGColor = BG_GREEN;
}
setBackGroundColor(BGColor);
setForeGoundColor(FGColor);
moveCursorLineHead();
// info.name[10] = '\0';
printf ("%15s%15d%15d%15lld 0x%08x",
leak.file_name.c_str(), leak.line, leak.size, second,leak.address);
resetDisplay();
printf("\n");
}
| [
"178927469@qq.com"
] | 178927469@qq.com |
12e0b49ad14de0cf666bf78bfefd856790107786 | 7b3d3a3e80584cf02174fb345167d3b922f4aa42 | /UVA/11111.Cpp | ed8bbd5d94d280391902b4358297a635e7befa9d | [] | no_license | asdf168ghjkl/coding | 63d495521284bd2c680142be647444926e54ba7d | 3ac370cd8df420a58c65b6ab9675d3758cda0be6 | refs/heads/master | 2021-01-10T14:00:45.897404 | 2016-02-12T10:58:11 | 2016-02-12T10:58:11 | 50,718,986 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,090 | cpp | #include <iostream>
#include <sstream>
#include <stdio.h>
using namespace std;
int main(){
string x;
int ans=0;
while(getline(cin,x)){
ans=0;
stringstream p(x);
int z[100000]={0},zz=1,yy=0,xx=1;
int y[100000]={0};
int k[100000]={0};
int m[100000]={0};
int q[100000]={0},qq=1;
int po=0,ne=0;
while(p >> z[zz]){
zz++;
}
zz--;
int i=1;
if(zz==0){
cout << ":-) Matrioshka!\n";
continue;
}
if(zz%2==1){
cout << ":-( Try again.\n";
continue;
}
for(int j=1;j<=zz;j++){
if(z[j]<0) ne++;
else po++;
}
if(po!=ne){
cout << ":-( Try again.\n";
continue;
}
int a0=0;
for(int j=1;j<=zz;j++){
if(z[j]==0){
a0=1;
break;
}
}
if(a0==1){
cout << ":-( Try again.\n";
continue;
}
while(i<zz){
if(z[i]==-z[i+1]){
yy++;
y[yy]=i;
k[i]=1;
k[i+1]=1;
}
i++;
}
while(xx<=yy){
for(int j=0;;j++){
if(y[xx]-j<1) break;
if(z[y[xx]+j+1] == -z[y[xx]-j]){
if(z[y[xx]+j+1] > m[y[xx]]){
for(int f=0;f<=j;f++){
m[y[xx]+1+f]=z[y[xx]+1+j];
m[y[xx]-f]=z[y[xx]+1+j];
q[y[xx]+1+f]=qq;
q[y[xx]-f]=qq;
}
qq++;
}
else ans=1;
k[y[xx]+j+1]=1;
k[y[xx]-j]=1;
}
else{
break;
}
}
xx++;
}
for(int j=y[1]+2;j<=zz;j++){
if(k[j]==0 && z[j]>0){
for(int u=j-1;u>=1;u--){
if(k[u]==0 && z[u] == -z[j]){
int total=0,g=0;
for(int r=j-1;r>u;r--){
if(q[r]!=g){
g=q[r];
total+=m[r];
}
}
if(z[j] > total){
k[j]=1;
k[u]=1;
for(int f=u;f<=j;f++){
m[f]=z[j];
q[f]=qq;
}
qq++;
break;
}
else{
ans=1;
break;
}
}
else if(k[u]==0 && z[u]<0){
ans=1;
break;
}
}
}
else continue;
}
/*
int ma=-1000000000;
for(int j=1;j<=zz/2;j++){
if(z[j] == -z[zz+1-j]){
if(z[j] > ma) ma=z[j];
else ans=1;
k[j]=1;
k[zz+1-j]=1;
}
else{
int total=0,g=0;
for(int u=j+1;u<=zz+1-j;u++){
if(q[u]!=g){
g=q[u];
total+=m[u];
}
}
if(total >= z[zz+2-j]) ans=1;
break;
}
}
*/
for(int j=1;j<=zz;j++){
if(k[j]==0){
ans=1;
break;
}
}
if(ans==1){
cout << ":-( Try again.\n";
}
else{
cout << ":-) Matrioshka!\n";
}
}
return 0;
}
| [
"asdf168ghjkl@gmail.com"
] | asdf168ghjkl@gmail.com |
b60e9be83cbf9c4d49d59f9d0a8febf46e2a622d | cb80a8562d90eb969272a7ff2cf52c1fa7aeb084 | /inletTest9/0.044/nut | 0859a44de5d4f72d319a3646f9eb238d641c4c79 | [] | no_license | mahoep/inletCFD | eb516145fad17408f018f51e32aa0604871eaa95 | 0df91e3fbfa60d5db9d52739e212ca6d3f0a28b2 | refs/heads/main | 2023-08-30T22:07:41.314690 | 2021-10-14T19:23:51 | 2021-10-14T19:23:51 | 314,657,843 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 143,493 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.044";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField nonuniform List<scalar>
12716
(
723.824
636.261
2096.72
2215.19
3850.1
13159.8
3600.64
253.332
17.6093
3.49874
1.36691
0.810261
0.601412
0.503899
0.450687
0.416107
0.38947
0.36659
0.346079
0.327617
0.311166
0.296666
0.283959
0.272831
0.263049
0.254404
0.246721
0.239867
0.233741
0.22827
0.223397
0.219083
0.215294
0.212005
0.209197
0.206856
0.204974
0.203547
0.20258
0.202071
0.202047
0.202542
0.203585
0.205234
0.207565
0.210668
0.214644
0.219583
0.225532
0.232465
0.240301
0.249048
0.259257
0.273081
0.296607
0.34534
0.459375
0.756809
1.64475
4.3962
9.40661
8.96269
4.86846
1.91891
0.807909
0.375005
0.194369
0.0897323
0.0223428
0.00390643
0.000125967
0.000107088
0.00172243
0.00798471
0.00485653
0.00122452
9.39718e-05
8.28895e-05
0.00102784
0.0036907
0.00317791
0.000940163
7.66877e-05
7.09376e-05
0.000869366
0.00281817
0.00261469
0.000831281
6.73549e-05
6.41816e-05
0.000794046
0.00242592
0.00233134
0.000776702
6.21456e-05
6.0082e-05
0.000745454
0.00219579
0.00214482
0.000736538
5.87925e-05
5.7326e-05
0.000711787
0.00204623
0.00201058
0.000706561
5.64538e-05
5.53506e-05
0.000685841
0.00193246
0.00190566
0.000682339
5.47196e-05
5.38533e-05
0.000664775
0.00184011
0.00181917
0.000661686
5.33669e-05
5.26602e-05
0.00064661
0.00176226
0.00174549
0.000643781
5.22692e-05
5.16694e-05
0.000630518
0.00169497
0.00168123
0.000627943
5.13425e-05
5.08199e-05
0.000616055
0.00163582
0.00162413
0.000613689
5.05389e-05
5.00732e-05
0.000602869
0.00158309
0.00157291
0.000600695
4.98256e-05
4.94032e-05
0.000590737
0.0015355
0.00152651
0.000588745
4.91809e-05
4.87925e-05
0.000579493
0.0014921
0.0014841
0.000577669
4.85898e-05
4.82283e-05
0.000569005
0.00145223
0.00144505
0.000567335
4.80409e-05
4.77011e-05
0.000559165
0.00141535
0.00140886
0.000557631
4.75261e-05
4.72039e-05
0.000549878
0.00138099
0.0013751
0.000548468
4.70389e-05
4.67313e-05
0.000541069
0.00134877
0.00134344
0.000539769
4.65744e-05
4.62787e-05
0.000532676
0.0013185
0.00131367
0.000531478
4.61284e-05
4.58423e-05
0.00052465
0.00128997
0.00128557
0.000523546
4.56973e-05
4.54192e-05
0.000516948
0.00126297
0.00125893
0.000515926
4.52786e-05
4.5007e-05
0.000509526
0.00123732
0.00123359
0.000508574
4.48702e-05
4.46038e-05
0.000502342
0.00121284
0.00120937
0.000501449
4.447e-05
4.42076e-05
0.000495357
0.00118939
0.00118613
0.000494514
4.40762e-05
4.38164e-05
0.000488535
0.00116684
0.00116375
0.000487737
4.36866e-05
4.34282e-05
0.000481848
0.00114506
0.00114212
0.000481087
4.32995e-05
4.30413e-05
0.000475265
0.00112396
0.00112112
0.000474535
4.29129e-05
4.26537e-05
0.000468755
0.00110344
0.00110068
0.000468046
4.2525e-05
4.22635e-05
0.000462284
0.00108338
0.00108066
0.000461589
4.21339e-05
4.18687e-05
0.000455819
0.0010637
0.00106099
0.000455128
4.17375e-05
4.14672e-05
0.000449325
0.00104429
0.00104155
0.000448631
4.13338e-05
4.1057e-05
0.000442772
0.00102505
0.00102227
0.000442071
4.09207e-05
4.06362e-05
0.000436136
0.00100592
0.00100308
0.000435428
4.04964e-05
4.02029e-05
0.000429399
0.000986838
0.000983906
0.000428685
4.00593e-05
3.97558e-05
0.000422546
0.000967743
0.000964709
0.000421801
3.96079e-05
3.92929e-05
0.000415546
0.000948583
0.000945431
0.000414773
3.91401e-05
3.8812e-05
0.000408392
0.000929308
0.000926028
0.000407594
3.86534e-05
3.83103e-05
0.000401072
0.000909881
0.00090647
0.000400252
3.81449e-05
3.77845e-05
0.000393575
0.000890275
0.000886743
0.000392746
3.76113e-05
3.72315e-05
0.000385908
0.000870492
0.000866865
0.000385089
3.70499e-05
3.66494e-05
0.000378097
0.000850575
0.000846898
0.000377319
3.64597e-05
3.60385e-05
0.000370193
0.00083062
0.000827124
0.00036949
3.58413e-05
3.53995e-05
0.000362303
0.000810822
0.000807683
0.000361734
3.51947e-05
3.47349e-05
0.000354637
0.000791473
0.000788845
0.000354198
3.45257e-05
3.40508e-05
0.00034726
0.000772842
0.000770975
0.00034705
3.38402e-05
3.33543e-05
0.000340399
0.000755359
0.000754291
0.000340517
3.31462e-05
3.26548e-05
0.00033428
0.000739446
0.000739637
0.000334862
3.24544e-05
3.19657e-05
0.000329196
0.000725843
0.000727647
0.000330374
3.17793e-05
3.13034e-05
0.000325437
0.000715117
0.000718815
0.000327314
3.11376e-05
3.06846e-05
0.000323217
0.000707774
0.000713609
0.000325851
3.05452e-05
3.01236e-05
0.000322634
0.000704195
0.000712274
0.000326044
3.00125e-05
2.96292e-05
0.000323687
0.000704693
0.000714786
0.000327748
2.95476e-05
2.9207e-05
0.000326083
0.00070908
0.00072081
0.000330618
2.91503e-05
2.88561e-05
0.000329422
0.000716785
0.000729579
0.000334199
2.88073e-05
2.85857e-05
0.000332842
0.000727052
0.000739838
0.000336913
2.85267e-05
2.83621e-05
0.000334503
0.000737739
0.00075041
0.000338154
2.82705e-05
2.81139e-05
0.000335309
0.000748342
0.000760609
0.000338642
2.80067e-05
2.78488e-05
0.000335614
0.000758014
0.000769503
0.000338581
2.77338e-05
2.75814e-05
0.000335442
0.000766155
0.000776646
0.000337928
2.74861e-05
2.73411e-05
0.000334726
0.00077246
0.000781889
0.000336716
2.72621e-05
2.71261e-05
0.000333488
0.000776947
0.000785367
0.000335075
2.70597e-05
2.69349e-05
0.000331884
0.00077984
0.000787309
0.000333147
2.68785e-05
2.67657e-05
0.000330052
0.000781455
0.000787996
0.000331033
2.67201e-05
2.66196e-05
0.000328091
0.000782026
0.000787726
0.000328852
2.65828e-05
2.64954e-05
0.000326097
0.000781726
0.000786705
0.000326696
2.64692e-05
2.63936e-05
0.000324151
0.00078078
0.000785055
0.000324621
2.63745e-05
2.63094e-05
0.000322276
0.000779318
0.000783019
0.000322658
2.62964e-05
2.62399e-05
0.000320494
0.000777512
0.000780789
0.000320855
2.62302e-05
2.61815e-05
0.000318824
0.000775507
0.000778388
0.000319193
2.61758e-05
2.61336e-05
0.000317267
0.000773336
0.000775868
0.000317635
2.61293e-05
2.60923e-05
0.000315756
0.00077096
0.00077319
0.000316141
2.60903e-05
2.60586e-05
0.000314309
0.000768362
0.0007703
0.000314699
2.60583e-05
2.60303e-05
0.000312894
0.000765421
0.000767213
0.00031328
2.60301e-05
2.60039e-05
0.00031148
0.000762103
0.000763764
0.000311849
2.6001e-05
2.59741e-05
0.000310031
0.000758395
0.000759912
0.000310364
2.59656e-05
2.59366e-05
0.000308505
0.000754294
0.000755651
0.000308801
2.59232e-05
2.58931e-05
0.000306909
0.000749798
0.000751006
0.00030717
2.58747e-05
2.58431e-05
0.000305239
0.000744924
0.000745999
0.000305466
2.5822e-05
2.57889e-05
0.000303488
0.000739684
0.000740832
0.000303733
2.57655e-05
2.57203e-05
0.000301732
0.000734268
0.00073504
0.000301709
2.57183e-05
2.56129e-05
0.000299943
0.000728236
0.000731478
0.000300977
2.57515e-05
2.57147e-05
0.000300011
0.000730941
0.000742364
0.000305545
2.63246e-05
2.6311e-05
0.000308517
0.000749893
0.000743088
0.000306033
2.6789e-05
2.6841e-05
0.000317506
0.000772045
0.000779153
0.000321312
2.74501e-05
0.00224499
0.00439573
0.00682008
0.00937106
0.0115826
0.0139177
0.0158742
0.0175299
0.0187572
0.0195878
0.019981
0.0199282
0.0194398
0.0185013
0.0172033
0.0155063
0.013604
0.0114185
0.0095668
0.00744976
0.00503024
0.00324426
0.00236735
0.00106317
0.00030661
0.000141013
1.78322e-05
1.27988e-05
0.000130984
0.000265742
8.95352e-05
3.69594e-05
9.18925e-06
1.09306e-05
8.32722e-05
0.000207944
0.000191813
7.99824e-05
1.14901e-05
1.15301e-05
8.59637e-05
0.000208947
0.000194839
8.10137e-05
1.1408e-05
1.13696e-05
8.38162e-05
0.000200607
0.000191625
7.96108e-05
1.12557e-05
1.1265e-05
8.31854e-05
0.000198398
0.000192162
7.99561e-05
1.1171e-05
1.12425e-05
8.27138e-05
0.000199935
0.000193531
7.9685e-05
1.12316e-05
1.12814e-05
8.33817e-05
0.00020172
0.000196071
8.07106e-05
1.12605e-05
1.13288e-05
8.4138e-05
0.000203993
0.000198191
8.12584e-05
1.13078e-05
1.13718e-05
8.47416e-05
0.00020624
0.000200427
8.19171e-05
1.13501e-05
1.14141e-05
8.55824e-05
0.00020878
0.000202921
8.27326e-05
1.13942e-05
1.14559e-05
8.61936e-05
0.000211255
0.000205124
8.29898e-05
1.14295e-05
1.14676e-05
8.63219e-05
0.000213513
0.000207355
8.3342e-05
1.14358e-05
1.14808e-05
8.70599e-05
0.000216047
0.000209871
8.41726e-05
1.14554e-05
1.15297e-05
8.78058e-05
0.000218793
0.000212495
8.47382e-05
1.15055e-05
1.15718e-05
8.84566e-05
0.00022157
0.000215182
8.54283e-05
1.15478e-05
1.16179e-05
8.92395e-05
0.000224534
0.000218126
8.62429e-05
1.15952e-05
1.167e-05
9.01667e-05
0.000227702
0.000221163
8.71192e-05
1.16481e-05
1.17198e-05
9.10135e-05
0.000230839
0.000224075
8.77924e-05
1.16956e-05
1.17638e-05
9.16071e-05
0.00023385
0.000227018
8.8402e-05
1.17391e-05
1.18189e-05
9.25405e-05
0.000237224
0.000230528
8.96573e-05
1.1801e-05
1.19096e-05
9.41342e-05
0.000241159
0.000234386
9.10972e-05
1.19008e-05
1.20122e-05
9.53809e-05
0.000245199
0.000238217
9.19888e-05
1.19934e-05
1.20669e-05
9.63373e-05
0.000249106
0.000241898
9.29838e-05
1.20464e-05
1.21269e-05
9.73511e-05
0.000253003
0.000245672
9.39856e-05
1.21061e-05
1.21921e-05
9.85015e-05
0.000257111
0.000249758
9.51408e-05
1.21726e-05
1.22653e-05
9.98045e-05
0.000261589
0.000254112
9.63883e-05
1.22464e-05
1.23403e-05
0.000101122
0.000266144
0.000258447
9.76014e-05
1.23202e-05
1.24118e-05
0.00010238
0.000270729
0.000262861
9.87789e-05
1.23905e-05
1.24841e-05
0.000103687
0.00027547
0.000267531
0.000100078
1.24635e-05
1.2565e-05
0.000105154
0.000280566
0.00027247
0.000101491
1.25444e-05
1.2648e-05
0.000106605
0.000285723
0.000277391
0.000102778
1.26254e-05
1.27277e-05
0.000107932
0.000290996
0.000282556
0.000104118
1.27035e-05
1.2813e-05
0.000109629
0.000296635
0.000288124
0.000105868
1.27905e-05
1.29054e-05
0.000111361
0.000302503
0.000293562
0.000107253
1.2878e-05
1.29781e-05
0.00011256
0.000307926
0.000298696
0.000108341
1.29441e-05
1.30363e-05
0.000113869
0.000313508
0.000304248
0.000109653
1.29981e-05
1.3122e-05
0.000115113
0.000319387
0.000309848
0.000110788
1.30961e-05
1.32133e-05
0.000116234
0.000325473
0.0003158
0.000111746
1.31783e-05
1.33138e-05
0.000117268
0.000332014
0.000322346
0.000112764
1.32861e-05
1.34542e-05
0.000118417
0.000339895
0.000330543
0.000113892
1.34469e-05
1.36219e-05
0.000120053
0.000349893
0.000340871
0.000115802
1.36124e-05
1.37837e-05
0.000124044
0.000366196
0.000355471
0.000118695
1.38369e-05
1.40203e-05
0.000130215
0.000381275
0.000370151
0.000123352
1.39321e-05
1.41542e-05
0.000135523
0.000400037
0.000387056
0.000128779
1.41598e-05
1.4418e-05
0.000140103
0.000415162
0.000405187
0.000135813
1.44547e-05
1.46622e-05
0.00014467
0.000435253
0.000425121
0.000139675
1.46766e-05
1.48671e-05
0.000148899
0.000455984
0.000448843
0.000148139
1.50535e-05
1.52659e-05
0.000160507
0.000482612
0.000473778
0.000154719
1.53513e-05
1.55575e-05
0.000165526
0.000503742
0.000496249
0.000160749
1.56418e-05
1.58707e-05
0.000170574
0.000525838
0.00051898
0.000167246
1.60735e-05
1.64501e-05
0.000176831
0.000543322
0.000531639
0.000174563
1.67741e-05
1.73686e-05
0.000179021
0.00055271
0.000540849
0.000179141
1.8391e-05
2.01738e-05
0.000190736
0.000567067
0.00055812
0.000192905
2.24389e-05
2.57368e-05
0.000232432
0.000588495
0.00055896
0.000259574
1.93985e-05
1.2667e-05
5.50325e-05
0.000162068
0.000465273
0.000151295
1.57757e-05
1.76405e-05
0.000145412
0.000452616
0.000521365
0.00017432
2.05214e-05
2.43282e-05
0.000175176
0.000546164
0.000747364
0.00021005
3.07758e-05
5.0609e-05
0.000286929
0.00133441
0.00196751
0.000779585
8.70626e-05
0.000101813
0.000780101
0.00215664
0.00268621
0.00112927
0.000121866
0.000134103
0.00124315
0.00291143
0.00283055
0.00119932
0.00012853
0.000116487
0.000928482
0.00213056
0.00271596
0.00106968
0.00014062
0.000162108
0.00121071
0.00288491
0.00313167
0.00131475
0.000188281
0.000205272
0.00139124
0.00332629
0.00335288
0.00143814
0.000233798
0.000265337
0.00173497
0.00407106
0.00427647
0.00188287
0.000300727
0.000296025
0.00197763
0.00448633
0.00357773
0.00165085
0.000270214
0.000269712
0.00169743
0.0037176
0.00352768
0.0016431
0.000269887
0.000262113
0.001714
0.00366046
0.0029025
0.00145412
0.000244187
0.000248924
0.00153035
0.00316219
0.00358723
0.00171791
0.000270875
0.00028963
0.00187664
0.00396521
0.00398929
0.00195778
0.000293992
0.000302241
0.00191889
0.00371171
0.00320992
0.0021309
0.000327941
0.00037384
0.00238498
0.00263773
0.00216032
0.00205317
0.000387201
0.000430452
0.00181598
0.00204963
0.00177925
0.00146806
0.000478856
0.00054771
0.00132049
0.00144541
0.00119359
0.0010497
0.000574349
0.000526513
0.000900485
0.00116007
0.00109477
0.00077131
0.000603401
0.000373875
0.000683824
0.00112395
0.00121064
0.000675904
0.000462858
0.000243895
0.000716294
0.0014013
0.0015419
0.000783291
0.000249683
0.000206141
0.000634495
0.00197746
0.00105947
0.000489274
0.000199318
0.000188924
0.000480271
0.00119599
0.00116709
0.000461706
0.00018555
0.000166343
0.000400953
0.000783884
0.000987426
0.00043319
0.000160999
0.00015079
0.000432236
0.000914037
0.000841232
0.000405378
0.000134861
0.000119451
0.000362367
0.0006391
0.000836031
0.000407565
0.000113402
0.00010604
0.00042695
0.000808763
0.000779136
0.000409655
9.61976e-05
8.50405e-05
0.000384868
0.000626708
0.000840709
0.000445426
8.29115e-05
8.93357e-05
0.000457877
0.000777755
0.00126158
0.000600262
0.000104769
0.000120446
0.000673694
0.00141738
0.00146888
0.000716572
0.000115735
0.000109258
0.000686664
0.00121029
0.00166346
0.000821742
0.000118284
0.000126584
0.000888855
0.00165679
0.00159032
0.000845567
0.000113498
0.000104464
0.000763862
0.00127309
0.00161666
0.000881869
0.000111386
0.000121332
0.000950043
0.00168774
0.00160674
0.000909336
0.000111626
9.83507e-05
0.000809963
0.00153248
0.00119544
0.000672836
8.50791e-05
8.95365e-05
0.000806086
0.00155714
0.00146299
0.000734282
8.78606e-05
7.07753e-05
0.000631503
0.00122207
0.000685827
0.000198829
3.84565e-05
3.07901e-05
0.000249795
0.00093446
0.000784745
0.000226297
3.69907e-05
2.88558e-05
0.000184958
0.000559523
0.000535154
0.000178458
2.31668e-05
1.6068e-05
7.53641e-05
0.000211054
0.000562869
0.000297843
2.39681e-05
3.14715e-05
0.000287786
0.000568259
0.000466091
0.000195086
2.65968e-05
2.11376e-05
0.0001715
0.000430337
0.000161355
6.59748e-05
1.52215e-05
2.07974e-05
0.000252804
0.000480377
0.000455098
0.00020868
2.72388e-05
2.21516e-05
0.000177975
0.000411349
0.00015709
6.79388e-05
1.59254e-05
2.07922e-05
0.000245644
0.000461527
0.000420772
0.000194537
2.69232e-05
2.17739e-05
0.000160476
0.000363043
0.000139368
6.35769e-05
1.57447e-05
1.95983e-05
0.00020871
0.000414128
0.000395974
0.000191626
2.58896e-05
2.25828e-05
0.000137085
0.000315935
0.000295727
0.000128186
1.89399e-05
1.44167e-05
5.30406e-05
0.000114861
0.000349931
0.000176196
1.73388e-05
2.31339e-05
0.000152112
0.000315708
0.000271603
0.000125177
1.90163e-05
1.43838e-05
5.10374e-05
0.000106107
0.000311855
0.000158241
1.64956e-05
2.19762e-05
0.000134051
0.000275441
0.00024748
0.000117135
1.81721e-05
1.42664e-05
4.93528e-05
0.000100005
0.000300293
0.000153756
1.62468e-05
2.16734e-05
0.000133816
0.000270896
0.000235082
0.000112936
1.81914e-05
1.4363e-05
4.79148e-05
9.61653e-05
0.000272909
0.000142341
1.56951e-05
2.12399e-05
0.000123847
0.000245853
0.000222764
0.000109146
1.79912e-05
1.44777e-05
4.69893e-05
9.4345e-05
0.0002662
0.000139749
1.54222e-05
2.09897e-05
0.000124191
0.00024319
0.000211567
0.000103577
1.79593e-05
1.4391e-05
4.50953e-05
8.92034e-05
0.000237322
0.000126914
1.45136e-05
1.9036e-05
0.000118905
0.000229104
9.9114e-05
5.27244e-05
1.49948e-05
1.59948e-05
0.000144969
0.000267534
0.00024078
0.000126889
2.15357e-05
1.85235e-05
0.000107442
0.000207751
9.17424e-05
4.76636e-05
1.47975e-05
1.50782e-05
0.000129538
0.000235701
0.000213115
0.000114875
2.04232e-05
1.76882e-05
9.94582e-05
0.000188346
8.37597e-05
4.40876e-05
1.44267e-05
1.39229e-05
0.000111956
0.000196825
0.000187713
0.000104853
1.80029e-05
1.42873e-05
4.83074e-05
8.58027e-05
0.000208777
0.000118988
1.441e-05
1.94396e-05
0.000104309
0.000184041
0.000166187
9.29259e-05
1.6891e-05
1.40656e-05
4.26415e-05
7.8692e-05
0.000175623
0.000103663
1.35836e-05
1.78182e-05
9.99809e-05
0.000170974
8.24029e-05
4.74941e-05
1.43527e-05
1.41946e-05
0.000112254
0.000191661
0.000175753
0.000102842
1.9378e-05
1.7126e-05
9.14847e-05
0.000157566
7.69024e-05
4.32584e-05
1.41457e-05
1.3482e-05
0.000101038
0.000167593
0.000160674
9.64142e-05
1.77249e-05
1.42927e-05
4.73986e-05
7.95037e-05
0.000177007
0.000107456
1.39557e-05
1.91857e-05
9.80757e-05
0.000161889
0.000147767
8.56828e-05
1.70339e-05
1.42823e-05
4.44757e-05
7.36454e-05
0.00014697
9.4443e-05
1.34136e-05
1.78137e-05
8.85443e-05
0.000142319
7.46469e-05
4.80883e-05
1.4329e-05
1.35913e-05
9.83616e-05
0.000152092
0.000143564
9.16633e-05
1.86799e-05
1.65335e-05
7.87355e-05
0.000130188
6.66997e-05
4.31732e-05
1.37369e-05
1.27786e-05
8.65476e-05
0.000131081
0.000125868
8.14575e-05
1.71048e-05
1.38474e-05
4.59536e-05
6.81928e-05
0.000137161
9.2092e-05
1.29046e-05
1.72636e-05
8.56561e-05
0.000130595
7.15171e-05
4.84831e-05
1.40541e-05
1.32194e-05
9.37925e-05
0.000136717
0.000129892
8.58707e-05
1.77561e-05
1.44971e-05
5.01193e-05
7.26804e-05
0.000140861
9.50784e-05
1.35977e-05
1.86257e-05
8.83931e-05
0.000134993
0.000118687
7.74623e-05
1.65462e-05
1.38714e-05
4.53715e-05
6.49163e-05
0.000121732
8.328e-05
1.28643e-05
1.74119e-05
7.85644e-05
0.000113793
6.50965e-05
4.84113e-05
1.42548e-05
1.30727e-05
8.4369e-05
0.000119651
0.000112484
7.92186e-05
1.75283e-05
1.43455e-05
4.96535e-05
6.56332e-05
0.00012249
8.67308e-05
1.3262e-05
1.78291e-05
8.12639e-05
0.000114492
6.79146e-05
5.19392e-05
1.47274e-05
1.37938e-05
8.78579e-05
0.000124673
0.000122114
8.55884e-05
1.93407e-05
1.74065e-05
7.52696e-05
0.000108417
6.13762e-05
4.81012e-05
1.45063e-05
1.30798e-05
7.99885e-05
0.000113113
0.000106119
7.59905e-05
1.77739e-05
1.45472e-05
4.98278e-05
6.20769e-05
0.000114485
8.22813e-05
1.31592e-05
1.7891e-05
7.77206e-05
0.00010645
6.3448e-05
5.16625e-05
1.47329e-05
1.34512e-05
8.32305e-05
0.000113803
0.000105937
7.81839e-05
1.81984e-05
1.49026e-05
5.26805e-05
6.38294e-05
0.000115771
8.45017e-05
1.35378e-05
1.833e-05
7.98749e-05
0.000107629
6.52071e-05
5.42575e-05
1.5166e-05
1.37771e-05
8.53154e-05
0.000115378
0.000107169
8.03255e-05
1.86678e-05
1.55091e-05
5.57432e-05
6.58198e-05
0.000116079
8.49115e-05
1.4217e-05
1.99295e-05
8.31938e-05
0.000110263
9.98563e-05
7.46627e-05
1.79164e-05
1.49385e-05
5.07053e-05
5.92867e-05
0.000102008
7.5317e-05
1.33314e-05
1.83919e-05
7.22147e-05
9.58996e-05
5.9056e-05
5.21376e-05
1.51248e-05
1.33935e-05
7.57568e-05
0.000100378
9.41545e-05
7.24028e-05
1.83787e-05
1.51488e-05
5.29349e-05
5.89946e-05
0.00010071
7.64573e-05
1.34974e-05
1.84879e-05
7.28524e-05
9.41443e-05
5.94722e-05
5.39234e-05
1.52414e-05
1.35171e-05
7.66518e-05
0.000100193
9.41921e-05
7.33717e-05
1.85545e-05
1.54506e-05
5.48427e-05
6.00389e-05
0.00010146
7.77416e-05
1.37358e-05
1.88098e-05
7.42652e-05
9.51158e-05
6.08797e-05
5.60835e-05
1.56082e-05
1.39669e-05
7.83957e-05
0.000101844
9.59157e-05
7.51437e-05
1.91346e-05
1.59246e-05
5.72857e-05
6.18291e-05
0.000103655
7.99915e-05
1.41486e-05
1.92948e-05
7.65285e-05
9.73215e-05
6.29319e-05
5.84837e-05
1.61207e-05
1.43165e-05
8.05302e-05
0.000104084
9.81705e-05
7.73999e-05
1.96007e-05
1.64684e-05
5.98422e-05
6.38701e-05
0.000106442
8.24672e-05
1.46832e-05
2.00409e-05
7.91875e-05
0.000100247
6.59995e-05
6.20802e-05
1.69426e-05
1.53511e-05
8.44808e-05
0.000109687
0.000106483
8.53255e-05
2.15134e-05
1.95322e-05
7.76095e-05
9.57444e-05
6.18843e-05
5.77255e-05
1.64039e-05
1.45324e-05
7.75928e-05
0.0001012
9.61461e-05
7.48124e-05
2.01548e-05
1.67622e-05
5.88924e-05
6.21028e-05
0.000102391
7.93422e-05
1.47254e-05
2.01927e-05
7.63796e-05
9.6504e-05
6.33071e-05
6.01446e-05
1.67587e-05
1.47441e-05
8.0243e-05
0.000102579
9.64769e-05
7.72215e-05
2.02171e-05
1.6879e-05
6.11142e-05
6.38149e-05
0.000103922
8.1392e-05
1.49576e-05
2.04751e-05
7.84416e-05
9.79687e-05
6.516e-05
6.21442e-05
1.70602e-05
1.50055e-05
8.23268e-05
0.000104612
9.84991e-05
7.9262e-05
2.06224e-05
1.71915e-05
6.30523e-05
6.56857e-05
0.000105995
8.33371e-05
1.51537e-05
2.0845e-05
8.03417e-05
0.000100079
6.71443e-05
6.43935e-05
1.75066e-05
1.54682e-05
8.46412e-05
0.000106922
0.000100776
8.15513e-05
2.1161e-05
1.77187e-05
6.55852e-05
6.78656e-05
0.000108603
8.60891e-05
1.56862e-05
2.15259e-05
8.30324e-05
0.000102696
6.97216e-05
6.70479e-05
1.80275e-05
1.5843e-05
8.72764e-05
0.000109638
0.000103486
8.41796e-05
2.1687e-05
1.82251e-05
6.82021e-05
7.05423e-05
0.000111474
8.86414e-05
1.61161e-05
2.21844e-05
8.56931e-05
0.000105708
7.29596e-05
7.05696e-05
1.88596e-05
1.68433e-05
9.06733e-05
0.000114729
0.000110432
9.25037e-05
2.36753e-05
2.13628e-05
8.48797e-05
9.92678e-05
6.93357e-05
6.53424e-05
1.80066e-05
1.58677e-05
8.19228e-05
0.000102419
9.77475e-05
7.94725e-05
2.20885e-05
1.85484e-05
6.61752e-05
6.83855e-05
0.000101106
8.1898e-05
1.61038e-05
2.22115e-05
7.9444e-05
9.57465e-05
6.80364e-05
6.7195e-05
1.85023e-05
1.61135e-05
8.22279e-05
0.00010009
9.53893e-05
7.98321e-05
2.23018e-05
1.86431e-05
6.80545e-05
6.82508e-05
0.000101263
8.32185e-05
1.62423e-05
2.23708e-05
8.07784e-05
9.619e-05
6.91546e-05
6.93143e-05
1.87766e-05
1.64106e-05
8.43063e-05
0.000102514
9.77733e-05
8.2e-05
2.25487e-05
1.90744e-05
7.06514e-05
7.0259e-05
0.000105093
8.63471e-05
1.67406e-05
2.30953e-05
8.39402e-05
0.000100207
7.21977e-05
7.27537e-05
1.9428e-05
1.70948e-05
8.84608e-05
0.000107425
0.000102664
8.61915e-05
2.3522e-05
2.01152e-05
7.54803e-05
7.43345e-05
0.000113183
9.19161e-05
1.79354e-05
2.52193e-05
9.50358e-05
0.000109176
9.94864e-05
8.85934e-05
2.29192e-05
1.94753e-05
7.18237e-05
7.35418e-05
0.000105031
8.63555e-05
1.70896e-05
2.40809e-05
8.42158e-05
0.000101006
7.31613e-05
7.40549e-05
2.03528e-05
1.75691e-05
8.84407e-05
0.000106401
0.000101536
8.60563e-05
2.42523e-05
2.03909e-05
7.57979e-05
7.42172e-05
0.000108736
9.06357e-05
1.77075e-05
2.4354e-05
8.81527e-05
0.000104146
7.64594e-05
7.7647e-05
2.05928e-05
1.79574e-05
9.26823e-05
0.000111112
0.000106011
9.03715e-05
2.45541e-05
2.09512e-05
8.0073e-05
7.84077e-05
0.000114282
9.4648e-05
1.86865e-05
2.63148e-05
9.80392e-05
0.000108807
0.000100896
9.19848e-05
2.40846e-05
2.07127e-05
7.59517e-05
7.73346e-05
0.000106854
8.9464e-05
1.81297e-05
2.53419e-05
8.72512e-05
0.000102602
7.63761e-05
7.82644e-05
2.13091e-05
1.84595e-05
9.10772e-05
0.000108172
0.000103841
8.90467e-05
2.54981e-05
2.17601e-05
8.12103e-05
7.80048e-05
0.000113394
9.46196e-05
1.91702e-05
2.72591e-05
9.88609e-05
0.000108602
0.000100087
9.32772e-05
2.49622e-05
2.14345e-05
7.88661e-05
7.84266e-05
0.000107597
9.08734e-05
1.87276e-05
2.61996e-05
8.89665e-05
0.000103635
7.8397e-05
8.13825e-05
2.212e-05
1.9081e-05
9.37759e-05
0.000110159
0.000105172
9.16623e-05
2.62992e-05
2.21037e-05
8.38202e-05
8.02803e-05
0.000113723
9.58687e-05
1.93341e-05
2.77114e-05
0.000100279
0.000107944
0.000100857
9.46967e-05
2.54949e-05
2.20824e-05
8.05826e-05
8.02363e-05
0.000108281
9.21904e-05
1.92193e-05
2.69505e-05
9.02003e-05
0.000104126
8.00875e-05
8.35681e-05
2.2737e-05
1.95972e-05
9.47764e-05
0.00011063
0.000106288
9.28896e-05
2.71677e-05
2.33108e-05
8.74964e-05
8.2216e-05
0.000117293
9.94146e-05
2.03511e-05
2.88689e-05
0.000104244
0.000112582
0.000104291
9.94838e-05
2.67937e-05
2.3209e-05
8.71066e-05
8.44704e-05
0.00011397
9.77249e-05
2.03639e-05
2.8448e-05
9.62283e-05
0.000110087
8.63582e-05
9.14005e-05
2.43841e-05
2.13501e-05
0.000102605
0.000119822
0.000115322
0.000108234
3.01236e-05
2.71928e-05
0.000102783
0.000106443
8.65689e-05
8.88308e-05
2.33785e-05
2.04937e-05
9.88993e-05
0.000115619
0.000112173
9.72125e-05
2.90618e-05
2.52495e-05
9.32791e-05
8.88561e-05
0.000120462
0.000103982
2.20391e-05
3.12304e-05
0.00010968
0.000115886
0.000107824
0.000105339
2.8748e-05
2.47943e-05
9.39237e-05
9.01806e-05
0.000118008
0.000102666
2.16777e-05
3.10728e-05
0.000108409
0.000112895
0.000107078
0.000102538
2.83442e-05
2.50361e-05
9.10848e-05
8.92202e-05
0.000115118
9.95441e-05
2.19234e-05
3.08181e-05
9.84745e-05
0.000111402
9.03766e-05
9.74784e-05
2.63863e-05
2.3037e-05
0.000106286
0.000121762
0.000117241
0.000112163
3.26296e-05
3.02906e-05
0.00010835
0.000109915
9.3068e-05
9.97231e-05
2.63219e-05
2.27817e-05
0.000108494
0.000124911
0.000120713
0.000114595
3.28155e-05
3.07867e-05
0.000110394
0.000113227
9.59932e-05
0.000101316
2.70817e-05
2.39801e-05
0.000109709
0.000125725
0.000121589
0.000115812
3.43707e-05
3.20224e-05
0.000111317
0.00011518
9.86534e-05
0.000103381
2.78585e-05
2.39688e-05
0.000110853
0.000126059
0.000122338
0.000117271
3.41482e-05
3.18846e-05
0.000112882
0.000115287
9.92732e-05
0.000105061
2.83204e-05
2.50405e-05
0.000112168
0.000127352
0.000122082
0.000112656
3.61251e-05
3.48584e-05
0.000121406
0.000116122
0.000113162
0.000114853
3.28654e-05
2.8991e-05
0.000103174
0.000100695
0.00012267
0.000108506
2.47033e-05
3.62217e-05
0.000115409
0.00011887
0.000113125
0.000111295
3.41621e-05
3.00623e-05
0.000107279
9.96289e-05
0.000126467
0.0001126
2.61747e-05
3.783e-05
0.000112209
0.000121562
0.00011605
0.000119967
3.72265e-05
3.4032e-05
0.000114397
0.000112687
0.000100612
0.000108754
3.08655e-05
2.7276e-05
0.000114041
0.000129214
0.000125396
0.000113088
4.02825e-05
3.87847e-05
0.000125734
0.000119482
0.000115452
0.000120018
3.6304e-05
3.16473e-05
0.000112334
0.000104802
0.000130826
0.000116165
2.64278e-05
3.94074e-05
0.000118553
0.000125935
0.000122184
0.000122994
3.95042e-05
4.00467e-05
0.00012214
0.000118265
0.000116621
0.000116376
3.89905e-05
3.45192e-05
0.000113851
0.000105697
0.000131594
0.000116534
2.84439e-05
4.27445e-05
0.000120016
0.000129095
0.000124783
0.000120875
4.3787e-05
4.47273e-05
0.000125479
0.000121003
0.000119617
0.00012186
4.47301e-05
4.39085e-05
0.000124313
0.000116449
0.000114159
0.000118144
4.2249e-05
3.79719e-05
0.000117996
0.00010678
0.00013069
0.000118461
3.10248e-05
4.35224e-05
0.000117125
0.000127365
0.00012217
0.000125995
4.38504e-05
4.61683e-05
0.000124284
0.000120797
0.000119479
0.000123902
4.78239e-05
4.91282e-05
0.000120924
0.000119101
0.000117366
0.000122527
5.11634e-05
5.1793e-05
0.00011926
0.000117176
0.000116407
0.000125724
5.25166e-05
5.31832e-05
0.000127532
0.000116623
0.000117621
0.000135178
5.26029e-05
5.1331e-05
0.000140156
0.000118342
0.000121606
0.000150312
4.9934e-05
4.83663e-05
0.000154623
0.000122804
0.000128045
0.000163087
4.69973e-05
4.55977e-05
0.000162002
0.000129733
0.000136519
0.000170389
4.44359e-05
4.32742e-05
0.000170126
0.00013886
0.000146978
0.000177454
4.23197e-05
4.14153e-05
0.000179615
0.000149828
0.000159999
0.000184748
4.06513e-05
3.99643e-05
0.000188301
0.000163689
0.000176197
0.000191968
3.93693e-05
3.88566e-05
0.000195718
0.00018029
0.000194269
0.000199442
3.83994e-05
3.80356e-05
0.00020307
0.000199046
0.000213671
0.000206904
3.76777e-05
3.74564e-05
0.000210663
0.000219283
0.00023469
0.000214684
3.71671e-05
3.70768e-05
0.000218499
0.000240045
0.000257068
0.000222468
3.68467e-05
3.68522e-05
0.000226262
0.000258177
0.000275294
0.000230315
3.66815e-05
3.67339e-05
0.000233993
0.000276423
0.000293101
0.000237921
3.6631e-05
3.6706e-05
0.000241511
0.000294136
0.000310449
0.000245453
3.66623e-05
3.67476e-05
0.000248812
0.000311271
0.000326891
0.000252563
3.6748e-05
3.68327e-05
0.000255727
0.000327521
0.000342541
0.000259432
3.68564e-05
3.69395e-05
0.000262293
0.000342831
0.00035706
0.000265759
3.69814e-05
3.70617e-05
0.000268396
0.00035712
0.000370529
0.00027174
3.71017e-05
3.7193e-05
0.000274098
0.000370289
0.000382835
0.000277074
3.72301e-05
3.73252e-05
0.000279235
0.000382519
0.000394424
0.000282027
3.73531e-05
3.74457e-05
0.000283862
0.000393804
0.00040497
0.000286413
3.74686e-05
3.75574e-05
0.000288033
0.000404307
0.000414934
0.000290447
3.75724e-05
3.76569e-05
0.000291766
0.000413986
0.000424024
0.00029395
3.76683e-05
3.77482e-05
0.000295095
0.000423073
0.000432674
0.000297155
3.77531e-05
3.78277e-05
0.000298033
0.000431457
0.0004406
0.000299889
3.78303e-05
3.79001e-05
0.000300637
0.00043942
0.000448234
0.000302395
3.78977e-05
3.79623e-05
0.000302913
0.000446797
0.000455224
0.000304491
3.7958e-05
3.80183e-05
0.000304931
0.000453854
0.000462069
0.000306446
3.80106e-05
3.80673e-05
0.00030669
0.000460456
0.000468329
0.000308047
3.80585e-05
3.81117e-05
0.000308185
0.000466657
0.000474514
0.000309526
3.80996e-05
3.8151e-05
0.000309594
0.000472731
0.000480235
0.000310798
3.81386e-05
3.81881e-05
0.000310874
0.000478623
0.000486025
0.000312054
3.81734e-05
3.82212e-05
0.000311992
0.000484165
0.000491328
0.000313041
3.82067e-05
3.82521e-05
0.000312987
0.00048958
0.000496695
0.000314029
3.8236e-05
3.82795e-05
0.000313858
0.0004947
0.000501686
0.000314787
3.82639e-05
3.83054e-05
0.00031465
0.000499765
0.000505647
0.000315592
3.8289e-05
3.83293e-05
0.000315348
0.00050442
0.000508931
0.00031619
3.83142e-05
3.83531e-05
0.000315982
0.000508913
0.000511893
0.000316839
3.83376e-05
3.83753e-05
0.000316524
0.000512947
0.000514629
0.000317283
3.83611e-05
3.83971e-05
0.000317007
0.00051682
0.000517029
0.000317779
3.83826e-05
3.84168e-05
0.000317396
0.000520235
0.000519229
0.000318073
3.84034e-05
3.84354e-05
0.00031773
0.000523546
0.000521166
0.000318426
3.84218e-05
3.84516e-05
0.000317984
0.000525586
0.000522908
0.000318586
3.84391e-05
3.84666e-05
0.000318191
0.000527401
0.000524428
0.00031881
3.84537e-05
3.84788e-05
0.000318314
0.000528712
0.000525732
0.000318839
3.84668e-05
3.84893e-05
0.000318392
0.000530149
0.000526886
0.00031894
3.8477e-05
3.8497e-05
0.000318396
0.000531102
0.000527863
0.000318857
3.84857e-05
3.85032e-05
0.000318369
0.000532231
0.000528737
0.000318861
3.84916e-05
3.8507e-05
0.000318284
0.000532918
0.000529476
0.000318697
3.84964e-05
3.85097e-05
0.000318184
0.000533826
0.000530149
0.000318634
3.84989e-05
3.85106e-05
0.000318038
0.000534319
0.000530714
0.000318417
3.85007e-05
3.85108e-05
0.00031789
0.000535059
0.000531233
0.000318313
3.85008e-05
3.85097e-05
0.000317708
0.000535402
0.000531664
0.000318064
3.85007e-05
3.85085e-05
0.000317534
0.000536017
0.000532071
0.000317939
3.84994e-05
3.85063e-05
0.000317335
0.000536251
0.000532408
0.000317677
3.84982e-05
3.85042e-05
0.000317152
0.000536779
0.000532736
0.000317546
3.8496e-05
3.85013e-05
0.000316948
0.000536935
0.000533002
0.000317282
3.84941e-05
3.84987e-05
0.000316764
0.000537389
0.000533259
0.000317152
3.84914e-05
3.84954e-05
0.000316562
0.00053747
0.000533454
0.000316891
3.8489e-05
3.84925e-05
0.000316382
0.000537855
0.000533649
0.000316766
3.8486e-05
3.8489e-05
0.000316186
0.000537875
0.000533793
0.000316512
3.84835e-05
3.84861e-05
0.000316014
0.000538212
0.000533945
0.000316396
3.84803e-05
3.84826e-05
0.000315827
0.000538187
0.000534049
0.000316153
3.84777e-05
3.84798e-05
0.000315665
0.000538485
0.000534165
0.000316046
3.84746e-05
3.84763e-05
0.000315487
0.000538424
0.000534238
0.000315812
3.84718e-05
3.84735e-05
0.000315334
0.000538693
0.000534328
0.000315715
3.84685e-05
3.84699e-05
0.000315165
0.000538604
0.000534376
0.000315489
3.84655e-05
3.84669e-05
0.00031502
0.000538846
0.000534439
0.0003154
3.8462e-05
3.8463e-05
0.000314858
0.000538728
0.000534462
0.000315183
3.84589e-05
3.84599e-05
0.000314721
0.000538947
0.000534507
0.000315103
3.84553e-05
3.8456e-05
0.000314569
0.000538813
0.00053452
0.000314895
3.84521e-05
3.84529e-05
0.000314443
0.000539025
0.00053456
0.000314825
3.84486e-05
3.8449e-05
0.0003143
0.000538885
0.000534566
0.000314627
3.84453e-05
3.84459e-05
0.000314183
0.000539085
0.000534592
0.000314566
3.84418e-05
3.84421e-05
0.00031405
0.000538927
0.000534581
0.000314378
3.84386e-05
3.84391e-05
0.000313942
0.000539111
0.000534595
0.000314328
3.84352e-05
3.84355e-05
0.000313819
0.000538946
0.000534585
0.000314151
3.84323e-05
3.84327e-05
0.000313723
0.000539136
0.00053461
0.000314111
3.84291e-05
3.84293e-05
0.000313611
0.00053898
0.000534606
0.000313944
3.84264e-05
3.84267e-05
0.000313523
0.000539171
0.000534625
0.000313912
3.84234e-05
3.84235e-05
0.000313418
0.000539004
0.000534609
0.000313753
3.84209e-05
3.84212e-05
0.000313338
0.000539184
0.000534623
0.000313729
3.84181e-05
3.84183e-05
0.000313241
0.000539017
0.000534612
0.000313577
3.84159e-05
3.84162e-05
0.000313168
0.000539204
0.000534632
0.000313561
3.84135e-05
3.84136e-05
0.000313078
0.000539037
0.000534618
0.000313416
3.84116e-05
3.8412e-05
0.000313012
0.000539218
0.000534634
0.000313406
3.84096e-05
3.84098e-05
0.000312929
0.000539051
0.000534626
0.000313267
3.84081e-05
3.84084e-05
0.000312868
0.000539243
0.000534653
0.000313262
3.84062e-05
3.84063e-05
0.000312788
0.000539082
0.000534642
0.000313127
3.84047e-05
3.8405e-05
0.000312731
0.000539261
0.000534648
0.000313126
3.84031e-05
3.84032e-05
0.000312658
0.000539075
0.000534621
0.000313
3.84021e-05
3.84025e-05
0.000312613
0.000539252
0.000534645
0.000313013
3.84011e-05
3.84013e-05
0.000312554
0.000539105
0.00053467
0.000312901
3.84007e-05
3.84017e-05
0.000312523
0.000539339
0.000534745
0.000312927
3.84003e-05
3.84021e-05
0.000312477
0.000539229
0.000534788
0.000312829
3.84008e-05
3.84038e-05
0.000312462
0.000539465
0.00053486
0.000312872
3.84013e-05
3.8406e-05
0.000312431
0.000539272
0.000535001
0.000312794
3.84032e-05
3.84351e-05
0.000312678
0.000539592
0.000535128
0.000313088
3.8449e-05
3.84706e-05
0.000312967
0.000540584
0.000535325
0.000314003
3.86376e-05
3.88316e-05
0.000314779
0.000544056
0.000553514
0.000319404
3.96891e-05
4.08011e-05
0.000325086
0.000563195
0.000612659
0.000342472
4.39893e-05
4.68455e-05
0.000364068
0.000639259
0.000685587
0.000391022
5.02205e-05
0.00104804
0.00167837
0.00255214
0.00460453
0.00843068
0.0105862
0.0158192
0.0286363
0.0381868
0.051967
0.0693167
0.0912907
0.118969
0.153224
0.194815
0.244139
0.301293
0.365956
0.437421
0.51453
0.59591
0.679591
0.763898
0.845427
0.922196
0.988762
1.04326
1.08227
1.1065
1.1179
1.12485
1.13767
1.15618
1.17989
1.20794
1.23984
1.27487
1.31304
1.3544
1.39929
1.44815
1.50158
1.5603
1.62524
1.69756
1.77879
1.87096
1.97684
2.1004
2.24757
1.97098
1.32906
0.962254
0.783788
0.691302
0.632456
0.582992
0.535003
0.488003
0.443306
0.401619
0.363009
0.327298
0.294352
0.264154
0.236724
0.212027
0.189948
0.170304
0.152877
0.137444
0.123796
0.111738
0.101099
0.091725
0.0834768
0.0762306
0.0698745
0.0643076
0.0594392
0.0551886
0.0514829
0.0482577
0.0454558
0.0430268
0.0409262
0.039115
0.0375593
0.0362292
0.0350989
0.0341461
0.0333512
0.0326974
0.0321703
0.0317572
0.0314473
0.0312312
0.0311009
0.0310495
0.0310708
0.0311596
0.0313116
0.0315228
0.0317899
0.03211
0.0324806
0.0328997
0.0333655
0.0338763
0.0344311
0.0350289
0.035669
0.0363507
0.0370735
0.0378373
0.0386419
0.0394873
0.0403735
0.0413007
0.0422692
0.0432793
0.0443314
0.0454262
0.0465643
0.0477465
0.0489738
0.0502472
0.0515681
0.0529376
0.0543575
0.0558295
0.0573553
0.0589369
0.0605768
0.0622773
0.0640414
0.0658721
0.0677732
0.0697484
0.0718019
0.073939
0.0761649
0.0784853
0.0809062
0.0834349
0.0860781
0.0888433
0.091739
0.0947732
0.0979548
0.101293
0.104799
0.108481
0.112353
0.116425
0.120711
0.125226
0.129987
0.135012
0.140324
0.145945
0.151905
0.158234
0.164972
0.172157
0.179838
0.188068
0.196908
0.206427
0.216706
0.227837
0.239928
0.253111
0.267539
0.283404
0.300938
0.320433
0.342258
0.366883
0.394922
0.427202
0.464871
0.509614
0.564057
0.632526
0.722442
0.846834
1.0292
1.31309
1.77619
2.52871
3.64497
5.2141
8.54623
20.5554
80.9612
293.357
313.246
337.098
239.027
100.685
32.728
8.36725
2.91176
1.44915
0.923057
0.7054
0.608029
0.557928
0.5243
0.494894
0.46611
0.437982
0.411502
0.387453
0.366151
0.347539
0.331352
0.317266
0.304969
0.294197
0.284738
0.276424
0.269126
0.26274
0.25718
0.252379
0.248284
0.244854
0.242057
0.239874
0.238295
0.237324
0.236991
0.237306
0.2383
0.240047
0.242626
0.246144
0.25073
0.256528
0.26365
0.272112
0.281721
0.29198
0.302157
0.311847
0.322586
0.341041
0.384733
0.494579
0.770978
1.45967
2.89898
4.36386
3.10024
1.60945
0.587107
0.125577
0.0511118
0.0159614
0.0131862
0.0117566
0.0103983
0.00973748
0.00887485
0.00849032
0.00788676
0.00763464
0.00718268
0.00700019
0.00664759
0.00650853
0.00622249
0.00611286
0.00587346
0.00578466
0.00557927
0.00550596
0.00532636
0.00526476
0.00510559
0.0050524
0.00491007
0.00486354
0.0047348
0.00469362
0.00457604
0.00453923
0.00443095
0.00439778
0.00429736
0.00426728
0.00417368
0.00414627
0.0040586
0.00403347
0.00395096
0.00392778
0.00384975
0.00382819
0.00375406
0.00373387
0.00366318
0.00364411
0.00357639
0.00355827
0.00349316
0.00347585
0.003413
0.00339636
0.00333545
0.00331935
0.00326006
0.00324437
0.00318639
0.00317097
0.00311403
0.00309878
0.00304272
0.00302747
0.00297204
0.00295671
0.00290175
0.00288626
0.00283163
0.00281591
0.00276146
0.00274544
0.00269107
0.0026747
0.0026203
0.00260354
0.00254906
0.0025319
0.00247733
0.0024598
0.00240521
0.00238739
0.00233295
0.00231497
0.0022609
0.00224312
0.00219005
0.00217273
0.00212114
0.00210464
0.00205556
0.00204014
0.00199467
0.0019806
0.00193956
0.00192804
0.00188996
0.00188353
0.00184907
0.00184856
0.00181818
0.00182436
0.00179853
0.00181176
0.00179078
0.00181071
0.00179443
0.00182023
0.00180821
0.00183875
0.00183018
0.00186347
0.00185691
0.00189142
0.00188589
0.00192076
0.00191554
0.00194997
0.00194458
0.00197795
0.00197221
0.00200411
0.00199796
0.00202813
0.00202158
0.0020499
0.00204298
0.00206936
0.00206208
0.00208653
0.00207896
0.00210148
0.0020936
0.00211425
0.00210607
0.00212499
0.00211642
0.00213375
0.00212479
0.00214067
0.00213124
0.00214578
0.00213578
0.00214904
0.00213835
0.00215032
0.0021388
0.00214944
0.00213699
0.00214635
0.00213289
0.00214112
0.00212663
0.00213385
0.00211834
0.00212457
0.00210847
0.00211383
0.00209708
0.00210108
0.00207861
0.00209494
0.00208046
0.00211192
0.00213187
0.00214314
0.00215651
0.00430992
0.00679064
0.00673848
0.00426115
0.0042477
0.00667195
0.00645478
0.00417105
0.00404819
0.00606152
0.0102984
0.00958141
0.00949228
0.0094352
0.0115881
0.0115286
0.0113975
0.014281
0.0141407
0.0140234
0.0159571
0.0160276
0.0160259
0.0154058
0.0153048
0.0102533
0.00654987
0.00414154
0.0040582
0.00607249
0.00655709
0.00414934
0.00407951
0.00610537
0.010309
0.010372
0.00658703
0.00416918
0.00409725
0.00613371
0.00661521
0.00418523
0.00411317
0.00615728
0.0104388
0.0104925
0.00663949
0.00419893
0.00412433
0.00617441
0.00665695
0.00420801
0.00413075
0.00618388
0.0105405
0.0105725
0.00666596
0.00421221
0.00413214
0.00618599
0.00666687
0.00421134
0.00412827
0.00618019
0.0105943
0.010603
0.00665936
0.00420529
0.00411917
0.00616667
0.00664371
0.0041941
0.004105
0.00614557
0.0105999
0.010584
0.00662001
0.00417803
0.00408603
0.00611724
0.00658855
0.00415731
0.00406239
0.00608173
0.0105559
0.0105153
0.00654926
0.00413206
0.00403416
0.00603914
0.00650225
0.00410232
0.0040014
0.00598966
0.0104623
0.0103975
0.00644791
0.00406826
0.00396438
0.00593406
0.00638726
0.00403018
0.00392345
0.00587334
0.0103223
0.0102389
0.00632129
0.00398839
0.00387898
0.00580835
0.00625108
0.00394331
0.00383156
0.00574028
0.0101495
0.0100575
0.00617824
0.00389551
0.00378181
0.00567073
0.00610477
0.00384571
0.00373067
0.0056016
0.00996754
0.00988269
0.00603287
0.00379493
0.00367922
0.00553516
0.00596519
0.00374448
0.00362893
0.00547494
0.00980479
0.00974587
0.00590589
0.00369571
0.00358123
0.00542414
0.00585876
0.00365026
0.00353791
0.00538502
0.00971096
0.00970818
0.00582887
0.00361058
0.00350167
0.00535986
0.0058204
0.00357978
0.00347597
0.00535525
0.00974537
0.00982984
0.0058369
0.00356099
0.00346427
0.00537554
0.00588286
0.00355746
0.00346996
0.00542485
0.00996883
0.0101669
0.00596189
0.0035721
0.0034954
0.00550641
0.00607642
0.00360688
0.00354212
0.00562144
0.0104312
0.0107352
0.00622626
0.00366269
0.00361449
0.00577101
0.00640932
0.00374772
0.00370892
0.00594942
0.0110935
0.0115177
0.00661752
0.00385359
0.00381956
0.00615461
0.00685334
0.00397541
0.00394325
0.00638224
0.012008
0.0125368
0.00711207
0.00411124
0.00407981
0.00662736
0.00738874
0.00425832
0.00422663
0.00688422
0.0130955
0.0136788
0.00767869
0.00441396
0.00438132
0.00715147
0.00797611
0.00457543
0.00454117
0.00742562
0.0142819
0.0149005
0.00827808
0.00474064
0.0047043
0.00770392
0.00858205
0.00490834
0.00486969
0.00798446
0.0155318
0.0161728
0.00888725
0.00507718
0.00503539
0.00826643
0.00919306
0.00524561
0.00520064
0.00854672
0.0168211
0.0174769
0.0094999
0.00541347
0.00536509
0.00882635
0.00980646
0.00558034
0.0055286
0.00910552
0.0181402
0.0188121
0.0101129
0.00574633
0.0056913
0.00938466
0.0104199
0.00591168
0.00585344
0.00966447
0.0194941
0.0201894
0.0107282
0.0060767
0.00601534
0.00994531
0.0110386
0.0062418
0.00617742
0.0102275
0.0209044
0.0216339
0.0113515
0.0064075
0.00634026
0.0105125
0.0116679
0.00657444
0.0065045
0.0108016
0.0223801
0.0231468
0.0119891
0.0067432
0.00667081
0.0110961
0.0123171
0.00691469
0.00683995
0.0113975
0.0239406
0.0247642
0.0126531
0.00708983
0.00701289
0.0117075
0.0129992
0.00726953
0.00719072
0.0120281
0.0256223
0.0265189
0.0133578
0.00745514
0.00737474
0.0123618
0.0137318
0.00764808
0.00756638
0.0127121
0.0274589
0.0284464
0.014125
0.00784991
0.0077672
0.0130837
0.0145433
0.00806221
0.00797876
0.0134826
0.0294854
0.0305799
0.0149938
0.00828651
0.00820269
0.0139087
0.0154755
0.00852433
0.00844047
0.0143663
0.0317667
0.0330664
0.0159945
0.00877782
0.00869429
0.0148598
0.0165555
0.00904945
0.00896687
0.0153951
0.0344888
0.0360561
0.0171663
0.00934273
0.00926148
0.0159793
0.0178361
0.00966124
0.00958218
0.0166224
0.0377988
0.039754
0.0185765
0.0100097
0.00993373
0.017337
0.0194037
0.0103933
0.0103211
0.0181355
0.0419703
0.0445157
0.0203318
0.010818
0.0107508
0.0190343
0.0213813
0.0112925
0.011232
0.0200549
0.0474754
0.0509489
0.0225781
0.0118279
0.0117767
0.0212244
0.0239559
0.0124397
0.012402
0.022588
0.0550351
0.0599674
0.0255735
0.0131494
0.0131307
0.0241965
0.0275139
0.0139868
0.0139952
0.0261329
0.0660916
0.0738891
0.029889
0.0149945
0.0150423
0.0285332
0.0328748
0.0162367
0.016353
0.0315992
0.0841481
0.0982179
0.0367549
0.0178216
0.0180599
0.0356658
0.0420039
0.0199297
0.0203738
0.0413134
0.118604
0.150435
0.0495312
0.0229113
0.0237317
0.0496983
0.0609939
0.0273222
0.0291437
0.0638575
0.20567
0.315217
0.0809521
0.0347673
0.0395591
0.091728
0.854233
0.526422
0.366958
0.278813
0.224465
0.188084
0.162185
0.142869
0.127933
0.116048
0.106346
0.0982431
0.0913725
0.0854713
0.0803453
0.0758382
0.0718339
0.0682439
0.0650006
0.0620494
0.0593498
0.0568741
0.0545655
0.0523934
0.0503411
0.0483956
0.0465463
0.0447839
0.0430967
0.0414862
0.0398871
0.0383145
0.0367776
0.0352824
0.0338299
0.0324191
0.0310485
0.0297168
0.0284232
0.0271675
0.0259517
0.0247786
0.0236538
0.0225841
0.0215811
0.020655
0.0198348
0.0191217
0.018488
0.0179482
0.0175232
0.0171918
0.0169326
0.0167768
0.0166959
0.0166754
0.0166995
0.0167535
0.0168221
0.016893
0.0169561
0.0170048
0.017035
0.0170447
0.0170329
0.0170001
0.016947
0.0168756
0.0167876
0.0166854
0.0165698
0.0164437
0.0163056
0.0161619
0.0160034
0.0158497
0.015666
0.015533
0.0193074
0.0189683
0.0188193
0.017928
0.0177766
0.0176401
0.0188634
0.0189843
0.0190646
0.0200288
0.0198681
0.0197144
0.0201161
0.0202766
0.0204424
0.020614
0.0209097
0.0209303
0.0206039
0.0203886
0.02023
0.0200677
0.01959
0.019769
0.0199649
0.0188891
0.0187667
0.0186305
0.0173403
0.0175049
0.0176985
0.0187003
0.0189581
0.0194269
0.0214114
0.021341
0.0217267
0.0195778
0.0198839
0.020177
0.0225601
0.022143
0.022338
0.0218557
0.0198513
0.0203311
0.020816
0.0228287
0.0233486
0.0229954
0.0204788
0.0207776
0.0234412
0.0239016
0.0210791
0.021379
0.0243759
0.0250614
0.0244638
0.0238944
0.0218926
0.0213391
0.0170505
0.0166091
0.0162119
0.0158041
0.0154814
0.015077
0.0150447
0.0156521
0.0156198
0.0155576
0.0135979
0.0136589
0.0137977
0.0106383
0.0108846
0.0110804
0.00906902
0.00893847
0.00895426
0.0096372
0.0095896
0.00550064
0.00496169
0.00536475
0.00560396
0.00596557
0.00593727
0.00308358
0.0029757
0.00261191
0.00107034
0.000509075
0.000606464
0.00139842
0.00123274
0.000597298
0.000668903
0.00148931
0.00282873
0.00280529
0.00143673
0.00123953
0.000608791
0.000639607
0.000599767
0.00122297
0.00143365
0.0027215
0.00265761
0.00275698
0.00271477
0.00505595
0.0056322
0.00986061
0.0100612
0.0103361
0.010595
0.0060483
0.00543132
0.00590272
0.00529966
0.00576075
0.00517342
0.0027907
0.00282538
0.00150424
0.00127421
0.00147914
0.00125136
0.00146439
0.00124251
0.00144148
0.00122488
0.000603284
0.000637325
0.000641573
0.000609701
0.000650973
0.000617504
0.000660087
0.000625561
0.000668408
0.00063313
0.00128682
0.00151739
0.00130976
0.000643363
0.000677057
0.000687215
0.00154602
0.00290343
0.00287005
0.00155995
0.00132307
0.000650948
0.000696312
0.000661387
0.0013469
0.00158963
0.00298683
0.00295278
0.00307415
0.00304001
0.00557084
0.00620397
0.0108895
0.0111931
0.0175105
0.0180083
0.0224774
0.0230987
0.0237651
0.0256941
0.0248649
0.0216776
0.0219723
0.0253697
0.0258853
0.0222608
0.0225401
0.0264097
0.0277989
0.0270604
0.0263591
0.0244765
0.0252422
0.0260651
0.0211382
0.0204071
0.0197324
0.0191187
0.0185442
0.0118777
0.0115249
0.0065434
0.00587462
0.00636834
0.00571802
0.0031319
0.00316633
0.00168375
0.0014268
0.0016511
0.00140062
0.00163548
0.00138578
0.00160429
0.00136078
0.000669362
0.000706748
0.000716476
0.000680613
0.000727695
0.000689137
0.00073799
0.000701001
0.000749889
0.000710171
0.00144252
0.00170025
0.00146989
0.000722677
0.000760883
0.00077328
0.00173429
0.00326349
0.00322898
0.00175157
0.00148631
0.000732049
0.000784473
0.000745033
0.00151491
0.00178767
0.00336649
0.00333241
0.00604093
0.00672945
0.00621843
0.00344239
0.00347615
0.00184511
0.00156391
0.00180697
0.00153309
0.000755777
0.00079782
0.000810667
0.000770252
0.000825098
0.000781382
0.00158306
0.00186517
0.00161508
0.000796172
0.00083815
0.000853248
0.00190544
0.00359307
0.0069289
0.0122604
0.0126748
0.0131282
0.0136251
0.00763341
0.00684083
0.00737825
0.00661606
0.00714439
0.0064093
0.00356029
0.00371898
0.00368763
0.00199345
0.00169284
0.00197061
0.0016704
0.00192767
0.00163596
0.000808225
0.000867573
0.000824351
0.000883857
0.000837184
0.000898867
0.000854089
0.00172919
0.00203973
0.00385538
0.00382641
0.00400445
0.00397855
0.00708749
0.00791544
0.0141752
0.0219403
0.0269548
0.0285775
0.0269464
0.0228072
0.0230569
0.0274877
0.0280317
0.0232849
0.0234869
0.0285704
0.031154
0.0302549
0.0293957
0.0279191
0.0289686
0.0301135
0.031365
0.0320898
0.0290961
0.0236582
0.0237949
0.0295993
0.0300692
0.023896
0.0239634
0.0304887
0.0350297
0.0340412
0.0330557
0.032729
0.0342136
0.0358138
0.0375242
0.0360035
0.030862
0.0240055
0.0240327
0.0311781
0.0314385
0.0240641
0.0241224
0.0316672
0.0385409
0.0377922
0.0369346
0.0393197
0.0411594
0.0429625
0.044584
0.0391688
0.0318894
0.0242347
0.0244486
0.0321638
0.0324932
0.0247709
0.02517
0.0329672
0.0407175
0.0401892
0.0397009
0.0459754
0.0471348
0.0360856
0.0274149
0.037451
0.0484114
0.0451479
0.0419269
0.0387504
0.0358861
0.0333624
0.0311569
0.0292576
0.0275998
0.0261591
0.0249055
0.0238029
0.0228218
0.0147742
0.0154386
0.0161936
0.0090237
0.00803785
0.00860074
0.00767752
0.00823304
0.00736261
0.00414756
0.00416847
0.00219622
0.00186273
0.00214229
0.00182064
0.00211497
0.00179347
0.00206492
0.00175398
0.000867935
0.000916144
0.000932558
0.000886444
0.000951494
0.000901544
0.000968975
0.000921018
0.000989087
0.000937443
0.00189294
0.00222715
0.00193908
0.000958814
0.00100837
0.0010302
0.00228615
0.00435166
0.00433819
0.00232104
0.00197285
0.000976341
0.00105078
0.000999291
0.00202357
0.00238663
0.00455807
0.00455411
0.00479335
0.00480395
0.00845533
0.00951308
0.0170603
0.018131
0.0194399
0.020991
0.0116669
0.0103229
0.0108009
0.00957403
0.0100903
0.0089569
0.00509614
0.00506932
0.00264295
0.00223656
0.00255331
0.00216756
0.00250229
0.00212016
0.00242759
0.00206277
0.00101905
0.00107483
0.00109817
0.00104489
0.00112592
0.00106866
0.00115508
0.00110192
0.00119373
0.001134
0.00229694
0.0027065
0.00237737
0.00117747
0.0012384
0.00128064
0.00280679
0.00539081
0.00544098
0.00287776
0.00244666
0.00121699
0.00132813
0.00126195
0.00253626
0.00298318
0.00577183
0.00585118
0.00623063
0.00636856
0.0112642
0.0127544
0.0229171
0.025313
0.0283893
0.0324435
0.0193786
0.0163638
0.0160854
0.013974
0.0141422
0.0124317
0.00703445
0.00681026
0.00340413
0.00291751
0.00327534
0.00280588
0.00318465
0.0027188
0.00306851
0.00261721
0.00131139
0.00137433
0.00142138
0.00136447
0.00147796
0.00141473
0.00153096
0.00147597
0.00158714
0.00152774
0.00301738
0.00351352
0.00314333
0.0015772
0.0016356
0.00168595
0.00366034
0.00756098
0.00788341
0.00379978
0.00327297
0.00162503
0.00173444
0.00168857
0.00345483
0.00404205
0.00862192
0.00950304
0.0114844
0.012758
0.0199289
0.0229168
0.0367856
0.0384353
0.026974
0.0203252
0.0171578
0.0217317
0.0244787
0.0295124
0.0274054
0.0239085
0.0158353
0.0144459
0.00783005
0.0067597
0.00687615
0.00578484
0.00601807
0.00446988
0.00452983
0.00376518
0.00179362
0.00181075
0.00202193
0.00216329
0.000955486
0.00139386
0.00330896
0.00326228
0.0037832
0.00387755
0.00140144
0.00141915
0.00133443
0.002268
0.00447267
0.00456218
0.00775578
0.00903507
0.00903911
0.00602709
0.00589914
0.00377828
0.00267294
0.00394604
0.00465086
0.00689308
0.0102979
0.0180293
0.0203304
0.0120864
0.0105442
0.00732399
0.00853434
0.0097464
0.0130622
0.0138011
0.0225784
0.0203021
0.0151506
0.00856858
0.00783893
0.00742948
0.00712702
0.00587294
0.00505537
0.00409093
0.00470845
0.00501772
0.00533978
0.00580963
0.00557951
0.00809696
0.0104988
0.0155309
0.0124683
0.0112827
0.0101493
0.00712405
0.00707955
0.00914721
0.00982088
0.0099014
0.00807162
0.00901529
0.0115018
0.0158031
0.0215525
0.0280709
0.0333216
0.033618
0.0257493
0.0264442
0.0306336
0.027105
0.0273623
0.0268521
0.0254838
0.0238743
0.0248439
0.0275898
0.0238442
0.0220567
0.0217026
0.0222737
0.0239277
0.0250024
0.0256974
0.0254087
0.0251903
0.0258538
0.0257142
0.0264209
0.0268755
0.0270274
0.0256382
0.0245738
0.0233845
0.0248624
0.0266355
0.028652
0.0287009
0.0282042
0.0274469
0.0287551
0.0298089
0.031673
0.0303345
0.0321805
0.0337934
0.0351951
0.0327911
0.030626
0.0308924
0.0333551
0.0360436
0.038969
0.0378449
0.0361784
0.0343031
0.0367152
0.0388397
0.0417886
0.0394317
0.0424683
0.0450339
0.0473698
0.0439221
0.0407505
0.0421454
0.0455875
0.0493094
0.0509186
0.0469264
0.0432139
0.0397634
0.0365561
0.0335734
0.0307988
0.0282219
0.0258354
0.0236484
0.0216934
0.0199954
0.0186876
0.0182048
0.0188766
0.0140937
0.0140627
0.0151146
0.0116091
0.0101665
0.0100001
0.00614662
0.00744672
0.00594597
0.00702288
0.00650453
0.00763369
0.00700387
0.00689962
0.0064615
0.00598057
0.00548101
0.00511167
0.00559481
0.00543152
0.00490193
0.00474111
0.00481718
0.00420992
0.00453298
0.00497943
0.00538714
0.00457145
0.00533311
0.00457829
0.00474822
0.00498795
0.0041887
0.00384772
0.00344589
0.00369503
0.00407651
0.00453189
0.0041318
0.00357408
0.00329466
0.00295796
0.0032917
0.00377019
0.00344251
0.00402459
0.00294352
0.00267971
0.0022897
0.00208913
0.00237081
0.00270894
0.00301998
0.00324243
0.0033562
0.0033319
0.00280688
0.00263445
0.00221901
0.00209256
0.00254009
0.00272368
0.00273731
0.00340128
0.00384215
0.00445847
0.00319306
0.0028367
0.00241671
0.00244642
0.00201558
0.00185884
0.00197153
0.00145983
0.00170744
0.00172515
0.00157063
0.00132058
0.00120444
0.00137325
0.00154441
0.00176742
0.00177903
0.00222132
0.00203295
0.00257602
0.00186775
0.00191634
0.00159063
0.00136281
0.0012005
0.00139512
0.00145915
0.00170476
0.00170839
0.00180338
0.0022832
0.00279764
0.00204479
0.00304549
0.00233186
0.00155659
0.0023981
0.00185365
0.00153781
0.00122115
0.00187048
0.00152007
0.00143362
0.00119575
0.00177315
0.00262543
0.00181438
0.00272213
0.0026893
0.00235996
0.00350035
0.0029413
0.00272748
0.0022496
0.00304873
0.00291751
0.0026938
0.00253583
0.00207495
0.00297848
0.00241983
0.00206138
0.00151033
0.00243164
0.0015201
0.00128003
0.00127081
0.000873869
0.00178374
0.00170459
0.00131279
0.00124269
0.000791202
0.00171203
0.00137385
0.00130608
0.000777727
0.00176652
0.00134785
0.00123579
0.000712202
0.00155727
0.00135736
0.001039
0.00102424
0.000590102
0.00150168
0.00112539
0.00102928
0.000537598
0.00138557
0.00102684
0.00098011
0.000519087
0.00141578
0.00103826
0.000941983
0.00046958
0.00128336
0.000943767
0.00089475
0.000455213
0.00131027
0.000947187
0.000852546
0.000417629
0.00109751
0.00103394
0.000463217
0.00136556
0.000960105
0.000838565
0.000399415
0.00114666
0.000836911
0.000746657
0.000346294
0.000955097
0.000861994
0.000358429
0.00107372
0.000729497
0.000657889
0.000305149
0.000878783
0.000789011
0.0003269
0.00108845
0.000761621
0.000657981
0.000289174
0.00084648
0.00075471
0.000305718
0.000939967
0.000626492
0.000552613
0.000249121
0.000747456
0.000657273
0.000257652
0.000919079
0.000623665
0.000524477
0.000221959
0.000687067
0.000609237
0.000240892
0.000708811
0.000615179
0.000234404
0.000736059
0.000618174
0.000244786
0.000759893
0.000507757
0.000413812
0.000192184
0.000586397
0.000470161
0.000191456
0.000594891
0.000506485
0.000199729
0.000631369
0.000507042
0.000203885
0.000714868
0.000502034
0.000376084
0.000175912
0.000534593
0.00043789
0.000181479
0.000543847
0.000420819
0.000176847
0.00055065
0.000430541
0.000181022
0.000541291
0.000409304
0.000176708
0.00055009
0.000410941
0.000178519
0.000535791
0.000349866
0.000266823
0.00014971
0.000403315
0.000300611
0.000147876
0.000415904
0.000310299
0.000149852
0.000426214
0.00030362
0.000147876
0.000414441
0.000307723
0.000150297
0.000427735
0.000304596
0.000150213
0.000415284
0.000307991
0.000153238
0.000420984
0.000302019
0.000152787
0.000409522
0.000306275
0.000156499
0.000423287
0.000309196
0.000159467
0.000469782
0.000317406
0.000234646
0.000145537
0.00033951
0.000265971
0.000148996
0.000341519
0.000263303
0.000147684
0.000344317
0.000265079
0.000150195
0.00033369
0.000259941
0.000149629
0.000335552
0.000261027
0.000152279
0.000326579
0.000257396
0.000152104
0.000331598
0.000260894
0.000155357
0.000323112
0.000258969
0.000154695
0.000327758
0.000262873
0.000157639
0.000322072
0.000262602
0.000158498
0.000369919
0.000258361
0.000211113
0.000137261
0.000243922
0.000219571
0.000135163
0.000263551
0.000221584
0.000134311
0.000261237
0.000224597
0.000136651
0.00027492
0.000229117
0.000138399
0.000276425
0.000235258
0.000142949
0.000289668
0.000240243
0.000145969
0.00029361
0.000248948
0.00015344
0.000348841
0.000250231
0.000209117
0.000137704
0.000263236
0.000235076
0.00014274
0.00027899
0.000243611
0.000147176
0.000279888
0.000245281
0.00014906
0.000288086
0.000250799
0.000151496
0.000302738
0.000226947
0.000202479
0.000136807
0.000252941
0.000229447
0.000141787
0.000266846
0.000242743
0.000148825
0.000320172
0.000236173
0.000206333
0.000137596
0.000251509
0.000235862
0.000144744
0.000270852
0.000246157
0.000148041
0.000289168
0.000219553
0.000201153
0.000136592
0.000246383
0.000229372
0.000142726
0.000260426
0.000246494
0.0001525
0.000318833
0.000239549
0.000214933
0.000144414
0.000260239
0.000247644
0.000153849
0.000319845
0.000241806
0.000219424
0.000146116
0.000246094
0.000236737
0.000151552
0.000312237
0.000238068
0.000217496
0.000145498
0.000280468
0.000216961
0.000206632
0.000141229
0.000255829
0.000242779
0.000153163
0.000323242
0.000254044
0.00023569
0.000157065
0.000318876
0.000246232
0.000230229
0.000155686
0.000295792
0.000237389
0.000225712
0.000153956
0.000310879
0.00023955
0.000226932
0.000155313
0.000279397
0.0002497
0.000203506
0.00020197
0.000143975
0.000300973
0.000231958
0.000223386
0.000153564
0.000296105
0.00028286
0.000230783
0.000227174
0.000159485
0.000307826
0.000295366
0.000228447
0.000226316
0.000157827
0.000298366
0.000265449
0.000234447
0.000213092
0.000217871
0.000158989
0.00034392
0.000296897
0.0002842
0.000251775
0.000249485
0.000213523
0.000218001
0.000158067
0.000306726
0.000292545
0.000249704
0.000252769
0.000231794
0.000238799
0.000221094
0.000230468
0.00021538
0.000223366
0.000210734
0.000219687
0.000208967
0.000218102
0.000209105
0.000218915
0.000210599
0.000221242
0.000213592
0.000225107
0.000218045
0.000229848
0.000224407
0.00023627
0.000232434
0.000243803
0.000241105
0.000241618
0.000244332
0.000240841
0.00024561
0.000242399
0.000248931
0.000246175
0.000254621
0.000252055
0.000262257
0.000259788
0.000271808
0.000269068
0.000282336
0.000279437
0.000293951
0.000290795
0.000306079
0.000302825
0.000319335
0.000315694
0.000332743
0.000328934
0.000347064
0.000342751
0.000361223
0.000356684
0.000376147
0.000371016
0.000390684
0.000385305
0.000405891
0.000399832
0.000420589
0.000414311
0.000435856
0.000428794
0.000450476
0.000443264
0.000465641
0.000457656
0.000480217
0.000471959
0.000495001
0.000485838
0.00050882
0.000499637
0.00052329
0.000513123
0.000536599
0.000526399
0.000550527
0.00053929
0.000563154
0.000551933
0.000576377
0.000564063
0.00058813
0.00057589
0.000600495
0.000587166
0.000611327
0.000598127
0.000622784
0.000608499
0.000632674
0.00061856
0.000643185
0.00062797
0.000652071
0.000637092
0.000661607
0.000645538
0.000669504
0.000653749
0.000678106
0.000661273
0.000685067
0.000668622
0.000692798
0.000675307
0.00069892
0.000681877
0.000705867
0.000687799
0.00071129
0.000693685
0.000717637
0.000698966
0.000722377
0.000704209
0.000728061
0.00070886
0.000732174
0.000713533
0.000737281
0.000717635
0.000740842
0.0007218
0.000745428
0.0007254
0.000748489
0.000729109
0.000752616
0.000732272
0.000755249
0.000735592
0.000758983
0.000738378
0.000761244
0.000741357
0.000764635
0.000743815
0.000766578
0.000746506
0.000769682
0.000748687
0.00077135
0.00075112
0.00077419
0.000753039
0.000775599
0.000755243
0.000778221
0.000756957
0.000779438
0.000758999
0.000781908
0.000760546
0.000782939
0.000762404
0.000785208
0.000763733
0.000786015
0.000765399
0.000788125
0.000766594
0.000788828
0.00076819
0.000790877
0.000769301
0.000791464
0.000770761
0.000793355
0.0007717
0.000793779
0.000773039
0.000795587
0.000773913
0.000795955
0.000775196
0.000797688
0.000775965
0.000797936
0.000777146
0.000799598
0.000777868
0.000799826
0.000779042
0.000801464
0.000779684
0.000801552
0.000780695
0.000803015
0.000781188
0.000803018
0.000782203
0.00080458
0.000782845
0.00080476
0.000783992
0.000806394
0.000784506
0.000806401
0.00078554
0.000808126
0.000786225
0.000809018
0.000791169
0.000819654
0.000805392
0.000873411
0.00090248
0.000960144
0.000968167
0.00148003
0.00145208
0.0012336
0.00212225
0.00116051
0.00123233
0.00182948
0.00114865
0.00123087
0.00177037
0.0011455
0.00122677
0.00176026
0.00114039
0.00122199
0.00169081
0.00114341
0.00122178
0.00173642
0.00113661
0.00121732
0.001687
0.00113847
0.00121631
0.00172612
0.00113213
0.00121213
0.00167994
0.00113377
0.00121114
0.00171779
0.00112756
0.00120696
0.00167226
0.00112905
0.00120573
0.00170957
0.0011226
0.00120123
0.00166384
0.00112376
0.0011997
0.00170065
0.0011171
0.00119502
0.00165498
0.00111809
0.00119333
0.00169129
0.00111131
0.00118845
0.0016454
0.00111206
0.00118647
0.00168127
0.00110501
0.0011813
0.00163517
0.0011055
0.00117907
0.00167059
0.00109826
0.00117368
0.00162426
0.00109851
0.00117115
0.00165919
0.00109098
0.00116542
0.00161264
0.00109086
0.00116254
0.00164704
0.00108308
0.00115654
0.00160028
0.00108272
0.00115342
0.00163417
0.00107472
0.00114713
0.00158722
0.00107401
0.0011436
0.00162053
0.00106563
0.00113689
0.00157335
0.0010645
0.00113296
0.00160608
0.00105581
0.00112594
0.00155875
0.00105438
0.00112169
0.00159091
0.0010454
0.00111437
0.00154342
0.00104364
0.00110966
0.00157497
0.00103423
0.00110195
0.00152735
0.00103209
0.00109681
0.00155829
0.00102227
0.00108877
0.00151059
0.00101981
0.0010832
0.00154092
0.00100957
0.0010748
0.00149316
0.00100672
0.00106877
0.00152288
0.00099604
0.00106003
0.00147508
0.000992854
0.00105359
0.0015042
0.000981755
0.0010445
0.00145626
0.00097821
0.00103764
0.001485
0.000966691
0.00102819
0.00143673
0.000962823
0.00102105
0.00146539
0.000950981
0.00101136
0.00141674
0.000946899
0.00100401
0.00144534
0.000934748
0.000994075
0.00139632
0.00093043
0.000986519
0.00142491
0.000917987
0.000976407
0.00137555
0.000913539
0.000968774
0.00140417
0.000900913
0.000958605
0.00135448
0.00089642
0.000950975
0.00138323
0.00088364
0.000940797
0.00133299
0.000879177
0.000933264
0.00136199
0.000866321
0.000923202
0.00131155
0.00086198
0.000915882
0.00134086
0.000849112
0.000905999
0.00129004
0.000844948
0.000898931
0.00131971
0.000832073
0.000889268
0.00126852
0.000828142
0.000882543
0.00129877
0.000815308
0.000873194
0.00124727
0.000811688
0.000866867
0.0012783
0.000798841
0.000857727
0.00122665
0.000795316
0.000851498
0.00125883
0.000782
0.00084203
0.00120741
0.000777882
0.000836146
0.00124139
0.000763633
0.000826632
0.0011905
0.000757868
0.000819322
0.00122776
0.000744718
0.000810919
0.00117466
0.000738947
0.000803487
0.00121379
0.000726339
0.00079455
0.00116038
0.000721208
0.000788638
0.00120078
0.000709809
0.000779982
0.00114837
0.000705114
0.000775491
0.00119047
0.000695161
0.000767831
0.00113886
0.000691935
0.000765558
0.00118266
0.000683514
0.000759333
0.00113169
0.000681895
0.000758471
0.00117739
0.000673383
0.000753691
0.00112731
0.000672776
0.000752937
0.00117593
0.000664343
0.00074823
0.00112725
0.00066482
0.000747694
0.00117922
0.000655978
0.000742351
0.00113225
0.000655452
0.000740281
0.00118835
0.000644175
0.000731933
0.00114357
0.000640404
0.000726077
0.00120754
0.000624071
0.0007128
0.00116698
0.000615782
0.000705279
0.00123735
0.000598914
0.000695695
0.0011987
0.000594722
0.000696938
0.00126694
0.000587251
0.000697073
0.00122895
0.000591469
0.000702324
0.00130171
0.000588308
0.000703587
0.00127218
0.000593466
0.000710837
0.00135323
0.000592089
0.00071464
0.00133717
0.000598924
0.000724865
0.00142906
0.000599888
0.000732376
0.00143588
0.000608876
0.000746821
0.00153729
0.000613927
0.000759771
0.00156412
0.000625957
0.000782702
0.00170986
0.000634206
0.000800997
0.0017779
0.000655545
0.000841447
0.00202977
0.000697703
0.000957758
0.00227741
0.000867165
0.00139353
0.000539758
0.00055148
0.00121215
0.00295219
0.00330636
0.00161476
0.000712691
0.000734093
0.0014235
0.00179642
0.000917672
0.000983893
0.00161319
0.00406185
0.0047072
0.00198568
0.00132518
0.00161811
0.000589316
0.000611126
0.00191035
0.00176144
0.00058421
0.000865335
0.00261887
0.000789706
0.00141147
0.000514749
0.000575624
0.00127759
0.00341415
0.0120451
0.00699478
0.00685593
0.00931605
0.0131732
0.010501
0.0127069
0.00880886
0.00753524
0.012267
0.00769604
0.00619621
0.01197
0.00676056
0.00546968
0.0126938
0.00616372
0.00514118
0.0126058
0.00583343
0.00493908
0.0119382
0.00561012
0.0047825
0.0114295
0.00543647
0.00465758
0.0110952
0.00530084
0.00455091
0.0108177
0.00518954
0.00446517
0.0105798
0.00510009
0.00439235
0.0103724
0.00502366
0.00432878
0.0101897
0.0049564
0.00427438
0.0100274
0.00489811
0.00422799
0.009882
0.00484765
0.00418817
0.00975103
0.00480363
0.00415394
0.00963084
0.00476498
0.00412425
0.00951825
0.00473055
0.00409782
0.00941958
0.00469991
0.00407405
0.00932384
0.00467095
0.0040523
0.00924042
0.00464493
0.00403533
0.00915997
0.0046225
0.00402065
0.00908762
0.00460272
0.00400862
0.00901721
0.00458534
0.00399881
0.00895442
0.00457035
0.00399122
0.0088916
0.0045573
0.00398516
0.00883657
0.00454645
0.00398045
0.00877859
0.00453523
0.00397637
0.008729
0.00452666
0.00397433
0.00867975
0.00451905
0.00397276
0.00863473
0.00451234
0.00397202
0.00858857
0.00450639
0.00397179
0.00854739
0.00450118
0.00397219
0.00850383
0.00449642
0.00397272
0.00846597
0.00449219
0.00397383
0.00842443
0.00448844
0.00397509
0.00838974
0.00448527
0.00397681
0.00834968
0.00448215
0.0039781
0.00831794
0.00447917
0.00397968
0.00827876
0.00447622
0.00398091
0.00825001
0.0044736
0.0039825
0.00821124
0.00447072
0.00398327
0.0081856
0.00446791
0.00398448
0.0081466
0.00446496
0.00398503
0.00812445
0.00446247
0.00398638
0.00808467
0.0044597
0.00398652
0.0080665
0.00445699
0.00398728
0.00802504
0.00445358
0.00398653
0.00801197
0.00445071
0.00398707
0.00796839
0.00444778
0.00398591
0.00796774
0.00444478
0.00398754
0.0079128
0.00444135
0.00398331
0.0080336
0.00443562
0.0039854
0.00786041
0.00437255
0.00396813
0.00930012
0.0046529
0.00508767
0.00650672
0.00258475
0.0020659
0.00206651
0.00201114
0.00918406
0.00895182
0.00898121
0.0229067
0.0106742
0.0208635
0.0199658
0.0194793
0.0328974
0.0331477
0.0342913
0.0354397
0.0503446
0.0494763
0.0487158
0.0485192
0.067403
0.0674588
0.0678778
0.0684075
0.0909026
0.0906638
0.0905553
0.0906651
0.119503
0.119181
0.119007
0.11897
0.153563
0.153934
0.15443
0.155043
0.155723
0.119901
0.0908815
0.0674747
0.0484539
0.0326982
0.0194383
0.0194202
0.0195066
0.0195589
0.0330556
0.0329027
0.0328379
0.0486178
0.0487523
0.0489612
0.049143
0.0331774
0.0196503
0.0197189
0.0198088
0.0198871
0.0336268
0.0334707
0.0333302
0.0493555
0.0495593
0.0497806
0.0692076
0.0689296
0.0686633
0.0683977
0.0681503
0.0678951
0.0676828
0.0911651
0.0914775
0.0918009
0.121257
0.120795
0.120342
0.15643
0.157146
0.157867
0.158589
0.121724
0.0921301
0.0924663
0.0928078
0.0931563
0.123138
0.122663
0.122191
0.159311
0.160035
0.160758
0.161482
0.123616
0.0935108
0.0694917
0.0500014
0.03378
0.0199767
0.0200622
0.0201535
0.0202451
0.034279
0.0341072
0.0339428
0.0502346
0.050472
0.0507199
0.0509744
0.0344544
0.0203397
0.0204371
0.0205362
0.0206392
0.0350182
0.034824
0.0346367
0.0512394
0.051514
0.0517969
0.0717504
0.0713945
0.0710511
0.0707188
0.0703976
0.070086
0.069785
0.0938726
0.0942417
0.0946194
0.125073
0.124583
0.124098
0.162206
0.162929
0.163651
0.164372
0.125567
0.0950056
0.0954016
0.0958078
0.0962253
0.12708
0.12657
0.126066
0.165093
0.165812
0.16653
0.216936
0.215774
0.214607
0.213435
0.21226
0.211082
0.209902
0.20872
0.207538
0.206357
0.205177
0.204
0.202825
0.201654
0.200491
0.199337
0.198214
0.197165
0.196249
0.195478
0.245157
0.246439
0.247939
0.249625
0.309484
0.306903
0.304612
0.302693
0.367781
0.370463
0.373767
0.377534
0.453024
0.44777
0.443249
0.439695
0.517284
0.521778
0.52769
0.534705
0.620861
0.611866
0.60446
0.599038
0.68307
0.689358
0.698278
0.709381
0.797902
0.784649
0.774272
0.767285
0.849049
0.856782
0.868581
0.883934
0.964927
0.94754
0.934307
0.925779
0.993654
1.00356
1.01835
1.03765
1.09771
1.07672
1.06051
1.04928
1.0892
1.10141
1.11878
1.14117
1.16769
1.14436
1.12621
1.11355
1.19544
1.16791
1.12279
1.06063
0.985502
0.901925
0.813202
0.72201
0.630932
0.542451
0.458754
0.3816
0.312247
0.251423
0.253271
0.255143
0.257034
0.320978
0.318017
0.315104
0.385835
0.390183
0.39463
0.399176
0.323983
0.258941
0.260863
0.262799
0.264747
0.333254
0.330123
0.327032
0.403821
0.408564
0.413403
0.504903
0.497735
0.490761
0.483979
0.477389
0.470985
0.464768
0.55065
0.559185
0.568037
0.664752
0.652973
0.64169
0.73563
0.750027
0.765158
0.781044
0.677039
0.577209
0.586714
0.596558
0.60675
0.717177
0.70323
0.689858
0.797728
0.815253
0.833666
0.853017
0.73172
0.617297
0.512266
0.418337
0.336424
0.266706
0.268673
0.270648
0.272628
0.346139
0.342868
0.339629
0.423363
0.428478
0.433679
0.438965
0.349439
0.274614
0.276602
0.278594
0.280587
0.359509
0.356124
0.352768
0.444332
0.449782
0.455315
0.569062
0.560402
0.551922
0.543623
0.535503
0.527568
0.519822
0.628204
0.639472
0.651101
0.779085
0.762663
0.746878
0.87335
0.894707
0.917118
0.940603
0.796143
0.663085
0.675421
0.688101
0.70112
0.851034
0.832135
0.813831
0.965164
0.99078
1.01741
1.19788
1.16129
1.12642
1.0933
1.06194
1.03232
1.00436
0.977971
0.95307
0.92956
0.907347
0.886343
0.86647
0.847661
0.829886
0.921746
0.943036
0.965714
1.05977
1.0332
1.0084
1.08642
1.11452
1.1448
1.17733
1.08818
0.989821
1.01546
1.04274
1.07183
1.18602
1.1511
1.11856
1.2123
1.24996
1.29062
1.37871
1.33291
1.29071
1.25171
1.21557
1.18206
1.15109
1.19812
1.23124
1.26718
1.2987
1.26126
1.22681
1.33927
1.30605
1.34812
1.39378
1.44354
1.48339
1.43112
1.38327
1.54076
1.49801
1.42861
1.33466
1.22357
1.10288
1.13606
1.17155
1.20954
1.35507
1.30776
1.26405
1.38252
1.43469
1.49177
1.55441
1.40631
1.2502
1.29366
1.33998
1.38913
1.58663
1.5219
1.46183
1.62332
1.69922
1.78269
1.96293
1.85847
1.76585
1.68341
1.60965
1.54328
1.48323
1.55793
1.62427
1.69818
1.75339
1.67451
1.6041
1.84259
1.78119
1.87525
1.9829
2.10757
2.20224
2.06286
1.9446
2.09801
2.25402
2.08069
1.87387
1.65587
1.44093
1.23604
1.045
0.87051
0.714478
0.577909
0.460936
0.362923
0.282581
0.218093
0.167248
0.127598
0.0966553
0.0721197
0.0520911
0.0352181
0.0207434
0.0208523
0.0209624
0.0210776
0.0358611
0.0356392
0.0354254
0.0523968
0.052714
0.0530439
0.0533868
0.0360914
0.0211945
0.0213167
0.0214412
0.0215717
0.0368317
0.0365741
0.0363295
0.0537437
0.0541154
0.0545034
0.0751631
0.0746705
0.0741995
0.0737486
0.0733165
0.0729017
0.0725032
0.097099
0.0975575
0.0980322
0.129202
0.128657
0.128123
0.167964
0.16868
0.169395
0.170109
0.129758
0.0985248
0.099037
0.0995707
0.100128
0.131515
0.130913
0.130328
0.170823
0.171537
0.172252
0.172968
0.132138
0.100711
0.0756789
0.054908
0.0370968
0.0217043
0.0218462
0.0219888
0.0221417
0.0379656
0.0376629
0.0373749
0.0553315
0.0557744
0.0562393
0.0567272
0.0382809
0.022298
0.0224654
0.0226399
0.0228206
0.0393293
0.0389613
0.0386132
0.0572414
0.0577833
0.0583566
0.0801356
0.079388
0.0786832
0.0780171
0.0773866
0.0767884
0.0762201
0.101324
0.101967
0.102646
0.134162
0.133457
0.132784
0.173689
0.174418
0.175158
0.175917
0.134905
0.103364
0.104124
0.104933
0.105794
0.137421
0.136527
0.135691
0.176703
0.177524
0.178393
0.179322
0.138381
0.106714
0.0809305
0.0589641
0.0397184
0.023017
0.0232225
0.0234445
0.0236825
0.0410429
0.0405713
0.0401309
0.0596102
0.0602997
0.0610387
0.0618341
0.0415519
0.0239415
0.0242245
0.0245374
0.0248855
0.0433684
0.0427062
0.0421036
0.0626938
0.0636272
0.0646454
0.0884145
0.087075
0.0858435
0.0847086
0.083659
0.0826851
0.0817782
0.1077
0.108759
0.1099
0.141743
0.140532
0.139415
0.180332
0.181425
0.182575
0.184248
0.143067
0.111133
0.112468
0.113933
0.115459
0.126136
0.146367
0.144429
0.164662
0.137517
0.115039
0.0960289
0.105887
0.112985
0.0898871
0.0657624
0.0441032
0.0252777
0.025725
0.0262444
0.0268558
0.0469217
0.0458598
0.0449268
0.0669939
0.068351
0.060341
0.0467595
0.043739
0.0275829
0.0277052
0.0217753
0.0195184
0.0248754
0.0274549
0.0336237
0.0365558
0.0318826
0.0288341
0.0315292
0.0354917
0.039831
0.0479816
0.062395
0.0789219
0.0915516
0.0943264
0.0771506
0.0601405
0.0568064
0.0702517
0.0878818
0.0786399
0.0644934
0.0547482
0.0471976
0.0485246
0.0484902
0.0422172
0.0370695
0.0324936
0.0323324
0.0366108
0.042121
0.0409632
0.0360401
0.0321918
0.0325642
0.0361142
0.0405456
0.0460706
0.0529559
0.0615885
0.0724775
0.086632
0.104305
0.124617
0.148889
0.17883
0.216363
0.23657
0.235357
0.234383
0.233506
0.232621
0.231728
0.23082
0.229893
0.228939
0.227955
0.226941
0.2259
0.224833
0.223744
0.222638
0.221517
0.220385
0.219243
0.284576
0.286569
0.288559
0.373356
0.369845
0.366368
0.466651
0.472469
0.478403
0.484463
0.376899
0.290542
0.292513
0.294464
0.296386
0.387682
0.384071
0.380473
0.490662
0.497009
0.503505
0.647077
0.636153
0.625649
0.615523
0.605726
0.596216
0.586953
0.728188
0.742275
0.756788
0.932436
0.911179
0.890554
1.07347
1.10278
1.13293
1.16401
0.95444
0.771805
0.787427
0.803774
0.820973
1.027
1.00149
0.97738
1.19634
1.23041
1.26551
1.27301
1.05482
0.839188
0.65846
0.510143
0.391288
0.298266
0.300092
0.301847
0.303517
0.401782
0.39838
0.394865
0.516912
0.52379
0.530704
0.537349
0.405002
0.305092
0.306573
0.307964
0.309271
0.414311
0.410884
0.408034
0.543662
0.516799
0.407978
0.357761
0.464395
0.605546
0.709259
0.6962
0.682789
0.670319
0.858274
0.878372
0.891944
0.68619
0.940011
1.08385
0.931112
0.663659
0.491378
0.386852
0.502082
0.669643
0.49659
0.378132
0.298794
0.258836
0.309281
0.384427
0.320922
0.276223
0.242788
0.240541
0.268229
0.29975
0.338995
0.394238
0.482712
0.634005
0.883755
1.23427
1.49282
1.44479
1.40082
1.35819
1.31639
1.27561
1.49504
1.55104
1.60847
1.88542
1.80528
1.72904
1.97195
1.96003
1.51758
1.08763
1.53761
1.6657
1.58101
1.1718
0.831211
0.607759
0.798824
1.11301
0.794319
0.623895
0.529375
0.518539
0.57178
0.661868
0.824886
1.10897
1.54921
2.03843
1.70712
1.20099
0.893464
0.808948
1.02603
1.44588
0.695166
0.722479
0.627685
0.570046
0.526618
0.532848
0.578308
0.628105
0.48811
0.486265
0.479639
0.474692
0.500232
0.611309
0.48472
0.411331
0.364833
0.364739
0.398019
0.438646
0.436806
0.403053
0.368856
0.334063
0.332763
0.329767
0.298718
0.269352
0.241486
0.241002
0.269913
0.300864
0.300108
0.268316
0.239402
0.238012
0.266296
0.297681
0.332019
0.368655
0.40635
0.443502
0.445621
0.405115
0.366065
0.363945
0.402857
0.444442
0.327902
0.329451
0.295726
0.265002
0.237235
0.236868
0.264385
0.294723
0.212108
0.212307
0.212725
0.21355
0.214745
0.215591
0.215272
0.215465
0.22248
0.244324
0.282195
0.321761
0.347424
0.310171
0.296185
0.241586
0.198761
0.184572
0.225437
0.278935
0.256324
0.207621
0.171237
0.143781
0.152919
0.164482
0.136659
0.114243
0.096387
0.0925114
0.108211
0.127914
0.122412
0.105341
0.0913543
0.0917735
0.104516
0.119571
0.137703
0.160196
0.189229
0.228221
0.205606
0.176635
0.153794
0.151849
0.171487
0.194456
0.19184
0.170838
0.152032
0.135243
0.134665
0.134951
0.118915
0.10505
0.0929993
0.0943985
0.10613
0.119501
0.120341
0.10719
0.0956571
0.0855929
0.084156
0.0825312
0.0808912
0.0796976
0.0796791
0.0816936
0.0696827
0.0601321
0.0524311
0.0532307
0.0603612
0.0690627
0.0699204
0.0617493
0.0549292
0.0492311
0.0473563
0.0461805
0.0410984
0.0369672
0.0336315
0.035275
0.0385294
0.0425132
0.044474
0.0405168
0.0372443
0.0392509
0.0425924
0.0465991
0.0513663
0.0570181
0.0637064
0.0716012
0.0734907
0.065731
0.0590967
0.061026
0.067608
0.075269
0.0768484
0.0692817
0.0627545
0.0571404
0.0553936
0.0534523
0.0486648
0.044618
0.0412135
0.0430348
0.0464993
0.0505871
0.0523242
0.0482045
0.0446913
0.0461826
0.0497365
0.0538816
0.0587033
0.0642977
0.070773
0.0782494
0.086859
0.0967453
0.108066
0.120991
0.135703
0.152384
0.171165
0.192133
0.192059
0.171011
0.152379
0.152319
0.17059
0.191315
0.19061
0.170319
0.152391
0.136561
0.136227
0.13596
0.121524
0.108847
0.0977309
0.0986409
0.109593
0.122059
0.122594
0.110286
0.0994556
0.100134
0.110876
0.123071
0.136895
0.152546
0.170242
0.190219
0.190048
0.170255
0.152704
0.152821
0.170286
0.189976
0.137359
0.13717
0.123442
0.111324
0.10064
0.100963
0.111614
0.123688
0.0915812
0.0912341
0.0906863
0.0899409
0.0890343
0.0880019
0.0795059
0.0721043
0.0656713
0.0668797
0.0732812
0.0806257
0.0815977
0.0742955
0.0679162
0.0623534
0.0613112
0.0600925
0.0552652
0.0510977
0.0475082
0.0486679
0.0522889
0.0564771
0.0575113
0.0533041
0.0496556
0.050444
0.0541156
0.0583394
0.0631901
0.0687513
0.0751165
0.0823897
0.082966
0.0757094
0.0693508
0.0697261
0.0760812
0.0833288
0.0641621
0.063788
0.0589291
0.0546918
0.0510025
0.0513537
0.055053
0.0592983
0.0481356
0.0477961
0.0472583
0.0464977
0.0455441
0.044424
0.0431439
0.0417048
0.0401094
0.0383605
0.0364752
0.0345506
0.0326372
0.0309685
0.0297809
0.0291975
0.0290856
0.0290386
0.0280925
0.0258503
0.0228464
0.0187496
0.0177859
0.0174333
0.0176024
0.0197165
0.020064
0.0210249
0.0236273
0.0223087
0.0215935
0.021251
0.0196729
0.0177527
0.015198
0.0158497
0.0117577
0.0061258
0.00238902
0.00148799
0.000565413
0.000652487
0.000827575
0.00242602
0.00084627
0.00148988
0.000592022
0.000723297
0.00140564
0.00351308
0.00466211
0.00202053
0.00114717
0.00157439
0.000513958
0.00058269
0.00208405
0.00186522
0.000626173
0.00107041
0.00348048
0.00117786
0.000487467
0.000639951
0.00101879
0.00197377
0.0048004
0.00202124
0.0142823
0.0079007
0.0072452
0.0116616
0.014158
0.0123311
0.0132647
0.00944012
0.00680957
0.00944801
0.0169605
0.0175544
0.0188741
0.0184697
0.0180753
0.0197104
0.0210531
0.0209757
0.0198328
0.0200768
0.0210031
0.0210846
0.0213679
0.0217592
0.0223059
0.0230406
0.0241072
0.0257039
0.0265259
0.0247096
0.0233932
0.023475
0.0248301
0.0266466
0.0268895
0.0251482
0.0238427
0.0228774
0.0224696
0.0224261
0.0217198
0.0211891
0.0208359
0.0209001
0.0212314
0.0217465
0.0221762
0.0216854
0.0213684
0.0211902
0.0207058
0.020613
0.0208893
0.0211022
0.0204646
0.0194296
0.0181245
0.016906
0.0175846
0.0141255
0.00949855
0.00333278
0.000966744
0.000662154
0.000533846
0.00150536
0.00184962
0.00287047
0.00604856
0.0029543
0.00121219
0.000486795
0.000643269
0.00102906
0.00198817
0.00461344
0.00196999
0.00900632
0.0126895
0.00685354
0.00296746
0.00152292
0.000555683
0.000701153
0.00103659
0.00333328
0.00130382
0.000614412
0.000856821
0.00144778
0.000504337
0.000626102
0.00211971
0.000830757
0.00150237
0.000514218
0.000673649
0.00152723
0.00377757
0.00543643
0.00249198
0.00117766
0.00177516
0.000581785
0.000761037
0.00283846
0.00246341
0.00119877
0.000448008
0.000622524
0.00103485
0.00211038
0.00489227
0.00195557
0.00653047
0.00322263
0.00162013
0.000604023
0.000837688
0.0014198
0.000513187
0.000676501
0.00157294
0.00374057
0.00204202
0.00318784
0.0087547
0.01678
0.0100069
0.00830296
0.0146803
0.0172597
0.0149238
0.0158388
0.00977256
0.00689675
0.0140806
0.00467843
0.00192745
0.00185243
0.00957639
0.0127271
0.0154995
0.0183862
0.0193177
0.0187513
0.0197124
0.0189713
0.0200585
0.0206356
0.0212115
0.0203788
0.0211969
0.020294
0.0191178
0.0204264
0.0211601
0.0218588
0.0210527
0.0203065
0.0207199
0.0174006
0.0118252
0.00560175
0.00247486
0.00117416
0.00179479
0.000608245
0.000814762
0.00283074
0.00127232
0.000543627
0.000822925
0.00141491
0.000494986
0.000648498
0.00221745
0.000889127
0.00170223
0.000568452
0.000818583
0.00183599
0.00417847
0.00626989
0.00310847
0.00154264
0.000574268
0.00083277
0.00198012
0.00373551
0.00315041
0.00142046
0.000509295
0.000696504
0.00158714
0.00250763
0.00119981
0.00184627
0.000638336
0.000885734
0.00287855
0.00142755
0.000579527
0.000912354
0.00161911
0.000526447
0.000711402
0.00259021
0.00222785
0.00510723
0.00215418
0.0100149
0.0190926
0.00872234
0.00573692
0.0025032
0.0110852
0.00903707
0.0160496
0.0198632
0.0166994
0.0182964
0.0104296
0.00678739
0.0139065
0.00868752
0.0123336
0.00487338
0.00191278
0.00189618
0.0207556
0.0216286
0.022955
0.0218667
0.0228736
0.0218901
0.0227084
0.0231627
0.0224797
0.0218413
0.0223064
0.0218201
0.0219661
0.0216417
0.0212729
0.0208794
0.0211907
0.0212472
0.0213069
0.0213547
0.0214729
0.0221728
0.0223465
0.0227951
0.0231992
0.0224848
0.021815
0.0216158
0.0212187
0.0210121
0.0208569
0.0207604
0.0207437
0.0207614
0.0205101
0.0205037
0.0205721
0.0207644
0.020656
0.0206336
0.0211324
0.0211723
0.0212994
0.0214988
0.0209467
0.0207194
0.0209259
0.0211927
0.0215178
0.0214899
0.0218009
0.0220558
0.022667
0.0235152
0.0237646
0.0234561
0.0242067
0.0238296
0.0246716
0.0240842
0.0230968
0.0239608
0.0231382
0.0237043
0.0203668
0.0144796
0.00781289
0.0104714
0.00491609
0.00191596
0.000619371
0.000918118
0.00209998
0.00361235
0.00177031
0.000639786
0.000972184
0.00173256
0.000598954
0.000881311
0.00205994
0.00450889
0.00227698
0.00367295
0.00727634
0.0174117
0.00970653
0.0132285
0.00694237
0.00338406
0.00168384
0.000623597
0.000946799
0.00160832
0.000558727
0.000799427
0.00181973
0.00416527
0.00213309
0.00347016
0.00617883
0.00289734
0.00136186
0.00211708
0.000739407
0.00104585
0.00341143
0.00174956
0.000685723
0.00109945
0.00204928
0.000672534
0.000991102
0.00340075
0.00162413
0.000641681
0.00103075
0.00191263
0.000635525
0.000945151
0.00322555
0.00159118
0.000589119
0.000974638
0.00182154
0.000583757
0.000851808
0.00324119
0.00138985
0.00048538
0.000754734
0.0012734
0.00261704
0.00570091
0.00228774
0.0158605
0.00771388
0.00409986
0.00206556
0.00081223
0.00118256
0.00262223
0.00520505
0.00433286
0.00210307
0.000727859
0.00109334
0.00250818
0.00412434
0.00206854
0.00079112
0.00117904
0.00266818
0.0052911
0.00435021
0.00787762
0.0129881
0.0224998
0.0124513
0.0261833
0.0181417
0.0111444
0.013632
0.00803889
0.00403248
0.0020366
0.000817022
0.00119153
0.00209435
0.00076327
0.00110787
0.00247668
0.00507009
0.00259869
0.00420015
0.00753736
0.00402523
0.00205731
0.000841504
0.00120318
0.00261893
0.00516687
0.00424552
0.00208671
0.000797089
0.00111884
0.00243994
0.00393471
0.00203686
0.000887574
0.00122831
0.00254538
0.00492109
0.00408628
0.00774266
0.0130491
0.0107974
0.0175998
0.0270732
0.0186484
0.0214688
0.0107337
0.0124087
0.00714567
0.00386314
0.00200889
0.00085192
0.0011386
0.00247756
0.00477059
0.00402676
0.00170028
0.00230116
0.00113596
0.00153622
0.00265116
0.00112438
0.00141467
0.00412476
0.00234989
0.00111237
0.0015513
0.00269342
0.00112471
0.00141268
0.00424283
0.0036332
0.0067866
0.00332605
0.0120551
0.0210507
0.0124119
0.00690119
0.00337249
0.00359588
0.0102337
0.0102501
0.0170614
0.0279426
0.0181573
0.032095
0.0310843
0.0323174
0.0307825
0.0298678
0.0219104
0.0191317
0.0111009
0.0129435
0.0310982
0.0298784
0.0279187
0.0268674
0.0226097
0.0120896
0.00567755
0.00249947
0.00267417
0.00821524
0.0131233
0.00808093
0.0162555
0.0058653
0.00252224
0.00265518
0.00849613
0.00594552
0.00268003
0.00287103
0.0125133
0.0220691
0.0135057
0.0160799
0.00860804
0.00995915
0.0139313
0.0211531
0.0248603
0.026012
0.0247579
0.0239906
0.024977
0.0260447
0.0271642
0.027787
0.0269038
0.0259644
0.0249282
0.025719
0.0248607
0.0253147
0.0254693
0.0248924
0.0247396
0.0243023
0.0237251
0.0239037
0.024141
0.0250659
0.0253163
0.0260242
0.0260274
0.0267003
0.0265098
0.0272567
0.0279927
0.0278605
0.0273129
0.026783
0.0264557
0.0255432
0.0247246
0.0244072
0.0237862
0.0234452
0.0231304
0.0228918
0.0223586
0.0226878
0.0230861
0.023509
0.0240096
0.0242098
0.024651
0.0250788
0.0258232
0.0261385
0.0270495
0.0273325
0.0282944
0.0286674
0.0285608
0.0281631
0.0271747
0.0257685
0.0270663
0.0258323
0.0268209
0.028193
0.0296518
0.0283451
0.029456
0.0283794
0.0290945
0.0299478
0.0307846
0.0304721
0.0314527
0.030876
0.0296005
0.0312262
0.0320226
0.0329683
0.0323267
0.0333884
0.0323301
0.0336596
0.0348459
0.0336867
0.0351304
0.0337025
0.0323165
0.0334371
0.0273637
0.0167072
0.00983919
0.012687
0.00701333
0.00327725
0.00153037
0.00111738
0.00231868
0.00262899
0.00113293
0.00141866
0.00409934
0.00354397
0.00232528
0.00112034
0.00153718
0.00264488
0.00112387
0.00140227
0.00415322
0.0035515
0.00662657
0.00326706
0.0119786
0.0204067
0.0178248
0.00968561
0.0269957
0.0163526
0.00961472
0.0123116
0.00679358
0.00312476
0.00148852
0.00110631
0.00224725
0.00249293
0.00103085
0.001249
0.00377818
0.00176351
0.00300226
0.00127599
0.00162717
0.00330272
0.00634637
0.0116254
0.0199484
0.0174377
0.00937166
0.0259983
0.0157067
0.0092815
0.00523255
0.00285487
0.00137974
0.00174181
0.00287173
0.00129419
0.0016007
0.00327827
0.00647135
0.00349682
0.00550215
0.00892362
0.00502651
0.002776
0.00137385
0.00171906
0.00280165
0.00127889
0.00155684
0.00318491
0.00616345
0.00336478
0.00521185
0.0113915
0.0191194
0.0120282
0.0167548
0.0251092
0.0148443
0.00855027
0.00480424
0.00263046
0.00128073
0.00155154
0.00228202
0.0057215
0.00290438
0.00155774
0.0019951
0.00324697
0.00151833
0.00182596
0.00487397
0.00283607
0.00148353
0.00191613
0.0030893
0.00136475
0.00158306
0.00456039
0.00217554
0.0034889
0.00161835
0.00198297
0.0037209
0.0070219
0.0172533
0.00978999
0.00743935
0.00381615
0.00408183
0.0139161
0.0246217
0.0149286
0.0178495
0.0114119
0.0157803
0.00760818
0.0040786
0.00430455
0.0102867
0.0331122
0.0393945
0.0421353
0.0400448
0.0378607
0.034227
0.0383072
0.0362843
0.034803
0.0366671
0.0348588
0.0335923
0.0351599
0.0367199
0.0380678
0.0366899
0.0351687
0.0364096
0.037033
0.0359844
0.0363435
0.0353865
0.0344342
0.0347174
0.033834
0.0339512
0.033159
0.0323359
0.0323736
0.0316144
0.0314278
0.0308045
0.0300979
0.02934
0.0293064
0.0298378
0.0302701
0.0293044
0.0289412
0.0286331
0.0276751
0.0280442
0.0284846
0.0289715
0.0297001
0.0306319
0.0310145
0.0319479
0.0323775
0.0330487
0.0336448
0.032795
0.0319167
0.0314479
0.0306639
0.0301486
0.0295193
0.0301291
0.030793
0.0312278
0.0318677
0.0324658
0.0332798
0.0341636
0.0347072
0.0353894
0.0355857
0.036422
0.0371964
0.0373015
0.0382321
0.0380812
0.0376408
0.0387922
0.0391379
0.0401752
0.0399452
0.0394033
0.0383284
0.0398384
0.0383794
0.0401486
0.0417997
0.0402145
0.042148
0.0439201
0.0450919
0.0434751
0.0442602
0.0427817
0.0413338
0.0419882
0.0406845
0.0411253
0.0411774
0.0421707
0.0422983
0.0434441
0.0433209
0.0446511
0.0459737
0.0457616
0.0472963
0.0467921
0.0457954
0.0442301
0.0417003
0.0316091
0.0385324
0.0228263
0.0130803
0.00664204
0.00325816
0.00159012
0.00188631
0.00365203
0.00525905
0.00303646
0.0015525
0.0018366
0.00355216
0.00613398
0.00542856
0.00872223
0.0136853
0.0180416
0.0114798
0.0131817
0.00794406
0.00430291
0.0022587
0.00182599
0.00319693
0.00260206
0.00346055
0.00163245
0.00185137
0.00489907
0.00248839
0.00380612
0.0018731
0.00222279
0.00403088
0.00725227
0.0120747
0.0210162
0.0108206
0.0188922
0.0291589
0.0369125
0.0463664
0.0437515
0.0466934
0.0439251
0.0462514
0.0486302
0.0510606
0.0493413
0.0520031
0.0492225
0.0440102
0.0262752
0.0157961
0.00971234
0.00574064
0.00343896
0.00182375
0.00211975
0.00291316
0.00652923
0.00351359
0.00206605
0.00250876
0.00372688
0.00183996
0.00205822
0.00518991
0.00272763
0.00406626
0.00207432
0.00242246
0.00426336
0.00748583
0.00952779
0.00591542
0.0036461
0.00196302
0.00223961
0.00414644
0.00665487
0.00603539
0.00298412
0.00353022
0.00199499
0.00235898
0.00324936
0.00511293
0.00828206
0.00472181
0.0135926
0.0120564
0.0182713
0.0298776
0.0188834
0.0206982
0.0102689
0.00649466
0.00416048
0.00241243
0.0027542
0.00376553
0.00210558
0.00234158
0.00398099
0.00720868
0.00468671
0.00658348
0.0118807
0.0145948
0.00880953
0.00517295
0.00329046
0.003977
0.002195
0.00236765
0.00559075
0.00290796
0.0040576
0.00224937
0.0024852
0.00406129
0.00719273
0.016549
0.00853296
0.00527184
0.00343798
0.004111
0.00230415
0.00246841
0.00568902
0.00300401
0.00413471
0.00235454
0.00258572
0.00414675
0.00733395
0.0119161
0.0226831
0.0118955
0.0425356
0.0347749
0.0258975
0.0152138
0.011471
0.0462697
0.0387483
0.0542219
0.049669
0.0414522
0.0243385
0.0134471
0.0103818
0.0182039
0.00806491
0.00460224
0.00475994
0.012159
0.0165494
0.0345623
0.0479933
0.0524871
0.0559568
0.0514672
0.0560321
0.0601224
0.0651093
0.0613788
0.0675509
0.0600338
0.0677569
0.0553129
0.0640872
0.078032
0.0857456
0.0754278
0.0782253
0.0709874
0.07199
0.0666988
0.0621824
0.0583156
0.055008
0.0563143
0.0535967
0.0543349
0.0520353
0.0498633
0.0477203
0.0485799
0.0504616
0.0524439
0.0524903
0.0506346
0.0489006
0.0488738
0.0473731
0.047142
0.04584
0.0446102
0.0442668
0.0431948
0.0426224
0.041707
0.0408179
0.0399595
0.0391123
0.0386332
0.0379177
0.0372093
0.036592
0.0360005
0.0351937
0.034652
0.0337878
0.0330582
0.0337329
0.0343766
0.0350158
0.0357664
0.0364114
0.03712
0.0378747
0.0386018
0.0393676
0.0401455
0.0394004
0.0387711
0.0379071
0.0373943
0.0365262
0.0357378
0.0352752
0.0344645
0.0341477
0.0333257
0.0325589
0.0323074
0.0315254
0.0314235
0.0306151
0.0298632
0.0291623
0.0285175
0.0279338
0.0273972
0.0269293
0.0265011
0.0259541
0.0254969
0.0251636
0.0251258
0.0245355
0.0246956
0.0241085
0.0235493
0.0230506
0.0225836
0.0221761
0.0223192
0.0218897
0.0222743
0.0218657
0.0215028
0.0211945
0.021763
0.0220834
0.0224494
0.0228559
0.0233046
0.0227309
0.0232243
0.0227858
0.0233022
0.0237499
0.0242938
0.0237827
0.0244048
0.0239449
0.0235219
0.0231442
0.0228067
0.0225167
0.0222738
0.0220969
0.021986
0.0219548
0.0220227
0.0222076
0.0225319
0.0230249
0.0237248
0.0246762
0.0259458
0.0276103
0.0288607
0.0272124
0.0259338
0.0274846
0.0288243
0.0305148
0.0323452
0.0305592
0.0291173
0.027969
0.0264317
0.0249575
0.0242251
0.0236951
0.0233276
0.0245603
0.0250085
0.025622
0.027065
0.0263667
0.0258436
0.0271374
0.0277493
0.028537
0.0295328
0.0307735
0.0323064
0.0341851
0.035981
0.0340061
0.032375
0.033868
0.0355873
0.0376488
0.0391745
0.0370381
0.0352416
0.0337379
0.0324418
0.0310365
0.0299465
0.0290688
0.0283726
0.0295342
0.0303075
0.0312668
0.0324868
0.031454
0.0306105
0.0299315
0.0289217
0.0278329
0.0266771
0.0254664
0.0242517
0.0230928
0.022978
0.0229547
0.0230148
0.0239915
0.0239823
0.0240664
0.0252135
0.0250673
0.0250132
0.0250389
0.0240792
0.0231429
0.0233407
0.0235931
0.0239026
0.0247161
0.0244482
0.0242341
0.0251366
0.0252975
0.025516
0.0262926
0.0261214
0.026012
0.0259708
0.026006
0.0261272
0.026346
0.0274282
0.0271411
0.026957
0.0278555
0.0280984
0.0284489
0.0293964
0.0289877
0.0286905
0.0284927
0.0277078
0.0268638
0.0268515
0.0269118
0.0270377
0.0277424
0.0276591
0.0276452
0.0283836
0.0283546
0.0283983
0.0289978
0.0289903
0.0290584
0.0292097
0.0294531
0.0297994
0.0302608
0.0308522
0.031591
0.0324975
0.0335959
0.0349147
0.036487
0.0383515
0.0405532
0.0417809
0.0395222
0.0375982
0.0385721
0.0405474
0.0428555
0.0437703
0.0414205
0.0394017
0.0376731
0.0368876
0.0359658
0.0345875
0.033431
0.0324688
0.0332398
0.0342507
0.0354576
0.0361994
0.0349497
0.0338974
0.034421
0.0355065
0.0367905
0.0382992
0.0400629
0.0421165
0.0444997
0.0450147
0.0426072
0.0405287
0.0408269
0.0429198
0.0453411
0.0390235
0.0387397
0.0372059
0.0358974
0.0347881
0.0350294
0.0361525
0.0374752
0.0340833
0.0338555
0.0335113
0.0330196
0.0324016
0.031677
0.0310355
0.0305271
0.0301369
0.0307374
0.0311663
0.0317162
0.0322965
0.031711
0.0312486
0.0308966
0.0304168
0.0298525
0.0296633
0.02956
0.0295349
0.0300047
0.030059
0.0301937
0.0306442
0.0304821
0.0304023
0.0307139
0.0308149
0.0309996
0.0312761
0.0316538
0.0321435
0.0327578
0.03308
0.0324448
0.0319353
0.0321261
0.0326474
0.0332949
0.0317186
0.031539
0.0312449
0.0310437
0.0309274
0.0310771
0.0312028
0.0314139
0.0310299
0.0308889
0.0306897
0.0303978
0.030024
0.0295813
0.0290746
0.0285084
0.027889
0.0272236
0.02652
0.0257863
0.02503
0.02426
0.0246593
0.025097
0.0255702
0.0249076
0.0254429
0.0248359
0.0243043
0.0238477
0.0244335
0.0250528
0.0256992
0.0253318
0.0259974
0.0257427
0.0257083
0.0263182
0.026477
0.0270402
0.0276682
0.027664
0.0269631
0.0271153
0.0264147
0.0266969
0.0270771
0.0263757
0.0268189
0.0261448
0.0255021
0.024891
0.0254128
0.0260226
0.0266699
0.0273423
0.0280455
0.0275261
0.0282685
0.0278061
0.0274236
0.0281823
0.0278596
0.028637
0.0283991
0.0283401
0.0290666
0.0298379
0.030654
0.0308586
0.0300006
0.0291813
0.0294449
0.0302828
0.0311529
0.0315199
0.0306316
0.0297819
0.0289667
0.0293662
0.0285698
0.0290388
0.029533
0.028774
0.0292836
0.0285702
0.0278855
0.02723
0.0266041
0.0260086
0.0266161
0.0260768
0.0267063
0.0262298
0.0257901
0.0253899
0.0261054
0.0264688
0.0268749
0.0273208
0.027805
0.0272183
0.027764
0.0271875
0.0277908
0.0283437
0.0288805
0.0283245
0.0288646
0.0283702
0.0279141
0.027499
0.0271265
0.0267993
0.0274647
0.027757
0.0280973
0.0286629
0.0283531
0.028094
0.0286797
0.0289077
0.0291888
0.0295198
0.0290206
0.0284829
0.0289118
0.0293817
0.0298912
0.0293972
0.0299668
0.0294719
0.0289571
0.0284258
0.0290916
0.0297883
0.0305164
0.0300279
0.0308018
0.0303201
0.0298383
0.030665
0.0302005
0.0310632
0.0319576
0.0324088
0.0315219
0.0319845
0.0311371
0.0316069
0.032067
0.0312757
0.0317357
0.0309922
0.0302811
0.0296028
0.0300977
0.0307574
0.031451
0.0321781
0.0329391
0.032512
0.0333212
0.03289
0.0324429
0.0333107
0.0328628
0.0337727
0.0333263
0.03288
0.0324441
0.0320549
0.0317497
0.0315148
0.0324177
0.0322757
0.0331815
0.0331543
0.0340492
0.0350028
0.0350387
0.0359848
0.0361486
0.0370944
0.0381029
0.0383343
0.0393494
0.0397159
0.0402775
0.0409864
0.0418997
0.0429002
0.0436152
0.0446855
0.0453826
0.0465686
0.0478528
0.0485235
0.0499791
0.0504821
0.0521998
0.0515443
0.0507181
0.0492319
0.0484641
0.0471089
0.0458471
0.0451718
0.0439904
0.0434206
0.042287
0.0412395
0.0407412
0.0418447
0.043024
0.0442731
0.0446359
0.0459286
0.046444
0.0477972
0.0492218
0.0499103
0.0514287
0.052301
0.0532251
0.0540409
0.0545032
0.0546063
0.0569941
0.0568888
0.0597712
0.0593998
0.062969
0.0630344
0.0625792
0.0596439
0.0590927
0.0566996
0.0560049
0.0581078
0.0603012
0.0616616
0.0643323
0.065784
0.0667042
0.0670611
0.0717836
0.0772734
0.0783556
0.0861038
0.0873608
0.0992237
0.0999201
0.0927564
0.0766831
0.0528328
0.0283264
0.0155734
0.00932181
0.00530248
0.00350873
0.00413106
0.00233566
0.00244341
0.00561469
0.00272954
0.00359657
0.00697068
0.00394074
0.00251272
0.002842
0.00363202
0.00533913
0.00831525
0.00510027
0.0175682
0.011844
0.0160872
0.0247883
0.0112819
0.00655935
0.0044449
0.00268676
0.00290228
0.00353226
0.00701573
0.00393703
0.00253482
0.00282468
0.00346545
0.00495757
0.00832755
0.00489741
0.0103461
0.00598525
0.00394028
0.00501133
0.00277385
0.00286433
0.00634116
0.00596319
0.00319607
0.00428211
0.00828083
0.00450139
0.00305547
0.00365461
0.00435059
0.00601754
0.0103172
0.00595505
0.0278286
0.0125165
0.00752173
0.00543394
0.00389073
0.00415036
0.00590244
0.00827827
0.00755862
0.00452128
0.00459238
0.00712449
0.00445643
0.00441474
0.00629031
0.011593
0.0199548
0.0397237
0.018336
0.0450214
0.0283292
0.014977
0.00859072
0.00577521
0.00665382
0.00452349
0.00452951
0.00985257
0.00446617
0.00792924
0.00428821
0.00263225
0.00247226
0.00329961
0.00541587
0.00362968
0.00252407
0.00304664
0.00379067
0.00544871
0.00811714
0.00482859
0.00624975
0.00640238
0.00538435
0.00377316
0.00465422
0.00515691
0.00459244
0.00388572
0.00395791
0.0036657
0.00343167
0.00250369
0.00261976
0.00246335
0.0021686
0.0018716
0.00190199
0.00209415
0.0019293
0.00164698
0.0019967
0.00263991
0.00379326
0.00292111
0.00221664
0.00217905
0.00284548
0.00244186
0.00269933
0.00328878
0.00350595
0.00361566
0.00456202
0.00502491
0.00552648
0.00362399
0.00391186
0.00355917
0.00460091
0.00584556
0.00547574
0.00543996
0.00607059
0.00721524
0.00886157
0.00707037
0.00639501
0.00496844
0.0103034
0.0126156
0.0146922
0.0173261
0.0197587
0.0222328
0.0248504
0.0238714
0.0208346
0.017847
0.0162366
0.0196826
0.0230981
0.0227547
0.0190318
0.0152446
0.0115654
0.00885485
0.00877569
0.0108567
0.00748299
0.00612131
0.00765568
0.0119783
0.00907358
0.0119129
0.00710722
0.00550403
0.00644006
0.00861361
0.00863372
0.00885022
0.0146321
0.0184665
0.0212809
0.0298422
0.026669
0.0190409
0.0238015
0.0332645
0.0564426
0.0737585
0.0571755
0.0426058
0.0232804
0.0135836
0.0155307
0.0246061
0.0174108
0.032506
0.016107
0.0123677
0.0603593
0.0481547
0.0386975
0.066383
0.0795604
0.0958814
0.114366
0.0749901
0.0933885
0.135709
0.127987
0.114013
0.0626797
0.0618717
0.0583555
0.0973791
0.183022
0.159132
0.137369
0.117526
0.0973523
0.115888
0.152212
0.182559
0.159231
0.14467
0.119834
0.113564
0.124541
0.119627
0.0988121
0.134354
0.207275
0.129015
0.078322
0.0578221
0.0599593
0.0714102
0.0945288
0.0801761
0.0691811
0.0621936
0.0633763
0.0678323
0.0733812
0.082603
0.0955158
0.104854
0.103532
0.09522
0.089455
0.0834657
0.0796747
0.0752917
0.0708133
0.069185
0.0725202
0.0751505
0.0706012
0.0692207
0.0669603
0.0644645
0.0624806
0.0605673
0.0587754
0.0568873
0.0550143
0.0539611
0.0556555
0.0573144
0.0588453
0.0601498
0.0621082
0.0632357
0.0659782
0.0667536
0.0638739
0.0619023
0.061163
0.0597338
0.0586842
0.0574587
0.0560674
0.0545582
0.0529928
0.0521944
0.0506966
0.0501464
0.0486998
0.0472873
0.046951
0.0455857
0.0454116
0.0440831
0.0428065
0.0415886
0.0404348
0.0403117
0.0391772
0.0391754
0.0380561
0.0369934
0.0370586
0.0360039
0.0361686
0.0351269
0.0341289
0.0343438
0.0333627
0.0336311
0.0326728
0.0329954
0.0339778
0.0349973
0.0346268
0.0356641
0.0353599
0.0364149
0.0375128
0.0372498
0.0383671
0.0381614
0.0393112
0.0405017
0.040346
0.041567
0.0415051
0.0427523
0.0428322
0.0430033
0.0417291
0.0419899
0.0407362
0.0395297
0.0398434
0.0386553
0.0390249
0.0378673
0.036747
0.0371412
0.0360528
0.0364679
0.0354125
0.0343912
0.033402
0.0338354
0.0348217
0.0358413
0.0362733
0.0352579
0.0342761
0.034715
0.0356899
0.0366986
0.0377413
0.0373223
0.0368946
0.0379824
0.037557
0.0386816
0.0382652
0.0394247
0.0398417
0.0402637
0.0391052
0.039525
0.0384061
0.0388191
0.0399324
0.041082
0.0406799
0.0418711
0.0414584
0.0410378
0.04062
0.0402175
0.0414468
0.0410688
0.0423308
0.0436276
0.0432832
0.0446112
0.0443209
0.0441347
0.044049
0.0453863
0.0467577
0.0467828
0.0481859
0.0483573
0.0497879
0.0512259
0.0516041
0.053046
0.0536782
0.0551084
0.0544484
0.0540478
0.0526497
0.0524492
0.0510302
0.0496051
0.0495653
0.0481516
0.0482544
0.0468459
0.0454699
0.0456762
0.0470638
0.0484743
0.0487752
0.0473598
0.0459704
0.046322
0.0449587
0.0453473
0.0440123
0.0427119
0.0431193
0.0418516
0.0422701
0.0426895
0.0439575
0.0435388
0.0448437
0.0444226
0.0457612
0.0471342
0.0467157
0.0481162
0.0477164
0.0491392
0.0495474
0.0499807
0.048541
0.0489739
0.0475616
0.0461848
0.0466044
0.0452624
0.0456681
0.0443649
0.0430993
0.0434919
0.0422682
0.0426444
0.0414645
0.0403216
0.0392154
0.038145
0.0371101
0.0361097
0.0351436
0.0342107
0.0346343
0.0337457
0.0341639
0.034563
0.033734
0.0341266
0.0333463
0.0326007
0.0318899
0.0312139
0.0305728
0.031025
0.0304392
0.0308838
0.0303565
0.0298695
0.0294236
0.0298982
0.0303213
0.0307873
0.0312949
0.0318432
0.0314502
0.0320547
0.0316475
0.0323063
0.0326967
0.0330569
0.0324307
0.0327708
0.0321991
0.0316682
0.0311788
0.0307325
0.0303305
0.0299753
0.029669
0.0294145
0.029215
0.0296937
0.0298671
0.0300975
0.0304696
0.0302611
0.0301111
0.0304628
0.0305921
0.0307815
0.0310273
0.0307331
0.0303813
0.0307156
0.031098
0.0315262
0.0318253
0.0314134
0.0310486
0.0313263
0.0316757
0.0320733
0.0322622
0.0318759
0.031539
0.0312536
0.0310225
0.0308488
0.0307364
0.0309223
0.0310224
0.0311848
0.031303
0.0311477
0.0310551
0.0315172
0.0314055
0.0316813
0.0320094
0.0323874
0.0324828
0.0321098
0.0317871
0.0329041
0.0328134
0.0326954
0.0325172
0.0322824
0.0319985
0.0325137
0.0330705
0.0336681
0.0333821
0.0340324
0.0337211
0.0333757
0.0330009
0.0337313
0.0344973
0.0352991
0.0349419
0.0357924
0.0354265
0.0350401
0.0359507
0.0355564
0.0365126
0.0375034
0.0378763
0.0368958
0.0372586
0.0363249
0.0366785
0.0370108
0.0361369
0.0364578
0.0356324
0.0348436
0.0340914
0.0344228
0.0351619
0.0359384
0.0362131
0.0354481
0.0347211
0.0349825
0.0343056
0.0345382
0.0339121
0.0333269
0.0327833
0.033006
0.0335383
0.0341129
0.0347291
0.0353862
0.0352045
0.0359105
0.0356984
0.036453
0.0366559
0.0368212
0.0360837
0.0362121
0.0355214
0.0348717
0.0342635
0.0336973
0.0331743
0.0332854
0.0338021
0.0343623
0.0344407
0.0338842
0.0333716
0.0350399
0.0349651
0.0356097
0.0362956
0.0370223
0.0369432
0.0377146
0.0375985
0.0374406
0.0372462
0.0370161
0.0367521
0.0376033
0.03732
0.0382194
0.0379213
0.0376006
0.0385591
0.0382282
0.039234
0.0388924
0.0385293
0.0395911
0.0406893
0.0418244
0.042161
0.0410342
0.0399449
0.0402767
0.0413568
0.0424749
0.0427673
0.041658
0.0405873
0.0395545
0.0398539
0.0388689
0.0391564
0.0394193
0.0384922
0.0387365
0.0378571
0.0380781
0.0389488
0.0398586
0.0396544
0.0406114
0.0403849
0.0401314
0.0411449
0.0408769
0.0419384
0.0430392
0.0432902
0.0421976
0.0424339
0.0413895
0.0416079
0.0417972
0.0408079
0.0409729
0.0400303
0.0391276
0.0382644
0.0384156
0.0392724
0.0401691
0.0411061
0.0420838
0.0419559
0.0429798
0.0428271
0.0426447
0.0437224
0.0435188
0.0446448
0.0444233
0.0441798
0.0439159
0.0436315
0.0433258
0.0429971
0.0442079
0.0438622
0.0451182
0.0447533
0.0460531
0.0473918
0.0470093
0.0483888
0.0479835
0.0493998
0.0508532
0.0504213
0.0519036
0.0514527
0.0510082
0.050589
0.0502153
0.0499068
0.0496822
0.0511253
0.0510011
0.0524415
0.0538825
0.0538663
0.0552761
0.0554136
0.0557926
0.0564505
0.0576882
0.0588309
0.0599066
0.0606483
0.061503
0.0624766
0.0641213
0.0667447
0.0706801
0.0761046
0.0826862
0.0825006
0.0924734
0.0893928
0.0816939
0.0737778
0.0787657
0.0720879
0.0748375
0.0695946
0.0662551
0.0657579
0.0680952
0.0669431
0.0693919
0.0676391
0.0699315
0.0743087
0.0696384
0.0667279
0.0639419
0.0643526
0.0661264
0.0676967
0.0666545
0.0657949
0.0646822
0.0650211
0.065632
0.0660317
0.0663493
0.0655961
0.0655493
0.0647544
0.0644085
0.0642221
0.0630285
0.0636473
0.0643164
0.0649642
0.0651729
0.065525
0.0656782
0.0656255
0.0654123
0.0658648
0.0657462
0.065997
0.0655312
0.0656864
0.0649367
0.0641103
0.0632353
0.0623575
0.0620142
0.06096
0.0607191
0.0595136
0.0583082
0.0570737
0.0567503
0.058078
0.0593883
0.0594357
0.0580582
0.0566715
0.0567558
0.0553205
0.0555005
0.0540361
0.0525769
0.0528227
0.0513573
0.0516769
0.0520638
0.0535621
0.053158
0.0546569
0.0543013
0.055791
0.0572904
0.0569693
0.0584411
0.0581886
0.0596178
0.0599142
0.0603128
0.0587982
0.0592457
0.0577019
0.0561719
0.056624
0.0550825
0.0555568
0.0540138
0.0524973
0.0529563
0.0544911
0.0560567
0.0576532
0.0571259
0.0587207
0.0581859
0.0597675
0.0613687
0.0608027
0.0623728
0.0618334
0.0613866
0.0610408
0.0608034
0.0606876
0.0619707
0.0619127
0.0630826
0.0630696
0.0640933
0.0642144
0.0644546
0.0632285
0.06349
0.0621564
0.0624545
0.0638574
0.065251
0.0648025
0.0660972
0.0656482
0.0652986
0.0650576
0.0659602
0.066812
0.0663587
0.0669834
0.0663932
0.0667524
0.0659299
0.065111
0.0642792
0.0633676
0.0622999
0.0609141
0.0590161
0.0564052
0.052706
0.0483101
0.0440995
0.0408319
0.0378241
0.0286173
0.0331894
0.0302851
0.0257098
0.0211807
0.0171128
0.0168945
0.0134302
0.0153486
0.0129214
0.0117086
0.0153974
0.0193186
0.0231136
0.0242221
0.020394
0.0165407
0.0186382
0.0222315
0.0258926
0.0297024
0.0281821
0.0270293
0.0265499
0.0266029
0.0270228
0.0276219
0.0305494
0.0336495
0.0369402
0.0373201
0.0337229
0.0302982
0.0302029
0.0339301
0.0378108
0.0418714
0.041114
0.0404423
0.0441778
0.0481672
0.0524292
0.0538997
0.0493838
0.0451281
0.0461358
0.0506251
0.055358
0.0567704
0.0518922
0.0472335
0.0427776
0.0385055
0.0343952
0.0304193
0.0310552
0.0351788
0.0394274
0.0404741
0.0362166
0.0321281
0.0335437
0.0375251
0.0415567
0.0457232
0.0448499
0.043816
0.0483622
0.0530801
0.0579807
0.0587554
0.0539889
0.0493552
0.0500427
0.0544546
0.0589537
0.063542
0.0636607
0.0630765
0.0618857
0.0603535
0.0586944
0.0569824
0.0552096
0.0533249
0.0510944
0.0485784
0.0458393
0.049555
0.052422
0.0565704
0.0536236
0.0580613
0.0610523
0.0640896
0.0594184
0.0551028
0.0576548
0.0623326
0.0674076
0.0729336
0.0692047
0.0658978
0.0627388
0.0657501
0.0711594
0.0769443
0.0687041
0.0718241
0.0833778
0.0878667
0.0810844
0.0748778
0.0789323
0.0854027
0.0923882
0.0999673
0.0953014
0.0905535
0.0751305
0.0786418
0.0985359
0.107392
0.0823767
0.08635
0.117223
0.122035
0.112318
0.103436
0.108212
0.117207
0.127101
0.138152
0.132635
0.127681
0.0905615
0.0950006
0.134575
0.142168
0.0998642
0.1052
0.150544
0.172211
0.157277
0.144245
0.150698
0.164717
0.180463
0.189483
0.173212
0.158539
0.145238
0.133287
0.122594
0.112968
0.104236
0.096266
0.0889503
0.0821973
0.0759407
0.0701472
0.0647881
0.0598224
0.0618483
0.0670548
0.0726396
0.0750171
0.0692174
0.0637903
0.0656356
0.0712366
0.0772
0.0835802
0.0812427
0.0786481
0.0851317
0.0921517
0.0997888
0.103152
0.0952333
0.0879574
0.0904395
0.0978437
0.105859
0.107045
0.0993018
0.0920566
0.0852751
0.0789132
0.0729232
0.0672601
0.0683829
0.0739216
0.0797187
0.0793224
0.0739299
0.0687143
0.0682274
0.073021
0.0779342
0.0829773
0.0849058
0.0858025
0.0921986
0.0989225
0.105972
0.102828
0.0966694
0.090689
0.088156
0.0934677
0.0988988
0.104424
0.109127
0.113323
0.115302
0.114548
0.111805
0.108143
0.117328
0.127472
0.138716
0.143085
0.131682
0.121284
0.123961
0.134135
0.145083
0.156799
0.15557
0.151185
0.164948
0.18009
0.19683
0.200118
0.184008
0.169192
0.16924
0.182322
0.195925
0.182957
0.173093
0.163004
0.152896
0.142949
0.133306
0.124068
0.120923
0.128692
0.136529
0.12825
0.121908
0.11551
0.110012
0.115629
0.121252
0.126872
0.134473
0.144313
0.151918
0.15922
0.166126
0.152141
0.146413
0.140533
0.132505
0.138194
0.144008
0.141184
0.134839
0.128775
0.122928
0.117249
0.111703
0.106273
0.100957
0.0957625
0.0906995
0.0857757
0.0809923
0.0763439
0.0718197
0.0674048
0.0630811
0.0588305
0.0546555
0.0505765
0.0466081
0.0426912
0.0388352
0.0350277
0.0313635
0.0279046
0.0246968
0.0216013
0.0187919
0.0225495
0.0210184
0.0252866
0.0296466
0.0303158
0.0263779
0.0282158
0.0248487
0.0274821
0.0303413
0.0329302
0.0304259
0.033526
0.0317107
0.035329
0.0343531
0.0341038
0.0350133
0.0379016
0.0428378
0.0398424
0.0385808
0.0429616
0.0445226
0.0476197
0.051829
0.0488183
0.047133
0.0464549
0.0424929
0.0384341
0.0390412
0.0401893
0.0367874
0.0386387
0.0356863
0.0381248
0.0356761
0.0334139
0.0366499
0.0400956
0.0437236
0.0449591
0.0417234
0.0386269
0.0408069
0.0436755
0.0467091
0.0498537
0.048409
0.0474624
0.0512382
0.0549868
0.0588138
0.0593413
0.0556761
0.0520226
0.0531487
0.0566904
0.0603777
0.0617979
0.0582393
0.0549246
0.0517806
0.0487627
0.0459
0.0432395
0.0408042
0.0436984
0.0417699
0.0450307
0.0436844
0.0427994
0.0465365
0.0472089
0.0483574
0.049898
0.046752
0.048789
0.045921
0.0483934
0.0510907
0.053646
0.0510966
0.0539312
0.0517705
0.0548027
0.0530734
0.0516838
0.0506925
0.0501762
0.0502358
0.0510035
0.0526427
0.0553113
0.058111
0.05593
0.0544899
0.057554
0.0586825
0.0603111
0.0620706
0.0609784
0.0602088
0.0598256
0.0569625
0.0537563
0.0536458
0.0540703
0.0549494
0.0580987
0.05728
0.0568866
0.059859
0.0603004
0.0611206
0.0639815
0.0631164
0.0625827
0.062385
0.0625056
0.062911
0.0635375
0.0648179
0.0646034
0.0645363
0.0663563
0.066124
0.0660003
0.0671181
0.0675292
0.0680285
0.0686575
0.0667475
0.0646752
0.0650637
0.0657286
0.0666809
0.0692311
0.0681605
0.067339
0.0694525
0.0704433
0.0716517
0.0730931
0.0705619
0.0679235
0.0651677
0.0622908
0.0592984
0.0562175
0.0578309
0.0597551
0.056829
0.0591277
0.0563482
0.0590007
0.0564174
0.0539872
0.0570618
0.0603207
0.0637362
0.0659802
0.0625889
0.0593996
0.0618837
0.0649967
0.0683372
0.0708018
0.0675222
0.0644826
0.0616828
0.0644333
0.0619618
0.0648193
0.0626855
0.0608379
0.063788
0.0655898
0.0676807
0.0700501
0.0672271
0.0699007
0.0671603
0.070139
0.0733676
0.0760239
0.0728343
0.0755941
0.0726901
0.0755116
0.0728864
0.0705315
0.0684542
0.0666629
0.0694538
0.0712669
0.0733575
0.0761458
0.0740197
0.0721578
0.0747768
0.0767072
0.0788846
0.0813053
0.0785316
0.0757193
0.0783453
0.0812261
0.078399
0.0815391
0.078755
0.0821633
0.0794633
0.0768437
0.0743213
0.0719035
0.0695771
0.0673635
0.0655649
0.0641156
0.0630829
0.0627933
0.0668604
0.0710377
0.0753488
0.0753303
0.0710728
0.0669888
0.0679332
0.0719575
0.0762385
0.080739
0.0797803
0.0798164
0.0844558
0.0892766
0.0942836
0.0944286
0.0893253
0.0844432
0.085482
0.0904598
0.0956686
0.0974236
0.0921703
0.0871452
0.0823472
0.0778175
0.0735613
0.0694859
0.0713074
0.0754377
0.0797604
0.0818223
0.0774593
0.0733869
0.0756926
0.0797288
0.0839844
0.0884462
0.0863801
0.0843464
0.0891001
0.0940897
0.0993264
0.10127
0.0961084
0.0911197
0.0931825
0.0981082
0.103153
0.108395
0.106551
0.104724
0.102877
0.101098
0.0997507
0.0994773
0.104855
0.110418
0.116171
0.116992
0.111034
0.105287
0.106735
0.112574
0.11861
0.124848
0.123171
0.122133
0.128332
0.134808
0.141602
0.143262
0.13628
0.129591
0.131304
0.138002
0.144961
0.146328
0.13948
0.132878
0.126503
0.120328
0.114334
0.108516
0.11029
0.116021
0.121913
0.123416
0.117632
0.112008
0.113797
0.119287
0.124965
0.130873
0.129386
0.12798
0.134245
0.140738
0.147478
0.148645
0.141977
0.135562
0.136991
0.143364
0.149994
0.151596
0.144974
0.13861
0.132549
0.126721
0.121043
0.115576
0.110275
0.105102
0.10014
0.0953519
0.0907138
0.0862854
0.082071
0.0780777
0.0805609
0.0845099
0.0886781
0.0911647
0.0870487
0.0831427
0.0858061
0.0896673
0.0937292
0.0979757
0.0954745
0.093052
0.0976132
0.102339
0.107236
0.109445
0.104623
0.0999644
0.102396
0.106985
0.111745
0.114132
0.109419
0.104889
0.100531
0.0963459
0.0923396
0.0885253
0.0849196
0.0877042
0.0843504
0.0871615
0.0840504
0.0811697
0.0839626
0.0868469
0.0899468
0.0932507
0.0904894
0.0940202
0.0912721
0.0950387
0.0989907
0.101645
0.0977417
0.100432
0.0967482
0.0994423
0.0959699
0.0926851
0.0895935
0.0867034
0.0840235
0.0815619
0.0793246
0.0773143
0.0755298
0.0739652
0.0726094
0.071446
0.0704532
0.0696037
0.0688659
0.0682056
0.0675887
0.0684527
0.0676353
0.06835
0.0673514
0.06634
0.0668165
0.0679713
0.0691266
0.0699629
0.0686665
0.0673818
0.0680311
0.0666398
0.0672738
0.0657971
0.0643264
0.0628572
0.0633602
0.0648946
0.0664395
0.0679989
0.0695777
0.0687627
0.0702707
0.0694333
0.070856
0.0718058
0.0728167
0.0711815
0.0721689
0.0704761
0.0688125
0.0671738
0.0655563
0.0639568
0.0646324
0.06299
0.0636609
0.0619876
0.0603411
0.0609392
0.0592805
0.0598384
0.0581808
0.056559
0.0549724
0.0534207
0.0538722
0.052344
0.0527607
0.0512641
0.049807
0.0501877
0.0487698
0.0491225
0.0477477
0.0464132
0.0467468
0.0454576
0.045772
0.0445292
0.0448274
0.0460632
0.0473399
0.0470549
0.0483788
0.0480762
0.0494467
0.0508592
0.0505384
0.0519961
0.0516462
0.0531459
0.0546876
0.0542973
0.0558745
0.0554384
0.057043
0.0574932
0.0579012
0.0562724
0.0566301
0.0550408
0.0534966
0.0538143
0.0523147
0.0526057
0.0511531
0.0497445
0.0500191
0.0486581
0.0489171
0.047604
0.0463334
0.0451043
0.0453611
0.0465838
0.0478489
0.0480744
0.0468145
0.0455978
0.0458129
0.047024
0.0482791
0.0495794
0.0493787
0.0491573
0.0505103
0.0502738
0.0516753
0.0514239
0.0528738
0.0531228
0.0533548
0.051909
0.0521248
0.0507284
0.050926
0.0523202
0.0537636
0.0535694
0.0550638
0.0548494
0.0546179
0.05437
0.0541037
0.0556483
0.0553592
0.0569508
0.0585904
0.0582655
0.0599486
0.0595752
0.0591543
0.0586866
0.0603703
0.062095
0.0615324
0.0632641
0.06263
0.0643538
0.0661118
0.065362
0.0670923
0.0662974
0.067987
0.0688535
0.069736
0.0679053
0.068697
0.0668449
0.0650344
0.0656728
0.063862
0.0644046
0.0626086
0.060859
0.0612959
0.0630647
0.0648836
0.0667546
0.0662489
0.0681435
0.0675291
0.0694328
0.0713861
0.0705925
0.0725334
0.0716054
0.0706473
0.0697035
0.0714497
0.0732287
0.0750441
0.0738957
0.075662
0.0744903
0.0733768
0.0723099
0.0712834
0.0702974
0.069354
0.0703833
0.0692883
0.0701682
0.0711206
0.0726066
0.0714597
0.072754
0.0715005
0.0726423
0.0738066
0.0753585
0.0740545
0.0755358
0.0740772
0.0754893
0.0738474
0.0721739
0.0733549
0.0746876
0.076192
0.0783467
0.0766987
0.0752047
0.0770088
0.0786525
0.0804346
0.0824508
0.0805466
0.0787676
0.0771018
0.0786793
0.0769785
0.0784035
0.0766653
0.0749932
0.0762101
0.0779844
0.079822
0.081732
0.0802185
0.0821207
0.0804731
0.0823712
0.0843838
0.0862259
0.08412
0.085807
0.0837239
0.0853242
0.0832551
0.0812627
0.0793384
0.077474
0.0788014
0.0769001
0.0781959
0.076247
0.0743414
0.0724758
0.0735156
0.0754688
0.0774678
0.0786546
0.0765614
0.0745222
0.0754529
0.0733918
0.0741558
0.0720937
0.0700908
0.0706638
0.0686803
0.0691446
0.0671934
0.0653009
0.0634643
0.0616809
0.0620208
0.0602798
0.0605779
0.0588836
0.057241
0.057508
0.0559142
0.0561621
0.0563943
0.0579916
0.0577574
0.0594057
0.0591533
0.0608521
0.0626068
0.062326
0.0641303
0.0638156
0.0656665
0.0659937
0.0662952
0.0644201
0.064693
0.0628707
0.0611093
0.0613521
0.0596434
0.0598647
0.0582093
0.0566098
0.0568046
0.0552578
0.0554265
0.0539332
0.0524915
0.0510997
0.0497564
0.0484601
0.0472097
0.0460039
0.0448418
0.0450117
0.0438983
0.0440453
0.0441634
0.0431027
0.0431912
0.0421763
0.0412027
0.0402701
0.039378
0.0385262
0.0385976
0.0377897
0.0378524
0.0370877
0.0363639
0.0356812
0.0386577
0.0395038
0.039446
0.040335
0.0403906
0.0413183
0.0412648
0.0422357
0.0432481
0.0443024
0.0442481
0.0453476
0.0452667
0.0451533
0.0463047
0.0461682
0.0473688
0.0486146
0.0487415
0.0475004
0.0476046
0.0464134
0.0464906
0.0465398
0.0453995
0.0454454
0.0443502
0.0432977
0.0422872
0.0465838
0.0477664
0.0477245
0.0476779
0.0489107
0.0488413
0.0501246
0.0500293
0.0499067
0.0512464
0.0526352
0.0540744
0.0541857
0.0527499
0.0513649
0.0514559
0.0528365
0.0542681
0.0543205
0.0528934
0.051517
0.0501899
0.0502306
0.0489543
0.0489941
0.0502681
0.0515895
0.0515544
0.0529273
0.0543508
0.0543804
0.0529597
0.055853
0.0558265
0.0558001
0.0557523
0.0556741
0.0555658
0.0571113
0.0569733
0.0585756
0.058406
0.0600643
0.0617821
0.0615783
0.063353
0.0631204
0.0649513
0.0668483
0.0665793
0.0685336
0.0682356
0.0679196
0.0675767
0.0695496
0.0715894
0.0711583
0.0732387
0.0727086
0.0748192
0.0770007
0.0762812
0.0784749
0.0775732
0.0797573
0.0807429
0.0816026
0.0792594
0.0799378
0.0776218
0.0753912
0.0758904
0.073701
0.0741145
0.0719749
0.0699118
0.0702457
0.0723302
0.0744949
0.076746
0.0763367
0.0786487
0.0781643
0.0805306
0.0829982
0.0823474
0.0848601
0.0840387
0.0830922
0.0820106
0.0808058
0.0795157
0.0816166
0.080192
0.0822402
0.0807536
0.0827631
0.0843459
0.0859969
0.0837751
0.085302
0.0830197
0.0843395
0.0867512
0.0892538
0.0876591
0.0900983
0.0882885
0.086516
0.0848371
0.0869839
0.089213
0.0874795
0.0897314
0.0879911
0.0902862
0.0884475
0.0865199
0.0844901
0.0823667
0.0801624
0.0778838
0.0797735
0.0818675
0.0841674
0.0866932
0.0843315
0.0821554
0.0844574
0.0867123
0.0891348
0.091727
0.0892404
0.0866715
0.0893758
0.0922748
0.0953632
0.0979789
0.0948845
0.0919715
0.0944904
0.097427
0.100541
0.103064
0.0999116
0.0969366
0.0941306
0.0914877
0.089003
0.0866721
0.0887872
0.091193
0.0937438
0.0958937
0.0932725
0.0907934
0.0927024
0.0952508
0.097943
0.100792
0.0986669
0.0964469
0.0993101
0.102343
0.105557
0.108014
0.104714
0.101603
0.10381
0.107014
0.110416
0.112765
0.10926
0.105965
0.102864
0.0999422
0.0971826
0.0945702
0.0920909
0.0939614
0.0915348
0.0934956
0.0910812
0.0887581
0.0906573
0.0931119
0.0956617
0.0979918
0.095256
0.0926278
0.0945684
0.0918564
0.0934792
0.0907139
0.0880681
0.0855309
0.0865772
0.0892289
0.0920052
0.0949186
0.0979816
0.0963752
0.0994134
0.0973994
0.100359
0.102604
0.104607
0.101207
0.102744
0.099366
0.0961644
0.0931259
0.0902375
0.0874863
0.0882775
0.0855769
0.0862094
0.0835757
0.0810587
0.0815376
0.079091
0.0794984
0.0771265
0.0748507
0.072664
0.0705602
0.0708566
0.0688153
0.0690763
0.0670984
0.0651919
0.0654073
0.063562
0.0637392
0.0619559
0.0602356
0.0603729
0.0587129
0.058816
0.0572168
0.057291
0.0588861
0.0605399
0.0604738
0.0621926
0.0620936
0.0638778
0.0657283
0.0655885
0.067507
0.0673211
0.0693073
0.0713697
0.0711297
0.0732634
0.0729771
0.0751821
0.0754823
0.0757409
0.0735127
0.0737142
0.0715659
0.0694982
0.0696414
0.0676484
0.0677429
0.0658242
0.0639751
0.0640334
0.0622548
0.0622833
0.0605733
0.0589244
0.0573341
0.0573563
0.0589423
0.0605867
0.0606033
0.0589624
0.0573797
0.0623049
0.062292
0.0640609
0.0640568
0.0658971
0.0658787
0.0677936
0.0678072
0.067802
0.0658965
0.065902
0.0640701
0.0678039
0.06978
0.0697813
0.0697907
0.0697818
0.0697346
0.071803
0.0717109
0.0738609
0.0760957
0.0759475
0.0782704
0.0780595
0.077792
0.0774776
0.0798699
0.0823662
0.0819739
0.0845611
0.0840946
0.0867714
0.0895775
0.0889702
0.0918691
0.0911115
0.0940909
0.0949176
0.095619
0.0925233
0.0930805
0.0901053
0.0872686
0.0877003
0.0849737
0.0853265
0.0827075
0.0801983
0.0804737
0.0829896
0.0856132
0.0858305
0.0832061
0.0806881
0.0808381
0.0784198
0.0785091
0.0761858
0.0739519
0.0739931
0.0718469
0.0718518
0.0718387
0.0739786
0.0739946
0.0762238
0.0762247
0.0785467
0.0809643
0.080927
0.0834451
0.0833562
0.0859801
0.0860694
0.0861106
0.0834835
0.0834848
0.0809631
0.0785448
0.0785265
0.076206
0.0761978
0.073972
0.0718345
0.0785177
0.0809379
0.0809459
0.0834708
0.0861079
0.0861168
0.0888662
0.0888527
0.088807
0.0887164
0.0885678
0.0883514
0.0880623
0.0909227
0.0905541
0.0935437
0.096678
0.0962036
0.0994846
0.0988754
0.0981272
0.0972283
0.100536
0.104028
0.107715
0.106311
0.110079
0.108192
0.105958
0.103455
0.100844
0.0983171
0.096013
0.0986464
0.0965061
0.0991836
0.10201
0.10432
0.10141
0.10399
0.101089
0.103822
0.106696
0.110085
0.106933
0.110183
0.107031
0.110224
0.107391
0.105002
0.108176
0.11155
0.115139
0.117729
0.114081
0.11064
0.11358
0.117109
0.120819
0.124646
0.120809
0.117119
0.113577
0.117314
0.113625
0.117052
0.113179
0.109481
0.111972
0.115954
0.12014
0.124531
0.121096
0.125303
0.121148
0.125116
0.129208
0.134145
0.129659
0.133899
0.12912
0.13226
0.127357
0.122691
0.118261
0.114059
0.115725
0.11161
0.112813
0.10884
0.105077
0.10151
0.102303
0.105913
0.109718
0.11038
0.106562
0.102934
0.103419
0.0999665
0.100335
0.0970499
0.0939156
0.0942018
0.0912116
0.0914254
0.0915725
0.0945571
0.0944114
0.0975351
0.0973308
0.100609
0.104047
0.103782
0.107402
0.107048
0.110864
0.111209
0.111455
0.107657
0.107844
0.104239
0.100807
0.100951
0.0976795
0.0977805
0.0946533
0.0916654
0.0917178
0.0947145
0.0978526
0.101143
0.101058
0.104498
0.104383
0.10799
0.111787
0.111638
0.115639
0.115458
0.115219
0.114883
0.114403
0.113729
0.11796
0.117007
0.121436
0.120072
0.124663
0.126115
0.127146
0.122426
0.123121
0.118644
0.119121
0.123596
0.128332
0.127855
0.132869
0.132141
0.131063
0.129509
0.134624
0.14002
0.137403
0.142782
0.138851
0.143957
0.138739
0.133409
0.128628
0.124717
0.121594
0.118954
0.116494
0.114032
0.111517
0.108965
0.106403
0.103838
0.101256
0.0986377
0.102098
0.105747
0.1031
0.106947
0.104299
0.108353
0.105729
0.10312
0.107425
0.111913
0.116598
0.11914
0.114462
0.109997
0.112604
0.117067
0.121761
0.126705
0.124052
0.121499
0.119044
0.116688
0.11443
0.112273
0.117467
0.122921
0.128572
0.130543
0.12497
0.119605
0.121833
0.127187
0.132779
0.138656
0.13642
0.134395
0.14048
0.146837
0.153456
0.155505
0.148919
0.142565
0.1448
0.15117
0.157731
0.16014
0.153584
0.147207
0.141056
0.135163
0.129541
0.124175
0.126637
0.132027
0.137683
0.14034
0.134644
0.129216
0.131912
0.137388
0.143126
0.149107
0.146294
0.143606
0.149774
0.156148
0.162682
0.165343
0.15884
0.152475
0.155293
0.161641
0.16811
0.174667
0.171946
0.169334
0.166837
0.164467
0.162281
0.16027
0.158438
0.156863
0.155557
0.154465
0.153429
0.152194
0.15056
0.148756
0.14788
0.150039
0.157783
0.172591
0.192383
0.209881
0.217656
0.215526
0.207735
0.198342
0.189495
0.159833
0.111087
0.11762
0.17019
0.18179
0.124914
0.133112
0.194797
0.260446
0.233374
0.209638
0.218806
0.242494
0.270018
0.302228
0.281789
0.209352
0.142412
0.153134
0.22612
0.245704
0.165649
0.180461
0.268858
0.365748
0.333148
0.305467
0.341031
0.389135
0.448887
0.514741
0.404464
0.296669
0.1983
0.220278
0.330835
0.374081
0.248095
0.284416
0.430588
0.586433
0.510156
0.451295
0.572662
0.644859
0.736959
0.858042
0.688767
0.507269
0.333685
0.40389
0.616401
0.78162
0.510653
0.687228
1.05256
1.37288
1.04121
0.831624
1.02177
1.13118
1.1914
0.731758
0.735439
0.736273
0.719729
0.684499
0.634741
0.576128
0.514783
0.455242
0.401237
0.354489
0.314519
0.280621
0.252394
0.228464
0.236655
0.26081
0.288548
0.279177
0.257361
0.236739
0.223935
0.237703
0.250636
0.262032
0.30121
0.31983
0.353696
0.388891
0.423765
0.354056
0.339984
0.321967
0.271236
0.277927
0.282199
0.234902
0.231232
0.227089
0.222126
0.216151
0.209139
0.201171
0.17863
0.184313
0.189749
0.175388
0.169277
0.163451
0.156389
0.163155
0.170405
0.178167
0.181884
0.195068
0.200409
0.20594
0.21185
0.204287
0.196295
0.188837
0.186423
0.195124
0.204201
0.213568
0.21281
0.218302
0.238478
0.284379
0.363121
0.455702
0.48097
0.495638
0.499439
0.359876
0.364628
0.366454
0.284942
0.284719
0.284874
0.286481
0.354785
0.494975
0.48545
0.475468
0.471056
0.353282
0.349852
0.351108
0.290063
0.295833
0.305083
0.288846
0.276691
0.266982
0.258793
0.25205
0.246675
0.242289
0.225384
0.233153
0.24171
0.241008
0.231213
0.221808
0.223119
0.232772
0.242486
0.252217
0.251178
0.251149
0.261402
0.272582
0.285292
0.284411
0.272633
0.261642
0.261915
0.2719
0.282122
0.29048
0.295168
0.298288
0.302855
0.317871
0.362438
0.475387
0.738311
1.27249
1.92479
1.53602
1.01043
1.66603
2.46816
2.4091
1.37108
0.754772
0.484854
0.374251
0.331259
0.315592
0.308551
0.302274
0.294685
0.286105
0.284188
0.27793
0.26927
0.260444
0.251788
0.242913
0.23387
0.224714
0.215467
0.206185
0.196954
0.187878
0.179058
0.170594
0.16256
0.154991
0.156297
0.164227
0.172516
0.174282
0.166102
0.158179
0.159696
0.167442
0.17538
0.183434
0.182643
0.181097
0.189874
0.198742
0.207605
0.207902
0.199538
0.191093
0.19152
0.199559
0.207489
0.206933
0.199328
0.191606
0.183817
0.176031
0.168324
0.160771
0.161679
0.169082
0.176612
0.17738
0.169982
0.162685
0.163931
0.171145
0.178433
0.185723
0.184804
0.184195
0.191759
0.199243
0.206605
0.206658
0.199488
0.192191
0.192959
0.200099
0.207111
0.213969
0.213674
0.213814
0.214386
0.215269
0.216127
0.216383
0.225018
0.233487
0.241781
0.239722
0.23205
0.22418
0.222875
0.230294
0.237492
0.244376
0.247109
0.249827
0.257558
0.265366
0.272666
0.267228
0.261114
0.25415
0.250894
0.257145
0.262217
0.257923
0.253762
0.248148
0.242066
0.235582
0.228748
0.221665
0.220846
0.227665
0.2342
0.233387
0.227107
0.220507
0.220637
0.227053
0.233111
0.238692
0.239234
0.240346
0.246038
0.251065
0.254423
0.251702
0.249049
0.244565
0.243687
0.247674
0.249715
0.248418
0.246901
0.243361
0.238674
0.233328
0.227457
0.221193
0.214658
0.207929
0.201047
0.194042
0.18694
0.179772
0.172583
0.16545
0.167213
0.174263
0.181361
0.183164
0.176159
0.169184
0.171334
0.17824
0.185133
0.191999
0.190136
0.188422
0.1954
0.202289
0.209071
0.210511
0.203791
0.197003
0.198813
0.205569
0.212253
0.214257
0.207602
0.200846
0.194047
0.187263
0.18046
0.173632
0.176061
0.182815
0.189569
0.192041
0.185314
0.178613
0.181286
0.187956
0.194678
0.201459
0.198799
0.196332
0.203107
0.209857
0.216529
0.21911
0.212367
0.205582
0.208291
0.215147
0.221978
0.228695
0.225742
0.223096
0.22079
0.218794
0.217086
0.215704
0.222137
0.228281
0.234
0.235104
0.2295
0.223446
0.225104
0.231099
0.236634
0.241498
0.240085
0.239145
0.243556
0.246705
0.247783
0.247794
0.247066
0.244251
0.245431
0.247956
0.248443
0.2497
0.249392
0.247122
0.24338
0.238579
0.233078
0.227106
0.229455
0.235434
0.240896
0.243602
0.238155
0.232145
0.235171
0.241239
0.246737
0.25155
0.24838
0.245672
0.249356
0.251437
0.251565
0.254082
0.254079
0.252083
0.255277
0.257292
0.257265
0.25497
0.251876
0.249462
0.24771
0.246604
0.246162
0.246413
0.247372
0.249067
0.251544
0.254865
0.259097
0.264286
0.270396
0.277206
0.277447
0.269448
0.262497
0.256712
0.252054
0.248428
0.245731
0.243874
0.242788
0.242425
0.242745
0.243734
0.245383
0.247681
0.250644
0.254294
0.258766
0.261113
0.261097
0.258977
0.255162
0.250271
0.244687
0.238531
0.231959
0.225136
0.218197
0.211241
0.204328
0.197492
0.190745
0.18408
0.177489
0.17097
0.164536
0.158211
0.152028
0.146028
0.14025
0.134721
0.129459
0.124465
0.119733
0.115248
0.110992
0.113653
0.109595
0.112253
0.108382
0.104721
0.107329
0.111025
0.114942
0.119095
0.116348
0.120684
0.117938
0.122467
0.127256
0.130134
0.125276
0.128169
0.123501
0.126407
0.121917
0.117685
0.113699
0.109943
0.112581
0.116422
0.120502
0.123382
0.119189
0.115237
0.117876
0.121955
0.126277
0.130839
0.127823
0.12483
0.129413
0.13425
0.131158
0.136167
0.133103
0.138297
0.13526
0.132312
0.137636
0.143215
0.149027
0.152103
0.146268
0.140645
0.143735
0.149392
0.155239
0.161247
0.158115
0.155037
0.16121
0.16751
0.173914
0.176937
0.170551
0.164273
0.16739
0.173655
0.180043
0.183245
0.176832
0.170564
0.164429
0.15843
0.15258
0.146901
0.141422
0.144636
0.13933
0.142583
0.137434
0.132509
0.135636
0.140654
0.145875
0.151281
0.147936
0.153472
0.150146
0.155836
0.161684
0.165027
0.159173
0.162584
0.156854
0.160207
0.15457
0.149096
0.143796
0.138686
0.133784
0.129105
0.124661
0.120458
0.123006
0.127297
0.131825
0.134537
0.129997
0.125682
0.128807
0.133091
0.13757
0.142248
0.139298
0.136582
0.141557
0.146737
0.152106
0.154848
0.149459
0.144274
0.147128
0.152218
0.157528
0.160753
0.155627
0.150716
0.14599
0.141429
0.137019
0.132753
0.137705
0.142087
0.146549
0.152937
0.148156
0.143417
0.149193
0.154531
0.159944
0.165404
0.15775
0.151096
0.155741
0.160512
0.165446
0.172447
0.167485
0.162595
0.170888
0.17638
0.18187
0.187362
0.177523
0.170592
0.166128
0.163076
0.160442
0.157656
0.163382
0.169289
0.166003
0.171966
0.168468
0.174515
0.171032
0.167679
0.173818
0.180111
0.186577
0.190089
0.183541
0.177197
0.180743
0.187177
0.193842
0.197867
0.191036
0.184458
0.17811
0.181696
0.175387
0.178543
0.172276
0.166248
0.168881
0.174966
0.181356
0.188067
0.185068
0.191866
0.188238
0.195034
0.202099
0.206319
0.198949
0.202493
0.195113
0.198027
0.190881
0.184138
0.177784
0.171792
0.176003
0.181733
0.187836
0.193966
0.188223
0.182762
0.192868
0.198415
0.20404
0.209793
0.200047
0.194353
0.201313
0.208729
0.205576
0.213509
0.210195
0.218196
0.213966
0.209437
0.204967
0.200761
0.196864
0.193238
0.189821
0.186563
0.183432
0.180409
0.186997
0.193687
0.200492
0.203688
0.196793
0.190045
0.193234
0.200073
0.207087
0.214266
0.210726
0.207414
0.214436
0.221517
0.228583
0.232314
0.225105
0.217882
0.221576
0.228956
0.236321
0.240596
0.233065
0.225517
0.21804
0.2107
0.203541
0.196581
0.200116
0.20722
0.214543
0.218645
0.211149
0.203883
0.207943
0.215382
0.223054
0.230918
0.226335
0.222056
0.229708
0.237428
0.245134
0.249948
0.242059
0.234162
0.238918
0.24699
0.25507
0.263098
0.257753
0.252735
0.24801
0.243565
0.239402
0.235531
0.242222
0.248492
0.254191
0.258499
0.252649
0.246234
0.250559
0.257151
0.263195
0.268633
0.263699
0.25921
0.2632
0.265509
0.265643
0.270882
0.270543
0.267946
0.273218
0.276212
0.276859
0.283606
0.282533
0.279025
0.274016
0.268285
0.261998
0.255191
0.260131
0.267194
0.273777
0.279693
0.272756
0.265393
0.271015
0.278724
0.286074
0.293053
0.286193
0.279862
0.285378
0.289526
0.291157
0.299552
0.297215
0.2923
0.299829
0.305638
0.308844
0.3191
0.314851
0.308026
0.300511
0.292993
0.285168
0.277065
0.268839
0.260566
0.252282
0.244029
0.235857
0.227819
0.219965
0.212338
0.217041
0.224889
0.232948
0.238326
0.230002
0.221871
0.226462
0.234953
0.24363
0.252462
0.246806
0.241179
0.249541
0.257994
0.266508
0.272928
0.264125
0.255414
0.261424
0.270507
0.279713
0.286491
0.276709
0.267095
0.257643
0.248359
0.239265
0.230397
0.221797
0.224903
0.216599
0.220793
0.213424
0.206519
0.215733
0.22193
0.228456
0.242282
0.236443
0.230589
0.224632
0.218522
0.212243
0.205809
0.199256
0.192632
0.185993
0.179391
0.172876
0.166489
0.160262
0.154224
0.148392
0.151709
0.14571
0.147723
0.141842
0.136297
0.137436
0.14306
0.149047
0.149905
0.143858
0.138192
0.138693
0.133354
0.133684
0.128656
0.12392
0.119449
0.119683
0.124152
0.128891
0.133925
0.139285
0.139034
0.144741
0.144383
0.150465
0.150843
0.151114
0.145003
0.145211
0.139489
0.134123
0.129082
0.124338
0.119865
0.120025
0.115793
0.115939
0.111923
0.108114
0.108229
0.104597
0.104682
0.10121
0.0979028
0.0947501
0.0917411
0.0917496
0.0888649
0.0888677
0.0861055
0.0834647
0.0917593
0.0947887
0.0947707
0.0979375
0.0979652
0.101298
0.10126
0.104748
0.108414
0.108332
0.112173
0.112053
0.116085
0.120341
0.120183
0.124673
0.124506
0.129258
0.129431
0.129602
0.12484
0.124994
0.120488
0.11622
0.11633
0.11227
0.11234
0.108474
0.104797
0.116408
0.120691
0.120607
0.125118
0.12988
0.129757
0.134796
0.134647
0.134479
0.134304
0.139672
0.145388
0.151482
0.151319
0.15785
0.157656
0.157382
0.156981
0.156376
0.155438
0.153971
0.160619
0.15803
0.164683
0.171675
0.175251
0.167701
0.169614
0.162277
0.163322
0.163982
0.171519
0.170795
0.178856
0.177501
0.185989
0.183299
0.179003
0.186651
0.194587
0.202756
0.210544
0.200953
0.191865
0.19513
0.204966
0.215527
0.21825
0.207198
0.196992
0.187567
0.188444
0.179652
0.180094
0.171955
0.164403
0.164672
0.172205
0.180307
0.189034
0.188879
0.19838
0.197963
0.208286
0.219496
0.21985
0.208673
0.208637
0.198451
0.198317
0.18901
0.180369
0.17233
0.164839
0.164936
0.157987
0.158083
0.151614
0.145544
0.139842
0.139999
0.145681
0.151721
0.151803
0.145794
0.140134
0.140237
0.134913
0.134993
0.129965
0.125205
0.140307
0.145934
0.145877
0.151861
0.151901
0.15824
0.158219
0.158191
0.158148
0.164997
0.164983
0.172354
0.17237
0.180334
0.18024
0.180122
0.172307
0.172251
0.164994
0.164987
0.172205
0.179921
0.180008
0.188319
0.188496
0.188695
0.18888
0.198071
0.207984
0.208366
0.219252
0.219686
0.23171
0.232018
0.231684
0.230208
0.226821
0.220587
0.211077
0.219442
0.227727
0.235792
0.252303
0.241623
0.230992
0.238828
0.251489
0.264692
0.278272
0.26282
0.243507
0.250769
0.257517
0.263759
0.291133
0.282441
0.272941
0.291997
0.305583
0.318701
0.339968
0.322031
0.304563
0.287812
0.271938
0.257031
0.243123
0.244948
0.259395
0.275128
0.275825
0.259849
0.245302
0.244849
0.259267
0.275166
0.292778
0.293413
0.292244
0.310818
0.33088
0.352402
0.357738
0.334191
0.312805
0.312372
0.334244
0.358704
0.35716
0.332512
0.310683
0.291254
0.273863
0.258201
0.244013
0.231087
0.230357
0.218709
0.218155
0.20757
0.19778
0.197491
0.207181
0.217652
0.217243
0.206858
0.197245
0.197067
0.188187
0.188112
0.179871
0.17218
0.164985
0.196963
0.206495
0.206629
0.216956
0.216788
0.227936
0.228144
0.2285
0.229008
0.229642
0.242159
0.243066
0.257001
0.27237
0.270951
0.255864
0.254885
0.24137
0.240744
0.240306
0.253576
0.254115
0.268779
0.269733
0.286133
0.287657
0.289427
0.308488
0.329943
0.354271
0.350931
0.327213
0.306284
0.30436
0.324766
0.347811
0.345331
0.322848
0.302858
0.284943
0.284116
0.268114
0.267719
0.253257
0.240048
0.283625
0.301213
0.301822
0.321537
0.343649
0.342681
0.320774
0.367418
0.368666
0.370864
0.374098
0.378059
0.382045
0.385085
0.386062
0.383567
0.375263
0.358034
0.331012
0.298902
0.269569
0.248225
0.23539
0.228648
0.237001
0.233614
0.242696
0.252111
0.255208
0.245855
0.250795
0.242811
0.254418
0.275094
0.280541
0.261021
0.268201
0.259408
0.268708
0.265051
0.261829
0.271825
0.282086
0.29261
0.297425
0.286171
0.275376
0.278737
0.289521
0.301069
0.313376
0.309132
0.30341
0.296462
0.289056
0.28182
0.27506
0.283636
0.292183
0.300549
0.308847
0.299865
0.290808
0.298561
0.308226
0.317929
0.327539
0.317647
0.308669
0.316986
0.324941
0.330414
0.342899
0.336011
0.326828
0.337661
0.348145
0.35666
0.371731
0.361339
0.34945
0.338272
0.32767
0.317088
0.306655
0.314514
0.32595
0.337645
0.347029
0.333955
0.321301
0.326442
0.340277
0.354813
0.369756
0.360305
0.349452
0.361853
0.375348
0.387959
0.404823
0.389477
0.374135
0.385254
0.402691
0.421271
0.437208
0.416908
0.396886
0.378123
0.360999
0.345572
0.331745
0.319362
0.308274
0.298353
0.289498
0.281627
0.274673
0.268578
0.263289
0.258665
0.2638
0.269755
0.276597
0.284405
0.293275
0.303325
0.314701
0.327583
0.342189
0.35876
0.377502
0.398485
0.421459
0.445695
0.469951
0.456299
0.435942
0.413962
0.3943
0.377097
0.360702
0.345147
0.330753
0.317571
0.305565
0.294695
0.284908
0.276116
0.29221
0.286156
0.317031
0.311706
0.305729
0.342206
0.352045
0.360409
0.367327
0.321997
0.326962
0.298974
0.306707
0.315635
0.338491
0.332325
0.377759
0.372993
0.434152
0.422384
0.408473
0.392788
0.375804
0.399232
0.423952
0.448922
0.474796
0.442189
0.41173
0.416596
0.450539
0.488064
0.529294
0.509275
0.4735
0.496926
0.518367
0.443599
0.450797
0.382109
0.386616
0.345853
0.325952
0.337819
0.351381
0.366691
0.378721
0.36565
0.354786
0.391914
0.398681
0.407552
0.418909
0.394002
0.383513
0.40174
0.423143
0.448132
0.459718
0.433075
0.411506
0.433101
0.452191
0.478006
0.519015
0.496913
0.483141
0.474569
0.468434
0.463918
0.460165
0.456102
0.55224
0.537018
0.618596
0.581935
0.545197
0.574336
0.623306
0.676293
0.733217
0.653979
0.686695
0.563778
0.572001
0.577867
0.739995
0.715582
0.857099
0.793682
0.865095
0.783156
0.711149
0.647215
0.590094
0.538962
0.493294
0.452695
0.416772
0.413932
0.450674
0.493046
0.488654
0.445866
0.409383
0.404435
0.439888
0.48185
0.532088
0.539029
0.541808
0.597672
0.661375
0.733897
0.749263
0.667963
0.598346
0.592746
0.666282
0.755325
0.750729
0.657581
0.58334
0.523606
0.474852
0.434381
0.4002
0.397273
0.430421
0.469459
0.466247
0.428157
0.395621
0.511685
0.516337
0.573894
0.646273
0.739467
0.728461
0.637137
0.567207
0.852701
0.862121
0.86807
0.862596
0.84393
0.816861
0.913247
1.02869
0.959845
1.0714
0.922671
0.98801
0.759197
0.582342
0.586473
0.594435
0.612117
0.808942
0.785045
0.772499
1.04854
1.10737
1.18587
1.76184
1.52369
1.35087
1.20238
1.35535
1.17256
1.25653
1.08837
0.954871
0.991622
1.14964
1.35228
1.62502
1.47583
1.76427
1.58347
1.88104
2.35917
2.95606
2.17616
2.60079
2.00514
2.38773
1.84068
1.46905
1.20857
1.01657
1.02747
1.25858
1.59778
1.71128
1.29468
1.02959
2.3731
2.11265
2.88789
4.09797
3.27307
5.19792
3.86213
7.54829
4.92435
3.28251
2.10663
1.28775
0.845738
0.640192
0.549007
0.508848
0.488592
0.473089
0.492945
0.514915
0.540582
0.583763
0.67622
0.889773
1.38979
2.5313
5.09608
10.8932
22.0143
39.1557
11.2603
15.4181
6.69004
7.8992
4.81797
3.36473
18.8081
75.2715
59.8647
0.00540472
0.0074092
0.00375044
0.00886351
0.00485374
0.00645702
0.00522236
0.0144324
0.00529273
0.00517657
0.0039606
0.00586771
0.00447131
0.00209576
0.00171839
0.00324849
0.00385052
0.00583986
0.00926513
0.00559069
0.00314547
0.00497502
0.00332895
0.00112534
0.000827336
0.00210083
0.00244167
0.00109552
0.000741115
0.00208378
0.0024641
0.00293315
0.0151453
0.000975402
0.0112907
0.00245953
0.0104115
0.00188111
0.00285495
0.00165883
0.00210638
0.00100277
0.000824426
0.00187832
0.00394336
0.00178158
0.00865411
0.0200516
0.0297095
0.0558821
0.21086
0.112648
0.0686739
0.17379
0.319527
0.438434
0.839533
0.758794
1.35002
3.33045
1.6046
6.14383
6.48689
3.52183
1.5427
0.77652
0.493689
0.382417
0.335783
0.313546
0.299585
0.287998
0.277206
0.267186
0.258243
0.250584
0.244252
0.239165
0.235188
0.232178
0.230012
0.22859
0.227838
0.227689
0.228121
0.229117
0.230647
0.232712
0.235318
0.238479
0.242217
0.246563
0.251561
0.257261
0.263732
0.271058
0.279353
0.28876
0.299469
0.311718
0.325793
0.342032
0.360767
0.382223
0.406433
0.433203
0.462325
0.494338
0.532611
0.588148
0.688942
0.903476
1.43619
3.22532
13.2873
113.26
598.589
2030.05
1121.35
)
;
boundaryField
{
bottomEmptyFaces
{
type empty;
}
topEmptyFaces
{
type empty;
}
inlet
{
type calculated;
value nonuniform List<scalar>
69
(
2337.36
3940.86
12910.3
6563.06
296.16
18.4132
3.54338
1.31257
0.750113
0.546308
0.453326
0.403844
0.37291
0.350007
0.330704
0.313407
0.297711
0.283579
0.270999
0.259875
0.250063
0.241386
0.233668
0.226765
0.220568
0.214996
0.209991
0.205512
0.201529
0.198018
0.194959
0.192338
0.190145
0.188373
0.187018
0.186087
0.185571
0.185493
0.185891
0.186781
0.188213
0.19025
0.192968
0.196446
0.200746
0.205885
0.211813
0.218444
0.225838
0.234665
0.247245
0.269796
0.317851
0.43233
0.739577
1.71445
5.13444
12.5509
10.7894
4.68518
1.80588
0.735948
0.330766
0.168061
0.0776193
2141.87
0.000134444
0.0127514
0.0382853
)
;
}
outlet
{
type calculated;
value nonuniform List<scalar>
33
(
1.1065
1.08227
1.04326
0.988762
0.922196
0.845427
0.763898
0.679591
0.59591
0.51453
0.437421
0.365956
0.301293
0.244139
0.194815
0.153224
0.118969
0.0912907
0.0693167
0.051967
0.0381868
0.0286363
0.0158192
0.0105862
0.00843068
0.00460453
0.00255214
0.00167837
0.00104804
1.1179
5.09335e-05
0.000391233
0.000685587
)
;
}
walls
{
type nutkWallFunction;
blending stepwise;
Cmu 0.09;
kappa 0.41;
E 9.8;
value nonuniform List<scalar>
900
(
9.57671e-06
9.60498e-06
9.59706e-06
9.62524e-06
9.6174e-06
9.64537e-06
9.63755e-06
9.66505e-06
9.65722e-06
9.68433e-06
9.67648e-06
9.70316e-06
9.69535e-06
9.72174e-06
9.71395e-06
9.73996e-06
9.73219e-06
9.75787e-06
9.75012e-06
9.77533e-06
9.76757e-06
9.79223e-06
9.78441e-06
9.80834e-06
9.80045e-06
9.82366e-06
9.81566e-06
9.83799e-06
9.82984e-06
9.85134e-06
9.84303e-06
9.86356e-06
9.8551e-06
9.87478e-06
9.86615e-06
9.88491e-06
9.87612e-06
9.89413e-06
9.88518e-06
9.90238e-06
9.89332e-06
9.90991e-06
9.90075e-06
9.91669e-06
9.90747e-06
9.92295e-06
9.91367e-06
9.92863e-06
9.91932e-06
9.93393e-06
9.92458e-06
9.93875e-06
9.92937e-06
9.94324e-06
9.93384e-06
9.94733e-06
9.93789e-06
9.95115e-06
9.94169e-06
9.95462e-06
9.94514e-06
9.95788e-06
9.94839e-06
9.96085e-06
9.95134e-06
9.96366e-06
9.95414e-06
9.96625e-06
9.95668e-06
9.96866e-06
9.95906e-06
9.97086e-06
9.96118e-06
9.97285e-06
9.96312e-06
9.97462e-06
9.96482e-06
9.97619e-06
9.96636e-06
9.97758e-06
9.96769e-06
9.97882e-06
9.96891e-06
9.97991e-06
9.96994e-06
9.98086e-06
9.97089e-06
9.9817e-06
9.97169e-06
9.98245e-06
9.97246e-06
9.98314e-06
9.97313e-06
9.98379e-06
9.9738e-06
9.9844e-06
9.9744e-06
9.98499e-06
9.97503e-06
9.98556e-06
9.97561e-06
9.98614e-06
9.97624e-06
9.98674e-06
9.97684e-06
9.98735e-06
9.97751e-06
9.988e-06
9.97817e-06
9.98867e-06
9.97891e-06
9.98939e-06
9.97964e-06
9.99015e-06
9.98045e-06
9.99093e-06
9.98124e-06
9.99174e-06
9.98213e-06
9.99265e-06
9.9831e-06
9.99373e-06
9.98433e-06
9.99506e-06
9.9858e-06
9.99672e-06
9.9877e-06
9.99892e-06
9.99008e-06
1.00019e-05
9.99325e-06
1.00057e-05
9.99739e-06
1.00109e-05
1.00028e-05
1.00298e-05
1.00314e-05
1.00663e-05
1.01282e-05
1.02817e-05
1.06516e-05
1.13599e-05
1.28725e-05
1.45971e-05
3.85883e-05
4.32165e-05
4.52931e-05
5.79566e-05
6.54206e-05
3.37399e-05
2.83682e-05
2.98705e-05
3.07368e-05
2.13904e-05
1.96111e-05
2.58899e-05
2.22877e-05
2.28452e-05
3.44226e-05
3.68824e-05
7.32115e-05
7.83681e-05
6.65355e-05
6.97331e-05
5.81929e-05
4.68764e-05
5.22496e-05
4.52036e-05
3.94051e-05
3.5059e-05
3.61203e-05
3.44963e-05
3.20688e-05
2.92054e-05
3.09269e-05
2.85836e-05
3.7028e-06
2.32136e-06
7.46697e-07
8.50752e-07
0
2.60475e-06
2.88875e-06
1.09048e-06
6.07876e-07
0
8.96999e-07
7.7725e-07
0
2.8313e-06
1.13474e-06
2.70284e-06
1.10305e-06
6.49306e-07
0
2.02593e-06
2.79249e-06
1.19907e-06
3.01104e-07
0
6.14716e-07
0
3.02315e-06
1.42466e-06
1.95951e-06
3.46957e-07
0
3.23189e-06
1.70747e-06
2.92585e-06
1.33788e-06
3.57165e-07
0
8.67046e-07
0
2.07611e-06
1.01481e-06
0
3.44887e-06
1.28186e-06
0
1.71467e-06
8.85159e-07
0
8.97955e-06
6.94331e-06
4.84238e-06
4.14709e-06
7.75595e-06
5.27559e-06
4.76935e-06
8.18989e-06
6.00973e-06
5.27091e-06
9.55038e-06
7.45674e-06
3.43753e-06
1.5496e-06
1.06449e-06
3.63071e-06
1.63263e-06
1.20756e-06
8.27028e-06
8.67749e-06
5.73278e-06
5.24283e-06
9.75623e-06
7.69911e-06
5.55616e-06
4.83048e-06
6.13194e-06
5.49389e-06
5.24199e-06
4.53688e-06
5.85043e-06
4.10414e-06
4.49439e-06
2.18738e-06
1.62608e-06
4.16135e-06
2.17841e-06
1.72051e-06
4.34721e-06
2.31009e-06
1.87511e-06
3.74053e-06
1.84175e-06
1.37233e-06
3.95917e-06
2.00217e-06
1.51591e-06
4.53321e-06
2.60265e-06
2.09515e-06
4.86791e-06
3.09947e-06
2.4221e-06
3.17399e-06
1.64676e-06
2.08338e-06
2.97664e-07
0
2.44711e-06
2.79634e-06
9.26272e-07
2.05327e-07
6.26539e-07
0
4.06057e-06
2.50142e-06
3.10609e-06
2.83997e-06
8.91699e-07
3.0336e-07
1.12853e-06
5.74824e-07
1.2903e-05
1.07517e-05
3.48248e-06
1.91063e-06
6.22831e-07
0
2.73671e-06
1.14788e-06
5.00109e-07
2.49724e-06
8.8838e-07
3.11742e-07
1.27315e-06
5.36017e-07
3.06026e-06
1.62063e-06
8.12507e-07
3.18688e-06
2.2484e-06
5.13026e-07
0
1.01504e-06
9.75399e-08
1.29931e-05
8.5796e-06
7.52844e-06
1.66418e-06
5.05803e-07
0
2.30032e-06
9.55848e-07
8.20778e-08
1.08915e-05
8.95933e-06
7.7383e-06
1.34946e-05
1.14066e-05
1.36631e-05
9.18625e-06
8.13801e-06
3.5319e-06
4.5409e-06
3.77862e-06
1.73045e-06
1.17972e-06
2.04304e-06
1.39519e-06
3.34423e-06
1.37352e-06
8.1478e-07
1.51594e-06
9.63352e-07
2.87518e-06
1.19576e-06
6.06514e-07
3.28877e-06
1.38223e-06
9.52356e-07
9.21668e-06
7.00124e-06
6.2161e-06
9.82477e-06
1.08006e-05
2.80021e-05
8.70434e-06
6.50782e-06
5.66679e-06
2.72593e-05
2.79903e-05
2.61272e-05
2.72528e-05
2.92125e-05
2.65337e-05
2.5592e-05
2.42514e-05
1.01313e-05
8.00902e-06
7.12417e-06
1.2052e-05
9.77513e-06
1.13869e-05
7.56079e-06
6.72572e-06
8.95627e-06
4.96103e-06
2.8836e-06
6.6227e-06
5.79895e-06
2.5354e-05
8.66533e-06
2.211e-05
6.074e-06
1.91424e-05
1.98933e-05
1.90416e-05
5.55244e-06
1.47891e-05
3.02354e-06
6.0422e-06
2.50148e-05
2.08513e-05
1.81847e-05
1.75888e-05
3.19376e-05
3.20882e-05
3.62182e-05
3.31501e-05
1.14881e-05
9.29472e-06
7.37107e-06
6.41437e-06
7.44581e-06
6.55815e-06
1.09396e-05
8.63293e-06
7.68343e-06
1.11024e-06
2.08643e-06
0
4.47069e-06
2.87861e-06
3.4568e-06
1.6131e-06
8.95997e-07
1.29785e-06
0
3.75114e-06
1.71486e-06
0
1.75467e-06
1.50563e-06
0
3.72483e-05
3.5338e-05
3.27015e-05
3.02475e-05
2.86807e-05
2.60878e-05
1.437e-05
2.35763e-05
2.28271e-05
2.08862e-05
1.29037e-05
2.39083e-05
2.22495e-05
1.10048e-05
9.28029e-06
1.88666e-05
8.06609e-06
1.57214e-05
1.41731e-05
8.25453e-06
2.10052e-06
1.21501e-05
1.14947e-05
9.6112e-06
8.36046e-06
1.53143e-05
1.41996e-05
1.19285e-05
1.02033e-05
8.86297e-06
1.635e-05
1.08409e-05
9.09981e-06
1.48374e-05
1.26016e-05
8.49235e-07
0
0
0
0
0
1.60101e-05
1.93421e-06
1.51602e-05
1.04415e-06
1.44062e-05
4.14037e-07
0
1.30421e-05
0
1.16686e-05
1.01126e-05
1.78804e-05
0
0
1.75977e-05
0
0
0
0
1.70718e-05
1.62683e-05
1.52588e-05
1.36897e-05
1.76076e-05
0
0
1.69587e-05
0
1.71035e-05
0
1.21959e-05
1.07188e-05
0
1.04941e-05
9.31588e-06
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1.7052e-05
1.69846e-05
1.71407e-05
1.69293e-05
1.67089e-05
1.65103e-05
1.60463e-05
1.5468e-05
1.4894e-05
1.43084e-05
1.3781e-05
1.32666e-05
1.28145e-05
1.23825e-05
1.2002e-05
1.1653e-05
1.13381e-05
1.10617e-05
1.08054e-05
1.05883e-05
1.03816e-05
1.02165e-05
1.00483e-05
9.93238e-06
9.79358e-06
9.72321e-06
9.60919e-06
9.57354e-06
9.48272e-06
9.46763e-06
9.40014e-06
9.3984e-06
9.35133e-06
9.35827e-06
9.32643e-06
9.33871e-06
9.31716e-06
9.33354e-06
9.3196e-06
9.33886e-06
5.79823e-06
5.96347e-06
3.52306e-06
3.08718e-06
9.32814e-06
9.35283e-06
9.34359e-06
9.37143e-06
9.36256e-06
9.39176e-06
9.38311e-06
9.41305e-06
6.43471e-06
4.20193e-06
3.69443e-06
9.40463e-06
9.43507e-06
9.42688e-06
9.45749e-06
9.4495e-06
9.4799e-06
9.47193e-06
9.50187e-06
5.66955e-06
3.45115e-06
3.0491e-06
9.49385e-06
6.30684e-06
9.52324e-06
7.31287e-06
4.3102e-06
3.64928e-06
3.75065e-06
3.23872e-06
5.28958e-06
3.13124e-06
2.59001e-06
9.51517e-06
9.54409e-06
6.05724e-06
3.71667e-06
3.28737e-06
9.53601e-06
5.92676e-06
3.53999e-06
3.13564e-06
6.24165e-06
3.889e-06
3.46117e-06
9.56455e-06
9.55646e-06
9.58472e-06
4.99395e-06
5.13856e-06
2.81847e-06
2.38956e-06
4.67737e-06
4.78941e-06
2.52739e-06
2.11057e-06
2.43112e-06
2.00417e-06
2.70907e-06
2.24186e-06
5.33582e-06
5.53591e-06
3.17329e-06
2.73156e-06
2.95871e-06
2.49818e-06
3.36377e-06
2.86929e-06
7.05376e-06
7.14473e-06
5.16603e-06
4.41973e-06
6.81796e-06
4.45502e-06
3.95257e-06
8.40102e-06
6.34997e-06
4.2e-06
3.53186e-06
7.5894e-06
7.35636e-06
4.62382e-06
4.21706e-06
4.83358e-06
4.39406e-06
7.90568e-06
5.14666e-06
4.65851e-06
5.64528e-06
4.98084e-06
1.63664e-05
0
2.65796e-05
2.37646e-05
2.16005e-05
2.03131e-05
1.91887e-05
1.8428e-05
1.77743e-05
1.73211e-05
1.68624e-05
1.6551e-05
1.62053e-05
1.59769e-05
1.57032e-05
1.55247e-05
1.52997e-05
1.51523e-05
1.49604e-05
1.48337e-05
1.46648e-05
1.45527e-05
1.44006e-05
1.4299e-05
1.41592e-05
1.40652e-05
1.39347e-05
1.38464e-05
1.37232e-05
1.36391e-05
1.35215e-05
1.34407e-05
1.33274e-05
1.3249e-05
1.31391e-05
1.30623e-05
1.2955e-05
1.28795e-05
1.2774e-05
1.26992e-05
1.25949e-05
1.25204e-05
1.2417e-05
1.23424e-05
1.22392e-05
1.21642e-05
1.20608e-05
1.19851e-05
1.1881e-05
1.18041e-05
1.16988e-05
1.16204e-05
1.15135e-05
1.14332e-05
1.13241e-05
1.12416e-05
1.11298e-05
1.10446e-05
1.09296e-05
1.08413e-05
1.07224e-05
1.06306e-05
1.05073e-05
1.04114e-05
1.02831e-05
1.01826e-05
1.00486e-05
9.94319e-06
9.80291e-06
9.692e-06
9.54481e-06
9.42793e-06
9.27315e-06
9.14976e-06
8.98667e-06
8.85623e-06
8.6841e-06
8.5461e-06
8.36425e-06
8.21831e-06
8.02623e-06
7.87218e-06
7.66968e-06
7.50768e-06
7.29494e-06
7.12541e-06
6.90302e-06
6.72685e-06
6.49651e-06
6.31548e-06
6.0791e-06
5.89544e-06
5.65596e-06
5.47296e-06
5.2344e-06
5.05638e-06
4.82407e-06
4.65636e-06
4.43663e-06
4.28509e-06
4.08448e-06
3.95475e-06
3.77908e-06
3.67556e-06
3.52947e-06
3.45465e-06
3.34009e-06
3.29326e-06
3.21006e-06
3.18662e-06
3.13764e-06
3.132e-06
3.10976e-06
3.1122e-06
3.10358e-06
3.11301e-06
3.11223e-06
3.12615e-06
3.13086e-06
3.15141e-06
3.15913e-06
3.18336e-06
3.19257e-06
3.21822e-06
3.2283e-06
3.25423e-06
3.2646e-06
3.29024e-06
3.30062e-06
3.32557e-06
3.33597e-06
3.36022e-06
3.37035e-06
3.39337e-06
3.40305e-06
3.42479e-06
3.43387e-06
3.45396e-06
3.46245e-06
3.48128e-06
3.48925e-06
3.50683e-06
3.51435e-06
3.53059e-06
3.53768e-06
3.55258e-06
3.55893e-06
3.57232e-06
3.57755e-06
3.58929e-06
3.59326e-06
3.60299e-06
3.60606e-06
3.61408e-06
3.61626e-06
3.62268e-06
3.62418e-06
3.62972e-06
3.63093e-06
3.63592e-06
3.63523e-06
3.64396e-06
3.63173e-06
3.68566e-06
3.72553e-06
3.92463e-06
4.0105e-06
4.13818e-06
4.28891e-06
4.52331e-06
3.0064e-05
)
;
}
rightWall
{
type calculated;
value nonuniform List<scalar>
30
(
0.00106317
0.00236735
0.00324426
0.00503024
0.00744976
0.0095668
0.0114185
0.013604
0.0155063
0.0172033
0.0185013
0.0194398
0.0199282
0.019981
0.0195878
0.0187572
0.0175299
0.0158742
0.0139177
0.0115826
0.00937106
0.00682008
0.00439573
0.00224499
3.43938e-05
0.000321312
0.000779153
1.91642e-05
0.000141013
0.00030661
)
;
}
symmetryLine
{
type symmetryPlane;
}
}
// ************************************************************************* //
| [
"mhoeper3234@gmail.com"
] | mhoeper3234@gmail.com | |
b87fd1939f82a28296d522a52a38ea4fcd8dacf7 | 65a08b2d3e3073f5ad250bb0c471441814990058 | /dh.h | 399ff040c7b80f9f83d93a37f9fcdb8c5ce03597 | [
"BSL-1.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | MYCLRY/cryptopp | 303fdbdec4f3f545171bac83bdf8407cb9a4170b | 1993a8b7b9f60020ce1524860ce76c01081f3e79 | refs/heads/master | 2020-12-07T02:32:56.883508 | 2015-11-13T14:15:47 | 2015-11-13T14:15:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,606 | h | #ifndef CRYPTOPP_DH_H
#define CRYPTOPP_DH_H
/** \file
*/
#include "cryptlib.h"
#include "gfpcrypt.h"
NAMESPACE_BEGIN(CryptoPP)
//! ,
template <class GROUP_PARAMETERS, class COFACTOR_OPTION = CPP_TYPENAME GROUP_PARAMETERS::DefaultCofactorOption>
class DH_Domain : public DL_SimpleKeyAgreementDomainBase<typename GROUP_PARAMETERS::Element>
{
typedef DL_SimpleKeyAgreementDomainBase<typename GROUP_PARAMETERS::Element> Base;
public:
typedef GROUP_PARAMETERS GroupParameters;
typedef typename GroupParameters::Element Element;
typedef DL_KeyAgreementAlgorithm_DH<Element, COFACTOR_OPTION> DH_Algorithm;
typedef DH_Domain<GROUP_PARAMETERS, COFACTOR_OPTION> Domain;
DH_Domain() {}
DH_Domain(const GroupParameters ¶ms)
: m_groupParameters(params) {}
DH_Domain(BufferedTransformation &bt)
{m_groupParameters.BERDecode(bt);}
template <class T2>
DH_Domain(RandomNumberGenerator &v1, const T2 &v2)
{m_groupParameters.Initialize(v1, v2);}
template <class T2, class T3>
DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3)
{m_groupParameters.Initialize(v1, v2, v3);}
template <class T2, class T3, class T4>
DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3, const T4 &v4)
{m_groupParameters.Initialize(v1, v2, v3, v4);}
template <class T1, class T2>
DH_Domain(const T1 &v1, const T2 &v2)
{m_groupParameters.Initialize(v1, v2);}
template <class T1, class T2, class T3>
DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3)
{m_groupParameters.Initialize(v1, v2, v3);}
template <class T1, class T2, class T3, class T4>
DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
{m_groupParameters.Initialize(v1, v2, v3, v4);}
const GroupParameters & GetGroupParameters() const {return m_groupParameters;}
GroupParameters & AccessGroupParameters() {return m_groupParameters;}
void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
{
Base::GeneratePublicKey(rng, privateKey, publicKey);
if (FIPS_140_2_ComplianceEnabled())
{
SecByteBlock privateKey2(this->PrivateKeyLength());
this->GeneratePrivateKey(rng, privateKey2);
SecByteBlock publicKey2(this->PublicKeyLength());
Base::GeneratePublicKey(rng, privateKey2, publicKey2);
SecByteBlock agreedValue(this->AgreedValueLength()), agreedValue2(this->AgreedValueLength());
bool agreed1 = this->Agree(agreedValue, privateKey, publicKey2);
bool agreed2 = this->Agree(agreedValue2, privateKey2, publicKey);
if (!agreed1 || !agreed2 || agreedValue != agreedValue2)
throw SelfTestFailure(this->AlgorithmName() + ": pairwise consistency test failed");
}
}
static std::string CRYPTOPP_API StaticAlgorithmName()
{return GroupParameters::StaticAlgorithmNamePrefix() + DH_Algorithm::StaticAlgorithmName();}
std::string AlgorithmName() const {return StaticAlgorithmName();}
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
virtual ~DH_Domain() {}
#endif
private:
const DL_KeyAgreementAlgorithm<Element> & GetKeyAgreementAlgorithm() const
{return Singleton<DH_Algorithm>().Ref();}
DL_GroupParameters<Element> & AccessAbstractGroupParameters()
{return m_groupParameters;}
GroupParameters m_groupParameters;
};
CRYPTOPP_DLL_TEMPLATE_CLASS DH_Domain<DL_GroupParameters_GFP_DefaultSafePrime>;
//! <a href="http://www.weidai.com/scan-mirror/ka.html#DH">Diffie-Hellman</a> in GF(p) with key validation
typedef DH_Domain<DL_GroupParameters_GFP_DefaultSafePrime> DH;
NAMESPACE_END
#endif
| [
"noloader@gmail.com"
] | noloader@gmail.com |
f8f982431c4054f9666fb72b0480cc726533abb1 | dd544eac0ef5fa8a7eca6d0a7effac53a190b711 | /IMU.ino | bade07c4ba2b8686eb5175c4fefc430840a75ba0 | [] | no_license | happytm/EspCopter32 | 056e3ed4ab6bfc2609b2a5982c99e7f694ae3d68 | f34e71d7e084d657dc6af4853917f9410a9aed62 | refs/heads/master | 2020-06-08T08:50:41.621065 | 2019-06-21T19:30:28 | 2019-06-21T19:30:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,099 | ino |
enum cart { X,Y,Z };
#define GYRO_SCALE ((1998 * PI)/(32767.0f * 180.0f * 1000.0f)) // MPU6050
#define F_GYRO_SCALE 0.001 * GYRO_SCALE // in usec
/* Set the Gyro Weight for Gyro/Acc complementary filter
Increasing this value would reduce and delay Acc influence on the output of the filter*/
#define GYR_CMPF_FACTOR 90
#define INV_GYR_CMPF_FACTOR (1.0f / (GYR_CMPF_FACTOR + 1.0f))
typedef struct fp_vector
{
float X,Y,Z;
} t_fp_vector_def;
typedef union
{
float A[3];
t_fp_vector_def V;
} t_fp_vector;
float InvSqrt (float x)
{
union{
int32_t i;
float f;
} conv;
conv.f = x;
conv.i = 0x5f3759df - (conv.i >> 1);
return 0.5f * conv.f * (3.0f - x * conv.f * conv.f);
}
// Rotate Estimated vector(s) with small angle approximation, according to the gyro data
void rotateV(struct fp_vector *v,float* delta)
{
fp_vector v_tmp = *v;
v->Z -= delta[ROLL] * v_tmp.X + delta[PITCH] * v_tmp.Y;
v->X += delta[ROLL] * v_tmp.Z - delta[YAW] * v_tmp.Y;
v->Y += delta[PITCH] * v_tmp.Z + delta[YAW] * v_tmp.X;
}
static t_fp_vector EstG = { 0.0, 0.0, (float)ACCRESO };
static float accData[3] = {0,0,0};
uint32_t tnow;
void getEstimatedAttitude()
{
uint8_t axis;
float deltaGyroAngle[3];
uint32_t tdiff;
float scale;
tdiff = micros() - tnow;
tnow = micros();
scale = (float)tdiff * F_GYRO_SCALE;
// Initialization
for (axis = 0; axis < 3; axis++)
{
deltaGyroAngle[axis] = (float)gyroADC[axis] * scale;
accData[axis] = (float)accADC[axis];
gyroData[axis] = gyroADC[axis];
}
rotateV(&EstG.V,deltaGyroAngle);
// Apply complimentary filter (Gyro drift correction)
for (axis = 0; axis < 3; axis++)
EstG.A[axis] = (EstG.A[axis] * GYR_CMPF_FACTOR + accData[axis]) * INV_GYR_CMPF_FACTOR;
// Attitude of the estimated vector
float sqGZ = sq(EstG.V.Z);
float sqGX = sq(EstG.V.X);
float sqGX_sqGZ = sqGX + sqGZ;
float invmagXZ = InvSqrt(sqGX_sqGZ);
angle[ROLL] = 572.95f * atan2(EstG.V.X , EstG.V.Z);
angle[PITCH] = 572.95f * atan2(EstG.V.Y , invmagXZ*sqGX_sqGZ);
}
| [
"cesco2@bluewin.ch"
] | cesco2@bluewin.ch |
a467ef9728b33007bf3524378006f1400d5e2bf0 | d7b7ae913fde6770a89d6e0e69a85c0a5f5272f3 | /playtest/sub/asio/asio/impl/use_awaitable.hpp | 7bb757401f21bb5e6b6c93b4f9183315e66b498d | [
"MIT"
] | permissive | gdext/native | 2f5fb04d3b912eb0d1d29ed7031266ab412bca84 | 6d174bc56482091ae0f6c973a3de2d45d5fc74c8 | refs/heads/main | 2023-06-21T17:40:13.001545 | 2021-07-24T09:02:40 | 2021-07-24T09:02:40 | 360,237,781 | 3 | 2 | MIT | 2021-04-21T16:42:34 | 2021-04-21T16:33:27 | null | UTF-8 | C++ | false | false | 7,078 | hpp | //
// impl/use_awaitable.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef ASIO_IMPL_USE_AWAITABLE_HPP
#define ASIO_IMPL_USE_AWAITABLE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/async_result.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
namespace detail {
template <typename Executor, typename T>
class awaitable_handler_base
: public awaitable_thread<Executor>
{
public:
typedef void result_type;
typedef awaitable<T, Executor> awaitable_type;
// Construct from the entry point of a new thread of execution.
awaitable_handler_base(awaitable<void, Executor> a, const Executor& ex)
: awaitable_thread<Executor>(std::move(a), ex)
{
}
// Transfer ownership from another awaitable_thread.
explicit awaitable_handler_base(awaitable_thread<Executor>* h)
: awaitable_thread<Executor>(std::move(*h))
{
}
protected:
awaitable_frame<T, Executor>* frame() noexcept
{
return static_cast<awaitable_frame<T, Executor>*>(this->top_of_stack_);
}
};
template <typename, typename...>
class awaitable_handler;
template <typename Executor>
class awaitable_handler<Executor>
: public awaitable_handler_base<Executor, void>
{
public:
using awaitable_handler_base<Executor, void>::awaitable_handler_base;
void operator()()
{
this->frame()->attach_thread(this);
this->frame()->return_void();
this->frame()->pop_frame();
this->pump();
}
};
template <typename Executor>
class awaitable_handler<Executor, asio::error_code>
: public awaitable_handler_base<Executor, void>
{
public:
using awaitable_handler_base<Executor, void>::awaitable_handler_base;
void operator()(const asio::error_code& ec)
{
this->frame()->attach_thread(this);
if (ec)
this->frame()->set_error(ec);
else
this->frame()->return_void();
this->frame()->pop_frame();
this->pump();
}
};
template <typename Executor>
class awaitable_handler<Executor, std::exception_ptr>
: public awaitable_handler_base<Executor, void>
{
public:
using awaitable_handler_base<Executor, void>::awaitable_handler_base;
void operator()(std::exception_ptr ex)
{
this->frame()->attach_thread(this);
if (ex)
this->frame()->set_except(ex);
else
this->frame()->return_void();
this->frame()->pop_frame();
this->pump();
}
};
template <typename Executor, typename T>
class awaitable_handler<Executor, T>
: public awaitable_handler_base<Executor, T>
{
public:
using awaitable_handler_base<Executor, T>::awaitable_handler_base;
template <typename Arg>
void operator()(Arg&& arg)
{
this->frame()->attach_thread(this);
this->frame()->return_value(std::forward<Arg>(arg));
this->frame()->pop_frame();
this->pump();
}
};
template <typename Executor, typename T>
class awaitable_handler<Executor, asio::error_code, T>
: public awaitable_handler_base<Executor, T>
{
public:
using awaitable_handler_base<Executor, T>::awaitable_handler_base;
template <typename Arg>
void operator()(const asio::error_code& ec, Arg&& arg)
{
this->frame()->attach_thread(this);
if (ec)
this->frame()->set_error(ec);
else
this->frame()->return_value(std::forward<Arg>(arg));
this->frame()->pop_frame();
this->pump();
}
};
template <typename Executor, typename T>
class awaitable_handler<Executor, std::exception_ptr, T>
: public awaitable_handler_base<Executor, T>
{
public:
using awaitable_handler_base<Executor, T>::awaitable_handler_base;
template <typename Arg>
void operator()(std::exception_ptr ex, Arg&& arg)
{
this->frame()->attach_thread(this);
if (ex)
this->frame()->set_except(ex);
else
this->frame()->return_value(std::forward<Arg>(arg));
this->frame()->pop_frame();
this->pump();
}
};
template <typename Executor, typename... Ts>
class awaitable_handler
: public awaitable_handler_base<Executor, std::tuple<Ts...>>
{
public:
using awaitable_handler_base<Executor,
std::tuple<Ts...>>::awaitable_handler_base;
template <typename... Args>
void operator()(Args&&... args)
{
this->frame()->attach_thread(this);
this->frame()->return_values(std::forward<Args>(args)...);
this->frame()->pop_frame();
this->pump();
}
};
template <typename Executor, typename... Ts>
class awaitable_handler<Executor, asio::error_code, Ts...>
: public awaitable_handler_base<Executor, std::tuple<Ts...>>
{
public:
using awaitable_handler_base<Executor,
std::tuple<Ts...>>::awaitable_handler_base;
template <typename... Args>
void operator()(const asio::error_code& ec, Args&&... args)
{
this->frame()->attach_thread(this);
if (ec)
this->frame()->set_error(ec);
else
this->frame()->return_values(std::forward<Args>(args)...);
this->frame()->pop_frame();
this->pump();
}
};
template <typename Executor, typename... Ts>
class awaitable_handler<Executor, std::exception_ptr, Ts...>
: public awaitable_handler_base<Executor, std::tuple<Ts...>>
{
public:
using awaitable_handler_base<Executor,
std::tuple<Ts...>>::awaitable_handler_base;
template <typename... Args>
void operator()(std::exception_ptr ex, Args&&... args)
{
this->frame()->attach_thread(this);
if (ex)
this->frame()->set_except(ex);
else
this->frame()->return_values(std::forward<Args>(args)...);
this->frame()->pop_frame();
this->pump();
}
};
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
#if defined(_MSC_VER)
template <typename T>
T dummy_return()
{
return std::move(*static_cast<T*>(nullptr));
}
template <>
inline void dummy_return()
{
}
#endif // defined(_MSC_VER)
template <typename Executor, typename R, typename... Args>
class async_result<use_awaitable_t<Executor>, R(Args...)>
{
public:
typedef typename detail::awaitable_handler<
Executor, typename decay<Args>::type...> handler_type;
typedef typename handler_type::awaitable_type return_type;
template <typename Initiation, typename... InitArgs>
static return_type initiate(Initiation initiation,
use_awaitable_t<Executor> u, InitArgs... args)
{
(void)u;
co_await [&](auto* frame)
{
ASIO_HANDLER_LOCATION((u.file_name_, u.line_, u.function_name_));
handler_type handler(frame->detach_thread());
std::move(initiation)(std::move(handler), std::move(args)...);
return static_cast<handler_type*>(nullptr);
};
for (;;) {} // Never reached.
#if defined(_MSC_VER)
co_return dummy_return<typename return_type::value_type>();
#endif // defined(_MSC_VER)
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_IMPL_USE_AWAITABLE_HPP
| [
"nassimbennamari38@gmail.com"
] | nassimbennamari38@gmail.com |
73deb90a67125a43c9858b295ec36e120937826b | 72ce336247f5a68ca579e630cfcf125b5bcb4c2e | /opengl_experiments/imgui/imgui_demo.cpp | 9a6063598807a29658c65e9c43a1543a01327823 | [] | no_license | mateun/opengl_experiments | 47f442a7e6d0d21fa5a79320b7cfda15da214e99 | 96750672861743ad14cbce6a61a3df3d6b89951c | refs/heads/master | 2020-03-26T21:19:17.632065 | 2018-08-19T21:20:03 | 2018-08-19T21:20:03 | 145,380,374 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 184,537 | cpp | // dear imgui, v1.63 WIP
// (demo code)
// Message to the person tempted to delete this file when integrating ImGui into their code base:
// Don't do it! Do NOT remove this file from your project! It is useful reference code that you and other users will want to refer to.
// Everything in this file will be stripped out by the linker if you don't call ImGui::ShowDemoWindow().
// During development, you can call ImGui::ShowDemoWindow() in your code to learn about various features of ImGui. Have it wired in a debug menu!
// Removing this file from your project is hindering access to documentation for everyone in your team, likely leading you to poorer usage of the library.
// Note that you can #define IMGUI_DISABLE_DEMO_WINDOWS in imconfig.h for the same effect.
// If you want to link core ImGui in your final builds but not those demo windows, #define IMGUI_DISABLE_DEMO_WINDOWS in imconfig.h and those functions will be empty.
// In other situation, when you have ImGui available you probably want this to be available for reference and execution.
// Thank you,
// -Your beloved friend, imgui_demo.cpp (that you won't delete)
// Message to beginner C/C++ programmers about the meaning of the 'static' keyword: in this demo code, we frequently we use 'static' variables inside functions.
// A static variable persist across calls, so it is essentially like a global variable but declared inside the scope of the function.
// We do this as a way to gather code and data in the same place, just to make the demo code faster to read, faster to write, and use less code.
// It also happens to be a convenient way of storing simple UI related information as long as your function doesn't need to be reentrant or used in threads.
// This might be a pattern you occasionally want to use in your code, but most of the real data you would be editing is likely to be stored outside your functions.
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "stdafx.h"
#include "imgui.h"
#include <ctype.h> // toupper, isprint
#include <limits.h> // INT_MIN, INT_MAX
#include <math.h> // sqrtf, powf, cosf, sinf, floorf, ceilf
#include <stdio.h> // vsnprintf, sscanf, printf
#include <stdlib.h> // NULL, malloc, free, atoi
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
#include <stddef.h> // intptr_t
#else
#include <stdint.h> // intptr_t
#endif
#ifdef _MSC_VER
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif
#ifdef __clang__
#pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse.
#pragma clang diagnostic ignored "-Wdeprecated-declarations" // warning : 'xx' is deprecated: The POSIX name for this item.. // for strdup used in demo code (so user can copy & paste the code)
#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int'
#pragma clang diagnostic ignored "-Wformat-security" // warning : warning: format string is not a string literal
#pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals.
#if __has_warning("-Wreserved-id-macro")
#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier //
#endif
#elif defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
#pragma GCC diagnostic ignored "-Wformat-security" // warning : format string is not a string literal (potentially insecure)
#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
#if (__GNUC__ >= 6)
#pragma GCC diagnostic ignored "-Wmisleading-indentation" // warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on GitHub.
#endif
#endif
// Play it nice with Windows users. Notepad in 2017 still doesn't display text data with Unix-style \n.
#ifdef _WIN32
#define IM_NEWLINE "\r\n"
#else
#define IM_NEWLINE "\n"
#endif
#define IM_MAX(_A,_B) (((_A) >= (_B)) ? (_A) : (_B))
//-----------------------------------------------------------------------------
// DEMO CODE
//-----------------------------------------------------------------------------
#if !defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && defined(IMGUI_DISABLE_TEST_WINDOWS) && !defined(IMGUI_DISABLE_DEMO_WINDOWS) // Obsolete name since 1.53, TEST->DEMO
#define IMGUI_DISABLE_DEMO_WINDOWS
#endif
#if !defined(IMGUI_DISABLE_DEMO_WINDOWS)
// Forward Declarations
static void ShowExampleAppMainMenuBar();
static void ShowExampleAppConsole(bool* p_open);
static void ShowExampleAppLog(bool* p_open);
static void ShowExampleAppLayout(bool* p_open);
static void ShowExampleAppPropertyEditor(bool* p_open);
static void ShowExampleAppLongText(bool* p_open);
static void ShowExampleAppAutoResize(bool* p_open);
static void ShowExampleAppConstrainedResize(bool* p_open);
static void ShowExampleAppSimpleOverlay(bool* p_open);
static void ShowExampleAppWindowTitles(bool* p_open);
static void ShowExampleAppCustomRendering(bool* p_open);
static void ShowExampleMenuFile();
// Helper to display a little (?) mark which shows a tooltip when hovered.
static void ShowHelpMarker(const char* desc)
{
ImGui::TextDisabled("(?)");
if (ImGui::IsItemHovered())
{
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
ImGui::TextUnformatted(desc);
ImGui::PopTextWrapPos();
ImGui::EndTooltip();
}
}
// Helper to display basic user controls.
void ImGui::ShowUserGuide()
{
ImGui::BulletText("Double-click on title bar to collapse window.");
ImGui::BulletText("Click and drag on lower right corner to resize window\n(double-click to auto fit window to its contents).");
ImGui::BulletText("Click and drag on any empty space to move window.");
ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text.");
if (ImGui::GetIO().FontAllowUserScaling)
ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents.");
ImGui::BulletText("Mouse Wheel to scroll.");
ImGui::BulletText("While editing text:\n");
ImGui::Indent();
ImGui::BulletText("Hold SHIFT or use mouse to select text.");
ImGui::BulletText("CTRL+Left/Right to word jump.");
ImGui::BulletText("CTRL+A or double-click to select all.");
ImGui::BulletText("CTRL+X,CTRL+C,CTRL+V to use clipboard.");
ImGui::BulletText("CTRL+Z,CTRL+Y to undo/redo.");
ImGui::BulletText("ESCAPE to revert.");
ImGui::BulletText("You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract.");
ImGui::Unindent();
}
// Demonstrate most Dear ImGui features (this is big function!)
// You may execute this function to experiment with the UI and understand what it does. You may then search for keywords in the code when you are interested by a specific feature.
void ImGui::ShowDemoWindow(bool* p_open)
{
// Examples Apps (accessible from the "Examples" menu)
static bool show_app_main_menu_bar = false;
static bool show_app_console = false;
static bool show_app_log = false;
static bool show_app_layout = false;
static bool show_app_property_editor = false;
static bool show_app_long_text = false;
static bool show_app_auto_resize = false;
static bool show_app_constrained_resize = false;
static bool show_app_simple_overlay = false;
static bool show_app_window_titles = false;
static bool show_app_custom_rendering = false;
if (show_app_main_menu_bar) ShowExampleAppMainMenuBar();
if (show_app_console) ShowExampleAppConsole(&show_app_console);
if (show_app_log) ShowExampleAppLog(&show_app_log);
if (show_app_layout) ShowExampleAppLayout(&show_app_layout);
if (show_app_property_editor) ShowExampleAppPropertyEditor(&show_app_property_editor);
if (show_app_long_text) ShowExampleAppLongText(&show_app_long_text);
if (show_app_auto_resize) ShowExampleAppAutoResize(&show_app_auto_resize);
if (show_app_constrained_resize) ShowExampleAppConstrainedResize(&show_app_constrained_resize);
if (show_app_simple_overlay) ShowExampleAppSimpleOverlay(&show_app_simple_overlay);
if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles);
if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering);
// Dear ImGui Apps (accessible from the "Help" menu)
static bool show_app_metrics = false;
static bool show_app_style_editor = false;
static bool show_app_about = false;
if (show_app_metrics) { ImGui::ShowMetricsWindow(&show_app_metrics); }
if (show_app_style_editor) { ImGui::Begin("Style Editor", &show_app_style_editor); ImGui::ShowStyleEditor(); ImGui::End(); }
if (show_app_about)
{
ImGui::Begin("About Dear ImGui", &show_app_about, ImGuiWindowFlags_AlwaysAutoResize);
ImGui::Text("Dear ImGui, %s", ImGui::GetVersion());
ImGui::Separator();
ImGui::Text("By Omar Cornut and all dear imgui contributors.");
ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information.");
ImGui::End();
}
// Demonstrate the various window flags. Typically you would just use the default!
static bool no_titlebar = false;
static bool no_scrollbar = false;
static bool no_menu = false;
static bool no_move = false;
static bool no_resize = false;
static bool no_collapse = false;
static bool no_close = false;
static bool no_nav = false;
ImGuiWindowFlags window_flags = 0;
if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar;
if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar;
if (!no_menu) window_flags |= ImGuiWindowFlags_MenuBar;
if (no_move) window_flags |= ImGuiWindowFlags_NoMove;
if (no_resize) window_flags |= ImGuiWindowFlags_NoResize;
if (no_collapse) window_flags |= ImGuiWindowFlags_NoCollapse;
if (no_nav) window_flags |= ImGuiWindowFlags_NoNav;
if (no_close) p_open = NULL; // Don't pass our bool* to Begin
// We specify a default position/size in case there's no data in the .ini file. Typically this isn't required! We only do it to make the Demo applications a little more welcoming.
ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(550, 680), ImGuiCond_FirstUseEver);
// Main body of the Demo window starts here.
if (!ImGui::Begin("ImGui Demo", p_open, window_flags))
{
// Early out if the window is collapsed, as an optimization.
ImGui::End();
return;
}
ImGui::Text("dear imgui says hello. (%s)", IMGUI_VERSION);
// Most "big" widgets share a common width settings by default.
//ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.65f); // Use 2/3 of the space for widgets and 1/3 for labels (default)
ImGui::PushItemWidth(ImGui::GetFontSize() * -12); // Use fixed width for labels (by passing a negative value), the rest goes to widgets. We choose a width proportional to our font size.
// Menu
if (ImGui::BeginMenuBar())
{
if (ImGui::BeginMenu("Menu"))
{
ShowExampleMenuFile();
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Examples"))
{
ImGui::MenuItem("Main menu bar", NULL, &show_app_main_menu_bar);
ImGui::MenuItem("Console", NULL, &show_app_console);
ImGui::MenuItem("Log", NULL, &show_app_log);
ImGui::MenuItem("Simple layout", NULL, &show_app_layout);
ImGui::MenuItem("Property editor", NULL, &show_app_property_editor);
ImGui::MenuItem("Long text display", NULL, &show_app_long_text);
ImGui::MenuItem("Auto-resizing window", NULL, &show_app_auto_resize);
ImGui::MenuItem("Constrained-resizing window", NULL, &show_app_constrained_resize);
ImGui::MenuItem("Simple overlay", NULL, &show_app_simple_overlay);
ImGui::MenuItem("Manipulating window titles", NULL, &show_app_window_titles);
ImGui::MenuItem("Custom rendering", NULL, &show_app_custom_rendering);
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Help"))
{
ImGui::MenuItem("Metrics", NULL, &show_app_metrics);
ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor);
ImGui::MenuItem("About Dear ImGui", NULL, &show_app_about);
ImGui::EndMenu();
}
ImGui::EndMenuBar();
}
ImGui::Spacing();
if (ImGui::CollapsingHeader("Help"))
{
ImGui::TextWrapped("This window is being created by the ShowDemoWindow() function. Please refer to the code in imgui_demo.cpp for reference.\n\n");
ImGui::Text("USER GUIDE:");
ImGui::ShowUserGuide();
}
if (ImGui::CollapsingHeader("Window options"))
{
ImGui::Checkbox("No titlebar", &no_titlebar); ImGui::SameLine(150);
ImGui::Checkbox("No scrollbar", &no_scrollbar); ImGui::SameLine(300);
ImGui::Checkbox("No menu", &no_menu);
ImGui::Checkbox("No move", &no_move); ImGui::SameLine(150);
ImGui::Checkbox("No resize", &no_resize); ImGui::SameLine(300);
ImGui::Checkbox("No collapse", &no_collapse);
ImGui::Checkbox("No close", &no_close); ImGui::SameLine(150);
ImGui::Checkbox("No nav", &no_nav);
if (ImGui::TreeNode("Style"))
{
ImGui::ShowStyleEditor();
ImGui::TreePop();
}
if (ImGui::TreeNode("Capture/Logging"))
{
ImGui::TextWrapped("The logging API redirects all text output so you can easily capture the content of a window or a block. Tree nodes can be automatically expanded. You can also call ImGui::LogText() to output directly to the log without a visual output.");
ImGui::LogButtons();
ImGui::TreePop();
}
}
if (ImGui::CollapsingHeader("Widgets"))
{
if (ImGui::TreeNode("Basic"))
{
static int clicked = 0;
if (ImGui::Button("Button"))
clicked++;
if (clicked & 1)
{
ImGui::SameLine();
ImGui::Text("Thanks for clicking me!");
}
static bool check = true;
ImGui::Checkbox("checkbox", &check);
static int e = 0;
ImGui::RadioButton("radio a", &e, 0); ImGui::SameLine();
ImGui::RadioButton("radio b", &e, 1); ImGui::SameLine();
ImGui::RadioButton("radio c", &e, 2);
// Color buttons, demonstrate using PushID() to add unique identifier in the ID stack, and changing style.
for (int i = 0; i < 7; i++)
{
if (i > 0) ImGui::SameLine();
ImGui::PushID(i);
ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(i/7.0f, 0.6f, 0.6f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(i/7.0f, 0.7f, 0.7f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i/7.0f, 0.8f, 0.8f));
ImGui::Button("Click");
ImGui::PopStyleColor(3);
ImGui::PopID();
}
// Arrow buttons
static int counter = 0;
float spacing = ImGui::GetStyle().ItemInnerSpacing.x;
ImGui::PushButtonRepeat(true);
if (ImGui::ArrowButton("##left", ImGuiDir_Left)) { counter--; }
ImGui::SameLine(0.0f, spacing);
if (ImGui::ArrowButton("##right", ImGuiDir_Right)) { counter++; }
ImGui::PopButtonRepeat();
ImGui::SameLine();
ImGui::Text("%d", counter);
ImGui::Text("Hover over me");
if (ImGui::IsItemHovered())
ImGui::SetTooltip("I am a tooltip");
ImGui::SameLine();
ImGui::Text("- or me");
if (ImGui::IsItemHovered())
{
ImGui::BeginTooltip();
ImGui::Text("I am a fancy tooltip");
static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr));
ImGui::EndTooltip();
}
ImGui::Separator();
ImGui::LabelText("label", "Value");
{
// Using the _simplified_ one-liner Combo() api here
// See "Combo" section for examples of how to use the more complete BeginCombo()/EndCombo() api.
const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" };
static int item_current = 0;
ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items));
ImGui::SameLine(); ShowHelpMarker("Refer to the \"Combo\" section below for an explanation of the full BeginCombo/EndCombo API, and demonstration of various flags.\n");
}
{
static char str0[128] = "Hello, world!";
static int i0 = 123;
ImGui::InputText("input text", str0, IM_ARRAYSIZE(str0));
ImGui::SameLine(); ShowHelpMarker("Hold SHIFT or use mouse to select text.\n" "CTRL+Left/Right to word jump.\n" "CTRL+A or double-click to select all.\n" "CTRL+X,CTRL+C,CTRL+V clipboard.\n" "CTRL+Z,CTRL+Y undo/redo.\n" "ESCAPE to revert.\n");
ImGui::InputInt("input int", &i0);
ImGui::SameLine(); ShowHelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
static float f0 = 0.001f;
ImGui::InputFloat("input float", &f0, 0.01f, 1.0f);
static double d0 = 999999.00000001;
ImGui::InputDouble("input double", &d0, 0.01f, 1.0f, "%.8f");
static float f1 = 1.e10f;
ImGui::InputFloat("input scientific", &f1, 0.0f, 0.0f, "%e");
ImGui::SameLine(); ShowHelpMarker("You can input value using the scientific notation,\n e.g. \"1e+8\" becomes \"100000000\".\n");
static float vec4a[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
ImGui::InputFloat3("input float3", vec4a);
}
{
static int i1 = 50, i2 = 42;
ImGui::DragInt("drag int", &i1, 1);
ImGui::SameLine(); ShowHelpMarker("Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input value.");
ImGui::DragInt("drag int 0..100", &i2, 1, 0, 100, "%d%%");
static float f1=1.00f, f2=0.0067f;
ImGui::DragFloat("drag float", &f1, 0.005f);
ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f ns");
}
{
static int i1=0;
ImGui::SliderInt("slider int", &i1, -1, 3);
ImGui::SameLine(); ShowHelpMarker("CTRL+click to input value.");
static float f1=0.123f, f2=0.0f;
ImGui::SliderFloat("slider float", &f1, 0.0f, 1.0f, "ratio = %.3f");
ImGui::SliderFloat("slider float (curve)", &f2, -10.0f, 10.0f, "%.4f", 2.0f);
static float angle = 0.0f;
ImGui::SliderAngle("slider angle", &angle);
}
{
static float col1[3] = { 1.0f,0.0f,0.2f };
static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
ImGui::ColorEdit3("color 1", col1);
ImGui::SameLine(); ShowHelpMarker("Click on the colored square to open a color picker.\nClick and hold to use drag and drop.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n");
ImGui::ColorEdit4("color 2", col2);
}
{
// List box
const char* listbox_items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" };
static int listbox_item_current = 1;
ImGui::ListBox("listbox\n(single select)", &listbox_item_current, listbox_items, IM_ARRAYSIZE(listbox_items), 4);
//static int listbox_item_current2 = 2;
//ImGui::PushItemWidth(-1);
//ImGui::ListBox("##listbox2", &listbox_item_current2, listbox_items, IM_ARRAYSIZE(listbox_items), 4);
//ImGui::PopItemWidth();
}
ImGui::TreePop();
}
// Testing ImGuiOnceUponAFrame helper.
//static ImGuiOnceUponAFrame once;
//for (int i = 0; i < 5; i++)
// if (once)
// ImGui::Text("This will be displayed only once.");
if (ImGui::TreeNode("Trees"))
{
if (ImGui::TreeNode("Basic trees"))
{
for (int i = 0; i < 5; i++)
if (ImGui::TreeNode((void*)(intptr_t)i, "Child %d", i))
{
ImGui::Text("blah blah");
ImGui::SameLine();
if (ImGui::SmallButton("button")) { };
ImGui::TreePop();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Advanced, with Selectable nodes"))
{
ShowHelpMarker("This is a more standard looking tree with selectable nodes.\nClick to select, CTRL+Click to toggle, click on arrows or double-click to open.");
static bool align_label_with_current_x_position = false;
ImGui::Checkbox("Align label with current X position)", &align_label_with_current_x_position);
ImGui::Text("Hello!");
if (align_label_with_current_x_position)
ImGui::Unindent(ImGui::GetTreeNodeToLabelSpacing());
static int selection_mask = (1 << 2); // Dumb representation of what may be user-side selection state. You may carry selection state inside or outside your objects in whatever format you see fit.
int node_clicked = -1; // Temporary storage of what node we have clicked to process selection at the end of the loop. May be a pointer to your own node type, etc.
ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, ImGui::GetFontSize()*3); // Increase spacing to differentiate leaves from expanded contents.
for (int i = 0; i < 6; i++)
{
// Disable the default open on single-click behavior and pass in Selected flag according to our selection state.
ImGuiTreeNodeFlags node_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ((selection_mask & (1 << i)) ? ImGuiTreeNodeFlags_Selected : 0);
if (i < 3)
{
// Node
bool node_open = ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Node %d", i);
if (ImGui::IsItemClicked())
node_clicked = i;
if (node_open)
{
ImGui::Text("Blah blah\nBlah Blah");
ImGui::TreePop();
}
}
else
{
// Leaf: The only reason we have a TreeNode at all is to allow selection of the leaf. Otherwise we can use BulletText() or TreeAdvanceToLabelPos()+Text().
node_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen; // ImGuiTreeNodeFlags_Bullet
ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Leaf %d", i);
if (ImGui::IsItemClicked())
node_clicked = i;
}
}
if (node_clicked != -1)
{
// Update selection state. Process outside of tree loop to avoid visual inconsistencies during the clicking-frame.
if (ImGui::GetIO().KeyCtrl)
selection_mask ^= (1 << node_clicked); // CTRL+click to toggle
else //if (!(selection_mask & (1 << node_clicked))) // Depending on selection behavior you want, this commented bit preserve selection when clicking on item that is part of the selection
selection_mask = (1 << node_clicked); // Click to single-select
}
ImGui::PopStyleVar();
if (align_label_with_current_x_position)
ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing());
ImGui::TreePop();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Collapsing Headers"))
{
static bool closable_group = true;
ImGui::Checkbox("Enable extra group", &closable_group);
if (ImGui::CollapsingHeader("Header"))
{
ImGui::Text("IsItemHovered: %d", IsItemHovered());
for (int i = 0; i < 5; i++)
ImGui::Text("Some content %d", i);
}
if (ImGui::CollapsingHeader("Header with a close button", &closable_group))
{
ImGui::Text("IsItemHovered: %d", IsItemHovered());
for (int i = 0; i < 5; i++)
ImGui::Text("More content %d", i);
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Bullets"))
{
ImGui::BulletText("Bullet point 1");
ImGui::BulletText("Bullet point 2\nOn multiple lines");
ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)");
ImGui::Bullet(); ImGui::SmallButton("Button");
ImGui::TreePop();
}
if (ImGui::TreeNode("Text"))
{
if (ImGui::TreeNode("Colored Text"))
{
// Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility.
ImGui::TextColored(ImVec4(1.0f,0.0f,1.0f,1.0f), "Pink");
ImGui::TextColored(ImVec4(1.0f,1.0f,0.0f,1.0f), "Yellow");
ImGui::TextDisabled("Disabled");
ImGui::SameLine(); ShowHelpMarker("The TextDisabled color is stored in ImGuiStyle.");
ImGui::TreePop();
}
if (ImGui::TreeNode("Word Wrapping"))
{
// Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility.
ImGui::TextWrapped("This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules suitable for English and possibly other languages.");
ImGui::Spacing();
static float wrap_width = 200.0f;
ImGui::SliderFloat("Wrap width", &wrap_width, -20, 600, "%.0f");
ImGui::Text("Test paragraph 1:");
ImVec2 pos = ImGui::GetCursorScreenPos();
ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(pos.x + wrap_width, pos.y), ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight()), IM_COL32(255,0,255,255));
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
ImGui::Text("The lazy dog is a good dog. This paragraph is made to fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width);
ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255,255,0,255));
ImGui::PopTextWrapPos();
ImGui::Text("Test paragraph 2:");
pos = ImGui::GetCursorScreenPos();
ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(pos.x + wrap_width, pos.y), ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight()), IM_COL32(255,0,255,255));
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
ImGui::Text("aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee ffffffff. gggggggg!hhhhhhhh");
ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255,255,0,255));
ImGui::PopTextWrapPos();
ImGui::TreePop();
}
if (ImGui::TreeNode("UTF-8 Text"))
{
// UTF-8 test with Japanese characters
// (Needs a suitable font, try Noto, or Arial Unicode, or M+ fonts. Read misc/fonts/README.txt for details.)
// - From C++11 you can use the u8"my text" syntax to encode literal strings as UTF-8
// - For earlier compiler, you may be able to encode your sources as UTF-8 (e.g. Visual Studio save your file as 'UTF-8 without signature')
// - FOR THIS DEMO FILE ONLY, BECAUSE WE WANT TO SUPPORT OLD COMPILERS, WE ARE *NOT* INCLUDING RAW UTF-8 CHARACTERS IN THIS SOURCE FILE.
// Instead we are encoding a few strings with hexadecimal constants. Don't do this in your application!
// Please use u8"text in any language" in your application!
// Note that characters values are preserved even by InputText() if the font cannot be displayed, so you can safely copy & paste garbled characters into another application.
ImGui::TextWrapped("CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->LoadFromFileTTF() manually to load extra character ranges. Read misc/fonts/README.txt for details.");
ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)"); // Normally we would use u8"blah blah" with the proper characters directly in the string.
ImGui::Text("Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)");
static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e";
//static char buf[32] = u8"NIHONGO"; // <- this is how you would write it with C++11, using real kanjis
ImGui::InputText("UTF-8 input", buf, IM_ARRAYSIZE(buf));
ImGui::TreePop();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Images"))
{
ImGuiIO& io = ImGui::GetIO();
ImGui::TextWrapped("Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!");
// Here we are grabbing the font texture because that's the only one we have access to inside the demo code.
// Remember that ImTextureID is just storage for whatever you want it to be, it is essentially a value that will be passed to the render function inside the ImDrawCmd structure.
// If you use one of the default imgui_impl_XXXX.cpp renderer, they all have comments at the top of their file to specify what they expect to be stored in ImTextureID.
// (for example, the imgui_impl_dx11.cpp renderer expect a 'ID3D11ShaderResourceView*' pointer. The imgui_impl_glfw_gl3.cpp renderer expect a GLuint OpenGL texture identifier etc.)
// If you decided that ImTextureID = MyEngineTexture*, then you can pass your MyEngineTexture* pointers to ImGui::Image(), and gather width/height through your own functions, etc.
// Using ShowMetricsWindow() as a "debugger" to inspect the draw data that are being passed to your render will help you debug issues if you are confused about this.
// Consider using the lower-level ImDrawList::AddImage() API, via ImGui::GetWindowDrawList()->AddImage().
ImTextureID my_tex_id = io.Fonts->TexID;
float my_tex_w = (float)io.Fonts->TexWidth;
float my_tex_h = (float)io.Fonts->TexHeight;
ImGui::Text("%.0fx%.0f", my_tex_w, my_tex_h);
ImVec2 pos = ImGui::GetCursorScreenPos();
ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), ImVec2(0,0), ImVec2(1,1), ImColor(255,255,255,255), ImColor(255,255,255,128));
if (ImGui::IsItemHovered())
{
ImGui::BeginTooltip();
float region_sz = 32.0f;
float region_x = io.MousePos.x - pos.x - region_sz * 0.5f; if (region_x < 0.0f) region_x = 0.0f; else if (region_x > my_tex_w - region_sz) region_x = my_tex_w - region_sz;
float region_y = io.MousePos.y - pos.y - region_sz * 0.5f; if (region_y < 0.0f) region_y = 0.0f; else if (region_y > my_tex_h - region_sz) region_y = my_tex_h - region_sz;
float zoom = 4.0f;
ImGui::Text("Min: (%.2f, %.2f)", region_x, region_y);
ImGui::Text("Max: (%.2f, %.2f)", region_x + region_sz, region_y + region_sz);
ImVec2 uv0 = ImVec2((region_x) / my_tex_w, (region_y) / my_tex_h);
ImVec2 uv1 = ImVec2((region_x + region_sz) / my_tex_w, (region_y + region_sz) / my_tex_h);
ImGui::Image(my_tex_id, ImVec2(region_sz * zoom, region_sz * zoom), uv0, uv1, ImColor(255,255,255,255), ImColor(255,255,255,128));
ImGui::EndTooltip();
}
ImGui::TextWrapped("And now some textured buttons..");
static int pressed_count = 0;
for (int i = 0; i < 8; i++)
{
ImGui::PushID(i);
int frame_padding = -1 + i; // -1 = uses default padding
if (ImGui::ImageButton(my_tex_id, ImVec2(32,32), ImVec2(0,0), ImVec2(32.0f/my_tex_w,32/my_tex_h), frame_padding, ImColor(0,0,0,255)))
pressed_count += 1;
ImGui::PopID();
ImGui::SameLine();
}
ImGui::NewLine();
ImGui::Text("Pressed %d times.", pressed_count);
ImGui::TreePop();
}
if (ImGui::TreeNode("Combo"))
{
// Expose flags as checkbox for the demo
static ImGuiComboFlags flags = 0;
ImGui::CheckboxFlags("ImGuiComboFlags_PopupAlignLeft", (unsigned int*)&flags, ImGuiComboFlags_PopupAlignLeft);
if (ImGui::CheckboxFlags("ImGuiComboFlags_NoArrowButton", (unsigned int*)&flags, ImGuiComboFlags_NoArrowButton))
flags &= ~ImGuiComboFlags_NoPreview; // Clear the other flag, as we cannot combine both
if (ImGui::CheckboxFlags("ImGuiComboFlags_NoPreview", (unsigned int*)&flags, ImGuiComboFlags_NoPreview))
flags &= ~ImGuiComboFlags_NoArrowButton; // Clear the other flag, as we cannot combine both
// General BeginCombo() API, you have full control over your selection data and display type.
// (your selection data could be an index, a pointer to the object, an id for the object, a flag stored in the object itself, etc.)
const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" };
static const char* item_current = items[0]; // Here our selection is a single pointer stored outside the object.
if (ImGui::BeginCombo("combo 1", item_current, flags)) // The second parameter is the label previewed before opening the combo.
{
for (int n = 0; n < IM_ARRAYSIZE(items); n++)
{
bool is_selected = (item_current == items[n]);
if (ImGui::Selectable(items[n], is_selected))
item_current = items[n];
if (is_selected)
ImGui::SetItemDefaultFocus(); // Set the initial focus when opening the combo (scrolling + for keyboard navigation support in the upcoming navigation branch)
}
ImGui::EndCombo();
}
// Simplified one-liner Combo() API, using values packed in a single constant string
static int item_current_2 = 0;
ImGui::Combo("combo 2 (one-liner)", &item_current_2, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
// Simplified one-liner Combo() using an array of const char*
static int item_current_3 = -1; // If the selection isn't within 0..count, Combo won't display a preview
ImGui::Combo("combo 3 (array)", &item_current_3, items, IM_ARRAYSIZE(items));
// Simplified one-liner Combo() using an accessor function
struct FuncHolder { static bool ItemGetter(void* data, int idx, const char** out_str) { *out_str = ((const char**)data)[idx]; return true; } };
static int item_current_4 = 0;
ImGui::Combo("combo 4 (function)", &item_current_4, &FuncHolder::ItemGetter, items, IM_ARRAYSIZE(items));
ImGui::TreePop();
}
if (ImGui::TreeNode("Selectables"))
{
// Selectable() has 2 overloads:
// - The one taking "bool selected" as a read-only selection information. When Selectable() has been clicked is returns true and you can alter selection state accordingly.
// - The one taking "bool* p_selected" as a read-write selection information (convenient in some cases)
// The earlier is more flexible, as in real application your selection may be stored in a different manner (in flags within objects, as an external list, etc).
if (ImGui::TreeNode("Basic"))
{
static bool selection[5] = { false, true, false, false, false };
ImGui::Selectable("1. I am selectable", &selection[0]);
ImGui::Selectable("2. I am selectable", &selection[1]);
ImGui::Text("3. I am not selectable");
ImGui::Selectable("4. I am selectable", &selection[3]);
if (ImGui::Selectable("5. I am double clickable", selection[4], ImGuiSelectableFlags_AllowDoubleClick))
if (ImGui::IsMouseDoubleClicked(0))
selection[4] = !selection[4];
ImGui::TreePop();
}
if (ImGui::TreeNode("Selection State: Single Selection"))
{
static int selected = -1;
for (int n = 0; n < 5; n++)
{
char buf[32];
sprintf(buf, "Object %d", n);
if (ImGui::Selectable(buf, selected == n))
selected = n;
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Selection State: Multiple Selection"))
{
ShowHelpMarker("Hold CTRL and click to select multiple items.");
static bool selection[5] = { false, false, false, false, false };
for (int n = 0; n < 5; n++)
{
char buf[32];
sprintf(buf, "Object %d", n);
if (ImGui::Selectable(buf, selection[n]))
{
if (!ImGui::GetIO().KeyCtrl) // Clear selection when CTRL is not held
memset(selection, 0, sizeof(selection));
selection[n] ^= 1;
}
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Rendering more text into the same line"))
{
// Using the Selectable() override that takes "bool* p_selected" parameter and toggle your booleans automatically.
static bool selected[3] = { false, false, false };
ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(300); ImGui::Text("12,345 bytes");
ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
ImGui::TreePop();
}
if (ImGui::TreeNode("In columns"))
{
ImGui::Columns(3, NULL, false);
static bool selected[16] = { 0 };
for (int i = 0; i < 16; i++)
{
char label[32]; sprintf(label, "Item %d", i);
if (ImGui::Selectable(label, &selected[i])) {}
ImGui::NextColumn();
}
ImGui::Columns(1);
ImGui::TreePop();
}
if (ImGui::TreeNode("Grid"))
{
static bool selected[16] = { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true };
for (int i = 0; i < 16; i++)
{
ImGui::PushID(i);
if (ImGui::Selectable("Sailor", &selected[i], 0, ImVec2(50,50)))
{
int x = i % 4, y = i / 4;
if (x > 0) selected[i - 1] ^= 1;
if (x < 3) selected[i + 1] ^= 1;
if (y > 0) selected[i - 4] ^= 1;
if (y < 3) selected[i + 4] ^= 1;
}
if ((i % 4) < 3) ImGui::SameLine();
ImGui::PopID();
}
ImGui::TreePop();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Filtered Text Input"))
{
static char buf1[64] = ""; ImGui::InputText("default", buf1, 64);
static char buf2[64] = ""; ImGui::InputText("decimal", buf2, 64, ImGuiInputTextFlags_CharsDecimal);
static char buf3[64] = ""; ImGui::InputText("hexadecimal", buf3, 64, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase);
static char buf4[64] = ""; ImGui::InputText("uppercase", buf4, 64, ImGuiInputTextFlags_CharsUppercase);
static char buf5[64] = ""; ImGui::InputText("no blank", buf5, 64, ImGuiInputTextFlags_CharsNoBlank);
struct TextFilters { static int FilterImGuiLetters(ImGuiTextEditCallbackData* data) { if (data->EventChar < 256 && strchr("imgui", (char)data->EventChar)) return 0; return 1; } };
static char buf6[64] = ""; ImGui::InputText("\"imgui\" letters", buf6, 64, ImGuiInputTextFlags_CallbackCharFilter, TextFilters::FilterImGuiLetters);
ImGui::Text("Password input");
static char bufpass[64] = "password123";
ImGui::InputText("password", bufpass, 64, ImGuiInputTextFlags_Password | ImGuiInputTextFlags_CharsNoBlank);
ImGui::SameLine(); ShowHelpMarker("Display all characters as '*'.\nDisable clipboard cut and copy.\nDisable logging.\n");
ImGui::InputText("password (clear)", bufpass, 64, ImGuiInputTextFlags_CharsNoBlank);
ImGui::TreePop();
}
if (ImGui::TreeNode("Multi-line Text Input"))
{
static bool read_only = false;
static char text[1024*16] =
"/*\n"
" The Pentium F00F bug, shorthand for F0 0F C7 C8,\n"
" the hexadecimal encoding of one offending instruction,\n"
" more formally, the invalid operand with locked CMPXCHG8B\n"
" instruction bug, is a design flaw in the majority of\n"
" Intel Pentium, Pentium MMX, and Pentium OverDrive\n"
" processors (all in the P5 microarchitecture).\n"
"*/\n\n"
"label:\n"
"\tlock cmpxchg8b eax\n";
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0));
ImGui::Checkbox("Read-only", &read_only);
ImGui::PopStyleVar();
ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-1.0f, ImGui::GetTextLineHeight() * 16), ImGuiInputTextFlags_AllowTabInput | (read_only ? ImGuiInputTextFlags_ReadOnly : 0));
ImGui::TreePop();
}
if (ImGui::TreeNode("Plots Widgets"))
{
static bool animate = true;
ImGui::Checkbox("Animate", &animate);
static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr));
// Create a dummy array of contiguous float values to plot
// Tip: If your float aren't contiguous but part of a structure, you can pass a pointer to your first float and the sizeof() of your structure in the Stride parameter.
static float values[90] = { 0 };
static int values_offset = 0;
static double refresh_time = 0.0;
if (!animate || refresh_time == 0.0f)
refresh_time = ImGui::GetTime();
while (refresh_time < ImGui::GetTime()) // Create dummy data at fixed 60 hz rate for the demo
{
static float phase = 0.0f;
values[values_offset] = cosf(phase);
values_offset = (values_offset+1) % IM_ARRAYSIZE(values);
phase += 0.10f*values_offset;
refresh_time += 1.0f/60.0f;
}
ImGui::PlotLines("Lines", values, IM_ARRAYSIZE(values), values_offset, "avg 0.0", -1.0f, 1.0f, ImVec2(0,80));
ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0,80));
// Use functions to generate output
// FIXME: This is rather awkward because current plot API only pass in indices. We probably want an API passing floats and user provide sample rate/count.
struct Funcs
{
static float Sin(void*, int i) { return sinf(i * 0.1f); }
static float Saw(void*, int i) { return (i & 1) ? 1.0f : -1.0f; }
};
static int func_type = 0, display_count = 70;
ImGui::Separator();
ImGui::PushItemWidth(100); ImGui::Combo("func", &func_type, "Sin\0Saw\0"); ImGui::PopItemWidth();
ImGui::SameLine();
ImGui::SliderInt("Sample count", &display_count, 1, 400);
float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw;
ImGui::PlotLines("Lines", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0,80));
ImGui::PlotHistogram("Histogram", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0,80));
ImGui::Separator();
// Animate a simple progress bar
static float progress = 0.0f, progress_dir = 1.0f;
if (animate)
{
progress += progress_dir * 0.4f * ImGui::GetIO().DeltaTime;
if (progress >= +1.1f) { progress = +1.1f; progress_dir *= -1.0f; }
if (progress <= -0.1f) { progress = -0.1f; progress_dir *= -1.0f; }
}
// Typically we would use ImVec2(-1.0f,0.0f) to use all available width, or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth.
ImGui::ProgressBar(progress, ImVec2(0.0f,0.0f));
ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
ImGui::Text("Progress Bar");
float progress_saturated = (progress < 0.0f) ? 0.0f : (progress > 1.0f) ? 1.0f : progress;
char buf[32];
sprintf(buf, "%d/%d", (int)(progress_saturated*1753), 1753);
ImGui::ProgressBar(progress, ImVec2(0.f,0.f), buf);
ImGui::TreePop();
}
if (ImGui::TreeNode("Color/Picker Widgets"))
{
static ImVec4 color = ImColor(114, 144, 154, 200);
static bool alpha_preview = true;
static bool alpha_half_preview = false;
static bool drag_and_drop = true;
static bool options_menu = true;
static bool hdr = false;
ImGui::Checkbox("With Alpha Preview", &alpha_preview);
ImGui::Checkbox("With Half Alpha Preview", &alpha_half_preview);
ImGui::Checkbox("With Drag and Drop", &drag_and_drop);
ImGui::Checkbox("With Options Menu", &options_menu); ImGui::SameLine(); ShowHelpMarker("Right-click on the individual color widget to show options.");
ImGui::Checkbox("With HDR", &hdr); ImGui::SameLine(); ShowHelpMarker("Currently all this does is to lift the 0..1 limits on dragging widgets.");
int misc_flags = (hdr ? ImGuiColorEditFlags_HDR : 0) | (drag_and_drop ? 0 : ImGuiColorEditFlags_NoDragDrop) | (alpha_half_preview ? ImGuiColorEditFlags_AlphaPreviewHalf : (alpha_preview ? ImGuiColorEditFlags_AlphaPreview : 0)) | (options_menu ? 0 : ImGuiColorEditFlags_NoOptions);
ImGui::Text("Color widget:");
ImGui::SameLine(); ShowHelpMarker("Click on the colored square to open a color picker.\nCTRL+click on individual component to input value.\n");
ImGui::ColorEdit3("MyColor##1", (float*)&color, misc_flags);
ImGui::Text("Color widget HSV with Alpha:");
ImGui::ColorEdit4("MyColor##2", (float*)&color, ImGuiColorEditFlags_HSV | misc_flags);
ImGui::Text("Color widget with Float Display:");
ImGui::ColorEdit4("MyColor##2f", (float*)&color, ImGuiColorEditFlags_Float | misc_flags);
ImGui::Text("Color button with Picker:");
ImGui::SameLine(); ShowHelpMarker("With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\nWith the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only be used for the tooltip and picker popup.");
ImGui::ColorEdit4("MyColor##3", (float*)&color, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | misc_flags);
ImGui::Text("Color button with Custom Picker Popup:");
// Generate a dummy palette
static bool saved_palette_inited = false;
static ImVec4 saved_palette[32];
if (!saved_palette_inited)
for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++)
{
ImGui::ColorConvertHSVtoRGB(n / 31.0f, 0.8f, 0.8f, saved_palette[n].x, saved_palette[n].y, saved_palette[n].z);
saved_palette[n].w = 1.0f; // Alpha
}
saved_palette_inited = true;
static ImVec4 backup_color;
bool open_popup = ImGui::ColorButton("MyColor##3b", color, misc_flags);
ImGui::SameLine();
open_popup |= ImGui::Button("Palette");
if (open_popup)
{
ImGui::OpenPopup("mypicker");
backup_color = color;
}
if (ImGui::BeginPopup("mypicker"))
{
// FIXME: Adding a drag and drop example here would be perfect!
ImGui::Text("MY CUSTOM COLOR PICKER WITH AN AMAZING PALETTE!");
ImGui::Separator();
ImGui::ColorPicker4("##picker", (float*)&color, misc_flags | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoSmallPreview);
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Text("Current");
ImGui::ColorButton("##current", color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60,40));
ImGui::Text("Previous");
if (ImGui::ColorButton("##previous", backup_color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60,40)))
color = backup_color;
ImGui::Separator();
ImGui::Text("Palette");
for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++)
{
ImGui::PushID(n);
if ((n % 8) != 0)
ImGui::SameLine(0.0f, ImGui::GetStyle().ItemSpacing.y);
if (ImGui::ColorButton("##palette", saved_palette[n], ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoTooltip, ImVec2(20,20)))
color = ImVec4(saved_palette[n].x, saved_palette[n].y, saved_palette[n].z, color.w); // Preserve alpha!
if (ImGui::BeginDragDropTarget())
{
if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F))
memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 3);
if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F))
memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 4);
EndDragDropTarget();
}
ImGui::PopID();
}
ImGui::EndGroup();
ImGui::EndPopup();
}
ImGui::Text("Color button only:");
ImGui::ColorButton("MyColor##3c", *(ImVec4*)&color, misc_flags, ImVec2(80,80));
ImGui::Text("Color picker:");
static bool alpha = true;
static bool alpha_bar = true;
static bool side_preview = true;
static bool ref_color = false;
static ImVec4 ref_color_v(1.0f,0.0f,1.0f,0.5f);
static int inputs_mode = 2;
static int picker_mode = 0;
ImGui::Checkbox("With Alpha", &alpha);
ImGui::Checkbox("With Alpha Bar", &alpha_bar);
ImGui::Checkbox("With Side Preview", &side_preview);
if (side_preview)
{
ImGui::SameLine();
ImGui::Checkbox("With Ref Color", &ref_color);
if (ref_color)
{
ImGui::SameLine();
ImGui::ColorEdit4("##RefColor", &ref_color_v.x, ImGuiColorEditFlags_NoInputs | misc_flags);
}
}
ImGui::Combo("Inputs Mode", &inputs_mode, "All Inputs\0No Inputs\0RGB Input\0HSV Input\0HEX Input\0");
ImGui::Combo("Picker Mode", &picker_mode, "Auto/Current\0Hue bar + SV rect\0Hue wheel + SV triangle\0");
ImGui::SameLine(); ShowHelpMarker("User can right-click the picker to change mode.");
ImGuiColorEditFlags flags = misc_flags;
if (!alpha) flags |= ImGuiColorEditFlags_NoAlpha; // This is by default if you call ColorPicker3() instead of ColorPicker4()
if (alpha_bar) flags |= ImGuiColorEditFlags_AlphaBar;
if (!side_preview) flags |= ImGuiColorEditFlags_NoSidePreview;
if (picker_mode == 1) flags |= ImGuiColorEditFlags_PickerHueBar;
if (picker_mode == 2) flags |= ImGuiColorEditFlags_PickerHueWheel;
if (inputs_mode == 1) flags |= ImGuiColorEditFlags_NoInputs;
if (inputs_mode == 2) flags |= ImGuiColorEditFlags_RGB;
if (inputs_mode == 3) flags |= ImGuiColorEditFlags_HSV;
if (inputs_mode == 4) flags |= ImGuiColorEditFlags_HEX;
ImGui::ColorPicker4("MyColor##4", (float*)&color, flags, ref_color ? &ref_color_v.x : NULL);
ImGui::Text("Programmatically set defaults:");
ImGui::SameLine(); ShowHelpMarker("SetColorEditOptions() is designed to allow you to set boot-time default.\nWe don't have Push/Pop functions because you can force options on a per-widget basis if needed, and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid encouraging you to persistently save values that aren't forward-compatible.");
if (ImGui::Button("Default: Uint8 + HSV + Hue Bar"))
ImGui::SetColorEditOptions(ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_HSV | ImGuiColorEditFlags_PickerHueBar);
if (ImGui::Button("Default: Float + HDR + Hue Wheel"))
ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel);
ImGui::TreePop();
}
if (ImGui::TreeNode("Range Widgets"))
{
static float begin = 10, end = 90;
static int begin_i = 100, end_i = 1000;
ImGui::DragFloatRange2("range", &begin, &end, 0.25f, 0.0f, 100.0f, "Min: %.1f %%", "Max: %.1f %%");
ImGui::DragIntRange2("range int (no bounds)", &begin_i, &end_i, 5, 0, 0, "Min: %d units", "Max: %d units");
ImGui::TreePop();
}
if (ImGui::TreeNode("Data Types"))
{
// The DragScalar/InputScalar/SliderScalar functions allow various data types: signed/unsigned int/long long and float/double
// To avoid polluting the public API with all possible combinations, we use the ImGuiDataType enum to pass the type,
// and passing all arguments by address.
// This is the reason the test code below creates local variables to hold "zero" "one" etc. for each types.
// In practice, if you frequently use a given type that is not covered by the normal API entry points, you can wrap it
// yourself inside a 1 line function which can take typed argument as value instead of void*, and then pass their address
// to the generic function. For example:
// bool MySliderU64(const char *label, u64* value, u64 min = 0, u64 max = 0, const char* format = "%lld")
// {
// return SliderScalar(label, ImGuiDataType_U64, value, &min, &max, format);
// }
// Limits (as helper variables that we can take the address of)
// Note that the SliderScalar function has a maximum usable range of half the natural type maximum, hence the /2 below.
#ifndef LLONG_MIN
ImS64 LLONG_MIN = -9223372036854775807LL - 1;
ImS64 LLONG_MAX = 9223372036854775807LL;
ImU64 ULLONG_MAX = (2ULL * 9223372036854775807LL + 1);
#endif
const ImS32 s32_zero = 0, s32_one = 1, s32_fifty = 50, s32_min = INT_MIN/2, s32_max = INT_MAX/2, s32_hi_a = INT_MAX/2 - 100, s32_hi_b = INT_MAX/2;
const ImU32 u32_zero = 0, u32_one = 1, u32_fifty = 50, u32_min = 0, u32_max = UINT_MAX/2, u32_hi_a = UINT_MAX/2 - 100, u32_hi_b = UINT_MAX/2;
const ImS64 s64_zero = 0, s64_one = 1, s64_fifty = 50, s64_min = LLONG_MIN/2, s64_max = LLONG_MAX/2, s64_hi_a = LLONG_MAX/2 - 100, s64_hi_b = LLONG_MAX/2;
const ImU64 u64_zero = 0, u64_one = 1, u64_fifty = 50, u64_min = 0, u64_max = ULLONG_MAX/2, u64_hi_a = ULLONG_MAX/2 - 100, u64_hi_b = ULLONG_MAX/2;
const float f32_zero = 0.f, f32_one = 1.f, f32_lo_a = -10000000000.0f, f32_hi_a = +10000000000.0f;
const double f64_zero = 0., f64_one = 1., f64_lo_a = -1000000000000000.0, f64_hi_a = +1000000000000000.0;
// State
static ImS32 s32_v = -1;
static ImU32 u32_v = (ImU32)-1;
static ImS64 s64_v = -1;
static ImU64 u64_v = (ImU64)-1;
static float f32_v = 0.123f;
static double f64_v = 90000.01234567890123456789;
const float drag_speed = 0.2f;
static bool drag_clamp = false;
ImGui::Text("Drags:");
ImGui::Checkbox("Clamp integers to 0..50", &drag_clamp); ImGui::SameLine(); ShowHelpMarker("As with every widgets in dear imgui, we never modify values unless there is a user interaction.\nYou can override the clamping limits by using CTRL+Click to input a value.");
ImGui::DragScalar("drag s32", ImGuiDataType_S32, &s32_v, drag_speed, drag_clamp ? &s32_zero : NULL, drag_clamp ? &s32_fifty : NULL);
ImGui::DragScalar("drag u32", ImGuiDataType_U32, &u32_v, drag_speed, drag_clamp ? &u32_zero : NULL, drag_clamp ? &u32_fifty : NULL, "%u ms");
ImGui::DragScalar("drag s64", ImGuiDataType_S64, &s64_v, drag_speed, drag_clamp ? &s64_zero : NULL, drag_clamp ? &s64_fifty : NULL);
ImGui::DragScalar("drag u64", ImGuiDataType_U64, &u64_v, drag_speed, drag_clamp ? &u64_zero : NULL, drag_clamp ? &u64_fifty : NULL);
ImGui::DragScalar("drag float", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f", 1.0f);
ImGui::DragScalar("drag float ^2", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f", 2.0f); ImGui::SameLine(); ShowHelpMarker("You can use the 'power' parameter to increase tweaking precision on one side of the range.");
ImGui::DragScalar("drag double", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, NULL, "%.10f grams", 1.0f);
ImGui::DragScalar("drag double ^2", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, &f64_one, "0 < %.10f < 1", 2.0f);
ImGui::Text("Sliders");
ImGui::SliderScalar("slider s32 low", ImGuiDataType_S32, &s32_v, &s32_zero, &s32_fifty,"%d");
ImGui::SliderScalar("slider s32 high", ImGuiDataType_S32, &s32_v, &s32_hi_a, &s32_hi_b, "%d");
ImGui::SliderScalar("slider s32 full", ImGuiDataType_S32, &s32_v, &s32_min, &s32_max, "%d");
ImGui::SliderScalar("slider u32 low", ImGuiDataType_U32, &u32_v, &u32_zero, &u32_fifty,"%u");
ImGui::SliderScalar("slider u32 high", ImGuiDataType_U32, &u32_v, &u32_hi_a, &u32_hi_b, "%u");
ImGui::SliderScalar("slider u32 full", ImGuiDataType_U32, &u32_v, &u32_min, &u32_max, "%u");
ImGui::SliderScalar("slider s64 low", ImGuiDataType_S64, &s64_v, &s64_zero, &s64_fifty,"%I64d");
ImGui::SliderScalar("slider s64 high", ImGuiDataType_S64, &s64_v, &s64_hi_a, &s64_hi_b, "%I64d");
ImGui::SliderScalar("slider s64 full", ImGuiDataType_S64, &s64_v, &s64_min, &s64_max, "%I64d");
ImGui::SliderScalar("slider u64 low", ImGuiDataType_U64, &u64_v, &u64_zero, &u64_fifty,"%I64u ms");
ImGui::SliderScalar("slider u64 high", ImGuiDataType_U64, &u64_v, &u64_hi_a, &u64_hi_b, "%I64u ms");
ImGui::SliderScalar("slider u64 full", ImGuiDataType_U64, &u64_v, &u64_min, &u64_max, "%I64u ms");
ImGui::SliderScalar("slider float low", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one);
ImGui::SliderScalar("slider float low^2", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one, "%.10f", 2.0f);
ImGui::SliderScalar("slider float high", ImGuiDataType_Float, &f32_v, &f32_lo_a, &f32_hi_a, "%e");
ImGui::SliderScalar("slider double low", ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f grams", 1.0f);
ImGui::SliderScalar("slider double low^2",ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f", 2.0f);
ImGui::SliderScalar("slider double high", ImGuiDataType_Double, &f64_v, &f64_lo_a, &f64_hi_a, "%e grams", 1.0f);
static bool inputs_step = true;
ImGui::Text("Inputs");
ImGui::Checkbox("Show step buttons", &inputs_step);
ImGui::InputScalar("input s32", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%d");
ImGui::InputScalar("input s32 hex", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%08X", ImGuiInputTextFlags_CharsHexadecimal);
ImGui::InputScalar("input u32", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%u");
ImGui::InputScalar("input u32 hex", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%08X", ImGuiInputTextFlags_CharsHexadecimal);
ImGui::InputScalar("input s64", ImGuiDataType_S64, &s64_v, inputs_step ? &s64_one : NULL);
ImGui::InputScalar("input u64", ImGuiDataType_U64, &u64_v, inputs_step ? &u64_one : NULL);
ImGui::InputScalar("input float", ImGuiDataType_Float, &f32_v, inputs_step ? &f32_one : NULL);
ImGui::InputScalar("input double", ImGuiDataType_Double, &f64_v, inputs_step ? &f64_one : NULL);
ImGui::TreePop();
}
if (ImGui::TreeNode("Multi-component Widgets"))
{
static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
static int vec4i[4] = { 1, 5, 100, 255 };
ImGui::InputFloat2("input float2", vec4f);
ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f);
ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f);
ImGui::InputInt2("input int2", vec4i);
ImGui::DragInt2("drag int2", vec4i, 1, 0, 255);
ImGui::SliderInt2("slider int2", vec4i, 0, 255);
ImGui::Spacing();
ImGui::InputFloat3("input float3", vec4f);
ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f);
ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f);
ImGui::InputInt3("input int3", vec4i);
ImGui::DragInt3("drag int3", vec4i, 1, 0, 255);
ImGui::SliderInt3("slider int3", vec4i, 0, 255);
ImGui::Spacing();
ImGui::InputFloat4("input float4", vec4f);
ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f);
ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f);
ImGui::InputInt4("input int4", vec4i);
ImGui::DragInt4("drag int4", vec4i, 1, 0, 255);
ImGui::SliderInt4("slider int4", vec4i, 0, 255);
ImGui::TreePop();
}
if (ImGui::TreeNode("Vertical Sliders"))
{
const float spacing = 4;
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(spacing, spacing));
static int int_value = 0;
ImGui::VSliderInt("##int", ImVec2(18,160), &int_value, 0, 5);
ImGui::SameLine();
static float values[7] = { 0.0f, 0.60f, 0.35f, 0.9f, 0.70f, 0.20f, 0.0f };
ImGui::PushID("set1");
for (int i = 0; i < 7; i++)
{
if (i > 0) ImGui::SameLine();
ImGui::PushID(i);
ImGui::PushStyleColor(ImGuiCol_FrameBg, (ImVec4)ImColor::HSV(i/7.0f, 0.5f, 0.5f));
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, (ImVec4)ImColor::HSV(i/7.0f, 0.6f, 0.5f));
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, (ImVec4)ImColor::HSV(i/7.0f, 0.7f, 0.5f));
ImGui::PushStyleColor(ImGuiCol_SliderGrab, (ImVec4)ImColor::HSV(i/7.0f, 0.9f, 0.9f));
ImGui::VSliderFloat("##v", ImVec2(18,160), &values[i], 0.0f, 1.0f, "");
if (ImGui::IsItemActive() || ImGui::IsItemHovered())
ImGui::SetTooltip("%.3f", values[i]);
ImGui::PopStyleColor(4);
ImGui::PopID();
}
ImGui::PopID();
ImGui::SameLine();
ImGui::PushID("set2");
static float values2[4] = { 0.20f, 0.80f, 0.40f, 0.25f };
const int rows = 3;
const ImVec2 small_slider_size(18, (160.0f-(rows-1)*spacing)/rows);
for (int nx = 0; nx < 4; nx++)
{
if (nx > 0) ImGui::SameLine();
ImGui::BeginGroup();
for (int ny = 0; ny < rows; ny++)
{
ImGui::PushID(nx*rows+ny);
ImGui::VSliderFloat("##v", small_slider_size, &values2[nx], 0.0f, 1.0f, "");
if (ImGui::IsItemActive() || ImGui::IsItemHovered())
ImGui::SetTooltip("%.3f", values2[nx]);
ImGui::PopID();
}
ImGui::EndGroup();
}
ImGui::PopID();
ImGui::SameLine();
ImGui::PushID("set3");
for (int i = 0; i < 4; i++)
{
if (i > 0) ImGui::SameLine();
ImGui::PushID(i);
ImGui::PushStyleVar(ImGuiStyleVar_GrabMinSize, 40);
ImGui::VSliderFloat("##v", ImVec2(40,160), &values[i], 0.0f, 1.0f, "%.2f\nsec");
ImGui::PopStyleVar();
ImGui::PopID();
}
ImGui::PopID();
ImGui::PopStyleVar();
ImGui::TreePop();
}
if (ImGui::TreeNode("Drag and Drop"))
{
{
// ColorEdit widgets automatically act as drag source and drag target.
// They are using standardized payload strings IMGUI_PAYLOAD_TYPE_COLOR_3F and IMGUI_PAYLOAD_TYPE_COLOR_4F to allow your own widgets
// to use colors in their drag and drop interaction. Also see the demo in Color Picker -> Palette demo.
ImGui::BulletText("Drag and drop in standard widgets");
ImGui::Indent();
static float col1[3] = { 1.0f,0.0f,0.2f };
static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
ImGui::ColorEdit3("color 1", col1);
ImGui::ColorEdit4("color 2", col2);
ImGui::Unindent();
}
{
ImGui::BulletText("Drag and drop to copy/swap items");
ImGui::Indent();
enum Mode
{
Mode_Copy,
Mode_Move,
Mode_Swap
};
static int mode = 0;
if (ImGui::RadioButton("Copy", mode == Mode_Copy)) { mode = Mode_Copy; } ImGui::SameLine();
if (ImGui::RadioButton("Move", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine();
if (ImGui::RadioButton("Swap", mode == Mode_Swap)) { mode = Mode_Swap; }
static const char* names[9] = { "Bobby", "Beatrice", "Betty", "Brianna", "Barry", "Bernard", "Bibi", "Blaine", "Bryn" };
for (int n = 0; n < IM_ARRAYSIZE(names); n++)
{
ImGui::PushID(n);
if ((n % 3) != 0)
ImGui::SameLine();
ImGui::Button(names[n], ImVec2(60,60));
// Our buttons are both drag sources and drag targets here!
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None))
{
ImGui::SetDragDropPayload("DND_DEMO_CELL", &n, sizeof(int)); // Set payload to carry the index of our item (could be anything)
if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); } // Display preview (could be anything, e.g. when dragging an image we could decide to display the filename and a small preview of the image, etc.)
if (mode == Mode_Move) { ImGui::Text("Move %s", names[n]); }
if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); }
ImGui::EndDragDropSource();
}
if (ImGui::BeginDragDropTarget())
{
if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("DND_DEMO_CELL"))
{
IM_ASSERT(payload->DataSize == sizeof(int));
int payload_n = *(const int*)payload->Data;
if (mode == Mode_Copy)
{
names[n] = names[payload_n];
}
if (mode == Mode_Move)
{
names[n] = names[payload_n];
names[payload_n] = "";
}
if (mode == Mode_Swap)
{
const char* tmp = names[n];
names[n] = names[payload_n];
names[payload_n] = tmp;
}
}
ImGui::EndDragDropTarget();
}
ImGui::PopID();
}
ImGui::Unindent();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Active, Focused, Hovered & Focused Tests"))
{
// Display the value of IsItemHovered() and other common item state functions. Note that the flags can be combined.
// (because BulletText is an item itself and that would affect the output of IsItemHovered() we pass all state in a single call to simplify the code).
static int item_type = 1;
static bool b = false;
static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
ImGui::RadioButton("Text", &item_type, 0); ImGui::SameLine();
ImGui::RadioButton("Button", &item_type, 1); ImGui::SameLine();
ImGui::RadioButton("CheckBox", &item_type, 2); ImGui::SameLine();
ImGui::RadioButton("SliderFloat", &item_type, 3); ImGui::SameLine();
ImGui::RadioButton("ColorEdit4", &item_type, 4); ImGui::SameLine();
ImGui::RadioButton("ListBox", &item_type, 5);
bool ret = false;
if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction
if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button
if (item_type == 2) { ret = ImGui::Checkbox("ITEM: CheckBox", &b); } // Testing checkbox
if (item_type == 3) { ret = ImGui::SliderFloat("ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); } // Testing basic item
if (item_type == 4) { ret = ImGui::ColorEdit4("ITEM: ColorEdit4", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged)
if (item_type == 5) { const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", ¤t, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); }
ImGui::BulletText(
"Return value = %d\n"
"IsItemFocused() = %d\n"
"IsItemHovered() = %d\n"
"IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
"IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
"IsItemHovered(_AllowWhenOverlapped) = %d\n"
"IsItemHovered(_RectOnly) = %d\n"
"IsItemActive() = %d\n"
"IsItemDeactivated() = %d\n"
"IsItemDeactivatedAfterChange() = %d\n"
"IsItemVisible() = %d\n",
ret,
ImGui::IsItemFocused(),
ImGui::IsItemHovered(),
ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup),
ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenOverlapped),
ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly),
ImGui::IsItemActive(),
ImGui::IsItemDeactivated(),
ImGui::IsItemDeactivatedAfterChange(),
ImGui::IsItemVisible()
);
static bool embed_all_inside_a_child_window = false;
ImGui::Checkbox("Embed everything inside a child window (for additional testing)", &embed_all_inside_a_child_window);
if (embed_all_inside_a_child_window)
ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20), true);
// Testing IsWindowFocused() function with its various flags. Note that the flags can be combined.
ImGui::BulletText(
"IsWindowFocused() = %d\n"
"IsWindowFocused(_ChildWindows) = %d\n"
"IsWindowFocused(_ChildWindows|_RootWindow) = %d\n"
"IsWindowFocused(_RootWindow) = %d\n"
"IsWindowFocused(_AnyWindow) = %d\n",
ImGui::IsWindowFocused(),
ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows),
ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows | ImGuiFocusedFlags_RootWindow),
ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow),
ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow));
// Testing IsWindowHovered() function with its various flags. Note that the flags can be combined.
ImGui::BulletText(
"IsWindowHovered() = %d\n"
"IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n"
"IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n"
"IsWindowHovered(_ChildWindows) = %d\n"
"IsWindowHovered(_ChildWindows|_RootWindow) = %d\n"
"IsWindowHovered(_RootWindow) = %d\n"
"IsWindowHovered(_AnyWindow) = %d\n",
ImGui::IsWindowHovered(),
ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup),
ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows),
ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow),
ImGui::IsWindowHovered(ImGuiHoveredFlags_RootWindow),
ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow));
ImGui::BeginChild("child", ImVec2(0, 50), true);
ImGui::Text("This is another child window for testing with the _ChildWindows flag.");
ImGui::EndChild();
if (embed_all_inside_a_child_window)
EndChild();
// Calling IsItemHovered() after begin returns the hovered status of the title bar.
// This is useful in particular if you want to create a context menu (with BeginPopupContextItem) associated to the title bar of a window.
static bool test_window = false;
ImGui::Checkbox("Hovered/Active tests after Begin() for title bar testing", &test_window);
if (test_window)
{
ImGui::Begin("Title bar Hovered/Active tests", &test_window);
if (ImGui::BeginPopupContextItem()) // <-- This is using IsItemHovered()
{
if (ImGui::MenuItem("Close")) { test_window = false; }
ImGui::EndPopup();
}
ImGui::Text(
"IsItemHovered() after begin = %d (== is title bar hovered)\n"
"IsItemActive() after begin = %d (== is window being clicked/moved)\n",
ImGui::IsItemHovered(), ImGui::IsItemActive());
ImGui::End();
}
ImGui::TreePop();
}
}
if (ImGui::CollapsingHeader("Layout"))
{
if (ImGui::TreeNode("Child regions"))
{
static bool disable_mouse_wheel = false;
static bool disable_menu = false;
ImGui::Checkbox("Disable Mouse Wheel", &disable_mouse_wheel);
ImGui::Checkbox("Disable Menu", &disable_menu);
static int line = 50;
bool goto_line = ImGui::Button("Goto");
ImGui::SameLine();
ImGui::PushItemWidth(100);
goto_line |= ImGui::InputInt("##Line", &line, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue);
ImGui::PopItemWidth();
// Child 1: no border, enable horizontal scrollbar
{
ImGui::BeginChild("Child1", ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f, 300), false, ImGuiWindowFlags_HorizontalScrollbar | (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0));
for (int i = 0; i < 100; i++)
{
ImGui::Text("%04d: scrollable region", i);
if (goto_line && line == i)
ImGui::SetScrollHere();
}
if (goto_line && line >= 100)
ImGui::SetScrollHere();
ImGui::EndChild();
}
ImGui::SameLine();
// Child 2: rounded border
{
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f);
ImGui::BeginChild("Child2", ImVec2(0,300), true, (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0) | (disable_menu ? 0 : ImGuiWindowFlags_MenuBar));
if (!disable_menu && ImGui::BeginMenuBar())
{
if (ImGui::BeginMenu("Menu"))
{
ShowExampleMenuFile();
ImGui::EndMenu();
}
ImGui::EndMenuBar();
}
ImGui::Columns(2);
for (int i = 0; i < 100; i++)
{
char buf[32];
sprintf(buf, "%03d", i);
ImGui::Button(buf, ImVec2(-1.0f, 0.0f));
ImGui::NextColumn();
}
ImGui::EndChild();
ImGui::PopStyleVar();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Widgets Width"))
{
static float f = 0.0f;
ImGui::Text("PushItemWidth(100)");
ImGui::SameLine(); ShowHelpMarker("Fixed width.");
ImGui::PushItemWidth(100);
ImGui::DragFloat("float##1", &f);
ImGui::PopItemWidth();
ImGui::Text("PushItemWidth(GetWindowWidth() * 0.5f)");
ImGui::SameLine(); ShowHelpMarker("Half of window width.");
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5f);
ImGui::DragFloat("float##2", &f);
ImGui::PopItemWidth();
ImGui::Text("PushItemWidth(GetContentRegionAvailWidth() * 0.5f)");
ImGui::SameLine(); ShowHelpMarker("Half of available width.\n(~ right-cursor_pos)\n(works within a column set)");
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() * 0.5f);
ImGui::DragFloat("float##3", &f);
ImGui::PopItemWidth();
ImGui::Text("PushItemWidth(-100)");
ImGui::SameLine(); ShowHelpMarker("Align to right edge minus 100");
ImGui::PushItemWidth(-100);
ImGui::DragFloat("float##4", &f);
ImGui::PopItemWidth();
ImGui::Text("PushItemWidth(-1)");
ImGui::SameLine(); ShowHelpMarker("Align to right edge");
ImGui::PushItemWidth(-1);
ImGui::DragFloat("float##5", &f);
ImGui::PopItemWidth();
ImGui::TreePop();
}
if (ImGui::TreeNode("Basic Horizontal Layout"))
{
ImGui::TextWrapped("(Use ImGui::SameLine() to keep adding items to the right of the preceding item)");
// Text
ImGui::Text("Two items: Hello"); ImGui::SameLine();
ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
// Adjust spacing
ImGui::Text("More spacing: Hello"); ImGui::SameLine(0, 20);
ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
// Button
ImGui::AlignTextToFramePadding();
ImGui::Text("Normal buttons"); ImGui::SameLine();
ImGui::Button("Banana"); ImGui::SameLine();
ImGui::Button("Apple"); ImGui::SameLine();
ImGui::Button("Corniflower");
// Button
ImGui::Text("Small buttons"); ImGui::SameLine();
ImGui::SmallButton("Like this one"); ImGui::SameLine();
ImGui::Text("can fit within a text block.");
// Aligned to arbitrary position. Easy/cheap column.
ImGui::Text("Aligned");
ImGui::SameLine(150); ImGui::Text("x=150");
ImGui::SameLine(300); ImGui::Text("x=300");
ImGui::Text("Aligned");
ImGui::SameLine(150); ImGui::SmallButton("x=150");
ImGui::SameLine(300); ImGui::SmallButton("x=300");
// Checkbox
static bool c1=false,c2=false,c3=false,c4=false;
ImGui::Checkbox("My", &c1); ImGui::SameLine();
ImGui::Checkbox("Tailor", &c2); ImGui::SameLine();
ImGui::Checkbox("Is", &c3); ImGui::SameLine();
ImGui::Checkbox("Rich", &c4);
// Various
static float f0=1.0f, f1=2.0f, f2=3.0f;
ImGui::PushItemWidth(80);
const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" };
static int item = -1;
ImGui::Combo("Combo", &item, items, IM_ARRAYSIZE(items)); ImGui::SameLine();
ImGui::SliderFloat("X", &f0, 0.0f,5.0f); ImGui::SameLine();
ImGui::SliderFloat("Y", &f1, 0.0f,5.0f); ImGui::SameLine();
ImGui::SliderFloat("Z", &f2, 0.0f,5.0f);
ImGui::PopItemWidth();
ImGui::PushItemWidth(80);
ImGui::Text("Lists:");
static int selection[4] = { 0, 1, 2, 3 };
for (int i = 0; i < 4; i++)
{
if (i > 0) ImGui::SameLine();
ImGui::PushID(i);
ImGui::ListBox("", &selection[i], items, IM_ARRAYSIZE(items));
ImGui::PopID();
//if (ImGui::IsItemHovered()) ImGui::SetTooltip("ListBox %d hovered", i);
}
ImGui::PopItemWidth();
// Dummy
ImVec2 button_sz(40,40);
ImGui::Button("A", button_sz); ImGui::SameLine();
ImGui::Dummy(button_sz); ImGui::SameLine();
ImGui::Button("B", button_sz);
// Manually wrapping (we should eventually provide this as an automatic layout feature, but for now you can do it manually)
ImGui::Text("Manually wrapping:");
ImGuiStyle& style = ImGui::GetStyle();
int buttons_count = 20;
float window_visible_x2 = ImGui::GetWindowPos().x + ImGui::GetWindowContentRegionMax().x;
for (int n = 0; n < buttons_count; n++)
{
ImGui::PushID(n);
ImGui::Button("Box", button_sz);
float last_button_x2 = ImGui::GetItemRectMax().x;
float next_button_x2 = last_button_x2 + style.ItemSpacing.x + button_sz.x; // Expected position if next button was on same line
if (n + 1 < buttons_count && next_button_x2 < window_visible_x2)
ImGui::SameLine();
ImGui::PopID();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Groups"))
{
ImGui::TextWrapped("(Using ImGui::BeginGroup()/EndGroup() to layout items. BeginGroup() basically locks the horizontal position. EndGroup() bundles the whole group so that you can use functions such as IsItemHovered() on it.)");
ImGui::BeginGroup();
{
ImGui::BeginGroup();
ImGui::Button("AAA");
ImGui::SameLine();
ImGui::Button("BBB");
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Button("CCC");
ImGui::Button("DDD");
ImGui::EndGroup();
ImGui::SameLine();
ImGui::Button("EEE");
ImGui::EndGroup();
if (ImGui::IsItemHovered())
ImGui::SetTooltip("First group hovered");
}
// Capture the group size and create widgets using the same size
ImVec2 size = ImGui::GetItemRectSize();
const float values[5] = { 0.5f, 0.20f, 0.80f, 0.60f, 0.25f };
ImGui::PlotHistogram("##values", values, IM_ARRAYSIZE(values), 0, NULL, 0.0f, 1.0f, size);
ImGui::Button("ACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f,size.y));
ImGui::SameLine();
ImGui::Button("REACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f,size.y));
ImGui::EndGroup();
ImGui::SameLine();
ImGui::Button("LEVERAGE\nBUZZWORD", size);
ImGui::SameLine();
if (ImGui::ListBoxHeader("List", size))
{
ImGui::Selectable("Selected", true);
ImGui::Selectable("Not Selected", false);
ImGui::ListBoxFooter();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Text Baseline Alignment"))
{
ImGui::TextWrapped("(This is testing the vertical alignment that occurs on text to keep it at the same baseline as widgets. Lines only composed of text or \"small\" widgets fit in less vertical spaces than lines with normal widgets)");
ImGui::Text("One\nTwo\nThree"); ImGui::SameLine();
ImGui::Text("Hello\nWorld"); ImGui::SameLine();
ImGui::Text("Banana");
ImGui::Text("Banana"); ImGui::SameLine();
ImGui::Text("Hello\nWorld"); ImGui::SameLine();
ImGui::Text("One\nTwo\nThree");
ImGui::Button("HOP##1"); ImGui::SameLine();
ImGui::Text("Banana"); ImGui::SameLine();
ImGui::Text("Hello\nWorld"); ImGui::SameLine();
ImGui::Text("Banana");
ImGui::Button("HOP##2"); ImGui::SameLine();
ImGui::Text("Hello\nWorld"); ImGui::SameLine();
ImGui::Text("Banana");
ImGui::Button("TEST##1"); ImGui::SameLine();
ImGui::Text("TEST"); ImGui::SameLine();
ImGui::SmallButton("TEST##2");
ImGui::AlignTextToFramePadding(); // If your line starts with text, call this to align it to upcoming widgets.
ImGui::Text("Text aligned to Widget"); ImGui::SameLine();
ImGui::Button("Widget##1"); ImGui::SameLine();
ImGui::Text("Widget"); ImGui::SameLine();
ImGui::SmallButton("Widget##2"); ImGui::SameLine();
ImGui::Button("Widget##3");
// Tree
const float spacing = ImGui::GetStyle().ItemInnerSpacing.x;
ImGui::Button("Button##1");
ImGui::SameLine(0.0f, spacing);
if (ImGui::TreeNode("Node##1")) { for (int i = 0; i < 6; i++) ImGui::BulletText("Item %d..", i); ImGui::TreePop(); } // Dummy tree data
ImGui::AlignTextToFramePadding(); // Vertically align text node a bit lower so it'll be vertically centered with upcoming widget. Otherwise you can use SmallButton (smaller fit).
bool node_open = ImGui::TreeNode("Node##2"); // Common mistake to avoid: if we want to SameLine after TreeNode we need to do it before we add child content.
ImGui::SameLine(0.0f, spacing); ImGui::Button("Button##2");
if (node_open) { for (int i = 0; i < 6; i++) ImGui::BulletText("Item %d..", i); ImGui::TreePop(); } // Dummy tree data
// Bullet
ImGui::Button("Button##3");
ImGui::SameLine(0.0f, spacing);
ImGui::BulletText("Bullet text");
ImGui::AlignTextToFramePadding();
ImGui::BulletText("Node");
ImGui::SameLine(0.0f, spacing); ImGui::Button("Button##4");
ImGui::TreePop();
}
if (ImGui::TreeNode("Scrolling"))
{
ImGui::TextWrapped("(Use SetScrollHere() or SetScrollFromPosY() to scroll to a given position.)");
static bool track = true;
static int track_line = 50, scroll_to_px = 200;
ImGui::Checkbox("Track", &track);
ImGui::PushItemWidth(100);
ImGui::SameLine(130); track |= ImGui::DragInt("##line", &track_line, 0.25f, 0, 99, "Line = %d");
bool scroll_to = ImGui::Button("Scroll To Pos");
ImGui::SameLine(130); scroll_to |= ImGui::DragInt("##pos_y", &scroll_to_px, 1.00f, 0, 9999, "Y = %d px");
ImGui::PopItemWidth();
if (scroll_to) track = false;
for (int i = 0; i < 5; i++)
{
if (i > 0) ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Text("%s", i == 0 ? "Top" : i == 1 ? "25%" : i == 2 ? "Center" : i == 3 ? "75%" : "Bottom");
ImGui::BeginChild(ImGui::GetID((void*)(intptr_t)i), ImVec2(ImGui::GetWindowWidth() * 0.17f, 200.0f), true);
if (scroll_to)
ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + scroll_to_px, i * 0.25f);
for (int line = 0; line < 100; line++)
{
if (track && line == track_line)
{
ImGui::TextColored(ImColor(255,255,0), "Line %d", line);
ImGui::SetScrollHere(i * 0.25f); // 0.0f:top, 0.5f:center, 1.0f:bottom
}
else
{
ImGui::Text("Line %d", line);
}
}
float scroll_y = ImGui::GetScrollY(), scroll_max_y = ImGui::GetScrollMaxY();
ImGui::EndChild();
ImGui::Text("%.0f/%0.f", scroll_y, scroll_max_y);
ImGui::EndGroup();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Horizontal Scrolling"))
{
ImGui::Bullet(); ImGui::TextWrapped("Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.");
ImGui::Bullet(); ImGui::TextWrapped("You may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin().");
static int lines = 7;
ImGui::SliderInt("Lines", &lines, 1, 15);
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f));
ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetFrameHeightWithSpacing()*7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar);
for (int line = 0; line < lines; line++)
{
// Display random stuff (for the sake of this trivial demo we are using basic Button+SameLine. If you want to create your own time line for a real application you may be better off
// manipulating the cursor position yourself, aka using SetCursorPos/SetCursorScreenPos to position the widgets yourself. You may also want to use the lower-level ImDrawList API)
int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
for (int n = 0; n < num_buttons; n++)
{
if (n > 0) ImGui::SameLine();
ImGui::PushID(n + line * 1000);
char num_buf[16];
sprintf(num_buf, "%d", n);
const char* label = (!(n%15)) ? "FizzBuzz" : (!(n%3)) ? "Fizz" : (!(n%5)) ? "Buzz" : num_buf;
float hue = n*0.05f;
ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(hue, 0.6f, 0.6f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(hue, 0.7f, 0.7f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(hue, 0.8f, 0.8f));
ImGui::Button(label, ImVec2(40.0f + sinf((float)(line + n)) * 20.0f, 0.0f));
ImGui::PopStyleColor(3);
ImGui::PopID();
}
}
float scroll_x = ImGui::GetScrollX(), scroll_max_x = ImGui::GetScrollMaxX();
ImGui::EndChild();
ImGui::PopStyleVar(2);
float scroll_x_delta = 0.0f;
ImGui::SmallButton("<<"); if (ImGui::IsItemActive()) scroll_x_delta = -ImGui::GetIO().DeltaTime * 1000.0f; ImGui::SameLine();
ImGui::Text("Scroll from code"); ImGui::SameLine();
ImGui::SmallButton(">>"); if (ImGui::IsItemActive()) scroll_x_delta = +ImGui::GetIO().DeltaTime * 1000.0f; ImGui::SameLine();
ImGui::Text("%.0f/%.0f", scroll_x, scroll_max_x);
if (scroll_x_delta != 0.0f)
{
ImGui::BeginChild("scrolling"); // Demonstrate a trick: you can use Begin to set yourself in the context of another window (here we are already out of your child window)
ImGui::SetScrollX(ImGui::GetScrollX() + scroll_x_delta);
ImGui::End();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Clipping"))
{
static ImVec2 size(100, 100), offset(50, 20);
ImGui::TextWrapped("On a per-widget basis we are occasionally clipping text CPU-side if it won't fit in its frame. Otherwise we are doing coarser clipping + passing a scissor rectangle to the renderer. The system is designed to try minimizing both execution and CPU/GPU rendering cost.");
ImGui::DragFloat2("size", (float*)&size, 0.5f, 0.0f, 200.0f, "%.0f");
ImGui::TextWrapped("(Click and drag)");
ImVec2 pos = ImGui::GetCursorScreenPos();
ImVec4 clip_rect(pos.x, pos.y, pos.x+size.x, pos.y+size.y);
ImGui::InvisibleButton("##dummy", size);
if (ImGui::IsItemActive() && ImGui::IsMouseDragging()) { offset.x += ImGui::GetIO().MouseDelta.x; offset.y += ImGui::GetIO().MouseDelta.y; }
ImGui::GetWindowDrawList()->AddRectFilled(pos, ImVec2(pos.x+size.x,pos.y+size.y), IM_COL32(90,90,120,255));
ImGui::GetWindowDrawList()->AddText(ImGui::GetFont(), ImGui::GetFontSize()*2.0f, ImVec2(pos.x+offset.x,pos.y+offset.y), IM_COL32(255,255,255,255), "Line 1 hello\nLine 2 clip me!", NULL, 0.0f, &clip_rect);
ImGui::TreePop();
}
}
if (ImGui::CollapsingHeader("Popups & Modal windows"))
{
if (ImGui::TreeNode("Popups"))
{
ImGui::TextWrapped("When a popup is active, it inhibits interacting with windows that are behind the popup. Clicking outside the popup closes it.");
static int selected_fish = -1;
const char* names[] = { "Bream", "Haddock", "Mackerel", "Pollock", "Tilefish" };
static bool toggles[] = { true, false, false, false, false };
// Simple selection popup
// (If you want to show the current selection inside the Button itself, you may want to build a string using the "###" operator to preserve a constant ID with a variable label)
if (ImGui::Button("Select.."))
ImGui::OpenPopup("select");
ImGui::SameLine();
ImGui::TextUnformatted(selected_fish == -1 ? "<None>" : names[selected_fish]);
if (ImGui::BeginPopup("select"))
{
ImGui::Text("Aquarium");
ImGui::Separator();
for (int i = 0; i < IM_ARRAYSIZE(names); i++)
if (ImGui::Selectable(names[i]))
selected_fish = i;
ImGui::EndPopup();
}
// Showing a menu with toggles
if (ImGui::Button("Toggle.."))
ImGui::OpenPopup("toggle");
if (ImGui::BeginPopup("toggle"))
{
for (int i = 0; i < IM_ARRAYSIZE(names); i++)
ImGui::MenuItem(names[i], "", &toggles[i]);
if (ImGui::BeginMenu("Sub-menu"))
{
ImGui::MenuItem("Click me");
ImGui::EndMenu();
}
ImGui::Separator();
ImGui::Text("Tooltip here");
if (ImGui::IsItemHovered())
ImGui::SetTooltip("I am a tooltip over a popup");
if (ImGui::Button("Stacked Popup"))
ImGui::OpenPopup("another popup");
if (ImGui::BeginPopup("another popup"))
{
for (int i = 0; i < IM_ARRAYSIZE(names); i++)
ImGui::MenuItem(names[i], "", &toggles[i]);
if (ImGui::BeginMenu("Sub-menu"))
{
ImGui::MenuItem("Click me");
ImGui::EndMenu();
}
ImGui::EndPopup();
}
ImGui::EndPopup();
}
if (ImGui::Button("Popup Menu.."))
ImGui::OpenPopup("FilePopup");
if (ImGui::BeginPopup("FilePopup"))
{
ShowExampleMenuFile();
ImGui::EndPopup();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Context menus"))
{
// BeginPopupContextItem() is a helper to provide common/simple popup behavior of essentially doing:
// if (IsItemHovered() && IsMouseClicked(0))
// OpenPopup(id);
// return BeginPopup(id);
// For more advanced uses you may want to replicate and cuztomize this code. This the comments inside BeginPopupContextItem() implementation.
static float value = 0.5f;
ImGui::Text("Value = %.3f (<-- right-click here)", value);
if (ImGui::BeginPopupContextItem("item context menu"))
{
if (ImGui::Selectable("Set to zero")) value = 0.0f;
if (ImGui::Selectable("Set to PI")) value = 3.1415f;
ImGui::PushItemWidth(-1);
ImGui::DragFloat("##Value", &value, 0.1f, 0.0f, 0.0f);
ImGui::PopItemWidth();
ImGui::EndPopup();
}
static char name[32] = "Label1";
char buf[64]; sprintf(buf, "Button: %s###Button", name); // ### operator override ID ignoring the preceding label
ImGui::Button(buf);
if (ImGui::BeginPopupContextItem()) // When used after an item that has an ID (here the Button), we can skip providing an ID to BeginPopupContextItem().
{
ImGui::Text("Edit name:");
ImGui::InputText("##edit", name, IM_ARRAYSIZE(name));
if (ImGui::Button("Close"))
ImGui::CloseCurrentPopup();
ImGui::EndPopup();
}
ImGui::SameLine(); ImGui::Text("(<-- right-click here)");
ImGui::TreePop();
}
if (ImGui::TreeNode("Modals"))
{
ImGui::TextWrapped("Modal windows are like popups but the user cannot close them by clicking outside the window.");
if (ImGui::Button("Delete.."))
ImGui::OpenPopup("Delete?");
if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize))
{
ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n");
ImGui::Separator();
//static int dummy_i = 0;
//ImGui::Combo("Combo", &dummy_i, "Delete\0Delete harder\0");
static bool dont_ask_me_next_time = false;
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0));
ImGui::Checkbox("Don't ask me next time", &dont_ask_me_next_time);
ImGui::PopStyleVar();
if (ImGui::Button("OK", ImVec2(120,0))) { ImGui::CloseCurrentPopup(); }
ImGui::SetItemDefaultFocus();
ImGui::SameLine();
if (ImGui::Button("Cancel", ImVec2(120,0))) { ImGui::CloseCurrentPopup(); }
ImGui::EndPopup();
}
if (ImGui::Button("Stacked modals.."))
ImGui::OpenPopup("Stacked 1");
if (ImGui::BeginPopupModal("Stacked 1"))
{
ImGui::Text("Hello from Stacked The First\nUsing style.Colors[ImGuiCol_ModalWindowDimBg] behind it.");
static int item = 1;
ImGui::Combo("Combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
static float color[4] = { 0.4f,0.7f,0.0f,0.5f };
ImGui::ColorEdit4("color", color); // This is to test behavior of stacked regular popups over a modal
if (ImGui::Button("Add another modal.."))
ImGui::OpenPopup("Stacked 2");
if (ImGui::BeginPopupModal("Stacked 2"))
{
ImGui::Text("Hello from Stacked The Second!");
if (ImGui::Button("Close"))
ImGui::CloseCurrentPopup();
ImGui::EndPopup();
}
if (ImGui::Button("Close"))
ImGui::CloseCurrentPopup();
ImGui::EndPopup();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Menus inside a regular window"))
{
ImGui::TextWrapped("Below we are testing adding menu items to a regular window. It's rather unusual but should work!");
ImGui::Separator();
// NB: As a quirk in this very specific example, we want to differentiate the parent of this menu from the parent of the various popup menus above.
// To do so we are encloding the items in a PushID()/PopID() block to make them two different menusets. If we don't, opening any popup above and hovering our menu here
// would open it. This is because once a menu is active, we allow to switch to a sibling menu by just hovering on it, which is the desired behavior for regular menus.
ImGui::PushID("foo");
ImGui::MenuItem("Menu item", "CTRL+M");
if (ImGui::BeginMenu("Menu inside a regular window"))
{
ShowExampleMenuFile();
ImGui::EndMenu();
}
ImGui::PopID();
ImGui::Separator();
ImGui::TreePop();
}
}
if (ImGui::CollapsingHeader("Columns"))
{
ImGui::PushID("Columns");
// Basic columns
if (ImGui::TreeNode("Basic"))
{
ImGui::Text("Without border:");
ImGui::Columns(3, "mycolumns3", false); // 3-ways, no border
ImGui::Separator();
for (int n = 0; n < 14; n++)
{
char label[32];
sprintf(label, "Item %d", n);
if (ImGui::Selectable(label)) {}
//if (ImGui::Button(label, ImVec2(-1,0))) {}
ImGui::NextColumn();
}
ImGui::Columns(1);
ImGui::Separator();
ImGui::Text("With border:");
ImGui::Columns(4, "mycolumns"); // 4-ways, with border
ImGui::Separator();
ImGui::Text("ID"); ImGui::NextColumn();
ImGui::Text("Name"); ImGui::NextColumn();
ImGui::Text("Path"); ImGui::NextColumn();
ImGui::Text("Hovered"); ImGui::NextColumn();
ImGui::Separator();
const char* names[3] = { "One", "Two", "Three" };
const char* paths[3] = { "/path/one", "/path/two", "/path/three" };
static int selected = -1;
for (int i = 0; i < 3; i++)
{
char label[32];
sprintf(label, "%04d", i);
if (ImGui::Selectable(label, selected == i, ImGuiSelectableFlags_SpanAllColumns))
selected = i;
bool hovered = ImGui::IsItemHovered();
ImGui::NextColumn();
ImGui::Text(names[i]); ImGui::NextColumn();
ImGui::Text(paths[i]); ImGui::NextColumn();
ImGui::Text("%d", hovered); ImGui::NextColumn();
}
ImGui::Columns(1);
ImGui::Separator();
ImGui::TreePop();
}
// Create multiple items in a same cell before switching to next column
if (ImGui::TreeNode("Mixed items"))
{
ImGui::Columns(3, "mixed");
ImGui::Separator();
ImGui::Text("Hello");
ImGui::Button("Banana");
ImGui::NextColumn();
ImGui::Text("ImGui");
ImGui::Button("Apple");
static float foo = 1.0f;
ImGui::InputFloat("red", &foo, 0.05f, 0, "%.3f");
ImGui::Text("An extra line here.");
ImGui::NextColumn();
ImGui::Text("Sailor");
ImGui::Button("Corniflower");
static float bar = 1.0f;
ImGui::InputFloat("blue", &bar, 0.05f, 0, "%.3f");
ImGui::NextColumn();
if (ImGui::CollapsingHeader("Category A")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn();
if (ImGui::CollapsingHeader("Category B")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn();
if (ImGui::CollapsingHeader("Category C")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn();
ImGui::Columns(1);
ImGui::Separator();
ImGui::TreePop();
}
// Word wrapping
if (ImGui::TreeNode("Word-wrapping"))
{
ImGui::Columns(2, "word-wrapping");
ImGui::Separator();
ImGui::TextWrapped("The quick brown fox jumps over the lazy dog.");
ImGui::TextWrapped("Hello Left");
ImGui::NextColumn();
ImGui::TextWrapped("The quick brown fox jumps over the lazy dog.");
ImGui::TextWrapped("Hello Right");
ImGui::Columns(1);
ImGui::Separator();
ImGui::TreePop();
}
if (ImGui::TreeNode("Borders"))
{
// NB: Future columns API should allow automatic horizontal borders.
static bool h_borders = true;
static bool v_borders = true;
ImGui::Checkbox("horizontal", &h_borders);
ImGui::SameLine();
ImGui::Checkbox("vertical", &v_borders);
ImGui::Columns(4, NULL, v_borders);
for (int i = 0; i < 4*3; i++)
{
if (h_borders && ImGui::GetColumnIndex() == 0)
ImGui::Separator();
ImGui::Text("%c%c%c", 'a'+i, 'a'+i, 'a'+i);
ImGui::Text("Width %.2f\nOffset %.2f", ImGui::GetColumnWidth(), ImGui::GetColumnOffset());
ImGui::NextColumn();
}
ImGui::Columns(1);
if (h_borders)
ImGui::Separator();
ImGui::TreePop();
}
// Scrolling columns
/*
if (ImGui::TreeNode("Vertical Scrolling"))
{
ImGui::BeginChild("##header", ImVec2(0, ImGui::GetTextLineHeightWithSpacing()+ImGui::GetStyle().ItemSpacing.y));
ImGui::Columns(3);
ImGui::Text("ID"); ImGui::NextColumn();
ImGui::Text("Name"); ImGui::NextColumn();
ImGui::Text("Path"); ImGui::NextColumn();
ImGui::Columns(1);
ImGui::Separator();
ImGui::EndChild();
ImGui::BeginChild("##scrollingregion", ImVec2(0, 60));
ImGui::Columns(3);
for (int i = 0; i < 10; i++)
{
ImGui::Text("%04d", i); ImGui::NextColumn();
ImGui::Text("Foobar"); ImGui::NextColumn();
ImGui::Text("/path/foobar/%04d/", i); ImGui::NextColumn();
}
ImGui::Columns(1);
ImGui::EndChild();
ImGui::TreePop();
}
*/
if (ImGui::TreeNode("Horizontal Scrolling"))
{
ImGui::SetNextWindowContentSize(ImVec2(1500.0f, 0.0f));
ImGui::BeginChild("##ScrollingRegion", ImVec2(0, ImGui::GetFontSize() * 20), false, ImGuiWindowFlags_HorizontalScrollbar);
ImGui::Columns(10);
int ITEMS_COUNT = 2000;
ImGuiListClipper clipper(ITEMS_COUNT); // Also demonstrate using the clipper for large list
while (clipper.Step())
{
for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
for (int j = 0; j < 10; j++)
{
ImGui::Text("Line %d Column %d...", i, j);
ImGui::NextColumn();
}
}
ImGui::Columns(1);
ImGui::EndChild();
ImGui::TreePop();
}
bool node_open = ImGui::TreeNode("Tree within single cell");
ImGui::SameLine(); ShowHelpMarker("NB: Tree node must be poped before ending the cell. There's no storage of state per-cell.");
if (node_open)
{
ImGui::Columns(2, "tree items");
ImGui::Separator();
if (ImGui::TreeNode("Hello")) { ImGui::BulletText("Sailor"); ImGui::TreePop(); } ImGui::NextColumn();
if (ImGui::TreeNode("Bonjour")) { ImGui::BulletText("Marin"); ImGui::TreePop(); } ImGui::NextColumn();
ImGui::Columns(1);
ImGui::Separator();
ImGui::TreePop();
}
ImGui::PopID();
}
if (ImGui::CollapsingHeader("Filtering"))
{
static ImGuiTextFilter filter;
ImGui::Text("Filter usage:\n"
" \"\" display all lines\n"
" \"xxx\" display lines containing \"xxx\"\n"
" \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n"
" \"-xxx\" hide lines containing \"xxx\"");
filter.Draw();
const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" };
for (int i = 0; i < IM_ARRAYSIZE(lines); i++)
if (filter.PassFilter(lines[i]))
ImGui::BulletText("%s", lines[i]);
}
if (ImGui::CollapsingHeader("Inputs, Navigation & Focus"))
{
ImGuiIO& io = ImGui::GetIO();
ImGui::Text("WantCaptureMouse: %d", io.WantCaptureMouse);
ImGui::Text("WantCaptureKeyboard: %d", io.WantCaptureKeyboard);
ImGui::Text("WantTextInput: %d", io.WantTextInput);
ImGui::Text("WantSetMousePos: %d", io.WantSetMousePos);
ImGui::Text("NavActive: %d, NavVisible: %d", io.NavActive, io.NavVisible);
ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor);
ImGui::SameLine(); ShowHelpMarker("Instruct ImGui to render a mouse cursor for you in software. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something).");
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableGamepad [beta]", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableGamepad);
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableKeyboard [beta]", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard);
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableSetMousePos);
ImGui::SameLine(); ShowHelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos.");
ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange);
ImGui::SameLine(); ShowHelpMarker("Instruct back-end to not alter mouse cursor shape and visibility.");
ImGui::Checkbox("io.ConfigCursorBlink", &io.ConfigCursorBlink);
ImGui::SameLine(); ShowHelpMarker("Set to false to disable blinking cursor, for users who consider it distracting");
ImGui::Checkbox("io.ConfigResizeWindowsFromEdges [beta]", &io.ConfigResizeWindowsFromEdges);
ImGui::SameLine(); ShowHelpMarker("Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback.");
if (ImGui::TreeNode("Keyboard, Mouse & Navigation State"))
{
if (ImGui::IsMousePosValid())
ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y);
else
ImGui::Text("Mouse pos: <INVALID>");
ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y);
ImGui::Text("Mouse down:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (io.MouseDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); }
ImGui::Text("Mouse clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); }
ImGui::Text("Mouse dbl-clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseDoubleClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); }
ImGui::Text("Mouse released:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseReleased(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); }
ImGui::Text("Mouse wheel: %.1f", io.MouseWheel);
ImGui::Text("Keys down:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (io.KeysDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("%d (%.02f secs)", i, io.KeysDownDuration[i]); }
ImGui::Text("Keys pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyPressed(i)) { ImGui::SameLine(); ImGui::Text("%d", i); }
ImGui::Text("Keys release:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyReleased(i)) { ImGui::SameLine(); ImGui::Text("%d", i); }
ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : "");
ImGui::Text("NavInputs down:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputs[i] > 0.0f) { ImGui::SameLine(); ImGui::Text("[%d] %.2f", i, io.NavInputs[i]); }
ImGui::Text("NavInputs pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputsDownDuration[i] == 0.0f) { ImGui::SameLine(); ImGui::Text("[%d]", i); }
ImGui::Text("NavInputs duration:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputsDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("[%d] %.2f", i, io.NavInputsDownDuration[i]); }
ImGui::Button("Hovering me sets the\nkeyboard capture flag");
if (ImGui::IsItemHovered())
ImGui::CaptureKeyboardFromApp(true);
ImGui::SameLine();
ImGui::Button("Holding me clears the\nthe keyboard capture flag");
if (ImGui::IsItemActive())
ImGui::CaptureKeyboardFromApp(false);
ImGui::TreePop();
}
if (ImGui::TreeNode("Tabbing"))
{
ImGui::Text("Use TAB/SHIFT+TAB to cycle through keyboard editable fields.");
static char buf[32] = "dummy";
ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
ImGui::InputText("3", buf, IM_ARRAYSIZE(buf));
ImGui::PushAllowKeyboardFocus(false);
ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf));
//ImGui::SameLine(); ShowHelperMarker("Use ImGui::PushAllowKeyboardFocus(bool)\nto disable tabbing through certain widgets.");
ImGui::PopAllowKeyboardFocus();
ImGui::InputText("5", buf, IM_ARRAYSIZE(buf));
ImGui::TreePop();
}
if (ImGui::TreeNode("Focus from code"))
{
bool focus_1 = ImGui::Button("Focus on 1"); ImGui::SameLine();
bool focus_2 = ImGui::Button("Focus on 2"); ImGui::SameLine();
bool focus_3 = ImGui::Button("Focus on 3");
int has_focus = 0;
static char buf[128] = "click on a button to set focus";
if (focus_1) ImGui::SetKeyboardFocusHere();
ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
if (ImGui::IsItemActive()) has_focus = 1;
if (focus_2) ImGui::SetKeyboardFocusHere();
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
if (ImGui::IsItemActive()) has_focus = 2;
ImGui::PushAllowKeyboardFocus(false);
if (focus_3) ImGui::SetKeyboardFocusHere();
ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf));
if (ImGui::IsItemActive()) has_focus = 3;
ImGui::PopAllowKeyboardFocus();
if (has_focus)
ImGui::Text("Item with focus: %d", has_focus);
else
ImGui::Text("Item with focus: <none>");
// Use >= 0 parameter to SetKeyboardFocusHere() to focus an upcoming item
static float f3[3] = { 0.0f, 0.0f, 0.0f };
int focus_ahead = -1;
if (ImGui::Button("Focus on X")) focus_ahead = 0; ImGui::SameLine();
if (ImGui::Button("Focus on Y")) focus_ahead = 1; ImGui::SameLine();
if (ImGui::Button("Focus on Z")) focus_ahead = 2;
if (focus_ahead != -1) ImGui::SetKeyboardFocusHere(focus_ahead);
ImGui::SliderFloat3("Float3", &f3[0], 0.0f, 1.0f);
ImGui::TextWrapped("NB: Cursor & selection are preserved when refocusing last used item in code.");
ImGui::TreePop();
}
if (ImGui::TreeNode("Dragging"))
{
ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget.");
for (int button = 0; button < 3; button++)
ImGui::Text("IsMouseDragging(%d):\n w/ default threshold: %d,\n w/ zero threshold: %d\n w/ large threshold: %d",
button, ImGui::IsMouseDragging(button), ImGui::IsMouseDragging(button, 0.0f), ImGui::IsMouseDragging(button, 20.0f));
ImGui::Button("Drag Me");
if (ImGui::IsItemActive())
{
// Draw a line between the button and the mouse cursor
ImDrawList* draw_list = ImGui::GetWindowDrawList();
draw_list->PushClipRectFullScreen();
draw_list->AddLine(io.MouseClickedPos[0], io.MousePos, ImGui::GetColorU32(ImGuiCol_Button), 4.0f);
draw_list->PopClipRect();
// Drag operations gets "unlocked" when the mouse has moved past a certain threshold (the default threshold is stored in io.MouseDragThreshold)
// You can request a lower or higher threshold using the second parameter of IsMouseDragging() and GetMouseDragDelta()
ImVec2 value_raw = ImGui::GetMouseDragDelta(0, 0.0f);
ImVec2 value_with_lock_threshold = ImGui::GetMouseDragDelta(0);
ImVec2 mouse_delta = io.MouseDelta;
ImGui::SameLine(); ImGui::Text("Raw (%.1f, %.1f), WithLockThresold (%.1f, %.1f), MouseDelta (%.1f, %.1f)", value_raw.x, value_raw.y, value_with_lock_threshold.x, value_with_lock_threshold.y, mouse_delta.x, mouse_delta.y);
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Mouse cursors"))
{
const char* mouse_cursors_names[] = { "Arrow", "TextInput", "Move", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand" };
IM_ASSERT(IM_ARRAYSIZE(mouse_cursors_names) == ImGuiMouseCursor_COUNT);
ImGui::Text("Current mouse cursor = %d: %s", ImGui::GetMouseCursor(), mouse_cursors_names[ImGui::GetMouseCursor()]);
ImGui::Text("Hover to see mouse cursors:");
ImGui::SameLine(); ShowHelpMarker("Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. If software cursor rendering (io.MouseDrawCursor) is set ImGui will draw the right cursor for you, otherwise your backend needs to handle it.");
for (int i = 0; i < ImGuiMouseCursor_COUNT; i++)
{
char label[32];
sprintf(label, "Mouse cursor %d: %s", i, mouse_cursors_names[i]);
ImGui::Bullet(); ImGui::Selectable(label, false);
if (ImGui::IsItemHovered() || ImGui::IsItemFocused())
ImGui::SetMouseCursor(i);
}
ImGui::TreePop();
}
}
// End of ShowDemoWindow()
ImGui::End();
}
// Demo helper function to select among default colors. See ShowStyleEditor() for more advanced options.
// Here we use the simplified Combo() api that packs items into a single literal string. Useful for quick combo boxes where the choices are known locally.
bool ImGui::ShowStyleSelector(const char* label)
{
static int style_idx = -1;
if (ImGui::Combo(label, &style_idx, "Classic\0Dark\0Light\0"))
{
switch (style_idx)
{
case 0: ImGui::StyleColorsClassic(); break;
case 1: ImGui::StyleColorsDark(); break;
case 2: ImGui::StyleColorsLight(); break;
}
return true;
}
return false;
}
// Demo helper function to select among loaded fonts.
// Here we use the regular BeginCombo()/EndCombo() api which is more the more flexible one.
void ImGui::ShowFontSelector(const char* label)
{
ImGuiIO& io = ImGui::GetIO();
ImFont* font_current = ImGui::GetFont();
if (ImGui::BeginCombo(label, font_current->GetDebugName()))
{
for (int n = 0; n < io.Fonts->Fonts.Size; n++)
if (ImGui::Selectable(io.Fonts->Fonts[n]->GetDebugName(), io.Fonts->Fonts[n] == font_current))
io.FontDefault = io.Fonts->Fonts[n];
ImGui::EndCombo();
}
ImGui::SameLine();
ShowHelpMarker(
"- Load additional fonts with io.Fonts->AddFontFromFileTTF().\n"
"- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n"
"- Read FAQ and documentation in misc/fonts/ for more details.\n"
"- If you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame().");
}
void ImGui::ShowStyleEditor(ImGuiStyle* ref)
{
// You can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it compares to an internally stored reference)
ImGuiStyle& style = ImGui::GetStyle();
static ImGuiStyle ref_saved_style;
// Default to using internal storage as reference
static bool init = true;
if (init && ref == NULL)
ref_saved_style = style;
init = false;
if (ref == NULL)
ref = &ref_saved_style;
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f);
if (ImGui::ShowStyleSelector("Colors##Selector"))
ref_saved_style = style;
ImGui::ShowFontSelector("Fonts##Selector");
// Simplified Settings
if (ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f"))
style.GrabRounding = style.FrameRounding; // Make GrabRounding always the same value as FrameRounding
{ bool window_border = (style.WindowBorderSize > 0.0f); if (ImGui::Checkbox("WindowBorder", &window_border)) style.WindowBorderSize = window_border ? 1.0f : 0.0f; }
ImGui::SameLine();
{ bool frame_border = (style.FrameBorderSize > 0.0f); if (ImGui::Checkbox("FrameBorder", &frame_border)) style.FrameBorderSize = frame_border ? 1.0f : 0.0f; }
ImGui::SameLine();
{ bool popup_border = (style.PopupBorderSize > 0.0f); if (ImGui::Checkbox("PopupBorder", &popup_border)) style.PopupBorderSize = popup_border ? 1.0f : 0.0f; }
// Save/Revert button
if (ImGui::Button("Save Ref"))
*ref = ref_saved_style = style;
ImGui::SameLine();
if (ImGui::Button("Revert Ref"))
style = *ref;
ImGui::SameLine();
ShowHelpMarker("Save/Revert in local non-persistent storage. Default Colors definition are not affected. Use \"Export Colors\" below to save them somewhere.");
if (ImGui::TreeNode("Rendering"))
{
ImGui::Checkbox("Anti-aliased lines", &style.AntiAliasedLines); ImGui::SameLine(); ShowHelpMarker("When disabling anti-aliasing lines, you'll probably want to disable borders in your style as well.");
ImGui::Checkbox("Anti-aliased fill", &style.AntiAliasedFill);
ImGui::PushItemWidth(100);
ImGui::DragFloat("Curve Tessellation Tolerance", &style.CurveTessellationTol, 0.02f, 0.10f, FLT_MAX, NULL, 2.0f);
if (style.CurveTessellationTol < 0.0f) style.CurveTessellationTol = 0.10f;
ImGui::DragFloat("Global Alpha", &style.Alpha, 0.005f, 0.20f, 1.0f, "%.2f"); // Not exposing zero here so user doesn't "lose" the UI (zero alpha clips all widgets). But application code could have a toggle to switch between zero and non-zero.
ImGui::PopItemWidth();
ImGui::TreePop();
}
if (ImGui::TreeNode("Settings"))
{
ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f");
ImGui::SliderFloat("PopupRounding", &style.PopupRounding, 0.0f, 16.0f, "%.0f");
ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f");
ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f");
ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f");
ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f");
ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f");
ImGui::SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f");
ImGui::Text("BorderSize");
ImGui::SliderFloat("WindowBorderSize", &style.WindowBorderSize, 0.0f, 1.0f, "%.0f");
ImGui::SliderFloat("ChildBorderSize", &style.ChildBorderSize, 0.0f, 1.0f, "%.0f");
ImGui::SliderFloat("PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f, "%.0f");
ImGui::SliderFloat("FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f, "%.0f");
ImGui::Text("Rounding");
ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 14.0f, "%.0f");
ImGui::SliderFloat("ChildRounding", &style.ChildRounding, 0.0f, 16.0f, "%.0f");
ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f");
ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f");
ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f");
ImGui::Text("Alignment");
ImGui::SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f");
ImGui::SliderFloat2("ButtonTextAlign", (float*)&style.ButtonTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); ShowHelpMarker("Alignment applies when a button is larger than its text content.");
ImGui::Text("Safe Area Padding"); ImGui::SameLine(); ShowHelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).");
ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f");
ImGui::TreePop();
}
if (ImGui::TreeNode("Colors"))
{
static int output_dest = 0;
static bool output_only_modified = true;
if (ImGui::Button("Export Unsaved"))
{
if (output_dest == 0)
ImGui::LogToClipboard();
else
ImGui::LogToTTY();
ImGui::LogText("ImVec4* colors = ImGui::GetStyle().Colors;" IM_NEWLINE);
for (int i = 0; i < ImGuiCol_COUNT; i++)
{
const ImVec4& col = style.Colors[i];
const char* name = ImGui::GetStyleColorName(i);
if (!output_only_modified || memcmp(&col, &ref->Colors[i], sizeof(ImVec4)) != 0)
ImGui::LogText("colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" IM_NEWLINE, name, 23-(int)strlen(name), "", col.x, col.y, col.z, col.w);
}
ImGui::LogFinish();
}
ImGui::SameLine(); ImGui::PushItemWidth(120); ImGui::Combo("##output_type", &output_dest, "To Clipboard\0To TTY\0"); ImGui::PopItemWidth();
ImGui::SameLine(); ImGui::Checkbox("Only Modified Colors", &output_only_modified);
ImGui::Text("Tip: Left-click on colored square to open color picker,\nRight-click to open edit options menu.");
static ImGuiTextFilter filter;
filter.Draw("Filter colors", 200);
static ImGuiColorEditFlags alpha_flags = 0;
ImGui::RadioButton("Opaque", &alpha_flags, 0); ImGui::SameLine();
ImGui::RadioButton("Alpha", &alpha_flags, ImGuiColorEditFlags_AlphaPreview); ImGui::SameLine();
ImGui::RadioButton("Both", &alpha_flags, ImGuiColorEditFlags_AlphaPreviewHalf);
ImGui::BeginChild("#colors", ImVec2(0, 300), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened);
ImGui::PushItemWidth(-160);
for (int i = 0; i < ImGuiCol_COUNT; i++)
{
const char* name = ImGui::GetStyleColorName(i);
if (!filter.PassFilter(name))
continue;
ImGui::PushID(i);
ImGui::ColorEdit4("##color", (float*)&style.Colors[i], ImGuiColorEditFlags_AlphaBar | alpha_flags);
if (memcmp(&style.Colors[i], &ref->Colors[i], sizeof(ImVec4)) != 0)
{
// Tips: in a real user application, you may want to merge and use an icon font into the main font, so instead of "Save"/"Revert" you'd use icons.
// Read the FAQ and misc/fonts/README.txt about using icon fonts. It's really easy and super convenient!
ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Save")) ref->Colors[i] = style.Colors[i];
ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Revert")) style.Colors[i] = ref->Colors[i];
}
ImGui::SameLine(0.0f, style.ItemInnerSpacing.x);
ImGui::TextUnformatted(name);
ImGui::PopID();
}
ImGui::PopItemWidth();
ImGui::EndChild();
ImGui::TreePop();
}
bool fonts_opened = ImGui::TreeNode("Fonts", "Fonts (%d)", ImGui::GetIO().Fonts->Fonts.Size);
if (fonts_opened)
{
ImFontAtlas* atlas = ImGui::GetIO().Fonts;
if (ImGui::TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
{
ImGui::Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0,0), ImVec2(1,1), ImColor(255,255,255,255), ImColor(255,255,255,128));
ImGui::TreePop();
}
ImGui::PushItemWidth(100);
for (int i = 0; i < atlas->Fonts.Size; i++)
{
ImFont* font = atlas->Fonts[i];
ImGui::PushID(font);
bool font_details_opened = ImGui::TreeNode(font, "Font %d: \'%s\', %.2f px, %d glyphs", i, font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size);
ImGui::SameLine(); if (ImGui::SmallButton("Set as default")) ImGui::GetIO().FontDefault = font;
if (font_details_opened)
{
ImGui::PushFont(font);
ImGui::Text("The quick brown fox jumps over the lazy dog");
ImGui::PopFont();
ImGui::DragFloat("Font scale", &font->Scale, 0.005f, 0.3f, 2.0f, "%.1f"); // Scale only this font
ImGui::SameLine(); ShowHelpMarker("Note than the default embedded font is NOT meant to be scaled.\n\nFont are currently rendered into bitmaps at a given size at the time of building the atlas. You may oversample them to get some flexibility with scaling. You can also render at multiple sizes and select which one to use at runtime.\n\n(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)");
ImGui::InputFloat("Font offset", &font->DisplayOffset.y, 1, 1, "%.0f");
ImGui::Text("Ascent: %f, Descent: %f, Height: %f", font->Ascent, font->Descent, font->Ascent - font->Descent);
ImGui::Text("Fallback character: '%c' (%d)", font->FallbackChar, font->FallbackChar);
ImGui::Text("Texture surface: %d pixels (approx) ~ %dx%d", font->MetricsTotalSurface, (int)sqrtf((float)font->MetricsTotalSurface), (int)sqrtf((float)font->MetricsTotalSurface));
for (int config_i = 0; config_i < font->ConfigDataCount; config_i++)
if (ImFontConfig* cfg = &font->ConfigData[config_i])
ImGui::BulletText("Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d", config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH);
if (ImGui::TreeNode("Glyphs", "Glyphs (%d)", font->Glyphs.Size))
{
// Display all glyphs of the fonts in separate pages of 256 characters
for (int base = 0; base < 0x10000; base += 256)
{
int count = 0;
for (int n = 0; n < 256; n++)
count += font->FindGlyphNoFallback((ImWchar)(base + n)) ? 1 : 0;
if (count > 0 && ImGui::TreeNode((void*)(intptr_t)base, "U+%04X..U+%04X (%d %s)", base, base+255, count, count > 1 ? "glyphs" : "glyph"))
{
float cell_size = font->FontSize * 1;
float cell_spacing = style.ItemSpacing.y;
ImVec2 base_pos = ImGui::GetCursorScreenPos();
ImDrawList* draw_list = ImGui::GetWindowDrawList();
for (int n = 0; n < 256; n++)
{
ImVec2 cell_p1(base_pos.x + (n % 16) * (cell_size + cell_spacing), base_pos.y + (n / 16) * (cell_size + cell_spacing));
ImVec2 cell_p2(cell_p1.x + cell_size, cell_p1.y + cell_size);
const ImFontGlyph* glyph = font->FindGlyphNoFallback((ImWchar)(base+n));
draw_list->AddRect(cell_p1, cell_p2, glyph ? IM_COL32(255,255,255,100) : IM_COL32(255,255,255,50));
if (glyph)
font->RenderChar(draw_list, cell_size, cell_p1, ImGui::GetColorU32(ImGuiCol_Text), (ImWchar)(base+n)); // We use ImFont::RenderChar as a shortcut because we don't have UTF-8 conversion functions available to generate a string.
if (glyph && ImGui::IsMouseHoveringRect(cell_p1, cell_p2))
{
ImGui::BeginTooltip();
ImGui::Text("Codepoint: U+%04X", base+n);
ImGui::Separator();
ImGui::Text("AdvanceX: %.1f", glyph->AdvanceX);
ImGui::Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->X0, glyph->Y0, glyph->X1, glyph->Y1);
ImGui::Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1);
ImGui::EndTooltip();
}
}
ImGui::Dummy(ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16));
ImGui::TreePop();
}
}
ImGui::TreePop();
}
ImGui::TreePop();
}
ImGui::PopID();
}
static float window_scale = 1.0f;
ImGui::DragFloat("this window scale", &window_scale, 0.005f, 0.3f, 2.0f, "%.1f"); // scale only this window
ImGui::DragFloat("global scale", &ImGui::GetIO().FontGlobalScale, 0.005f, 0.3f, 2.0f, "%.1f"); // scale everything
ImGui::PopItemWidth();
ImGui::SetWindowFontScale(window_scale);
ImGui::TreePop();
}
ImGui::PopItemWidth();
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: MAIN MENU BAR
//-----------------------------------------------------------------------------
// Demonstrate creating a fullscreen menu bar and populating it.
static void ShowExampleAppMainMenuBar()
{
if (ImGui::BeginMainMenuBar())
{
if (ImGui::BeginMenu("File"))
{
ShowExampleMenuFile();
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Edit"))
{
if (ImGui::MenuItem("Undo", "CTRL+Z")) {}
if (ImGui::MenuItem("Redo", "CTRL+Y", false, false)) {} // Disabled item
ImGui::Separator();
if (ImGui::MenuItem("Cut", "CTRL+X")) {}
if (ImGui::MenuItem("Copy", "CTRL+C")) {}
if (ImGui::MenuItem("Paste", "CTRL+V")) {}
ImGui::EndMenu();
}
ImGui::EndMainMenuBar();
}
}
static void ShowExampleMenuFile()
{
ImGui::MenuItem("(dummy menu)", NULL, false, false);
if (ImGui::MenuItem("New")) {}
if (ImGui::MenuItem("Open", "Ctrl+O")) {}
if (ImGui::BeginMenu("Open Recent"))
{
ImGui::MenuItem("fish_hat.c");
ImGui::MenuItem("fish_hat.inl");
ImGui::MenuItem("fish_hat.h");
if (ImGui::BeginMenu("More.."))
{
ImGui::MenuItem("Hello");
ImGui::MenuItem("Sailor");
if (ImGui::BeginMenu("Recurse.."))
{
ShowExampleMenuFile();
ImGui::EndMenu();
}
ImGui::EndMenu();
}
ImGui::EndMenu();
}
if (ImGui::MenuItem("Save", "Ctrl+S")) {}
if (ImGui::MenuItem("Save As..")) {}
ImGui::Separator();
if (ImGui::BeginMenu("Options"))
{
static bool enabled = true;
ImGui::MenuItem("Enabled", "", &enabled);
ImGui::BeginChild("child", ImVec2(0, 60), true);
for (int i = 0; i < 10; i++)
ImGui::Text("Scrolling Text %d", i);
ImGui::EndChild();
static float f = 0.5f;
static int n = 0;
static bool b = true;
ImGui::SliderFloat("Value", &f, 0.0f, 1.0f);
ImGui::InputFloat("Input", &f, 0.1f);
ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0");
ImGui::Checkbox("Check", &b);
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Colors"))
{
float sz = ImGui::GetTextLineHeight();
for (int i = 0; i < ImGuiCol_COUNT; i++)
{
const char* name = ImGui::GetStyleColorName((ImGuiCol)i);
ImVec2 p = ImGui::GetCursorScreenPos();
ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x+sz, p.y+sz), ImGui::GetColorU32((ImGuiCol)i));
ImGui::Dummy(ImVec2(sz, sz));
ImGui::SameLine();
ImGui::MenuItem(name);
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Disabled", false)) // Disabled
{
IM_ASSERT(0);
}
if (ImGui::MenuItem("Checked", NULL, true)) {}
if (ImGui::MenuItem("Quit", "Alt+F4")) {}
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: CONSOLE
//-----------------------------------------------------------------------------
// Demonstrating creating a simple console window, with scrolling, filtering, completion and history.
// For the console example, here we are using a more C++ like approach of declaring a class to hold the data and the functions.
struct ExampleAppConsole
{
char InputBuf[256];
ImVector<char*> Items;
bool ScrollToBottom;
ImVector<char*> History;
int HistoryPos; // -1: new line, 0..History.Size-1 browsing history.
ImVector<const char*> Commands;
ExampleAppConsole()
{
ClearLog();
memset(InputBuf, 0, sizeof(InputBuf));
HistoryPos = -1;
Commands.push_back("HELP");
Commands.push_back("HISTORY");
Commands.push_back("CLEAR");
Commands.push_back("CLASSIFY"); // "classify" is only here to provide an example of "C"+[tab] completing to "CL" and displaying matches.
AddLog("Welcome to Dear ImGui!");
}
~ExampleAppConsole()
{
ClearLog();
for (int i = 0; i < History.Size; i++)
free(History[i]);
}
// Portable helpers
static int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; }
static int Strnicmp(const char* str1, const char* str2, int n) { int d = 0; while (n > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; n--; } return d; }
static char* Strdup(const char *str) { size_t len = strlen(str) + 1; void* buff = malloc(len); return (char*)memcpy(buff, (const void*)str, len); }
static void Strtrim(char* str) { char* str_end = str + strlen(str); while (str_end > str && str_end[-1] == ' ') str_end--; *str_end = 0; }
void ClearLog()
{
for (int i = 0; i < Items.Size; i++)
free(Items[i]);
Items.clear();
ScrollToBottom = true;
}
void AddLog(const char* fmt, ...) IM_FMTARGS(2)
{
// FIXME-OPT
char buf[1024];
va_list args;
va_start(args, fmt);
vsnprintf(buf, IM_ARRAYSIZE(buf), fmt, args);
buf[IM_ARRAYSIZE(buf)-1] = 0;
va_end(args);
Items.push_back(Strdup(buf));
ScrollToBottom = true;
}
void Draw(const char* title, bool* p_open)
{
ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiCond_FirstUseEver);
if (!ImGui::Begin(title, p_open))
{
ImGui::End();
return;
}
// As a specific feature guaranteed by the library, after calling Begin() the last Item represent the title bar. So e.g. IsItemHovered() will return true when hovering the title bar.
// Here we create a context menu only available from the title bar.
if (ImGui::BeginPopupContextItem())
{
if (ImGui::MenuItem("Close Console"))
*p_open = false;
ImGui::EndPopup();
}
ImGui::TextWrapped("This example implements a console with basic coloring, completion and history. A more elaborate implementation may want to store entries along with extra data such as timestamp, emitter, etc.");
ImGui::TextWrapped("Enter 'HELP' for help, press TAB to use text completion.");
// TODO: display items starting from the bottom
if (ImGui::SmallButton("Add Dummy Text")) { AddLog("%d some text", Items.Size); AddLog("some more text"); AddLog("display very important message here!"); } ImGui::SameLine();
if (ImGui::SmallButton("Add Dummy Error")) { AddLog("[error] something went wrong"); } ImGui::SameLine();
if (ImGui::SmallButton("Clear")) { ClearLog(); } ImGui::SameLine();
bool copy_to_clipboard = ImGui::SmallButton("Copy"); ImGui::SameLine();
if (ImGui::SmallButton("Scroll to bottom")) ScrollToBottom = true;
//static float t = 0.0f; if (ImGui::GetTime() - t > 0.02f) { t = ImGui::GetTime(); AddLog("Spam %f", t); }
ImGui::Separator();
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0));
static ImGuiTextFilter filter;
filter.Draw("Filter (\"incl,-excl\") (\"error\")", 180);
ImGui::PopStyleVar();
ImGui::Separator();
const float footer_height_to_reserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing(); // 1 separator, 1 input text
ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), false, ImGuiWindowFlags_HorizontalScrollbar); // Leave room for 1 separator + 1 InputText
if (ImGui::BeginPopupContextWindow())
{
if (ImGui::Selectable("Clear")) ClearLog();
ImGui::EndPopup();
}
// Display every line as a separate entry so we can change their color or add custom widgets. If you only want raw text you can use ImGui::TextUnformatted(log.begin(), log.end());
// NB- if you have thousands of entries this approach may be too inefficient and may require user-side clipping to only process visible items.
// You can seek and display only the lines that are visible using the ImGuiListClipper helper, if your elements are evenly spaced and you have cheap random access to the elements.
// To use the clipper we could replace the 'for (int i = 0; i < Items.Size; i++)' loop with:
// ImGuiListClipper clipper(Items.Size);
// while (clipper.Step())
// for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
// However, note that you can not use this code as is if a filter is active because it breaks the 'cheap random-access' property. We would need random-access on the post-filtered list.
// A typical application wanting coarse clipping and filtering may want to pre-compute an array of indices that passed the filtering test, recomputing this array when user changes the filter,
// and appending newly elements as they are inserted. This is left as a task to the user until we can manage to improve this example code!
// If your items are of variable size you may want to implement code similar to what ImGuiListClipper does. Or split your data into fixed height items to allow random-seeking into your list.
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4,1)); // Tighten spacing
if (copy_to_clipboard)
ImGui::LogToClipboard();
ImVec4 col_default_text = ImGui::GetStyleColorVec4(ImGuiCol_Text);
for (int i = 0; i < Items.Size; i++)
{
const char* item = Items[i];
if (!filter.PassFilter(item))
continue;
ImVec4 col = col_default_text;
if (strstr(item, "[error]")) col = ImColor(1.0f,0.4f,0.4f,1.0f);
else if (strncmp(item, "# ", 2) == 0) col = ImColor(1.0f,0.78f,0.58f,1.0f);
ImGui::PushStyleColor(ImGuiCol_Text, col);
ImGui::TextUnformatted(item);
ImGui::PopStyleColor();
}
if (copy_to_clipboard)
ImGui::LogFinish();
if (ScrollToBottom)
ImGui::SetScrollHere(1.0f);
ScrollToBottom = false;
ImGui::PopStyleVar();
ImGui::EndChild();
ImGui::Separator();
// Command-line
bool reclaim_focus = false;
if (ImGui::InputText("Input", InputBuf, IM_ARRAYSIZE(InputBuf), ImGuiInputTextFlags_EnterReturnsTrue|ImGuiInputTextFlags_CallbackCompletion|ImGuiInputTextFlags_CallbackHistory, &TextEditCallbackStub, (void*)this))
{
Strtrim(InputBuf);
if (InputBuf[0])
ExecCommand(InputBuf);
strcpy(InputBuf, "");
reclaim_focus = true;
}
// Demonstrate keeping focus on the input box
ImGui::SetItemDefaultFocus();
if (reclaim_focus)
ImGui::SetKeyboardFocusHere(-1); // Auto focus previous widget
ImGui::End();
}
void ExecCommand(const char* command_line)
{
AddLog("# %s\n", command_line);
// Insert into history. First find match and delete it so it can be pushed to the back. This isn't trying to be smart or optimal.
HistoryPos = -1;
for (int i = History.Size-1; i >= 0; i--)
if (Stricmp(History[i], command_line) == 0)
{
free(History[i]);
History.erase(History.begin() + i);
break;
}
History.push_back(Strdup(command_line));
// Process command
if (Stricmp(command_line, "CLEAR") == 0)
{
ClearLog();
}
else if (Stricmp(command_line, "HELP") == 0)
{
AddLog("Commands:");
for (int i = 0; i < Commands.Size; i++)
AddLog("- %s", Commands[i]);
}
else if (Stricmp(command_line, "HISTORY") == 0)
{
int first = History.Size - 10;
for (int i = first > 0 ? first : 0; i < History.Size; i++)
AddLog("%3d: %s\n", i, History[i]);
}
else
{
AddLog("Unknown command: '%s'\n", command_line);
}
}
static int TextEditCallbackStub(ImGuiTextEditCallbackData* data) // In C++11 you are better off using lambdas for this sort of forwarding callbacks
{
ExampleAppConsole* console = (ExampleAppConsole*)data->UserData;
return console->TextEditCallback(data);
}
int TextEditCallback(ImGuiTextEditCallbackData* data)
{
//AddLog("cursor: %d, selection: %d-%d", data->CursorPos, data->SelectionStart, data->SelectionEnd);
switch (data->EventFlag)
{
case ImGuiInputTextFlags_CallbackCompletion:
{
// Example of TEXT COMPLETION
// Locate beginning of current word
const char* word_end = data->Buf + data->CursorPos;
const char* word_start = word_end;
while (word_start > data->Buf)
{
const char c = word_start[-1];
if (c == ' ' || c == '\t' || c == ',' || c == ';')
break;
word_start--;
}
// Build a list of candidates
ImVector<const char*> candidates;
for (int i = 0; i < Commands.Size; i++)
if (Strnicmp(Commands[i], word_start, (int)(word_end-word_start)) == 0)
candidates.push_back(Commands[i]);
if (candidates.Size == 0)
{
// No match
AddLog("No match for \"%.*s\"!\n", (int)(word_end-word_start), word_start);
}
else if (candidates.Size == 1)
{
// Single match. Delete the beginning of the word and replace it entirely so we've got nice casing
data->DeleteChars((int)(word_start-data->Buf), (int)(word_end-word_start));
data->InsertChars(data->CursorPos, candidates[0]);
data->InsertChars(data->CursorPos, " ");
}
else
{
// Multiple matches. Complete as much as we can, so inputing "C" will complete to "CL" and display "CLEAR" and "CLASSIFY"
int match_len = (int)(word_end - word_start);
for (;;)
{
int c = 0;
bool all_candidates_matches = true;
for (int i = 0; i < candidates.Size && all_candidates_matches; i++)
if (i == 0)
c = toupper(candidates[i][match_len]);
else if (c == 0 || c != toupper(candidates[i][match_len]))
all_candidates_matches = false;
if (!all_candidates_matches)
break;
match_len++;
}
if (match_len > 0)
{
data->DeleteChars((int)(word_start - data->Buf), (int)(word_end-word_start));
data->InsertChars(data->CursorPos, candidates[0], candidates[0] + match_len);
}
// List matches
AddLog("Possible matches:\n");
for (int i = 0; i < candidates.Size; i++)
AddLog("- %s\n", candidates[i]);
}
break;
}
case ImGuiInputTextFlags_CallbackHistory:
{
// Example of HISTORY
const int prev_history_pos = HistoryPos;
if (data->EventKey == ImGuiKey_UpArrow)
{
if (HistoryPos == -1)
HistoryPos = History.Size - 1;
else if (HistoryPos > 0)
HistoryPos--;
}
else if (data->EventKey == ImGuiKey_DownArrow)
{
if (HistoryPos != -1)
if (++HistoryPos >= History.Size)
HistoryPos = -1;
}
// A better implementation would preserve the data on the current input line along with cursor position.
if (prev_history_pos != HistoryPos)
{
data->CursorPos = data->SelectionStart = data->SelectionEnd = data->BufTextLen = (int)snprintf(data->Buf, (size_t)data->BufSize, "%s", (HistoryPos >= 0) ? History[HistoryPos] : "");
data->BufDirty = true;
}
}
}
return 0;
}
};
static void ShowExampleAppConsole(bool* p_open)
{
static ExampleAppConsole console;
console.Draw("Example: Console", p_open);
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: LOG
//-----------------------------------------------------------------------------
// Usage:
// static ExampleAppLog my_log;
// my_log.AddLog("Hello %d world\n", 123);
// my_log.Draw("title");
struct ExampleAppLog
{
ImGuiTextBuffer Buf;
ImGuiTextFilter Filter;
ImVector<int> LineOffsets; // Index to lines offset
bool ScrollToBottom;
void Clear() { Buf.clear(); LineOffsets.clear(); }
void AddLog(const char* fmt, ...) IM_FMTARGS(2)
{
int old_size = Buf.size();
va_list args;
va_start(args, fmt);
Buf.appendfv(fmt, args);
va_end(args);
for (int new_size = Buf.size(); old_size < new_size; old_size++)
if (Buf[old_size] == '\n')
LineOffsets.push_back(old_size);
ScrollToBottom = true;
}
void Draw(const char* title, bool* p_open = NULL)
{
ImGui::SetNextWindowSize(ImVec2(500,400), ImGuiCond_FirstUseEver);
if (!ImGui::Begin(title, p_open))
{
ImGui::End();
return;
}
if (ImGui::Button("Clear")) Clear();
ImGui::SameLine();
bool copy = ImGui::Button("Copy");
ImGui::SameLine();
Filter.Draw("Filter", -100.0f);
ImGui::Separator();
ImGui::BeginChild("scrolling", ImVec2(0,0), false, ImGuiWindowFlags_HorizontalScrollbar);
if (copy) ImGui::LogToClipboard();
if (Filter.IsActive())
{
const char* buf_begin = Buf.begin();
const char* line = buf_begin;
for (int line_no = 0; line != NULL; line_no++)
{
const char* line_end = (line_no < LineOffsets.Size) ? buf_begin + LineOffsets[line_no] : NULL;
if (Filter.PassFilter(line, line_end))
ImGui::TextUnformatted(line, line_end);
line = line_end && line_end[1] ? line_end + 1 : NULL;
}
}
else
{
ImGui::TextUnformatted(Buf.begin());
}
if (ScrollToBottom)
ImGui::SetScrollHere(1.0f);
ScrollToBottom = false;
ImGui::EndChild();
ImGui::End();
}
};
// Demonstrate creating a simple log window with basic filtering.
static void ShowExampleAppLog(bool* p_open)
{
static ExampleAppLog log;
// Demo: add random items (unless Ctrl is held)
static double last_time = -1.0;
double time = ImGui::GetTime();
if (time - last_time >= 0.20f && !ImGui::GetIO().KeyCtrl)
{
const char* random_words[] = { "system", "info", "warning", "error", "fatal", "notice", "log" };
log.AddLog("[%s] Hello, time is %.1f, frame count is %d\n", random_words[rand() % IM_ARRAYSIZE(random_words)], time, ImGui::GetFrameCount());
last_time = time;
}
log.Draw("Example: Log", p_open);
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: SIMPLE LAYOUT
//-----------------------------------------------------------------------------
// Demonstrate create a window with multiple child windows.
static void ShowExampleAppLayout(bool* p_open)
{
ImGui::SetNextWindowSize(ImVec2(500, 440), ImGuiCond_FirstUseEver);
if (ImGui::Begin("Example: Layout", p_open, ImGuiWindowFlags_MenuBar))
{
if (ImGui::BeginMenuBar())
{
if (ImGui::BeginMenu("File"))
{
if (ImGui::MenuItem("Close")) *p_open = false;
ImGui::EndMenu();
}
ImGui::EndMenuBar();
}
// left
static int selected = 0;
ImGui::BeginChild("left pane", ImVec2(150, 0), true);
for (int i = 0; i < 100; i++)
{
char label[128];
sprintf(label, "MyObject %d", i);
if (ImGui::Selectable(label, selected == i))
selected = i;
}
ImGui::EndChild();
ImGui::SameLine();
// right
ImGui::BeginGroup();
ImGui::BeginChild("item view", ImVec2(0, -ImGui::GetFrameHeightWithSpacing())); // Leave room for 1 line below us
ImGui::Text("MyObject: %d", selected);
ImGui::Separator();
ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ");
ImGui::EndChild();
if (ImGui::Button("Revert")) {}
ImGui::SameLine();
if (ImGui::Button("Save")) {}
ImGui::EndGroup();
}
ImGui::End();
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: PROPERTY EDITOR
//-----------------------------------------------------------------------------
// Demonstrate create a simple property editor.
static void ShowExampleAppPropertyEditor(bool* p_open)
{
ImGui::SetNextWindowSize(ImVec2(430,450), ImGuiCond_FirstUseEver);
if (!ImGui::Begin("Example: Property editor", p_open))
{
ImGui::End();
return;
}
ShowHelpMarker("This example shows how you may implement a property editor using two columns.\nAll objects/fields data are dummies here.\nRemember that in many simple cases, you can use ImGui::SameLine(xxx) to position\nyour cursor horizontally instead of using the Columns() API.");
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2,2));
ImGui::Columns(2);
ImGui::Separator();
struct funcs
{
static void ShowDummyObject(const char* prefix, int uid)
{
ImGui::PushID(uid); // Use object uid as identifier. Most commonly you could also use the object pointer as a base ID.
ImGui::AlignTextToFramePadding(); // Text and Tree nodes are less high than regular widgets, here we add vertical spacing to make the tree lines equal high.
bool node_open = ImGui::TreeNode("Object", "%s_%u", prefix, uid);
ImGui::NextColumn();
ImGui::AlignTextToFramePadding();
ImGui::Text("my sailor is rich");
ImGui::NextColumn();
if (node_open)
{
static float dummy_members[8] = { 0.0f,0.0f,1.0f,3.1416f,100.0f,999.0f };
for (int i = 0; i < 8; i++)
{
ImGui::PushID(i); // Use field index as identifier.
if (i < 2)
{
ShowDummyObject("Child", 424242);
}
else
{
// Here we use a TreeNode to highlight on hover (we could use e.g. Selectable as well)
ImGui::AlignTextToFramePadding();
ImGui::TreeNodeEx("Field", ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_Bullet, "Field_%d", i);
ImGui::NextColumn();
ImGui::PushItemWidth(-1);
if (i >= 5)
ImGui::InputFloat("##value", &dummy_members[i], 1.0f);
else
ImGui::DragFloat("##value", &dummy_members[i], 0.01f);
ImGui::PopItemWidth();
ImGui::NextColumn();
}
ImGui::PopID();
}
ImGui::TreePop();
}
ImGui::PopID();
}
};
// Iterate dummy objects with dummy members (all the same data)
for (int obj_i = 0; obj_i < 3; obj_i++)
funcs::ShowDummyObject("Object", obj_i);
ImGui::Columns(1);
ImGui::Separator();
ImGui::PopStyleVar();
ImGui::End();
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: LONG TEXT
//-----------------------------------------------------------------------------
// Demonstrate/test rendering huge amount of text, and the incidence of clipping.
static void ShowExampleAppLongText(bool* p_open)
{
ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiCond_FirstUseEver);
if (!ImGui::Begin("Example: Long text display", p_open))
{
ImGui::End();
return;
}
static int test_type = 0;
static ImGuiTextBuffer log;
static int lines = 0;
ImGui::Text("Printing unusually long amount of text.");
ImGui::Combo("Test type", &test_type, "Single call to TextUnformatted()\0Multiple calls to Text(), clipped manually\0Multiple calls to Text(), not clipped (slow)\0");
ImGui::Text("Buffer contents: %d lines, %d bytes", lines, log.size());
if (ImGui::Button("Clear")) { log.clear(); lines = 0; }
ImGui::SameLine();
if (ImGui::Button("Add 1000 lines"))
{
for (int i = 0; i < 1000; i++)
log.appendf("%i The quick brown fox jumps over the lazy dog\n", lines+i);
lines += 1000;
}
ImGui::BeginChild("Log");
switch (test_type)
{
case 0:
// Single call to TextUnformatted() with a big buffer
ImGui::TextUnformatted(log.begin(), log.end());
break;
case 1:
{
// Multiple calls to Text(), manually coarsely clipped - demonstrate how to use the ImGuiListClipper helper.
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
ImGuiListClipper clipper(lines);
while (clipper.Step())
for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
ImGui::Text("%i The quick brown fox jumps over the lazy dog", i);
ImGui::PopStyleVar();
break;
}
case 2:
// Multiple calls to Text(), not clipped (slow)
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
for (int i = 0; i < lines; i++)
ImGui::Text("%i The quick brown fox jumps over the lazy dog", i);
ImGui::PopStyleVar();
break;
}
ImGui::EndChild();
ImGui::End();
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: AUTO RESIZE
//-----------------------------------------------------------------------------
// Demonstrate creating a window which gets auto-resized according to its content.
static void ShowExampleAppAutoResize(bool* p_open)
{
if (!ImGui::Begin("Example: Auto-resizing window", p_open, ImGuiWindowFlags_AlwaysAutoResize))
{
ImGui::End();
return;
}
static int lines = 10;
ImGui::Text("Window will resize every-frame to the size of its content.\nNote that you probably don't want to query the window size to\noutput your content because that would create a feedback loop.");
ImGui::SliderInt("Number of lines", &lines, 1, 20);
for (int i = 0; i < lines; i++)
ImGui::Text("%*sThis is line %d", i * 4, "", i); // Pad with space to extend size horizontally
ImGui::End();
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: CONSTRAINED RESIZE
//-----------------------------------------------------------------------------
// Demonstrate creating a window with custom resize constraints.
static void ShowExampleAppConstrainedResize(bool* p_open)
{
struct CustomConstraints // Helper functions to demonstrate programmatic constraints
{
static void Square(ImGuiSizeCallbackData* data) { data->DesiredSize = ImVec2(IM_MAX(data->DesiredSize.x, data->DesiredSize.y), IM_MAX(data->DesiredSize.x, data->DesiredSize.y)); }
static void Step(ImGuiSizeCallbackData* data) { float step = (float)(int)(intptr_t)data->UserData; data->DesiredSize = ImVec2((int)(data->DesiredSize.x / step + 0.5f) * step, (int)(data->DesiredSize.y / step + 0.5f) * step); }
};
static bool auto_resize = false;
static int type = 0;
static int display_lines = 10;
if (type == 0) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 0), ImVec2(-1, FLT_MAX)); // Vertical only
if (type == 1) ImGui::SetNextWindowSizeConstraints(ImVec2(0, -1), ImVec2(FLT_MAX, -1)); // Horizontal only
if (type == 2) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(FLT_MAX, FLT_MAX)); // Width > 100, Height > 100
if (type == 3) ImGui::SetNextWindowSizeConstraints(ImVec2(400, -1), ImVec2(500, -1)); // Width 400-500
if (type == 4) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 400), ImVec2(-1, 500)); // Height 400-500
if (type == 5) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Square); // Always Square
if (type == 6) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Step, (void*)100);// Fixed Step
ImGuiWindowFlags flags = auto_resize ? ImGuiWindowFlags_AlwaysAutoResize : 0;
if (ImGui::Begin("Example: Constrained Resize", p_open, flags))
{
const char* desc[] =
{
"Resize vertical only",
"Resize horizontal only",
"Width > 100, Height > 100",
"Width 400-500",
"Height 400-500",
"Custom: Always Square",
"Custom: Fixed Steps (100)",
};
if (ImGui::Button("200x200")) { ImGui::SetWindowSize(ImVec2(200, 200)); } ImGui::SameLine();
if (ImGui::Button("500x500")) { ImGui::SetWindowSize(ImVec2(500, 500)); } ImGui::SameLine();
if (ImGui::Button("800x200")) { ImGui::SetWindowSize(ImVec2(800, 200)); }
ImGui::PushItemWidth(200);
ImGui::Combo("Constraint", &type, desc, IM_ARRAYSIZE(desc));
ImGui::DragInt("Lines", &display_lines, 0.2f, 1, 100);
ImGui::PopItemWidth();
ImGui::Checkbox("Auto-resize", &auto_resize);
for (int i = 0; i < display_lines; i++)
ImGui::Text("%*sHello, sailor! Making this line long enough for the example.", i * 4, "");
}
ImGui::End();
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: SIMPLE OVERLAY
//-----------------------------------------------------------------------------
// Demonstrate creating a simple static window with no decoration + a context-menu to choose which corner of the screen to use.
static void ShowExampleAppSimpleOverlay(bool* p_open)
{
const float DISTANCE = 10.0f;
static int corner = 0;
ImVec2 window_pos = ImVec2((corner & 1) ? ImGui::GetIO().DisplaySize.x - DISTANCE : DISTANCE, (corner & 2) ? ImGui::GetIO().DisplaySize.y - DISTANCE : DISTANCE);
ImVec2 window_pos_pivot = ImVec2((corner & 1) ? 1.0f : 0.0f, (corner & 2) ? 1.0f : 0.0f);
if (corner != -1)
ImGui::SetNextWindowPos(window_pos, ImGuiCond_Always, window_pos_pivot);
ImGui::SetNextWindowBgAlpha(0.3f); // Transparent background
if (ImGui::Begin("Example: Simple Overlay", p_open, (corner != -1 ? ImGuiWindowFlags_NoMove : 0) | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav))
{
ImGui::Text("Simple overlay\n" "in the corner of the screen.\n" "(right-click to change position)");
ImGui::Separator();
if (ImGui::IsMousePosValid())
ImGui::Text("Mouse Position: (%.1f,%.1f)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
else
ImGui::Text("Mouse Position: <invalid>");
if (ImGui::BeginPopupContextWindow())
{
if (ImGui::MenuItem("Custom", NULL, corner == -1)) corner = -1;
if (ImGui::MenuItem("Top-left", NULL, corner == 0)) corner = 0;
if (ImGui::MenuItem("Top-right", NULL, corner == 1)) corner = 1;
if (ImGui::MenuItem("Bottom-left", NULL, corner == 2)) corner = 2;
if (ImGui::MenuItem("Bottom-right", NULL, corner == 3)) corner = 3;
if (p_open && ImGui::MenuItem("Close")) *p_open = false;
ImGui::EndPopup();
}
}
ImGui::End();
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: WINDOW TITLES
//-----------------------------------------------------------------------------
// Demonstrate using "##" and "###" in identifiers to manipulate ID generation.
// This apply to all regular items as well. Read FAQ section "How can I have multiple widgets with the same label? Can I have widget without a label? (Yes). A primer on the purpose of labels/IDs." for details.
static void ShowExampleAppWindowTitles(bool*)
{
// By default, Windows are uniquely identified by their title.
// You can use the "##" and "###" markers to manipulate the display/ID.
// Using "##" to display same title but have unique identifier.
ImGui::SetNextWindowPos(ImVec2(100, 100), ImGuiCond_FirstUseEver);
ImGui::Begin("Same title as another window##1");
ImGui::Text("This is window 1.\nMy title is the same as window 2, but my identifier is unique.");
ImGui::End();
ImGui::SetNextWindowPos(ImVec2(100, 200), ImGuiCond_FirstUseEver);
ImGui::Begin("Same title as another window##2");
ImGui::Text("This is window 2.\nMy title is the same as window 1, but my identifier is unique.");
ImGui::End();
// Using "###" to display a changing title but keep a static identifier "AnimatedTitle"
char buf[128];
sprintf(buf, "Animated title %c %d###AnimatedTitle", "|/-\\"[(int)(ImGui::GetTime() / 0.25f) & 3], ImGui::GetFrameCount());
ImGui::SetNextWindowPos(ImVec2(100, 300), ImGuiCond_FirstUseEver);
ImGui::Begin(buf);
ImGui::Text("This window has a changing title.");
ImGui::End();
}
//-----------------------------------------------------------------------------
// EXAMPLE APP CODE: CUSTOM RENDERING
//-----------------------------------------------------------------------------
// Demonstrate using the low-level ImDrawList to draw custom shapes.
static void ShowExampleAppCustomRendering(bool* p_open)
{
ImGui::SetNextWindowSize(ImVec2(350, 560), ImGuiCond_FirstUseEver);
if (!ImGui::Begin("Example: Custom rendering", p_open))
{
ImGui::End();
return;
}
// Tip: If you do a lot of custom rendering, you probably want to use your own geometrical types and benefit of overloaded operators, etc.
// Define IM_VEC2_CLASS_EXTRA in imconfig.h to create implicit conversions between your types and ImVec2/ImVec4.
// ImGui defines overloaded operators but they are internal to imgui.cpp and not exposed outside (to avoid messing with your types)
// In this example we are not using the maths operators!
ImDrawList* draw_list = ImGui::GetWindowDrawList();
// Primitives
ImGui::Text("Primitives");
static float sz = 36.0f;
static float thickness = 4.0f;
static ImVec4 col = ImVec4(1.0f, 1.0f, 0.4f, 1.0f);
ImGui::DragFloat("Size", &sz, 0.2f, 2.0f, 72.0f, "%.0f");
ImGui::DragFloat("Thickness", &thickness, 0.05f, 1.0f, 8.0f, "%.02f");
ImGui::ColorEdit3("Color", &col.x);
{
const ImVec2 p = ImGui::GetCursorScreenPos();
const ImU32 col32 = ImColor(col);
float x = p.x + 4.0f, y = p.y + 4.0f, spacing = 8.0f;
for (int n = 0; n < 2; n++)
{
float curr_thickness = (n == 0) ? 1.0f : thickness;
draw_list->AddCircle(ImVec2(x+sz*0.5f, y+sz*0.5f), sz*0.5f, col32, 20, curr_thickness); x += sz+spacing;
draw_list->AddRect(ImVec2(x, y), ImVec2(x+sz, y+sz), col32, 0.0f, ImDrawCornerFlags_All, curr_thickness); x += sz+spacing;
draw_list->AddRect(ImVec2(x, y), ImVec2(x+sz, y+sz), col32, 10.0f, ImDrawCornerFlags_All, curr_thickness); x += sz+spacing;
draw_list->AddRect(ImVec2(x, y), ImVec2(x+sz, y+sz), col32, 10.0f, ImDrawCornerFlags_TopLeft|ImDrawCornerFlags_BotRight, curr_thickness); x += sz+spacing;
draw_list->AddTriangle(ImVec2(x+sz*0.5f, y), ImVec2(x+sz,y+sz-0.5f), ImVec2(x,y+sz-0.5f), col32, curr_thickness); x += sz+spacing;
draw_list->AddLine(ImVec2(x, y), ImVec2(x+sz, y ), col32, curr_thickness); x += sz+spacing; // Horizontal line (note: drawing a filled rectangle will be faster!)
draw_list->AddLine(ImVec2(x, y), ImVec2(x, y+sz), col32, curr_thickness); x += spacing; // Vertical line (note: drawing a filled rectangle will be faster!)
draw_list->AddLine(ImVec2(x, y), ImVec2(x+sz, y+sz), col32, curr_thickness); x += sz+spacing; // Diagonal line
draw_list->AddBezierCurve(ImVec2(x, y), ImVec2(x+sz*1.3f,y+sz*0.3f), ImVec2(x+sz-sz*1.3f,y+sz-sz*0.3f), ImVec2(x+sz, y+sz), col32, curr_thickness);
x = p.x + 4;
y += sz+spacing;
}
draw_list->AddCircleFilled(ImVec2(x+sz*0.5f, y+sz*0.5f), sz*0.5f, col32, 32); x += sz+spacing;
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x+sz, y+sz), col32); x += sz+spacing;
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x+sz, y+sz), col32, 10.0f); x += sz+spacing;
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x+sz, y+sz), col32, 10.0f, ImDrawCornerFlags_TopLeft|ImDrawCornerFlags_BotRight); x += sz+spacing;
draw_list->AddTriangleFilled(ImVec2(x+sz*0.5f, y), ImVec2(x+sz,y+sz-0.5f), ImVec2(x,y+sz-0.5f), col32); x += sz+spacing;
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x+sz, y+thickness), col32); x += sz+spacing; // Horizontal line (faster than AddLine, but only handle integer thickness)
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x+thickness, y+sz), col32); x += spacing+spacing; // Vertical line (faster than AddLine, but only handle integer thickness)
draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x+1, y+1), col32); x += sz; // Pixel (faster than AddLine)
draw_list->AddRectFilledMultiColor(ImVec2(x, y), ImVec2(x+sz, y+sz), IM_COL32(0,0,0,255), IM_COL32(255,0,0,255), IM_COL32(255,255,0,255), IM_COL32(0,255,0,255));
ImGui::Dummy(ImVec2((sz+spacing)*8, (sz+spacing)*3));
}
ImGui::Separator();
{
static ImVector<ImVec2> points;
static bool adding_line = false;
ImGui::Text("Canvas example");
if (ImGui::Button("Clear")) points.clear();
if (points.Size >= 2) { ImGui::SameLine(); if (ImGui::Button("Undo")) { points.pop_back(); points.pop_back(); } }
ImGui::Text("Left-click and drag to add lines,\nRight-click to undo");
// Here we are using InvisibleButton() as a convenience to 1) advance the cursor and 2) allows us to use IsItemHovered()
// But you can also draw directly and poll mouse/keyboard by yourself. You can manipulate the cursor using GetCursorPos() and SetCursorPos().
// If you only use the ImDrawList API, you can notify the owner window of its extends by using SetCursorPos(max).
ImVec2 canvas_pos = ImGui::GetCursorScreenPos(); // ImDrawList API uses screen coordinates!
ImVec2 canvas_size = ImGui::GetContentRegionAvail(); // Resize canvas to what's available
if (canvas_size.x < 50.0f) canvas_size.x = 50.0f;
if (canvas_size.y < 50.0f) canvas_size.y = 50.0f;
draw_list->AddRectFilledMultiColor(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), IM_COL32(50, 50, 50, 255), IM_COL32(50, 50, 60, 255), IM_COL32(60, 60, 70, 255), IM_COL32(50, 50, 60, 255));
draw_list->AddRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), IM_COL32(255, 255, 255, 255));
bool adding_preview = false;
ImGui::InvisibleButton("canvas", canvas_size);
ImVec2 mouse_pos_in_canvas = ImVec2(ImGui::GetIO().MousePos.x - canvas_pos.x, ImGui::GetIO().MousePos.y - canvas_pos.y);
if (adding_line)
{
adding_preview = true;
points.push_back(mouse_pos_in_canvas);
if (!ImGui::IsMouseDown(0))
adding_line = adding_preview = false;
}
if (ImGui::IsItemHovered())
{
if (!adding_line && ImGui::IsMouseClicked(0))
{
points.push_back(mouse_pos_in_canvas);
adding_line = true;
}
if (ImGui::IsMouseClicked(1) && !points.empty())
{
adding_line = adding_preview = false;
points.pop_back();
points.pop_back();
}
}
draw_list->PushClipRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), true); // clip lines within the canvas (if we resize it, etc.)
for (int i = 0; i < points.Size - 1; i += 2)
draw_list->AddLine(ImVec2(canvas_pos.x + points[i].x, canvas_pos.y + points[i].y), ImVec2(canvas_pos.x + points[i + 1].x, canvas_pos.y + points[i + 1].y), IM_COL32(255, 255, 0, 255), 2.0f);
draw_list->PopClipRect();
if (adding_preview)
points.pop_back();
}
ImGui::End();
}
// End of Demo code
#else
void ImGui::ShowDemoWindow(bool*) {}
void ImGui::ShowUserGuide() {}
void ImGui::ShowStyleEditor(ImGuiStyle*) {}
#endif
| [
"m.gruscher@ttech.at"
] | m.gruscher@ttech.at |
89f3ccbbb03b857ca9fdd12173b42179aab5aef3 | 45645fd8c0836f239e59bb09f2a022a57c031c17 | /GMAT-R2019aBeta1/src/gmatutil/util/ElapsedTime.cpp | 7de67943338b936c329804d4e5fc58c6a732b0d0 | [
"Apache-2.0"
] | permissive | daniestevez/gmat-dslwp-source | 03678e983f814ed1dcfb41079813e1da9bad2a6e | 9f02f6f94e2188161b624cd3d818a9b230c65845 | refs/heads/master | 2022-10-07T07:05:03.266744 | 2020-06-06T13:32:41 | 2020-06-06T13:32:41 | 260,881,226 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 8,716 | cpp | //$Id$
//------------------------------------------------------------------------------
// ElapsedTime
//------------------------------------------------------------------------------
// GMAT: General Mission Analysis Tool
//
// Copyright (c) 2002 - 2018 United States Government as represented by the
// Administrator of the National Aeronautics and Space Administration.
// All Other Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0.
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language
// governing permissions and limitations under the License.
//
// Developed jointly by NASA/GSFC and Thinking Systems, Inc. under contract
// number S-67573-G
//
// Author: Linda Jun
// Created: 2003/09/22
//
/**
* Defines elapsed time operations. Internal elapsed time is in seconds.
*/
//------------------------------------------------------------------------------
#include <sstream>
#include "ElapsedTime.hpp"
#include "RealUtilities.hpp"
using namespace GmatTimeConstants; // for SECS_PER_DAY, SECS_PER_HOUR, etc.
using namespace GmatMathUtil; // for Rem(), IsEqual()
using namespace GmatMathConstants; // for Rem(), IsEqual()
//---------------------------------
// static variables
//---------------------------------
const std::string ElapsedTime::DATA_DESCRIPTIONS[NUM_DATA] =
{
"Elapsed Time in Seconds"
};
//---------------------------------
// public
//---------------------------------
//------------------------------------------------------------------------------
// ElapsedTime::ElapsedTime(const Real &secs, const Real tol)
//------------------------------------------------------------------------------
ElapsedTime::ElapsedTime(const Real &secs, const Real tol)
: seconds(secs), tolerance(tol)
{
}
//------------------------------------------------------------------------------
// ElapsedTime::ElapsedTime(const ElapsedTime &elapsedTime, const Real tol)
//------------------------------------------------------------------------------
ElapsedTime::ElapsedTime(const ElapsedTime &elapsedTime, const Real tol)
: seconds(elapsedTime.seconds), tolerance(tol)
{
}
//------------------------------------------------------------------------------
// ElapsedTime& ElapsedTime::operator= (const ElapsedTime &right)
//------------------------------------------------------------------------------
ElapsedTime& ElapsedTime::operator= (const ElapsedTime &right)
{
seconds = right.seconds;
return *this;
}
//------------------------------------------------------------------------------
// ElapsedTime::~ElapsedTime()
//------------------------------------------------------------------------------
ElapsedTime::~ElapsedTime()
{
}
//------------------------------------------------------------------------------
// ElapsedTime ElapsedTime::operator+ (const Real &right) const
//------------------------------------------------------------------------------
ElapsedTime ElapsedTime::operator+ (const Real &right) const
{
return ElapsedTime(seconds + right);
}
//------------------------------------------------------------------------------
// ElapsedTime ElapsedTime::operator- (const Real &right) const
//------------------------------------------------------------------------------
ElapsedTime ElapsedTime::operator- (const Real &right) const
{
return ElapsedTime(seconds - right);
}
//------------------------------------------------------------------------------
// const ElapsedTime& ElapsedTime::operator+= (const Real &right)
//------------------------------------------------------------------------------
const ElapsedTime& ElapsedTime::operator+= (const Real &right)
{
seconds += right;
return *this;
}
//------------------------------------------------------------------------------
// const ElapsedTime& ElapsedTime::operator-= (const Real &right)
//------------------------------------------------------------------------------
const ElapsedTime& ElapsedTime::operator-= (const Real &right)
{
seconds -= right;
return *this;
}
//------------------------------------------------------------------------------
// bool ElapsedTime::operator< (const ElapsedTime &right) const
//------------------------------------------------------------------------------
bool ElapsedTime::operator< (const ElapsedTime &right) const
{
return seconds < right.seconds;
}
//------------------------------------------------------------------------------
// bool ElapsedTime::operator> (const ElapsedTime &right) const
//------------------------------------------------------------------------------
bool ElapsedTime::operator> (const ElapsedTime &right) const
{
return seconds > right.seconds;
}
//------------------------------------------------------------------------------
// bool ElapsedTime::operator== (const ElapsedTime &right) const
//------------------------------------------------------------------------------
bool ElapsedTime::operator== (const ElapsedTime &right) const
{
return IsEqual(seconds, right.seconds, tolerance);
}
//------------------------------------------------------------------------------
// bool ElapsedTime::operator!= (const ElapsedTime &right) const
//------------------------------------------------------------------------------
bool ElapsedTime::operator!= (const ElapsedTime &right) const
{
return !(IsEqual(seconds, right.seconds, tolerance));
}
//------------------------------------------------------------------------------
// bool ElapsedTime::operator>= (const ElapsedTime &right) const
//------------------------------------------------------------------------------
bool ElapsedTime::operator>= (const ElapsedTime &right) const
{
return seconds >= right.seconds;
}
//------------------------------------------------------------------------------
// bool ElapsedTime::operator<= (const ElapsedTime &right) const
//------------------------------------------------------------------------------
bool ElapsedTime::operator<= (const ElapsedTime &right) const
{
return seconds <= right.seconds;
}
//------------------------------------------------------------------------------
// Real ElapsedTime::Get() const
//------------------------------------------------------------------------------
Real ElapsedTime::Get() const
{
return seconds;
}
//------------------------------------------------------------------------------
// void ElapsedTime::Set(Real secs)
//------------------------------------------------------------------------------
void ElapsedTime::Set(Real secs)
{
seconds = secs;
}
//------------------------------------------------------------------------------
// GmatTimeUtil::ElapsedDate ElapsedTime::ToElapsedDate() const
//------------------------------------------------------------------------------
GmatTimeUtil::ElapsedDate ElapsedTime::ToElapsedDate() const
{
Real secs = seconds;
// Compute sign
if (secs < 0)
secs = - secs;
//Compute elapsed days, hours, minutes, seconds
Integer days = (Integer)(secs / SECS_PER_DAY);
Integer hours = (Integer)(Rem(secs, SECS_PER_DAY) / SECS_PER_HOUR);
Integer minutes = (Integer)(Rem(Rem(secs, SECS_PER_DAY),
SECS_PER_HOUR) / SECS_PER_MINUTE);
secs = Rem(Rem(Rem(secs, SECS_PER_DAY), SECS_PER_HOUR), SECS_PER_MINUTE);
return GmatTimeUtil::ElapsedDate(days, hours, minutes, secs);
}
//------------------------------------------------------------------------------
// Integer GetNumData() const
//------------------------------------------------------------------------------
Integer ElapsedTime::GetNumData() const
{
return NUM_DATA;
}
//------------------------------------------------------------------------------
// const std::string* ElapsedTime::GetDataDescriptions() const
//------------------------------------------------------------------------------
const std::string* ElapsedTime::GetDataDescriptions() const
{
return DATA_DESCRIPTIONS;
}
//------------------------------------------------------------------------------
// std::string* ElapsedTime::ToValueStrings()
//------------------------------------------------------------------------------
std::string* ElapsedTime::ToValueStrings()
{
std::stringstream ss("");
ss << seconds;
stringValues[0] = ss.str();
return stringValues;
}
| [
"daniel@destevez.net"
] | daniel@destevez.net |
693ec5479652da2b68191d0b5f49d03fd348bdc8 | 4b055f9c18ad613f10c0e281873b800f3ff515ff | /Minigin/Scene.h | 3bc00529b808bb170f1e5e74a04999e45e9d252b | [] | no_license | minoarno/MidestinyEngine | 982508e7ac0197fc49649c1bec362ad5ba113469 | 68e88f2f3dc537cf4add9fe474004681a90e8a84 | refs/heads/main | 2023-07-16T06:31:24.398267 | 2021-08-23T04:40:14 | 2021-08-23T04:40:14 | 337,725,203 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 719 | h | #pragma once
#include <string>
#include <vector>
namespace dae
{
class GameObject;
class Scene
{
public:
explicit Scene(const std::string& name);
Scene(const Scene& other) = delete;
Scene(Scene&& other) = delete;
Scene& operator=(const Scene& other) = delete;
Scene& operator=(Scene&& other) = delete;
virtual ~Scene();
void Add(GameObject* object);
virtual void Initialize();
virtual void FixedUpdate();
virtual void Update();
virtual void LateUpdate();
virtual void Render() const;
virtual void Unload();
std::vector<GameObject*> Collision(GameObject* object);
private:
std::string m_Name;
std::vector <GameObject*> m_Objects{};
static unsigned int m_IdCounter;
};
}
| [
"minoarno@users.noreply.github.com"
] | minoarno@users.noreply.github.com |
45ee96df706710c295ecee9b68fd069e5505bd12 | bedac65573099644606eb947be2bfdf8fb809db5 | /MainMenuScene.cpp | 6b54f7198f2b519bb1729382adf4016235ce5473 | [] | no_license | wooooonga/WoongGame | e3178c6439fb4a966ed915f5cfef87158e3f2934 | 769184d46de6edca4b9285e6878d7e601aa3bc26 | refs/heads/master | 2016-09-06T16:55:42.750673 | 2014-05-09T08:03:02 | 2014-05-09T08:03:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,890 | cpp | #include "MainMenuScene.h"
#include "MainGameScene.h"
#include "ScoreBoard.h"
USING_NS_CC;
Scene* MainMenuScene::CreateScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = MainMenuScene::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
// on "init" you need to initialize your instance
bool MainMenuScene::init()
{
this->setTouchEnabled(true);
//////////////////////////////
// 1. super init first
if ( !Layer::init() )
{
return false;
}
Size visibleSize = Director::getInstance()->getVisibleSize();
Point origin = Director::getInstance()->getVisibleOrigin();
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
// you may modify it.
// add a "close" icon to exit the progress. it's an autorelease object
auto closeItem = MenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
CC_CALLBACK_1(MainMenuScene::menuCloseCallback, this));
closeItem->setPosition(Point(origin.x + visibleSize.width - closeItem->getContentSize().width/2 ,
origin.y + closeItem->getContentSize().height/2));
// create menu, it's an autorelease object
auto menu = Menu::create(closeItem, NULL);
menu->setPosition(Point::ZERO);
this->addChild(menu, 1);
/////////////////////////////
// 3. add your codes below...
LabelBMFont *pBMfontStart = LabelBMFont::create("Start", "fonts/FlappyFont.fnt", visibleSize.width / 1.5, kCCTextAlignmentCenter);
LabelBMFont *pBMfontScore = LabelBMFont::create("HighScore", "fonts/FlappyFont.fnt", visibleSize.width / 1.5, kCCTextAlignmentCenter);
LabelBMFont *pBMfontClose = LabelBMFont::create("Close", "fonts/FlappyFont.fnt", visibleSize.width / 1.5, kCCTextAlignmentCenter);
//MenuItemFont *pLabelStart = MenuItemFont::create("Start", this, menu_selector(MainMenuScene::menuGoToGame));
//MenuItemFont *pLabelClose = MenuItemFont::create("Close", this, menu_selector(MainMenuScene::menuCloseCallback));
MenuItemLabel *pLabelStart = MenuItemLabel::create(pBMfontStart, this, menu_selector(MainMenuScene::menuGoToGame));
MenuItemLabel *pLabelScore = MenuItemLabel::create(pBMfontScore, this, menu_selector(MainMenuScene::ShowHighScore));
MenuItemLabel *pLabelClose = MenuItemLabel::create(pBMfontClose, this, menu_selector(MainMenuScene::menuCloseCallback));
pLabelStart->setColor(ccc3(255, 0, 0));
pLabelClose->setColor(ccc3(0, 255, 0));
Menu* pMenu = Menu::create(pLabelStart, pLabelClose, pLabelScore, NULL);
pMenu->setPosition(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y);
pMenu->alignItemsVertically();
pMenu->setTag(MENU);
this->addChild(pMenu, 1);
//////////////////////////
// pressed Backbutton
//////////////////////////
_keyboardListener = EventListenerKeyboard::create();
_keyboardListener->onKeyReleased = CC_CALLBACK_2(MainMenuScene::onKeyReleased, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(_keyboardListener, this);
// add "MainMenuScene" splash screen"
Sprite* bgSprite = Sprite::create("Img/MarioBackground-static.png");
bgSprite->setPosition((Point(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y)));
// add the sprite as a child to this layer
this->addChild(bgSprite, 0);
return true;
}
void MainMenuScene::menuCloseCallback(Ref* pSender)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
MessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert");
return;
#endif
Director::getInstance()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
}
void MainMenuScene::ShowHighScore(cocos2d::Ref* pSender)
{
ScoreBoard* scoreBoard = ScoreBoard::CreateScoreBoard(100000);
scoreBoard->setTag(SCOREBOARD);
this->addChild(scoreBoard, 30);
Menu* pMenu = (Menu*) this->getChildByTag(MENU);
pMenu->setVisible(false);
}
void
MainMenuScene::onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event)
{
if(keyCode == EventKeyboard::KeyCode::KEY_BACKSPACE)
{
ScoreBoard* scoreBoard = (ScoreBoard*) this->getChildByTag(SCOREBOARD);
if(scoreBoard != NULL)
{
this->removeChildByTag(SCOREBOARD);
Menu* pMenu = (Menu*) this->getChildByTag(MENU);
pMenu->setVisible(true);
}
else
{
Director::getInstance()->end();
}
}
}
void MainMenuScene::menuGoToGame(Ref* pSender)
{
Scene *pScene = MainGameScene::CreateScene();
pScene->getPhysicsWorld()->setDebugDrawMask(PhysicsWorld::DEBUGDRAW_NONE);
Director::getInstance()->replaceScene(pScene);
}
| [
"wooooonga@gmail.com"
] | wooooonga@gmail.com |
3de0b57005cc108d02e7bf9e8d0ad1bd84091906 | 8554fbbb1c710b68277d40ca21397ff0c1e98391 | /Lightoj Solutions/1200 - Thief.cpp | 255c3f5fb578ff2cafcf583affb6732ae59d9e46 | [] | no_license | Nasif-Imtiaj/Judge-Solutions | 753be5ddb39249c433f7590354bd343329ee16df | cb5f56babfd3bf9286281b5503de8501d21907fe | refs/heads/master | 2020-12-02T17:38:41.380575 | 2020-04-05T16:29:51 | 2020-04-05T16:29:51 | 231,076,432 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,376 | cpp | #include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define co(q) cout<<q<<endl;
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define bug cout<<"bug"<<endl;
#define FastRead ios_base::sync_with_stdio(false);cin.tie(NULL);
int dp[10005][101],ans,n,arr[2][105],remain_weight;
int recur(int pos,int cur_weight)
{
if(pos==n)
return 0;
if(dp[cur_weight][pos]!=-1)
return dp[cur_weight][pos];
int l=0,r=0;
if(arr[1][pos]+cur_weight<=remain_weight)
{
l=arr[0][pos]+recur(pos+1,arr[1][pos]+cur_weight);
l=max(l,arr[0][pos]+recur(pos,arr[1][pos]+cur_weight));
}
r=recur(pos+1,cur_weight);
return dp[cur_weight][pos]=max(l,r);
}
int main()
{
//freopen("output.txt", "w", stdout);
int t;
scanf("%d",&t);
for(int k=1; k<=t; k++)
{
int w;
scanf("%d %d",&n,&w);
for(int i=0; i<n; i++)
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
arr[0][i]=a;
arr[1][i]=c;
w-=b*c;
}
if(w<0)
printf("Case %d: Impossible\n",k);
else
{
remain_weight=w;
memset(dp, -1, sizeof(dp));
printf("Case %d: %d\n",k,recur(0,0));
}
}
return 0;
}
| [
"nasifimtiaj.16@gmail.com"
] | nasifimtiaj.16@gmail.com |
57f063a152f45af51c3ef4804cda34f972dd8d34 | f67f0f77370d18400e2ac3a64b5eda85231fbe8b | /of-develop/squareBump/71/h | 0f6e270282c1e8899699014a1f7807e831f21a61 | [] | no_license | seiyawati/OpenFOAM | 6c3f0a2691e0eeabee6645d7b71c272c2489de03 | 79d770169962cc641f5b386318f210c61b9a8e25 | refs/heads/master | 2023-06-09T18:28:56.170426 | 2021-06-10T15:03:44 | 2021-06-10T15:03:44 | 354,198,942 | 0 | 0 | null | 2021-06-18T06:13:41 | 2021-04-03T04:30:05 | C++ | UTF-8 | C++ | false | false | 5,062 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "71";
object h;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField nonuniform List<scalar>
400
(
0.0100007
0.0100007
0.0100007
0.0100007
0.0100007
0.0100007
0.0100007
0.0100007
0.0100006
0.0100006
0.0100006
0.0100006
0.0100006
0.0100005
0.0100005
0.0100004
0.0100004
0.0100003
0.0100002
0.0100001
0.0100006
0.0100006
0.0100006
0.0100006
0.0100006
0.0100005
0.0100005
0.0100005
0.0100005
0.0100005
0.0100005
0.0100005
0.0100004
0.0100004
0.0100004
0.0100003
0.0100003
0.0100002
0.0100001
0.01
0.0100005
0.0100005
0.0100005
0.0100005
0.0100005
0.0100005
0.0100005
0.0100005
0.0100005
0.0100005
0.0100004
0.0100004
0.0100004
0.0100004
0.0100003
0.0100003
0.0100002
0.0100002
0.0100001
0.01
0.0100004
0.0100004
0.0100004
0.0100004
0.0100004
0.0100004
0.0100004
0.0100004
0.0100004
0.0100004
0.0100004
0.0100003
0.0100003
0.0100003
0.0100003
0.0100002
0.0100002
0.0100001
0.0100001
0.01
0.0100004
0.0100004
0.0100004
0.0100004
0.0100004
0.0100004
0.0100004
0.0100003
0.0100003
0.0100003
0.0100003
0.0100003
0.0100003
0.0100003
0.0100002
0.0100002
0.0100002
0.0100001
0.0100001
0.01
0.0100003
0.0100003
0.0100003
0.0100003
0.0100003
0.0100003
0.0100003
0.0100003
0.0100003
0.0100003
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100001
0.0100001
0.0100001
0.0100001
0.01
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100001
0.0100001
0.0100001
0.0100001
0.01
0.01
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100002
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.01
0.01
0.01
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.0100001
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.01
0.00999997
0.00999997
0.00999997
0.00999997
0.00999997
0.00999997
0.00999997
0.00999997
0.00999997
0.00999997
0.00999997
0.00999998
0.00999998
0.00999998
0.00999998
0.00999998
0.00999999
0.00999999
0.00999999
0.01
0.0099999
0.0099999
0.0099999
0.0099999
0.0099999
0.0099999
0.00999991
0.00999991
0.00999991
0.00999992
0.00999992
0.00999992
0.00999993
0.00999994
0.00999994
0.00999995
0.00999996
0.00999997
0.00999998
0.00999999
0.00999983
0.00999983
0.00999983
0.00999983
0.00999984
0.00999984
0.00999984
0.00999985
0.00999985
0.00999986
0.00999986
0.00999987
0.00999988
0.00999989
0.00999991
0.00999992
0.00999994
0.00999995
0.00999997
0.00999999
0.00999976
0.00999976
0.00999977
0.00999977
0.00999977
0.00999977
0.00999978
0.00999978
0.00999979
0.0099998
0.00999981
0.00999982
0.00999983
0.00999985
0.00999986
0.00999988
0.00999991
0.00999993
0.00999996
0.00999998
0.0099997
0.0099997
0.0099997
0.0099997
0.00999971
0.00999971
0.00999972
0.00999972
0.00999973
0.00999974
0.00999975
0.00999977
0.00999978
0.0099998
0.00999983
0.00999985
0.00999988
0.00999991
0.00999995
0.00999998
0.00999963
0.00999963
0.00999963
0.00999963
0.00999963
0.00999964
0.00999964
0.00999965
0.00999966
0.00999967
0.00999969
0.0099997
0.00999972
0.00999975
0.00999977
0.00999981
0.00999984
0.00999988
0.00999993
0.00999997
0.00999956
0.00999956
0.00999957
0.00999957
0.00999958
0.00999958
0.00999959
0.0099996
0.00999961
0.00999962
0.00999964
0.00999966
0.00999968
0.00999971
0.00999974
0.00999977
0.00999982
0.00999986
0.00999992
0.00999997
0.00999948
0.00999948
0.00999948
0.00999948
0.00999948
0.00999949
0.0099995
0.00999951
0.00999952
0.00999953
0.00999955
0.00999957
0.0099996
0.00999963
0.00999966
0.00999971
0.00999975
0.00999981
0.00999988
0.00999995
0.00999943
0.00999943
0.00999944
0.00999944
0.00999945
0.00999946
0.00999946
0.00999947
0.00999949
0.0099995
0.00999952
0.00999954
0.00999957
0.0099996
0.00999964
0.00999968
0.00999974
0.0099998
0.00999988
0.00999996
0.00999931
0.00999931
0.00999931
0.00999931
0.00999932
0.00999933
0.00999934
0.00999935
0.00999936
0.00999938
0.0099994
0.00999942
0.00999945
0.00999948
0.00999952
0.00999957
0.00999963
0.0099997
0.0099998
0.00999991
)
;
boundaryField
{
sides
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0.01;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
| [
"kid960805@gmail.com"
] | kid960805@gmail.com | |
f54cc2fe01b4b329d9364d7a2d7076af7862c036 | e398a585764f16511a70d0ef33a3b61da0733b69 | /3790.1830/inc/wxp/oleacc.h | cc4ab2ee100ba8d0531dcb369c82a305c8f2c0c6 | [
"MIT"
] | permissive | MichaelDavidGK/WinDDK | f9e4fc6872741ee742f8eace04b2b3a30b049495 | eea187e357d61569e67292ff705550887c4df908 | refs/heads/master | 2020-05-30T12:26:40.125588 | 2019-06-01T13:28:10 | 2019-06-01T13:28:10 | 189,732,991 | 0 | 0 | null | 2019-06-01T12:58:11 | 2019-06-01T12:58:11 | null | UTF-8 | C++ | false | false | 70,150 | h |
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 6.00.0347 */
/* Compiler settings for oleacc.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __oleacc_h__
#define __oleacc_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IAccessible_FWD_DEFINED__
#define __IAccessible_FWD_DEFINED__
typedef interface IAccessible IAccessible;
#endif /* __IAccessible_FWD_DEFINED__ */
#ifndef __IAccessibleHandler_FWD_DEFINED__
#define __IAccessibleHandler_FWD_DEFINED__
typedef interface IAccessibleHandler IAccessibleHandler;
#endif /* __IAccessibleHandler_FWD_DEFINED__ */
#ifndef __IAccIdentity_FWD_DEFINED__
#define __IAccIdentity_FWD_DEFINED__
typedef interface IAccIdentity IAccIdentity;
#endif /* __IAccIdentity_FWD_DEFINED__ */
#ifndef __IAccPropServer_FWD_DEFINED__
#define __IAccPropServer_FWD_DEFINED__
typedef interface IAccPropServer IAccPropServer;
#endif /* __IAccPropServer_FWD_DEFINED__ */
#ifndef __IAccPropServices_FWD_DEFINED__
#define __IAccPropServices_FWD_DEFINED__
typedef interface IAccPropServices IAccPropServices;
#endif /* __IAccPropServices_FWD_DEFINED__ */
#ifndef __IAccessible_FWD_DEFINED__
#define __IAccessible_FWD_DEFINED__
typedef interface IAccessible IAccessible;
#endif /* __IAccessible_FWD_DEFINED__ */
#ifndef __IAccessibleHandler_FWD_DEFINED__
#define __IAccessibleHandler_FWD_DEFINED__
typedef interface IAccessibleHandler IAccessibleHandler;
#endif /* __IAccessibleHandler_FWD_DEFINED__ */
#ifndef __IAccIdentity_FWD_DEFINED__
#define __IAccIdentity_FWD_DEFINED__
typedef interface IAccIdentity IAccIdentity;
#endif /* __IAccIdentity_FWD_DEFINED__ */
#ifndef __IAccPropServer_FWD_DEFINED__
#define __IAccPropServer_FWD_DEFINED__
typedef interface IAccPropServer IAccPropServer;
#endif /* __IAccPropServer_FWD_DEFINED__ */
#ifndef __IAccPropServices_FWD_DEFINED__
#define __IAccPropServices_FWD_DEFINED__
typedef interface IAccPropServices IAccPropServices;
#endif /* __IAccPropServices_FWD_DEFINED__ */
#ifndef __CAccPropServices_FWD_DEFINED__
#define __CAccPropServices_FWD_DEFINED__
#ifdef __cplusplus
typedef class CAccPropServices CAccPropServices;
#else
typedef struct CAccPropServices CAccPropServices;
#endif /* __cplusplus */
#endif /* __CAccPropServices_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#ifdef __cplusplus
extern "C"{
#endif
void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * );
/* interface __MIDL_itf_oleacc_0000 */
/* [local] */
//=--------------------------------------------------------------------------=
// OLEACC.H
//=--------------------------------------------------------------------------=
// (C) Copyright (c) Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//=--------------------------------------------------------------------------=
//=--------------------------------------------------------------------------=
// Typedefs
//=--------------------------------------------------------------------------=
typedef LRESULT (STDAPICALLTYPE *LPFNLRESULTFROMOBJECT)(REFIID riid, WPARAM wParam, LPUNKNOWN punk);
typedef HRESULT (STDAPICALLTYPE *LPFNOBJECTFROMLRESULT)(LRESULT lResult, REFIID riid, WPARAM wParam, void** ppvObject);
typedef HRESULT (STDAPICALLTYPE *LPFNACCESSIBLEOBJECTFROMWINDOW)(HWND hwnd, DWORD dwId, REFIID riid, void** ppvObject);
typedef HRESULT (STDAPICALLTYPE *LPFNACCESSIBLEOBJECTFROMPOINT)(POINT ptScreen, IAccessible** ppacc, VARIANT* pvarChild);
typedef HRESULT (STDAPICALLTYPE *LPFNCREATESTDACCESSIBLEOBJECT)(HWND hwnd, LONG idObject, REFIID riid, void** ppvObject);
typedef HRESULT (STDAPICALLTYPE *LPFNACCESSIBLECHILDREN)(IAccessible* paccContainer, LONG iChildStart,LONG cChildren,VARIANT* rgvarChildren,LONG* pcObtained);
//=--------------------------------------------------------------------------=
// GUIDs
//=--------------------------------------------------------------------------=
DEFINE_GUID(LIBID_Accessibility, 0x1ea4dbf0, 0x3c3b, 0x11cf, 0x81, 0x0c, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
DEFINE_GUID(IID_IAccessible, 0x618736e0, 0x3c3d, 0x11cf, 0x81, 0x0c, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
DEFINE_GUID(IID_IAccessibleHandler, 0x03022430, 0xABC4, 0x11d0, 0xBD, 0xE2, 0x00, 0xAA, 0x00, 0x1A, 0x19, 0x53);
DEFINE_GUID(IID_IAccIdentity, 0x7852b78d, 0x1cfd, 0x41c1, 0xa6, 0x15, 0x9c, 0x0c, 0x85, 0x96, 0x0b, 0x5f);
DEFINE_GUID(IID_IAccPropServer, 0x76c0dbbb, 0x15e0, 0x4e7b, 0xb6, 0x1b, 0x20, 0xee, 0xea, 0x20, 0x01, 0xe0);
DEFINE_GUID(IID_IAccPropServices, 0x6e26e776, 0x04f0, 0x495d, 0x80, 0xe4, 0x33, 0x30, 0x35, 0x2e, 0x31, 0x69);
DEFINE_GUID(IID_IAccPropMgrInternal, 0x2bd370a9, 0x3e7f, 0x4edd, 0x8a, 0x85, 0xf8, 0xfe, 0xd1, 0xf8, 0xe5, 0x1f);
DEFINE_GUID(CLSID_AccPropServices, 0xb5f8350b, 0x0548, 0x48b1, 0xa6, 0xee, 0x88, 0xbd, 0x00, 0xb4, 0xa5, 0xe7);
DEFINE_GUID(IIS_IsOleaccProxy, 0x902697fa, 0x80e4, 0x4560, 0x80, 0x2a, 0xa1, 0x3f, 0x22, 0xa6, 0x47, 0x09);
//=--------------------------------------------------------------------------=
// MSAA API Prototypes
//=--------------------------------------------------------------------------=
STDAPI_(LRESULT) LresultFromObject(REFIID riid, WPARAM wParam, LPUNKNOWN punk);
STDAPI ObjectFromLresult(LRESULT lResult, REFIID riid, WPARAM wParam, void** ppvObject);
STDAPI WindowFromAccessibleObject(IAccessible*, HWND* phwnd);
STDAPI AccessibleObjectFromWindow(HWND hwnd, DWORD dwId, REFIID riid, void **ppvObject);
STDAPI AccessibleObjectFromEvent(HWND hwnd, DWORD dwId, DWORD dwChildId, IAccessible** ppacc, VARIANT* pvarChild);
STDAPI AccessibleObjectFromPoint(POINT ptScreen, IAccessible ** ppacc, VARIANT* pvarChild);
STDAPI AccessibleChildren (IAccessible* paccContainer, LONG iChildStart,LONG cChildren, VARIANT* rgvarChildren,LONG* pcObtained);
STDAPI_(UINT) GetRoleTextA(DWORD lRole, LPSTR lpszRole, UINT cchRoleMax);
STDAPI_(UINT) GetRoleTextW(DWORD lRole, LPWSTR lpszRole, UINT cchRoleMax);
#ifdef UNICODE
#define GetRoleText GetRoleTextW
#else
#define GetRoleText GetRoleTextA
#endif // UNICODE
STDAPI_(UINT) GetStateTextA(DWORD lStateBit, LPSTR lpszState, UINT cchState);
STDAPI_(UINT) GetStateTextW(DWORD lStateBit, LPWSTR lpszState, UINT cchState);
#ifdef UNICODE
#define GetStateText GetStateTextW
#else
#define GetStateText GetStateTextA
#endif // UNICODE
STDAPI_(VOID) GetOleaccVersionInfo(DWORD* pVer, DWORD* pBuild);
STDAPI CreateStdAccessibleObject(HWND hwnd, LONG idObject, REFIID riid, void** ppvObject);
STDAPI CreateStdAccessibleProxyA(HWND hwnd, LPCSTR pClassName, LONG idObject, REFIID riid, void** ppvObject);
STDAPI CreateStdAccessibleProxyW(HWND hwnd, LPCWSTR pClassName, LONG idObject, REFIID riid, void** ppvObject);
#ifdef UNICODE
#define CreateStdAccessibleProxy CreateStdAccessibleProxyW
#else
#define CreateStdAccessibleProxy CreateStdAccessibleProxyA
#endif // UNICODE
// Simple Owner-Drawn Menu support...
#define MSAA_MENU_SIG 0xAA0DF00DL
// Menu's dwItemData should point to one of these structs:
// (or can point to an app-defined struct containing this as the first member)
typedef struct tagMSAAMENUINFO {
DWORD dwMSAASignature; // Must be MSAA_MENU_SIG
DWORD cchWText; // Length of text, in Unicode characters, excluding terminating NUL
LPWSTR pszWText; // NUL-terminated text, in Unicode
} MSAAMENUINFO, *LPMSAAMENUINFO;
//=--------------------------------------------------------------------------=
// Property GUIDs (used by annotation interfaces)
//=--------------------------------------------------------------------------=
DEFINE_GUID( PROPID_ACC_NAME , 0x608d3df8, 0x8128, 0x4aa7, 0xa4, 0x28, 0xf5, 0x5e, 0x49, 0x26, 0x72, 0x91);
DEFINE_GUID( PROPID_ACC_VALUE , 0x123fe443, 0x211a, 0x4615, 0x95, 0x27, 0xc4, 0x5a, 0x7e, 0x93, 0x71, 0x7a);
DEFINE_GUID( PROPID_ACC_DESCRIPTION , 0x4d48dfe4, 0xbd3f, 0x491f, 0xa6, 0x48, 0x49, 0x2d, 0x6f, 0x20, 0xc5, 0x88);
DEFINE_GUID( PROPID_ACC_ROLE , 0xcb905ff2, 0x7bd1, 0x4c05, 0xb3, 0xc8, 0xe6, 0xc2, 0x41, 0x36, 0x4d, 0x70);
DEFINE_GUID( PROPID_ACC_STATE , 0xa8d4d5b0, 0x0a21, 0x42d0, 0xa5, 0xc0, 0x51, 0x4e, 0x98, 0x4f, 0x45, 0x7b);
DEFINE_GUID( PROPID_ACC_HELP , 0xc831e11f, 0x44db, 0x4a99, 0x97, 0x68, 0xcb, 0x8f, 0x97, 0x8b, 0x72, 0x31);
DEFINE_GUID( PROPID_ACC_KEYBOARDSHORTCUT , 0x7d9bceee, 0x7d1e, 0x4979, 0x93, 0x82, 0x51, 0x80, 0xf4, 0x17, 0x2c, 0x34);
DEFINE_GUID( PROPID_ACC_DEFAULTACTION , 0x180c072b, 0xc27f, 0x43c7, 0x99, 0x22, 0xf6, 0x35, 0x62, 0xa4, 0x63, 0x2b);
DEFINE_GUID( PROPID_ACC_HELPTOPIC , 0x787d1379, 0x8ede, 0x440b, 0x8a, 0xec, 0x11, 0xf7, 0xbf, 0x90, 0x30, 0xb3);
DEFINE_GUID( PROPID_ACC_FOCUS , 0x6eb335df, 0x1c29, 0x4127, 0xb1, 0x2c, 0xde, 0xe9, 0xfd, 0x15, 0x7f, 0x2b);
DEFINE_GUID( PROPID_ACC_SELECTION , 0xb99d073c, 0xd731, 0x405b, 0x90, 0x61, 0xd9, 0x5e, 0x8f, 0x84, 0x29, 0x84);
DEFINE_GUID( PROPID_ACC_PARENT , 0x474c22b6, 0xffc2, 0x467a, 0xb1, 0xb5, 0xe9, 0x58, 0xb4, 0x65, 0x73, 0x30);
DEFINE_GUID( PROPID_ACC_NAV_UP , 0x016e1a2b, 0x1a4e, 0x4767, 0x86, 0x12, 0x33, 0x86, 0xf6, 0x69, 0x35, 0xec);
DEFINE_GUID( PROPID_ACC_NAV_DOWN , 0x031670ed, 0x3cdf, 0x48d2, 0x96, 0x13, 0x13, 0x8f, 0x2d, 0xd8, 0xa6, 0x68);
DEFINE_GUID( PROPID_ACC_NAV_LEFT , 0x228086cb, 0x82f1, 0x4a39, 0x87, 0x05, 0xdc, 0xdc, 0x0f, 0xff, 0x92, 0xf5);
DEFINE_GUID( PROPID_ACC_NAV_RIGHT , 0xcd211d9f, 0xe1cb, 0x4fe5, 0xa7, 0x7c, 0x92, 0x0b, 0x88, 0x4d, 0x09, 0x5b);
DEFINE_GUID( PROPID_ACC_NAV_PREV , 0x776d3891, 0xc73b, 0x4480, 0xb3, 0xf6, 0x07, 0x6a, 0x16, 0xa1, 0x5a, 0xf6);
DEFINE_GUID( PROPID_ACC_NAV_NEXT , 0x1cdc5455, 0x8cd9, 0x4c92, 0xa3, 0x71, 0x39, 0x39, 0xa2, 0xfe, 0x3e, 0xee);
DEFINE_GUID( PROPID_ACC_NAV_FIRSTCHILD , 0xcfd02558, 0x557b, 0x4c67, 0x84, 0xf9, 0x2a, 0x09, 0xfc, 0xe4, 0x07, 0x49);
DEFINE_GUID( PROPID_ACC_NAV_LASTCHILD , 0x302ecaa5, 0x48d5, 0x4f8d, 0xb6, 0x71, 0x1a, 0x8d, 0x20, 0xa7, 0x78, 0x32);
// Value map, used by sliders and other controls...
DEFINE_GUID( PROPID_ACC_ROLEMAP , 0xf79acda2, 0x140d, 0x4fe6, 0x89, 0x14, 0x20, 0x84, 0x76, 0x32, 0x82, 0x69);
DEFINE_GUID( PROPID_ACC_VALUEMAP , 0xda1c3d79, 0xfc5c, 0x420e, 0xb3, 0x99, 0x9d, 0x15, 0x33, 0x54, 0x9e, 0x75);
DEFINE_GUID( PROPID_ACC_STATEMAP , 0x43946c5e, 0x0ac0, 0x4042, 0xb5, 0x25, 0x07, 0xbb, 0xdb, 0xe1, 0x7f, 0xa7);
DEFINE_GUID( PROPID_ACC_DESCRIPTIONMAP , 0x1ff1435f, 0x8a14, 0x477b, 0xb2, 0x26, 0xa0, 0xab, 0xe2, 0x79, 0x97, 0x5d);
DEFINE_GUID( PROPID_ACC_DODEFAULTACTION , 0x1ba09523, 0x2e3b, 0x49a6, 0xa0, 0x59, 0x59, 0x68, 0x2a, 0x3c, 0x48, 0xfd);
//=--------------------------------------------------------------------------=
// Interface Definitions
//=--------------------------------------------------------------------------=
extern RPC_IF_HANDLE __MIDL_itf_oleacc_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_oleacc_0000_v0_0_s_ifspec;
#ifndef __IAccessible_INTERFACE_DEFINED__
#define __IAccessible_INTERFACE_DEFINED__
/* interface IAccessible */
/* [unique][dual][hidden][uuid][object] */
#define DISPID_ACC_PARENT ( -5000 )
#define DISPID_ACC_CHILDCOUNT ( -5001 )
#define DISPID_ACC_CHILD ( -5002 )
#define DISPID_ACC_NAME ( -5003 )
#define DISPID_ACC_VALUE ( -5004 )
#define DISPID_ACC_DESCRIPTION ( -5005 )
#define DISPID_ACC_ROLE ( -5006 )
#define DISPID_ACC_STATE ( -5007 )
#define DISPID_ACC_HELP ( -5008 )
#define DISPID_ACC_HELPTOPIC ( -5009 )
#define DISPID_ACC_KEYBOARDSHORTCUT ( -5010 )
#define DISPID_ACC_FOCUS ( -5011 )
#define DISPID_ACC_SELECTION ( -5012 )
#define DISPID_ACC_DEFAULTACTION ( -5013 )
#define DISPID_ACC_SELECT ( -5014 )
#define DISPID_ACC_LOCATION ( -5015 )
#define DISPID_ACC_NAVIGATE ( -5016 )
#define DISPID_ACC_HITTEST ( -5017 )
#define DISPID_ACC_DODEFAULTACTION ( -5018 )
typedef /* [unique] */ IAccessible *LPACCESSIBLE;
#define NAVDIR_MIN ( 0 )
#define NAVDIR_UP ( 0x1 )
#define NAVDIR_DOWN ( 0x2 )
#define NAVDIR_LEFT ( 0x3 )
#define NAVDIR_RIGHT ( 0x4 )
#define NAVDIR_NEXT ( 0x5 )
#define NAVDIR_PREVIOUS ( 0x6 )
#define NAVDIR_FIRSTCHILD ( 0x7 )
#define NAVDIR_LASTCHILD ( 0x8 )
#define NAVDIR_MAX ( 0x9 )
#define SELFLAG_NONE ( 0 )
#define SELFLAG_TAKEFOCUS ( 0x1 )
#define SELFLAG_TAKESELECTION ( 0x2 )
#define SELFLAG_EXTENDSELECTION ( 0x4 )
#define SELFLAG_ADDSELECTION ( 0x8 )
#define SELFLAG_REMOVESELECTION ( 0x10 )
#define SELFLAG_VALID ( 0x1f )
#ifndef STATE_SYSTEM_UNAVAILABLE
#define STATE_SYSTEM_NORMAL ( 0 )
#define STATE_SYSTEM_UNAVAILABLE ( 0x1 )
#define STATE_SYSTEM_SELECTED ( 0x2 )
#define STATE_SYSTEM_FOCUSED ( 0x4 )
#define STATE_SYSTEM_PRESSED ( 0x8 )
#define STATE_SYSTEM_CHECKED ( 0x10 )
#define STATE_SYSTEM_MIXED ( 0x20 )
#define STATE_SYSTEM_INDETERMINATE ( STATE_SYSTEM_MIXED )
#define STATE_SYSTEM_READONLY ( 0x40 )
#define STATE_SYSTEM_HOTTRACKED ( 0x80 )
#define STATE_SYSTEM_DEFAULT ( 0x100 )
#define STATE_SYSTEM_EXPANDED ( 0x200 )
#define STATE_SYSTEM_COLLAPSED ( 0x400 )
#define STATE_SYSTEM_BUSY ( 0x800 )
#define STATE_SYSTEM_FLOATING ( 0x1000 )
#define STATE_SYSTEM_MARQUEED ( 0x2000 )
#define STATE_SYSTEM_ANIMATED ( 0x4000 )
#define STATE_SYSTEM_INVISIBLE ( 0x8000 )
#define STATE_SYSTEM_OFFSCREEN ( 0x10000 )
#define STATE_SYSTEM_SIZEABLE ( 0x20000 )
#define STATE_SYSTEM_MOVEABLE ( 0x40000 )
#define STATE_SYSTEM_SELFVOICING ( 0x80000 )
#define STATE_SYSTEM_FOCUSABLE ( 0x100000 )
#define STATE_SYSTEM_SELECTABLE ( 0x200000 )
#define STATE_SYSTEM_LINKED ( 0x400000 )
#define STATE_SYSTEM_TRAVERSED ( 0x800000 )
#define STATE_SYSTEM_MULTISELECTABLE ( 0x1000000 )
#define STATE_SYSTEM_EXTSELECTABLE ( 0x2000000 )
#define STATE_SYSTEM_ALERT_LOW ( 0x4000000 )
#define STATE_SYSTEM_ALERT_MEDIUM ( 0x8000000 )
#define STATE_SYSTEM_ALERT_HIGH ( 0x10000000 )
#define STATE_SYSTEM_PROTECTED ( 0x20000000 )
#define STATE_SYSTEM_VALID ( 0x7fffffff )
#endif //STATE_SYSTEM_UNAVAILABLE
#ifndef STATE_SYSTEM_HASPOPUP
#define STATE_SYSTEM_HASPOPUP ( 0x40000000 )
#endif //STATE_SYSTEM_HASPOPUP
#define ROLE_SYSTEM_TITLEBAR ( 0x1 )
#define ROLE_SYSTEM_MENUBAR ( 0x2 )
#define ROLE_SYSTEM_SCROLLBAR ( 0x3 )
#define ROLE_SYSTEM_GRIP ( 0x4 )
#define ROLE_SYSTEM_SOUND ( 0x5 )
#define ROLE_SYSTEM_CURSOR ( 0x6 )
#define ROLE_SYSTEM_CARET ( 0x7 )
#define ROLE_SYSTEM_ALERT ( 0x8 )
#define ROLE_SYSTEM_WINDOW ( 0x9 )
#define ROLE_SYSTEM_CLIENT ( 0xa )
#define ROLE_SYSTEM_MENUPOPUP ( 0xb )
#define ROLE_SYSTEM_MENUITEM ( 0xc )
#define ROLE_SYSTEM_TOOLTIP ( 0xd )
#define ROLE_SYSTEM_APPLICATION ( 0xe )
#define ROLE_SYSTEM_DOCUMENT ( 0xf )
#define ROLE_SYSTEM_PANE ( 0x10 )
#define ROLE_SYSTEM_CHART ( 0x11 )
#define ROLE_SYSTEM_DIALOG ( 0x12 )
#define ROLE_SYSTEM_BORDER ( 0x13 )
#define ROLE_SYSTEM_GROUPING ( 0x14 )
#define ROLE_SYSTEM_SEPARATOR ( 0x15 )
#define ROLE_SYSTEM_TOOLBAR ( 0x16 )
#define ROLE_SYSTEM_STATUSBAR ( 0x17 )
#define ROLE_SYSTEM_TABLE ( 0x18 )
#define ROLE_SYSTEM_COLUMNHEADER ( 0x19 )
#define ROLE_SYSTEM_ROWHEADER ( 0x1a )
#define ROLE_SYSTEM_COLUMN ( 0x1b )
#define ROLE_SYSTEM_ROW ( 0x1c )
#define ROLE_SYSTEM_CELL ( 0x1d )
#define ROLE_SYSTEM_LINK ( 0x1e )
#define ROLE_SYSTEM_HELPBALLOON ( 0x1f )
#define ROLE_SYSTEM_CHARACTER ( 0x20 )
#define ROLE_SYSTEM_LIST ( 0x21 )
#define ROLE_SYSTEM_LISTITEM ( 0x22 )
#define ROLE_SYSTEM_OUTLINE ( 0x23 )
#define ROLE_SYSTEM_OUTLINEITEM ( 0x24 )
#define ROLE_SYSTEM_PAGETAB ( 0x25 )
#define ROLE_SYSTEM_PROPERTYPAGE ( 0x26 )
#define ROLE_SYSTEM_INDICATOR ( 0x27 )
#define ROLE_SYSTEM_GRAPHIC ( 0x28 )
#define ROLE_SYSTEM_STATICTEXT ( 0x29 )
#define ROLE_SYSTEM_TEXT ( 0x2a )
#define ROLE_SYSTEM_PUSHBUTTON ( 0x2b )
#define ROLE_SYSTEM_CHECKBUTTON ( 0x2c )
#define ROLE_SYSTEM_RADIOBUTTON ( 0x2d )
#define ROLE_SYSTEM_COMBOBOX ( 0x2e )
#define ROLE_SYSTEM_DROPLIST ( 0x2f )
#define ROLE_SYSTEM_PROGRESSBAR ( 0x30 )
#define ROLE_SYSTEM_DIAL ( 0x31 )
#define ROLE_SYSTEM_HOTKEYFIELD ( 0x32 )
#define ROLE_SYSTEM_SLIDER ( 0x33 )
#define ROLE_SYSTEM_SPINBUTTON ( 0x34 )
#define ROLE_SYSTEM_DIAGRAM ( 0x35 )
#define ROLE_SYSTEM_ANIMATION ( 0x36 )
#define ROLE_SYSTEM_EQUATION ( 0x37 )
#define ROLE_SYSTEM_BUTTONDROPDOWN ( 0x38 )
#define ROLE_SYSTEM_BUTTONMENU ( 0x39 )
#define ROLE_SYSTEM_BUTTONDROPDOWNGRID ( 0x3a )
#define ROLE_SYSTEM_WHITESPACE ( 0x3b )
#define ROLE_SYSTEM_PAGETABLIST ( 0x3c )
#define ROLE_SYSTEM_CLOCK ( 0x3d )
#define ROLE_SYSTEM_SPLITBUTTON ( 0x3e )
#define ROLE_SYSTEM_IPADDRESS ( 0x3f )
#define ROLE_SYSTEM_OUTLINEBUTTON ( 0x40 )
EXTERN_C const IID IID_IAccessible;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("618736e0-3c3d-11cf-810c-00aa00389b71")
IAccessible : public IDispatch
{
public:
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accParent(
/* [retval][out] */ IDispatch **ppdispParent) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accChildCount(
/* [retval][out] */ long *pcountChildren) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accChild(
/* [in] */ VARIANT varChild,
/* [retval][out] */ IDispatch **ppdispChild) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accName(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszName) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accValue(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszValue) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accDescription(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszDescription) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accRole(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ VARIANT *pvarRole) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accState(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ VARIANT *pvarState) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accHelp(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszHelp) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accHelpTopic(
/* [out] */ BSTR *pszHelpFile,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ long *pidTopic) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accKeyboardShortcut(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszKeyboardShortcut) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accFocus(
/* [retval][out] */ VARIANT *pvarChild) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accSelection(
/* [retval][out] */ VARIANT *pvarChildren) = 0;
virtual /* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE get_accDefaultAction(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszDefaultAction) = 0;
virtual /* [id][hidden] */ HRESULT STDMETHODCALLTYPE accSelect(
/* [in] */ long flagsSelect,
/* [optional][in] */ VARIANT varChild) = 0;
virtual /* [id][hidden] */ HRESULT STDMETHODCALLTYPE accLocation(
/* [out] */ long *pxLeft,
/* [out] */ long *pyTop,
/* [out] */ long *pcxWidth,
/* [out] */ long *pcyHeight,
/* [optional][in] */ VARIANT varChild) = 0;
virtual /* [id][hidden] */ HRESULT STDMETHODCALLTYPE accNavigate(
/* [in] */ long navDir,
/* [optional][in] */ VARIANT varStart,
/* [retval][out] */ VARIANT *pvarEndUpAt) = 0;
virtual /* [id][hidden] */ HRESULT STDMETHODCALLTYPE accHitTest(
/* [in] */ long xLeft,
/* [in] */ long yTop,
/* [retval][out] */ VARIANT *pvarChild) = 0;
virtual /* [id][hidden] */ HRESULT STDMETHODCALLTYPE accDoDefaultAction(
/* [optional][in] */ VARIANT varChild) = 0;
virtual /* [id][propput][hidden] */ HRESULT STDMETHODCALLTYPE put_accName(
/* [optional][in] */ VARIANT varChild,
/* [in] */ BSTR szName) = 0;
virtual /* [id][propput][hidden] */ HRESULT STDMETHODCALLTYPE put_accValue(
/* [optional][in] */ VARIANT varChild,
/* [in] */ BSTR szValue) = 0;
};
#else /* C style interface */
typedef struct IAccessibleVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IAccessible * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IAccessible * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IAccessible * This);
HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
IAccessible * This,
/* [out] */ UINT *pctinfo);
HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
IAccessible * This,
/* [in] */ UINT iTInfo,
/* [in] */ LCID lcid,
/* [out] */ ITypeInfo **ppTInfo);
HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
IAccessible * This,
/* [in] */ REFIID riid,
/* [size_is][in] */ LPOLESTR *rgszNames,
/* [in] */ UINT cNames,
/* [in] */ LCID lcid,
/* [size_is][out] */ DISPID *rgDispId);
/* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
IAccessible * This,
/* [in] */ DISPID dispIdMember,
/* [in] */ REFIID riid,
/* [in] */ LCID lcid,
/* [in] */ WORD wFlags,
/* [out][in] */ DISPPARAMS *pDispParams,
/* [out] */ VARIANT *pVarResult,
/* [out] */ EXCEPINFO *pExcepInfo,
/* [out] */ UINT *puArgErr);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accParent )(
IAccessible * This,
/* [retval][out] */ IDispatch **ppdispParent);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accChildCount )(
IAccessible * This,
/* [retval][out] */ long *pcountChildren);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accChild )(
IAccessible * This,
/* [in] */ VARIANT varChild,
/* [retval][out] */ IDispatch **ppdispChild);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accName )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszName);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accValue )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszValue);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accDescription )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszDescription);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accRole )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ VARIANT *pvarRole);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accState )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ VARIANT *pvarState);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accHelp )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszHelp);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accHelpTopic )(
IAccessible * This,
/* [out] */ BSTR *pszHelpFile,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ long *pidTopic);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accKeyboardShortcut )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszKeyboardShortcut);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accFocus )(
IAccessible * This,
/* [retval][out] */ VARIANT *pvarChild);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accSelection )(
IAccessible * This,
/* [retval][out] */ VARIANT *pvarChildren);
/* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accDefaultAction )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszDefaultAction);
/* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accSelect )(
IAccessible * This,
/* [in] */ long flagsSelect,
/* [optional][in] */ VARIANT varChild);
/* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accLocation )(
IAccessible * This,
/* [out] */ long *pxLeft,
/* [out] */ long *pyTop,
/* [out] */ long *pcxWidth,
/* [out] */ long *pcyHeight,
/* [optional][in] */ VARIANT varChild);
/* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accNavigate )(
IAccessible * This,
/* [in] */ long navDir,
/* [optional][in] */ VARIANT varStart,
/* [retval][out] */ VARIANT *pvarEndUpAt);
/* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accHitTest )(
IAccessible * This,
/* [in] */ long xLeft,
/* [in] */ long yTop,
/* [retval][out] */ VARIANT *pvarChild);
/* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accDoDefaultAction )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild);
/* [id][propput][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_accName )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [in] */ BSTR szName);
/* [id][propput][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_accValue )(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [in] */ BSTR szValue);
END_INTERFACE
} IAccessibleVtbl;
interface IAccessible
{
CONST_VTBL struct IAccessibleVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IAccessible_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IAccessible_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IAccessible_Release(This) \
(This)->lpVtbl -> Release(This)
#define IAccessible_GetTypeInfoCount(This,pctinfo) \
(This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
#define IAccessible_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
(This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define IAccessible_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
(This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define IAccessible_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
(This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
#define IAccessible_get_accParent(This,ppdispParent) \
(This)->lpVtbl -> get_accParent(This,ppdispParent)
#define IAccessible_get_accChildCount(This,pcountChildren) \
(This)->lpVtbl -> get_accChildCount(This,pcountChildren)
#define IAccessible_get_accChild(This,varChild,ppdispChild) \
(This)->lpVtbl -> get_accChild(This,varChild,ppdispChild)
#define IAccessible_get_accName(This,varChild,pszName) \
(This)->lpVtbl -> get_accName(This,varChild,pszName)
#define IAccessible_get_accValue(This,varChild,pszValue) \
(This)->lpVtbl -> get_accValue(This,varChild,pszValue)
#define IAccessible_get_accDescription(This,varChild,pszDescription) \
(This)->lpVtbl -> get_accDescription(This,varChild,pszDescription)
#define IAccessible_get_accRole(This,varChild,pvarRole) \
(This)->lpVtbl -> get_accRole(This,varChild,pvarRole)
#define IAccessible_get_accState(This,varChild,pvarState) \
(This)->lpVtbl -> get_accState(This,varChild,pvarState)
#define IAccessible_get_accHelp(This,varChild,pszHelp) \
(This)->lpVtbl -> get_accHelp(This,varChild,pszHelp)
#define IAccessible_get_accHelpTopic(This,pszHelpFile,varChild,pidTopic) \
(This)->lpVtbl -> get_accHelpTopic(This,pszHelpFile,varChild,pidTopic)
#define IAccessible_get_accKeyboardShortcut(This,varChild,pszKeyboardShortcut) \
(This)->lpVtbl -> get_accKeyboardShortcut(This,varChild,pszKeyboardShortcut)
#define IAccessible_get_accFocus(This,pvarChild) \
(This)->lpVtbl -> get_accFocus(This,pvarChild)
#define IAccessible_get_accSelection(This,pvarChildren) \
(This)->lpVtbl -> get_accSelection(This,pvarChildren)
#define IAccessible_get_accDefaultAction(This,varChild,pszDefaultAction) \
(This)->lpVtbl -> get_accDefaultAction(This,varChild,pszDefaultAction)
#define IAccessible_accSelect(This,flagsSelect,varChild) \
(This)->lpVtbl -> accSelect(This,flagsSelect,varChild)
#define IAccessible_accLocation(This,pxLeft,pyTop,pcxWidth,pcyHeight,varChild) \
(This)->lpVtbl -> accLocation(This,pxLeft,pyTop,pcxWidth,pcyHeight,varChild)
#define IAccessible_accNavigate(This,navDir,varStart,pvarEndUpAt) \
(This)->lpVtbl -> accNavigate(This,navDir,varStart,pvarEndUpAt)
#define IAccessible_accHitTest(This,xLeft,yTop,pvarChild) \
(This)->lpVtbl -> accHitTest(This,xLeft,yTop,pvarChild)
#define IAccessible_accDoDefaultAction(This,varChild) \
(This)->lpVtbl -> accDoDefaultAction(This,varChild)
#define IAccessible_put_accName(This,varChild,szName) \
(This)->lpVtbl -> put_accName(This,varChild,szName)
#define IAccessible_put_accValue(This,varChild,szValue) \
(This)->lpVtbl -> put_accValue(This,varChild,szValue)
#endif /* COBJMACROS */
#endif /* C style interface */
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accParent_Proxy(
IAccessible * This,
/* [retval][out] */ IDispatch **ppdispParent);
void __RPC_STUB IAccessible_get_accParent_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accChildCount_Proxy(
IAccessible * This,
/* [retval][out] */ long *pcountChildren);
void __RPC_STUB IAccessible_get_accChildCount_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accChild_Proxy(
IAccessible * This,
/* [in] */ VARIANT varChild,
/* [retval][out] */ IDispatch **ppdispChild);
void __RPC_STUB IAccessible_get_accChild_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accName_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszName);
void __RPC_STUB IAccessible_get_accName_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accValue_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszValue);
void __RPC_STUB IAccessible_get_accValue_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accDescription_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszDescription);
void __RPC_STUB IAccessible_get_accDescription_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accRole_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ VARIANT *pvarRole);
void __RPC_STUB IAccessible_get_accRole_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accState_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ VARIANT *pvarState);
void __RPC_STUB IAccessible_get_accState_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accHelp_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszHelp);
void __RPC_STUB IAccessible_get_accHelp_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accHelpTopic_Proxy(
IAccessible * This,
/* [out] */ BSTR *pszHelpFile,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ long *pidTopic);
void __RPC_STUB IAccessible_get_accHelpTopic_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accKeyboardShortcut_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszKeyboardShortcut);
void __RPC_STUB IAccessible_get_accKeyboardShortcut_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accFocus_Proxy(
IAccessible * This,
/* [retval][out] */ VARIANT *pvarChild);
void __RPC_STUB IAccessible_get_accFocus_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accSelection_Proxy(
IAccessible * This,
/* [retval][out] */ VARIANT *pvarChildren);
void __RPC_STUB IAccessible_get_accSelection_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propget][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_get_accDefaultAction_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR *pszDefaultAction);
void __RPC_STUB IAccessible_get_accDefaultAction_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_accSelect_Proxy(
IAccessible * This,
/* [in] */ long flagsSelect,
/* [optional][in] */ VARIANT varChild);
void __RPC_STUB IAccessible_accSelect_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_accLocation_Proxy(
IAccessible * This,
/* [out] */ long *pxLeft,
/* [out] */ long *pyTop,
/* [out] */ long *pcxWidth,
/* [out] */ long *pcyHeight,
/* [optional][in] */ VARIANT varChild);
void __RPC_STUB IAccessible_accLocation_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_accNavigate_Proxy(
IAccessible * This,
/* [in] */ long navDir,
/* [optional][in] */ VARIANT varStart,
/* [retval][out] */ VARIANT *pvarEndUpAt);
void __RPC_STUB IAccessible_accNavigate_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_accHitTest_Proxy(
IAccessible * This,
/* [in] */ long xLeft,
/* [in] */ long yTop,
/* [retval][out] */ VARIANT *pvarChild);
void __RPC_STUB IAccessible_accHitTest_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_accDoDefaultAction_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild);
void __RPC_STUB IAccessible_accDoDefaultAction_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propput][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_put_accName_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [in] */ BSTR szName);
void __RPC_STUB IAccessible_put_accName_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [id][propput][hidden] */ HRESULT STDMETHODCALLTYPE IAccessible_put_accValue_Proxy(
IAccessible * This,
/* [optional][in] */ VARIANT varChild,
/* [in] */ BSTR szValue);
void __RPC_STUB IAccessible_put_accValue_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IAccessible_INTERFACE_DEFINED__ */
#ifndef __IAccessibleHandler_INTERFACE_DEFINED__
#define __IAccessibleHandler_INTERFACE_DEFINED__
/* interface IAccessibleHandler */
/* [unique][oleautomation][hidden][uuid][object] */
typedef /* [unique] */ IAccessibleHandler *LPACCESSIBLEHANDLER;
EXTERN_C const IID IID_IAccessibleHandler;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("03022430-ABC4-11d0-BDE2-00AA001A1953")
IAccessibleHandler : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE AccessibleObjectFromID(
/* [in] */ long hwnd,
/* [in] */ long lObjectID,
/* [out] */ LPACCESSIBLE *pIAccessible) = 0;
};
#else /* C style interface */
typedef struct IAccessibleHandlerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IAccessibleHandler * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IAccessibleHandler * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IAccessibleHandler * This);
HRESULT ( STDMETHODCALLTYPE *AccessibleObjectFromID )(
IAccessibleHandler * This,
/* [in] */ long hwnd,
/* [in] */ long lObjectID,
/* [out] */ LPACCESSIBLE *pIAccessible);
END_INTERFACE
} IAccessibleHandlerVtbl;
interface IAccessibleHandler
{
CONST_VTBL struct IAccessibleHandlerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IAccessibleHandler_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IAccessibleHandler_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IAccessibleHandler_Release(This) \
(This)->lpVtbl -> Release(This)
#define IAccessibleHandler_AccessibleObjectFromID(This,hwnd,lObjectID,pIAccessible) \
(This)->lpVtbl -> AccessibleObjectFromID(This,hwnd,lObjectID,pIAccessible)
#endif /* COBJMACROS */
#endif /* C style interface */
HRESULT STDMETHODCALLTYPE IAccessibleHandler_AccessibleObjectFromID_Proxy(
IAccessibleHandler * This,
/* [in] */ long hwnd,
/* [in] */ long lObjectID,
/* [out] */ LPACCESSIBLE *pIAccessible);
void __RPC_STUB IAccessibleHandler_AccessibleObjectFromID_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IAccessibleHandler_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_oleacc_0112 */
/* [local] */
typedef
enum AnnoScope
{ ANNO_THIS = 0,
ANNO_CONTAINER = 1
} AnnoScope;
typedef GUID MSAAPROPID;
extern RPC_IF_HANDLE __MIDL_itf_oleacc_0112_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_oleacc_0112_v0_0_s_ifspec;
#ifndef __IAccIdentity_INTERFACE_DEFINED__
#define __IAccIdentity_INTERFACE_DEFINED__
/* interface IAccIdentity */
/* [unique][uuid][object] */
EXTERN_C const IID IID_IAccIdentity;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("7852b78d-1cfd-41c1-a615-9c0c85960b5f")
IAccIdentity : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetIdentityString(
/* [in] */ DWORD dwIDChild,
/* [size_is][size_is][out] */ BYTE **ppIDString,
/* [out] */ DWORD *pdwIDStringLen) = 0;
};
#else /* C style interface */
typedef struct IAccIdentityVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IAccIdentity * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IAccIdentity * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IAccIdentity * This);
HRESULT ( STDMETHODCALLTYPE *GetIdentityString )(
IAccIdentity * This,
/* [in] */ DWORD dwIDChild,
/* [size_is][size_is][out] */ BYTE **ppIDString,
/* [out] */ DWORD *pdwIDStringLen);
END_INTERFACE
} IAccIdentityVtbl;
interface IAccIdentity
{
CONST_VTBL struct IAccIdentityVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IAccIdentity_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IAccIdentity_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IAccIdentity_Release(This) \
(This)->lpVtbl -> Release(This)
#define IAccIdentity_GetIdentityString(This,dwIDChild,ppIDString,pdwIDStringLen) \
(This)->lpVtbl -> GetIdentityString(This,dwIDChild,ppIDString,pdwIDStringLen)
#endif /* COBJMACROS */
#endif /* C style interface */
HRESULT STDMETHODCALLTYPE IAccIdentity_GetIdentityString_Proxy(
IAccIdentity * This,
/* [in] */ DWORD dwIDChild,
/* [size_is][size_is][out] */ BYTE **ppIDString,
/* [out] */ DWORD *pdwIDStringLen);
void __RPC_STUB IAccIdentity_GetIdentityString_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IAccIdentity_INTERFACE_DEFINED__ */
#ifndef __IAccPropServer_INTERFACE_DEFINED__
#define __IAccPropServer_INTERFACE_DEFINED__
/* interface IAccPropServer */
/* [unique][uuid][object] */
EXTERN_C const IID IID_IAccPropServer;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("76c0dbbb-15e0-4e7b-b61b-20eeea2001e0")
IAccPropServer : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetPropValue(
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [in] */ MSAAPROPID idProp,
/* [out] */ VARIANT *pvarValue,
/* [out] */ BOOL *pfHasProp) = 0;
};
#else /* C style interface */
typedef struct IAccPropServerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IAccPropServer * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IAccPropServer * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IAccPropServer * This);
HRESULT ( STDMETHODCALLTYPE *GetPropValue )(
IAccPropServer * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [in] */ MSAAPROPID idProp,
/* [out] */ VARIANT *pvarValue,
/* [out] */ BOOL *pfHasProp);
END_INTERFACE
} IAccPropServerVtbl;
interface IAccPropServer
{
CONST_VTBL struct IAccPropServerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IAccPropServer_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IAccPropServer_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IAccPropServer_Release(This) \
(This)->lpVtbl -> Release(This)
#define IAccPropServer_GetPropValue(This,pIDString,dwIDStringLen,idProp,pvarValue,pfHasProp) \
(This)->lpVtbl -> GetPropValue(This,pIDString,dwIDStringLen,idProp,pvarValue,pfHasProp)
#endif /* COBJMACROS */
#endif /* C style interface */
HRESULT STDMETHODCALLTYPE IAccPropServer_GetPropValue_Proxy(
IAccPropServer * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [in] */ MSAAPROPID idProp,
/* [out] */ VARIANT *pvarValue,
/* [out] */ BOOL *pfHasProp);
void __RPC_STUB IAccPropServer_GetPropValue_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IAccPropServer_INTERFACE_DEFINED__ */
#ifndef __IAccPropServices_INTERFACE_DEFINED__
#define __IAccPropServices_INTERFACE_DEFINED__
/* interface IAccPropServices */
/* [unique][uuid][object] */
EXTERN_C const IID IID_IAccPropServices;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("6e26e776-04f0-495d-80e4-3330352e3169")
IAccPropServices : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetPropValue(
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [in] */ MSAAPROPID idProp,
/* [in] */ VARIANT var) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPropServer(
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps,
/* [in] */ IAccPropServer *pServer,
/* [in] */ AnnoScope annoScope) = 0;
virtual HRESULT STDMETHODCALLTYPE ClearProps(
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps) = 0;
virtual HRESULT STDMETHODCALLTYPE SetHwndProp(
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [in] */ VARIANT var) = 0;
virtual HRESULT STDMETHODCALLTYPE SetHwndPropStr(
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [string][in] */ LPCWSTR str) = 0;
virtual HRESULT STDMETHODCALLTYPE SetHwndPropServer(
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps,
/* [in] */ IAccPropServer *pServer,
/* [in] */ AnnoScope annoScope) = 0;
virtual HRESULT STDMETHODCALLTYPE ClearHwndProps(
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps) = 0;
virtual HRESULT STDMETHODCALLTYPE ComposeHwndIdentityString(
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [size_is][size_is][out] */ BYTE **ppIDString,
/* [out] */ DWORD *pdwIDStringLen) = 0;
virtual HRESULT STDMETHODCALLTYPE DecomposeHwndIdentityString(
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [out] */ HWND *phwnd,
/* [out] */ DWORD *pidObject,
/* [out] */ DWORD *pidChild) = 0;
virtual HRESULT STDMETHODCALLTYPE SetHmenuProp(
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [in] */ VARIANT var) = 0;
virtual HRESULT STDMETHODCALLTYPE SetHmenuPropStr(
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [string][in] */ LPCWSTR str) = 0;
virtual HRESULT STDMETHODCALLTYPE SetHmenuPropServer(
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps,
/* [in] */ IAccPropServer *pServer,
/* [in] */ AnnoScope annoScope) = 0;
virtual HRESULT STDMETHODCALLTYPE ClearHmenuProps(
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps) = 0;
virtual HRESULT STDMETHODCALLTYPE ComposeHmenuIdentityString(
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [size_is][size_is][out] */ BYTE **ppIDString,
/* [out] */ DWORD *pdwIDStringLen) = 0;
virtual HRESULT STDMETHODCALLTYPE DecomposeHmenuIdentityString(
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [out] */ HMENU *phmenu,
/* [out] */ DWORD *pidChild) = 0;
};
#else /* C style interface */
typedef struct IAccPropServicesVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IAccPropServices * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IAccPropServices * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IAccPropServices * This);
HRESULT ( STDMETHODCALLTYPE *SetPropValue )(
IAccPropServices * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [in] */ MSAAPROPID idProp,
/* [in] */ VARIANT var);
HRESULT ( STDMETHODCALLTYPE *SetPropServer )(
IAccPropServices * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps,
/* [in] */ IAccPropServer *pServer,
/* [in] */ AnnoScope annoScope);
HRESULT ( STDMETHODCALLTYPE *ClearProps )(
IAccPropServices * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps);
HRESULT ( STDMETHODCALLTYPE *SetHwndProp )(
IAccPropServices * This,
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [in] */ VARIANT var);
HRESULT ( STDMETHODCALLTYPE *SetHwndPropStr )(
IAccPropServices * This,
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [string][in] */ LPCWSTR str);
HRESULT ( STDMETHODCALLTYPE *SetHwndPropServer )(
IAccPropServices * This,
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps,
/* [in] */ IAccPropServer *pServer,
/* [in] */ AnnoScope annoScope);
HRESULT ( STDMETHODCALLTYPE *ClearHwndProps )(
IAccPropServices * This,
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps);
HRESULT ( STDMETHODCALLTYPE *ComposeHwndIdentityString )(
IAccPropServices * This,
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [size_is][size_is][out] */ BYTE **ppIDString,
/* [out] */ DWORD *pdwIDStringLen);
HRESULT ( STDMETHODCALLTYPE *DecomposeHwndIdentityString )(
IAccPropServices * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [out] */ HWND *phwnd,
/* [out] */ DWORD *pidObject,
/* [out] */ DWORD *pidChild);
HRESULT ( STDMETHODCALLTYPE *SetHmenuProp )(
IAccPropServices * This,
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [in] */ VARIANT var);
HRESULT ( STDMETHODCALLTYPE *SetHmenuPropStr )(
IAccPropServices * This,
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [string][in] */ LPCWSTR str);
HRESULT ( STDMETHODCALLTYPE *SetHmenuPropServer )(
IAccPropServices * This,
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps,
/* [in] */ IAccPropServer *pServer,
/* [in] */ AnnoScope annoScope);
HRESULT ( STDMETHODCALLTYPE *ClearHmenuProps )(
IAccPropServices * This,
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps);
HRESULT ( STDMETHODCALLTYPE *ComposeHmenuIdentityString )(
IAccPropServices * This,
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [size_is][size_is][out] */ BYTE **ppIDString,
/* [out] */ DWORD *pdwIDStringLen);
HRESULT ( STDMETHODCALLTYPE *DecomposeHmenuIdentityString )(
IAccPropServices * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [out] */ HMENU *phmenu,
/* [out] */ DWORD *pidChild);
END_INTERFACE
} IAccPropServicesVtbl;
interface IAccPropServices
{
CONST_VTBL struct IAccPropServicesVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IAccPropServices_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IAccPropServices_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IAccPropServices_Release(This) \
(This)->lpVtbl -> Release(This)
#define IAccPropServices_SetPropValue(This,pIDString,dwIDStringLen,idProp,var) \
(This)->lpVtbl -> SetPropValue(This,pIDString,dwIDStringLen,idProp,var)
#define IAccPropServices_SetPropServer(This,pIDString,dwIDStringLen,paProps,cProps,pServer,annoScope) \
(This)->lpVtbl -> SetPropServer(This,pIDString,dwIDStringLen,paProps,cProps,pServer,annoScope)
#define IAccPropServices_ClearProps(This,pIDString,dwIDStringLen,paProps,cProps) \
(This)->lpVtbl -> ClearProps(This,pIDString,dwIDStringLen,paProps,cProps)
#define IAccPropServices_SetHwndProp(This,hwnd,idObject,idChild,idProp,var) \
(This)->lpVtbl -> SetHwndProp(This,hwnd,idObject,idChild,idProp,var)
#define IAccPropServices_SetHwndPropStr(This,hwnd,idObject,idChild,idProp,str) \
(This)->lpVtbl -> SetHwndPropStr(This,hwnd,idObject,idChild,idProp,str)
#define IAccPropServices_SetHwndPropServer(This,hwnd,idObject,idChild,paProps,cProps,pServer,annoScope) \
(This)->lpVtbl -> SetHwndPropServer(This,hwnd,idObject,idChild,paProps,cProps,pServer,annoScope)
#define IAccPropServices_ClearHwndProps(This,hwnd,idObject,idChild,paProps,cProps) \
(This)->lpVtbl -> ClearHwndProps(This,hwnd,idObject,idChild,paProps,cProps)
#define IAccPropServices_ComposeHwndIdentityString(This,hwnd,idObject,idChild,ppIDString,pdwIDStringLen) \
(This)->lpVtbl -> ComposeHwndIdentityString(This,hwnd,idObject,idChild,ppIDString,pdwIDStringLen)
#define IAccPropServices_DecomposeHwndIdentityString(This,pIDString,dwIDStringLen,phwnd,pidObject,pidChild) \
(This)->lpVtbl -> DecomposeHwndIdentityString(This,pIDString,dwIDStringLen,phwnd,pidObject,pidChild)
#define IAccPropServices_SetHmenuProp(This,hmenu,idChild,idProp,var) \
(This)->lpVtbl -> SetHmenuProp(This,hmenu,idChild,idProp,var)
#define IAccPropServices_SetHmenuPropStr(This,hmenu,idChild,idProp,str) \
(This)->lpVtbl -> SetHmenuPropStr(This,hmenu,idChild,idProp,str)
#define IAccPropServices_SetHmenuPropServer(This,hmenu,idChild,paProps,cProps,pServer,annoScope) \
(This)->lpVtbl -> SetHmenuPropServer(This,hmenu,idChild,paProps,cProps,pServer,annoScope)
#define IAccPropServices_ClearHmenuProps(This,hmenu,idChild,paProps,cProps) \
(This)->lpVtbl -> ClearHmenuProps(This,hmenu,idChild,paProps,cProps)
#define IAccPropServices_ComposeHmenuIdentityString(This,hmenu,idChild,ppIDString,pdwIDStringLen) \
(This)->lpVtbl -> ComposeHmenuIdentityString(This,hmenu,idChild,ppIDString,pdwIDStringLen)
#define IAccPropServices_DecomposeHmenuIdentityString(This,pIDString,dwIDStringLen,phmenu,pidChild) \
(This)->lpVtbl -> DecomposeHmenuIdentityString(This,pIDString,dwIDStringLen,phmenu,pidChild)
#endif /* COBJMACROS */
#endif /* C style interface */
HRESULT STDMETHODCALLTYPE IAccPropServices_SetPropValue_Proxy(
IAccPropServices * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [in] */ MSAAPROPID idProp,
/* [in] */ VARIANT var);
void __RPC_STUB IAccPropServices_SetPropValue_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_SetPropServer_Proxy(
IAccPropServices * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps,
/* [in] */ IAccPropServer *pServer,
/* [in] */ AnnoScope annoScope);
void __RPC_STUB IAccPropServices_SetPropServer_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_ClearProps_Proxy(
IAccPropServices * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps);
void __RPC_STUB IAccPropServices_ClearProps_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_SetHwndProp_Proxy(
IAccPropServices * This,
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [in] */ VARIANT var);
void __RPC_STUB IAccPropServices_SetHwndProp_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_SetHwndPropStr_Proxy(
IAccPropServices * This,
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [string][in] */ LPCWSTR str);
void __RPC_STUB IAccPropServices_SetHwndPropStr_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_SetHwndPropServer_Proxy(
IAccPropServices * This,
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps,
/* [in] */ IAccPropServer *pServer,
/* [in] */ AnnoScope annoScope);
void __RPC_STUB IAccPropServices_SetHwndPropServer_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_ClearHwndProps_Proxy(
IAccPropServices * This,
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps);
void __RPC_STUB IAccPropServices_ClearHwndProps_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_ComposeHwndIdentityString_Proxy(
IAccPropServices * This,
/* [in] */ HWND hwnd,
/* [in] */ DWORD idObject,
/* [in] */ DWORD idChild,
/* [size_is][size_is][out] */ BYTE **ppIDString,
/* [out] */ DWORD *pdwIDStringLen);
void __RPC_STUB IAccPropServices_ComposeHwndIdentityString_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_DecomposeHwndIdentityString_Proxy(
IAccPropServices * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [out] */ HWND *phwnd,
/* [out] */ DWORD *pidObject,
/* [out] */ DWORD *pidChild);
void __RPC_STUB IAccPropServices_DecomposeHwndIdentityString_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_SetHmenuProp_Proxy(
IAccPropServices * This,
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [in] */ VARIANT var);
void __RPC_STUB IAccPropServices_SetHmenuProp_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_SetHmenuPropStr_Proxy(
IAccPropServices * This,
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [in] */ MSAAPROPID idProp,
/* [string][in] */ LPCWSTR str);
void __RPC_STUB IAccPropServices_SetHmenuPropStr_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_SetHmenuPropServer_Proxy(
IAccPropServices * This,
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps,
/* [in] */ IAccPropServer *pServer,
/* [in] */ AnnoScope annoScope);
void __RPC_STUB IAccPropServices_SetHmenuPropServer_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_ClearHmenuProps_Proxy(
IAccPropServices * This,
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [size_is][in] */ const MSAAPROPID *paProps,
/* [in] */ int cProps);
void __RPC_STUB IAccPropServices_ClearHmenuProps_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_ComposeHmenuIdentityString_Proxy(
IAccPropServices * This,
/* [in] */ HMENU hmenu,
/* [in] */ DWORD idChild,
/* [size_is][size_is][out] */ BYTE **ppIDString,
/* [out] */ DWORD *pdwIDStringLen);
void __RPC_STUB IAccPropServices_ComposeHmenuIdentityString_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IAccPropServices_DecomposeHmenuIdentityString_Proxy(
IAccPropServices * This,
/* [size_is][in] */ const BYTE *pIDString,
/* [in] */ DWORD dwIDStringLen,
/* [out] */ HMENU *phmenu,
/* [out] */ DWORD *pidChild);
void __RPC_STUB IAccPropServices_DecomposeHmenuIdentityString_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IAccPropServices_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_oleacc_0115 */
/* [local] */
//=--------------------------------------------------------------------------=
// Type Library Definitions
//=--------------------------------------------------------------------------=
extern RPC_IF_HANDLE __MIDL_itf_oleacc_0115_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_oleacc_0115_v0_0_s_ifspec;
#ifndef __Accessibility_LIBRARY_DEFINED__
#define __Accessibility_LIBRARY_DEFINED__
/* library Accessibility */
/* [hidden][version][lcid][uuid] */
EXTERN_C const IID LIBID_Accessibility;
EXTERN_C const CLSID CLSID_CAccPropServices;
#ifdef __cplusplus
class DECLSPEC_UUID("b5f8350b-0548-48b1-a6ee-88bd00b4a5e7")
CAccPropServices;
#endif
#endif /* __Accessibility_LIBRARY_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
unsigned long __RPC_USER HMENU_UserSize( unsigned long *, unsigned long , HMENU * );
unsigned char * __RPC_USER HMENU_UserMarshal( unsigned long *, unsigned char *, HMENU * );
unsigned char * __RPC_USER HMENU_UserUnmarshal(unsigned long *, unsigned char *, HMENU * );
void __RPC_USER HMENU_UserFree( unsigned long *, HMENU * );
unsigned long __RPC_USER HWND_UserSize( unsigned long *, unsigned long , HWND * );
unsigned char * __RPC_USER HWND_UserMarshal( unsigned long *, unsigned char *, HWND * );
unsigned char * __RPC_USER HWND_UserUnmarshal(unsigned long *, unsigned char *, HWND * );
void __RPC_USER HWND_UserFree( unsigned long *, HWND * );
unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * );
unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * );
unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * );
void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
| [
"blindtiger@foxmail.com"
] | blindtiger@foxmail.com |
3709f057342160e91a39e38162c9b8f1a94a952f | 3e612ab74b1298d668352c9690698e1872b34a81 | /First Missing Positive/Submit.cpp | f4de4ad10be151d930babe7545299c2473111c05 | [] | no_license | lyh-ADT/LeetCodeNote | afda090bcb988e63bcf44440695a55fe7bd6e47b | 1351d520ce842ec85068b41c31eb574bd406c81b | refs/heads/master | 2020-04-08T14:37:33.335757 | 2019-04-29T05:52:44 | 2019-04-29T05:52:44 | 159,444,761 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,088 | cpp | #include <iostream>
#include <vector>
using namespace std;
static const auto disable_sync = []() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
return nullptr;
}();
class Solution {
public:
int firstMissingPositive(vector<int> &nums) {
if (nums.empty()) {
return 1;
}
for (auto i = nums.begin(); i != nums.end();) {
if (*i <= 0) {
i = nums.erase(i);
} else
++i;
}
bool tag = false;
for (int i = 0; i < nums.size(); ++i) {
int t = abs(nums[i]);
if (t - 1 < nums.size() && nums[t - 1] > 0) {
nums[t - 1] = -nums[t - 1];
tag = true;
}
}
if (!tag) {
return 1;
}
for (int i = 0; i < nums.size(); ++i) {
if (nums[i] > 0) {
return i + 1;
}
}
return nums.size() + 1;
}
};
int main() {
Solution s;
vector<int> a = {7};
cout << s.firstMissingPositive(a);
return 0;
} | [
"1043970238@qq.com"
] | 1043970238@qq.com |
822972bfa8d1d27fd28a2f5bcfcc1d93fbf0f3b8 | c5592fd3eb7a4382b1e0da11755eee6796edb725 | /atcoder.jp/abc140/abc140_a/Main.cpp | 4f342e04bea4f47f27866695a607a17640d13d58 | [] | no_license | wdiiahk/procon-archive | 4dbba35977ed85bb1cb1db71722ee643fb8bb747 | 57c3a143f09ff0725ae90de6d9182e770963b31f | refs/heads/main | 2023-03-16T07:32:22.534101 | 2019-06-28T03:27:14 | 2019-06-28T03:27:14 | 345,225,662 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,165 | cpp | //デバッグ用オプション:-fsanitize=undefined,address
//コンパイラ最適化
#pragma GCC optimize("Ofast")
//インクルードなど
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
namespace
{
typedef long long ll;
using vint = vector<int>;
using vll = vector<ll>;
using vbool = vector<bool>;
using vs = vector<string>;
using P = pair<ll, ll>;
using vp = vector<P>;
template <class T>
using arr = vector<vector<T>>;
//マクロ
#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)
#define ALL(x) x.begin(), x.end()
#define SIZE(x) ll(x.size())
#define INF 100000000000000
template <typename T>
bool chmax(T &a, const T &b)
{
if (a < b)
{
a = b; // aをbで更新
return true;
}
return false;
}
template <typename T>
bool chmin(T &a, const T &b)
{
if (a > b)
{
a = b; // aをbで更新
return true;
}
return false;
}
template <class T>
void pl(T x) { cout << x << " "; }
template <class T>
void pr(T x) { cout << x << endl; }
template <class T>
void prvec(const vector<T> &a)
{
REP(i, a.size() - 1)
{
cout << a[i] << " ";
}
pr(a[a.size() - 1]);
}
template <class T>
void prarr(const arr<T> &a)
{
REP(i, a.size())
if (a[i].empty())
pr("");
else
prvec(a[i]);
}
template <typename T1, typename T2>
pair<T1, T2> operator+(const pair<T1, T2> &l, const pair<T1, T2> &r) { return {l.first + r.first, l.second + r.second}; }
template <typename T1, typename T2>
pair<T1, T2> operator-(const pair<T1, T2> &l, const pair<T1, T2> &r) { return {l.first - r.first, l.second - r.second}; }
template <typename T>
pair<T, T> operator*(const pair<T, T> &l, const T &r) { return {l.first * r, l.second * r}; }
template <typename T>
pair<T, T> operator/(const pair<T, T> &l, const T &r) { return {l.first / r, l.second / r}; }
template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
for (auto &v : vec)
is >> v;
return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec)
{
os << "[";
for (auto v : vec)
os << v << ",";
os << "]";
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const deque<T> &vec)
{
os << "deq[";
for (auto v : vec)
os << v << ",";
os << "]";
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &vec)
{
os << "{";
for (auto v : vec)
os << v << ",";
os << "}";
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_set<T> &vec)
{
os << "{";
for (auto v : vec)
os << v << ",";
os << "}";
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &vec)
{
os << "{";
for (auto v : vec)
os << v << ",";
os << "}";
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_multiset<T> &vec)
{
os << "{";
for (auto v : vec)
os << v << ",";
os << "}";
return os;
}
template <typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &pa)
{
is >> pa.first >> pa.second;
return is;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &pa)
{
os << "(" << pa.first << "," << pa.second << ")";
return os;
}
template <typename... Ts>
istream &operator>>(istream &is, tuple<Ts...> &theTuple)
{
apply([&is](Ts &...tupleArgs) { ((is >> tupleArgs), ...); }, theTuple);
return is;
}
template <typename... Ts>
ostream &operator<<(ostream &os, const tuple<Ts...> &theTuple)
{
apply([&os](const Ts &...tupleArgs) {
os << '(';
size_t n(0);
((os << tupleArgs << (++n < sizeof...(Ts) ? "," : "")), ...);
os << ')';
},
theTuple);
return os;
}
template <typename TK, typename TV>
ostream &operator<<(ostream &os, const map<TK, TV> &mp)
{
os << "{";
for (auto v : mp)
os << v.first << "=>" << v.second << ",";
os << "}";
return os;
}
template <typename TK, typename TV>
ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp)
{
os << "{";
for (auto v : mp)
os << v.first << "=>" << v.second << ",";
os << "}";
return os;
}
//
template <typename T>
void for_enum(T &container, std::function<bool(int, typename T::value_type &)> op)
{
int idx = 0;
for (auto &value : container)
{
if (!op(idx++, value))
{
break;
}
}
}
template <typename S, typename T>
map<S, T> group_by(T &container, std::function<S(typename T::value_type &)> op)
{
map<S, T> grouped;
for (auto &value : container)
{
grouped[op(value)].push_back(value);
}
return grouped;
}
template <class Container, class Transform>
Container fmap(const Container &c, Transform f)
{
Container r;
r.reserve(c.size());
transform(ALL(c), back_inserter(r), f);
return r;
}
template <class Container, class Predicate>
Container ffilter(const Container &c, Predicate f)
{
Container r;
std::copy_if(ALL(c), back_inserter(r), f);
return r;
}
template <class Container, class InitialT, class BinaryOp>
InitialT freduce(const Container &c, InitialT v, BinaryOp op)
{
return accumulate(ALL(c), v, op);
}
} // namespace
// const P udlr[4] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
struct Constants
{
ll N;
Constants()
{
cin >> N;
}
} C;
struct Args
{
Args()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
}
} args;
struct Solver
{
ll ans;
Solver() : ans(0)
{
}
//
void solve()
{
ans = pow(C.N, 3);
}
//
void output()
{
pr(ans);
}
} s;
int main()
{
s.solve();
s.output();
return 0;
}
| [
"hikida0842@gmail.com"
] | hikida0842@gmail.com |
75daa2f8b171dbed523088f04bdf170c6f8d1a7e | db111ff94903f0b24658c328d93f5cc28b670b8d | /chrome/browser/extensions/extension_management.cc | 73c51032e486199042d2b051ea17743933406248 | [
"BSD-3-Clause"
] | permissive | nibilin33/chromium | 21e505ab4c6dec858d3b0fe2bfbaf56d023d9f0d | 3dea9ffa737bc9c9a9f58d4bab7074e3bc84f349 | refs/heads/master | 2023-01-16T10:54:57.353825 | 2020-04-02T04:24:11 | 2020-04-02T04:24:11 | 252,359,157 | 1 | 0 | BSD-3-Clause | 2020-04-02T04:57:37 | 2020-04-02T04:57:37 | null | UTF-8 | C++ | false | false | 27,078 | cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_management.h"
#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/strings/string16.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/syslog_logging.h"
#include "base/trace_event/trace_event.h"
#include "base/version.h"
#include "chrome/browser/extensions/extension_management_constants.h"
#include "chrome/browser/extensions/extension_management_internal.h"
#include "chrome/browser/extensions/external_policy_loader.h"
#include "chrome/browser/extensions/external_provider_impl.h"
#include "chrome/browser/extensions/forced_extensions/installation_reporter.h"
#include "chrome/browser/extensions/forced_extensions/installation_reporter_factory.h"
#include "chrome/browser/extensions/permissions_based_management_policy_provider.h"
#include "chrome/browser/extensions/standard_management_policy_provider.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h"
#include "components/crx_file/id_util.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
#include "extensions/browser/pref_names.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_urls.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/permissions/api_permission_set.h"
#include "extensions/common/permissions/permission_set.h"
#include "extensions/common/url_pattern.h"
#include "url/gurl.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/extensions/default_web_app_ids.h"
#include "chrome/browser/chromeos/policy/system_features_disable_list_policy_handler.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "extensions/common/constants.h"
#endif
namespace extensions {
ExtensionManagement::ExtensionManagement(Profile* profile)
: profile_(profile),
pref_service_(profile_->GetPrefs()),
is_child_(profile_->IsChild()) {
TRACE_EVENT0("browser,startup",
"ExtensionManagement::ExtensionManagement::ctor");
base::Closure pref_change_callback = base::Bind(
&ExtensionManagement::OnExtensionPrefChanged, base::Unretained(this));
#if defined(OS_CHROMEOS)
is_signin_profile_ = chromeos::ProfileHelper::IsSigninProfile(profile);
PrefService* const local_state = g_browser_process->local_state();
if (local_state) { // Sometimes it's not available in tests.
local_state_pref_change_registrar_.Init(local_state);
local_state_pref_change_registrar_.Add(
policy::policy_prefs::kSystemFeaturesDisableList, pref_change_callback);
}
#endif
pref_change_registrar_.Init(pref_service_);
pref_change_registrar_.Add(pref_names::kInstallAllowList,
pref_change_callback);
pref_change_registrar_.Add(pref_names::kInstallDenyList,
pref_change_callback);
pref_change_registrar_.Add(pref_names::kInstallForceList,
pref_change_callback);
pref_change_registrar_.Add(pref_names::kLoginScreenExtensions,
pref_change_callback);
pref_change_registrar_.Add(pref_names::kAllowedInstallSites,
pref_change_callback);
pref_change_registrar_.Add(pref_names::kAllowedTypes, pref_change_callback);
pref_change_registrar_.Add(pref_names::kExtensionManagement,
pref_change_callback);
pref_change_registrar_.Add(prefs::kCloudExtensionRequestEnabled,
pref_change_callback);
#if !defined(OS_CHROMEOS)
pref_change_registrar_.Add(prefs::kCloudReportingEnabled,
pref_change_callback);
#endif
// Note that both |global_settings_| and |default_settings_| will be null
// before first call to Refresh(), so in order to resolve this, Refresh() must
// be called in the initialization of ExtensionManagement.
Refresh();
providers_.push_back(
std::make_unique<StandardManagementPolicyProvider>(this));
providers_.push_back(
std::make_unique<PermissionsBasedManagementPolicyProvider>(this));
}
ExtensionManagement::~ExtensionManagement() {
}
void ExtensionManagement::Shutdown() {
pref_change_registrar_.RemoveAll();
local_state_pref_change_registrar_.RemoveAll();
pref_service_ = nullptr;
}
void ExtensionManagement::AddObserver(Observer* observer) {
observer_list_.AddObserver(observer);
}
void ExtensionManagement::RemoveObserver(Observer* observer) {
observer_list_.RemoveObserver(observer);
}
const std::vector<std::unique_ptr<ManagementPolicy::Provider>>&
ExtensionManagement::GetProviders() const {
return providers_;
}
bool ExtensionManagement::BlacklistedByDefault() const {
return (default_settings_->installation_mode == INSTALLATION_BLOCKED ||
default_settings_->installation_mode == INSTALLATION_REMOVED);
}
ExtensionManagement::InstallationMode ExtensionManagement::GetInstallationMode(
const Extension* extension) const {
std::string update_url;
if (extension->manifest()->GetString(manifest_keys::kUpdateURL, &update_url))
return GetInstallationMode(extension->id(), update_url);
return GetInstallationMode(extension->id(), std::string());
}
ExtensionManagement::InstallationMode ExtensionManagement::GetInstallationMode(
const ExtensionId& extension_id,
const std::string& update_url) const {
// Check per-extension installation mode setting first.
auto iter_id = settings_by_id_.find(extension_id);
if (iter_id != settings_by_id_.end())
return iter_id->second->installation_mode;
// Check per-update-url installation mode setting.
if (!update_url.empty()) {
auto iter_update_url = settings_by_update_url_.find(update_url);
if (iter_update_url != settings_by_update_url_.end())
return iter_update_url->second->installation_mode;
}
// Fall back to default installation mode setting.
return default_settings_->installation_mode;
}
std::unique_ptr<base::DictionaryValue>
ExtensionManagement::GetForceInstallList() const {
return GetInstallListByMode(INSTALLATION_FORCED);
}
std::unique_ptr<base::DictionaryValue>
ExtensionManagement::GetRecommendedInstallList() const {
return GetInstallListByMode(INSTALLATION_RECOMMENDED);
}
bool ExtensionManagement::HasWhitelistedExtension() const {
if (default_settings_->installation_mode != INSTALLATION_BLOCKED &&
default_settings_->installation_mode != INSTALLATION_REMOVED) {
return true;
}
for (const auto& it : settings_by_id_) {
if (it.second->installation_mode == INSTALLATION_ALLOWED)
return true;
}
return false;
}
bool ExtensionManagement::IsInstallationExplicitlyAllowed(
const ExtensionId& id) const {
auto it = settings_by_id_.find(id);
// No settings explicitly specified for |id|.
if (it == settings_by_id_.end())
return false;
// Checks if the extension is on the automatically installed list or
// install white-list.
InstallationMode mode = it->second->installation_mode;
return mode == INSTALLATION_FORCED || mode == INSTALLATION_RECOMMENDED ||
mode == INSTALLATION_ALLOWED;
}
bool ExtensionManagement::IsInstallationExplicitlyBlocked(
const ExtensionId& id) const {
auto it = settings_by_id_.find(id);
// No settings explicitly specified for |id|.
if (it == settings_by_id_.end())
return false;
// Checks if the extension is on the black list or removed list.
InstallationMode mode = it->second->installation_mode;
return mode == INSTALLATION_BLOCKED || mode == INSTALLATION_REMOVED;
}
bool ExtensionManagement::IsOffstoreInstallAllowed(
const GURL& url,
const GURL& referrer_url) const {
// No allowed install sites specified, disallow by default.
if (!global_settings_->has_restricted_install_sources)
return false;
const URLPatternSet& url_patterns = global_settings_->install_sources;
if (!url_patterns.MatchesURL(url))
return false;
// The referrer URL must also be whitelisted, unless the URL has the file
// scheme (there's no referrer for those URLs).
return url.SchemeIsFile() || url_patterns.MatchesURL(referrer_url);
}
bool ExtensionManagement::IsAllowedManifestType(
Manifest::Type manifest_type,
const std::string& extension_id) const {
if (!global_settings_->has_restricted_allowed_types)
return true;
const std::vector<Manifest::Type>& allowed_types =
global_settings_->allowed_types;
return base::Contains(allowed_types, manifest_type);
}
APIPermissionSet ExtensionManagement::GetBlockedAPIPermissions(
const Extension* extension) const {
// Fetch per-extension blocked permissions setting.
auto iter_id = settings_by_id_.find(extension->id());
// Fetch per-update-url blocked permissions setting.
std::string update_url;
auto iter_update_url = settings_by_update_url_.end();
if (extension->manifest()->GetString(manifest_keys::kUpdateURL,
&update_url)) {
iter_update_url = settings_by_update_url_.find(update_url);
}
if (iter_id != settings_by_id_.end() &&
iter_update_url != settings_by_update_url_.end()) {
// Blocked permissions setting are specified in both per-extension and
// per-update-url settings, try to merge them.
APIPermissionSet merged;
APIPermissionSet::Union(iter_id->second->blocked_permissions,
iter_update_url->second->blocked_permissions,
&merged);
return merged;
}
// Check whether if in one of them, setting is specified.
if (iter_id != settings_by_id_.end())
return iter_id->second->blocked_permissions.Clone();
if (iter_update_url != settings_by_update_url_.end())
return iter_update_url->second->blocked_permissions.Clone();
// Fall back to the default blocked permissions setting.
return default_settings_->blocked_permissions.Clone();
}
const URLPatternSet& ExtensionManagement::GetDefaultPolicyBlockedHosts() const {
return default_settings_->policy_blocked_hosts;
}
const URLPatternSet& ExtensionManagement::GetDefaultPolicyAllowedHosts() const {
return default_settings_->policy_allowed_hosts;
}
const URLPatternSet& ExtensionManagement::GetPolicyBlockedHosts(
const Extension* extension) const {
auto iter_id = settings_by_id_.find(extension->id());
if (iter_id != settings_by_id_.end())
return iter_id->second->policy_blocked_hosts;
return default_settings_->policy_blocked_hosts;
}
const URLPatternSet& ExtensionManagement::GetPolicyAllowedHosts(
const Extension* extension) const {
auto iter_id = settings_by_id_.find(extension->id());
if (iter_id != settings_by_id_.end())
return iter_id->second->policy_allowed_hosts;
return default_settings_->policy_allowed_hosts;
}
bool ExtensionManagement::UsesDefaultPolicyHostRestrictions(
const Extension* extension) const {
return settings_by_id_.find(extension->id()) == settings_by_id_.end();
}
bool ExtensionManagement::IsPolicyBlockedHost(const Extension* extension,
const GURL& url) const {
auto iter_id = settings_by_id_.find(extension->id());
if (iter_id != settings_by_id_.end())
return iter_id->second->policy_blocked_hosts.MatchesURL(url);
return default_settings_->policy_blocked_hosts.MatchesURL(url);
}
std::unique_ptr<const PermissionSet> ExtensionManagement::GetBlockedPermissions(
const Extension* extension) const {
// Only api permissions are supported currently.
return std::unique_ptr<const PermissionSet>(new PermissionSet(
GetBlockedAPIPermissions(extension), ManifestPermissionSet(),
URLPatternSet(), URLPatternSet()));
}
bool ExtensionManagement::IsPermissionSetAllowed(
const Extension* extension,
const PermissionSet& perms) const {
for (auto* blocked_api : GetBlockedAPIPermissions(extension)) {
if (perms.HasAPIPermission(blocked_api->id()))
return false;
}
return true;
}
const std::string ExtensionManagement::BlockedInstallMessage(
const ExtensionId& id) const {
auto iter_id = settings_by_id_.find(id);
if (iter_id != settings_by_id_.end())
return iter_id->second->blocked_install_message;
return default_settings_->blocked_install_message;
}
bool ExtensionManagement::CheckMinimumVersion(
const Extension* extension,
std::string* required_version) const {
auto iter = settings_by_id_.find(extension->id());
// If there are no minimum version required for |extension|, return true.
if (iter == settings_by_id_.end() || !iter->second->minimum_version_required)
return true;
bool meets_requirement = extension->version().CompareTo(
*iter->second->minimum_version_required) >= 0;
// Output a human readable version string for prompting if necessary.
if (!meets_requirement && required_version)
*required_version = iter->second->minimum_version_required->GetString();
return meets_requirement;
}
void ExtensionManagement::Refresh() {
TRACE_EVENT0("browser,startup", "ExtensionManagement::Refresh");
// Load all extension management settings preferences.
const base::ListValue* allowed_list_pref =
static_cast<const base::ListValue*>(LoadPreference(
pref_names::kInstallAllowList, true, base::Value::Type::LIST));
// Allow user to use preference to block certain extensions. Note that policy
// managed forcelist or whitelist will always override this.
const base::ListValue* denied_list_pref =
static_cast<const base::ListValue*>(LoadPreference(
pref_names::kInstallDenyList, false, base::Value::Type::LIST));
const base::DictionaryValue* forced_list_pref =
static_cast<const base::DictionaryValue*>(LoadPreference(
pref_names::kInstallForceList, true, base::Value::Type::DICTIONARY));
const base::DictionaryValue* login_screen_extensions_pref = nullptr;
if (is_signin_profile_) {
login_screen_extensions_pref = static_cast<const base::DictionaryValue*>(
LoadPreference(pref_names::kLoginScreenExtensions, true,
base::Value::Type::DICTIONARY));
}
const base::ListValue* install_sources_pref =
static_cast<const base::ListValue*>(LoadPreference(
pref_names::kAllowedInstallSites, true, base::Value::Type::LIST));
const base::ListValue* allowed_types_pref =
static_cast<const base::ListValue*>(LoadPreference(
pref_names::kAllowedTypes, true, base::Value::Type::LIST));
const base::DictionaryValue* dict_pref =
static_cast<const base::DictionaryValue*>(
LoadPreference(pref_names::kExtensionManagement,
true,
base::Value::Type::DICTIONARY));
const base::Value* extension_request_pref = LoadPreference(
prefs::kCloudExtensionRequestEnabled, false, base::Value::Type::BOOLEAN);
// Reset all settings.
global_settings_.reset(new internal::GlobalSettings());
settings_by_id_.clear();
default_settings_.reset(new internal::IndividualSettings());
// Parse default settings.
const base::Value wildcard("*");
if ((denied_list_pref &&
denied_list_pref->Find(wildcard) != denied_list_pref->end()) ||
(extension_request_pref && extension_request_pref->GetBool())) {
default_settings_->installation_mode = INSTALLATION_BLOCKED;
}
const base::DictionaryValue* subdict = NULL;
if (dict_pref &&
dict_pref->GetDictionary(schema_constants::kWildcard, &subdict)) {
if (!default_settings_->Parse(
subdict, internal::IndividualSettings::SCOPE_DEFAULT)) {
LOG(WARNING) << "Default extension management settings parsing error.";
default_settings_->Reset();
}
// Settings from new preference have higher priority over legacy ones.
const base::ListValue* list_value = NULL;
if (subdict->GetList(schema_constants::kInstallSources, &list_value))
install_sources_pref = list_value;
if (subdict->GetList(schema_constants::kAllowedTypes, &list_value))
allowed_types_pref = list_value;
}
// Parse legacy preferences.
ExtensionId id;
if (allowed_list_pref) {
for (auto it = allowed_list_pref->begin(); it != allowed_list_pref->end();
++it) {
if (it->GetAsString(&id) && crx_file::id_util::IdIsValid(id))
AccessById(id)->installation_mode = INSTALLATION_ALLOWED;
}
}
if (denied_list_pref) {
for (auto it = denied_list_pref->begin(); it != denied_list_pref->end();
++it) {
if (it->GetAsString(&id) && crx_file::id_util::IdIsValid(id))
AccessById(id)->installation_mode = INSTALLATION_BLOCKED;
}
}
UpdateForcedExtensions(forced_list_pref);
UpdateForcedExtensions(login_screen_extensions_pref);
if (install_sources_pref) {
global_settings_->has_restricted_install_sources = true;
for (auto it = install_sources_pref->begin();
it != install_sources_pref->end(); ++it) {
std::string url_pattern;
if (it->GetAsString(&url_pattern)) {
URLPattern entry(URLPattern::SCHEME_ALL);
if (entry.Parse(url_pattern) == URLPattern::ParseResult::kSuccess) {
global_settings_->install_sources.AddPattern(entry);
} else {
LOG(WARNING) << "Invalid URL pattern in for preference "
<< pref_names::kAllowedInstallSites << ": "
<< url_pattern << ".";
}
}
}
}
if (allowed_types_pref) {
global_settings_->has_restricted_allowed_types = true;
for (auto it = allowed_types_pref->begin(); it != allowed_types_pref->end();
++it) {
int int_value;
std::string string_value;
if (it->GetAsInteger(&int_value) && int_value >= 0 &&
int_value < Manifest::Type::NUM_LOAD_TYPES) {
global_settings_->allowed_types.push_back(
static_cast<Manifest::Type>(int_value));
} else if (it->GetAsString(&string_value)) {
Manifest::Type manifest_type =
schema_constants::GetManifestType(string_value);
if (manifest_type != Manifest::TYPE_UNKNOWN)
global_settings_->allowed_types.push_back(manifest_type);
}
}
}
if (dict_pref) {
// Parse new extension management preference.
for (base::DictionaryValue::Iterator iter(*dict_pref); !iter.IsAtEnd();
iter.Advance()) {
if (iter.key() == schema_constants::kWildcard)
continue;
if (!iter.value().GetAsDictionary(&subdict))
continue;
if (base::StartsWith(iter.key(), schema_constants::kUpdateUrlPrefix,
base::CompareCase::SENSITIVE)) {
const std::string& update_url =
iter.key().substr(strlen(schema_constants::kUpdateUrlPrefix));
if (!GURL(update_url).is_valid()) {
LOG(WARNING) << "Invalid update URL: " << update_url << ".";
continue;
}
internal::IndividualSettings* by_update_url =
AccessByUpdateUrl(update_url);
if (!by_update_url->Parse(
subdict, internal::IndividualSettings::SCOPE_UPDATE_URL)) {
settings_by_update_url_.erase(update_url);
LOG(WARNING) << "Malformed Extension Management settings for "
"extensions with update url: " << update_url << ".";
}
} else {
std::vector<std::string> extension_ids = base::SplitString(
iter.key(), ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
InstallationReporter* installation_reporter =
InstallationReporter::Get(profile_);
for (const auto& extension_id : extension_ids) {
if (!crx_file::id_util::IdIsValid(extension_id)) {
SYSLOG(WARNING) << "Invalid extension ID : " << extension_id << ".";
continue;
}
internal::IndividualSettings* by_id = AccessById(extension_id);
if (!by_id->Parse(subdict,
internal::IndividualSettings::SCOPE_INDIVIDUAL)) {
settings_by_id_.erase(extension_id);
installation_reporter->ReportFailure(
extension_id, InstallationReporter::FailureReason::
MALFORMED_EXTENSION_SETTINGS);
SYSLOG(WARNING) << "Malformed Extension Management settings for "
<< extension_id << ".";
}
}
}
}
}
#if defined(OS_CHROMEOS)
const base::Value* system_features_disable_list_pref = nullptr;
PrefService* const local_state = g_browser_process->local_state();
if (local_state) { // Sometimes it's not available in tests.
system_features_disable_list_pref =
local_state->GetList(policy::policy_prefs::kSystemFeaturesDisableList);
}
if (system_features_disable_list_pref) {
for (const auto& entry : system_features_disable_list_pref->GetList()) {
switch (entry.GetInt()) {
case policy::SystemFeature::CAMERA:
AccessById(extension_misc::kCameraAppId)->installation_mode =
INSTALLATION_BLOCKED;
break;
case policy::SystemFeature::SETTINGS:
AccessById(chromeos::default_web_apps::kOsSettingsAppId)
->installation_mode = INSTALLATION_BLOCKED;
break;
}
}
}
#endif
}
const base::Value* ExtensionManagement::LoadPreference(
const char* pref_name,
bool force_managed,
base::Value::Type expected_type) const {
if (!pref_service_)
return nullptr;
const PrefService::Preference* pref =
pref_service_->FindPreference(pref_name);
if (pref && !pref->IsDefaultValue() &&
(!force_managed || pref->IsManaged())) {
const base::Value* value = pref->GetValue();
if (value && value->type() == expected_type)
return value;
}
return nullptr;
}
void ExtensionManagement::OnExtensionPrefChanged() {
Refresh();
NotifyExtensionManagementPrefChanged();
}
void ExtensionManagement::NotifyExtensionManagementPrefChanged() {
InstallationReporter* installation_reporter =
InstallationReporter::Get(profile_);
for (const auto& entry : settings_by_id_) {
if (entry.second->installation_mode == INSTALLATION_FORCED) {
installation_reporter->ReportInstallationStage(
entry.first, InstallationReporter::Stage::NOTIFIED_FROM_MANAGEMENT);
} else {
installation_reporter->ReportInstallationStage(
entry.first,
InstallationReporter::Stage::NOTIFIED_FROM_MANAGEMENT_NOT_FORCED);
}
}
for (auto& observer : observer_list_)
observer.OnExtensionManagementSettingsChanged();
}
std::unique_ptr<base::DictionaryValue>
ExtensionManagement::GetInstallListByMode(
InstallationMode installation_mode) const {
auto extension_dict = std::make_unique<base::DictionaryValue>();
for (const auto& entry : settings_by_id_) {
if (entry.second->installation_mode == installation_mode) {
ExternalPolicyLoader::AddExtension(extension_dict.get(), entry.first,
entry.second->update_url);
}
}
return extension_dict;
}
void ExtensionManagement::UpdateForcedExtensions(
const base::DictionaryValue* extension_dict) {
if (!extension_dict)
return;
std::string update_url;
InstallationReporter* installation_reporter =
InstallationReporter::Get(profile_);
for (base::DictionaryValue::Iterator it(*extension_dict); !it.IsAtEnd();
it.Advance()) {
if (!crx_file::id_util::IdIsValid(it.key())) {
installation_reporter->ReportFailure(
it.key(), InstallationReporter::FailureReason::INVALID_ID);
continue;
}
const base::DictionaryValue* dict_value = nullptr;
if (it.value().GetAsDictionary(&dict_value) &&
dict_value->GetStringWithoutPathExpansion(
ExternalProviderImpl::kExternalUpdateUrl, &update_url)) {
internal::IndividualSettings* by_id = AccessById(it.key());
by_id->installation_mode = INSTALLATION_FORCED;
by_id->update_url = update_url;
installation_reporter->ReportInstallationStage(
it.key(), InstallationReporter::Stage::CREATED);
} else {
installation_reporter->ReportFailure(
it.key(), InstallationReporter::FailureReason::NO_UPDATE_URL);
}
}
}
internal::IndividualSettings* ExtensionManagement::AccessById(
const ExtensionId& id) {
DCHECK(crx_file::id_util::IdIsValid(id)) << "Invalid ID: " << id;
std::unique_ptr<internal::IndividualSettings>& settings = settings_by_id_[id];
if (!settings) {
settings =
std::make_unique<internal::IndividualSettings>(default_settings_.get());
}
return settings.get();
}
internal::IndividualSettings* ExtensionManagement::AccessByUpdateUrl(
const std::string& update_url) {
DCHECK(GURL(update_url).is_valid()) << "Invalid update URL: " << update_url;
std::unique_ptr<internal::IndividualSettings>& settings =
settings_by_update_url_[update_url];
if (!settings) {
settings =
std::make_unique<internal::IndividualSettings>(default_settings_.get());
}
return settings.get();
}
// static
ExtensionManagement* ExtensionManagementFactory::GetForBrowserContext(
content::BrowserContext* context) {
return static_cast<ExtensionManagement*>(
GetInstance()->GetServiceForBrowserContext(context, true));
}
// static
ExtensionManagementFactory* ExtensionManagementFactory::GetInstance() {
return base::Singleton<ExtensionManagementFactory>::get();
}
ExtensionManagementFactory::ExtensionManagementFactory()
: BrowserContextKeyedServiceFactory(
"ExtensionManagement",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(InstallationReporterFactory::GetInstance());
}
ExtensionManagementFactory::~ExtensionManagementFactory() {
}
KeyedService* ExtensionManagementFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
TRACE_EVENT0("browser,startup",
"ExtensionManagementFactory::BuildServiceInstanceFor");
return new ExtensionManagement(Profile::FromBrowserContext(context));
}
content::BrowserContext* ExtensionManagementFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
void ExtensionManagementFactory::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* user_prefs) {
user_prefs->RegisterDictionaryPref(pref_names::kExtensionManagement);
}
} // namespace extensions
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
0741b39d1fe809642146afc9db3d767661ac2061 | aaba6d264025d7ff1a7874b3e329c61ecec01bd6 | /codechef/easy/Odd.cpp | b1c82aa809c45593f034cf346abf21fe2cd39b92 | [] | no_license | liuzixing/scut | b8118c3f0fea497a6babbe1ccbed94f2997b07d3 | 930c90abbabc98ac0bff4cb4fcde2c46f92a2937 | refs/heads/master | 2020-06-09T06:59:29.230684 | 2014-03-19T11:29:52 | 2014-03-19T11:29:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 442 | cpp | #include <cstdio>
using namespace std;
int two[31];
int main()
{
int t,n;
two[0] = 1;
for (int i = 1;two[i - 1] < 1000000000;i++)
two[i] = two[i - 1] * 2;
scanf("%d",&t);
while (t--)
{
scanf("%d",&n);
for (int i = 30;i >= 0;i--)
if (two[i] <= n)
{
printf("%d\n",two[i]);
break;
}
}
return 0;
}
| [
"liucising@gmail.com"
] | liucising@gmail.com |
3a0230afb8efa1246c0a31aae9b4a90bb988c68f | 81d9c66e71be0bbda562cae1eaaed092934f9375 | /SpaceCombat/Scenarios/scenario4.h | 6790a51ce15ee14d052ca1e58863ac7a7837e4ad | [] | no_license | ThePiachu/Space-Combat | 9fd1c54c2e1283e34fdb26c800fa27d939b1336f | b23d4ad60ca6aa3c5a6eb834329ca0e4c2e725ea | refs/heads/master | 2021-01-22T08:59:55.352193 | 2012-06-15T20:17:22 | 2012-06-15T20:17:22 | 2,955,081 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,633 | h | #ifndef SCENARIO4_H_
#define SCENARIO4_H_
#include "scenario.h"
#include "../math.h"
#include "../map.h"
#include "../ai.h"
//#define SCENARIO4STARS 5000
//#define SCENARIO4BOIDAMOUNT 1500
#define SCENARIO4SHIPAMOUNT 200
class scenario4:public scenario
{
char Chars[100];
int i, fps, tmptime;
string result;
path mypath;
grid metagrid;
pilots allpilots;
steeringpreferences defaultsteering;
unsigned int displaygrid;
fsme defaultfsme;
fsm defaultfsm;
public:
scenario4():
i(0), fps(0), tmptime(time(NULL)),
result(),
mypath(),
metagrid(2.0),
allpilots(),
defaultsteering(),
displaygrid(1),
defaultfsme(),
defaultfsm()
{
}
~scenario4()
{
allpilots.clear();
}
void nexttime()
{
i++;
if (tmptime!=time(NULL))
{
tmptime=time(NULL);
fps=i;
i=0;
result=string("FPS: ")+itoa(fps, Chars, 10);
myhud->setbottomleft(result);
}
allpilots.nexttime();
metagrid.checkallships();
//myboids->moveme();
//myboids->moveme(2, i%2);
}
void startscenario(quaternioncamera2 *Camera, hud* HUD, stars *Stars)
{
metagrid.clear();
allpilots.clear();
defaultsteering.reset();
defaultfsm.clear();
defaultfsme.clear();
defaultsteering.setwander(1.0);
defaultsteering.setalignment(0.2);
defaultsteering.setseparation(0.3);
defaultsteering.setcohesion(0.1);
defaultsteering.setavoid(1.0);
defaultsteering.setfollow(3.0, 0.3, 0.5);
/*defaultsteering.setwander(1.0);
defaultsteering.setalignment(0.3);
defaultsteering.setseparation(0.2);
defaultsteering.setcohesion(0.3);
defaultsteering.setavoid(1.0);
//defaultsteering.setfollow(1.0, 0.6, 1.0);
defaultsteering.setfollow(5.0, 0.5, 1.0);*/
steeringcontrol orders;
orders.setgo(true);
orders.setloopedpathfollow(true);
decisionpreferences decprefs;
state tmpstate(string("Follow"),
//defaultsteering, decprefs,
orders);
fsme defaultfsme;
defaultfsme.setname("Default");
defaultfsme.addstate(tmpstate);
defaultfsme.setcurrentstate("Follow");
defaultfsme.setalldecisions(decprefs);
defaultfsme.setallsteering(defaultsteering);
defaultfsm.addfsme(defaultfsme);
myhud=HUD;
cam=Camera;
myhud->settopleft(string("Scenario 4"));
//myboids=Boids;
mystars=Stars;
mypath.clear();
//mystars->setstars(SIZE, SCENARIO4STARS);
//cam->setzoom(7.0*SIZE);
//myboids->setamount(SCENARIO4BOIDAMOUNT);
//myboids->setuniverse(*mystars);
//myboids->setdisplay(&myhud->topleft);
//myboids->setallsteering(1.0, 0.0, 0.0, 0.0, 1.0);
tmptime=time(NULL);
// HEY
//CHRIS
//path:
//loop back to H:
mypath.addpoint(point(-5.0, 6.0, -3.0));
//H
mypath.addpoint(point(-5.0, 6.0, 0.0));
mypath.addpoint(point(-5.0, 1.0, 0.0));
mypath.addpoint(point(-5.0, 3.5, 0.0));
mypath.addpoint(point(-3.0, 3.5, 0.0));
mypath.addpoint(point(-3.0, 6.0, 0.0));
mypath.addpoint(point(-3.0, 1.0, 0.0));
//fade into background
mypath.addpoint(point(-3.0, 1.0, -3.0));
mypath.addpoint(point(1.0, 6.0, -3.0));
//E
mypath.addpoint(point(1.0, 6.0, 0.0));
mypath.addpoint(point(-1.0, 6.0, 0.0));
mypath.addpoint(point(-1.0, 3.5, 0.0));
mypath.addpoint(point(0.0, 3.5, 0.0));
mypath.addpoint(point(-1.0, 3.5, 0.0));
mypath.addpoint(point(-1.0, 1.0, 0.0));
mypath.addpoint(point(1.0, 1.0, 0.0));
//fade into background
mypath.addpoint(point(1.0, 1.0, -3.0));
mypath.addpoint(point(3.0, 6.0, -3.0));
//Y
mypath.addpoint(point(3.0, 6.0, 0.0));
mypath.addpoint(point(4.0, 3.5, 0.0));
mypath.addpoint(point(5.0, 6.0, 0.0));
mypath.addpoint(point(4.0, 3.5, 0.0));
mypath.addpoint(point(4.0, 1.0, 0.0));
mypath.addpoint(point(4.0, 1.0, -3.0));
mypath.addpoint(point(-7.0, 0.0, -3.0));
//C
mypath.addpoint(point(-7.0, 0.0, 0.0));
mypath.addpoint(point(-9.0, 0.0, 0.0));
mypath.addpoint(point(-9.0, -4.0, 0.0));
mypath.addpoint(point(-7.0, -4.0, 0.0));
mypath.addpoint(point(-7.0, -4.0, -3.0));
mypath.addpoint(point(-5.0, 0.0, -3.0));
//H
mypath.addpoint(point(-5.0, 0.0, 0.0));
mypath.addpoint(point(-5.0, -4, 0.0));
mypath.addpoint(point(-5.0, -2.0, 0.0));
mypath.addpoint(point(-3.0, -2.0, 0.0));
mypath.addpoint(point(-3.0, 0.0, 0.0));
mypath.addpoint(point(-3.0, -4.0, 0.0));
mypath.addpoint(point(-3.0, -4.0, -3.0));
mypath.addpoint(point(-1.0, -4.0, -3.0));
//R
mypath.addpoint(point(-1.0, -4.0, 0.0));
mypath.addpoint(point(-1.0, 0.0, 0.0));
mypath.addpoint(point(0.0, 0.0, 0.0));
mypath.addpoint(point(1.0, -1.0, 0.0));
mypath.addpoint(point(0.0, -2.0, 0.0));
mypath.addpoint(point(1.0, -4.0, 0.0));
mypath.addpoint(point(1.0, -4.0, -3.0));
mypath.addpoint(point(4.0, -4.0, -3.0));
//I
mypath.addpoint(point(3.5, -4.0, 0.0));
mypath.addpoint(point(3.5, 0.0, 0.0));
//I again
mypath.addpoint(point(3.5, -4.0, 0.0));
mypath.addpoint(point(3.3, 0.0, 0.0));
mypath.addpoint(point(3.5, 0.0, -3.0));
mypath.addpoint(point(8.0, 0.0, -3.0));
//S
mypath.addpoint(point(8.0, 0.0, 0.0));
mypath.addpoint(point(6.0, 0.0, 0.0));
mypath.addpoint(point(6.0, -2.0, 0.0));
mypath.addpoint(point(8.0, -2.0, 0.0));
mypath.addpoint(point(8.0, -4.0, 0.0));
mypath.addpoint(point(6.0, -4.0, 0.0));
mypath.addpoint(point(6.0, -4.0, -3.0));
//and loops back to H
allpilots.setgrid(&metagrid);
allpilots.setdefaultpilot(pilot(point(0.0, 0.0, 0.0), defaultfsm));
allpilots.setpilotcap(SCENARIO4SHIPAMOUNT);
allpilots.setdefaultloopedpath(mypath);
for (unsigned int i=0;i<SCENARIO4SHIPAMOUNT;i++)
{
allpilots.newbasicpilot2(myrandom->randomcubeposition(8));
}
allpilots.assignloopedpath();
//myboids->setboidsloopedpath(mypath);
}
void drawme()
{
glColor3f(1.0, 1.0, 1.0);
glPushMatrix();
//cam.rotatecamera();
//drawing the 3 unit vectors
glBegin(GL_LINES);
glColor3f(1.0,0.0,0.0);
glVertex3f(0.0,0.0,0.0);
glVertex3f(1.0,0.0,0.0);
glColor3f(0.0,1.0,0.0);
glVertex3f(0.0,0.0,0.0);
glVertex3f(0.0,1.0,0.0);
glColor3f(0.0,0.0,1.0);
glVertex3f(0.0,0.0,0.0);
glVertex3f(0.0,0.0,1.0);
glEnd();
glColor3f(1.0,1.0,1.0);
//mystars->drawme();
glPopMatrix();
//myboids->drawme();
allpilots.drawme();
metagrid.drawme(displaygrid);
}
void handlekey(int Key)
{
switch(Key)
{
case (int)'/':
displaygrid++;
break;
default:
break;
}
}
};
#endif /* SCENARIO4_H_ */
| [
"ThePiachu@gmail.com"
] | ThePiachu@gmail.com |
d0d3452ade56b05617bf96b23df4989b87a6e08c | 2b671042d4d4e1f14f4b07e303965d6774bcf494 | /CPP_Opdracht1/Course.h | 5a38bd5653853e757c013682fb147c041be4abc5 | [] | no_license | Calvin-Davidson/SD_opdracht1 | cf2bb4387561481d4c43507641e062c0e9a8609e | 12a0c0da00d05df9f07ccce2adbe27488ef9be30 | refs/heads/main | 2023-04-17T16:03:10.335215 | 2021-03-26T15:15:53 | 2021-03-26T15:15:53 | 301,715,233 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 500 | h | #pragma once
#include <string>;
#include <vector>;
#include "Student.h"
class Course
{
public:
std::vector < Student* > students;
Course(std::string name);
~Course();
void AddStudent(Student* student);
void RemoveStudent(Student* student);
// getters and setters
std::string GetName();
int GetAge();
int GetStudentCounter();
std::vector<Student*> * GetStudents();
void SetName(std::string name);
void SetAge(int age);
private:
std::string name;
int age;
int studentCount;
};
| [
"calvin2003davidson@gmail.com"
] | calvin2003davidson@gmail.com |
40067425c9745b3e65c52991fc6780e97c2a013a | 08b8cf38e1936e8cec27f84af0d3727321cec9c4 | /data/crawl/git/new_hunk_2306.cpp | 40afd1bf501130ea5de30b41a630be4225cac317 | [] | no_license | ccdxc/logSurvey | eaf28e9c2d6307140b17986d5c05106d1fd8e943 | 6b80226e1667c1e0760ab39160893ee19b0e9fb1 | refs/heads/master | 2022-01-07T21:31:55.446839 | 2018-04-21T14:12:43 | 2018-04-21T14:12:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 551 | cpp | return dst;
}
static const char *strip_ref_components(const char *refname, const char *nr_arg)
{
char *end;
long nr = strtol(nr_arg, &end, 10);
long remaining = nr;
const char *start = refname;
if (nr < 1 || *end != '\0')
die(":strip= requires a positive integer argument");
while (remaining) {
switch (*start++) {
case '\0':
die("ref '%s' does not have %ld components to :strip",
refname, nr);
case '/':
remaining--;
break;
}
}
return start;
}
/*
* Parse the object referred by ref, and grab needed value.
*/
| [
"993273596@qq.com"
] | 993273596@qq.com |
226fedf6bb6e593252d15c4278823ba15809542f | d8c772acd5efa2f124f24c1de49294f0be798830 | /Program/binaryrecur.cpp | c7b78dc19e4a5142afb3e629f35f239943377504 | [] | no_license | Adityashar/Program | 4cad8c5fa0acd31d759bb1264774699256d9fcd4 | 9610b85165a861e260d3e0d2f6a7e871db7c90dc | refs/heads/master | 2021-07-16T08:50:10.011124 | 2018-10-17T03:42:44 | 2018-10-17T03:42:44 | 135,829,550 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 395 | cpp | #include <iostream>
using namespace std;
int brecur(int a[100],int s,int e,int l)
{
int mid = (s+e)/2;
//if(mid<=1) return 1;
if(a[mid]>l) e=mid-1;
else if(a[mid]<l) s=mid+1;
else
return mid;
brecur(a,s,e,l);
}
int main()
{
int n,a[100],l;
cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
cin>>l;
cout<<brecur(a,0,n,l);
return 0;
}
| [
"adityashar@github.com"
] | adityashar@github.com |
957cf91a21367f679f08cdd8ca55a1ec779fb252 | ba1475516f1905521303b114fadebbe337055e12 | /node_modules/catch/include/internal/catch_interfaces_capture.h | 6565f0e6923cd68b02710e898409dc0105791c35 | [
"MIT",
"BSL-1.0"
] | permissive | RobWongus/NodeHomework | ab16b83a5a97378ff03ec7400dbce1a40a920f11 | 07a8276b25df0f72973e6590830cf480e59c7f0d | refs/heads/master | 2021-07-15T04:32:01.677059 | 2020-03-30T03:55:09 | 2020-03-30T03:55:09 | 247,172,780 | 0 | 0 | MIT | 2021-05-11T07:34:56 | 2020-03-13T22:35:29 | JavaScript | UTF-8 | C++ | false | false | 1,423 | h | /*
* Created by Phil on 07/01/2011.
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
#define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
#include <string>
#include "catch_result_type.h"
#include "catch_common.h"
namespace Catch {
class TestCase;
class AssertionResult;
struct AssertionInfo;
struct SectionInfo;
struct MessageInfo;
class ScopedMessageBuilder;
struct Counts;
struct IResultCapture {
virtual ~IResultCapture();
virtual void assertionEnded( AssertionResult const& result ) = 0;
virtual bool sectionStarted( SectionInfo const& sectionInfo,
Counts& assertions ) = 0;
virtual void sectionEnded( SectionInfo const& name, Counts const& assertions, double _durationInSeconds ) = 0;
virtual void pushScopedMessage( MessageInfo const& message ) = 0;
virtual void popScopedMessage( MessageInfo const& message ) = 0;
virtual std::string getCurrentTestName() const = 0;
virtual const AssertionResult* getLastResult() const = 0;
};
IResultCapture& getResultCapture();
}
#endif // TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
| [
"rob_wo@yahoo.com"
] | rob_wo@yahoo.com |
5bc3bc862630a3918e5cb3d00fe04a2808ecf0a6 | ba41dbc2183bd91e6e9a8669904b85f342775530 | /python/im/include/flattery.hpp | 22913a0bb6c9b04d2307714aed589591b17eb428 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | fish2000/libimread | 5d835f98083a897e1d0d9fde4f816cea4496e35f | 781e2484559136de5171d577d54afa624ca4c8b4 | refs/heads/master | 2022-04-28T18:14:27.189975 | 2022-03-20T23:57:15 | 2022-03-20T23:57:15 | 30,621,253 | 7 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 235 | hpp |
#include <Python.h>
namespace py {
namespace flattery {
PyObject* unflatten(PyObject*, PyObject*);
PyObject* flatten(PyObject*);
PyObject* flatten_mappings(PyObject*);
}
}
| [
"fish2000@gmail.com"
] | fish2000@gmail.com |
6d6c9186dfec35994266a98f633ed1072797decd | d3b468ef0938ec32edf71ea1ceeb5b5d06ebf171 | /ogr/ogrsf_frmts/pmtiles/ogrpmtilesdriver.cpp | 474fa633628523b66351f8acacb5da8ac913ff10 | [
"LicenseRef-scancode-warranty-disclaimer",
"SunPro",
"LicenseRef-scancode-info-zip-2005-02",
"BSD-3-Clause",
"MIT",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | OSGeo/gdal | 30a1e1fb0909d758d4f636d481bf03fcd7affe3c | 1e7746b2546b8c4878f4bfdb20c87f87e561745b | refs/heads/master | 2023-09-03T19:37:50.027999 | 2023-09-03T18:29:31 | 2023-09-03T18:29:31 | 6,148,317 | 4,100 | 2,611 | NOASSERTION | 2023-09-14T20:23:19 | 2012-10-09T21:39:58 | C++ | UTF-8 | C++ | false | false | 8,960 | cpp | /******************************************************************************
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implementation of PMTiles
* Author: Even Rouault <even.rouault at spatialys.com>
*
******************************************************************************
* Copyright (c) 2023, Planet Labs
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#include "ogr_pmtiles.h"
#include "vsipmtiles.h"
#include "ogrpmtilesfrommbtiles.h"
#ifdef HAVE_MVT_WRITE_SUPPORT
#include "mvtutils.h"
#endif
/************************************************************************/
/* OGRPMTilesDriverIdentify() */
/************************************************************************/
static int OGRPMTilesDriverIdentify(GDALOpenInfo *poOpenInfo)
{
if (poOpenInfo->nHeaderBytes < 127 || !poOpenInfo->fpL)
return FALSE;
return memcmp(poOpenInfo->pabyHeader, "PMTiles\x03", 8) == 0;
}
/************************************************************************/
/* OGRPMTilesDriverOpen() */
/************************************************************************/
static GDALDataset *OGRPMTilesDriverOpen(GDALOpenInfo *poOpenInfo)
{
if (!OGRPMTilesDriverIdentify(poOpenInfo))
return nullptr;
auto poDS = cpl::make_unique<OGRPMTilesDataset>();
if (!poDS->Open(poOpenInfo))
return nullptr;
return poDS.release();
}
/************************************************************************/
/* OGRPMTilesDriverCanVectorTranslateFrom() */
/************************************************************************/
static bool OGRPMTilesDriverCanVectorTranslateFrom(
const char * /*pszDestName*/, GDALDataset *poSourceDS,
CSLConstList papszVectorTranslateArguments, char ***ppapszFailureReasons)
{
auto poSrcDriver = poSourceDS->GetDriver();
if (!(poSrcDriver && EQUAL(poSrcDriver->GetDescription(), "MBTiles")))
{
if (ppapszFailureReasons)
*ppapszFailureReasons = CSLAddString(
*ppapszFailureReasons, "Source driver is not MBTiles");
return false;
}
if (papszVectorTranslateArguments)
{
const int nArgs = CSLCount(papszVectorTranslateArguments);
for (int i = 0; i < nArgs; ++i)
{
if (i + 1 < nArgs &&
(strcmp(papszVectorTranslateArguments[i], "-f") == 0 ||
strcmp(papszVectorTranslateArguments[i], "-of") == 0))
{
++i;
}
else
{
if (ppapszFailureReasons)
*ppapszFailureReasons =
CSLAddString(*ppapszFailureReasons,
"Direct copy from MBTiles does not "
"support GDALVectorTranslate() options");
return false;
}
}
}
return true;
}
/************************************************************************/
/* OGRPMTilesDriverVectorTranslateFrom() */
/************************************************************************/
static GDALDataset *OGRPMTilesDriverVectorTranslateFrom(
const char *pszDestName, GDALDataset *poSourceDS,
CSLConstList papszVectorTranslateArguments,
GDALProgressFunc /* pfnProgress */, void * /* pProgressData */)
{
if (!OGRPMTilesDriverCanVectorTranslateFrom(
pszDestName, poSourceDS, papszVectorTranslateArguments, nullptr))
{
return nullptr;
}
if (!OGRPMTilesConvertFromMBTiles(pszDestName,
poSourceDS->GetDescription()))
{
return nullptr;
}
GDALOpenInfo oOpenInfo(pszDestName, GA_ReadOnly);
return OGRPMTilesDriverOpen(&oOpenInfo);
}
#ifdef HAVE_MVT_WRITE_SUPPORT
/************************************************************************/
/* Create() */
/************************************************************************/
static GDALDataset *OGRPMTilesDriverCreate(const char *pszFilename, int nXSize,
int nYSize, int nBandsIn,
GDALDataType eDT,
char **papszOptions)
{
if (nXSize == 0 && nYSize == 0 && nBandsIn == 0 && eDT == GDT_Unknown)
{
auto poDS = cpl::make_unique<OGRPMTilesWriterDataset>();
if (!poDS->Create(pszFilename, papszOptions))
return nullptr;
return poDS.release();
}
return nullptr;
}
#endif
/************************************************************************/
/* RegisterOGRPMTiles() */
/************************************************************************/
void RegisterOGRPMTiles()
{
if (GDALGetDriverByName("PMTiles") != nullptr)
return;
VSIPMTilesRegister();
GDALDriver *poDriver = new GDALDriver();
poDriver->SetDescription("PMTiles");
poDriver->SetMetadataItem(GDAL_DCAP_VECTOR, "YES");
poDriver->SetMetadataItem(GDAL_DMD_LONGNAME, "ProtoMap Tiles");
poDriver->SetMetadataItem(GDAL_DMD_EXTENSIONS, "pmtiles");
poDriver->SetMetadataItem(GDAL_DMD_HELPTOPIC,
"drivers/vector/pmtiles.html");
poDriver->SetMetadataItem(
GDAL_DMD_OPENOPTIONLIST,
"<OpenOptionList>"
" <Option name='ZOOM_LEVEL' type='integer' "
"description='Zoom level of full resolution. If not specified, maximum "
"non-empty zoom level'/>"
" <Option name='CLIP' type='boolean' "
"description='Whether to clip geometries to tile extent' "
"default='YES'/>"
" <Option name='ZOOM_LEVEL_AUTO' type='boolean' "
"description='Whether to auto-select the zoom level for vector layers "
"according to spatial filter extent. Only for display purpose' "
"default='NO'/>"
" <Option name='JSON_FIELD' type='boolean' "
"description='For vector layers, "
"whether to put all attributes as a serialized JSon dictionary'/>"
"</OpenOptionList>");
poDriver->SetMetadataItem(GDAL_DCAP_VIRTUALIO, "YES");
poDriver->pfnOpen = OGRPMTilesDriverOpen;
poDriver->pfnIdentify = OGRPMTilesDriverIdentify;
poDriver->pfnCanVectorTranslateFrom =
OGRPMTilesDriverCanVectorTranslateFrom;
poDriver->pfnVectorTranslateFrom = OGRPMTilesDriverVectorTranslateFrom;
#ifdef HAVE_MVT_WRITE_SUPPORT
poDriver->SetMetadataItem(
GDAL_DMD_CREATIONOPTIONLIST,
"<CreationOptionList>"
" <Option name='NAME' scope='raster,vector' type='string' "
"description='Tileset name'/>"
" <Option name='DESCRIPTION' scope='raster,vector' type='string' "
"description='A description of the layer'/>"
" <Option name='TYPE' scope='raster,vector' type='string-select' "
"description='Layer type' default='overlay'>"
" <Value>overlay</Value>"
" <Value>baselayer</Value>"
" </Option>" MVT_MBTILES_PMTILES_COMMON_DSCO "</CreationOptionList>");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE_LAYER, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE_FIELD, "YES");
poDriver->SetMetadataItem(GDAL_DMD_CREATIONFIELDDATATYPES,
"Integer Integer64 Real String");
poDriver->SetMetadataItem(GDAL_DMD_CREATIONFIELDDATASUBTYPES,
"Boolean Float32");
poDriver->SetMetadataItem(GDAL_DS_LAYER_CREATIONOPTIONLIST, MVT_LCO);
poDriver->pfnCreate = OGRPMTilesDriverCreate;
#endif
GetGDALDriverManager()->RegisterDriver(poDriver);
}
| [
"even.rouault@spatialys.com"
] | even.rouault@spatialys.com |
aaf37fc04cb6c98ff0a229ebc85e655b8ed9ed5d | 8dbb7fa86438f47fd441c3b1717b466e687269ad | /CrazyEditer/CrazyEditer/CountString.cpp | 2e656e82e9b349f314dab80bca4cda313d1293d2 | [] | no_license | lihao98722/crazy-editor | 2f1b4dec765050a57a1c7c6dd7175bab346c5739 | 4faff5701c56fd895ed074a912a2ca9ebe3bb8dc | refs/heads/master | 2020-12-31T03:03:02.658124 | 2015-07-11T15:54:49 | 2015-07-11T15:54:49 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,706 | cpp | // CountString.cpp : 实现文件
//
#include "stdafx.h"
#include "CrazyEditer.h"
#include "CountString.h"
#include "afxdialogex.h"
// CCountString 对话框
IMPLEMENT_DYNAMIC(CCountString, CDialogEx)
CCountString::CCountString(CWnd* pParent /*=NULL*/)
: CDialogEx(CCountString::IDD, pParent)
, m_StringToCount(_T(""))
, resultOfCount(0)
{
//默认初始化就行了
}
CCountString::~CCountString()
{
}
void CCountString::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_StringToCount);
DDX_Text(pDX, IDC_EDIT2, resultOfCount);
}
BEGIN_MESSAGE_MAP(CCountString, CDialogEx)
ON_BN_CLICKED(IDCOUNTSTRING, &CCountString::OnBnClickedCountstring)
END_MESSAGE_MAP()
// CCountString 消息处理程序
//获取主编辑区内容
void CCountString::SetText (CString str)
{
text = str;
}
//统计字符串
/*
在查找前,先判断主编辑框以及统计字符串编辑框里的内容; 若主编辑框和统计字符
编辑框里都不为空,则进行查找; 查找时,先找到第一次出现待统计字符串的地方,
然后让计数器+1,接着重新设置查找的起始位置(就是把起始位置设在查找到的字符串出现的
地方之后),一直循环直到查找结束
*/
void CCountString::OnBnClickedCountstring()
{
UpdateData(TRUE); //获取查询编辑框内容
resultOfCount = 0; //统计次数重新归零
int length = m_StringToCount.GetLength(); //待统计String的长度
int totalLength = text.GetLength(); //主编辑框文本的总长度
int i = 0;
int index = 0;
//查找前先判断主编辑框以及统计字符串编辑框里的内容
if(totalLength == 0){ //编辑区无内容
MessageBox("编辑框没有内容!");
resultOfCount = 0;
}
else if(length == 0){ //统计字符串编辑框无内容
MessageBox("请输入您要统计的字符串!");
resultOfCount = 0;
}else{
//循环统计字符个数
for (i = 0,index = 0; index + length < totalLength && index != -1; i = index + 1){
index = text.Find(m_StringToCount, i); //查找字符串
if (index != -1){
resultOfCount ++; //找到则计数加1
if (text.GetAt(index)>255||text.GetAt(index)<0){
index ++; //设置下一个查找位置
}
}
}
}
//查找完成后判断结果
if(totalLength !=0 && length !=0 && resultOfCount == 0){ //如果没有找到任何符合的字符串
MessageBox("您要统计的字符串不在文本中!");
resultOfCount = 0;
}
UpdateData (FALSE); //更新统计结果
}
| [
"lihao98722@gmail.com"
] | lihao98722@gmail.com |
8e683621306a0655c2570055b867740f3c6e96b1 | bfa40191bb6837f635d383d9cd7520160d0b03ac | /LightNote/Source/Core/Graphics/Common/Font/Font.h | b07e0bdfce3006fddd7f69af4711cdeeeaaaf25d | [] | no_license | lriki/LightNote | 87ec6969c16f2919d04fdaac9d0e7ed389f403ad | a38542691d0c7453dd108bcf1d653a08bb1b6b6b | refs/heads/master | 2021-01-10T19:16:33.199071 | 2015-02-01T08:41:06 | 2015-02-01T08:41:06 | 25,684,431 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,032 | h | //==============================================================================
// Font
//------------------------------------------------------------------------------
///**
// @file Font.h
// @brief Font
//*/
//==============================================================================
#pragma once
#include "../../Interface.h"
namespace LNote
{
namespace Core
{
namespace Graphics
{
//==============================================================================
// Font
//------------------------------------------------------------------------------
///**
// @brief
//*/
//==============================================================================
class Font
: public Base::ReferenceObject
{
LN_TYPE_INFO_ACCESS_DECL;
public:
/// フォント名の設定
virtual void setName(const lnChar* fontName) = 0;
/// フォント名の取得
virtual const lnChar* getName() const = 0;
/// フォントサイズの設定
virtual void setSize(lnU32 size) = 0;
/// フォントサイズの取得
virtual lnU32 getSize() const = 0;
/// フォントカラーの設定
virtual void setColor(const LColor& color) = 0;
/// フォントカラーの取得
virtual const LColor& getColor() const = 0;
/// エッジカラーの設定
virtual void setEdgeColor(const LColor& color) = 0;
/// エッジカラーの取得
virtual const LColor& getEdgeColor() const = 0;
/// エッジの幅の設定 (0 でエッジ無効)
virtual void setEdgeSize(lnU32 size) = 0;
/// エッジの幅の取得
virtual lnU32 getEdgeSize() const = 0;
/// 太文字の設定
virtual void setBold(bool flag) = 0;
/// 太文字の判定
virtual bool isBold() const = 0;
/// イタリック体の設定
virtual void setItalic(bool flag) = 0;
/// イタリック体の判定
virtual bool isItalic() const = 0;
/// アンチエイリアスの有効設定
virtual void setAntiAlias(bool flag) = 0;
/// アンチエイリアスの有効判定
virtual bool isAntiAlias() const = 0;
/// 文字列を描画したときのサイズ (ピクセル単位) の取得 (length = -1 で \0 まで)
virtual void getTextSize(const char* text, int length, Geometry::Rect* outRect) = 0;
/// 文字列を描画したときのサイズ (ピクセル単位) の取得 (length = -1 で \0 まで)
virtual void getTextSize(const wchar_t* text, int length, Geometry::Rect* outRect) = 0;
/// このフォントのコピーを作成する
virtual Font* copy() = 0;
/// グリフデータの取得 (最初の文字の場合、prevData に NULL を渡す。以降は戻り値を渡し続ける。非スレッドセーフ)
virtual FontGlyphData* makeGlyphData(lnU32 utf32code, FontGlyphData* prevData) = 0;
/// グリフデータの取得を終了する (メモリ解放。一連の makeGlyphData() を呼び終わった後、最後に呼ぶ)
virtual void postGlyphData(FontGlyphData* glyphData) = 0;
protected:
virtual ~Font() {}
};
} // namespace Graphics
} // namespace Core
} // namespace LNote
| [
"ilys.vianote@gmail.com"
] | ilys.vianote@gmail.com |
63348b44f7e0ece3dd9492c9aff4018c6403cdf0 | 345d9a4ad960c76aab172ea29b7134fd4d6a045c | /src/casinocoin/json/json_forwards.h | 9e596a06e18f27188fd72e636bff5f5cf2458d61 | [
"MIT-Wu",
"MIT",
"ISC",
"BSL-1.0"
] | permissive | ajochems/casinocoind | 7357ee50ad2708b22010c01981e57138806ec67a | 4ec0d39ea1687e724070ed7315c7e1115fc43bce | refs/heads/master | 2020-03-22T21:41:13.940891 | 2019-10-03T18:53:28 | 2019-10-03T18:53:28 | 140,707,219 | 1 | 0 | NOASSERTION | 2019-10-03T18:53:30 | 2018-07-12T11:58:21 | C++ | UTF-8 | C++ | false | false | 1,606 | h | //------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
//==============================================================================
/*
2017-06-30 ajochems Refactored for casinocoin
*/
//==============================================================================
#ifndef CASINOCOIN_JSON_JSON_FORWARDS_H_INCLUDED
#define CASINOCOIN_JSON_JSON_FORWARDS_H_INCLUDED
namespace Json
{
// value.h
using Int = int;
using UInt = unsigned int;
class StaticString;
class Value;
class ValueIteratorBase;
class ValueIterator;
class ValueConstIterator;
} // namespace Json
#endif // JSON_FORWARDS_H_INCLUDED
| [
"andre@jochems.com"
] | andre@jochems.com |
34b413c7c5c309b760717734cc17c9b09f410ff8 | 4fee08e558e77d16ab915f629df74a0574709e8b | /cpsc585/Havok/Common/Base/Math/Vector/Fpu/hkFpuVector4.inl | 8dda2ea6df6cf53c07adc350dba160eb3bebf012 | [] | no_license | NinjaMeTimbers/CPSC-585-Game-Project | c6fe97818ffa69b26e6e4dce622079068f5831cc | 27a0ce3ef6daabb79e7bdfbe7dcd5635bafce390 | refs/heads/master | 2021-01-21T00:55:51.915184 | 2012-04-16T20:06:05 | 2012-04-16T20:06:05 | 3,392,986 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 61,475 | inl | /*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Level 2 and Level 3 source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2011 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
*/
/* quad, here for inlining */
#ifndef HK_DISABLE_MATH_CONSTRUCTORS
HK_FORCE_INLINE hkVector4::hkVector4(hkReal a, hkReal b, hkReal c, hkReal d)
{
m_quad.v[0] = a;
m_quad.v[1] = b;
m_quad.v[2] = c;
m_quad.v[3] = d;
}
HK_FORCE_INLINE hkVector4::hkVector4(const hkQuadReal& q)
{
hkMemUtil::memCpyOneAligned<4*sizeof(hkReal), 16>(&m_quad, &q);
}
HK_FORCE_INLINE hkVector4::hkVector4( const hkVector4& v)
{
hkMemUtil::memCpyOneAligned<4*sizeof(hkReal), 16>(&m_quad, &v.m_quad);
}
#endif
HK_FORCE_INLINE void hkVector4::set(hkReal a, hkReal b, hkReal c, hkReal d)
{
m_quad.v[0] = a;
m_quad.v[1] = b;
m_quad.v[2] = c;
m_quad.v[3] = d;
}
HK_FORCE_INLINE void hkVector4::set( hkSimdRealParameter a, hkSimdRealParameter b, hkSimdRealParameter c, hkSimdRealParameter d )
{
m_quad.v[0] = a.getReal();
m_quad.v[1] = b.getReal();
m_quad.v[2] = c.getReal();
m_quad.v[3] = d.getReal();
}
HK_FORCE_INLINE void hkVector4::setAll(const hkReal& a)
{
m_quad.v[0] = a;
m_quad.v[1] = a;
m_quad.v[2] = a;
m_quad.v[3] = a;
}
HK_FORCE_INLINE void hkVector4::setAll(hkSimdRealParameter a)
{
setAll( a.getReal() );
}
HK_FORCE_INLINE void hkVector4::setZero()
{
m_quad.v[0] = hkReal(0);
m_quad.v[1] = hkReal(0);
m_quad.v[2] = hkReal(0);
m_quad.v[3] = hkReal(0);
}
template <int I>
HK_FORCE_INLINE void hkVector4::zeroComponent()
{
HK_VECTOR4_SUBINDEX_CHECK;
m_quad.v[I] = hkReal(0);
}
HK_FORCE_INLINE void hkVector4::zeroComponent(const int i)
{
HK_ASSERT2(0x3bc36625, (i>=0) && (i<4), "Component index out of range");
m_quad.v[i] = hkReal(0);
}
HK_FORCE_INLINE void hkVector4::setAdd(hkVector4Parameter v0, hkVector4Parameter v1)
{
m_quad.v[0] = v0.m_quad.v[0] + v1.m_quad.v[0];
m_quad.v[1] = v0.m_quad.v[1] + v1.m_quad.v[1];
m_quad.v[2] = v0.m_quad.v[2] + v1.m_quad.v[2];
m_quad.v[3] = v0.m_quad.v[3] + v1.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setSub(hkVector4Parameter v0, hkVector4Parameter v1)
{
m_quad.v[0] = v0.m_quad.v[0] - v1.m_quad.v[0];
m_quad.v[1] = v0.m_quad.v[1] - v1.m_quad.v[1];
m_quad.v[2] = v0.m_quad.v[2] - v1.m_quad.v[2];
m_quad.v[3] = v0.m_quad.v[3] - v1.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setMul(hkVector4Parameter v0, hkVector4Parameter v1)
{
m_quad.v[0] = v0.m_quad.v[0] * v1.m_quad.v[0];
m_quad.v[1] = v0.m_quad.v[1] * v1.m_quad.v[1];
m_quad.v[2] = v0.m_quad.v[2] * v1.m_quad.v[2];
m_quad.v[3] = v0.m_quad.v[3] * v1.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setMul(hkVector4Parameter a, hkSimdRealParameter rs)
{
const hkReal r = rs.getReal();
m_quad.v[0] = r * a.m_quad.v[0];
m_quad.v[1] = r * a.m_quad.v[1];
m_quad.v[2] = r * a.m_quad.v[2];
m_quad.v[3] = r * a.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setSubMul(hkVector4Parameter a, hkVector4Parameter b, hkSimdRealParameter r)
{
const hkReal rr = r.getReal();
m_quad.v[0] = a.m_quad.v[0] - rr * b.m_quad.v[0];
m_quad.v[1] = a.m_quad.v[1] - rr * b.m_quad.v[1];
m_quad.v[2] = a.m_quad.v[2] - rr * b.m_quad.v[2];
m_quad.v[3] = a.m_quad.v[3] - rr * b.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setAddMul(hkVector4Parameter a, hkVector4Parameter b, hkSimdRealParameter r)
{
const hkReal rr = r.getReal();
m_quad.v[0] = a.m_quad.v[0] + rr * b.m_quad.v[0];
m_quad.v[1] = a.m_quad.v[1] + rr * b.m_quad.v[1];
m_quad.v[2] = a.m_quad.v[2] + rr * b.m_quad.v[2];
m_quad.v[3] = a.m_quad.v[3] + rr * b.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setAddMul(hkVector4Parameter a, hkVector4Parameter m0, hkVector4Parameter m1)
{
m_quad.v[0] = a.m_quad.v[0] + m0.m_quad.v[0] * m1.m_quad.v[0];
m_quad.v[1] = a.m_quad.v[1] + m0.m_quad.v[1] * m1.m_quad.v[1];
m_quad.v[2] = a.m_quad.v[2] + m0.m_quad.v[2] * m1.m_quad.v[2];
m_quad.v[3] = a.m_quad.v[3] + m0.m_quad.v[3] * m1.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setSubMul(hkVector4Parameter a, hkVector4Parameter m0, hkVector4Parameter m1)
{
m_quad.v[0] = a.m_quad.v[0] - m0.m_quad.v[0] * m1.m_quad.v[0];
m_quad.v[1] = a.m_quad.v[1] - m0.m_quad.v[1] * m1.m_quad.v[1];
m_quad.v[2] = a.m_quad.v[2] - m0.m_quad.v[2] * m1.m_quad.v[2];
m_quad.v[3] = a.m_quad.v[3] - m0.m_quad.v[3] * m1.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setCross( hkVector4Parameter v1, hkVector4Parameter v2 )
{
const hkReal nx = v1.m_quad.v[1]*v2.m_quad.v[2] - v1.m_quad.v[2]*v2.m_quad.v[1];
const hkReal ny = v1.m_quad.v[2]*v2.m_quad.v[0] - v1.m_quad.v[0]*v2.m_quad.v[2];
const hkReal nz = v1.m_quad.v[0]*v2.m_quad.v[1] - v1.m_quad.v[1]*v2.m_quad.v[0];
set( nx, ny, nz , hkReal(0) );
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::equal(hkVector4Parameter a) const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]==a.m_quad.v[0]) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE) |
((m_quad.v[1]==a.m_quad.v[1]) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE) |
((m_quad.v[2]==a.m_quad.v[2]) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE) |
((m_quad.v[3]==a.m_quad.v[3]) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::notEqual(hkVector4Parameter a) const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]==a.m_quad.v[0]) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_X) |
((m_quad.v[1]==a.m_quad.v[1]) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_Y) |
((m_quad.v[2]==a.m_quad.v[2]) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_Z) |
((m_quad.v[3]==a.m_quad.v[3]) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_W);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::less(hkVector4Parameter a) const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]<a.m_quad.v[0]) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE) |
((m_quad.v[1]<a.m_quad.v[1]) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE) |
((m_quad.v[2]<a.m_quad.v[2]) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE) |
((m_quad.v[3]<a.m_quad.v[3]) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::lessEqual(hkVector4Parameter a) const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]<=a.m_quad.v[0]) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE) |
((m_quad.v[1]<=a.m_quad.v[1]) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE) |
((m_quad.v[2]<=a.m_quad.v[2]) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE) |
((m_quad.v[3]<=a.m_quad.v[3]) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::greater(hkVector4Parameter a) const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]>a.m_quad.v[0]) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE) |
((m_quad.v[1]>a.m_quad.v[1]) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE) |
((m_quad.v[2]>a.m_quad.v[2]) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE) |
((m_quad.v[3]>a.m_quad.v[3]) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::greaterEqual(hkVector4Parameter a) const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]>=a.m_quad.v[0]) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE) |
((m_quad.v[1]>=a.m_quad.v[1]) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE) |
((m_quad.v[2]>=a.m_quad.v[2]) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE) |
((m_quad.v[3]>=a.m_quad.v[3]) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::lessZero() const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]<hkReal(0)) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE) |
((m_quad.v[1]<hkReal(0)) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE) |
((m_quad.v[2]<hkReal(0)) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE) |
((m_quad.v[3]<hkReal(0)) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::lessEqualZero() const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]<=hkReal(0)) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE) |
((m_quad.v[1]<=hkReal(0)) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE) |
((m_quad.v[2]<=hkReal(0)) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE) |
((m_quad.v[3]<=hkReal(0)) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::greaterZero() const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]>hkReal(0)) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE) |
((m_quad.v[1]>hkReal(0)) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE) |
((m_quad.v[2]>hkReal(0)) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE) |
((m_quad.v[3]>hkReal(0)) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::greaterEqualZero() const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]>=hkReal(0)) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE) |
((m_quad.v[1]>=hkReal(0)) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE) |
((m_quad.v[2]>=hkReal(0)) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE) |
((m_quad.v[3]>=hkReal(0)) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::equalZero() const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]==hkReal(0)) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE) |
((m_quad.v[1]==hkReal(0)) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE) |
((m_quad.v[2]==hkReal(0)) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE) |
((m_quad.v[3]==hkReal(0)) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE);
return ret;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::notEqualZero() const
{
hkVector4Comparison ret;
ret.m_mask =
((m_quad.v[0]==hkReal(0)) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_X) |
((m_quad.v[1]==hkReal(0)) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_Y) |
((m_quad.v[2]==hkReal(0)) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_Z) |
((m_quad.v[3]==hkReal(0)) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_W);
return ret;
}
HK_FORCE_INLINE void hkVector4::setSelect( hkVector4ComparisonParameter comp, hkVector4Parameter trueValue, hkVector4Parameter falseValue )
{
m_quad.v[0] = comp.anyIsSet(hkVector4Comparison::MASK_X) ? trueValue.m_quad.v[0] : falseValue.m_quad.v[0];
m_quad.v[1] = comp.anyIsSet(hkVector4Comparison::MASK_Y) ? trueValue.m_quad.v[1] : falseValue.m_quad.v[1];
m_quad.v[2] = comp.anyIsSet(hkVector4Comparison::MASK_Z) ? trueValue.m_quad.v[2] : falseValue.m_quad.v[2];
m_quad.v[3] = comp.anyIsSet(hkVector4Comparison::MASK_W) ? trueValue.m_quad.v[3] : falseValue.m_quad.v[3];
}
template <int N>
HK_FORCE_INLINE void hkVector4::setNeg(hkVector4Parameter v)
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
int i=0;
for (; i<N; ++i) m_quad.v[i] = -v.m_quad.v[i];
for (; i<4; ++i) m_quad.v[i] = v.m_quad.v[i];
}
HK_FORCE_INLINE void hkVector4::setAbs(hkVector4Parameter v)
{
m_quad.v[0] = hkMath::fabs(v.m_quad.v[0]);
m_quad.v[1] = hkMath::fabs(v.m_quad.v[1]);
m_quad.v[2] = hkMath::fabs(v.m_quad.v[2]);
m_quad.v[3] = hkMath::fabs(v.m_quad.v[3]);
}
HK_FORCE_INLINE void hkVector4::setMin(hkVector4Parameter a, hkVector4Parameter b)
{
m_quad.v[0] = hkMath::min2(a.m_quad.v[0], b.m_quad.v[0]);
m_quad.v[1] = hkMath::min2(a.m_quad.v[1], b.m_quad.v[1]);
m_quad.v[2] = hkMath::min2(a.m_quad.v[2], b.m_quad.v[2]);
m_quad.v[3] = hkMath::min2(a.m_quad.v[3], b.m_quad.v[3]);
}
HK_FORCE_INLINE void hkVector4::setMax(hkVector4Parameter a, hkVector4Parameter b)
{
m_quad.v[0] = hkMath::max2(a.m_quad.v[0], b.m_quad.v[0]);
m_quad.v[1] = hkMath::max2(a.m_quad.v[1], b.m_quad.v[1]);
m_quad.v[2] = hkMath::max2(a.m_quad.v[2], b.m_quad.v[2]);
m_quad.v[3] = hkMath::max2(a.m_quad.v[3], b.m_quad.v[3]);
}
HK_FORCE_INLINE void hkVector4::_setRotatedDir(const hkMatrix3& r, hkVector4Parameter v )
{
const hkSimdReal v0 = v.getComponent<0>();
const hkSimdReal v1 = v.getComponent<1>();
const hkSimdReal v2 = v.getComponent<2>();
set(r.getElement<0,0>()*v0 + r.getElement<0,1>()*v1 + r.getElement<0,2>()*v2 ,
r.getElement<1,0>()*v0 + r.getElement<1,1>()*v1 + r.getElement<1,2>()*v2 ,
r.getElement<2,0>()*v0 + r.getElement<2,1>()*v1 + r.getElement<2,2>()*v2 ,
r.getElement<3,0>()*v0 + r.getElement<3,1>()*v1 + r.getElement<3,2>()*v2 ); // needed to conform with SSE processing
}
HK_FORCE_INLINE void hkVector4::_setRotatedInverseDir(const hkMatrix3& r, hkVector4Parameter v )
{
const hkSimdReal v0 = v.getComponent<0>();
const hkSimdReal v1 = v.getComponent<1>();
const hkSimdReal v2 = v.getComponent<2>();
set(r.getElement<0,0>()*v0 + r.getElement<1,0>()*v1 + r.getElement<2,0>()*v2 ,
r.getElement<0,1>()*v0 + r.getElement<1,1>()*v1 + r.getElement<2,1>()*v2 ,
r.getElement<0,2>()*v0 + r.getElement<1,2>()*v1 + r.getElement<2,2>()*v2 ,
r.getElement<0,3>()*v0 + r.getElement<1,3>()*v1 + r.getElement<2,3>()*v2 ); // needed to conform with SSE processing
}
template <int N>
HK_FORCE_INLINE const hkSimdReal hkVector4::dot(hkVector4Parameter a) const
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkReal sum = hkReal(0);
for (int i=0; i<N; ++i) sum += (m_quad.v[i] * a.m_quad.v[i]);
return hkSimdReal::convert(sum);
}
HK_FORCE_INLINE const hkSimdReal hkVector4::dot4xyz1(hkVector4Parameter a) const
{
return hkSimdReal::convert( (m_quad.v[0] * a.m_quad.v[0]) +
(m_quad.v[1] * a.m_quad.v[1]) +
(m_quad.v[2] * a.m_quad.v[2]) +
m_quad.v[3] );
}
template <int N>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalAdd() const
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkReal sum = hkReal(0);
for (int i=0; i<N; ++i) sum += m_quad.v[i];
return hkSimdReal::convert(sum);
}
template <>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalMax<1>() const
{
return getComponent<0>();
}
template <>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalMax<2>() const
{
return hkSimdReal::convert(hkMath::max2(m_quad.v[0], m_quad.v[1]));
}
template <>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalMax<3>() const
{
const hkReal m = hkMath::max2(m_quad.v[0], m_quad.v[1]);
return hkSimdReal::convert(hkMath::max2(m, m_quad.v[2]));
}
template <>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalMax<4>() const
{
const hkReal ma = hkMath::max2(m_quad.v[0], m_quad.v[1]);
const hkReal mb = hkMath::max2(m_quad.v[2], m_quad.v[3]);
return hkSimdReal::convert(hkMath::max2(ma, mb));
}
template <int N>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalMax() const
{
HK_VECTOR4_NOT_IMPLEMENTED;
return hkSimdReal::getConstant<HK_QUADREAL_0>();
}
template <>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalMin<1>() const
{
return getComponent<0>();
}
template <>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalMin<2>() const
{
return hkSimdReal::convert(hkMath::min2(m_quad.v[0], m_quad.v[1]));
}
template <>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalMin<3>() const
{
const hkReal m = hkMath::min2(m_quad.v[0], m_quad.v[1]);
return hkSimdReal::convert(hkMath::min2(m, m_quad.v[2]));
}
template <>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalMin<4>() const
{
const hkReal ma = hkMath::min2(m_quad.v[0], m_quad.v[1]);
const hkReal mb = hkMath::min2(m_quad.v[2], m_quad.v[3]);
return hkSimdReal::convert(hkMath::min2(ma, mb));
}
template <int N>
HK_FORCE_INLINE const hkSimdReal hkVector4::horizontalMin() const
{
HK_VECTOR4_NOT_IMPLEMENTED;
return hkSimdReal::getConstant<HK_QUADREAL_0>();
}
/* operator () */
HK_FORCE_INLINE hkReal& hkVector4::operator() (int a)
{
HK_ASSERT2(0x6d0c31d7, a>=0 && a<4, "index out of bounds for component access");
return m_quad.v[a];
}
HK_FORCE_INLINE const hkReal& hkVector4::operator() (int a) const
{
HK_ASSERT2(0x6d0c31d7, a>=0 && a<4, "index out of bounds for component access");
return const_cast<const hkReal&>(m_quad.v[a]);
}
HK_FORCE_INLINE void hkVector4::setXYZ_W(hkVector4Parameter xyz, hkVector4Parameter ww)
{
m_quad.v[0] = xyz.m_quad.v[0];
m_quad.v[1] = xyz.m_quad.v[1];
m_quad.v[2] = xyz.m_quad.v[2];
m_quad.v[3] = ww.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setXYZ_W(hkVector4Parameter xyz, hkSimdRealParameter ww)
{
m_quad.v[0] = xyz.m_quad.v[0];
m_quad.v[1] = xyz.m_quad.v[1];
m_quad.v[2] = xyz.m_quad.v[2];
m_quad.v[3] = ww.getReal();
}
HK_FORCE_INLINE void hkVector4::setW(hkVector4Parameter w)
{
m_quad.v[3] = w.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setXYZ(hkVector4Parameter xyz)
{
m_quad.v[0] = xyz.m_quad.v[0];
m_quad.v[1] = xyz.m_quad.v[1];
m_quad.v[2] = xyz.m_quad.v[2];
}
HK_FORCE_INLINE void hkVector4::addXYZ(hkVector4Parameter xyz)
{
m_quad.v[0] += xyz.m_quad.v[0];
m_quad.v[1] += xyz.m_quad.v[1];
m_quad.v[2] += xyz.m_quad.v[2];
#if defined(HK_REAL_IS_DOUBLE)
HK_ON_DEBUG( *((hkUint64*)&(m_quad.v[3])) = 0xffffffffffffffffull; )
#else
HK_ON_DEBUG( *((hkUint32*)&(m_quad.v[3])) = 0xffffffff; )
#endif
}
HK_FORCE_INLINE void hkVector4::subXYZ(hkVector4Parameter xyz)
{
m_quad.v[0] -= xyz.m_quad.v[0];
m_quad.v[1] -= xyz.m_quad.v[1];
m_quad.v[2] -= xyz.m_quad.v[2];
#if defined(HK_REAL_IS_DOUBLE)
HK_ON_DEBUG( *((hkUint64*)&(m_quad.v[3])) = 0xffffffffffffffffull; )
#else
HK_ON_DEBUG( *((hkUint32*)&(m_quad.v[3])) = 0xffffffff; )
#endif
}
HK_FORCE_INLINE void hkVector4::setXYZ(hkReal v)
{
m_quad.v[0] = v;
m_quad.v[1] = v;
m_quad.v[2] = v;
}
HK_FORCE_INLINE void hkVector4::setXYZ(hkSimdRealParameter vv)
{
setXYZ( vv.getReal() );
}
HK_FORCE_INLINE void hkVector4::setXYZ_0(hkVector4Parameter xyz)
{
setXYZ( xyz );
m_quad.v[3] = hkReal(0);
}
HK_FORCE_INLINE void hkVector4::setBroadcastXYZ(const int i, hkVector4Parameter v)
{
setXYZ( v.m_quad.v[i] );
#if defined(HK_REAL_IS_DOUBLE)
HK_ON_DEBUG( *((hkUint64*)&(m_quad.v[3])) = 0xffffffffffffffffull; )
#else
HK_ON_DEBUG( *((hkUint32*)&(m_quad.v[3])) = 0xffffffff; )
#endif
}
HK_FORCE_INLINE const hkSimdReal hkVector4::getComponent(const int i) const
{
HK_ASSERT2(0x6d0c31d7, i>=0 && i<4, "index out of bounds for component access");
return hkSimdReal::convert(m_quad.v[i]);
}
template <int I>
HK_FORCE_INLINE const hkSimdReal hkVector4::getComponent() const
{
HK_VECTOR4_SUBINDEX_CHECK;
return hkSimdReal::convert(m_quad.v[I]);
}
HK_FORCE_INLINE void hkVector4::setComponent(const int i, hkSimdRealParameter val)
{
HK_ASSERT2(0x6d0c31d7, i>=0 && i<4, "index out of bounds for component access");
m_quad.v[i] = val.getReal();
}
template <int I>
HK_FORCE_INLINE void hkVector4::setComponent(hkSimdRealParameter val)
{
HK_VECTOR4_SUBINDEX_CHECK;
m_quad.v[I] = val.getReal();
}
HK_FORCE_INLINE void hkVector4::reduceToHalfPrecision()
{
static const hkUint32 precisionMask = 0xffff0000;
const hkUint32* src = reinterpret_cast<const hkUint32*>( &m_quad );
hkUint32* dest = reinterpret_cast<hkUint32*>( &m_quad );
dest[0] = src[0] & precisionMask;
dest[1] = src[1] & precisionMask;
dest[2] = src[2] & precisionMask;
dest[3] = src[3] & precisionMask;
}
template <int N>
HK_FORCE_INLINE hkBool32 hkVector4::isOk() const
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
for(int i=0; i<N; ++i)
{
if (!hkMath::isFinite(m_quad.v[i]))
{
return false;
}
}
return true;
}
template <>
HK_FORCE_INLINE void hkVector4::setPermutation<hkVectorPermutation::XYZW>(hkVector4Parameter v)
{
m_quad = v.m_quad;
}
template <hkVectorPermutation::Permutation P>
HK_FORCE_INLINE void hkVector4::setPermutation(hkVector4Parameter v)
{
// Store in regs before writing to the destination - to handle case when v and this are the same
const hkReal t0 = v.m_quad.v[(P & 0x3000) >> 12];
const hkReal t1 = v.m_quad.v[(P & 0x0300) >> 8];
const hkReal t2 = v.m_quad.v[(P & 0x0030) >> 4];
const hkReal t3 = v.m_quad.v[(P & 0x0003) >> 0];
m_quad.v[0] = t0;
m_quad.v[1] = t1;
m_quad.v[2] = t2;
m_quad.v[3] = t3;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::signBitSet() const
{
hkVector4Comparison mask;
mask.m_mask = hkVector4Comparison::MASK_NONE;
mask.m_mask |= hkMath::signBitSet(m_quad.v[0]) ? hkVector4Comparison::MASK_X : hkVector4Comparison::MASK_NONE;
mask.m_mask |= hkMath::signBitSet(m_quad.v[1]) ? hkVector4Comparison::MASK_Y : hkVector4Comparison::MASK_NONE;
mask.m_mask |= hkMath::signBitSet(m_quad.v[2]) ? hkVector4Comparison::MASK_Z : hkVector4Comparison::MASK_NONE;
mask.m_mask |= hkMath::signBitSet(m_quad.v[3]) ? hkVector4Comparison::MASK_W : hkVector4Comparison::MASK_NONE;
return mask;
}
HK_FORCE_INLINE const hkVector4Comparison hkVector4::signBitClear() const
{
hkVector4Comparison mask;
mask.m_mask = hkVector4Comparison::MASK_NONE;
mask.m_mask |= hkMath::signBitSet(m_quad.v[0]) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_X;
mask.m_mask |= hkMath::signBitSet(m_quad.v[1]) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_Y;
mask.m_mask |= hkMath::signBitSet(m_quad.v[2]) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_Z;
mask.m_mask |= hkMath::signBitSet(m_quad.v[3]) ? hkVector4Comparison::MASK_NONE : hkVector4Comparison::MASK_W;
return mask;
}
HK_FORCE_INLINE void hkVector4::setFlipSign(hkVector4Parameter v, hkVector4ComparisonParameter mask)
{
m_quad.v[0] = mask.anyIsSet(hkVector4Comparison::MASK_X) ? -v.m_quad.v[0] : v.m_quad.v[0];
m_quad.v[1] = mask.anyIsSet(hkVector4Comparison::MASK_Y) ? -v.m_quad.v[1] : v.m_quad.v[1];
m_quad.v[2] = mask.anyIsSet(hkVector4Comparison::MASK_Z) ? -v.m_quad.v[2] : v.m_quad.v[2];
m_quad.v[3] = mask.anyIsSet(hkVector4Comparison::MASK_W) ? -v.m_quad.v[3] : v.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setFlipSign(hkVector4Parameter a, hkVector4Parameter signs)
{
m_quad.v[0] = hkMath::signBitSet(signs.m_quad.v[0]) ? -a.m_quad.v[0] : a.m_quad.v[0];
m_quad.v[1] = hkMath::signBitSet(signs.m_quad.v[1]) ? -a.m_quad.v[1] : a.m_quad.v[1];
m_quad.v[2] = hkMath::signBitSet(signs.m_quad.v[2]) ? -a.m_quad.v[2] : a.m_quad.v[2];
m_quad.v[3] = hkMath::signBitSet(signs.m_quad.v[3]) ? -a.m_quad.v[3] : a.m_quad.v[3];
}
HK_FORCE_INLINE void hkVector4::setFlipSign(hkVector4Parameter a, hkSimdRealParameter sharedSign)
{
const bool flip = hkMath::signBitSet(sharedSign.getReal());
if (flip)
{
m_quad.v[0] = -a.m_quad.v[0];
m_quad.v[1] = -a.m_quad.v[1];
m_quad.v[2] = -a.m_quad.v[2];
m_quad.v[3] = -a.m_quad.v[3];
}
else
{
hkMemUtil::memCpyOneAligned<4*sizeof(hkReal), 16>(&m_quad, &a.m_quad);
}
}
//
// advanced interface
//
namespace hkVector4_AdvancedInterface
{
template <hkMathAccuracyMode A, hkMathDivByZeroMode D>
struct unroll_setReciprocal { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
HK_VECTOR4_TEMPLATE_CONFIG_NOT_IMPLEMENTED;
} };
template <hkMathAccuracyMode A>
struct unroll_setReciprocal<A, HK_DIV_IGNORE> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[0])));
self.v[1] = hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[1])));
self.v[2] = hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[2])));
self.v[3] = hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[3])));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[0])));
self.v[1] = hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[1])));
self.v[2] = hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[2])));
self.v[3] = hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[3])));
}
break;
default:
{
self.v[0] = hkReal(1) / a.m_quad.v[0];
self.v[1] = hkReal(1) / a.m_quad.v[1];
self.v[2] = hkReal(1) / a.m_quad.v[2];
self.v[3] = hkReal(1) / a.m_quad.v[3];
}
break; // HK_ACC_FULL
}
} };
template <hkMathAccuracyMode A>
struct unroll_setReciprocal<A, HK_DIV_SET_ZERO> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = ((a.m_quad.v[0] == hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[0]))));
self.v[1] = ((a.m_quad.v[1] == hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[1]))));
self.v[2] = ((a.m_quad.v[2] == hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[2]))));
self.v[3] = ((a.m_quad.v[3] == hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[3]))));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = ((a.m_quad.v[0] == hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[0]))));
self.v[1] = ((a.m_quad.v[1] == hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[1]))));
self.v[2] = ((a.m_quad.v[2] == hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[2]))));
self.v[3] = ((a.m_quad.v[3] == hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[3]))));
}
break;
default:
{
self.v[0] = ((a.m_quad.v[0] == hkReal(0)) ? hkReal(0) : hkReal(1) / a.m_quad.v[0]);
self.v[1] = ((a.m_quad.v[1] == hkReal(0)) ? hkReal(0) : hkReal(1) / a.m_quad.v[1]);
self.v[2] = ((a.m_quad.v[2] == hkReal(0)) ? hkReal(0) : hkReal(1) / a.m_quad.v[2]);
self.v[3] = ((a.m_quad.v[3] == hkReal(0)) ? hkReal(0) : hkReal(1) / a.m_quad.v[3]);
}
break; // HK_ACC_FULL
}
} };
template <hkMathAccuracyMode A>
struct unroll_setReciprocal<A, HK_DIV_SET_HIGH> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = ((a.m_quad.v[0] == hkReal(0)) ? HK_REAL_HIGH : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[0]))));
self.v[1] = ((a.m_quad.v[1] == hkReal(0)) ? HK_REAL_HIGH : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[1]))));
self.v[2] = ((a.m_quad.v[2] == hkReal(0)) ? HK_REAL_HIGH : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[2]))));
self.v[3] = ((a.m_quad.v[3] == hkReal(0)) ? HK_REAL_HIGH : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[3]))));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = ((a.m_quad.v[0] == hkReal(0)) ? HK_REAL_HIGH : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[0]))));
self.v[1] = ((a.m_quad.v[1] == hkReal(0)) ? HK_REAL_HIGH : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[1]))));
self.v[2] = ((a.m_quad.v[2] == hkReal(0)) ? HK_REAL_HIGH : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[2]))));
self.v[3] = ((a.m_quad.v[3] == hkReal(0)) ? HK_REAL_HIGH : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[3]))));
}
break;
default:
{
self.v[0] = ((a.m_quad.v[0] == hkReal(0)) ? HK_REAL_HIGH : hkReal(1) / a.m_quad.v[0]);
self.v[1] = ((a.m_quad.v[1] == hkReal(0)) ? HK_REAL_HIGH : hkReal(1) / a.m_quad.v[1]);
self.v[2] = ((a.m_quad.v[2] == hkReal(0)) ? HK_REAL_HIGH : hkReal(1) / a.m_quad.v[2]);
self.v[3] = ((a.m_quad.v[3] == hkReal(0)) ? HK_REAL_HIGH : hkReal(1) / a.m_quad.v[3]);
}
break; // HK_ACC_FULL
}
} };
template <hkMathAccuracyMode A>
struct unroll_setReciprocal<A, HK_DIV_SET_MAX> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = ((a.m_quad.v[0] == hkReal(0)) ? HK_REAL_MAX : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[0]))));
self.v[1] = ((a.m_quad.v[1] == hkReal(0)) ? HK_REAL_MAX : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[1]))));
self.v[2] = ((a.m_quad.v[2] == hkReal(0)) ? HK_REAL_MAX : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[2]))));
self.v[3] = ((a.m_quad.v[3] == hkReal(0)) ? HK_REAL_MAX : hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(a.m_quad.v[3]))));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = ((a.m_quad.v[0] == hkReal(0)) ? HK_REAL_MAX : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[0]))));
self.v[1] = ((a.m_quad.v[1] == hkReal(0)) ? HK_REAL_MAX : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[1]))));
self.v[2] = ((a.m_quad.v[2] == hkReal(0)) ? HK_REAL_MAX : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[2]))));
self.v[3] = ((a.m_quad.v[3] == hkReal(0)) ? HK_REAL_MAX : hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(a.m_quad.v[3]))));
}
break;
default:
{
self.v[0] = ((a.m_quad.v[0] == hkReal(0)) ? HK_REAL_MAX : hkReal(1) / a.m_quad.v[0]);
self.v[1] = ((a.m_quad.v[1] == hkReal(0)) ? HK_REAL_MAX : hkReal(1) / a.m_quad.v[1]);
self.v[2] = ((a.m_quad.v[2] == hkReal(0)) ? HK_REAL_MAX : hkReal(1) / a.m_quad.v[2]);
self.v[3] = ((a.m_quad.v[3] == hkReal(0)) ? HK_REAL_MAX : hkReal(1) / a.m_quad.v[3]);
}
break; // HK_ACC_FULL
}
} };
template <hkMathAccuracyMode A>
struct unroll_setReciprocal<A, HK_DIV_SET_ZERO_AND_ONE> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
hkQuadReal val; unroll_setReciprocal<A, HK_DIV_SET_ZERO>::apply(val,a);
hkQuadReal absValLessOne;
absValLessOne.v[0] = hkMath::fabs(val.v[0]) - hkReal(1);
absValLessOne.v[1] = hkMath::fabs(val.v[1]) - hkReal(1);
absValLessOne.v[2] = hkMath::fabs(val.v[2]) - hkReal(1);
absValLessOne.v[3] = hkMath::fabs(val.v[3]) - hkReal(1);
self.v[0] = ((absValLessOne.v[0] <= HK_REAL_EPSILON) ? hkReal(1) : val.v[0]);
self.v[1] = ((absValLessOne.v[1] <= HK_REAL_EPSILON) ? hkReal(1) : val.v[1]);
self.v[2] = ((absValLessOne.v[2] <= HK_REAL_EPSILON) ? hkReal(1) : val.v[2]);
self.v[3] = ((absValLessOne.v[3] <= HK_REAL_EPSILON) ? hkReal(1) : val.v[3]);
} };
} // namespace
template <hkMathAccuracyMode A, hkMathDivByZeroMode D>
HK_FORCE_INLINE void hkVector4::setReciprocal(hkVector4Parameter v)
{
hkVector4_AdvancedInterface::unroll_setReciprocal<A,D>::apply(m_quad,v);
}
HK_FORCE_INLINE void hkVector4::setReciprocal(hkVector4Parameter v)
{
hkVector4_AdvancedInterface::unroll_setReciprocal<HK_ACC_23_BIT,HK_DIV_IGNORE>::apply(m_quad,v);
}
namespace hkVector4_AdvancedInterface
{
template <hkMathAccuracyMode A, hkMathDivByZeroMode D>
struct unroll_setDiv { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a, hkVector4Parameter b)
{
HK_VECTOR4_TEMPLATE_CONFIG_NOT_IMPLEMENTED;
} };
template <hkMathAccuracyMode A>
struct unroll_setDiv<A, HK_DIV_IGNORE> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a, hkVector4Parameter b)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = a.m_quad.v[0] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[0])));
self.v[1] = a.m_quad.v[1] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[1])));
self.v[2] = a.m_quad.v[2] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[2])));
self.v[3] = a.m_quad.v[3] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[3])));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = a.m_quad.v[0] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[0])));
self.v[1] = a.m_quad.v[1] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[1])));
self.v[2] = a.m_quad.v[2] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[2])));
self.v[3] = a.m_quad.v[3] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[3])));
}
break;
default:
{
self.v[0] = a.m_quad.v[0] / b.m_quad.v[0];
self.v[1] = a.m_quad.v[1] / b.m_quad.v[1];
self.v[2] = a.m_quad.v[2] / b.m_quad.v[2];
self.v[3] = a.m_quad.v[3] / b.m_quad.v[3];
}
break; // HK_ACC_FULL
}
} };
template <hkMathAccuracyMode A>
struct unroll_setDiv<A, HK_DIV_SET_ZERO> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a, hkVector4Parameter b)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = ((b.m_quad.v[0] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[0] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[0])))));
self.v[1] = ((b.m_quad.v[1] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[1] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[1])))));
self.v[2] = ((b.m_quad.v[2] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[2] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[2])))));
self.v[3] = ((b.m_quad.v[3] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[3] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[3])))));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = ((b.m_quad.v[0] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[0] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[0])))));
self.v[1] = ((b.m_quad.v[1] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[1] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[1])))));
self.v[2] = ((b.m_quad.v[2] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[2] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[2])))));
self.v[3] = ((b.m_quad.v[3] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[3] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[3])))));
}
break;
default:
{
self.v[0] = ((b.m_quad.v[0] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[0] / b.m_quad.v[0]));
self.v[1] = ((b.m_quad.v[1] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[1] / b.m_quad.v[1]));
self.v[2] = ((b.m_quad.v[2] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[2] / b.m_quad.v[2]));
self.v[3] = ((b.m_quad.v[3] == hkReal(0)) ? hkReal(0) : (a.m_quad.v[3] / b.m_quad.v[3]));
}
break; // HK_ACC_FULL
}
} };
template <hkMathAccuracyMode A>
struct unroll_setDiv<A, HK_DIV_SET_HIGH> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a, hkVector4Parameter b)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = ((b.m_quad.v[0] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[0] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[0])))));
self.v[1] = ((b.m_quad.v[1] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[1] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[1])))));
self.v[2] = ((b.m_quad.v[2] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[2] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[2])))));
self.v[3] = ((b.m_quad.v[3] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[3] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[3])))));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = ((b.m_quad.v[0] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[0] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[0])))));
self.v[1] = ((b.m_quad.v[1] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[1] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[1])))));
self.v[2] = ((b.m_quad.v[2] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[2] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[2])))));
self.v[3] = ((b.m_quad.v[3] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[3] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[3])))));
}
break;
default:
{
self.v[0] = ((b.m_quad.v[0] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[0] / b.m_quad.v[0]));
self.v[1] = ((b.m_quad.v[1] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[1] / b.m_quad.v[1]));
self.v[2] = ((b.m_quad.v[2] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[2] / b.m_quad.v[2]));
self.v[3] = ((b.m_quad.v[3] == hkReal(0)) ? HK_REAL_HIGH : (a.m_quad.v[3] / b.m_quad.v[3]));
}
break; // HK_ACC_FULL
}
} };
template <hkMathAccuracyMode A>
struct unroll_setDiv<A, HK_DIV_SET_MAX> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a, hkVector4Parameter b)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = ((b.m_quad.v[0] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[0] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[0])))));
self.v[1] = ((b.m_quad.v[1] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[1] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[1])))));
self.v[2] = ((b.m_quad.v[2] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[2] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[2])))));
self.v[3] = ((b.m_quad.v[3] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[3] * hkReal(hkMath::rcpF32Approx23Bit(hkFloat32(b.m_quad.v[3])))));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = ((b.m_quad.v[0] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[0] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[0])))));
self.v[1] = ((b.m_quad.v[1] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[1] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[1])))));
self.v[2] = ((b.m_quad.v[2] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[2] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[2])))));
self.v[3] = ((b.m_quad.v[3] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[3] * hkReal(hkMath::rcpF32Approx12Bit(hkFloat32(b.m_quad.v[3])))));
}
break;
default:
{
self.v[0] = ((b.m_quad.v[0] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[0] / b.m_quad.v[0]));
self.v[1] = ((b.m_quad.v[1] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[1] / b.m_quad.v[1]));
self.v[2] = ((b.m_quad.v[2] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[2] / b.m_quad.v[2]));
self.v[3] = ((b.m_quad.v[3] == hkReal(0)) ? HK_REAL_MAX : (a.m_quad.v[3] / b.m_quad.v[3]));
}
break; // HK_ACC_FULL
}
} };
} // namespace
template <hkMathAccuracyMode A, hkMathDivByZeroMode D>
HK_FORCE_INLINE void hkVector4::setDiv(hkVector4Parameter v0, hkVector4Parameter v1)
{
hkVector4_AdvancedInterface::unroll_setDiv<A,D>::apply(m_quad,v0,v1);
}
HK_FORCE_INLINE void hkVector4::setDiv(hkVector4Parameter v0, hkVector4Parameter v1)
{
hkVector4_AdvancedInterface::unroll_setDiv<HK_ACC_23_BIT,HK_DIV_IGNORE>::apply(m_quad,v0,v1);
}
template <hkMathAccuracyMode A, hkMathDivByZeroMode D>
HK_FORCE_INLINE void hkVector4::div(hkVector4Parameter a)
{
setDiv<A,D>( *this, a );
}
HK_FORCE_INLINE void hkVector4::div(hkVector4Parameter a)
{
setDiv( *this, a );
}
namespace hkVector4_AdvancedInterface
{
template <hkMathAccuracyMode A, hkMathNegSqrtMode S>
struct unroll_setSqrt { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
HK_VECTOR4_TEMPLATE_CONFIG_NOT_IMPLEMENTED;
} };
template <hkMathAccuracyMode A>
struct unroll_setSqrt<A, HK_SQRT_IGNORE> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = hkReal(hkMath::rcpF32Approx23Bit(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[0]))));
self.v[1] = hkReal(hkMath::rcpF32Approx23Bit(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[1]))));
self.v[2] = hkReal(hkMath::rcpF32Approx23Bit(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[2]))));
self.v[3] = hkReal(hkMath::rcpF32Approx23Bit(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[3]))));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = hkReal(hkMath::rcpF32Approx12Bit(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[0]))));
self.v[1] = hkReal(hkMath::rcpF32Approx12Bit(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[1]))));
self.v[2] = hkReal(hkMath::rcpF32Approx12Bit(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[2]))));
self.v[3] = hkReal(hkMath::rcpF32Approx12Bit(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[3]))));
}
break;
default:
{
self.v[0] = hkMath::sqrt(a.m_quad.v[0]);
self.v[1] = hkMath::sqrt(a.m_quad.v[1]);
self.v[2] = hkMath::sqrt(a.m_quad.v[2]);
self.v[3] = hkMath::sqrt(a.m_quad.v[3]);
}
break; // HK_ACC_FULL
}
} };
template <hkMathAccuracyMode A>
struct unroll_setSqrt<A, HK_SQRT_SET_ZERO> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = ((a.m_quad.v[0] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx23Bit(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[0])))));
self.v[1] = ((a.m_quad.v[1] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx23Bit(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[1])))));
self.v[2] = ((a.m_quad.v[2] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx23Bit(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[2])))));
self.v[3] = ((a.m_quad.v[3] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx23Bit(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[3])))));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = ((a.m_quad.v[0] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx12Bit(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[0])))));
self.v[1] = ((a.m_quad.v[1] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx12Bit(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[1])))));
self.v[2] = ((a.m_quad.v[2] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx12Bit(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[2])))));
self.v[3] = ((a.m_quad.v[3] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::rcpF32Approx12Bit(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[3])))));
}
break;
default:
{
self.v[0] = ((a.m_quad.v[0] <= hkReal(0)) ? hkReal(0) : hkMath::sqrt(a.m_quad.v[0]));
self.v[1] = ((a.m_quad.v[1] <= hkReal(0)) ? hkReal(0) : hkMath::sqrt(a.m_quad.v[1]));
self.v[2] = ((a.m_quad.v[2] <= hkReal(0)) ? hkReal(0) : hkMath::sqrt(a.m_quad.v[2]));
self.v[3] = ((a.m_quad.v[3] <= hkReal(0)) ? hkReal(0) : hkMath::sqrt(a.m_quad.v[3]));
}
break; // HK_ACC_FULL
}
} };
} // namespace
template <hkMathAccuracyMode A, hkMathNegSqrtMode S>
HK_FORCE_INLINE void hkVector4::setSqrt(hkVector4Parameter a)
{
hkVector4_AdvancedInterface::unroll_setSqrt<A,S>::apply(m_quad, a);
}
HK_FORCE_INLINE void hkVector4::setSqrt(hkVector4Parameter a)
{
hkVector4_AdvancedInterface::unroll_setSqrt<HK_ACC_23_BIT,HK_SQRT_SET_ZERO>::apply(m_quad, a);
}
namespace hkVector4_AdvancedInterface
{
template <hkMathAccuracyMode A, hkMathNegSqrtMode S>
struct unroll_setSqrtInverse { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
HK_VECTOR4_TEMPLATE_CONFIG_NOT_IMPLEMENTED;
} };
template <hkMathAccuracyMode A>
struct unroll_setSqrtInverse<A, HK_SQRT_IGNORE> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = hkReal(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[0])));
self.v[1] = hkReal(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[1])));
self.v[2] = hkReal(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[2])));
self.v[3] = hkReal(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[3])));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = hkReal(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[0])));
self.v[1] = hkReal(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[1])));
self.v[2] = hkReal(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[2])));
self.v[3] = hkReal(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[3])));
}
break;
default:
{
self.v[0] = hkMath::sqrtInverse(a.m_quad.v[0]);
self.v[1] = hkMath::sqrtInverse(a.m_quad.v[1]);
self.v[2] = hkMath::sqrtInverse(a.m_quad.v[2]);
self.v[3] = hkMath::sqrtInverse(a.m_quad.v[3]);
}
break; // HK_ACC_FULL
}
} };
template <hkMathAccuracyMode A>
struct unroll_setSqrtInverse<A, HK_SQRT_SET_ZERO> { HK_FORCE_INLINE static void apply(hkQuadReal& self, hkVector4Parameter a)
{
switch (A)
{
case HK_ACC_23_BIT:
{
self.v[0] = ((a.m_quad.v[0] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[0]))));
self.v[1] = ((a.m_quad.v[1] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[1]))));
self.v[2] = ((a.m_quad.v[2] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[2]))));
self.v[3] = ((a.m_quad.v[3] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::invSqrtF32Approx23Bit(hkFloat32(a.m_quad.v[3]))));
}
break;
case HK_ACC_12_BIT:
{
self.v[0] = ((a.m_quad.v[0] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[0]))));
self.v[1] = ((a.m_quad.v[1] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[1]))));
self.v[2] = ((a.m_quad.v[2] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[2]))));
self.v[3] = ((a.m_quad.v[3] <= hkReal(0)) ? hkReal(0) : hkReal(hkMath::invSqrtF32Approx12Bit(hkFloat32(a.m_quad.v[3]))));
}
break;
default:
{
self.v[0] = ((a.m_quad.v[0] <= hkReal(0)) ? hkReal(0) : hkMath::sqrtInverse(a.m_quad.v[0]));
self.v[1] = ((a.m_quad.v[1] <= hkReal(0)) ? hkReal(0) : hkMath::sqrtInverse(a.m_quad.v[1]));
self.v[2] = ((a.m_quad.v[2] <= hkReal(0)) ? hkReal(0) : hkMath::sqrtInverse(a.m_quad.v[2]));
self.v[3] = ((a.m_quad.v[3] <= hkReal(0)) ? hkReal(0) : hkMath::sqrtInverse(a.m_quad.v[3]));
}
break; // HK_ACC_FULL
}
} };
} // namespace
template <hkMathAccuracyMode A, hkMathNegSqrtMode S>
HK_FORCE_INLINE void hkVector4::setSqrtInverse(hkVector4Parameter a)
{
hkVector4_AdvancedInterface::unroll_setSqrtInverse<A,S>::apply(m_quad, a);
}
HK_FORCE_INLINE void hkVector4::setSqrtInverse(hkVector4Parameter a)
{
hkVector4_AdvancedInterface::unroll_setSqrtInverse<HK_ACC_23_BIT,HK_SQRT_SET_ZERO>::apply(m_quad, a);
}
namespace hkVector4_AdvancedInterface
{
template <int N, hkMathIoMode A>
struct unroll_load { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkReal* HK_RESTRICT p)
{
HK_VECTOR4_TEMPLATE_CONFIG_NOT_IMPLEMENTED;
} };
template <int N>
struct unroll_load<N, HK_IO_BYTE_ALIGNED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkReal* HK_RESTRICT p)
{
hkMemUtil::memCpy(&self, p, N*sizeof(hkReal));
#if defined(HK_DEBUG)
#if defined(HK_REAL_IS_DOUBLE)
for(int i=N; i<4; ++i) *((hkUint64*)&(self.v[i])) = 0xffffffffffffffffull;
#else
for(int i=N; i<4; ++i) *((hkUint32*)&(self.v[i])) = 0xffffffff;
#endif
#endif
} };
template <int N>
struct unroll_load<N, HK_IO_NATIVE_ALIGNED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkReal* HK_RESTRICT p)
{
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & (sizeof(hkReal)-1) ) == 0, "pointer must be aligned to native size of hkReal.");
hkMemUtil::memCpy<sizeof(hkReal)>(&self, p, N*sizeof(hkReal));
#if defined(HK_DEBUG)
#if defined(HK_REAL_IS_DOUBLE)
for(int i=N; i<4; ++i) *((hkUint64*)&(self.v[i])) = 0xffffffffffffffffull;
#else
for(int i=N; i<4; ++i) *((hkUint32*)&(self.v[i])) = 0xffffffff;
#endif
#endif
} };
template <int N>
struct unroll_load<N, HK_IO_SIMD_ALIGNED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkReal* HK_RESTRICT p)
{
#if !defined(HK_PLATFORM_IOS)
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & ((sizeof(hkReal)*(N!=3?N:4) )-1) ) == 0, "pointer must be aligned for SIMD.");
#endif
switch (N)
{
case 4:
{
hkMemUtil::memCpyOneAligned<4*sizeof(hkReal), 16>(&self, p);
}
break;
default:
{
unroll_load<N, HK_IO_NATIVE_ALIGNED>::apply(self,p);
}
break;
}
} };
template <int N>
struct unroll_load<N, HK_IO_NOT_CACHED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkReal* HK_RESTRICT p)
{
unroll_load<N, HK_IO_SIMD_ALIGNED>::apply(self,p);
} };
} // namespace
template <int N, hkMathIoMode A>
HK_FORCE_INLINE void hkVector4::load(const hkReal* p)
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_load<N,A>::apply(m_quad, p);
}
template <int N>
HK_FORCE_INLINE void hkVector4::load(const hkReal* p)
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_load<N,HK_IO_SIMD_ALIGNED>::apply(m_quad, p);
}
namespace hkVector4_AdvancedInterface
{
template <int N, hkMathIoMode A>
struct unroll_loadH { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkHalf* HK_RESTRICT p)
{
HK_VECTOR4_TEMPLATE_CONFIG_NOT_IMPLEMENTED;
} };
template <int N>
struct unroll_loadH<N, HK_IO_BYTE_ALIGNED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkHalf* HK_RESTRICT p)
{
switch (N)
{
case 4: self.v[3] = hkReal(hkFloat32(p[3]));
case 3: self.v[2] = hkReal(hkFloat32(p[2]));
case 2: self.v[1] = hkReal(hkFloat32(p[1]));
default: self.v[0] = hkReal(hkFloat32(p[0])); break;
}
#if defined(HK_DEBUG)
#if defined(HK_REAL_IS_DOUBLE)
for(int i=N; i<4; ++i) *((hkUint64*)&(self.v[i])) = 0xffffffffffffffffull;
#else
for(int i=N; i<4; ++i) *((hkUint32*)&(self.v[i])) = 0xffffffff;
#endif
#endif
} };
template <int N>
struct unroll_loadH<N, HK_IO_NATIVE_ALIGNED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkHalf* HK_RESTRICT p)
{
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & (sizeof(hkHalf)-1) ) == 0, "pointer must be aligned to native size of hkHalf.");
unroll_loadH<N, HK_IO_BYTE_ALIGNED>::apply(self,p);
} };
template <int N>
struct unroll_loadH<N, HK_IO_SIMD_ALIGNED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkHalf* HK_RESTRICT p)
{
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & ((sizeof(hkReal)*(N!=3?N:4) )-1) ) == 0, "pointer must be aligned for SIMD.");
unroll_loadH<N, HK_IO_NATIVE_ALIGNED>::apply(self,p);
} };
template <int N>
struct unroll_loadH<N, HK_IO_NOT_CACHED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkHalf* HK_RESTRICT p)
{
unroll_loadH<N, HK_IO_SIMD_ALIGNED>::apply(self,p);
} };
} // namespace
template <int N, hkMathIoMode A>
HK_FORCE_INLINE void hkVector4::load(const hkHalf* p)
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_loadH<N,A>::apply(m_quad, p);
}
template <int N>
HK_FORCE_INLINE void hkVector4::load(const hkHalf* p)
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_loadH<N,HK_IO_SIMD_ALIGNED>::apply(m_quad, p);
}
namespace hkVector4_AdvancedInterface
{
template <int N, hkMathIoMode A>
struct unroll_loadF16 { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkFloat16* HK_RESTRICT p)
{
HK_VECTOR4_TEMPLATE_CONFIG_NOT_IMPLEMENTED;
} };
template <int N>
struct unroll_loadF16<N, HK_IO_BYTE_ALIGNED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkFloat16* HK_RESTRICT p)
{
switch (N)
{
case 4: self.v[3] = p[3].getReal();
case 3: self.v[2] = p[2].getReal();
case 2: self.v[1] = p[1].getReal();
default: self.v[0] = p[0].getReal(); break;
}
#if defined(HK_DEBUG)
#if defined(HK_REAL_IS_DOUBLE)
for(int i=N; i<4; ++i) *((hkUint64*)&(self.v[i])) = 0xffffffffffffffffull;
#else
for(int i=N; i<4; ++i) *((hkUint32*)&(self.v[i])) = 0xffffffff;
#endif
#endif
} };
template <int N>
struct unroll_loadF16<N, HK_IO_NATIVE_ALIGNED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkFloat16* HK_RESTRICT p)
{
#if !defined(HK_PLATFORM_IOS)
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & (sizeof(hkFloat16)-1) ) == 0, "pointer must be aligned to native size of hkFloat16.");
#endif
unroll_loadF16<N, HK_IO_BYTE_ALIGNED>::apply(self,p);
} };
template <int N>
struct unroll_loadF16<N, HK_IO_SIMD_ALIGNED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkFloat16* HK_RESTRICT p)
{
#if !defined(HK_PLATFORM_IOS)
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & ((sizeof(hkReal)*(N!=3?N:4) )-1) ) == 0, "pointer must be aligned for SIMD.");
#endif
unroll_loadF16<N, HK_IO_NATIVE_ALIGNED>::apply(self,p);
} };
template <int N>
struct unroll_loadF16<N, HK_IO_NOT_CACHED> { HK_FORCE_INLINE static void apply(hkQuadReal& self, const hkFloat16* HK_RESTRICT p)
{
unroll_loadF16<N, HK_IO_SIMD_ALIGNED>::apply(self,p);
} };
} // namespace
template <int N, hkMathIoMode A>
HK_FORCE_INLINE void hkVector4::load(const hkFloat16* p)
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_loadF16<N,A>::apply(m_quad, p);
}
template <int N>
HK_FORCE_INLINE void hkVector4::load(const hkFloat16* p)
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_loadF16<N,HK_IO_SIMD_ALIGNED>::apply(m_quad, p);
}
namespace hkVector4_AdvancedInterface
{
template <int N, hkMathIoMode A>
struct unroll_store { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkReal* HK_RESTRICT p)
{
HK_VECTOR4_TEMPLATE_CONFIG_NOT_IMPLEMENTED;
} };
template <int N>
struct unroll_store<N, HK_IO_BYTE_ALIGNED> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkReal* HK_RESTRICT p)
{
hkMemUtil::memCpy(p, &self, N*sizeof(hkReal));
} };
template <int N>
struct unroll_store<N, HK_IO_NATIVE_ALIGNED> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkReal* HK_RESTRICT p)
{
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & (sizeof(hkReal)-1) ) == 0, "pointer must be aligned to native size of hkReal.");
hkMemUtil::memCpy<sizeof(hkReal)>(p, &self, N*sizeof(hkReal));
} };
template <int N>
struct unroll_store<N, HK_IO_SIMD_ALIGNED> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkReal* HK_RESTRICT p)
{
#if !defined(HK_PLATFORM_IOS)
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & ((sizeof(hkReal)*(N!=3?N:4) )-1) ) == 0, "pointer must be aligned for SIMD.");
#endif
switch (N)
{
case 4:
{
hkMemUtil::memCpyOneAligned<4*sizeof(hkReal), 16>(p, &self);
}
break;
default:
{
unroll_store<N, HK_IO_NATIVE_ALIGNED>::apply(self,p);
}
break;
}
} };
template <int N>
struct unroll_store<N, HK_IO_NOT_CACHED> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkReal* HK_RESTRICT p)
{
#if !defined(HK_PLATFORM_IOS)
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & ((sizeof(hkReal)*(N!=3?N:4) )-1) ) == 0, "pointer must be aligned for SIMD.");
#endif
unroll_store<N, HK_IO_SIMD_ALIGNED>::apply(self,p);
} };
} // namespace
template <int N, hkMathIoMode A>
HK_FORCE_INLINE void hkVector4::store(hkReal* p) const
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_store<N,A>::apply(m_quad, p);
}
template <int N>
HK_FORCE_INLINE void hkVector4::store(hkReal* p) const
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_store<N,HK_IO_SIMD_ALIGNED>::apply(m_quad, p);
}
namespace hkVector4_AdvancedInterface
{
template <int N, hkMathIoMode A, hkMathRoundingMode R>
struct unroll_storeH { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkHalf* HK_RESTRICT p)
{
HK_VECTOR4_TEMPLATE_CONFIG_NOT_IMPLEMENTED;
} };
template <int N, hkMathRoundingMode R>
struct unroll_storeH<N, HK_IO_BYTE_ALIGNED, R> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkHalf* HK_RESTRICT p)
{
if (R == HK_ROUND_NEAREST)
{
const hkReal packHalf = g_vectorConstants[HK_QUADREAL_PACK_HALF].v[0];
switch (N)
{
case 4: p[3] = hkFloat32(self.v[3] * packHalf);
case 3: p[2] = hkFloat32(self.v[2] * packHalf);
case 2: p[1] = hkFloat32(self.v[1] * packHalf);
default: p[0] = hkFloat32(self.v[0] * packHalf); break;
}
}
else
{
switch (N)
{
case 4: p[3] = hkFloat32(self.v[3]);
case 3: p[2] = hkFloat32(self.v[2]);
case 2: p[1] = hkFloat32(self.v[1]);
default: p[0] = hkFloat32(self.v[0]); break;
}
}
} };
template <int N, hkMathRoundingMode R>
struct unroll_storeH<N, HK_IO_NATIVE_ALIGNED, R> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkHalf* HK_RESTRICT p)
{
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & (sizeof(hkHalf)-1) ) == 0, "pointer must be aligned to native size of hkHalf.");
unroll_storeH<N, HK_IO_BYTE_ALIGNED, R>::apply(self,p);
} };
template <int N, hkMathRoundingMode R>
struct unroll_storeH<N, HK_IO_SIMD_ALIGNED, R> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkHalf* HK_RESTRICT p)
{
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & ((sizeof(hkReal)*(N!=3?N:4) )-1) ) == 0, "pointer must be aligned for SIMD.");
unroll_storeH<N, HK_IO_NATIVE_ALIGNED, R>::apply(self,p);
} };
template <int N, hkMathRoundingMode R>
struct unroll_storeH<N, HK_IO_NOT_CACHED, R> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkHalf* HK_RESTRICT p)
{
unroll_storeH<N, HK_IO_SIMD_ALIGNED, R>::apply(self,p);
} };
} // namespace
template <int N, hkMathIoMode A, hkMathRoundingMode R>
HK_FORCE_INLINE void hkVector4::store(hkHalf* p) const
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_storeH<N,A,R>::apply(m_quad, p);
}
template <int N>
HK_FORCE_INLINE void hkVector4::store(hkHalf* p) const
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_storeH<N,HK_IO_SIMD_ALIGNED,HK_ROUND_NEAREST>::apply(m_quad, p);
}
namespace hkVector4_AdvancedInterface
{
template <int N, hkMathIoMode A, hkMathRoundingMode R>
struct unroll_storeF16 { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkFloat16* HK_RESTRICT p)
{
HK_VECTOR4_TEMPLATE_CONFIG_NOT_IMPLEMENTED;
} };
template <int N, hkMathRoundingMode R>
struct unroll_storeF16<N, HK_IO_BYTE_ALIGNED, R> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkFloat16* HK_RESTRICT p)
{
switch (N)
{
case 4: p[3].setReal<(R == HK_ROUND_NEAREST)>(self.v[3]);
case 3: p[2].setReal<(R == HK_ROUND_NEAREST)>(self.v[2]);
case 2: p[1].setReal<(R == HK_ROUND_NEAREST)>(self.v[1]);
default: p[0].setReal<(R == HK_ROUND_NEAREST)>(self.v[0]); break;
}
} };
template <int N, hkMathRoundingMode R>
struct unroll_storeF16<N, HK_IO_NATIVE_ALIGNED, R> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkFloat16* HK_RESTRICT p)
{
#if !defined(HK_PLATFORM_IOS)
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & (sizeof(hkFloat16)-1) ) == 0, "pointer must be aligned to native size of hkFloat16.");
#endif
unroll_storeF16<N, HK_IO_BYTE_ALIGNED, R>::apply(self,p);
} };
template <int N, hkMathRoundingMode R>
struct unroll_storeF16<N, HK_IO_SIMD_ALIGNED, R> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkFloat16* HK_RESTRICT p)
{
#if !defined(HK_PLATFORM_IOS)
HK_ASSERT2(0x64211c2f, ( ((hkUlong)p) & ((sizeof(hkReal)*(N!=3?N:4) )-1) ) == 0, "pointer must be aligned for SIMD.");
#endif
unroll_storeF16<N, HK_IO_NATIVE_ALIGNED, R>::apply(self,p);
} };
template <int N, hkMathRoundingMode R>
struct unroll_storeF16<N, HK_IO_NOT_CACHED, R> { HK_FORCE_INLINE static void apply(const hkQuadReal& self, hkFloat16* HK_RESTRICT p)
{
unroll_storeF16<N, HK_IO_SIMD_ALIGNED, R>::apply(self,p);
} };
} // namespace
template <int N, hkMathIoMode A, hkMathRoundingMode R>
HK_FORCE_INLINE void hkVector4::store(hkFloat16* p) const
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_storeF16<N,A,R>::apply(m_quad, p);
}
template <int N>
HK_FORCE_INLINE void hkVector4::store(hkFloat16* p) const
{
HK_VECTOR4_UNSUPPORTED_LENGTH_CHECK;
hkVector4_AdvancedInterface::unroll_storeF16<N,HK_IO_SIMD_ALIGNED,HK_ROUND_NEAREST>::apply(m_quad, p);
}
/*
* Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20110913)
*
* Confidential Information of Havok. (C) Copyright 1999-2011
* Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
* Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership
* rights, and intellectual property rights in the Havok software remain in
* Havok and/or its suppliers.
*
* Use of this software for evaluation purposes is subject to and indicates
* acceptance of the End User licence Agreement for this product. A copy of
* the license is included with this software and is also available at www.havok.com/tryhavok.
*
*/
| [
"cdebavel@ucalgary.ca"
] | cdebavel@ucalgary.ca |
88a44ccde093eddc2484f1bacb4d4ee7fe44942f | 543d9580b9c69f20cfb58c6ba7865e0362308a2a | /996A.cpp | 88e8e2508dd47f22d8351c3a558e1b76ca03688d | [] | no_license | rikvdk/codeforces | d387513cc20654b78b229a3129b65cd19026a0e6 | b5ecd2f9a81ca4bac7bf0442d483f07494eb716b | refs/heads/master | 2022-12-11T11:55:32.368980 | 2020-09-19T20:07:33 | 2020-09-19T20:07:33 | 252,754,772 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 165 | cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
ll n;
cin >> n;
cout << n/100 + n%100/20 + n%20/10 + n%10/5 + n%5;
}
| [
"rikvanderkooij@gmail.com"
] | rikvanderkooij@gmail.com |
f8e034bf6f32ff81067bf21751d08269089aba31 | 89fdc24754bac6fe98b3b2994c576199248bbb5d | /Project1/main.cpp | 19f970e73994114cd6bb8f462a94291b3de6810c | [] | no_license | ChristopMD/Grafica-Tranformaciones-Indices | cd94c08a11fcc10b1f9061a113ee340718247518 | 9f7b63c7027d75f3d2dc46c89927c4df0595f09f | refs/heads/master | 2022-12-23T23:57:58.409157 | 2020-10-04T07:57:45 | 2020-10-04T07:57:45 | 301,071,540 | 1 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 8,681 | cpp | #include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
using namespace std;
void framebuffer_tamanho_callback(GLFWwindow* ventana, int ancho, int alto) {
glViewport(0, 0, ancho, alto);
}
void procesarEntrada(GLFWwindow* ventana) {
if (glfwGetKey(ventana, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(ventana, true);
}
const unsigned int ANCHO = 800;
const unsigned int ALTO = 600;
//Definir el código de Vertex Shader
//La matriz de transformacion geometrica se indica en el vertex shader
//ya que, en el vertex shader se colocan las posiciones y
//una transformacion geometrica cambia esas posiciones
//Definir el código de Fragment Shader
class CProgrmaShaders {
GLuint idPrograma;
public:
CProgrmaShaders(string rutaShaderVertice, string rutaShaderFragmento) {
//Variables para leer los archivos de código
string strCodigoShaderVertice;
string strCodigoShaderFragmento;
ifstream pArchivoShaderVertice;
ifstream pArchivoShaderFragmento;
//Mostramos excepciones en caso haya
pArchivoShaderVertice.exceptions(ifstream::failbit | ifstream::badbit);
pArchivoShaderFragmento.exceptions(ifstream::failbit | ifstream::badbit);
try
{
//Abriendo los archivos de código de los shader
pArchivoShaderVertice.open(rutaShaderVertice);
pArchivoShaderFragmento.open(rutaShaderFragmento);
//Leyendo la información de los archivos
stringstream lectorShaderVertice, lectorShaderFragmento;
lectorShaderVertice << pArchivoShaderVertice.rdbuf();
lectorShaderFragmento << pArchivoShaderFragmento.rdbuf();
//Cerar los archivos
pArchivoShaderVertice.close();
pArchivoShaderFragmento.close();
//Pasando la informacion leída a string
strCodigoShaderVertice = lectorShaderVertice.str();
strCodigoShaderFragmento = lectorShaderFragmento.str();
}
catch (ifstream::failure)
{
cout << "ERROR: Los archivos no pudieron ser leidos correctamente.\n";
}
const char* codigoShaderVertice = strCodigoShaderVertice.c_str();
const char* codigoShaderFragmento = strCodigoShaderFragmento.c_str();
//Asociando y compilando los códigos de los shader
GLuint idShaderVertice, idShderFragmento;
//Shader de Vertice
idShaderVertice = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(idShaderVertice, 1, &codigoShaderVertice, NULL);
glCompileShader(idShaderVertice);
verificarErrores(idShaderVertice, "Vertice");
//Shader de Fragmento
idShderFragmento = glCreateShader(GL_FRAGMENT_SHADER);
//Asociando al programa, de la tarjeta gráfica, con identificador "idShderFragmento" el código en la dirección apuntada por
//"codigoShaderFragmento"
glShaderSource(idShderFragmento, 1, &codigoShaderFragmento, NULL);
//Pedimos a la tarjeta gráfica que compile el programa con identificador "idShderFragmento"
glCompileShader(idShderFragmento);
verificarErrores(idShderFragmento, "Fragmento");
//Creando un programa en la tarjeta gráfica para mi shader, y obteniendo el identificador asociado
this->idPrograma = glCreateProgram();
//Enlazando vertex y fragment shaders
glAttachShader(this->idPrograma, idShaderVertice);
glAttachShader(this->idPrograma, idShderFragmento);
glLinkProgram(this->idPrograma);
//verificarErrores(this->idPrograma, "Programa");
//Ahora ya podemos eliminar los programas de los shaders
glDeleteShader(idShaderVertice);
glDeleteShader(idShderFragmento);
}
~CProgrmaShaders() {
glDeleteProgram(this->idPrograma);
}
void usar() const{
glUseProgram(this->idPrograma);
}
void setVec3(const string &nombre, float x, float y, float z) const {
glUniform3f(glGetUniformLocation(this->idPrograma, nombre.c_str()), x, y, z);
}
void setVec3(const string &nombre, const glm::vec3 &valor) const {
glUniform3fv(glGetUniformLocation(this->idPrograma, nombre.c_str()), 1, &valor[0]);
}
void setMat4(const string &nombre, const glm::mat4 &mat) const {
glUniformMatrix4fv(glGetUniformLocation(this->idPrograma, nombre.c_str()), 1, GL_FALSE, &mat[0][0]);
}
private:
void verificarErrores(GLuint identificador, string tipo) {
GLint ok;
GLchar log[1024];
if (tipo == "Programa") {
glGetProgramiv(this->idPrograma, GL_LINK_STATUS, &ok);
if (!ok) {
glGetProgramInfoLog(this->idPrograma, 1024, NULL, log);
cout << "Error de enlace con el programa: " << log << "\n";
}
}
else {
glGetShaderiv(identificador, GL_COMPILE_STATUS, &ok);
if (!ok) {
glGetShaderInfoLog(identificador, 1024, nullptr, log);
cout << "Error de compilación con el Shader de : " << tipo <<": "<< log << "\n";
}
}
}
};
//Global dx dy
float dx = 0.005;
float dy = 0.005;
void moverHex(float x, float y) {
if (x >= 1) dx *= -1.0;
else if (x <= -1)dx *= -1.0;
if (y >= 1) dy *= -1.0;
else if (y <= -1)dy *= -1.0;
}
int main() {
//Inicializar glfw
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
//Creando la ventana
GLFWwindow* ventana = glfwCreateWindow(ANCHO, ALTO, "Compu Grafica", NULL, NULL);
if (ventana == NULL) {
cout << "Problemas al crear la ventana\n";
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(ventana);
glfwSetFramebufferSizeCallback(ventana, framebuffer_tamanho_callback);
//Cargar Glad
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) {
cout << "Problemas al cargar GLAD\n";
return -1;
}
CProgrmaShaders programa_shaders = CProgrmaShaders("GLSL/codigo.vs", "GLSL/codigo.fs");
//Definiendo la geometría de la figura en función de vértices
float vertices[] = {
-0.4, 0.0, 0.0, 0.0, 1.0, 0.0,
-0.2, 0.4, 0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 1.0, 1.0,
0.2, 0.4, 0.0, 0.0, 0.0, 1.0,
0.4, 0.0, 0.0, 1.0, 1.0, 0.0,
0.2, -0.4, 0.0, 1.0, 0.0, 1.0,
-0.2, -0.4, 0.0, 0.0, 1.0, 0.0
};
unsigned int indices[] = {
0,1,2,
2,1,3,
2,3,4,
2,4,5,
2,5,6,
2,6,0
};
//Enviando la geometría al GPU: Definiendo los buffers (Vertex Array Objects y Vertex Buffer Objects)
unsigned int id_array_vertices, id_array_buffers, id_element_buffer;
glGenVertexArrays(1, &id_array_vertices);
glGenBuffers(1, &id_array_buffers);
glGenBuffers(1, &id_element_buffer);
//Anexando los buffers para su uso en la tarjeta gráfica
glBindVertexArray(id_array_vertices);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id_element_buffer);
//Anexando buffers cargandolos con los datos
glBindBuffer(GL_ARRAY_BUFFER, id_array_buffers);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id_element_buffer);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);
//Indicando las especificaciones de los atributos
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)(3 * sizeof(float)));
glEnableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);
float x = 0.0;
float y = 0.9;
while (!glfwWindowShouldClose(ventana)) {
procesarEntrada(ventana);
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
programa_shaders.usar();
//creando una matriz homográfica
glm::mat4 transformacion = glm::mat4(1.0);
//translacion
transformacion = glm::translate(transformacion, glm::vec3(glm::sin((float)glfwGetTime()), glm::cos((float)glfwGetTime()), 0.0));
//rotacion
transformacion = glm::rotate(transformacion, (float)glfwGetTime(), glm::vec3(0, 0, 1));
//scalamiento
transformacion = glm::scale(transformacion, glm::vec3(glm::sin((float)glfwGetTime()), glm::sin((float)glfwGetTime()), 1.0));
//Sepuede cambiar el orden de traslacion , rotacion y scalamiento para obtener diferentes resultados
//programa_shaders.setMat4("transformacion", glm::vec3(glm::sin((float)glfwGetTime()), glm::cos((float)glfwGetTime()), 0.0)); //poner x e y para hacer movimiento de rombo y coseno y seno para circular
programa_shaders.setMat4("transformacion", transformacion);
glBindVertexArray(id_array_vertices);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id_element_buffer);
//glDrawArrays(GL_TRIANGLES, 0, 18);
glDrawElements(GL_TRIANGLES, 18, GL_UNSIGNED_INT, 0);
glfwSwapBuffers(ventana);
glfwPollEvents();
//Movimiento de Hexagono
//moverHex(x, y);
//x += dx;
//y += dy;
}
//Liberando memoria
glDeleteVertexArrays(1, &id_array_vertices);
glDeleteBuffers(1, &id_array_buffers);
glfwTerminate();
return 0;
} | [
"42655558+ChristopMD@users.noreply.github.com"
] | 42655558+ChristopMD@users.noreply.github.com |
f6f4ea365871b60592ec0adc8058436c6080276a | 4aa943fc6e2710070b325eb81223fc4dbae205c6 | /src/BluetoothException.cc | f65ebee90f2dbd6f0eb8312a5589929d3b20a3d6 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause-Views",
"BSD-2-Clause",
"MIT"
] | permissive | RoukaVici/bluetooth-serial-port | e533f6f60af6502f17e54d47853a82b40e92eca3 | 2fc7ceab97f751bc9dfd2c88bbcc69b39c9e775c | refs/heads/master | 2020-03-18T06:55:42.918022 | 2018-09-20T11:51:19 | 2018-09-20T11:51:19 | 134,422,082 | 0 | 0 | null | 2018-05-22T13:48:44 | 2018-05-22T13:48:44 | null | UTF-8 | C++ | false | false | 213 | cc | #include "BluetoothException.h"
BluetoothException::BluetoothException(std::string msg) NOEXCEPT
{
this->message = msg;
}
const char* BluetoothException::what() const NOEXCEPT
{
return message.c_str();
} | [
"atomheartother@gmail.com"
] | atomheartother@gmail.com |
72689e935b6ea40527ef220592ad297e6ba0b8b5 | 80bee850d1197772d61e05d8febc014e9980d7c0 | /Addons/ExileReborn-Reborn_Zombies/mpmissions/Core_client_files/custom_crafting/bushkit.hpp | b7728f312004e40ba2ddb27c830a9c03fd62f9fb | [
"MIT"
] | permissive | x-cessive/Exile | 0443bb201bda31201fadc9c0ac80823fb2d7a25d | c5d1f679879a183549e1c87d078d462cbba32c25 | refs/heads/master | 2021-11-29T08:40:00.286597 | 2021-11-14T17:36:51 | 2021-11-14T17:36:51 | 82,304,207 | 10 | 8 | null | 2017-04-11T14:44:21 | 2017-02-17T14:20:22 | SQF | UTF-8 | C++ | false | false | 331 | hpp | class CraftBushKit: Exile_AbstractCraftingRecipe
{
name = "Craft bush kit";
pictureItem = "Exile_Item_BushKit_Green";
returnedItems[] =
{
{1, "Exile_Item_BushKit_Green"}
};
tools[] =
{
"Exile_Item_Pliers"
};
components[] =
{
{8, "Exile_Item_Leaves"},
{4, "Exile_Item_WoodSticks"},
{1, "Exile_Item_Rope"}
};
}; | [
"mrsage@xcsv.tv"
] | mrsage@xcsv.tv |
56f80cf0ce585438fff11e22665bb87044ba9019 | 3b8b45149196c81b498725edc7b42e413d012724 | /Interviews/Linked Lists/Open_loop.cpp | 2f74c6e37134b00e25678542757f22a8c3dcbd64 | [] | no_license | Zildj1an/Codes | a3cdbe9ec564314293fb29d24835c24a499337d6 | aa92789004913b5ac20b4479de475960e6c27ddb | refs/heads/main | 2023-03-09T12:22:38.448135 | 2021-01-13T17:37:28 | 2021-01-13T17:37:28 | 341,924,304 | 0 | 0 | null | 2021-02-24T14:20:18 | 2021-02-24T14:20:17 | null | UTF-8 | C++ | false | false | 1,899 | cpp | #include<bits/stdc++.h>
using namespace std;
struct node
{
int data;
node *next;
};
node * insert(node* head,int val)
{
node *newNode = (node *)malloc(sizeof( node));
node *temp;
newNode->data = val;
newNode->next = NULL;
if(head == NULL)
{
head = newNode;
// cout << val << head << endl;
return head;
}
temp = head;
while(temp->next!=NULL)
{
temp = temp->next;
// cout << val << temp << endl;
}
temp->next = newNode;
// cout << val << temp << endl;
return head;
}
int size(node*head)
{
if(head== NULL)
{
return 0;
}
node *temp;
temp = head;
int size = 0;
while(temp!=NULL)
{
size++;
temp = temp->next;
}
return size;
}
node *loop(node*head)
{
if(head==NULL)
{
return 0;
}
node *ptr1,*ptr2;
ptr1 = ptr2 = head;
int flag = 0;
while(ptr1 && ptr2&& ptr2->next!=NULL)
{
ptr2 = ptr2->next->next;
ptr1 = ptr1->next;
if(ptr1== ptr2)
{
flag = 1;
ptr1 = head;
break;
}
}
if(flag)
{
while(ptr1->next!=ptr2->next)
{
ptr1 = ptr1->next;
ptr2 = ptr2->next;
}
ptr2->next = NULL;
}
return head;
}
void print(node *head)
{
if(head == NULL)
{
return;
}
node *temp;
temp = head;
while(temp!=NULL)
{
cout << temp->data << endl;
temp = temp->next;
}
}
int main()
{
node *head1 = (node *)malloc(sizeof(node));
head1->data = 1;
head1->next = NULL;
insert(head1,2);
insert(head1,3);
insert(head1,4);
insert(head1,5);
cout << "The list before reversal" << endl;
print(head1);
cout << "The list after reversal" << endl;
cout << loop(head1)<< endl;
} | [
"meghaa105@gmail.com"
] | meghaa105@gmail.com |
b6f225781cabf55389cd93385582e97930ef6871 | 56526b6e3d824f140cf1b62eb1eaa0a2b58cecf6 | /IR_sensor/ir_sensor/ir_sensor.ino | bd62da323f0b85d2c44ab30041935614e8532e6c | [] | no_license | JosephJamesFraserBell/Mechatronics_Cooler | 7476bb10d2cfdbd8d3284e8fb71cc1cdbb4cc145 | 3c1de361d4a423ad9154e31732fb15054a864c45 | refs/heads/master | 2020-06-01T21:10:30.343273 | 2019-07-30T08:27:45 | 2019-07-30T08:27:45 | 190,928,477 | 0 | 0 | null | 2019-07-28T17:28:45 | 2019-06-08T19:45:39 | Makefile | UTF-8 | C++ | false | false | 1,567 | ino | #include <SharpIR.h>
#define IR A0 // define signal pin
#define model 1080 // used 1080 because model GP2Y0A21YK0F is used
// Sharp IR code for Robojax.com
// ir: the pin where your sensor is attached
// model: an int that determines your sensor: 1080 for GP2Y0A21Y
// 20150 for GP2Y0A02Y
// 430 for GP2Y0A41SK
/*
2 to 15 cm GP2Y0A51SK0F use 1080
4 to 30 cm GP2Y0A41SK0F / GP2Y0AF30 series use 430
10 to 80 cm GP2Y0A21YK0F use 1080
10 to 150 cm GP2Y0A60SZLF use 10150
20 to 150 cm GP2Y0A02YK0F use 20150
100 to 550 cm GP2Y0A710K0F use 100550
*/
SharpIR SharpIR(IR, model);
void setup() {
// Sharp IR code for Robojax.com
Serial.begin(9600);
pinMode(7, OUTPUT);
digitalWrite(7, LOW);
//Serial.println("Robojax Sharp IR ");
}
void loop() {
// Sharp IR code for Robojax.com
delay(1000);
unsigned long startTime=millis(); // takes the time before the loop on the library begins
int dis=SharpIR.distance(); // this returns the distance to the object you're measuring
// Sharp IR code for Robojax.com
Serial.print("Mean distance: "); // returns it to the serial monitor
Serial.println(dis);
//Serial.println(analogRead(A0));
unsigned long endTime=millis()-startTime; // the following gives you the time taken to get the measurement
//Serial.print("Time taken (ms): ");
//Serial.println(endTime);
// Sharp IR code for Robojax.com
if (dis < 60){
digitalWrite(7, HIGH);
}
else{
digitalWrite(7,LOW);
}
}
| [
"44582108+JosephJamesFraserBell@users.noreply.github.com"
] | 44582108+JosephJamesFraserBell@users.noreply.github.com |
dd20f5842aabff29eefdb482ba85c48af074c1c1 | aec314b49355be4eb37d65125f793ed69f3e27a6 | /ServerCore/ServerLibrary/Net/Terminal/TerminalSession.h | 22caf95cb281d00df4f5e9c2d3eefa57caa47d37 | [] | no_license | OneKim/GameServer | 3922dc03d2779a9cf580dc5507160f128121eb24 | b0924b81229a10a48e8bafe5e94ab598f0eff757 | refs/heads/master | 2021-04-26T14:28:37.954049 | 2018-04-30T14:50:33 | 2018-04-30T14:50:33 | 121,199,396 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 249 | h | #pragma once
#include "stdafx.h"
class TerminalSession : public Session
{
public:
bool connectTo(char *ip, int port);
void onSend(size_t transferSize);
void sendPacket(Packet *packet);
Package* onRecv(size_t transferSize);
};
| [
"anjelgogo@naver.com"
] | anjelgogo@naver.com |
fac5440998359213d337841ff55e735250182669 | 5f4aff8b044274cd81e8b577428cfdc465ac8174 | /chat-server-client/server/include/socket.h | 0f22d8323e2e0bb10fe0de28f25fcb4d44c30b72 | [] | no_license | dapper91/misc | c27d303c7daadbe6c36b0af6d310ac0ab05dfeb9 | b2ba730290639839503e02fe084ba476531c6f0d | refs/heads/master | 2020-04-03T23:55:47.195275 | 2016-11-27T07:06:47 | 2016-11-27T07:06:47 | 37,371,637 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,308 | h | #ifndef __SOCKET_H
#define __SOCKET_H
#include <stdexcept>
#include <string>
#include <vector>
#include <memory>
#include <cstring>
#include <sys/socket.h>
#include <arpa/inet.h>
namespace net {
/*
* Represents Socket exception.
*/
class SocketException: public std::runtime_error {
public:
SocketException(const std::string& what_arg):
std::runtime_error(what_arg)
{ }
};
/*
* Represents an ipv4 tcp socket.
* Non-copyable.
* Not thread-safe.
*/
class Socket {
public:
Socket();
Socket(int fd, sockaddr& addr):
sockfd(fd), addr(addr)
{ }
Socket(Socket&& other);
Socket(const Socket&) = delete;
Socket& operator=(const Socket&) = delete;
void bind(const std::string& ip, uint16_t port);
void connect(const std::string& ip, uint16_t port);
void listen(int backlog = 64);
std::unique_ptr<Socket> accept();
void set_nonblocking();
void set_reuse();
void close();
/*
* Sends all the data in the buffer buf. Blocks untill all the data are sent.
* params:
* buf - buffer containing data to be sent
*/
ssize_t sendall(const std::vector<char>& buf);
/*
* Sends data in the buffer buf.
* params:
* buf - buffer containing the data to be sent
* offset - buffer data start position to be sent from
* return a data size actually sent
*/
ssize_t send(const std::vector<char>& buf, size_t offset = 0);
/*
* Receives data of required size from the socket. Blocks untill all the data are received.
* params:
* buf - buffer to save the received data to
* size - required data size to be received
* returns received data size
*/
ssize_t recvall(std::vector<char>& buf, size_t size);
/*
* Receives data from the socket.
* params:
* buf - buffer to save the received data to
* max - maximum data size to be received
* returns actually received data size
*/
ssize_t recv(std::vector<char>& buf, size_t max = -1);
int get_sockfd() const;
private:
int sockfd = -1;
sockaddr addr;
size_t buf_size = 512;
void fill_sockaddr(sockaddr* addr, const std::string& ip, uint16_t port);
};
} // namespace net
#endif // __SOCKET_H | [
"dapper91@mail.ru"
] | dapper91@mail.ru |
88259733976ed52c226c0cfa36727f789fa0e072 | 198806ccd0b5a7d476c701be5943e9a7afacb7d0 | /xdaq/include/b2in/utils/MessengerCache.h | f45403e2b49645351010eb77dcc1c3734b6eb3a5 | [] | no_license | marcomuzio/EMULib_CLCT_Timing | df5999b5f1187725d7f5b6196ba566045ba60f55 | 04e930d46cadaa0c73b94a0c22e4478f55fac844 | refs/heads/master | 2021-01-16T13:47:26.141865 | 2014-08-14T12:04:33 | 2014-08-14T12:04:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,902 | h | // $Id: MessengerCache.h,v 1.7 2008/07/18 15:26:35 gutleber Exp $
/*************************************************************************
* XDAQ Components for Distributed Data Acquisition *
* Copyright (C) 2000-2009, CERN. *
* All rights reserved. *
* Authors: J. Gutleber and L. Orsini *
* *
* For the licensing terms see LICENSE. *
* For the list of contributors see CREDITS. *
*************************************************************************/
#ifndef _b2in_utils_MessengerCache_h_
#define _b2in_utils_MessengerCache_h_
#include <vector>
#include <map>
#include <string>
#include "xdaq/ApplicationContext.h"
#include "xdaq/NetGroup.h"
#include "xdaq/Network.h"
#include "xdata/Properties.h"
#include "pt/Messenger.h"
#include "pt/PeerTransportAgent.h"
#include "b2in/utils/exception/Exception.h"
#include "b2in/utils/MessengerCacheListener.h"
#include "toolbox/BSem.h"
#include "toolbox/lang/Class.h"
#include "toolbox/exception/Handler.h"
#include "b2in/nub/exception/InternalError.h"
#include "b2in/nub/exception/QueueFull.h"
#include "b2in/nub/exception/OverThreshold.h"
namespace b2in
{
namespace utils
{
//! This class maintains a cache of messenger pointers for fast access to
//! the messenger by giving a source and destination tid.
//
class MessengerCache : public toolbox::lang::Class
{
xdaq::ApplicationContext* context_;
public:
MessengerCache (xdaq::ApplicationContext* context, const std::string & networkName, MessengerCacheListener * listener )
throw(b2in::utils::exception::Exception);
//!
//
void invalidate
(
const std::string& url
)
throw (b2in::utils::exception::Exception);
//!
//
void createMessenger
(
const std::string& url
)
throw (b2in::utils::exception::Exception);
std::list<std::string> getDestinations();
void send (const std::string & url, toolbox::mem::Reference* msg, xdata::Properties & plist)
throw (b2in::nub::exception::InternalError, b2in::nub::exception::QueueFull, b2in::nub::exception::OverThreshold);
bool hasMessenger (const std::string & url);
pt::Address::Reference getLocalAddress();
protected:
bool subscribeFailed(xcept::Exception& e, void * context);
pt::Messenger* getMessenger
(
const std::string& url
)
throw (b2in::utils::exception::Exception);
std::vector<pt::Messenger::Reference> messengerReferences_;
std::map<std::string, pt::Messenger*> messengers_;
toolbox::BSem lock_;
pt::Address::Reference localAddress_;
toolbox::exception::HandlerSignature * subscribeFailedHandler_;
MessengerCacheListener * listener_;
};
}
}
#endif
| [
"hogenshpogen@gmail.com"
] | hogenshpogen@gmail.com |
c9f279a09187557ed9b1907d1d2030c3bfbe758e | bc0e9948c7090e022ed71a4aa3d8f19a1318c349 | /cses/1069.cpp | 1e64fbf771a47766364ce1efd7159fed0864c29b | [] | no_license | CheshireCatNick/code-exercise | 9180533d55f6fd1a6104fb1391ab29c9fba03de8 | 0d91d5f27048c19136b36eb8b4508474c9c84b24 | refs/heads/master | 2023-06-24T10:52:31.402307 | 2021-07-27T02:48:38 | 2021-07-27T02:48:38 | 64,368,175 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,163 | cpp | // Nicky's template
// C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <inttypes.h>
// C++
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <utility>
using namespace std;
#define FORN(i, n) for (int i = 0; i < int(n); i++)
#define NORF(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < int(b); i++)
#define ROF(i, a, b) for (int i = int(b) - 1; i >= a; i--)
#define FORX(it, x) for (auto it = x.begin(); it != x.end(); it++)
#define FORS(i, s) for (int i = 0; s[i]; i++)
#define MS0(x) memset((x), 0, sizeof((x)))
#define MS1(x) memset((x), -1, sizeof((x)))
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void _R(LL &x) { scanf("%lld", &x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
void _W(const LL &x) { printf("%lld", x); }
// print array
void WA(const int *a, int n) { for (int i = 0; i < n; _W(a[i++])) if (i != 0) putchar(' '); puts(""); }
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
template<class Iter> ostream &_out(ostream &s, Iter b, Iter e) {
s << "[";
for (auto it = b; it != e; it++) s << (it == b ? "" : " ") << *it;
return s << "]";
}
template<class A, class B> ostream &operator<<(ostream &s, const pair<A, B> &p) { return s << "(" << p.first << ", " << p.second << ")"; }
template<class T> ostream &operator<<(ostream &s, const vector<T> &c) { return _out(s, ALL(c)); }
template<class T, size_t N> ostream &operator<<(ostream &s, const array<T, N> &c) { return _out(s, ALL(c)); }
template<class T> ostream &operator<<(ostream &s, const set<T> &c) { return _out(s, ALL(c)); }
template<class A, class B> ostream &operator<<(ostream &s, const map<A, B> &c) { return _out(s, ALL(c)); }
template<class T, class F = less<T>> void sort_uniq(vector<T> &v, F f = F()) { sort(begin(v), end(v), f); v.resize(unique(begin(v), end(v)) - begin(v)); }
template<class T> inline T bit(T x, int i) { return (x >> i) & 1; }
template<class T> inline bool chmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool chmin(T &a, const T &b) { return b < a ? a = b, true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T> void _dump(const char *s, T &&head) { cerr << s << "=" << head << endl; }
template<class T, class... Args> void _dump(const char *s, T &&head, Args &&... tail) {
for (int c = 0; *s != ',' || c != 0; cerr << *s++) {
if (*s == '(' || *s == '[' || *s == '{') c++;
if (*s == ')' || *s == ']' || *s == '}') c--;
}
cerr << "=" << head << ",";
_dump(s + 1, tail...);
}
#define dump(...) do { fprintf(stderr, "%s:%d - ", __PRETTY_FUNCTION__, __LINE__); _dump(#__VA_ARGS__, __VA_ARGS__); } while (0)
int main(void) {
string s;
R(s);
int best = 1;
int cur = 1;
FOR(i, 1, s.length()) {
if (s[i] == s[i - 1]) {
cur++;
}
else {
chmax(best, cur);
cur = 1;
}
}
chmax(best, cur);
W(best);
return 0;
} | [
"nicky.chao@onedegree.hk"
] | nicky.chao@onedegree.hk |
ee8161b62316de4ae8439aa679ba32917fd439a5 | be31580024b7fb89884cfc9f7e8b8c4f5af67cfa | /CTDL1/New folder/VC/VCWizards/AppWiz/MFC/Library/templates/1031/stdafx.cpp | 655ffe1b682f9210af925758fae1c287dfc7c954 | [] | no_license | Dat0309/CTDL-GT1 | eebb73a24bd4fecf0ddb8428805017e88e4ad9da | 8b5a7ed4f98e5d553bf3c284cd165ae2bd7c5dcc | refs/heads/main | 2023-06-09T23:04:49.994095 | 2021-06-23T03:34:47 | 2021-06-23T03:34:47 | 379,462,390 | 1 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 214 | cpp | // stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet.
// [!output PROJECT_NAME].pch ist der vorkompilierte Header.
// stdafx.obj enthält die vorkompilierten Typinformationen.
#include "stdafx.h"
| [
"71766267+Dat0309@users.noreply.github.com"
] | 71766267+Dat0309@users.noreply.github.com |
40b1b613365fbff1e3eca50604a1639274a8ed3c | 67f988dedfd8ae049d982d1a8213bb83233d90de | /external/chromium/gpu/command_buffer/tests/gl_test_utils.cc | 1a3e7c2f2635ced90aa8b0bb975c4700dca48864 | [
"BSD-3-Clause"
] | permissive | opensourceyouthprogramming/h5vcc | 94a668a9384cc3096a365396b5e4d1d3e02aacc4 | d55d074539ba4555e69e9b9a41e5deb9b9d26c5b | refs/heads/master | 2020-04-20T04:57:47.419922 | 2019-02-12T00:56:14 | 2019-02-12T00:56:14 | 168,643,719 | 1 | 1 | null | 2019-02-12T00:49:49 | 2019-02-01T04:47:32 | C++ | UTF-8 | C++ | false | false | 6,438 | cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gpu/command_buffer/tests/gl_test_utils.h"
#include <string>
#include <stdio.h>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
// GCC requires these declarations, but MSVC requires they not be present.
#ifndef COMPILER_MSVC
const uint8 GLTestHelper::kCheckClearValue;
#endif
bool GLTestHelper::HasExtension(const char* extension) {
std::string extensions(
reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
return extensions.find(extension) != std::string::npos;
}
bool GLTestHelper::CheckGLError(const char* msg, int line) {
bool success = true;
GLenum error = GL_NO_ERROR;
while ((error = glGetError()) != GL_NO_ERROR) {
success = false;
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), error)
<< "GL ERROR in " << msg << " at line " << line << " : " << error;
}
return success;
}
GLuint GLTestHelper::LoadShader(GLenum type, const char* shaderSrc) {
GLuint shader = glCreateShader(type);
// Load the shader source
glShaderSource(shader, 1, &shaderSrc, NULL);
// Compile the shader
glCompileShader(shader);
// Check the compile status
GLint value = 0;
glGetShaderiv(shader, GL_COMPILE_STATUS, &value);
if (value == 0) {
char buffer[1024];
GLsizei length = 0;
glGetShaderInfoLog(shader, sizeof(buffer), &length, buffer);
std::string log(buffer, length);
EXPECT_EQ(1, value) << "Error compiling shader: " << log;
glDeleteShader(shader);
shader = 0;
}
return shader;
}
GLuint GLTestHelper::SetupProgram(
GLuint vertex_shader, GLuint fragment_shader) {
// Create the program object
GLuint program = glCreateProgram();
glAttachShader(program, vertex_shader);
glAttachShader(program, fragment_shader);
// Link the program
glLinkProgram(program);
// Check the link status
GLint linked = 0;
glGetProgramiv(program, GL_LINK_STATUS, &linked);
if (linked == 0) {
char buffer[1024];
GLsizei length = 0;
glGetProgramInfoLog(program, sizeof(buffer), &length, buffer);
std::string log(buffer, length);
EXPECT_EQ(1, linked) << "Error linking program: " << log;
glDeleteProgram(program);
program = 0;
}
return program;
}
GLuint GLTestHelper::LoadProgram(
const char* vertex_shader_source,
const char* fragment_shader_source) {
GLuint vertex_shader = LoadShader(
GL_VERTEX_SHADER, vertex_shader_source);
GLuint fragment_shader = LoadShader(
GL_FRAGMENT_SHADER, fragment_shader_source);
if (!vertex_shader || !fragment_shader) {
return 0;
}
return SetupProgram(vertex_shader, fragment_shader);
}
GLuint GLTestHelper::SetupUnitQuad(GLint position_location) {
GLuint vbo = 0;
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
static float vertices[] = {
1.0f, 1.0f,
-1.0f, 1.0f,
-1.0f, -1.0f,
1.0f, 1.0f,
-1.0f, -1.0f,
1.0f, -1.0f,
};
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glEnableVertexAttribArray(position_location);
glVertexAttribPointer(position_location, 2, GL_FLOAT, GL_FALSE, 0, 0);
return vbo;
}
bool GLTestHelper::CheckPixels(
GLint x, GLint y, GLsizei width, GLsizei height, GLint tolerance,
const uint8* color) {
GLsizei size = width * height * 4;
scoped_array<uint8> pixels(new uint8[size]);
memset(pixels.get(), kCheckClearValue, size);
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get());
bool same = true;
for (GLint yy = 0; yy < height; ++yy) {
for (GLint xx = 0; xx < width; ++xx) {
int offset = yy * width * 4 + xx * 4;
for (int jj = 0; jj < 4; ++jj) {
uint8 actual = pixels[offset + jj];
uint8 expected = color[jj];
int diff = actual - expected;
diff = diff < 0 ? -diff: diff;
if (diff > tolerance) {
EXPECT_EQ(expected, actual) << " at " << (xx + x) << ", " << (yy + y)
<< " channel " << jj;
same = false;
}
}
}
}
return same;
}
namespace {
void Set16BitValue(uint8 dest[2], uint16 value) {
dest[0] = value & 0xFFu;
dest[1] = value >> 8;
}
void Set32BitValue(uint8 dest[4], uint32 value) {
dest[0] = (value >> 0) & 0xFFu;
dest[1] = (value >> 8) & 0xFFu;
dest[2] = (value >> 16) & 0xFFu;
dest[3] = (value >> 24) & 0xFFu;
}
struct BitmapHeaderFile {
uint8 magic[2];
uint8 size[4];
uint8 reserved[4];
uint8 offset[4];
};
struct BitmapInfoHeader{
uint8 size[4];
uint8 width[4];
uint8 height[4];
uint8 planes[2];
uint8 bit_count[2];
uint8 compression[4];
uint8 size_image[4];
uint8 x_pels_per_meter[4];
uint8 y_pels_per_meter[4];
uint8 clr_used[4];
uint8 clr_important[4];
};
}
bool GLTestHelper::SaveBackbufferAsBMP(
const char* filename, int width, int height) {
FILE* fp = fopen(filename, "wb");
EXPECT_TRUE(fp != NULL);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
int num_pixels = width * height;
int size = num_pixels * 4;
scoped_array<uint8> data(new uint8[size]);
uint8* pixels = data.get();
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
// RGBA to BGRA
for (int ii = 0; ii < num_pixels; ++ii) {
int offset = ii * 4;
uint8 t = pixels[offset + 0];
pixels[offset + 0] = pixels[offset + 2];
pixels[offset + 2] = t;
}
BitmapHeaderFile bhf;
BitmapInfoHeader bih;
bhf.magic[0] = 'B';
bhf.magic[1] = 'M';
Set32BitValue(bhf.size, 0);
Set32BitValue(bhf.reserved, 0);
Set32BitValue(bhf.offset, sizeof(bhf) + sizeof(bih));
Set32BitValue(bih.size, sizeof(bih));
Set32BitValue(bih.width, width);
Set32BitValue(bih.height, height);
Set16BitValue(bih.planes, 1);
Set16BitValue(bih.bit_count, 32);
Set32BitValue(bih.compression, 0);
Set32BitValue(bih.x_pels_per_meter, 0);
Set32BitValue(bih.y_pels_per_meter, 0);
Set32BitValue(bih.clr_used, 0);
Set32BitValue(bih.clr_important, 0);
fwrite(&bhf, sizeof(bhf), 1, fp);
fwrite(&bih, sizeof(bih), 1, fp);
fwrite(pixels, size, 1, fp);
fclose(fp);
return true;
}
int GLTestHelper::RunTests(int argc, char** argv) {
testing::InitGoogleMock(&argc, argv);
return RUN_ALL_TESTS();
}
| [
"rjogrady@google.com"
] | rjogrady@google.com |
d9a37944dd7a6462166a9145ab90af680521f6a0 | cf61237a3ead16fe2f76f4a908229c34891ea0a4 | /Vexix/tinyxml2.h | afa050403e4667838bfd46dd31900e28b7abe983 | [] | no_license | tedajax/vexix | d609cc8aef4a2b2e31495682f48702bcdf612a37 | 4ff31b2b99d1bf1b927ba46fe00503656bada458 | refs/heads/master | 2020-04-16T01:52:37.747326 | 2014-09-08T02:03:03 | 2014-09-08T02:03:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 58,942 | h | /*
Original code by Lee Thomason (www.grinninglizard.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#ifndef TINYXML2_INCLUDED
#define TINYXML2_INCLUDED
#if defined(ANDROID_NDK) || defined(__BORLANDC__)
# include <ctype.h>
# include <limits.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <stdarg.h>
#else
# include <cctype>
# include <climits>
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cstdarg>
#endif
/*
TODO: intern strings instead of allocation.
*/
/*
gcc:
g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe
Formatting, Artistic Style:
AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h
*/
#if defined( _DEBUG ) || defined( DEBUG ) || defined (__DEBUG__)
# ifndef DEBUG
# define DEBUG
# endif
#endif
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4251)
#endif
#ifdef _WIN32
# ifdef TINYXML2_EXPORT
# define TINYXML2_LIB __declspec(dllexport)
# elif defined(TINYXML2_IMPORT)
# define TINYXML2_LIB __declspec(dllimport)
# else
# define TINYXML2_LIB
# endif
#else
# define TINYXML2_LIB
#endif
#if defined(DEBUG)
# if defined(_MSC_VER)
# define TIXMLASSERT( x ) if ( !(x)) { __debugbreak(); } //if ( !(x)) WinDebugBreak()
# elif defined (ANDROID_NDK)
# include <android/log.h>
# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }
# else
# include <assert.h>
# define TIXMLASSERT assert
# endif
# else
# define TIXMLASSERT( x ) {}
#endif
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
// Microsoft visual studio, version 2005 and higher.
/*int _snprintf_s(
char *buffer,
size_t sizeOfBuffer,
size_t count,
const char *format [,
argument] ...
);*/
inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )
{
va_list va;
va_start( va, format );
int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va );
va_end( va );
return result;
}
#define TIXML_SSCANF sscanf_s
#else
// GCC version 3 and higher
//#warning( "Using sn* functions." )
#define TIXML_SNPRINTF snprintf
#define TIXML_SSCANF sscanf
#endif
static const int TIXML2_MAJOR_VERSION = 1;
static const int TIXML2_MINOR_VERSION = 0;
static const int TIXML2_PATCH_VERSION = 12;
namespace tinyxml2
{
class XMLDocument;
class XMLElement;
class XMLAttribute;
class XMLComment;
class XMLText;
class XMLDeclaration;
class XMLUnknown;
class XMLPrinter;
/*
A class that wraps strings. Normally stores the start and end
pointers into the XML file itself, and will apply normalization
and entity translation if actually read. Can also store (and memory
manage) a traditional char[]
*/
class StrPair
{
public:
enum {
NEEDS_ENTITY_PROCESSING = 0x01,
NEEDS_NEWLINE_NORMALIZATION = 0x02,
COLLAPSE_WHITESPACE = 0x04,
TEXT_ELEMENT = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,
TEXT_ELEMENT_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION,
ATTRIBUTE_NAME = 0,
ATTRIBUTE_VALUE = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,
ATTRIBUTE_VALUE_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION,
COMMENT = NEEDS_NEWLINE_NORMALIZATION
};
StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {}
~StrPair();
void Set( char* start, char* end, int flags ) {
Reset();
_start = start;
_end = end;
_flags = flags | NEEDS_FLUSH;
}
const char* GetStr();
bool Empty() const {
return _start == _end;
}
void SetInternedStr( const char* str ) {
Reset();
_start = const_cast<char*>(str);
}
void SetStr( const char* str, int flags=0 );
char* ParseText( char* in, const char* endTag, int strFlags );
char* ParseName( char* in );
private:
void Reset();
void CollapseWhitespace();
enum {
NEEDS_FLUSH = 0x100,
NEEDS_DELETE = 0x200
};
// After parsing, if *_end != 0, it can be set to zero.
int _flags;
char* _start;
char* _end;
};
/*
A dynamic array of Plain Old Data. Doesn't support constructors, etc.
Has a small initial memory pool, so that low or no usage will not
cause a call to new/delete
*/
template <class T, int INIT>
class DynArray
{
public:
DynArray< T, INIT >() {
_mem = _pool;
_allocated = INIT;
_size = 0;
}
~DynArray() {
if ( _mem != _pool ) {
delete [] _mem;
}
}
void Clear() {
_size = 0;
}
void Push( T t ) {
EnsureCapacity( _size+1 );
_mem[_size++] = t;
}
T* PushArr( int count ) {
EnsureCapacity( _size+count );
T* ret = &_mem[_size];
_size += count;
return ret;
}
T Pop() {
return _mem[--_size];
}
void PopArr( int count ) {
TIXMLASSERT( _size >= count );
_size -= count;
}
bool Empty() const {
return _size == 0;
}
T& operator[](int i) {
TIXMLASSERT( i>= 0 && i < _size );
return _mem[i];
}
const T& operator[](int i) const {
TIXMLASSERT( i>= 0 && i < _size );
return _mem[i];
}
const T& PeekTop() const {
TIXMLASSERT( _size > 0 );
return _mem[ _size - 1];
}
int Size() const {
return _size;
}
int Capacity() const {
return _allocated;
}
const T* Mem() const {
return _mem;
}
T* Mem() {
return _mem;
}
private:
void EnsureCapacity( int cap ) {
if ( cap > _allocated ) {
int newAllocated = cap * 2;
T* newMem = new T[newAllocated];
memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs
if ( _mem != _pool ) {
delete [] _mem;
}
_mem = newMem;
_allocated = newAllocated;
}
}
T* _mem;
T _pool[INIT];
int _allocated; // objects allocated
int _size; // number objects in use
};
/*
Parent virtual class of a pool for fast allocation
and deallocation of objects.
*/
class MemPool
{
public:
MemPool() {}
virtual ~MemPool() {}
virtual int ItemSize() const = 0;
virtual void* Alloc() = 0;
virtual void Free( void* ) = 0;
virtual void SetTracked() = 0;
};
/*
Template child class to create pools of the correct type.
*/
template< int SIZE >
class MemPoolT : public MemPool
{
public:
MemPoolT() : _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {}
~MemPoolT() {
// Delete the blocks.
for( int i=0; i<_blockPtrs.Size(); ++i ) {
delete _blockPtrs[i];
}
}
virtual int ItemSize() const {
return SIZE;
}
int CurrentAllocs() const {
return _currentAllocs;
}
virtual void* Alloc() {
if ( !_root ) {
// Need a new block.
Block* block = new Block();
_blockPtrs.Push( block );
for( int i=0; i<COUNT-1; ++i ) {
block->chunk[i].next = &block->chunk[i+1];
}
block->chunk[COUNT-1].next = 0;
_root = block->chunk;
}
void* result = _root;
_root = _root->next;
++_currentAllocs;
if ( _currentAllocs > _maxAllocs ) {
_maxAllocs = _currentAllocs;
}
_nAllocs++;
_nUntracked++;
return result;
}
virtual void Free( void* mem ) {
if ( !mem ) {
return;
}
--_currentAllocs;
Chunk* chunk = (Chunk*)mem;
#ifdef DEBUG
memset( chunk, 0xfe, sizeof(Chunk) );
#endif
chunk->next = _root;
_root = chunk;
}
void Trace( const char* name ) {
printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n",
name, _maxAllocs, _maxAllocs*SIZE/1024, _currentAllocs, SIZE, _nAllocs, _blockPtrs.Size() );
}
void SetTracked() {
_nUntracked--;
}
int Untracked() const {
return _nUntracked;
}
// This number is perf sensitive. 4k seems like a good tradeoff on my machine.
// The test file is large, 170k.
// Release: VS2010 gcc(no opt)
// 1k: 4000
// 2k: 4000
// 4k: 3900 21000
// 16k: 5200
// 32k: 4300
// 64k: 4000 21000
enum { COUNT = (4*1024)/SIZE }; // Some compilers do not accept to use COUNT in private part if COUNT is private
private:
union Chunk {
Chunk* next;
char mem[SIZE];
};
struct Block {
Chunk chunk[COUNT];
};
DynArray< Block*, 10 > _blockPtrs;
Chunk* _root;
int _currentAllocs;
int _nAllocs;
int _maxAllocs;
int _nUntracked;
};
/**
Implements the interface to the "Visitor pattern" (see the Accept() method.)
If you call the Accept() method, it requires being passed a XMLVisitor
class to handle callbacks. For nodes that contain other nodes (Document, Element)
you will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs
are simply called with Visit().
If you return 'true' from a Visit method, recursive parsing will continue. If you return
false, <b>no children of this node or its siblings</b> will be visited.
All flavors of Visit methods have a default implementation that returns 'true' (continue
visiting). You need to only override methods that are interesting to you.
Generally Accept() is called on the XMLDocument, although all nodes support visiting.
You should never change the document from a callback.
@sa XMLNode::Accept()
*/
class TINYXML2_LIB XMLVisitor
{
public:
virtual ~XMLVisitor() {}
/// Visit a document.
virtual bool VisitEnter( const XMLDocument& /*doc*/ ) {
return true;
}
/// Visit a document.
virtual bool VisitExit( const XMLDocument& /*doc*/ ) {
return true;
}
/// Visit an element.
virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ ) {
return true;
}
/// Visit an element.
virtual bool VisitExit( const XMLElement& /*element*/ ) {
return true;
}
/// Visit a declaration.
virtual bool Visit( const XMLDeclaration& /*declaration*/ ) {
return true;
}
/// Visit a text node.
virtual bool Visit( const XMLText& /*text*/ ) {
return true;
}
/// Visit a comment node.
virtual bool Visit( const XMLComment& /*comment*/ ) {
return true;
}
/// Visit an unknown node.
virtual bool Visit( const XMLUnknown& /*unknown*/ ) {
return true;
}
};
/*
Utility functionality.
*/
class XMLUtil
{
public:
// Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't
// correct, but simple, and usually works.
static const char* SkipWhiteSpace( const char* p ) {
while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast<const unsigned char*>(p) ) ) {
++p;
}
return p;
}
static char* SkipWhiteSpace( char* p ) {
while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast<unsigned char*>(p) ) ) {
++p;
}
return p;
}
static bool IsWhiteSpace( char p ) {
return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );
}
inline static bool IsNameStartChar( unsigned char ch ) {
return ( ( ch < 128 ) ? isalpha( ch ) : 1 )
|| ch == ':'
|| ch == '_';
}
inline static bool IsNameChar( unsigned char ch ) {
return IsNameStartChar( ch )
|| isdigit( ch )
|| ch == '.'
|| ch == '-';
}
inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) {
int n = 0;
if ( p == q ) {
return true;
}
while( *p && *q && *p == *q && n<nChar ) {
++p;
++q;
++n;
}
if ( (n == nChar) || ( *p == 0 && *q == 0 ) ) {
return true;
}
return false;
}
inline static int IsUTF8Continuation( const char p ) {
return p & 0x80;
}
static const char* ReadBOM( const char* p, bool* hasBOM );
// p is the starting location,
// the UTF-8 value of the entity will be placed in value, and length filled in.
static const char* GetCharacterRef( const char* p, char* value, int* length );
static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );
// converts primitive types to strings
static void ToStr( int v, char* buffer, int bufferSize );
static void ToStr( unsigned v, char* buffer, int bufferSize );
static void ToStr( bool v, char* buffer, int bufferSize );
static void ToStr( float v, char* buffer, int bufferSize );
static void ToStr( double v, char* buffer, int bufferSize );
// converts strings to primitive types
static bool ToInt( const char* str, int* value );
static bool ToUnsigned( const char* str, unsigned* value );
static bool ToBool( const char* str, bool* value );
static bool ToFloat( const char* str, float* value );
static bool ToDouble( const char* str, double* value );
};
/** XMLNode is a base class for every object that is in the
XML Document Object Model (DOM), except XMLAttributes.
Nodes have siblings, a parent, and children which can
be navigated. A node is always in a XMLDocument.
The type of a XMLNode can be queried, and it can
be cast to its more defined type.
A XMLDocument allocates memory for all its Nodes.
When the XMLDocument gets deleted, all its Nodes
will also be deleted.
@verbatim
A Document can contain: Element (container or leaf)
Comment (leaf)
Unknown (leaf)
Declaration( leaf )
An Element can contain: Element (container or leaf)
Text (leaf)
Attributes (not on tree)
Comment (leaf)
Unknown (leaf)
@endverbatim
*/
class TINYXML2_LIB XMLNode
{
friend class XMLDocument;
friend class XMLElement;
public:
/// Get the XMLDocument that owns this XMLNode.
const XMLDocument* GetDocument() const {
return _document;
}
/// Get the XMLDocument that owns this XMLNode.
XMLDocument* GetDocument() {
return _document;
}
/// Safely cast to an Element, or null.
virtual XMLElement* ToElement() {
return 0;
}
/// Safely cast to Text, or null.
virtual XMLText* ToText() {
return 0;
}
/// Safely cast to a Comment, or null.
virtual XMLComment* ToComment() {
return 0;
}
/// Safely cast to a Document, or null.
virtual XMLDocument* ToDocument() {
return 0;
}
/// Safely cast to a Declaration, or null.
virtual XMLDeclaration* ToDeclaration() {
return 0;
}
/// Safely cast to an Unknown, or null.
virtual XMLUnknown* ToUnknown() {
return 0;
}
virtual const XMLElement* ToElement() const {
return 0;
}
virtual const XMLText* ToText() const {
return 0;
}
virtual const XMLComment* ToComment() const {
return 0;
}
virtual const XMLDocument* ToDocument() const {
return 0;
}
virtual const XMLDeclaration* ToDeclaration() const {
return 0;
}
virtual const XMLUnknown* ToUnknown() const {
return 0;
}
/** The meaning of 'value' changes for the specific type.
@verbatim
Document: empty
Element: name of the element
Comment: the comment text
Unknown: the tag contents
Text: the text string
@endverbatim
*/
const char* Value() const;
/** Set the Value of an XML node.
@sa Value()
*/
void SetValue( const char* val, bool staticMem=false );
/// Get the parent of this node on the DOM.
const XMLNode* Parent() const {
return _parent;
}
XMLNode* Parent() {
return _parent;
}
/// Returns true if this node has no children.
bool NoChildren() const {
return !_firstChild;
}
/// Get the first child node, or null if none exists.
const XMLNode* FirstChild() const {
return _firstChild;
}
XMLNode* FirstChild() {
return _firstChild;
}
/** Get the first child element, or optionally the first child
element with the specified name.
*/
const XMLElement* FirstChildElement( const char* value=0 ) const;
XMLElement* FirstChildElement( const char* value=0 ) {
return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( value ));
}
/// Get the last child node, or null if none exists.
const XMLNode* LastChild() const {
return _lastChild;
}
XMLNode* LastChild() {
return const_cast<XMLNode*>(const_cast<const XMLNode*>(this)->LastChild() );
}
/** Get the last child element or optionally the last child
element with the specified name.
*/
const XMLElement* LastChildElement( const char* value=0 ) const;
XMLElement* LastChildElement( const char* value=0 ) {
return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(value) );
}
/// Get the previous (left) sibling node of this node.
const XMLNode* PreviousSibling() const {
return _prev;
}
XMLNode* PreviousSibling() {
return _prev;
}
/// Get the previous (left) sibling element of this node, with an optionally supplied name.
const XMLElement* PreviousSiblingElement( const char* value=0 ) const ;
XMLElement* PreviousSiblingElement( const char* value=0 ) {
return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( value ) );
}
/// Get the next (right) sibling node of this node.
const XMLNode* NextSibling() const {
return _next;
}
XMLNode* NextSibling() {
return _next;
}
/// Get the next (right) sibling element of this node, with an optionally supplied name.
const XMLElement* NextSiblingElement( const char* value=0 ) const;
XMLElement* NextSiblingElement( const char* value=0 ) {
return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( value ) );
}
/**
Add a child node as the last (right) child.
If the child node is already part of the document,
it is moved from its old location to the new location.
Returns the addThis argument or 0 if the node does not
belong to the same document.
*/
XMLNode* InsertEndChild( XMLNode* addThis );
XMLNode* LinkEndChild( XMLNode* addThis ) {
return InsertEndChild( addThis );
}
/**
Add a child node as the first (left) child.
If the child node is already part of the document,
it is moved from its old location to the new location.
Returns the addThis argument or 0 if the node does not
belong to the same document.
*/
XMLNode* InsertFirstChild( XMLNode* addThis );
/**
Add a node after the specified child node.
If the child node is already part of the document,
it is moved from its old location to the new location.
Returns the addThis argument or 0 if the afterThis node
is not a child of this node, or if the node does not
belong to the same document.
*/
XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis );
/**
Delete all the children of this node.
*/
void DeleteChildren();
/**
Delete a child of this node.
*/
void DeleteChild( XMLNode* node );
/**
Make a copy of this node, but not its children.
You may pass in a Document pointer that will be
the owner of the new Node. If the 'document' is
null, then the node returned will be allocated
from the current Document. (this->GetDocument())
Note: if called on a XMLDocument, this will return null.
*/
virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0;
/**
Test if 2 nodes are the same, but don't test children.
The 2 nodes do not need to be in the same Document.
Note: if called on a XMLDocument, this will return false.
*/
virtual bool ShallowEqual( const XMLNode* compare ) const = 0;
/** Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the
XML tree will be conditionally visited and the host will be called back
via the XMLVisitor interface.
This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse
the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this
interface versus any other.)
The interface has been based on ideas from:
- http://www.saxproject.org/
- http://c2.com/cgi/wiki?HierarchicalVisitorPattern
Which are both good references for "visiting".
An example of using Accept():
@verbatim
XMLPrinter printer;
tinyxmlDoc.Accept( &printer );
const char* xmlcstr = printer.CStr();
@endverbatim
*/
virtual bool Accept( XMLVisitor* visitor ) const = 0;
// internal
virtual char* ParseDeep( char*, StrPair* );
protected:
XMLNode( XMLDocument* );
virtual ~XMLNode();
XMLNode( const XMLNode& ); // not supported
XMLNode& operator=( const XMLNode& ); // not supported
XMLDocument* _document;
XMLNode* _parent;
mutable StrPair _value;
XMLNode* _firstChild;
XMLNode* _lastChild;
XMLNode* _prev;
XMLNode* _next;
private:
MemPool* _memPool;
void Unlink( XMLNode* child );
};
/** XML text.
Note that a text node can have child element nodes, for example:
@verbatim
<root>This is <b>bold</b></root>
@endverbatim
A text node can have 2 ways to output the next. "normal" output
and CDATA. It will default to the mode it was parsed from the XML file and
you generally want to leave it alone, but you can change the output mode with
SetCData() and query it with CData().
*/
class TINYXML2_LIB XMLText : public XMLNode
{
friend class XMLBase;
friend class XMLDocument;
public:
virtual bool Accept( XMLVisitor* visitor ) const;
virtual XMLText* ToText() {
return this;
}
virtual const XMLText* ToText() const {
return this;
}
/// Declare whether this should be CDATA or standard text.
void SetCData( bool isCData ) {
_isCData = isCData;
}
/// Returns true if this is a CDATA text element.
bool CData() const {
return _isCData;
}
char* ParseDeep( char*, StrPair* endTag );
virtual XMLNode* ShallowClone( XMLDocument* document ) const;
virtual bool ShallowEqual( const XMLNode* compare ) const;
protected:
XMLText( XMLDocument* doc ) : XMLNode( doc ), _isCData( false ) {}
virtual ~XMLText() {}
XMLText( const XMLText& ); // not supported
XMLText& operator=( const XMLText& ); // not supported
private:
bool _isCData;
};
/** An XML Comment. */
class TINYXML2_LIB XMLComment : public XMLNode
{
friend class XMLDocument;
public:
virtual XMLComment* ToComment() {
return this;
}
virtual const XMLComment* ToComment() const {
return this;
}
virtual bool Accept( XMLVisitor* visitor ) const;
char* ParseDeep( char*, StrPair* endTag );
virtual XMLNode* ShallowClone( XMLDocument* document ) const;
virtual bool ShallowEqual( const XMLNode* compare ) const;
protected:
XMLComment( XMLDocument* doc );
virtual ~XMLComment();
XMLComment( const XMLComment& ); // not supported
XMLComment& operator=( const XMLComment& ); // not supported
private:
};
/** In correct XML the declaration is the first entry in the file.
@verbatim
<?xml version="1.0" standalone="yes"?>
@endverbatim
TinyXML-2 will happily read or write files without a declaration,
however.
The text of the declaration isn't interpreted. It is parsed
and written as a string.
*/
class TINYXML2_LIB XMLDeclaration : public XMLNode
{
friend class XMLDocument;
public:
virtual XMLDeclaration* ToDeclaration() {
return this;
}
virtual const XMLDeclaration* ToDeclaration() const {
return this;
}
virtual bool Accept( XMLVisitor* visitor ) const;
char* ParseDeep( char*, StrPair* endTag );
virtual XMLNode* ShallowClone( XMLDocument* document ) const;
virtual bool ShallowEqual( const XMLNode* compare ) const;
protected:
XMLDeclaration( XMLDocument* doc );
virtual ~XMLDeclaration();
XMLDeclaration( const XMLDeclaration& ); // not supported
XMLDeclaration& operator=( const XMLDeclaration& ); // not supported
};
/** Any tag that TinyXML-2 doesn't recognize is saved as an
unknown. It is a tag of text, but should not be modified.
It will be written back to the XML, unchanged, when the file
is saved.
DTD tags get thrown into XMLUnknowns.
*/
class TINYXML2_LIB XMLUnknown : public XMLNode
{
friend class XMLDocument;
public:
virtual XMLUnknown* ToUnknown() {
return this;
}
virtual const XMLUnknown* ToUnknown() const {
return this;
}
virtual bool Accept( XMLVisitor* visitor ) const;
char* ParseDeep( char*, StrPair* endTag );
virtual XMLNode* ShallowClone( XMLDocument* document ) const;
virtual bool ShallowEqual( const XMLNode* compare ) const;
protected:
XMLUnknown( XMLDocument* doc );
virtual ~XMLUnknown();
XMLUnknown( const XMLUnknown& ); // not supported
XMLUnknown& operator=( const XMLUnknown& ); // not supported
};
enum XMLError {
XML_NO_ERROR = 0,
XML_SUCCESS = 0,
XML_NO_ATTRIBUTE,
XML_WRONG_ATTRIBUTE_TYPE,
XML_ERROR_FILE_NOT_FOUND,
XML_ERROR_FILE_COULD_NOT_BE_OPENED,
XML_ERROR_FILE_READ_ERROR,
XML_ERROR_ELEMENT_MISMATCH,
XML_ERROR_PARSING_ELEMENT,
XML_ERROR_PARSING_ATTRIBUTE,
XML_ERROR_IDENTIFYING_TAG,
XML_ERROR_PARSING_TEXT,
XML_ERROR_PARSING_CDATA,
XML_ERROR_PARSING_COMMENT,
XML_ERROR_PARSING_DECLARATION,
XML_ERROR_PARSING_UNKNOWN,
XML_ERROR_EMPTY_DOCUMENT,
XML_ERROR_MISMATCHED_ELEMENT,
XML_ERROR_PARSING,
XML_CAN_NOT_CONVERT_TEXT,
XML_NO_TEXT_NODE
};
/** An attribute is a name-value pair. Elements have an arbitrary
number of attributes, each with a unique name.
@note The attributes are not XMLNodes. You may only query the
Next() attribute in a list.
*/
class TINYXML2_LIB XMLAttribute
{
friend class XMLElement;
public:
/// The name of the attribute.
const char* Name() const;
/// The value of the attribute.
const char* Value() const;
/// The next attribute in the list.
const XMLAttribute* Next() const {
return _next;
}
/** IntValue interprets the attribute as an integer, and returns the value.
If the value isn't an integer, 0 will be returned. There is no error checking;
use QueryIntValue() if you need error checking.
*/
int IntValue() const {
int i=0;
QueryIntValue( &i );
return i;
}
/// Query as an unsigned integer. See IntValue()
unsigned UnsignedValue() const {
unsigned i=0;
QueryUnsignedValue( &i );
return i;
}
/// Query as a boolean. See IntValue()
bool BoolValue() const {
bool b=false;
QueryBoolValue( &b );
return b;
}
/// Query as a double. See IntValue()
double DoubleValue() const {
double d=0;
QueryDoubleValue( &d );
return d;
}
/// Query as a float. See IntValue()
float FloatValue() const {
float f=0;
QueryFloatValue( &f );
return f;
}
/** QueryIntValue interprets the attribute as an integer, and returns the value
in the provided parameter. The function will return XML_NO_ERROR on success,
and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.
*/
XMLError QueryIntValue( int* value ) const;
/// See QueryIntValue
XMLError QueryUnsignedValue( unsigned int* value ) const;
/// See QueryIntValue
XMLError QueryBoolValue( bool* value ) const;
/// See QueryIntValue
XMLError QueryDoubleValue( double* value ) const;
/// See QueryIntValue
XMLError QueryFloatValue( float* value ) const;
/// Set the attribute to a string value.
void SetAttribute( const char* value );
/// Set the attribute to value.
void SetAttribute( int value );
/// Set the attribute to value.
void SetAttribute( unsigned value );
/// Set the attribute to value.
void SetAttribute( bool value );
/// Set the attribute to value.
void SetAttribute( double value );
/// Set the attribute to value.
void SetAttribute( float value );
private:
enum { BUF_SIZE = 200 };
XMLAttribute() : _next( 0 ), _memPool( 0 ) {}
virtual ~XMLAttribute() {}
XMLAttribute( const XMLAttribute& ); // not supported
void operator=( const XMLAttribute& ); // not supported
void SetName( const char* name );
char* ParseDeep( char* p, bool processEntities );
mutable StrPair _name;
mutable StrPair _value;
XMLAttribute* _next;
MemPool* _memPool;
};
/** The element is a container class. It has a value, the element name,
and can contain other elements, text, comments, and unknowns.
Elements also contain an arbitrary number of attributes.
*/
class TINYXML2_LIB XMLElement : public XMLNode
{
friend class XMLBase;
friend class XMLDocument;
public:
/// Get the name of an element (which is the Value() of the node.)
const char* Name() const {
return Value();
}
/// Set the name of the element.
void SetName( const char* str, bool staticMem=false ) {
SetValue( str, staticMem );
}
virtual XMLElement* ToElement() {
return this;
}
virtual const XMLElement* ToElement() const {
return this;
}
virtual bool Accept( XMLVisitor* visitor ) const;
/** Given an attribute name, Attribute() returns the value
for the attribute of that name, or null if none
exists. For example:
@verbatim
const char* value = ele->Attribute( "foo" );
@endverbatim
The 'value' parameter is normally null. However, if specified,
the attribute will only be returned if the 'name' and 'value'
match. This allow you to write code:
@verbatim
if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar();
@endverbatim
rather than:
@verbatim
if ( ele->Attribute( "foo" ) ) {
if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar();
}
@endverbatim
*/
const char* Attribute( const char* name, const char* value=0 ) const;
/** Given an attribute name, IntAttribute() returns the value
of the attribute interpreted as an integer. 0 will be
returned if there is an error. For a method with error
checking, see QueryIntAttribute()
*/
int IntAttribute( const char* name ) const {
int i=0;
QueryIntAttribute( name, &i );
return i;
}
/// See IntAttribute()
unsigned UnsignedAttribute( const char* name ) const {
unsigned i=0;
QueryUnsignedAttribute( name, &i );
return i;
}
/// See IntAttribute()
bool BoolAttribute( const char* name ) const {
bool b=false;
QueryBoolAttribute( name, &b );
return b;
}
/// See IntAttribute()
double DoubleAttribute( const char* name ) const {
double d=0;
QueryDoubleAttribute( name, &d );
return d;
}
/// See IntAttribute()
float FloatAttribute( const char* name ) const {
float f=0;
QueryFloatAttribute( name, &f );
return f;
}
/** Given an attribute name, QueryIntAttribute() returns
XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion
can't be performed, or XML_NO_ATTRIBUTE if the attribute
doesn't exist. If successful, the result of the conversion
will be written to 'value'. If not successful, nothing will
be written to 'value'. This allows you to provide default
value:
@verbatim
int value = 10;
QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10
@endverbatim
*/
XMLError QueryIntAttribute( const char* name, int* value ) const {
const XMLAttribute* a = FindAttribute( name );
if ( !a ) {
return XML_NO_ATTRIBUTE;
}
return a->QueryIntValue( value );
}
/// See QueryIntAttribute()
XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const {
const XMLAttribute* a = FindAttribute( name );
if ( !a ) {
return XML_NO_ATTRIBUTE;
}
return a->QueryUnsignedValue( value );
}
/// See QueryIntAttribute()
XMLError QueryBoolAttribute( const char* name, bool* value ) const {
const XMLAttribute* a = FindAttribute( name );
if ( !a ) {
return XML_NO_ATTRIBUTE;
}
return a->QueryBoolValue( value );
}
/// See QueryIntAttribute()
XMLError QueryDoubleAttribute( const char* name, double* value ) const {
const XMLAttribute* a = FindAttribute( name );
if ( !a ) {
return XML_NO_ATTRIBUTE;
}
return a->QueryDoubleValue( value );
}
/// See QueryIntAttribute()
XMLError QueryFloatAttribute( const char* name, float* value ) const {
const XMLAttribute* a = FindAttribute( name );
if ( !a ) {
return XML_NO_ATTRIBUTE;
}
return a->QueryFloatValue( value );
}
/** Given an attribute name, QueryAttribute() returns
XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion
can't be performed, or XML_NO_ATTRIBUTE if the attribute
doesn't exist. It is overloaded for the primitive types,
and is a generally more convenient replacement of
QueryIntAttribute() and related functions.
If successful, the result of the conversion
will be written to 'value'. If not successful, nothing will
be written to 'value'. This allows you to provide default
value:
@verbatim
int value = 10;
QueryAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10
@endverbatim
*/
int QueryAttribute( const char* name, int* value ) const {
return QueryIntAttribute( name, value );
}
int QueryAttribute( const char* name, unsigned int* value ) const {
return QueryUnsignedAttribute( name, value );
}
int QueryAttribute( const char* name, bool* value ) const {
return QueryBoolAttribute( name, value );
}
int QueryAttribute( const char* name, double* value ) const {
return QueryDoubleAttribute( name, value );
}
int QueryAttribute( const char* name, float* value ) const {
return QueryFloatAttribute( name, value );
}
/// Sets the named attribute to value.
void SetAttribute( const char* name, const char* value ) {
XMLAttribute* a = FindOrCreateAttribute( name );
a->SetAttribute( value );
}
/// Sets the named attribute to value.
void SetAttribute( const char* name, int value ) {
XMLAttribute* a = FindOrCreateAttribute( name );
a->SetAttribute( value );
}
/// Sets the named attribute to value.
void SetAttribute( const char* name, unsigned value ) {
XMLAttribute* a = FindOrCreateAttribute( name );
a->SetAttribute( value );
}
/// Sets the named attribute to value.
void SetAttribute( const char* name, bool value ) {
XMLAttribute* a = FindOrCreateAttribute( name );
a->SetAttribute( value );
}
/// Sets the named attribute to value.
void SetAttribute( const char* name, double value ) {
XMLAttribute* a = FindOrCreateAttribute( name );
a->SetAttribute( value );
}
/**
Delete an attribute.
*/
void DeleteAttribute( const char* name );
/// Return the first attribute in the list.
const XMLAttribute* FirstAttribute() const {
return _rootAttribute;
}
/// Query a specific attribute in the list.
const XMLAttribute* FindAttribute( const char* name ) const;
/** Convenience function for easy access to the text inside an element. Although easy
and concise, GetText() is limited compared to getting the XMLText child
and accessing it directly.
If the first child of 'this' is a XMLText, the GetText()
returns the character string of the Text node, else null is returned.
This is a convenient method for getting the text of simple contained text:
@verbatim
<foo>This is text</foo>
const char* str = fooElement->GetText();
@endverbatim
'str' will be a pointer to "This is text".
Note that this function can be misleading. If the element foo was created from
this XML:
@verbatim
<foo><b>This is text</b></foo>
@endverbatim
then the value of str would be null. The first child node isn't a text node, it is
another element. From this XML:
@verbatim
<foo>This is <b>text</b></foo>
@endverbatim
GetText() will return "This is ".
*/
const char* GetText() const;
/**
Convenience method to query the value of a child text node. This is probably best
shown by example. Given you have a document is this form:
@verbatim
<point>
<x>1</x>
<y>1.4</y>
</point>
@endverbatim
The QueryIntText() and similar functions provide a safe and easier way to get to the
"value" of x and y.
@verbatim
int x = 0;
float y = 0; // types of x and y are contrived for example
const XMLElement* xElement = pointElement->FirstChildElement( "x" );
const XMLElement* yElement = pointElement->FirstChildElement( "y" );
xElement->QueryIntText( &x );
yElement->QueryFloatText( &y );
@endverbatim
@returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted
to the requested type, and XML_NO_TEXT_NODE if there is no child text to query.
*/
XMLError QueryIntText( int* ival ) const;
/// See QueryIntText()
XMLError QueryUnsignedText( unsigned* uval ) const;
/// See QueryIntText()
XMLError QueryBoolText( bool* bval ) const;
/// See QueryIntText()
XMLError QueryDoubleText( double* dval ) const;
/// See QueryIntText()
XMLError QueryFloatText( float* fval ) const;
// internal:
enum {
OPEN, // <foo>
CLOSED, // <foo/>
CLOSING // </foo>
};
int ClosingType() const {
return _closingType;
}
char* ParseDeep( char* p, StrPair* endTag );
virtual XMLNode* ShallowClone( XMLDocument* document ) const;
virtual bool ShallowEqual( const XMLNode* compare ) const;
private:
XMLElement( XMLDocument* doc );
virtual ~XMLElement();
XMLElement( const XMLElement& ); // not supported
void operator=( const XMLElement& ); // not supported
XMLAttribute* FindAttribute( const char* name );
XMLAttribute* FindOrCreateAttribute( const char* name );
//void LinkAttribute( XMLAttribute* attrib );
char* ParseAttributes( char* p );
int _closingType;
// The attribute list is ordered; there is no 'lastAttribute'
// because the list needs to be scanned for dupes before adding
// a new attribute.
XMLAttribute* _rootAttribute;
};
enum Whitespace {
PRESERVE_WHITESPACE,
COLLAPSE_WHITESPACE
};
/** A Document binds together all the functionality.
It can be saved, loaded, and printed to the screen.
All Nodes are connected and allocated to a Document.
If the Document is deleted, all its Nodes are also deleted.
*/
class TINYXML2_LIB XMLDocument : public XMLNode
{
friend class XMLElement;
public:
/// constructor
XMLDocument( bool processEntities = true, Whitespace = PRESERVE_WHITESPACE );
~XMLDocument();
virtual XMLDocument* ToDocument() {
return this;
}
virtual const XMLDocument* ToDocument() const {
return this;
}
/**
Parse an XML file from a character string.
Returns XML_NO_ERROR (0) on success, or
an errorID.
You may optionally pass in the 'nBytes', which is
the number of bytes which will be parsed. If not
specified, TinyXML-2 will assume 'xml' points to a
null terminated string.
*/
XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) );
/**
Load an XML file from disk.
Returns XML_NO_ERROR (0) on success, or
an errorID.
*/
XMLError LoadFile( const char* filename );
/**
Load an XML file from disk. You are responsible
for providing and closing the FILE*.
Returns XML_NO_ERROR (0) on success, or
an errorID.
*/
XMLError LoadFile( FILE* );
/**
Save the XML file to disk.
Returns XML_NO_ERROR (0) on success, or
an errorID.
*/
XMLError SaveFile( const char* filename, bool compact = false );
/**
Save the XML file to disk. You are responsible
for providing and closing the FILE*.
Returns XML_NO_ERROR (0) on success, or
an errorID.
*/
XMLError SaveFile( FILE* fp, bool compact = false );
bool ProcessEntities() const {
return _processEntities;
}
Whitespace WhitespaceMode() const {
return _whitespace;
}
/**
Returns true if this document has a leading Byte Order Mark of UTF8.
*/
bool HasBOM() const {
return _writeBOM;
}
/** Sets whether to write the BOM when writing the file.
*/
void SetBOM( bool useBOM ) {
_writeBOM = useBOM;
}
/** Return the root element of DOM. Equivalent to FirstChildElement().
To get the first node, use FirstChild().
*/
XMLElement* RootElement() {
return FirstChildElement();
}
const XMLElement* RootElement() const {
return FirstChildElement();
}
/** Print the Document. If the Printer is not provided, it will
print to stdout. If you provide Printer, this can print to a file:
@verbatim
XMLPrinter printer( fp );
doc.Print( &printer );
@endverbatim
Or you can use a printer to print to memory:
@verbatim
XMLPrinter printer;
doc.Print( &printer );
// printer.CStr() has a const char* to the XML
@endverbatim
*/
void Print( XMLPrinter* streamer=0 ) const;
virtual bool Accept( XMLVisitor* visitor ) const;
/**
Create a new Element associated with
this Document. The memory for the Element
is managed by the Document.
*/
XMLElement* NewElement( const char* name );
/**
Create a new Comment associated with
this Document. The memory for the Comment
is managed by the Document.
*/
XMLComment* NewComment( const char* comment );
/**
Create a new Text associated with
this Document. The memory for the Text
is managed by the Document.
*/
XMLText* NewText( const char* text );
/**
Create a new Declaration associated with
this Document. The memory for the object
is managed by the Document.
If the 'text' param is null, the standard
declaration is used.:
@verbatim
<?xml version="1.0" encoding="UTF-8"?>
@endverbatim
*/
XMLDeclaration* NewDeclaration( const char* text=0 );
/**
Create a new Unknown associated with
this Document. The memory for the object
is managed by the Document.
*/
XMLUnknown* NewUnknown( const char* text );
/**
Delete a node associated with this document.
It will be unlinked from the DOM.
*/
void DeleteNode( XMLNode* node ) {
node->_parent->DeleteChild( node );
}
void SetError( XMLError error, const char* str1, const char* str2 );
/// Return true if there was an error parsing the document.
bool Error() const {
return _errorID != XML_NO_ERROR;
}
/// Return the errorID.
XMLError ErrorID() const {
return _errorID;
}
/// Return a possibly helpful diagnostic location or string.
const char* GetErrorStr1() const {
return _errorStr1;
}
/// Return a possibly helpful secondary diagnostic location or string.
const char* GetErrorStr2() const {
return _errorStr2;
}
/// If there is an error, print it to stdout.
void PrintError() const;
/// Clear the document, resetting it to the initial state.
void Clear();
// internal
char* Identify( char* p, XMLNode** node );
virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const {
return 0;
}
virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const {
return false;
}
private:
XMLDocument( const XMLDocument& ); // not supported
void operator=( const XMLDocument& ); // not supported
bool _writeBOM;
bool _processEntities;
XMLError _errorID;
Whitespace _whitespace;
const char* _errorStr1;
const char* _errorStr2;
char* _charBuffer;
MemPoolT< sizeof(XMLElement) > _elementPool;
MemPoolT< sizeof(XMLAttribute) > _attributePool;
MemPoolT< sizeof(XMLText) > _textPool;
MemPoolT< sizeof(XMLComment) > _commentPool;
};
/**
A XMLHandle is a class that wraps a node pointer with null checks; this is
an incredibly useful thing. Note that XMLHandle is not part of the TinyXML-2
DOM structure. It is a separate utility class.
Take an example:
@verbatim
<Document>
<Element attributeA = "valueA">
<Child attributeB = "value1" />
<Child attributeB = "value2" />
</Element>
</Document>
@endverbatim
Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very
easy to write a *lot* of code that looks like:
@verbatim
XMLElement* root = document.FirstChildElement( "Document" );
if ( root )
{
XMLElement* element = root->FirstChildElement( "Element" );
if ( element )
{
XMLElement* child = element->FirstChildElement( "Child" );
if ( child )
{
XMLElement* child2 = child->NextSiblingElement( "Child" );
if ( child2 )
{
// Finally do something useful.
@endverbatim
And that doesn't even cover "else" cases. XMLHandle addresses the verbosity
of such code. A XMLHandle checks for null pointers so it is perfectly safe
and correct to use:
@verbatim
XMLHandle docHandle( &document );
XMLElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild().NextSibling().ToElement();
if ( child2 )
{
// do something useful
@endverbatim
Which is MUCH more concise and useful.
It is also safe to copy handles - internally they are nothing more than node pointers.
@verbatim
XMLHandle handleCopy = handle;
@endverbatim
See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects.
*/
class TINYXML2_LIB XMLHandle
{
public:
/// Create a handle from any node (at any depth of the tree.) This can be a null pointer.
XMLHandle( XMLNode* node ) {
_node = node;
}
/// Create a handle from a node.
XMLHandle( XMLNode& node ) {
_node = &node;
}
/// Copy constructor
XMLHandle( const XMLHandle& ref ) {
_node = ref._node;
}
/// Assignment
XMLHandle& operator=( const XMLHandle& ref ) {
_node = ref._node;
return *this;
}
/// Get the first child of this handle.
XMLHandle FirstChild() {
return XMLHandle( _node ? _node->FirstChild() : 0 );
}
/// Get the first child element of this handle.
XMLHandle FirstChildElement( const char* value=0 ) {
return XMLHandle( _node ? _node->FirstChildElement( value ) : 0 );
}
/// Get the last child of this handle.
XMLHandle LastChild() {
return XMLHandle( _node ? _node->LastChild() : 0 );
}
/// Get the last child element of this handle.
XMLHandle LastChildElement( const char* _value=0 ) {
return XMLHandle( _node ? _node->LastChildElement( _value ) : 0 );
}
/// Get the previous sibling of this handle.
XMLHandle PreviousSibling() {
return XMLHandle( _node ? _node->PreviousSibling() : 0 );
}
/// Get the previous sibling element of this handle.
XMLHandle PreviousSiblingElement( const char* _value=0 ) {
return XMLHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 );
}
/// Get the next sibling of this handle.
XMLHandle NextSibling() {
return XMLHandle( _node ? _node->NextSibling() : 0 );
}
/// Get the next sibling element of this handle.
XMLHandle NextSiblingElement( const char* _value=0 ) {
return XMLHandle( _node ? _node->NextSiblingElement( _value ) : 0 );
}
/// Safe cast to XMLNode. This can return null.
XMLNode* ToNode() {
return _node;
}
/// Safe cast to XMLElement. This can return null.
XMLElement* ToElement() {
return ( ( _node && _node->ToElement() ) ? _node->ToElement() : 0 );
}
/// Safe cast to XMLText. This can return null.
XMLText* ToText() {
return ( ( _node && _node->ToText() ) ? _node->ToText() : 0 );
}
/// Safe cast to XMLUnknown. This can return null.
XMLUnknown* ToUnknown() {
return ( ( _node && _node->ToUnknown() ) ? _node->ToUnknown() : 0 );
}
/// Safe cast to XMLDeclaration. This can return null.
XMLDeclaration* ToDeclaration() {
return ( ( _node && _node->ToDeclaration() ) ? _node->ToDeclaration() : 0 );
}
private:
XMLNode* _node;
};
/**
A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the
same in all regards, except for the 'const' qualifiers. See XMLHandle for API.
*/
class TINYXML2_LIB XMLConstHandle
{
public:
XMLConstHandle( const XMLNode* node ) {
_node = node;
}
XMLConstHandle( const XMLNode& node ) {
_node = &node;
}
XMLConstHandle( const XMLConstHandle& ref ) {
_node = ref._node;
}
XMLConstHandle& operator=( const XMLConstHandle& ref ) {
_node = ref._node;
return *this;
}
const XMLConstHandle FirstChild() const {
return XMLConstHandle( _node ? _node->FirstChild() : 0 );
}
const XMLConstHandle FirstChildElement( const char* value=0 ) const {
return XMLConstHandle( _node ? _node->FirstChildElement( value ) : 0 );
}
const XMLConstHandle LastChild() const {
return XMLConstHandle( _node ? _node->LastChild() : 0 );
}
const XMLConstHandle LastChildElement( const char* _value=0 ) const {
return XMLConstHandle( _node ? _node->LastChildElement( _value ) : 0 );
}
const XMLConstHandle PreviousSibling() const {
return XMLConstHandle( _node ? _node->PreviousSibling() : 0 );
}
const XMLConstHandle PreviousSiblingElement( const char* _value=0 ) const {
return XMLConstHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 );
}
const XMLConstHandle NextSibling() const {
return XMLConstHandle( _node ? _node->NextSibling() : 0 );
}
const XMLConstHandle NextSiblingElement( const char* _value=0 ) const {
return XMLConstHandle( _node ? _node->NextSiblingElement( _value ) : 0 );
}
const XMLNode* ToNode() const {
return _node;
}
const XMLElement* ToElement() const {
return ( ( _node && _node->ToElement() ) ? _node->ToElement() : 0 );
}
const XMLText* ToText() const {
return ( ( _node && _node->ToText() ) ? _node->ToText() : 0 );
}
const XMLUnknown* ToUnknown() const {
return ( ( _node && _node->ToUnknown() ) ? _node->ToUnknown() : 0 );
}
const XMLDeclaration* ToDeclaration() const {
return ( ( _node && _node->ToDeclaration() ) ? _node->ToDeclaration() : 0 );
}
private:
const XMLNode* _node;
};
/**
Printing functionality. The XMLPrinter gives you more
options than the XMLDocument::Print() method.
It can:
-# Print to memory.
-# Print to a file you provide.
-# Print XML without a XMLDocument.
Print to Memory
@verbatim
XMLPrinter printer;
doc.Print( &printer );
SomeFunction( printer.CStr() );
@endverbatim
Print to a File
You provide the file pointer.
@verbatim
XMLPrinter printer( fp );
doc.Print( &printer );
@endverbatim
Print without a XMLDocument
When loading, an XML parser is very useful. However, sometimes
when saving, it just gets in the way. The code is often set up
for streaming, and constructing the DOM is just overhead.
The Printer supports the streaming case. The following code
prints out a trivially simple XML file without ever creating
an XML document.
@verbatim
XMLPrinter printer( fp );
printer.OpenElement( "foo" );
printer.PushAttribute( "foo", "bar" );
printer.CloseElement();
@endverbatim
*/
class TINYXML2_LIB XMLPrinter : public XMLVisitor
{
public:
/** Construct the printer. If the FILE* is specified,
this will print to the FILE. Else it will print
to memory, and the result is available in CStr().
If 'compact' is set to true, then output is created
with only required whitespace and newlines.
*/
XMLPrinter( FILE* file=0, bool compact = false, int depth = 0 );
virtual ~XMLPrinter() {}
/** If streaming, write the BOM and declaration. */
void PushHeader( bool writeBOM, bool writeDeclaration );
/** If streaming, start writing an element.
The element must be closed with CloseElement()
*/
void OpenElement( const char* name );
/// If streaming, add an attribute to an open element.
void PushAttribute( const char* name, const char* value );
void PushAttribute( const char* name, int value );
void PushAttribute( const char* name, unsigned value );
void PushAttribute( const char* name, bool value );
void PushAttribute( const char* name, double value );
/// If streaming, close the Element.
virtual void CloseElement();
/// Add a text node.
void PushText( const char* text, bool cdata=false );
/// Add a text node from an integer.
void PushText( int value );
/// Add a text node from an unsigned.
void PushText( unsigned value );
/// Add a text node from a bool.
void PushText( bool value );
/// Add a text node from a float.
void PushText( float value );
/// Add a text node from a double.
void PushText( double value );
/// Add a comment
void PushComment( const char* comment );
void PushDeclaration( const char* value );
void PushUnknown( const char* value );
virtual bool VisitEnter( const XMLDocument& /*doc*/ );
virtual bool VisitExit( const XMLDocument& /*doc*/ ) {
return true;
}
virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute );
virtual bool VisitExit( const XMLElement& element );
virtual bool Visit( const XMLText& text );
virtual bool Visit( const XMLComment& comment );
virtual bool Visit( const XMLDeclaration& declaration );
virtual bool Visit( const XMLUnknown& unknown );
/**
If in print to memory mode, return a pointer to
the XML file in memory.
*/
const char* CStr() const {
return _buffer.Mem();
}
/**
If in print to memory mode, return the size
of the XML file in memory. (Note the size returned
includes the terminating null.)
*/
int CStrSize() const {
return _buffer.Size();
}
/**
If in print to memory mode, reset the buffer to the
beginning.
*/
void ClearBuffer() {
_buffer.Clear();
_buffer.Push(0);
}
protected:
void SealElement();
bool _elementJustOpened;
DynArray< const char*, 10 > _stack;
private:
void PrintSpace( int depth );
void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities.
void Print( const char* format, ... );
bool _firstElement;
FILE* _fp;
int _depth;
int _textDepth;
bool _processEntities;
bool _compactMode;
enum {
ENTITY_RANGE = 64,
BUF_SIZE = 200
};
bool _entityFlag[ENTITY_RANGE];
bool _restrictedEntityFlag[ENTITY_RANGE];
DynArray< char, 20 > _buffer;
#ifdef _MSC_VER
DynArray< char, 20 > _accumulator;
#endif
};
} // tinyxml2
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
#endif // TINYXML2_INCLUDED
| [
"ted@tedajax.net"
] | ted@tedajax.net |
38f9b846e3e1b8cc47fd17ae3696a5cb99425da9 | c98365913c93d4e35eebf94d15286aac9266b500 | /src/hpp/dds/xtypes/TDynamicDataFactory.hpp | 8e4a05bde185b069715aa195d6b754a8c34a00ed | [] | no_license | sutambe/dds-psm-cxx | 5646349fc317f215418c30806f58f411c8abb337 | bababd36ed41f0bab0ddca8d60b5ea38e1a7900b | refs/heads/master | 2021-01-16T19:34:56.119255 | 2011-11-08T16:23:41 | 2011-11-08T16:23:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,457 | hpp | #ifndef OMG_DDS_DYNAMIC_DATA_FACTORY_HPP_
#define OMG_DDS_DYNAMIC_DATA_FACTORY_HPP_
/* Copyright 2010, Object Management Group, Inc.
* Copyright 2010, PrismTech, Corp.
* Copyright 2010, Real-Time Innovations, Inc.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <dds/core/detail/conformance.hpp>
#include <dds/core/Reference.hpp>
#include <tdds/xtypes/tdds_xtypes_fwd.hpp>
#ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
template <typename DELEGATE>
class tdds::type::dynamic::DynamicDataFactory : dds::core::Reference<DELEGATE>
{
OMG_DDS_REF_TYPE(DynamicDataFactory, dds::core::Reference, DELEGATE)
public:
static DynamicDataFactory get_instance();
public:
void close();
// TODO: Why no type-param?
dds::type::dynamic::DynamicData create_data();
};
#endif // OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
#endif // !defined(OMG_DDS_DYNAMIC_DATA_FACTORY_HPP_)
| [
"angelo@icorsaro.net"
] | angelo@icorsaro.net |
16a0f62b1bd349a1005a5f045180b683f6f925ef | 7926b330515aa573a810ed9cb298c3de93b007f9 | /陈磊贡献/最小生成树(prim).cpp | 613f1777aabd7b6392787ca9da66d210fa89b878 | [] | no_license | laijirong/NOIP-C-files | 6f1dceae364e41625f3a4ef0e3897ef1c731d0fe | 951af9aa0b287a8c169b6ba03d618ba8ba2e0ae2 | refs/heads/master | 2020-04-20T11:38:00.485181 | 2019-06-16T03:00:55 | 2019-06-16T03:00:55 | 168,822,282 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,169 | cpp | #include<cstdio>
using namespace std;
int n,m,answer;
int head[3010],used[3010],fr[3010],now[3010];
struct s1
{
int val,meter,last;
} map[2000010];
struct s2
{
int met,from;
} point[3010];
void search(int a,int b)
{
used[a]=1;
for(int i=head[a];i!=0;i=map[i].last)
if(used[map[i].val]==0&&map[i].meter<point[map[i].val].met)
{
point[map[i].val].met=map[i].meter;
point[map[i].val].from=a;
}
int t1=0;
for(int i=1;i<=n;i++)
if(used[i]==0&&point[i].met<point[t1].met)
t1=i;
fr[b]=point[t1].from; now[b]=t1;
if(b<n)
{
answer+=point[t1].met;
search(t1,b+1);
}
}
void read(int a,int b,int c,int d)
{
map[d].last=head[a];
map[d].val=b;
map[d].meter=c;
head[a]=d;
}
int main()
{
int xx,yy,zz;
freopen("11268.in","r",stdin);
freopen("11268.out","w",stdout);
scanf("%d%d",&n,&m);
for(int i=2;i<=2*m+1;i+=2)
{
scanf("%d%d%d",&xx,&yy,&zz);
read(xx,yy,zz,i);
read(yy,xx,zz,i^1);
}
for(int i=0;i<=n;i++)
point[i].met=0x7fffffff;
search(1,1);
printf("%d\n%d\n",answer,n-1);
for(int i=1;i<=n-1;i++)
printf("%d %d\n",fr[i],now[i]);
fclose(stdin);
fclose(stdout);
return 0;
}
| [
"laijirong@outlook.com"
] | laijirong@outlook.com |
14be894c741f88c51e8aeac3a36262c4662bd6b5 | bd948e5f06ff215a4ebce0503908c160bdbac9d4 | /HLL/test_type_def/src/type/type/doubletype.h | 6b81ab746c16103e810f53e899e1874ff3fdf1de | [] | no_license | Nuos/LearnCompilers | 46734b16836a621aa6f10083aa9ab5f1cde005ed | abfb28374264bf6a95cf76287fcb1401bdee16dc | refs/heads/master | 2020-09-04T20:32:51.152702 | 2016-06-25T08:26:53 | 2016-06-25T08:26:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 595 | h | #ifndef DOUBLETYPE_H
#define DOUBLETYPE_H
#include "type.h"
namespace qyvlik {
namespace typer {
class DoubleType : public Type
{
public:
DoubleType():
instantiable(TypeInstantiablePtr(new DoubleInstantiable))
{}
QString typeName() const override
{ return "double"; }
TypeWeakPtr baseType() const override
{ return TypeWeakPtr(); }
TypeInstantiablePtr typeInstantiable() const override
{ return instantiable; }
bool isTemplate() const override
{ return false; }
private:
TypeInstantiablePtr instantiable;
};
}
}
#endif // DOUBLETYPE_H
| [
"qyvlik@qq.com"
] | qyvlik@qq.com |
5a5fea770efd075745c7dbba08881b73df4bd2e7 | d09945668f19bb4bc17087c0cb8ccbab2b2dd688 | /atcoder/arc101-150/arc105/c.cpp | 8d827a28a11c5d2b2f4892a8ca4ac35420c99889 | [] | no_license | kmjp/procon | 27270f605f3ae5d80fbdb28708318a6557273a57 | 8083028ece4be1460150aa3f0e69bdb57e510b53 | refs/heads/master | 2023-09-04T11:01:09.452170 | 2023-09-03T15:25:21 | 2023-09-03T15:25:21 | 30,825,508 | 23 | 2 | null | 2023-08-18T14:02:07 | 2015-02-15T11:25:23 | C++ | UTF-8 | C++ | false | false | 1,634 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------
int N,M;
int W[8];
int L[101010],V[101010];
int D[10][10];
pair<int,int> P[101010];
void solve() {
int i,j,k,l,r,x,y; string s;
cin>>N>>M;
FOR(i,N) cin>>W[i];
ll ma=*max_element(W,W+N);
FOR(i,M) {
cin>>L[i]>>V[i];
if(V[i]<ma) return _P("-1\n");
P[i]={V[i],L[i]};
}
sort(P,P+M);
for(i=1;i<M;i++) {
P[i].second=max(P[i].second,P[i-1].second);
}
int mi=1<<30;
vector<int> A;
FOR(i,N) A.push_back(i);
do {
ZERO(D);
FOR(x,N) {
int ls=0;
for(y=x;y<N;y++) {
ls+=W[A[y]];
j=lower_bound(P,P+M,make_pair(ls,0))-P;
if(j>0) {
D[x][y]=max(D[x][y],P[j-1].second);
}
}
}
FOR(i,8) {
FOR(x,N) for(int z=x+1;z<N;z++) for(y=z+1;y<N;y++) {
D[x][y]=max(D[x][y],D[x][z]+D[z][y]);
}
}
mi=min(mi,D[0][N-1]);
} while(next_permutation(ALL(A)));
cout<<mi<<endl;
}
int main(int argc,char** argv){
string s;int i;
if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
cout.tie(0); solve(); return 0;
}
| [
"kmjp@users.noreply.github.com"
] | kmjp@users.noreply.github.com |
9e73205ebbcecda2bb26859b22a6345c3675cd9c | cc673e7e03157f6d6f2b7a1deefbca1f99a68d7f | /app/MessageBox/messagebox.cpp | c97f4b60e78a6770555ca235f5daad6de406ee30 | [] | no_license | jinhang87/qtutil | 3beb4375227f4657b107f7236dec8c087d29eadb | acd9bc5544330ee3ac58e58346541cb57a8092ae | refs/heads/master | 2021-01-20T13:44:38.709176 | 2017-11-29T13:08:58 | 2017-11-29T13:08:58 | 90,523,069 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,253 | cpp | #include "messagebox.h"
#include "ui_messagebox.h"
MessageBox::MessageBox(Icon icon, const QString &text, QMessageBox::StandardButtons buttons, QWidget *parent) :
QDialog(parent),
ui(new Ui::MessageBox)
{
ui->setupUi(this);
ui->buttonBox->setStyleSheet("QPushButton { min-width: 150px ; min-height: 60px}");
ui->buttonBox->setStandardButtons(QDialogButtonBox::StandardButtons(int(buttons)));
ui->label_2->setText(text);
}
MessageBox::~MessageBox()
{
delete ui;
}
int MessageBox::information(QWidget *parent, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
{
MessageBox messageBox(MessageBox::Information, text, buttons, parent);
return messageBox.exec();
}
int MessageBox::question(QWidget *parent, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
{
MessageBox messageBox(MessageBox::Question, text, buttons, parent);
return messageBox.exec();
}
int MessageBox::critical(QWidget *parent, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
{
MessageBox messageBox(MessageBox::Critical, text, buttons, parent);
return messageBox.exec();
}
| [
"jinhang87@163.com"
] | jinhang87@163.com |
d8cc60581eb6aea16a340e5fe6e042f5cda04fb8 | a5a8516791b8169253cdf9d3dc47edc7ad120a37 | /src/state_estimation/src/state_estimation/state_estimation_node.cpp | 343acb5fb73a6e32d35d7607d30385eff8cb6d9e | [] | no_license | Forrest-Z/Carbrain | fa0ce92f1c625b06bd100f2f788176acc57db3fb | bdba2a394f2e90f075118b960d46e63e88e395fe | refs/heads/master | 2022-01-07T16:55:12.681919 | 2019-06-09T16:38:59 | 2019-06-09T16:38:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,631 | cpp | #include "state_estimation_node.h"
#include <common/macros.h>
THIRD_PARTY_HEADERS_BEGIN
#include <common/node_creation_makros.h>
#include <state_estimation_msgs/State.h>
#include "state_estimation/StateEstimationConfig.h"
THIRD_PARTY_HEADERS_END
#include "state.h"
#include "state_estimation_node_debug.h"
StateEstimationNode::StateEstimationNode(ros::NodeHandle &node_handle)
: NodeBase(node_handle),
state_estimation_(std::make_unique<StateEstimationRealtime>(¶meter_handler_)) {
init();
}
StateEstimationNode::StateEstimationNode(ros::NodeHandle &node_handle,
std::unique_ptr<StateEstimation> state_estimation_)
: NodeBase(node_handle), state_estimation_(std::move(state_estimation_)) {
init();
}
// In general it is a very good practice to have not-throwing destructors.
// In this special case it does not really matter though, because this
// destructor should only be called during shutdown. If boost::thread throws
// an exception the operating system will take care of the remains and clean
// them up.
// NOLINTNEXTLINE(bugprone-exception-escape)
StateEstimationNode::~StateEstimationNode() { StateEstimationNode::stopModule(); }
void StateEstimationNode::init() {
if (!isInTestMode()) {
/*parameter_handler_.addDynamicReconfigureServer<state_estimation::StateEstimationConfig>(
node_handle_);*/
}
}
void StateEstimationNode::startModule() {
if (isInTestMode()) {
ROS_INFO("Starting in integration test mode");
test_service_server = node_handle_.advertiseService(
"process_sensor_data", &StateEstimationNode::processSensorData, this);
if (!test_service_server) {
ROS_ERROR("Can not start service process_sensor_data");
}
return;
}
state_estimation_publisher_ =
node_handle_.advertise<state_estimation_msgs::State>("state_estimation", 5, true);
state_estimation_publisher_thread_ = boost::thread(
boost::bind(&StateEstimationNode::stateEstimationPublisherLoop, this));
state_estimation_->start();
}
void StateEstimationNode::stopModule() {
state_estimation_publisher_thread_.interrupt();
state_estimation_publisher_thread_.join();
state_estimation_->stop();
state_estimation_publisher_.shutdown();
}
const std::string StateEstimationNode::getName() {
return std::string("state_estimation");
}
void StateEstimationNode::stateEstimationPublisherLoop() {
while (!boost::this_thread::interruption_requested()) {
VehicleState estimation;
if (state_estimation_->getNextEstimatedState(&estimation)) {
state_estimation_msgs::State msg;
msg.header.stamp = estimation.stamp;
msg.header.frame_id = "vehicle";
msg.speed_x = estimation.speed_x;
msg.speed_y = estimation.speed_y;
msg.yaw_rate = estimation.yaw_rate;
msg.acceleration = estimation.acceleration;
msg.steering_angle_back = estimation.steering_angle_back;
msg.steering_angle_front = estimation.steering_angle_front;
state_estimation_publisher_.publish(msg);
}
}
}
SensorMeasurements fromMsg(const controller_msgs::StateMeasure &msg) {
return {
.stamp = msg.header.stamp,
.left_IMU = {.angular_velocity = {.x = msg.imu_left.angular_velocity.x,
.y = msg.imu_left.angular_velocity.y,
.z = msg.imu_left.angular_velocity.z},
.acceleration = {.x = msg.imu_left.linear_acceleration.x,
.y = msg.imu_left.linear_acceleration.y,
.z = msg.imu_left.linear_acceleration.z}},
.right_IMU = {.angular_velocity = {.x = msg.imu_right.angular_velocity.x,
.y = msg.imu_right.angular_velocity.y,
.z = msg.imu_right.angular_velocity.z},
.acceleration = {.x = msg.imu_right.linear_acceleration.x,
.y = msg.imu_right.linear_acceleration.y,
.z = msg.imu_right.linear_acceleration.z}},
.angular_wheel_speeds = {.front = {.left = msg.wheel_speeds.front.left,
.right = msg.wheel_speeds.front.right},
.back = {.left = msg.wheel_speeds.back.left,
.right = msg.wheel_speeds.back.right}},
.steering_angles = {.front = {.left = msg.steering_angles.front.left,
.right = msg.steering_angles.front.right},
.back = {.left = msg.steering_angles.back.left,
.right = msg.steering_angles.back.right}}};
}
// only relevant for integration tests: callback of service process_sensor_data
bool StateEstimationNode::processSensorData(
state_estimation_msgs::ProcessSensorDataRequest &request,
state_estimation_msgs::ProcessSensorDataResponse &response) {
state_estimation_->updateParameters();
std::vector<std::tuple<SensorMeasurements, float, float, float>> input_data;
input_data.reserve(request.measures.size());
const auto &fs_commands = request.front_steering_servo_commands;
const auto &bs_commands = request.back_steering_servo_commands;
const auto &eng_commands = request.engine_commands;
auto fs_it = fs_commands.begin();
auto bs_it = bs_commands.begin();
auto eng_it = bs_commands.begin();
for (const auto &measure : request.measures) {
auto getCommandForMeasure = [&measure](const auto &commands, auto &it) {
it = std::find_if(it, commands.end(), [&measure](const auto &c) {
return c.header.stamp >= measure.header.stamp;
});
if (commands.empty()) {
return std::numeric_limits<float>::quiet_NaN();
} else if (it == commands.end()) {
return commands.back().data;
} else {
return it->data;
}
};
const float fs_command = getCommandForMeasure(fs_commands, fs_it);
const float bs_command = getCommandForMeasure(bs_commands, bs_it);
const float eng_command = getCommandForMeasure(eng_commands, eng_it);
input_data.emplace_back(fromMsg(measure), fs_command, bs_command, eng_command);
}
std::vector<VehicleState> intermediate_states =
state_estimation_->processSensorData(input_data);
if (state_estimation_->getUpdateRate() != request.rate) {
ROS_ERROR(
"state_estimation was compiled with an update rate of %d hz. The "
"service was called with a sensor rate of %d hz.",
state_estimation_->getUpdateRate(),
request.rate);
return false;
}
response.states =
std::vector<state_estimation_msgs::State>(intermediate_states.size());
ros::Time time = ros::Time::now();
for (size_t i = 0; i < intermediate_states.size(); i++) {
VehicleState vehicle_state = intermediate_states[i];
state_estimation_msgs::State state;
state.acceleration = vehicle_state.acceleration;
state.speed_x = vehicle_state.speed_x;
state.speed_y = vehicle_state.speed_y;
state.steering_angle_back = vehicle_state.steering_angle_back;
state.steering_angle_front = vehicle_state.steering_angle_front;
state.yaw_rate = vehicle_state.yaw_rate;
state.header.stamp = time + ros::Duration(i * (1.0 / request.rate));
response.states[i] = (state);
}
return true;
}
bool StateEstimationNode::isInTestMode() const {
bool test_mode;
node_handle_.param("integration_test_mode", test_mode, false);
return test_mode;
}
CREATE_NODE_WITH_FANCY_DEBUG(StateEstimationNode, StateEstimationNodeDebug)
| [
"fangnuaa@gmail.com"
] | fangnuaa@gmail.com |
7aae3f1cb8d66b359e21d0d1d116569984fac2bc | 6a4a2eb5cb08ea805733bd677ec44c62fb32ee91 | /host/test/mem/mutex_api.cpp | 634052811e8eeb0ff4a3b06938e0a542bd989058 | [] | no_license | agrigomi/pre-te-o | 7b737dc715b6432880aeaa030421d35c0620d0c3 | ed469c549b1571e1dadf186330ee4c44d001925e | refs/heads/master | 2020-05-15T13:41:51.793581 | 2019-04-19T18:44:28 | 2019-04-19T18:44:28 | 182,310,069 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 32 | cpp | ../../../core/sync/mutex_api.cpp | [
"agrigomi@abv.bg"
] | agrigomi@abv.bg |
8d5efacaa769fe2016e3a0763ec67de174252a5e | 21553f6afd6b81ae8403549467230cdc378f32c9 | /arm/cortex/Freescale/MKM33ZA5/include/arch/reg/tmr3.hpp | 84f4502e2b15c5b7dcc1c3db1d7f491261d42fe4 | [] | no_license | digint/openmptl-reg-arm-cortex | 3246b68dcb60d4f7c95a46423563cab68cb02b5e | 88e105766edc9299348ccc8d2ff7a9c34cddacd3 | refs/heads/master | 2021-07-18T19:56:42.569685 | 2017-10-26T11:11:35 | 2017-10-26T11:11:35 | 108,407,162 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 7,973 | hpp | /*
* OpenMPTL - C++ Microprocessor Template Library
*
* This program is a derivative representation of a CMSIS System View
* Description (SVD) file, and is subject to the corresponding license
* (see "Freescale CMSIS-SVD License Agreement.pdf" in the parent directory).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
////////////////////////////////////////////////////////////////////////
//
// Import from CMSIS-SVD: "Freescale/MKM33ZA5.svd"
//
// vendor: Freescale Semiconductor, Inc.
// vendorID: Freescale
// name: MKM33ZA5
// series: Kinetis_M
// version: 1.6
// description: MKM33ZA5 Freescale Microcontroller
// --------------------------------------------------------------------
//
// C++ Header file, containing architecture specific register
// declarations for use in OpenMPTL. It has been converted directly
// from a CMSIS-SVD file.
//
// https://digint.ch/openmptl
// https://github.com/posborne/cmsis-svd
//
#ifndef ARCH_REG_TMR3_HPP_INCLUDED
#define ARCH_REG_TMR3_HPP_INCLUDED
#warning "using untested register declarations"
#include <register.hpp>
namespace mptl {
/**
* Quad Timer
*/
struct TMR3
{
static constexpr reg_addr_t base_addr = 0x4005a000;
/**
* Timer Channel Compare Register 1
*/
struct COMP1
: public reg< uint16_t, base_addr + 0, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0, rw, 0 >;
using COMPARISON_1 = regbits< type, 0, 16 >; /**< Comparison Value 1 */
};
/**
* Timer Channel Compare Register 2
*/
struct COMP2
: public reg< uint16_t, base_addr + 0x2, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0x2, rw, 0 >;
using COMPARISON_2 = regbits< type, 0, 16 >; /**< Comparison Value 2 */
};
/**
* Timer Channel Capture Register
*/
struct CAPT
: public reg< uint16_t, base_addr + 0x4, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0x4, rw, 0 >;
using CAPTURE = regbits< type, 0, 16 >; /**< Capture Value */
};
/**
* Timer Channel Load Register
*/
struct LOAD
: public reg< uint16_t, base_addr + 0x6, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0x6, rw, 0 >;
// fixme: Field name equals parent register name: LOAD
using LOAD_ = regbits< type, 0, 16 >; /**< Timer Load Register */
};
/**
* Timer Channel Hold Register
*/
struct HOLD
: public reg< uint16_t, base_addr + 0x8, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0x8, rw, 0 >;
// fixme: Field name equals parent register name: HOLD
using HOLD_ = regbits< type, 0, 16 >; /**< no description available */
};
/**
* Timer Channel Counter Register
*/
struct CNTR
: public reg< uint16_t, base_addr + 0xa, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0xa, rw, 0 >;
using COUNTER = regbits< type, 0, 16 >; /**< no description available */
};
/**
* Timer Channel Control Register
*/
struct CTRL
: public reg< uint16_t, base_addr + 0xc, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0xc, rw, 0 >;
using OUTMODE = regbits< type, 0, 3 >; /**< Output Mode */
using COINIT = regbits< type, 3, 1 >; /**< Co-Channel Initialization */
using DIR = regbits< type, 4, 1 >; /**< Count Direction */
using LENGTH = regbits< type, 5, 1 >; /**< Count Length */
using ONCE = regbits< type, 6, 1 >; /**< Count Once */
using SCS = regbits< type, 7, 2 >; /**< Secondary Count Source */
using PCS = regbits< type, 9, 4 >; /**< Primary Count Source */
using CM = regbits< type, 13, 3 >; /**< Count Mode */
};
/**
* Timer Channel Status and Control Register
*/
struct SCTRL
: public reg< uint16_t, base_addr + 0xe, rw, 0x100 >
{
using type = reg< uint16_t, base_addr + 0xe, rw, 0x100 >;
using OEN = regbits< type, 0, 1 >; /**< Output Enable */
using OPS = regbits< type, 1, 1 >; /**< Output Polarity Select */
using FORCE = regbits< type, 2, 1 >; /**< Force OFLAG Output */
using VAL = regbits< type, 3, 1 >; /**< Forced OFLAG Value */
using EEOF = regbits< type, 4, 1 >; /**< Enable External OFLAG Force */
using MSTR = regbits< type, 5, 1 >; /**< Master Mode */
using CAPTURE_MODE = regbits< type, 6, 2 >; /**< Input Capture Mode */
using INPUT = regbits< type, 8, 1 >; /**< External Input Signal */
using IPS = regbits< type, 9, 1 >; /**< Input Polarity Select */
using IEFIE = regbits< type, 10, 1 >; /**< Input Edge Flag Interrupt Enable */
using IEF = regbits< type, 11, 1 >; /**< Input Edge Flag */
using TOFIE = regbits< type, 12, 1 >; /**< Timer Overflow Flag Interrupt Enable */
using TOF = regbits< type, 13, 1 >; /**< Timer Overflow Flag */
using TCFIE = regbits< type, 14, 1 >; /**< Timer Compare Flag Interrupt Enable */
using TCF = regbits< type, 15, 1 >; /**< Timer Compare Flag */
};
/**
* Timer Channel Comparator Load Register 1
*/
struct CMPLD1
: public reg< uint16_t, base_addr + 0x10, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0x10, rw, 0 >;
using COMPARATOR_LOAD_1 = regbits< type, 0, 16 >; /**< no description available */
};
/**
* Timer Channel Comparator Load Register 2
*/
struct CMPLD2
: public reg< uint16_t, base_addr + 0x12, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0x12, rw, 0 >;
using COMPARATOR_LOAD_2 = regbits< type, 0, 16 >; /**< no description available */
};
/**
* Timer Channel Comparator Status and Control Register
*/
struct CSCTRL
: public reg< uint16_t, base_addr + 0x14, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0x14, rw, 0 >;
using CL1 = regbits< type, 0, 2 >; /**< Compare Load Control 1 */
using CL2 = regbits< type, 2, 2 >; /**< Compare Load Control 2 */
using TCF1 = regbits< type, 4, 1 >; /**< Timer Compare 1 Interrupt Flag */
using TCF2 = regbits< type, 5, 1 >; /**< Timer Compare 2 Interrupt Flag */
using TCF1EN = regbits< type, 6, 1 >; /**< Timer Compare 1 Interrupt Enable */
using TCF2EN = regbits< type, 7, 1 >; /**< Timer Compare 2 Interrupt Enable */
using OFLAG = regbits< type, 8, 1 >; /**< Output flag */
using UP = regbits< type, 9, 1 >; /**< Counting Direction Indicator */
using TCI = regbits< type, 10, 1 >; /**< Triggered Count Initialization Control */
using ROC = regbits< type, 11, 1 >; /**< Reload on Capture */
using ALT_LOAD = regbits< type, 12, 1 >; /**< Alternative Load Enable */
using FAULT = regbits< type, 13, 1 >; /**< Fault Enable */
using DBG_EN = regbits< type, 14, 2 >; /**< Debug Actions Enable */
};
/**
* Timer Channel Input Filter Register
*/
struct FILT
: public reg< uint16_t, base_addr + 0x16, rw, 0 >
{
using type = reg< uint16_t, base_addr + 0x16, rw, 0 >;
using FILT_PER = regbits< type, 0, 8 >; /**< Input Filter Sample Period */
using FILT_CNT = regbits< type, 8, 3 >; /**< Input Filter Sample Count */
};
};
} // namespace mptl
#endif // ARCH_REG_TMR3_HPP_INCLUDED
| [
"axel@tty0.ch"
] | axel@tty0.ch |
123ed5519734aafa1164f2efdf8cf8cf13161a93 | 5cb244e33744828beae35db56fec0a01b9384ece | /Competitive-Problems/minimum-deletions/code.cpp | a656c6991bbcbeba5c3b3a0c07b97083bc06ffc3 | [] | no_license | osp709/code-hub | 409cd5c66a2142095f65c97cab8f16917e16b314 | b14b2b895c26947742fc60348148e57ac75d0cc4 | refs/heads/master | 2022-12-03T09:15:49.656733 | 2020-08-28T05:42:10 | 2020-08-28T05:42:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 839 | cpp | #include <bits/stdc++.h>
#define N 1e9 + 7
#define endl '\n'
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b)
{
if (a == 0)
return b;
if (b == 0)
return a;
if (a == b)
return a;
if (a > b)
return gcd(a - b, b);
return gcd(a, b - a);
}
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ifstream cin("input.txt");
ofstream cout("output.txt");
ll t;
cin >> t;
while (t--)
{
ll n, p = 0;
ll gcd_now = 1;
cin >> n;
cin >> gcd_now;
for (int i = 1; i < n; i++)
{
ll k;
cin >> k;
gcd_now = gcd(gcd_now, k);
}
if (gcd_now == 1)
cout << 0 << endl;
else
cout << -1 << endl;
}
return 0;
}
| [
"omshriprasath@gmail.com"
] | omshriprasath@gmail.com |
10b51672d51945681a07cf94e29fcb013f3d0b08 | 5194f4501ae1c728c72297952185303a7ca1da5c | /c++ tut/2.cpp | fe8c715def4fa4a5f906643cb0864cea6a3d3111 | [] | no_license | ebednar/Dev_ex | 595008aa909d3d170d4847a3cb08183c7cfe82ef | bc14ed4fa4823d85f55e2ff566265c92fcc700d9 | refs/heads/master | 2022-10-19T00:07:44.200466 | 2020-06-01T07:52:41 | 2020-06-01T07:52:41 | 268,373,010 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,776 | cpp | #include <iostream>
using namespace std;
int nod(int new_numerator, int new_denominator)
{
while (new_numerator != 0 && new_denominator != 0) {
if (new_numerator > new_denominator) {
new_numerator %= new_denominator;
}
else {
new_denominator %= new_numerator;
}
}
return new_denominator + new_numerator;
}
class Rational {
public:
Rational(int numerator = 0, int denominator = 1)
{
int s = 1;
if (numerator < 0 || denominator < 0)
{
if (numerator < 0 && denominator < 0)
;
else
s = -1;
numerator = abs(numerator);
denominator = abs(denominator);
}
int n = nod(numerator, denominator);
this->numerator = s * numerator / n;
this->denominator = denominator / n;
//cout << this->numerator << ' ' << this->denominator << endl;
}
int Numerator() const {return numerator;}
int Denominator() const {return denominator;}
bool operator==(const Rational& a)
{
if (this->numerator == a.numerator && this->denominator == a.denominator)
return true;
return false;
}
bool operator!=(const Rational& a)
{
if (this->numerator != a.numerator || this->denominator != a.denominator)
return true;
return false;
}
Rational operator+(const Rational& a)
{
Rational b, c;
b = a;
c = *this;
int tmp = b.denominator;
b.denominator *= c.denominator;
b.numerator *= c.denominator;
c.denominator *= tmp;
c.numerator *= tmp;
return {c.numerator + b.numerator, b.denominator};
}
Rational operator-(const Rational& a)
{
Rational b, c;
b = a;
c = *this;
int tmp = b.denominator;
b.denominator *= c.denominator;
b.numerator *= c.denominator;
c.denominator *= tmp;
c.numerator *= tmp;
return {c.numerator - b.numerator, b.denominator};
}
private:
int numerator, denominator;
}; | [
"evgeniya@MacBook-Air-Evgeniya.local"
] | evgeniya@MacBook-Air-Evgeniya.local |
439b164774c9dacd6edc189ac343f3a8d33f4258 | a6dd54cb560dddccef0b2233fa2990f25e818c7b | /USACO/NOV11/silver/P1.cpp | 93d4529231177768d5e2c412110d390fcfa004ad | [] | no_license | renzov/Red_Crown | ec11106389196aac03d04167ad6703acc62aaef6 | 449fe413dbbd67cb0ca673af239f7d616249599a | refs/heads/master | 2021-07-08T04:56:22.617893 | 2021-05-14T18:41:06 | 2021-05-14T18:41:06 | 4,538,198 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,270 | cpp | #include<cstdio>
#include<climits>
#include<queue>
#include<algorithm>
#include<vector>
using namespace std;
typedef pair<int,int> pii;
const int MAXN = 64;
char T[MAXN][MAXN];
int cmp[MAXN][MAXN];
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
vector<pii> C[4];
int d[4][MAXN][MAXN];
int D[4][4];
int N, M;
void dfs( const int &x, const int &y, const int &col ){
cmp[x][y] = col;
C[col].push_back( pii(x, y) );
int nx, ny;
for ( int k=0; k < 4; ++k ){
nx = x + dx[k];
ny = y + dy[k];
if ( nx < 0 || nx >= N || ny < 0 || ny >= M ) continue;
if ( T[nx][ny] == 'X' && !cmp[nx][ny] )
dfs( nx, ny, col );
}
}
void bfs( const int &col ){
queue<pii> q;
int x, y;
int nx, ny;
for ( int i=0; i < N; ++i )
for ( int j=0; j < M; ++j )
d[col][i][j] = -1;
for ( int i=0; i < (int) C[col].size(); ++i ){
x = C[col][i].first, y = C[col][i].second;
q.push( C[col][i] );
d[col][x][y] = 0;
}
while ( !q.empty() ){
x = q.front().first, y = q.front().second;
q.pop();
for ( int k=0; k < 4; ++k ){
nx = x + dx[k];
ny = y + dy[k];
if ( nx < 0 || nx >= N || ny < 0 || ny >= M ) continue;
if ( d[col][nx][ny] == -1 ){
d[col][nx][ny] = d[col][x][y] + 1;
q.push( pii(nx, ny) );
}
}
}
}
int main(){
scanf("%d %d", &N, &M);
for ( int i=0; i<N; ++i )
scanf("%s", T[i]);
// Mark the components
int cnt = 0;
for ( int i=0; i < N; ++i )
for ( int j=0; j < M; ++j )
if ( T[i][j] == 'X' && !cmp[i][j] )
dfs( i, j, ++cnt );
// find shortest path
for ( int k=1; k <= 3; ++k )
bfs( k );
// find distance between components
int val, x, y;
for ( int k=1; k < 3; ++k ){
for ( int i=k+1; i <= 3; ++i ){
val = INT_MAX;
for ( int j=0; j < (int)C[i].size(); ++j ){
x = C[i][j].first, y = C[i][j].second;
val = min( val, d[k][x][y] );
}
D[i][k] = D[k][i] = val - 1; // Number of cell between those points
}
}
int res = INT_MAX;
// Test anchor point
for ( int i=0; i<N; ++i )
for ( int j=0; j<M; ++j )
if ( !cmp[i][j] )
res = min( res, d[1][i][j] + d[2][i][j] + d[3][i][j] - 2 );
// Test each component as anchor
res = min( res, D[1][2] + D[1][3] );
res = min( res, D[2][1] + D[2][3] );
res = min( res, D[3][1] + D[3][2] );
printf("%d\n", res);
return 0;
}
| [
"gomez.renzo@gmail.com"
] | gomez.renzo@gmail.com |
d7970b6d0124e800d15d617c86a579777492e2cb | 792b3a823e2fc08361958902b8b51aa8f951f569 | /src/masternode-budget.h | 4760eefb515cfaf845a8fcdc8fe6bcccd32a5999 | [
"MIT"
] | permissive | nashsclay/GGN | ff82a2593c87e910a2b582b9e10b785fe971a1e6 | b9bd5d324fbb923f7b887806b6d4f188668c2853 | refs/heads/master | 2020-05-07T11:55:14.919952 | 2019-04-10T02:17:31 | 2019-04-10T02:17:31 | 180,481,087 | 0 | 0 | null | 2019-04-10T01:55:46 | 2019-04-10T01:55:46 | null | UTF-8 | C++ | false | false | 18,135 | h | // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef MASTERNODE_BUDGET_H
#define MASTERNODE_BUDGET_H
#include "base58.h"
#include "init.h"
#include "key.h"
#include "main.h"
#include "masternode.h"
#include "net.h"
#include "sync.h"
#include "util.h"
#include <boost/lexical_cast.hpp>
using namespace std;
extern CCriticalSection cs_budget;
class CBudgetManager;
class CFinalizedBudgetBroadcast;
class CFinalizedBudget;
class CBudgetProposal;
class CBudgetProposalBroadcast;
class CTxBudgetPayment;
#define VOTE_ABSTAIN 0
#define VOTE_YES 1
#define VOTE_NO 2
static const CAmount PROPOSAL_FEE_TX = (50 * COIN);
static const CAmount BUDGET_FEE_TX = (50 * COIN);
static const int64_t BUDGET_VOTE_UPDATE_MIN = 60 * 60;
extern std::vector<CBudgetProposalBroadcast> vecImmatureBudgetProposals;
extern std::vector<CFinalizedBudgetBroadcast> vecImmatureFinalizedBudgets;
extern CBudgetManager budget;
void DumpBudgets();
// Define amount of blocks in budget payment cycle
int GetBudgetPaymentCycleBlocks();
//Check the collateral transaction for the budget proposal/finalized budget
bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, std::string& strError, int64_t& nTime, int& nConf);
//
// CBudgetVote - Allow a masternode node to vote and broadcast throughout the network
//
class CBudgetVote
{
public:
bool fValid; //if the vote is currently valid / counted
bool fSynced; //if we've sent this to our peers
CTxIn vin;
uint256 nProposalHash;
int nVote;
int64_t nTime;
std::vector<unsigned char> vchSig;
CBudgetVote();
CBudgetVote(CTxIn vin, uint256 nProposalHash, int nVoteIn);
bool Sign(CKey& keyMasternode, CPubKey& pubKeyMasternode);
bool SignatureValid(bool fSignatureCheck);
void Relay();
std::string GetVoteString()
{
std::string ret = "ABSTAIN";
if (nVote == VOTE_YES) ret = "YES";
if (nVote == VOTE_NO) ret = "NO";
return ret;
}
uint256 GetHash()
{
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << vin;
ss << nProposalHash;
ss << nVote;
ss << nTime;
return ss.GetHash();
}
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
READWRITE(vin);
READWRITE(nProposalHash);
READWRITE(nVote);
READWRITE(nTime);
READWRITE(vchSig);
}
};
//
// CFinalizedBudgetVote - Allow a masternode node to vote and broadcast throughout the network
//
class CFinalizedBudgetVote
{
public:
bool fValid; //if the vote is currently valid / counted
bool fSynced; //if we've sent this to our peers
CTxIn vin;
uint256 nBudgetHash;
int64_t nTime;
std::vector<unsigned char> vchSig;
CFinalizedBudgetVote();
CFinalizedBudgetVote(CTxIn vinIn, uint256 nBudgetHashIn);
bool Sign(CKey& keyMasternode, CPubKey& pubKeyMasternode);
bool SignatureValid(bool fSignatureCheck);
void Relay();
uint256 GetHash()
{
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << vin;
ss << nBudgetHash;
ss << nTime;
return ss.GetHash();
}
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
READWRITE(vin);
READWRITE(nBudgetHash);
READWRITE(nTime);
READWRITE(vchSig);
}
};
/** Save Budget Manager (budget.dat)
*/
class CBudgetDB
{
private:
boost::filesystem::path pathDB;
std::string strMagicMessage;
public:
enum ReadResult {
Ok,
FileError,
HashReadError,
IncorrectHash,
IncorrectMagicMessage,
IncorrectMagicNumber,
IncorrectFormat
};
CBudgetDB();
bool Write(const CBudgetManager& objToSave);
ReadResult Read(CBudgetManager& objToLoad, bool fDryRun = false);
};
//
// Budget Manager : Contains all proposals for the budget
//
class CBudgetManager
{
private:
//hold txes until they mature enough to use
// XX42 map<uint256, CTransaction> mapCollateral;
map<uint256, uint256> mapCollateralTxids;
public:
// critical section to protect the inner data structures
mutable CCriticalSection cs;
// keep track of the scanning errors I've seen
map<uint256, CBudgetProposal> mapProposals;
map<uint256, CFinalizedBudget> mapFinalizedBudgets;
std::map<uint256, CBudgetProposalBroadcast> mapSeenMasternodeBudgetProposals;
std::map<uint256, CBudgetVote> mapSeenMasternodeBudgetVotes;
std::map<uint256, CBudgetVote> mapOrphanMasternodeBudgetVotes;
std::map<uint256, CFinalizedBudgetBroadcast> mapSeenFinalizedBudgets;
std::map<uint256, CFinalizedBudgetVote> mapSeenFinalizedBudgetVotes;
std::map<uint256, CFinalizedBudgetVote> mapOrphanFinalizedBudgetVotes;
CBudgetManager()
{
mapProposals.clear();
mapFinalizedBudgets.clear();
}
void ClearSeen()
{
mapSeenMasternodeBudgetProposals.clear();
mapSeenMasternodeBudgetVotes.clear();
mapSeenFinalizedBudgets.clear();
mapSeenFinalizedBudgetVotes.clear();
}
int sizeFinalized() { return (int)mapFinalizedBudgets.size(); }
int sizeProposals() { return (int)mapProposals.size(); }
void ResetSync();
void MarkSynced();
void Sync(CNode* node, uint256 nProp, bool fPartial = false);
void Calculate();
void ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv);
void NewBlock();
CBudgetProposal* FindProposal(const std::string& strProposalName);
CBudgetProposal* FindProposal(uint256 nHash);
CFinalizedBudget* FindFinalizedBudget(uint256 nHash);
std::pair<std::string, std::string> GetVotes(std::string strProposalName);
CAmount GetTotalBudget(int nHeight);
std::vector<CBudgetProposal*> GetBudget();
std::vector<CBudgetProposal*> GetAllProposals();
std::vector<CFinalizedBudget*> GetFinalizedBudgets();
bool IsBudgetPaymentBlock(int nBlockHeight);
bool AddProposal(CBudgetProposal& budgetProposal);
bool AddFinalizedBudget(CFinalizedBudget& finalizedBudget);
void SubmitFinalBudget();
bool UpdateProposal(CBudgetVote& vote, CNode* pfrom, std::string& strError);
bool UpdateFinalizedBudget(CFinalizedBudgetVote& vote, CNode* pfrom, std::string& strError);
bool PropExists(uint256 nHash);
bool IsTransactionValid(const CTransaction& txNew, int nBlockHeight);
std::string GetRequiredPaymentsString(int nBlockHeight);
void FillBlockPayee(CMutableTransaction& txNew, CAmount nFees, bool fProofOfStake);
void CheckOrphanVotes();
void Clear()
{
LOCK(cs);
LogPrintf("Budget object cleared\n");
mapProposals.clear();
mapFinalizedBudgets.clear();
mapSeenMasternodeBudgetProposals.clear();
mapSeenMasternodeBudgetVotes.clear();
mapSeenFinalizedBudgets.clear();
mapSeenFinalizedBudgetVotes.clear();
mapOrphanMasternodeBudgetVotes.clear();
mapOrphanFinalizedBudgetVotes.clear();
}
void CheckAndRemove();
std::string ToString() const;
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
READWRITE(mapSeenMasternodeBudgetProposals);
READWRITE(mapSeenMasternodeBudgetVotes);
READWRITE(mapSeenFinalizedBudgets);
READWRITE(mapSeenFinalizedBudgetVotes);
READWRITE(mapOrphanMasternodeBudgetVotes);
READWRITE(mapOrphanFinalizedBudgetVotes);
READWRITE(mapProposals);
READWRITE(mapFinalizedBudgets);
}
};
class CTxBudgetPayment
{
public:
uint256 nProposalHash;
CScript payee;
CAmount nAmount;
CTxBudgetPayment()
{
payee = CScript();
nAmount = 0;
nProposalHash = 0;
}
ADD_SERIALIZE_METHODS;
//for saving to the serialized db
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
READWRITE(payee);
READWRITE(nAmount);
READWRITE(nProposalHash);
}
};
//
// Finalized Budget : Contains the suggested proposals to pay on a given block
//
class CFinalizedBudget
{
private:
// critical section to protect the inner data structures
mutable CCriticalSection cs;
bool fAutoChecked; //If it matches what we see, we'll auto vote for it (masternode only)
public:
bool fValid;
std::string strBudgetName;
int nBlockStart;
std::vector<CTxBudgetPayment> vecBudgetPayments;
map<uint256, CFinalizedBudgetVote> mapVotes;
uint256 nFeeTXHash;
int64_t nTime;
CFinalizedBudget();
CFinalizedBudget(const CFinalizedBudget& other);
void CleanAndRemove(bool fSignatureCheck);
bool AddOrUpdateVote(CFinalizedBudgetVote& vote, std::string& strError);
double GetScore();
bool HasMinimumRequiredSupport();
bool IsValid(std::string& strError, bool fCheckCollateral = true);
std::string GetName() { return strBudgetName; }
std::string GetProposals();
int GetBlockStart() { return nBlockStart; }
int GetBlockEnd() { return nBlockStart + (int)(vecBudgetPayments.size() - 1); }
int GetVoteCount() { return (int)mapVotes.size(); }
bool IsTransactionValid(const CTransaction& txNew, int nBlockHeight);
bool GetBudgetPaymentByBlock(int64_t nBlockHeight, CTxBudgetPayment& payment)
{
LOCK(cs);
int i = nBlockHeight - GetBlockStart();
if (i < 0) return false;
if (i > (int)vecBudgetPayments.size() - 1) return false;
payment = vecBudgetPayments[i];
return true;
}
bool GetPayeeAndAmount(int64_t nBlockHeight, CScript& payee, CAmount& nAmount)
{
LOCK(cs);
int i = nBlockHeight - GetBlockStart();
if (i < 0) return false;
if (i > (int)vecBudgetPayments.size() - 1) return false;
payee = vecBudgetPayments[i].payee;
nAmount = vecBudgetPayments[i].nAmount;
return true;
}
//check to see if we should vote on this
void AutoCheck();
//total globalgreen paid out by this budget
CAmount GetTotalPayout();
//vote on this finalized budget as a masternode
void SubmitVote();
//checks the hashes to make sure we know about them
string GetStatus();
uint256 GetHash()
{
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << strBudgetName;
ss << nBlockStart;
ss << vecBudgetPayments;
uint256 h1 = ss.GetHash();
return h1;
}
ADD_SERIALIZE_METHODS;
//for saving to the serialized db
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
READWRITE(LIMITED_STRING(strBudgetName, 20));
READWRITE(nFeeTXHash);
READWRITE(nTime);
READWRITE(nBlockStart);
READWRITE(vecBudgetPayments);
READWRITE(fAutoChecked);
READWRITE(mapVotes);
}
};
// FinalizedBudget are cast then sent to peers with this object, which leaves the votes out
class CFinalizedBudgetBroadcast : public CFinalizedBudget
{
private:
std::vector<unsigned char> vchSig;
public:
CFinalizedBudgetBroadcast();
CFinalizedBudgetBroadcast(const CFinalizedBudget& other);
CFinalizedBudgetBroadcast(std::string strBudgetNameIn, int nBlockStartIn, std::vector<CTxBudgetPayment> vecBudgetPaymentsIn, uint256 nFeeTXHashIn);
void swap(CFinalizedBudgetBroadcast& first, CFinalizedBudgetBroadcast& second) // nothrow
{
// enable ADL (not necessary in our case, but good practice)
using std::swap;
// by swapping the members of two classes,
// the two classes are effectively swapped
swap(first.strBudgetName, second.strBudgetName);
swap(first.nBlockStart, second.nBlockStart);
first.mapVotes.swap(second.mapVotes);
first.vecBudgetPayments.swap(second.vecBudgetPayments);
swap(first.nFeeTXHash, second.nFeeTXHash);
swap(first.nTime, second.nTime);
}
CFinalizedBudgetBroadcast& operator=(CFinalizedBudgetBroadcast from)
{
swap(*this, from);
return *this;
}
void Relay();
ADD_SERIALIZE_METHODS;
//for propagating messages
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
//for syncing with other clients
READWRITE(LIMITED_STRING(strBudgetName, 20));
READWRITE(nBlockStart);
READWRITE(vecBudgetPayments);
READWRITE(nFeeTXHash);
}
};
//
// Budget Proposal : Contains the masternode votes for each budget
//
class CBudgetProposal
{
private:
// critical section to protect the inner data structures
mutable CCriticalSection cs;
CAmount nAlloted;
public:
bool fValid;
std::string strProposalName;
/*
json object with name, short-description, long-description, pdf-url and any other info
This allows the proposal website to stay 100% decentralized
*/
std::string strURL;
int nBlockStart;
int nBlockEnd;
CAmount nAmount;
CScript address;
int64_t nTime;
uint256 nFeeTXHash;
map<uint256, CBudgetVote> mapVotes;
//cache object
CBudgetProposal();
CBudgetProposal(const CBudgetProposal& other);
CBudgetProposal(std::string strProposalNameIn, std::string strURLIn, int nBlockStartIn, int nBlockEndIn, CScript addressIn, CAmount nAmountIn, uint256 nFeeTXHashIn);
void Calculate();
bool AddOrUpdateVote(CBudgetVote& vote, std::string& strError);
bool HasMinimumRequiredSupport();
std::pair<std::string, std::string> GetVotes();
bool IsValid(std::string& strError, bool fCheckCollateral = true);
bool IsEstablished()
{
// Proposals must be at least a day old to make it into a budget
if (Params().NetworkID() == CBaseChainParams::MAIN) return (nTime < GetTime() - (60 * 60 * 24));
// For testing purposes - 5 minutes
return (nTime < GetTime() - (60 * 5));
}
std::string GetName() { return strProposalName; }
std::string GetURL() { return strURL; }
int GetBlockStart() { return nBlockStart; }
int GetBlockEnd() { return nBlockEnd; }
CScript GetPayee() { return address; }
int GetTotalPaymentCount();
int GetRemainingPaymentCount();
int GetBlockStartCycle();
int GetBlockCurrentCycle();
int GetBlockEndCycle();
double GetRatio();
int GetYeas();
int GetNays();
int GetAbstains();
CAmount GetAmount() { return nAmount; }
void SetAllotted(CAmount nAllotedIn) { nAlloted = nAllotedIn; }
CAmount GetAllotted() { return nAlloted; }
void CleanAndRemove(bool fSignatureCheck);
uint256 GetHash()
{
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << strProposalName;
ss << strURL;
ss << nBlockStart;
ss << nBlockEnd;
ss << nAmount;
ss << address;
uint256 h1 = ss.GetHash();
return h1;
}
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
//for syncing with other clients
READWRITE(LIMITED_STRING(strProposalName, 20));
READWRITE(LIMITED_STRING(strURL, 64));
READWRITE(nTime);
READWRITE(nBlockStart);
READWRITE(nBlockEnd);
READWRITE(nAmount);
READWRITE(address);
READWRITE(nTime);
READWRITE(nFeeTXHash);
//for saving to the serialized db
READWRITE(mapVotes);
}
};
// Proposals are cast then sent to peers with this object, which leaves the votes out
class CBudgetProposalBroadcast : public CBudgetProposal
{
public:
CBudgetProposalBroadcast() : CBudgetProposal() {}
CBudgetProposalBroadcast(const CBudgetProposal& other) : CBudgetProposal(other) {}
CBudgetProposalBroadcast(const CBudgetProposalBroadcast& other) : CBudgetProposal(other) {}
CBudgetProposalBroadcast(std::string strProposalNameIn, std::string strURLIn, int nPaymentCount, CScript addressIn, CAmount nAmountIn, int nBlockStartIn, uint256 nFeeTXHashIn);
void swap(CBudgetProposalBroadcast& first, CBudgetProposalBroadcast& second) // nothrow
{
// enable ADL (not necessary in our case, but good practice)
using std::swap;
// by swapping the members of two classes,
// the two classes are effectively swapped
swap(first.strProposalName, second.strProposalName);
swap(first.nBlockStart, second.nBlockStart);
swap(first.strURL, second.strURL);
swap(first.nBlockEnd, second.nBlockEnd);
swap(first.nAmount, second.nAmount);
swap(first.address, second.address);
swap(first.nTime, second.nTime);
swap(first.nFeeTXHash, second.nFeeTXHash);
first.mapVotes.swap(second.mapVotes);
}
CBudgetProposalBroadcast& operator=(CBudgetProposalBroadcast from)
{
swap(*this, from);
return *this;
}
void Relay();
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
//for syncing with other clients
READWRITE(LIMITED_STRING(strProposalName, 20));
READWRITE(LIMITED_STRING(strURL, 64));
READWRITE(nTime);
READWRITE(nBlockStart);
READWRITE(nBlockEnd);
READWRITE(nAmount);
READWRITE(address);
READWRITE(nFeeTXHash);
}
};
#endif
| [
"root@localhost"
] | root@localhost |
6ac1c2fce98707c747f5244d089e40ef0b053080 | 4bcc9806152542ab43fc2cf47c499424f200896c | /tensorflow/compiler/mlir/tensorflow/utils/topological_sort.h | a62fe17add2462095c7c94f1fbeb8cb9c2c0899f | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"BSD-2-Clause"
] | permissive | tensorflow/tensorflow | 906276dbafcc70a941026aa5dc50425ef71ee282 | a7f3934a67900720af3d3b15389551483bee50b8 | refs/heads/master | 2023-08-25T04:24:41.611870 | 2023-08-25T04:06:24 | 2023-08-25T04:14:08 | 45,717,250 | 208,740 | 109,943 | Apache-2.0 | 2023-09-14T20:55:50 | 2015-11-07T01:19:20 | C++ | UTF-8 | C++ | false | false | 3,324 | h | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_COMPILER_MLIR_TENSORFLOW_UTILS_TOPOLOGICAL_SORT_H_
#define TENSORFLOW_COMPILER_MLIR_TENSORFLOW_UTILS_TOPOLOGICAL_SORT_H_
#include <utility>
#include <vector>
#include "absl/types/span.h"
#include "mlir/IR/BuiltinOps.h" // from @llvm-project
namespace mlir {
namespace TF {
// A function that determines which op to emit next in the case of ties.
// The predecessor (which can be null) is the last op we emitted,
// and op is the candidate we're considering. A larger returned integer
// means the op has a higher chance of being emitted first.
typedef int (*PriorityFunction)(Operation *predecessor, Operation *op);
// A function that returns extra dependencies for each op. These might
// e.g. be known side-effects (or control dependencies) between ops.
// If "incoming" is true, then the list of (extra) predecessors of the
// op should be returned. If "incoming" is false, the list of successors.
// The algorithm assumes that these are consistent which each other. So
// if (and only if) op1 is in extra_dependencies(op2, true), then op2
// must also be in extra_dependencies(op1, false).
// This function is called multiple times during the topological sort,
// so the implementation should preferably be constant-time.
typedef llvm::function_ref<llvm::SmallVector<Operation *, 4> const &(
Operation *, bool incoming)>
ExtraDependenciesFunction;
// Convenience function if there are no extra dependencies to declare.
// (Unlike nullptr, this also works inside the ternary operator)
extern ExtraDependenciesFunction no_extra_dependencies;
// Sort a block topologically, so that for all ops, all operands are
// available at the time of execution. This is similar to MLIR's topological
// sort (lib/Transforms/TopologicalSort.cpp) but also takes a priority
// function to determine the next op to emit in the case of ambiguity. This
// makes it possible to group operations by certain attributes. For example,
// the order_by_dialect pass uses this function to group by dialect.
// Only the operations nested directly under the block will be reordered.
// Nested blocks will be left alone.
// Also takes a list of control dependencies (vector of operation pairs,
// from->to) that will be honored when ordering the ops together with the
// data dependencies given through (the ops/results of) the operations
// themselves.
std::vector<Operation *> SortBlockTopologically(
Block &block, PriorityFunction priorityFunction,
ExtraDependenciesFunction extraDependencies = no_extra_dependencies);
} // namespace TF
} // namespace mlir
#endif // TENSORFLOW_COMPILER_MLIR_TENSORFLOW_UTILS_TOPOLOGICAL_SORT_H_
| [
"gardener@tensorflow.org"
] | gardener@tensorflow.org |
ae41bfb3b4dd2e6315c07dacd578657d1295e35e | bf839c3441ee7018203e114b2d50cbc330304ba2 | /test/test_camera_model.cpp | 7b798c2d8463d26906bfaacefb289e4a055553fd | [] | no_license | JHzss/VIssvo | 64bfb8b11a684fd80e5985a68ceb8e0917f074d4 | 69bb28171a318fd9a9436c0d3888ab1dac634748 | refs/heads/master | 2020-03-28T08:56:52.005204 | 2018-11-22T07:13:55 | 2018-11-22T07:13:55 | 148,001,707 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,480 | cpp | #include <fstream>
#include <sstream>
#include "global.hpp"
#include "utils.hpp"
#include "camera.hpp"
//! please use the TUM mono dataset
//! https://vision.in.tum.de/data/datasets/mono-dataset
class UndistorterFOV
{
public:
UndistorterFOV(ssvo::AbstractCamera::Ptr cam) : cam_(cam) { getundistortMap();}
void getundistortMap()
{
remapX_ = cv::Mat::zeros(cam_->height(), cam_->width(), CV_32FC1);
remapY_ = cv::Mat::zeros(cam_->height(), cam_->width(), CV_32FC1);
for (int y = 0; y < cam_->height(); ++y)
for (int x = 0; x < cam_->width(); ++x)
{
double x_norm = (x - cam_->cx()) / cam_->fx();
double y_norm = (y - cam_->cy()) / cam_->fy();
Vector2d px_dist = cam_->project(x_norm, y_norm);
remapX_.at<float>(y, x) = static_cast<float>(px_dist[0]);
remapY_.at<float>(y, x) = static_cast<float>(px_dist[1]);
}
}
void undistort(const cv::Mat &img_dist, cv::Mat &img_udist)
{
LOG_ASSERT(img_dist.cols == cam_->width() && img_dist.rows == cam_->height()) << "Error input image size";
LOG_ASSERT(img_dist.type() == CV_8UC1) << "Error input image type";
img_udist = cv::Mat::zeros(cam_->height(), cam_->width(), CV_8UC1);
for (int y = 0; y < cam_->height(); ++y)
for (int x = 0; x < cam_->width(); ++x)
{
float x_d = remapX_.at<float>(y, x);
float y_d = remapY_.at<float>(y, x);
if (!cam_->isInFrame(Vector2i(x_d, y_d)))
img_udist.at<float>(y, x) = 0;
img_udist.at<uchar>(y,x) = 0.5 + ssvo::utils::interpolateMat<uchar, float>(img_dist, x_d, y_d);
}
}
public:
ssvo::AbstractCamera::Ptr cam_;
cv::Mat remapX_;
cv::Mat remapY_;
};
int main(int argc, char *argv[])
{
LOG_ASSERT(argc == 2) << "run as: ./test_camera_model dataset_dir";
std::string dataset = argv[1];
std::ifstream ifstream_config(dataset+"camera.txt");
std::ifstream ifstream_times(dataset+"times.txt");
if(!ifstream_config.good())
{
std::cout << "Failed to read camera calibration file: " << dataset+"camera.txt" << std::endl;
return -1;
}
if(!ifstream_times.good())
{
std::cout << "Failed to read image timestamp file: " << dataset+"times.txt" << std::endl;
return -1;
}
std::string l1, l2;
std::getline(ifstream_config, l1);
std::getline(ifstream_config, l2);
int width, height;
float fx, fy, cx, cy, s;
if(std::sscanf(l1.c_str(), "%f %f %f %f %f", &fx, &fy, &cx, &cy, &s) == 5 &&
std::sscanf(l2.c_str(), "%d %d", &width, &height) == 2)
{
std::cout << "Input resolution: " << width << " " << height << std::endl;
std::cout << "Input Calibration (fx fy cx cy): "
<< width * fx << " " << height * fy << " " << width * cx << " " << height * cy << std::endl;
}
else
{
std::cout << "Failed to read camera calibration parameters: " << dataset+"camera.txt" << std::endl;
return -1;
}
ssvo::AtanCamera::Ptr atan_cam = ssvo::AtanCamera::create(width, height, fx, fy, cx, cy, s);
UndistorterFOV undistorter(std::static_pointer_cast<ssvo::AbstractCamera>(atan_cam));
bool is_undistort = false;
bool is_autoplay = false;
std::string timestamp_line;
while(std::getline(ifstream_times, timestamp_line))
{
std::string id;
std::istringstream istream_line(timestamp_line);
istream_line >> id;
cv::Mat image_input = cv::imread(dataset + "images/" + id + ".jpg", CV_LOAD_IMAGE_GRAYSCALE);
LOG_ASSERT(!image_input.empty()) << "Error in loading image: " + dataset + "images/"+ id + ".jpg";
cv::Mat image_undistorted;
undistorter.undistort(image_input, image_undistorted);;
while(true)
{
cv::Mat show = is_undistort ? image_undistorted : image_input;
cv::imshow("image show", show);
char k;
if(is_autoplay) k = cv::waitKey(1);
else k = cv::waitKey(0);
if(k == ' ') break;
if(k == 'r' || k == 'R') is_undistort = !is_undistort;
if(k == 'a' || k == 'A') is_autoplay = !is_autoplay;
if(is_autoplay) break;
}
}
std::cout << "End!!!" << std::endl;
cv::waitKey(0);
return 0;
} | [
"978176585@qq.com"
] | 978176585@qq.com |
2c5f131bed8dcda7827e1760a2bc9970fe51e730 | 2ef0b5ace4e77b3fbfb7ca75eef3aef4decb5013 | /chromecast/browser/android/cast_content_window_android.cc | 573cc7d6458513f1055e12535bf9e00f1005c323 | [
"BSD-3-Clause"
] | permissive | davgit/chromium | 309fb3749c1f9dcc24d38993fb69623c2d3235bf | f98299a83f66926792ef5f127a3f451325817df6 | refs/heads/master | 2022-12-27T21:13:08.716205 | 2019-10-23T15:14:07 | 2019-10-23T15:14:07 | 217,097,003 | 1 | 0 | BSD-3-Clause | 2019-10-23T15:55:35 | 2019-10-23T15:55:34 | null | UTF-8 | C++ | false | false | 4,828 | cc | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromecast/browser/android/cast_content_window_android.h"
#include <memory>
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "chromecast/browser/jni_headers/CastContentWindowAndroid_jni.h"
#include "content/public/browser/web_contents.h"
#include "ui/events/keycodes/keyboard_code_conversion_android.h"
namespace chromecast {
using base::android::ConvertUTF8ToJavaString;
namespace shell {
namespace {
base::android::ScopedJavaLocalRef<jobject> CreateJavaWindow(
jlong native_window,
bool is_headless,
bool enable_touch_input,
bool is_remote_control_mode,
bool turn_on_screen,
const std::string& session_id) {
JNIEnv* env = base::android::AttachCurrentThread();
return Java_CastContentWindowAndroid_create(
env, native_window, is_headless, enable_touch_input,
is_remote_control_mode, turn_on_screen,
ConvertUTF8ToJavaString(env, session_id));
}
} // namespace
// static
std::unique_ptr<CastContentWindow> CastContentWindow::Create(
const CastContentWindow::CreateParams& params) {
return base::WrapUnique(new CastContentWindowAndroid(params));
}
CastContentWindowAndroid::CastContentWindowAndroid(
const CastContentWindow::CreateParams& params)
: delegate_(params.delegate),
java_window_(CreateJavaWindow(reinterpret_cast<jlong>(this),
params.is_headless,
params.enable_touch_input,
params.is_remote_control_mode,
params.turn_on_screen,
params.session_id)) {
DCHECK(delegate_);
}
CastContentWindowAndroid::~CastContentWindowAndroid() {
JNIEnv* env = base::android::AttachCurrentThread();
Java_CastContentWindowAndroid_onNativeDestroyed(env, java_window_);
}
void CastContentWindowAndroid::CreateWindowForWebContents(
content::WebContents* web_contents,
CastWindowManager* /* window_manager */,
CastWindowManager::WindowId /* z_order */,
VisibilityPriority visibility_priority) {
DCHECK(web_contents);
JNIEnv* env = base::android::AttachCurrentThread();
base::android::ScopedJavaLocalRef<jobject> java_web_contents =
web_contents->GetJavaWebContents();
Java_CastContentWindowAndroid_createWindowForWebContents(
env, java_window_, java_web_contents,
static_cast<int>(visibility_priority));
}
void CastContentWindowAndroid::GrantScreenAccess() {
NOTIMPLEMENTED();
}
void CastContentWindowAndroid::RevokeScreenAccess() {
NOTIMPLEMENTED();
}
void CastContentWindowAndroid::EnableTouchInput(bool enabled) {
JNIEnv* env = base::android::AttachCurrentThread();
Java_CastContentWindowAndroid_enableTouchInput(
env, java_window_, static_cast<jboolean>(enabled));
}
void CastContentWindowAndroid::OnActivityStopped(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& jcaller) {
delegate_->OnWindowDestroyed();
}
void CastContentWindowAndroid::RequestVisibility(
VisibilityPriority visibility_priority) {
JNIEnv* env = base::android::AttachCurrentThread();
Java_CastContentWindowAndroid_requestVisibilityPriority(
env, java_window_, static_cast<int>(visibility_priority));
}
void CastContentWindowAndroid::SetActivityContext(
base::Value activity_context) {}
void CastContentWindowAndroid::SetHostContext(base::Value host_context) {}
void CastContentWindowAndroid::NotifyVisibilityChange(
VisibilityType visibility_type) {
delegate_->OnVisibilityChange(visibility_type);
for (auto& observer : observer_list_) {
observer.OnVisibilityChange(visibility_type);
}
}
void CastContentWindowAndroid::RequestMoveOut() {
JNIEnv* env = base::android::AttachCurrentThread();
Java_CastContentWindowAndroid_requestMoveOut(env, java_window_);
}
bool CastContentWindowAndroid::ConsumeGesture(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& jcaller,
int gesture_type) {
return delegate_->ConsumeGesture(static_cast<GestureType>(gesture_type));
}
void CastContentWindowAndroid::OnVisibilityChange(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& jcaller,
int visibility_type) {
NotifyVisibilityChange(static_cast<VisibilityType>(visibility_type));
}
base::android::ScopedJavaLocalRef<jstring> CastContentWindowAndroid::GetId(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& jcaller) {
return ConvertUTF8ToJavaString(env, delegate_->GetId());
}
} // namespace shell
} // namespace chromecast
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
69fa0150d505bbee2e1bdfd4800dec8cf4b34e27 | e4efbce1cf8e880a76e852908a5d55769684b61c | /uHunt/uva12192.cpp | b59b0f005ca5dcb4f6a4524a89249535d6faff82 | [] | no_license | Sodbayar/Competitive-Programming | d96dc51e26e7cdb738ce7e68de7dbac9384c9027 | ced407a539a6504f913fa3f2e1bbca723122e993 | refs/heads/master | 2021-08-07T11:01:13.528440 | 2021-07-30T21:50:05 | 2021-07-30T21:50:05 | 231,866,744 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,475 | cpp | #include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <climits>
#include <sstream>
#include <map>
#include <unordered_map>
#include <cctype>
#include <bitset>
#include <stack>
#include <iterator>
#define vi vector<int>
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define ll long long
#define oo (int)1e9
#define ii pair<int, int>
#define forl(i, k, p) for (int i = k; i <= p; i++)
#define loop(i, p) for (int i = 0; i < p; i++)
#define sf(a) scanf("%d",&a)
#define sfl(a) scanf("%lld",&a)
#define sff(a,b) scanf("%d %d",&a,&bingo)
#define sffl(a,b) scanf("%lld %lld",&a,&bingo)
#define sfff(a,b,c) scanf("%d %d %d",&a,&bingo,&c)
using namespace std;
int grid[505][505];
int n, m;
int l, r;
bool isOK(int x, int y, int len) {
if (x + len >= n || y + len >= m) return 0;
return 1;
}
int main() {
/*freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);*/
while (cin >> n >> m, n + m) {
loop(i, n) loop(j, m) cin >> grid[i][j];
int Q; cin >> Q;
while (Q--) {
int maxNum = 0;
cin >> l >> r;
loop(i, n - maxNum + 1) {
loop(j, m - maxNum + 1) {
if (grid[i][j] >= l) {
int len = maxNum;
while (isOK(i, j, len) && grid[i + len][j + len] <= r) len++;
maxNum = max(maxNum, len);
}
}
}
cout << maxNum << endl;
if (Q == 0) cout << "-\n";
}
}
}
| [
"snanjidj@codeustudents.com"
] | snanjidj@codeustudents.com |
6ffdb8695a025ade9ba7d204e665a3ee700b4ac7 | ec34a0afa695d07b868f82f8ead4fb82e5506a9f | /pathfinder/hw_interface_plugins/hw_interface_plugin_adis_imu/include/hw_interface_plugin_adis_imu/hw_interface_plugin_adis_imu_serial.hpp | 5db9b4f50cc4bbfc558bf57cc040ab8bf9d32d70 | [
"MIT"
] | permissive | cagrikilic/simulation-environment | 108b944140f485ad42af559c3e2f906cd8892138 | 459ded470c708a423fc8bcc6157b57399ae89c03 | refs/heads/main | 2023-05-01T11:16:28.158772 | 2021-05-19T15:22:39 | 2021-05-19T15:22:39 | 368,906,848 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,115 | hpp | #ifndef HW_INTERFACE_PLUGIN_ADIS_IMU_HPP__
#define HW_INTERFACE_PLUGIN_ADIS_IMU_HPP__
//always inlclude these
#include <ros/ros.h>
#include <pluginlib/class_list_macros.h>
#include <hw_interface/base_interface.hpp>
//include the header of the base type you want, Serial or UDP
#include <hw_interface/base_serial_interface.hpp>
//include ros message types
#include <sensor_msgs/Imu.h>
//TODO
//#include <sensor_msgs/MagneticField.h>
//#include <sensor_msgs/FluidPressure.h>
#define CRC32_POLYNOMIAL 0xEDB88320L
#define PI 3.14159265358979
#define RAD2DEG 180.0/PI
#define DEG2RAD PI/180.0
#define IMU_RATE 125.0 // Hz
namespace hw_interface_plugin_adis_imu {
class adis_imu_serial : public base_classes::base_serial_interface
{
public:
adis_imu_serial();
~adis_imu_serial() {}
protected:
//these methods are abstract as defined by the base_serial_interface
//they must be defined
bool subPluginInit(ros::NodeHandlePtr nhPtr);
void setInterfaceOptions();
bool interfaceReadHandler(const size_t &length, int arrayStartPos, const boost::system::error_code &ec);
bool verifyChecksum();
std::size_t adisIMUStreamMatcher(const boost::system::error_code &error, long totalBytesInBuffer);
long headerLen;
long fullPacketLen;
sensor_msgs::Imu imuMessage;
sensor_msgs::Imu imuMessageAdis;
//TODO
//sensor_msgs::MagneticField magMessage
//sensor_msgs::FluidPressure barMessage
ros::Publisher imuPublisher;
ros::Publisher imuPublisherAdis;
//TODO
//ros::Publisher magPublisher;
//ros::Publisher barPublisher;
double gyroScaleFactor;
double accelScaleFactor;
private:
unsigned long CRC32Value_(int i);
unsigned long CalculateBlockCRC32_(unsigned long ulCount, unsigned char *ucBuffer ); // Number of bytes in the data block, Data block
};
}
PLUGINLIB_EXPORT_CLASS(hw_interface_plugin_adis_imu::adis_imu_serial, base_classes::base_interface)
#endif //HW_INTERFACE_PLUGIN_ADIS_IMU_HPP__
| [
"cakilic@mix.wvu.edu"
] | cakilic@mix.wvu.edu |
729e8ea7a0c1037789496b3f1dccbedac98c4e6c | be6ed2363f68560a7b623a0cf9501af1ad8b3eeb | /chrome/browser/sharing/shared_clipboard/shared_clipboard_ui_controller.h | f7f8ca86cac676593357c95c4b91dfce8fdbcde5 | [
"BSD-3-Clause"
] | permissive | bugHappy/chromium | 7dc267eadb8488022869f90a3e5d7c2e99be9e38 | fb3afdd4ece94895a805e6ba9455592b039b8aea | refs/heads/master | 2023-03-15T20:57:17.109148 | 2019-08-30T12:53:52 | 2019-08-30T12:53:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,257 | h | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SHARING_SHARED_CLIPBOARD_SHARED_CLIPBOARD_UI_CONTROLLER_H_
#define CHROME_BROWSER_SHARING_SHARED_CLIPBOARD_SHARED_CLIPBOARD_UI_CONTROLLER_H_
#include <memory>
#include <string>
#include <vector>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/sharing/sharing_ui_controller.h"
#include "chrome/browser/ui/page_action/page_action_icon_container.h"
#include "content/public/browser/web_contents_user_data.h"
namespace content {
class WebContents;
} // namespace content
class SharedClipboardUiController
: public SharingUiController,
public content::WebContentsUserData<SharedClipboardUiController> {
public:
static SharedClipboardUiController* GetOrCreateFromWebContents(
content::WebContents* web_contents);
~SharedClipboardUiController() override;
void OnDeviceSelected(const base::string16& text,
const syncer::DeviceInfo& device);
// Overridden from SharingUiController:
base::string16 GetTitle() override;
PageActionIconType GetIconType() override;
int GetRequiredDeviceCapabilities() override;
void OnDeviceChosen(const syncer::DeviceInfo& device) override;
void OnAppChosen(const App& app) override;
const gfx::VectorIcon& GetVectorIcon() const override;
base::string16 GetTextForTooltipAndAccessibleName() const override;
// Called by the SharedClipboardDialogView when the help text got clicked.
void OnHelpTextClicked();
protected:
explicit SharedClipboardUiController(content::WebContents* web_contents);
// Overridden from SharingUiController:
SharingDialog* DoShowDialog(BrowserWindow* window) override;
void DoUpdateApps(UpdateAppsCallback callback) override;
private:
friend class content::WebContentsUserData<SharedClipboardUiController>;
base::string16 text_;
base::WeakPtrFactory<SharedClipboardUiController> weak_ptr_factory_{this};
WEB_CONTENTS_USER_DATA_KEY_DECL();
DISALLOW_COPY_AND_ASSIGN(SharedClipboardUiController);
};
#endif // CHROME_BROWSER_SHARING_SHARED_CLIPBOARD_SHARED_CLIPBOARD_UI_CONTROLLER_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
8e6985899460a51d51d49eb60934f3d76c3b16c3 | 355950fa7fc4cfddcb5d85d7cf56e2f23bb2c015 | /Models/ak47 new.re | 1dace3c4e41346eb22b87c062ae42ab9ad023543 | [] | no_license | repoman123/RepoBond | 700e5e8bd801b2e765c9ba07a796e06e77542999 | a79cc3229b08f83d9107021901df69cabaed737f | refs/heads/master | 2020-04-12T04:01:19.382666 | 2019-01-30T20:48:45 | 2019-01-30T20:48:45 | 162,282,381 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 173,904 | re | FileInfo
{
:Type=RepoSoft Model File
:Creation Time=21:3:39
:Creation Date=2/3/2013
:Creator=ReConvert
}
:Materials
{
:Material
{
:Name=_01 - Default
:Opacity=1
:DiffuseColor=0.6;0.6;0.6
:AmbientColor=0.588235;0.588235;0.588235
:SpecularColor=0;0;0
:DiffuseTexture=C:\Users\Erik\Documents\3dsMax\scenes\textures\ak47\1.JPG
}
:Material
{
:Name=_01 - Default_ncl1_1
:Opacity=1
:DiffuseColor=0.992157;0.756863;0.117647
:AmbientColor=0.992157;0.756863;0.117647
:SpecularColor=0;0;0
}
:Material
{
:Name=_02 - Default
:Opacity=1
:DiffuseColor=0.6;0.6;0.6
:AmbientColor=0.588235;0.588235;0.588235
:SpecularColor=0;0;0
:DiffuseTexture=C:\Users\Erik\Documents\3dsMax\scenes\textures\ak47\2.JPG
}
:Material
{
:Name=_03 - Default
:Opacity=1
:DiffuseColor=0.6;0.6;0.6
:AmbientColor=0.588235;0.588235;0.588235
:SpecularColor=0;0;0
:DiffuseTexture=C:\Users\Erik\Documents\3dsMax\scenes\textures\ak47\3.JPG
}
:Material
{
:Name=_07 - Default
:Opacity=1
:DiffuseColor=0.6;0.6;0.6
:AmbientColor=0.588235;0.588235;0.588235
:SpecularColor=0;0;0
:DiffuseTexture=C:\Users\Erik\Documents\3dsMax\scenes\textures\ak47\4.JPG
}
:Material
{
:Name=_08 - Default
:Opacity=1
:DiffuseColor=0.6;0.6;0.6
:AmbientColor=0.588235;0.588235;0.588235
:SpecularColor=0;0;0
:DiffuseTexture=C:\Users\Erik\Documents\3dsMax\scenes\textures\ak47\5.JPG
}
:Material
{
:Name=_09 - Default
:Opacity=1
:DiffuseColor=0.6;0.6;0.6
:AmbientColor=0.588235;0.588235;0.588235
:SpecularColor=0;0;0
:DiffuseTexture=C:\Users\Erik\Documents\3dsMax\scenes\textures\ak47\6.JPG
}
:Material
{
:Name=_13 - Default
:Opacity=1
:DiffuseColor=0.6;0.6;0.6
:AmbientColor=0.588235;0.588235;0.588235
:SpecularColor=0;0;0
:DiffuseTexture=C:\Users\Erik\Documents\3dsMax\scenes\textures\ak47\7.JPG
}
:Material
{
:Name=_14 - Default
:Opacity=1
:DiffuseColor=0.6;0.6;0.6
:AmbientColor=0.588235;0.588235;0.588235
:SpecularColor=0;0;0
:DiffuseTexture=C:\Users\Erik\Documents\3dsMax\scenes\textures\ak47\8.JPG
}
:Material
{
:Name=_15 - Default
:Opacity=1
:DiffuseColor=0.078431;0.078431;0.078431
:AmbientColor=0.078431;0.078431;0.078431
:SpecularColor=0;0;0
}
}
:Objects
{
:Dummy
{
:Name=root
:Matrix=1;0;0;0;0;0;-1;0;0;1;0;0;0;0;0;1
}
:Dummy
{
:Name=Handle1
:Matrix=-0.010946;9.3e-005;0.000144;0;0.000144;1.5e-005;0.010947;0;9.2e-005;0.010947;-1.6e-005;0;0;0;0;1
}
:Mesh
{
:Name=AK 47
:Matrix=0;0;-0.234911;0;0;0.128646;0;0;-0.234911;0;0;0;1.42373;10.1414;17.6731;1
:MatIndex=4
:VertexCount=396
:IndexCount=876
:Indices
{
0;1;2;1;3;4;0;3;1;0;5;3;0;6;5;0;7;6;8;9;10;9;11;12;8;11;9;11;13;14;8;13;11;15;13;8;16;17;18;19;17;16;20;17;19;21;22;23;22;24;25;21;24;22;21;26;24;27;26;21;28;29;30;29;28;31;32;33;34;33;32;35;36;37;38;37;36;39;40;41;42;41;40;43;44;45;46;45;44;47;48;49;50;49;48;51;52;53;54;53;52;55;56;57;58;57;56;59;60;61;62;61;60;63;64;65;66;65;64;67;68;69;70;69;68;71;72;73;74;73;72;75;76;77;78;77;76;79;80;81;82;81;80;83;84;85;86;85;84;87;88;89;90;89;88;91;92;93;94;93;92;95;96;97;98;97;96;99;100;101;102;101;100;103;104;105;106;105;104;107;108;109;110;109;108;111;112;113;114;113;112;115;116;117;118;117;116;119;120;121;122;121;120;123;124;125;126;125;124;127;128;129;130;129;128;131;132;133;134;133;132;135;136;137;138;137;139;140;136;139;137;139;141;142;136;141;139;143;141;136;143;144;141;144;145;146;144;147;145;148;146;145;148;149;146;150;149;148;150;151;149;150;152;151;150;153;152;150;154;153;147;154;150;147;155;154;147;156;155;156;157;158;147;157;156;147;159;157;147;160;159;147;161;160;147;162;161;163;158;157;164;165;166;165;167;168;164;167;165;164;169;167;158;169;164;169;170;171;158;170;169;158;172;170;163;172;158;173;172;163;174;172;173;162;172;174;147;172;162;147;175;172;144;175;147;144;176;175;144;177;176;178;171;170;178;179;171;180;179;178;179;181;182;181;183;184;179;183;181;180;183;179;177;183;180;177;185;183;177;186;185;177;187;186;177;188;187;144;188;177;189;184;190;184;182;181;189;182;184;189;191;182;188;191;189;144;191;188;143;191;144;191;192;193;143;192;191;143;194;192;143;195;194;143;20;195;143;17;20;17;136;18;143;136;17;196;197;198;196;199;197;196;200;199;200;201;202;196;201;200;196;203;201;204;205;206;205;204;207;208;209;210;209;211;212;211;213;214;209;213;211;208;213;209;215;213;208;216;217;218;216;219;217;220;219;216;221;222;223;222;224;225;221;224;222;226;224;221;227;224;226;228;229;230;229;228;231;232;233;234;233;232;235;236;237;238;237;236;239;240;241;242;241;240;243;244;245;246;245;244;247;248;249;250;249;248;251;252;253;254;253;252;255;256;257;258;257;256;259;260;261;262;261;260;263;264;265;266;265;264;267;268;269;270;269;268;271;272;273;274;273;272;275;276;277;278;277;276;279;280;281;282;281;280;283;284;285;286;285;284;287;288;289;290;289;288;291;292;293;294;293;292;295;296;297;298;297;296;299;300;301;302;301;300;303;304;305;306;305;304;307;308;309;310;309;308;311;312;313;314;313;312;315;316;317;318;317;316;319;320;321;322;321;320;323;324;325;326;325;324;327;328;329;330;329;328;331;332;333;334;333;332;335;336;337;338;336;339;337;339;340;341;336;340;339;342;343;344;343;345;346;342;345;343;340;345;342;340;347;345;348;344;343;344;349;342;348;349;344;350;351;352;349;351;350;349;353;351;348;353;349;348;354;353;355;354;348;356;354;355;357;354;356;347;354;357;352;358;350;359;360;361;360;362;363;359;362;360;358;362;359;358;364;362;352;364;358;365;364;352;364;366;367;365;366;364;365;368;366;365;369;368;365;370;369;367;371;364;372;373;374;375;373;372;375;376;373;377;376;375;378;376;377;379;376;378;380;376;379;380;381;376;382;381;380;371;381;382;367;381;371;383;381;367;384;381;383;385;381;384;370;381;385;365;381;370;386;381;365;374;387;372;381;387;374;386;387;381;388;387;386;354;387;388;347;387;354;340;387;347;336;387;340;336;389;387;389;390;391;390;392;393;392;394;395;390;394;392;389;394;390;336;394;389;394;216;218;336;216;394;336;220;216;336;338;220;
}
:Positions
{
28.7364;-27.4254;10.9191
27.6239;-31.1873;10.9191
27.2405;-29.8047;10.9191
31.3655;-32.1885;10.9191
28.7644;-32.5887;10.9191
30.8331;-30.9041;10.9191
31.0033;-27.8113;10.9191
30.0549;-27.1066;10.9191
9.4434;-28.0968;10.9192
7.96551;-24.6626;10.9192
9.44781;-26.0493;10.9192
5.91699;-26.6663;10.9192
6.47877;-25.317;10.9192
7.20701;-29.759;10.9192
6.46671;-28.7217;10.9192
9.06781;-29.454;10.9192
-29.4432;19.4805;6.32179
-32.3505;14.1269;4.66406
-29.4432;21.4375;4.66406
51.5745;21.4375;6.32179
55.8797;15.5666;4.66406
15.0395;-22.7457;10.9192
12.8047;-22.3679;10.9192
14.2952;-21.7134;10.9192
12.2392;-26.4401;10.9192
12.2417;-24.7372;10.9192
13.5437;-27.4892;10.9192
15.2246;-25.1311;10.9192
-7.64475;-16.3154;10.201
-37.8144;-13.2318;7.95678
-37.8144;-13.2318;10.201
-7.64475;-16.3154;7.95678
-37.8144;-13.2318;10.201
-38.2287;-23.8544;7.95678
-38.2287;-23.8544;10.201
-37.8144;-13.2318;7.95678
-38.2287;-23.8544;10.201
-8.10563;-25.7346;7.95678
-8.10563;-25.7346;10.201
-38.2287;-23.8544;7.95678
-8.10563;-25.7346;10.201
-7.64475;-16.3154;7.95678
-7.64475;-16.3154;10.201
-8.10563;-25.7346;7.95678
30.8331;-30.9041;10.201
31.0033;-27.8113;10.9191
31.0033;-27.8113;10.201
30.8331;-30.9041;10.9191
31.0033;-27.8113;10.201
30.0549;-27.1066;10.9191
30.0549;-27.1066;10.201
31.0033;-27.8113;10.9191
30.0549;-27.1066;10.201
28.7364;-27.4254;10.9191
28.7364;-27.4254;10.201
30.0549;-27.1066;10.9191
28.7364;-27.4254;10.201
27.2405;-29.8047;10.9191
27.2405;-29.8047;10.201
28.7364;-27.4254;10.9191
27.2405;-29.8047;10.201
27.6239;-31.1873;10.9191
27.6239;-31.1873;10.201
27.2405;-29.8047;10.9191
27.6239;-31.1873;10.201
28.7644;-32.5887;10.9191
28.7644;-32.5887;10.201
27.6239;-31.1873;10.9191
28.7644;-32.5887;10.201
31.3655;-32.1885;10.9191
31.3655;-32.1885;10.201
28.7644;-32.5887;10.9191
31.3655;-32.1885;10.201
30.8331;-30.9041;10.9191
30.8331;-30.9041;10.201
31.3655;-32.1885;10.9191
6.46671;-28.7217;10.201
7.20701;-29.759;10.9192
7.20701;-29.759;10.201
6.46671;-28.7217;10.9192
7.20701;-29.759;10.201
9.06781;-29.454;10.9192
9.06781;-29.454;10.201
7.20701;-29.759;10.9192
9.06781;-29.454;10.201
9.4434;-28.0968;10.9192
9.4434;-28.0968;10.201
9.06781;-29.454;10.9192
9.4434;-28.0968;10.201
9.44781;-26.0493;10.9192
9.44781;-26.0493;10.201
9.4434;-28.0968;10.9192
9.44781;-26.0493;10.201
7.96551;-24.6626;10.9192
7.96551;-24.6626;10.201
9.44781;-26.0493;10.9192
7.96551;-24.6626;10.201
6.47877;-25.317;10.9192
6.47877;-25.317;10.201
7.96551;-24.6626;10.9192
6.47877;-25.317;10.201
5.91699;-26.6663;10.9192
5.91699;-26.6663;10.201
6.47877;-25.317;10.9192
5.91699;-26.6663;10.201
6.46671;-28.7217;10.9192
6.46671;-28.7217;10.201
5.91699;-26.6663;10.9192
12.2392;-26.4401;10.201
13.5437;-27.4892;10.9192
13.5437;-27.4892;10.201
12.2392;-26.4401;10.9192
13.5437;-27.4892;10.201
15.2246;-25.1311;10.9192
15.2246;-25.1311;10.201
13.5437;-27.4892;10.9192
15.2246;-25.1311;10.201
15.0395;-22.7457;10.9192
15.0395;-22.7457;10.201
15.2246;-25.1311;10.9192
15.0395;-22.7457;10.201
14.2952;-21.7134;10.9192
14.2952;-21.7134;10.201
15.0395;-22.7457;10.9192
14.2952;-21.7134;10.201
12.8047;-22.3679;10.9192
12.8047;-22.3679;10.201
14.2952;-21.7134;10.9192
12.8047;-22.3679;10.201
12.2417;-24.7372;10.9192
12.2417;-24.7372;10.201
12.8047;-22.3679;10.9192
12.2417;-24.7372;10.201
12.2392;-26.4401;10.9192
12.2392;-26.4401;10.201
12.2417;-24.7372;10.9192
-33.3571;20.6547;8.54326
-53.7093;24.5686;10.201
-32.9657;25.3514;10.201
-54.8835;19.4805;10.201
-55.2749;22.6116;10.201
-59.5801;-0.480347;10.201
-59.1888;19.8719;10.201
-33.4104;6.38524;8.54326
-43.9246;-0.480347;10.201
-37.8144;-13.2318;10.201
-43.4477;-12.8791;10.201
-7.64475;-16.3154;10.201
-38.2287;-23.8544;10.201
-42.7504;-31.0087;10.201
-8.10563;-25.7346;10.201
-32.7489;-30.9323;10.201
-23.1239;-30.9003;10.201
-14.252;-30.9574;10.201
-6.50979;-31.1479;10.201
-0.273806;-31.5165;10.201
4.0794;-32.1076;10.201
7.20701;-29.759;10.201
6.17328;-32.9657;10.201
6.46671;-28.7217;10.201
5.91699;-26.6663;10.201
6.47877;-25.317;10.201
7.96551;-24.6626;10.201
9.06781;-29.454;10.201
7.06903;-33.8466;10.201
9.15149;-34.9683;10.201
8.06747;-34.5016;10.201
11.5078;-35.4874;10.201
10.304;-35.2843;10.201
12.7459;-35.6152;10.201
13.5437;-27.4892;10.201
14.0011;-35.7054;10.201
12.2392;-26.4401;10.201
9.4434;-28.0968;10.201
9.44781;-26.0493;10.201
12.2417;-24.7372;10.201
12.8047;-22.3679;10.201
14.2952;-21.7134;10.201
15.2246;-25.1311;10.201
17.5236;-33.3571;10.201
15.0395;-22.7457;10.201
31.9873;-33.6885;10.201
33.9619;-35.314;10.201
28.7644;-32.5887;10.201
31.3655;-32.1885;10.201
27.6239;-31.1873;10.201
27.2405;-29.8047;10.201
28.7364;-27.4254;10.201
30.0549;-27.1066;10.201
31.0033;-27.8113;10.201
30.8331;-30.9041;10.201
63.7075;-37.271;10.201
62.5334;-4.78563;10.201
65.2731;-4.78563;10.201
63.7075;-0.480347;10.201
60.185;6.17328;8.54326
28.7364;-27.4254;-5.91443
31.0033;-27.8113;-5.91443
30.0549;-27.1066;-5.91443
30.8331;-30.9041;-5.91443
31.3655;-32.1885;-5.91443
27.6239;-31.1873;-5.91443
28.7644;-32.5887;-5.91443
27.2405;-29.8047;-5.91443
-8.10563;-25.7346;-2.95206
-37.8144;-13.2318;-2.95206
-38.2287;-23.8544;-2.95206
-7.64475;-16.3154;-2.95206
7.20701;-29.759;-5.91443
5.91699;-26.6663;-5.91443
6.46671;-28.7217;-5.91443
7.96551;-24.6626;-5.91443
6.47877;-25.317;-5.91443
9.4434;-28.0968;-5.91443
9.44781;-26.0493;-5.91443
9.06781;-29.454;-5.91443
-32.3505;14.1269;0.340661
-29.4432;19.4805;-1.31708
-29.4432;21.4375;0.340661
51.5745;21.4375;-1.31708
55.8797;15.5666;0.340661
12.2392;-26.4401;-5.91443
12.8047;-22.3679;-5.91443
12.2417;-24.7372;-5.91443
15.0395;-22.7457;-5.91443
14.2952;-21.7134;-5.91443
13.5437;-27.4892;-5.91443
15.2246;-25.1311;-5.91443
-7.64475;-16.3154;-5.19628
-37.8144;-13.2318;-2.95206
-7.64475;-16.3154;-2.95206
-37.8144;-13.2318;-5.19628
-37.8144;-13.2318;-5.19628
-38.2287;-23.8544;-2.95206
-37.8144;-13.2318;-2.95206
-38.2287;-23.8544;-5.19628
-38.2287;-23.8544;-5.19628
-8.10563;-25.7346;-2.95206
-38.2287;-23.8544;-2.95206
-8.10563;-25.7346;-5.19628
-8.10563;-25.7346;-5.19628
-7.64475;-16.3154;-2.95206
-8.10563;-25.7346;-2.95206
-7.64475;-16.3154;-5.19628
30.8331;-30.9041;-5.19628
31.0033;-27.8113;-5.91443
30.8331;-30.9041;-5.91443
31.0033;-27.8113;-5.19628
31.0033;-27.8113;-5.19628
30.0549;-27.1066;-5.91443
31.0033;-27.8113;-5.91443
30.0549;-27.1066;-5.19628
30.0549;-27.1066;-5.19628
28.7364;-27.4254;-5.91443
30.0549;-27.1066;-5.91443
28.7364;-27.4254;-5.19628
28.7364;-27.4254;-5.19628
27.2405;-29.8047;-5.91443
28.7364;-27.4254;-5.91443
27.2405;-29.8047;-5.19628
27.2405;-29.8047;-5.19628
27.6239;-31.1873;-5.91443
27.2405;-29.8047;-5.91443
27.6239;-31.1873;-5.19628
27.6239;-31.1873;-5.19628
28.7644;-32.5887;-5.91443
27.6239;-31.1873;-5.91443
28.7644;-32.5887;-5.19628
28.7644;-32.5887;-5.19628
31.3655;-32.1885;-5.91443
28.7644;-32.5887;-5.91443
31.3655;-32.1885;-5.19628
31.3655;-32.1885;-5.19628
30.8331;-30.9041;-5.91443
31.3655;-32.1885;-5.91443
30.8331;-30.9041;-5.19628
6.46671;-28.7217;-5.19628
7.20701;-29.759;-5.91443
6.46671;-28.7217;-5.91443
7.20701;-29.759;-5.19628
7.20701;-29.759;-5.19628
9.06781;-29.454;-5.91443
7.20701;-29.759;-5.91443
9.06781;-29.454;-5.19628
9.06781;-29.454;-5.19628
9.4434;-28.0968;-5.91443
9.06781;-29.454;-5.91443
9.4434;-28.0968;-5.19628
9.4434;-28.0968;-5.19628
9.44781;-26.0493;-5.91443
9.4434;-28.0968;-5.91443
9.44781;-26.0493;-5.19628
9.44781;-26.0493;-5.19628
7.96551;-24.6626;-5.91443
9.44781;-26.0493;-5.91443
7.96551;-24.6626;-5.19628
7.96551;-24.6626;-5.19628
6.47877;-25.317;-5.91443
7.96551;-24.6626;-5.91443
6.47877;-25.317;-5.19628
6.47877;-25.317;-5.19628
5.91699;-26.6663;-5.91443
6.47877;-25.317;-5.91443
5.91699;-26.6663;-5.19628
5.91699;-26.6663;-5.19628
6.46671;-28.7217;-5.91443
5.91699;-26.6663;-5.91443
6.46671;-28.7217;-5.19628
12.2392;-26.4401;-5.19628
13.5437;-27.4892;-5.91443
12.2392;-26.4401;-5.91443
13.5437;-27.4892;-5.19628
13.5437;-27.4892;-5.19628
15.2246;-25.1311;-5.91443
13.5437;-27.4892;-5.91443
15.2246;-25.1311;-5.19628
15.2246;-25.1311;-5.19628
15.0395;-22.7457;-5.91443
15.2246;-25.1311;-5.91443
15.0395;-22.7457;-5.19628
15.0395;-22.7457;-5.19628
14.2952;-21.7134;-5.91443
15.0395;-22.7457;-5.91443
14.2952;-21.7134;-5.19628
14.2952;-21.7134;-5.19628
12.8047;-22.3679;-5.91443
14.2952;-21.7134;-5.91443
12.8047;-22.3679;-5.19628
12.8047;-22.3679;-5.19628
12.2417;-24.7372;-5.91443
12.8047;-22.3679;-5.91443
12.2417;-24.7372;-5.19628
12.2417;-24.7372;-5.19628
12.2392;-26.4401;-5.91443
12.2417;-24.7372;-5.91443
12.2392;-26.4401;-5.19628
-33.4104;6.38524;-3.53854
63.7075;-0.480345;-5.19628
60.185;6.17328;-3.53854
62.5334;-4.78563;-5.19628
63.7075;-37.271;-5.19628
65.2731;-4.78563;-5.19628
33.9619;-35.314;-5.19628
31.3655;-32.1885;-5.19628
31.9873;-33.6885;-5.19628
31.0033;-27.8113;-5.19628
30.8331;-30.9041;-5.19628
30.0549;-27.1066;-5.19628
28.7644;-32.5887;-5.19628
17.5236;-33.3571;-5.19628
14.0011;-35.7054;-5.19628
15.2246;-25.1311;-5.19628
13.5437;-27.4892;-5.19628
15.0395;-22.7457;-5.19628
14.2952;-21.7134;-5.19628
27.6239;-31.1873;-5.19628
27.2405;-29.8047;-5.19628
28.7364;-27.4254;-5.19628
12.7459;-35.6152;-5.19628
11.5078;-35.4874;-5.19628
9.15149;-34.9683;-5.19628
10.304;-35.2843;-5.19628
7.06903;-33.8466;-5.19628
8.06747;-34.5016;-5.19628
6.17328;-32.9657;-5.19628
12.2392;-26.4401;-5.19628
9.06781;-29.454;-5.19628
7.20701;-29.759;-5.19628
9.4434;-28.0968;-5.19628
9.44781;-26.0493;-5.19628
7.96551;-24.6626;-5.19628
4.0794;-32.1076;-5.19628
-43.4477;-12.8791;-5.19628
-38.2287;-23.8544;-5.19628
-37.8144;-13.2318;-5.19628
-42.7504;-31.0087;-5.19628
-8.10563;-25.7346;-5.19628
-32.7489;-30.9323;-5.19628
-23.1239;-30.9003;-5.19628
-14.252;-30.9574;-5.19628
-6.50979;-31.1479;-5.19628
-7.64475;-16.3154;-5.19628
-0.273806;-31.5165;-5.19628
6.46671;-28.7217;-5.19628
5.91699;-26.6663;-5.19628
6.47877;-25.317;-5.19628
12.2417;-24.7372;-5.19628
-43.9246;-0.480345;-5.19628
12.8047;-22.3679;-5.19628
-59.5801;-0.480345;-5.19628
-54.8835;19.4805;-5.19628
-59.1888;19.8719;-5.19628
-53.7093;24.5686;-5.19628
-55.2749;22.6116;-5.19628
-33.3571;20.6547;-3.53854
-32.9657;25.3514;-5.19628
}
:Normals
{
-0;-0;-1
-1e-006;-0;-1
-0;-0;-1
-0;-0;-1
-1e-006;-1e-006;-1
3e-006;2e-006;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0.528527;-0.02426;-0.84857
-0.528032;-0.076042;-0.845813
-0.143259;0.056972;-0.988044
-0.004472;0.269694;-0.962936
-0.001855;-0.176904;-0.984226
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0.101679;0.994817;0
0.101679;0.994817;0
0.101679;0.994817;0
0.101679;0.994817;0
-0.99924;0.038975;0
-0.99924;0.038975;0
-0.99924;0.038975;0
-0.99924;0.038975;0
-0.062295;-0.998058;0
-0.062295;-0.998058;0
-0.062295;-0.998058;0
-0.062295;-0.998058;0
0.998805;-0.048871;0
0.998805;-0.048871;0
0.998805;-0.048871;0
0.998805;-0.048871;0
-0.99849;0.054934;0
-0.99849;0.054934;0
-0.99849;0.054934;0
-0.99849;0.054934;0
-0.596429;-0.802666;0
-0.596429;-0.802666;0
-0.596429;-0.802666;0
-0.596429;-0.802666;0
0.235034;-0.971987;0
0.235034;-0.971987;0
0.235034;-0.971987;0
0.235034;-0.971987;0
0.846586;-0.532253;0
0.846586;-0.532253;0
0.846586;-0.532253;0
0.846586;-0.532253;0
0.963637;0.267213;0
0.963637;0.267213;0
0.963638;0.267213;0
0.963638;0.267213;0
0.775608;0.631215;0
0.775608;0.631215;0
0.775608;0.631215;0
0.775608;0.631215;0
-0.152074;0.988369;0
-0.152074;0.988369;0
-0.152074;0.988369;0
-0.152074;0.988369;0
-0.92378;-0.382923;0
-0.92378;-0.382923;0
-0.92378;-0.382923;0
-0.92378;-0.382923;0
0.813976;0.580899;0
0.813976;0.580899;0
0.813976;0.580899;0
0.813976;0.580899;0
-0.161744;0.986833;0
-0.161744;0.986833;0
-0.161744;0.986833;0
-0.161744;0.986833;0
-0.963778;0.266705;0
-0.963778;0.266705;0
-0.963778;0.266705;0
-0.963778;0.266705;0
-0.999998;0.002152;0
-0.999998;0.002152;0
-0.999998;0.002152;0
-0.999998;0.002152;0
-0.683161;-0.730268;0
-0.683161;-0.730268;0
-0.683161;-0.730268;0
-0.683161;-0.730268;0
0.402863;-0.91526;0
0.402863;-0.91526;0
0.402863;-0.91526;0
0.402863;-0.91526;0
0.92318;-0.384368;0
0.92318;-0.384368;0
0.92318;-0.384368;0
0.92318;-0.384368;0
0.966044;0.258377;0
0.966044;0.258377;0
0.966044;0.258377;0
0.966044;0.258377;0
0.626729;0.779237;0
0.626729;0.779238;0
0.626729;0.779237;0
0.626729;0.779237;0
-0.814307;0.580434;0
-0.814307;0.580434;0
-0.814307;0.580434;0
-0.814307;0.580434;0
-0.997003;-0.077357;0
-0.997003;-0.077357;0
-0.997003;-0.077357;0
-0.997003;-0.077357;0
-0.811138;-0.584854;0
-0.811138;-0.584854;0
-0.811138;-0.584854;0
-0.811138;-0.584854;0
0.402049;-0.915618;0
0.402049;-0.915618;0
0.402049;-0.915618;0
0.402049;-0.915618;0
0.97291;-0.231184;0
0.97291;-0.231184;0
0.97291;-0.231184;0
0.97291;-0.231184;0
0.999999;-0.001442;0
0.999999;-0.001442;0
0.999999;-0.001442;0
0.999999;-0.001442;0
-0.349135;0.191077;-0.917384
-0.056051;0.047856;-0.99728
-0.012594;0.333742;-0.94258
-0.049678;0.011597;-0.998698
0;0;-1
-0.050388;-0.031984;-0.998217
0;0;-1
-0.108662;-0.1718;-0.979121
-0.010523;-0.159679;-0.987113
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
-1e-006;-4e-006;-1
0;0;-1
-0;-0;-1
-0;-0;-1
1e-006;-0;-1
0;-0;-1
-0;1e-006;-1
1e-006;0;-1
-0;-0;-1
-0;-0;-1
-0;0;-1
0;1e-006;-1
0;0;-1
-2e-006;0;-1
0.009177;-0.009048;-0.999917
0.011792;-0.001362;-0.99993
0;0;-1
0.009431;-0.106654;-0.994251
-0.000665;-0.293627;-0.95592
-0;-0;1
0;0;1
0;0;1
3e-006;2e-006;1
-0;-0;1
-1e-006;-0;1
-1e-006;-1e-006;1
-0;-0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
-0.528032;-0.076042;0.845813
0.528527;-0.02426;0.84857
-0.143259;0.056972;0.988044
-0.004472;0.269694;0.962936
-0.001855;-0.176904;0.984226
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0.101679;0.994817;0
0.101679;0.994817;0
0.101679;0.994817;0
0.101679;0.994817;0
-0.99924;0.038975;0
-0.99924;0.038975;0
-0.99924;0.038975;0
-0.99924;0.038975;0
-0.062295;-0.998058;0
-0.062295;-0.998058;0
-0.062295;-0.998058;0
-0.062295;-0.998058;0
0.998805;-0.048871;0
0.998805;-0.048871;0
0.998805;-0.048871;0
0.998805;-0.048871;0
-0.99849;0.054934;0
-0.99849;0.054934;0
-0.99849;0.054934;0
-0.99849;0.054934;0
-0.596429;-0.802666;0
-0.596429;-0.802666;0
-0.596429;-0.802666;0
-0.596429;-0.802666;0
0.235034;-0.971987;0
0.235034;-0.971987;0
0.235034;-0.971987;0
0.235034;-0.971987;0
0.846586;-0.532253;0
0.846586;-0.532253;0
0.846586;-0.532253;0
0.846586;-0.532253;0
0.963637;0.267213;0
0.963637;0.267213;0
0.963638;0.267213;0
0.963638;0.267213;0
0.775608;0.631215;0
0.775608;0.631215;0
0.775608;0.631215;0
0.775608;0.631215;0
-0.152074;0.988369;0
-0.152074;0.988369;0
-0.152074;0.988369;0
-0.152074;0.988369;0
-0.92378;-0.382923;0
-0.92378;-0.382923;0
-0.92378;-0.382922;0
-0.92378;-0.382922;0
0.813976;0.580899;0
0.813976;0.580899;0
0.813976;0.580899;0
0.813976;0.580899;0
-0.161744;0.986833;0
-0.161744;0.986833;0
-0.161744;0.986833;0
-0.161744;0.986833;0
-0.963778;0.266705;0
-0.963778;0.266705;0
-0.963778;0.266705;0
-0.963778;0.266705;0
-0.999998;0.002152;0
-0.999998;0.002152;0
-0.999998;0.002152;0
-0.999998;0.002152;0
-0.683161;-0.730268;0
-0.683161;-0.730268;0
-0.683161;-0.730268;0
-0.683161;-0.730268;0
0.402863;-0.91526;0
0.402863;-0.91526;0
0.402863;-0.91526;0
0.402863;-0.91526;0
0.92318;-0.384368;0
0.92318;-0.384368;0
0.92318;-0.384368;0
0.92318;-0.384368;0
0.966044;0.258377;0
0.966044;0.258377;0
0.966044;0.258377;0
0.966044;0.258377;0
0.626729;0.779238;0
0.626729;0.779237;0
0.626729;0.779237;0
0.626729;0.779237;0
-0.814307;0.580434;0
-0.814307;0.580434;0
-0.814307;0.580434;0
-0.814307;0.580434;0
-0.997003;-0.077357;0
-0.997003;-0.077357;0
-0.997003;-0.077357;0
-0.997003;-0.077357;0
-0.811138;-0.584854;0
-0.811138;-0.584854;0
-0.811138;-0.584854;0
-0.811138;-0.584854;0
0.402049;-0.915618;0
0.402049;-0.915618;0
0.402049;-0.915618;0
0.402049;-0.915618;0
0.97291;-0.231184;0
0.97291;-0.231184;0
0.97291;-0.231184;0
0.97291;-0.231184;0
0.999999;-0.001442;0
0.999999;-0.001442;0
0.999999;-0.001442;0
0.999999;-0.001442;0
-0.108662;-0.1718;0.979121
0.009431;-0.106654;0.994251
-0.000665;-0.293627;0.95592
0.011792;-0.001362;0.99993
0.009177;-0.009048;0.999917
0;0;1
0;-0;1
1e-006;0;1
1e-006;-0;1
0;0;1
-2e-006;0;1
0;1e-006;1
-0;1e-006;1
-0;-0;1
0;0;1
0;0;1
0;0;1
-0;-0;1
-1e-006;-4e-006;1
-0;-0;1
-0;-0;1
-0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
-0.010523;-0.159679;0.987113
0;0;1
-0.050388;-0.031984;0.998217
-0.049678;0.011597;0.998698
0;0;1
-0.056051;0.047856;0.99728
0;0;1
-0.349135;0.191077;0.917384
-0.012594;0.333742;0.94258
}
:TexCoords
{
0.693098;0.77746
0.684801;0.824332
0.681941;0.807106
0.712708;0.836807
0.693307;0.841794
0.708737;0.820804
0.710006;0.782267
0.702933;0.773487
0.549203;0.785824
0.53818;0.743036
0.549236;0.760314
0.522901;0.768001
0.527091;0.751189
0.532523;0.806536
0.527001;0.793611
0.546401;0.802736
0.25917;0.193016
0.237486;0.259721
0.25917;0.168632
0.863435;0.168633
0.895546;0.241783
0.590941;0.719151
0.574273;0.714444
0.58539;0.706289
0.570055;0.765182
0.570074;0.743964
0.579785;0.778255
0.592322;0.748873
0.421752;0.63903
0.196733;0.600608
0.196733;0.600608
0.421752;0.63903
0.196733;0.600608
0.193643;0.732966
0.193643;0.732966
0.196733;0.600608
0.193643;0.732966
0.418314;0.756392
0.418314;0.756392
0.193643;0.732966
0.418314;0.756392
0.421752;0.63903
0.421752;0.63903
0.418314;0.756392
0.708737;0.820804
0.710006;0.782267
0.710006;0.782267
0.708737;0.820804
0.710006;0.782267
0.702933;0.773487
0.702933;0.773487
0.710006;0.782267
0.702933;0.773487
0.693098;0.77746
0.693098;0.77746
0.702933;0.773487
0.693098;0.77746
0.681941;0.807106
0.681941;0.807106
0.693098;0.77746
0.681941;0.807106
0.684801;0.824332
0.684801;0.824332
0.681941;0.807106
0.684801;0.824332
0.693307;0.841794
0.693307;0.841794
0.684801;0.824332
0.693307;0.841794
0.712708;0.836807
0.712708;0.836807
0.693307;0.841794
0.712708;0.836807
0.708737;0.820804
0.708737;0.820804
0.712708;0.836807
0.527001;0.793611
0.532523;0.806536
0.532523;0.806536
0.527001;0.793611
0.532523;0.806536
0.546401;0.802736
0.546401;0.802736
0.532523;0.806536
0.546401;0.802736
0.549203;0.785824
0.549203;0.785824
0.546401;0.802736
0.549203;0.785824
0.549236;0.760314
0.549236;0.760314
0.549203;0.785824
0.549236;0.760314
0.53818;0.743036
0.53818;0.743036
0.549236;0.760314
0.53818;0.743036
0.527091;0.751189
0.527091;0.751189
0.53818;0.743036
0.527091;0.751189
0.522901;0.768001
0.522901;0.768001
0.527091;0.751189
0.522901;0.768001
0.527001;0.793611
0.527001;0.793611
0.522901;0.768001
0.570055;0.765182
0.579785;0.778255
0.579785;0.778255
0.570055;0.765182
0.579785;0.778255
0.592322;0.748873
0.592322;0.748873
0.579785;0.778255
0.592322;0.748873
0.590941;0.719151
0.590941;0.719151
0.592322;0.748873
0.590941;0.719151
0.58539;0.706289
0.58539;0.706289
0.590941;0.719151
0.58539;0.706289
0.574273;0.714444
0.574273;0.714444
0.58539;0.706289
0.574273;0.714444
0.570074;0.743964
0.570074;0.743964
0.574273;0.714444
0.570074;0.743964
0.570055;0.765182
0.570055;0.765182
0.570074;0.743964
0.229978;0.178386
0.078182;0.129619
0.232897;0.119866
0.069425;0.193016
0.066505;0.154002
0.034395;0.441726
0.037314;0.188139
0.229581;0.356182
0.151161;0.441726
0.196733;0.600608
0.154718;0.596214
0.421752;0.63903
0.193643;0.732966
0.159918;0.822107
0.418314;0.756392
0.234514;0.821155
0.306302;0.820757
0.372472;0.821467
0.430217;0.823842
0.476728;0.828434
0.509196;0.835799
0.532523;0.806536
0.524813;0.846491
0.527001;0.793611
0.522901;0.768001
0.527091;0.751189
0.53818;0.743036
0.546401;0.802736
0.531494;0.857467
0.547026;0.871443
0.53894;0.865628
0.5646;0.877912
0.555621;0.875381
0.573834;0.879504
0.579785;0.778255
0.583196;0.880627
0.570055;0.765182
0.549203;0.785824
0.549236;0.760314
0.570074;0.743964
0.574273;0.714444
0.58539;0.706289
0.592322;0.748873
0.609468;0.851367
0.590941;0.719151
0.717345;0.855498
0.732073;0.875751
0.693307;0.841794
0.712708;0.836807
0.684801;0.824332
0.681941;0.807106
0.693098;0.77746
0.702933;0.773487
0.710006;0.782267
0.708737;0.820804
0.953929;0.900134
0.945171;0.49537
0.965605;0.49537
0.953929;0.441727
0.927656;0.358823
0.693098;0.77746
0.710006;0.782267
0.702933;0.773487
0.708737;0.820804
0.712708;0.836807
0.684801;0.824332
0.693307;0.841794
0.681941;0.807106
0.418314;0.756392
0.196733;0.600608
0.193643;0.732966
0.421752;0.63903
0.532523;0.806536
0.522901;0.768001
0.527001;0.793611
0.53818;0.743036
0.527091;0.751189
0.549203;0.785824
0.549236;0.760314
0.546401;0.802736
0.237486;0.259721
0.25917;0.193016
0.25917;0.168632
0.863435;0.168633
0.895546;0.241783
0.570055;0.765182
0.574273;0.714444
0.570074;0.743964
0.590941;0.719151
0.58539;0.706289
0.579785;0.778255
0.592322;0.748873
0.421752;0.63903
0.196733;0.600608
0.421752;0.63903
0.196733;0.600608
0.196733;0.600608
0.193643;0.732966
0.196733;0.600608
0.193643;0.732966
0.193643;0.732966
0.418314;0.756392
0.193643;0.732966
0.418314;0.756392
0.418314;0.756392
0.421752;0.63903
0.418314;0.756392
0.421752;0.63903
0.708737;0.820804
0.710006;0.782267
0.708737;0.820804
0.710006;0.782267
0.710006;0.782267
0.702933;0.773487
0.710006;0.782267
0.702933;0.773487
0.702933;0.773487
0.693098;0.77746
0.702933;0.773487
0.693098;0.77746
0.693098;0.77746
0.681941;0.807106
0.693098;0.77746
0.681941;0.807106
0.681941;0.807106
0.684801;0.824332
0.681941;0.807106
0.684801;0.824332
0.684801;0.824332
0.693307;0.841794
0.684801;0.824332
0.693307;0.841794
0.693307;0.841794
0.712708;0.836807
0.693307;0.841794
0.712708;0.836807
0.712708;0.836807
0.708737;0.820804
0.712708;0.836807
0.708737;0.820804
0.527001;0.793611
0.532523;0.806536
0.527001;0.793611
0.532523;0.806536
0.532523;0.806536
0.546401;0.802736
0.532523;0.806536
0.546401;0.802736
0.546401;0.802736
0.549203;0.785824
0.546401;0.802736
0.549203;0.785824
0.549203;0.785824
0.549236;0.760314
0.549203;0.785824
0.549236;0.760314
0.549236;0.760314
0.53818;0.743036
0.549236;0.760314
0.53818;0.743036
0.53818;0.743036
0.527091;0.751189
0.53818;0.743036
0.527091;0.751189
0.527091;0.751189
0.522901;0.768001
0.527091;0.751189
0.522901;0.768001
0.522901;0.768001
0.527001;0.793611
0.522901;0.768001
0.527001;0.793611
0.570055;0.765182
0.579785;0.778255
0.570055;0.765182
0.579785;0.778255
0.579785;0.778255
0.592322;0.748873
0.579785;0.778255
0.592322;0.748873
0.592322;0.748873
0.590941;0.719151
0.592322;0.748873
0.590941;0.719151
0.590941;0.719151
0.58539;0.706289
0.590941;0.719151
0.58539;0.706289
0.58539;0.706289
0.574273;0.714444
0.58539;0.706289
0.574273;0.714444
0.574273;0.714444
0.570074;0.743964
0.574273;0.714444
0.570074;0.743964
0.570074;0.743964
0.570055;0.765182
0.570074;0.743964
0.570055;0.765182
0.229581;0.356182
0.953929;0.441727
0.927656;0.358823
0.945171;0.49537
0.953929;0.900134
0.965605;0.49537
0.732073;0.875751
0.712708;0.836807
0.717345;0.855498
0.710006;0.782267
0.708737;0.820804
0.702933;0.773487
0.693307;0.841794
0.609468;0.851367
0.583196;0.880627
0.592322;0.748873
0.579785;0.778255
0.590941;0.719151
0.58539;0.706289
0.684801;0.824332
0.681941;0.807106
0.693098;0.77746
0.573834;0.879504
0.5646;0.877912
0.547026;0.871443
0.555621;0.875381
0.531494;0.857467
0.53894;0.865628
0.524813;0.846491
0.570055;0.765182
0.546401;0.802736
0.532523;0.806536
0.549203;0.785824
0.549236;0.760314
0.53818;0.743036
0.509196;0.835799
0.154718;0.596214
0.193643;0.732966
0.196733;0.600608
0.159918;0.822107
0.418314;0.756392
0.234514;0.821155
0.306302;0.820757
0.372472;0.821467
0.430217;0.823842
0.421752;0.63903
0.476728;0.828434
0.527001;0.793611
0.522901;0.768001
0.527091;0.751189
0.570074;0.743964
0.151161;0.441726
0.574273;0.714444
0.034395;0.441726
0.069425;0.193016
0.037314;0.188139
0.078182;0.129619
0.066505;0.154002
0.229978;0.178386
0.232897;0.119866
}
}
:Mesh
{
:Name=AK 47
:Matrix=0;0;-0.234911;0;0;0.128646;0;0;-0.234911;0;0;0;1.42373;10.1414;17.6731;1
:MatIndex=8
:VertexCount=268
:IndexCount=408
:Indices
{
0;1;2;1;0;3;4;5;6;5;4;7;8;9;10;9;8;11;12;13;14;13;12;15;16;17;18;17;16;19;20;21;22;21;20;23;24;25;26;25;24;27;28;29;30;29;28;31;32;33;34;33;32;35;36;37;38;37;36;39;38;40;41;40;38;37;42;43;44;43;42;45;46;47;48;47;46;49;50;51;52;51;50;53;54;55;56;55;54;57;58;59;60;59;58;61;62;63;64;63;62;65;66;67;68;67;66;69;70;71;72;71;70;73;74;75;76;75;74;77;78;79;80;79;78;81;82;83;84;83;82;85;86;87;88;87;86;89;90;91;92;91;90;93;94;95;96;95;94;97;98;99;100;99;98;101;102;103;104;103;102;105;106;107;108;107;106;109;110;111;112;111;110;113;114;115;116;115;114;117;118;119;120;119;118;121;122;123;124;123;122;125;126;127;128;127;126;129;130;131;132;131;130;133;134;135;136;135;134;137;138;139;140;139;138;141;142;143;144;143;142;145;146;147;148;147;146;149;150;151;152;151;150;153;154;155;156;155;154;157;158;159;160;159;158;161;162;163;164;163;162;165;166;167;168;167;166;169;170;171;172;171;170;173;173;174;171;174;173;175;176;177;178;177;176;179;180;181;182;181;180;183;184;185;186;185;184;187;188;189;190;189;188;191;192;193;194;193;192;195;196;197;198;197;196;199;200;201;202;201;200;203;204;205;206;205;204;207;208;209;210;209;208;211;212;213;214;213;212;215;216;217;218;217;216;219;220;221;222;221;220;223;224;225;226;225;224;227;228;229;230;229;228;231;232;233;234;233;232;235;236;237;238;237;236;239;240;241;242;241;240;243;244;245;246;245;244;247;248;249;250;249;248;251;252;253;254;253;252;255;256;257;258;257;256;259;260;261;262;261;260;263;264;265;266;265;264;267;
}
:Positions
{
-29.4432;19.4805;0
-29.4432;21.4375;4.66406
-29.4432;21.4375;0
-29.4432;19.4805;6.32179
-29.4432;21.4375;0
-33.3571;20.6547;8.54326
-33.3571;20.6547;0
-29.4432;21.4375;4.66406
-33.3571;20.6547;0
-32.9657;25.3514;10.201
-32.9657;25.3514;0
-33.3571;20.6547;8.54326
-32.9657;25.3514;0
-53.7093;24.5686;10.201
-53.7093;24.5686;0
-32.9657;25.3514;10.201
-53.7093;24.5686;0
-55.2749;22.6116;10.201
-55.2749;22.6116;0
-53.7093;24.5686;10.201
-55.2749;22.6116;0
-54.8835;19.4805;10.201
-54.8835;19.4805;0
-55.2749;22.6116;10.201
-54.8835;19.4805;0
-59.1888;19.8719;10.201
-59.1888;19.8719;0
-54.8835;19.4805;10.201
-59.1888;19.8719;0
-59.5801;-0.480347;10.201
-59.5801;-0.480347;0
-59.1888;19.8719;10.201
-59.5801;-0.480347;0
-43.9246;-0.480347;10.201
-43.9246;-0.480347;0
-59.5801;-0.480347;10.201
-43.9246;-0.480347;0
-43.4477;-12.8791;10.201
-43.4477;-12.8791;0
-43.9246;-0.480347;10.201
-42.7504;-31.0087;10.201
-42.7504;-31.0087;0
-42.7504;-31.0087;0
-32.7489;-30.9323;10.201
-32.7489;-30.9323;0
-42.7504;-31.0087;10.201
-32.7489;-30.9323;0
-23.1239;-30.9003;10.201
-23.1239;-30.9003;0
-32.7489;-30.9323;10.201
-23.1239;-30.9003;0
-14.252;-30.9574;10.201
-14.252;-30.9574;0
-23.1239;-30.9003;10.201
-14.252;-30.9574;0
-6.50979;-31.1479;10.201
-6.50979;-31.1479;0
-14.252;-30.9574;10.201
-6.50979;-31.1479;0
-0.273806;-31.5165;10.201
-0.273806;-31.5165;0
-6.50979;-31.1479;10.201
-0.273806;-31.5165;0
4.0794;-32.1076;10.201
4.0794;-32.1076;0
-0.273806;-31.5165;10.201
4.0794;-32.1076;0
6.17328;-32.9657;10.201
6.17328;-32.9657;0
4.0794;-32.1076;10.201
6.17328;-32.9657;0
7.06903;-33.8466;10.201
7.06903;-33.8466;0
6.17328;-32.9657;10.201
7.06903;-33.8466;0
8.06747;-34.5016;10.201
8.06747;-34.5016;0
7.06903;-33.8466;10.201
8.06747;-34.5016;0
9.15149;-34.9683;10.201
9.15149;-34.9683;0
8.06747;-34.5016;10.201
9.15149;-34.9683;0
10.304;-35.2843;10.201
10.304;-35.2843;0
9.15149;-34.9683;10.201
10.304;-35.2843;0
11.5078;-35.4874;10.201
11.5078;-35.4874;0
10.304;-35.2843;10.201
11.5078;-35.4874;0
12.7459;-35.6152;10.201
12.7459;-35.6152;0
11.5078;-35.4874;10.201
12.7459;-35.6152;0
14.0011;-35.7054;10.201
14.0011;-35.7054;0
12.7459;-35.6152;10.201
14.0011;-35.7054;0
17.5236;-33.3571;10.201
17.5236;-33.3571;0
14.0011;-35.7054;10.201
17.5236;-33.3571;0
33.9619;-35.314;10.201
33.9619;-35.314;0
17.5236;-33.3571;10.201
33.9619;-35.314;0
63.7075;-37.271;10.201
63.7075;-37.271;0
33.9619;-35.314;10.201
63.7075;-37.271;0
65.2731;-4.78563;10.201
65.2731;-4.78563;0
63.7075;-37.271;10.201
65.2731;-4.78563;0
62.5334;-4.78563;10.201
62.5334;-4.78563;0
65.2731;-4.78563;10.201
62.5334;-4.78563;0
63.7075;-0.480347;10.201
63.7075;-0.480347;0
62.5334;-4.78563;10.201
63.7075;-0.480347;0
60.185;6.17328;8.54326
60.185;6.17328;0
63.7075;-0.480347;10.201
60.185;6.17328;0
55.8797;15.5666;4.66406
55.8797;15.5666;0
60.185;6.17328;8.54326
55.8797;15.5666;0
51.5745;21.4375;6.32179
51.5745;21.4375;0
55.8797;15.5666;4.66406
-29.4432;19.4805;5.00472
-29.4432;21.4375;0.340661
-29.4432;19.4805;-1.31708
-29.4432;21.4375;5.00472
-29.4432;21.4375;5.00472
-33.3571;20.6547;-3.53854
-29.4432;21.4375;0.340661
-33.3571;20.6547;5.00472
-33.3571;20.6547;5.00472
-32.9657;25.3514;-5.19628
-33.3571;20.6547;-3.53854
-32.9657;25.3514;5.00472
-32.9657;25.3514;5.00472
-53.7093;24.5686;-5.19628
-32.9657;25.3514;-5.19628
-53.7093;24.5686;5.00472
-53.7093;24.5686;5.00472
-55.2749;22.6116;-5.19628
-53.7093;24.5686;-5.19628
-55.2749;22.6116;5.00472
-55.2749;22.6116;5.00472
-54.8835;19.4805;-5.19628
-55.2749;22.6116;-5.19628
-54.8835;19.4805;5.00472
-54.8835;19.4805;5.00472
-59.1888;19.8719;-5.19628
-54.8835;19.4805;-5.19628
-59.1888;19.8719;5.00472
-59.1888;19.8719;5.00472
-59.5801;-0.480345;-5.19628
-59.1888;19.8719;-5.19628
-59.5801;-0.480345;5.00472
-59.5801;-0.480345;5.00472
-43.9246;-0.480345;-5.19628
-59.5801;-0.480345;-5.19628
-43.9246;-0.480345;5.00472
-43.9246;-0.480345;5.00472
-43.4477;-12.8791;-5.19628
-43.9246;-0.480345;-5.19628
-43.4477;-12.8791;5.00472
-42.7504;-31.0087;-5.19628
-42.7504;-31.0087;5.00472
-42.7504;-31.0087;5.00472
-32.7489;-30.9323;-5.19628
-42.7504;-31.0087;-5.19628
-32.7489;-30.9323;5.00472
-32.7489;-30.9323;5.00472
-23.1239;-30.9003;-5.19628
-32.7489;-30.9323;-5.19628
-23.1239;-30.9003;5.00472
-23.1239;-30.9003;5.00472
-14.252;-30.9574;-5.19628
-23.1239;-30.9003;-5.19628
-14.252;-30.9574;5.00472
-14.252;-30.9574;5.00472
-6.50979;-31.1479;-5.19628
-14.252;-30.9574;-5.19628
-6.50979;-31.1479;5.00472
-6.50979;-31.1479;5.00472
-0.273806;-31.5165;-5.19628
-6.50979;-31.1479;-5.19628
-0.273806;-31.5165;5.00472
-0.273806;-31.5165;5.00472
4.0794;-32.1076;-5.19628
-0.273806;-31.5165;-5.19628
4.0794;-32.1076;5.00472
4.0794;-32.1076;5.00472
6.17328;-32.9657;-5.19628
4.0794;-32.1076;-5.19628
6.17328;-32.9657;5.00472
6.17328;-32.9657;5.00472
7.06903;-33.8466;-5.19628
6.17328;-32.9657;-5.19628
7.06903;-33.8466;5.00472
7.06903;-33.8466;5.00472
8.06747;-34.5016;-5.19628
7.06903;-33.8466;-5.19628
8.06747;-34.5016;5.00472
8.06747;-34.5016;5.00472
9.15149;-34.9683;-5.19628
8.06747;-34.5016;-5.19628
9.15149;-34.9683;5.00472
9.15149;-34.9683;5.00472
10.304;-35.2843;-5.19628
9.15149;-34.9683;-5.19628
10.304;-35.2843;5.00472
10.304;-35.2843;5.00472
11.5078;-35.4874;-5.19628
10.304;-35.2843;-5.19628
11.5078;-35.4874;5.00472
11.5078;-35.4874;5.00472
12.7459;-35.6152;-5.19628
11.5078;-35.4874;-5.19628
12.7459;-35.6152;5.00472
12.7459;-35.6152;5.00472
14.0011;-35.7054;-5.19628
12.7459;-35.6152;-5.19628
14.0011;-35.7054;5.00472
14.0011;-35.7054;5.00472
17.5236;-33.3571;-5.19628
14.0011;-35.7054;-5.19628
17.5236;-33.3571;5.00472
17.5236;-33.3571;5.00472
33.9619;-35.314;-5.19628
17.5236;-33.3571;-5.19628
33.9619;-35.314;5.00472
33.9619;-35.314;5.00472
63.7075;-37.271;-5.19628
33.9619;-35.314;-5.19628
63.7075;-37.271;5.00472
63.7075;-37.271;5.00472
65.2731;-4.78563;-5.19628
63.7075;-37.271;-5.19628
65.2731;-4.78563;5.00472
65.2731;-4.78563;5.00472
62.5334;-4.78563;-5.19628
65.2731;-4.78563;-5.19628
62.5334;-4.78563;5.00472
62.5334;-4.78563;5.00472
63.7075;-0.480345;-5.19628
62.5334;-4.78563;-5.19628
63.7075;-0.480345;5.00472
63.7075;-0.480345;5.00472
60.185;6.17328;-3.53854
63.7075;-0.480345;-5.19628
60.185;6.17328;5.00472
60.185;6.17328;5.00472
55.8797;15.5666;0.340661
60.185;6.17328;-3.53854
55.8797;15.5666;5.00472
55.8797;15.5666;5.00472
51.5745;21.4375;-1.31708
55.8797;15.5666;0.340661
51.5745;21.4375;5.00472
}
:Normals
{
-1;0;0
-1;0;0
-1;0;0
-1;0;0
0.196115;-0.980581;0
0.196115;-0.980581;0
0.196115;-0.980581;0
0.196115;-0.980581;0
-0.996546;0.083045;0
-0.996546;0.083045;0
-0.996546;0.083045;0
-0.996546;0.083045;0
0.037709;-0.999289;0
0.037709;-0.999289;0
0.037709;-0.999289;0
0.037709;-0.999289;0
0.780868;-0.624695;0
0.780869;-0.624695;0
0.780869;-0.624695;0
0.780869;-0.624695;0
0.992278;0.124034;0
0.992278;0.124034;0
0.992278;0.124034;0
0.992278;0.124034;0
-0.090537;-0.995893;0
-0.090537;-0.995893;0
-0.090537;-0.995893;0
-0.090537;-0.995893;0
0.999815;-0.019227;0
0.999815;-0.019227;0
0.999815;-0.019227;0
0.999815;-0.019227;0
0;1;0
0;1;0
0;1;0
0;1;0
0.999261;0.038433;0
0.999261;0.038433;0
0.999261;0.038433;0
0.999261;0.038433;0
0.999261;0.038433;0
0.999261;0.038433;0
-0.007644;0.999971;0
-0.007644;0.999971;0
-0.007644;0.999971;0
-0.007644;0.999971;0
-0.003319;0.999994;0
-0.003319;0.999994;0
-0.003319;0.999995;0
-0.003319;0.999995;0
0.00643;0.999979;0
0.00643;0.999979;0
0.00643;0.999979;0
0.00643;0.999979;0
0.024606;0.999697;0
0.024606;0.999697;0
0.024606;0.999697;0
0.024606;0.999697;0
0.059;0.998258;0
0.059;0.998258;0
0.059;0.998258;0
0.059;0.998258;0
0.134546;0.990907;0
0.134546;0.990907;0
0.134546;0.990907;0
0.134546;0.990907;0
0.379202;0.925314;0
0.379202;0.925314;0
0.379202;0.925314;0
0.379202;0.925314;0
0.701178;0.712986;0
0.701178;0.712986;0
0.701178;0.712986;0
0.701178;0.712986;0
0.548512;0.836143;0
0.548512;0.836143;0
0.548512;0.836143;0
0.548512;0.836143;0
0.395428;0.918497;0
0.395428;0.918497;0
0.395428;0.918497;0
0.395428;0.918497;0
0.264493;0.964388;0
0.264493;0.964387;0
0.264493;0.964388;0
0.264493;0.964388;0
0.166368;0.986064;0
0.166368;0.986064;0
0.166368;0.986064;0
0.166368;0.986064;0
0.10268;0.994714;0
0.10268;0.994714;0
0.10268;0.994714;0
0.10268;0.994714;0
0.071637;0.997431;0
0.071637;0.997431;0
0.071637;0.997431;0
0.071637;0.997431;0
-0.5547;0.832051;0
-0.5547;0.832051;0
-0.5547;0.832051;0
-0.5547;0.832051;0
0.118213;0.992988;0
0.118213;0.992988;0
0.118213;0.992988;0
0.118213;0.992988;0
0.065648;0.997843;0
0.065648;0.997843;0
0.065648;0.997843;0
0.065648;0.997843;0
-0.998841;0.048137;0
-0.998841;0.048137;0
-0.998841;0.048137;0
-0.998841;0.048137;0
0;-1;0
0;-1;0
0;-1;0
0;-1;0
-0.964764;0.263117;0
-0.964764;0.263117;0
-0.964764;0.263117;0
-0.964764;0.263117;0
-0.883788;-0.467887;0
-0.883788;-0.467887;0
-0.883788;-0.467887;0
-0.883788;-0.467887;0
-0.909065;-0.416655;0
-0.909065;-0.416655;0
-0.909065;-0.416655;0
-0.909065;-0.416655;0
-0.806405;-0.591364;0
-0.806405;-0.591364;0
-0.806405;-0.591364;0
-0.806405;-0.591364;0
-1;0;0
-1;0;0
-1;0;0
-1;0;0
0.196115;-0.980581;0
0.196115;-0.980581;0
0.196115;-0.980581;0
0.196115;-0.980581;0
-0.996546;0.083045;0
-0.996546;0.083045;0
-0.996546;0.083045;0
-0.996546;0.083045;0
0.037709;-0.999289;0
0.037709;-0.999289;0
0.037709;-0.999289;0
0.037709;-0.999289;0
0.780869;-0.624695;0
0.780868;-0.624695;0
0.780869;-0.624695;0
0.780869;-0.624695;0
0.992278;0.124034;0
0.992278;0.124034;0
0.992278;0.124034;0
0.992278;0.124034;0
-0.090537;-0.995893;0
-0.090537;-0.995893;0
-0.090537;-0.995893;0
-0.090537;-0.995893;0
0.999815;-0.019227;0
0.999815;-0.019227;0
0.999815;-0.019227;0
0.999815;-0.019227;0
0;1;0
0;1;0
0;1;0
0;1;0
0.999261;0.038433;0
0.999261;0.038433;0
0.999261;0.038433;0
0.999261;0.038433;0
0.999261;0.038433;0
0.999261;0.038433;0
-0.007644;0.999971;0
-0.007644;0.999971;0
-0.007644;0.999971;0
-0.007644;0.999971;0
-0.003319;0.999994;0
-0.003319;0.999994;0
-0.003319;0.999995;0
-0.003319;0.999995;0
0.00643;0.999979;0
0.00643;0.999979;0
0.00643;0.999979;0
0.00643;0.999979;0
0.024606;0.999697;0
0.024606;0.999697;0
0.024606;0.999697;0
0.024606;0.999697;0
0.059;0.998258;0
0.059;0.998258;0
0.059;0.998258;0
0.059;0.998258;0
0.134546;0.990907;0
0.134546;0.990907;0
0.134546;0.990907;0
0.134546;0.990907;0
0.379202;0.925314;0
0.379202;0.925314;0
0.379202;0.925314;0
0.379202;0.925314;0
0.701178;0.712986;0
0.701178;0.712986;0
0.701178;0.712986;0
0.701178;0.712986;0
0.548512;0.836143;0
0.548512;0.836143;0
0.548512;0.836143;0
0.548512;0.836143;0
0.395428;0.918497;0
0.395428;0.918497;0
0.395428;0.918497;0
0.395428;0.918497;0
0.264493;0.964387;0
0.264493;0.964388;0
0.264493;0.964388;0
0.264493;0.964388;0
0.166368;0.986064;0
0.166368;0.986064;0
0.166368;0.986064;0
0.166368;0.986064;0
0.10268;0.994714;0
0.10268;0.994714;0
0.10268;0.994714;0
0.10268;0.994714;0
0.071637;0.997431;0
0.071637;0.997431;0
0.071637;0.997431;0
0.071637;0.997431;0
-0.5547;0.832051;0
-0.5547;0.832051;0
-0.5547;0.832051;0
-0.5547;0.832051;0
0.118213;0.992988;0
0.118213;0.992988;0
0.118213;0.992988;0
0.118213;0.992988;0
0.065648;0.997843;0
0.065648;0.997843;0
0.065648;0.997843;0
0.065648;0.997843;0
-0.998841;0.048137;0
-0.998841;0.048137;0
-0.998841;0.048137;0
-0.998841;0.048137;0
0;-1;0
0;-1;0
0;-1;0
0;-1;0
-0.964764;0.263117;0
-0.964764;0.263117;0
-0.964764;0.263117;0
-0.964764;0.263117;0
-0.883788;-0.467887;0
-0.883788;-0.467887;0
-0.883788;-0.467887;0
-0.883788;-0.467887;-0
-0.909065;-0.416655;0
-0.909065;-0.416655;0
-0.909065;-0.416655;0
-0.909065;-0.416655;0
-0.806405;-0.591364;0
-0.806405;-0.591364;0
-0.806405;-0.591364;0
-0.806405;-0.591364;0
}
:TexCoords
{
0.25917;0.193016
0.25917;0.168632
0.25917;0.168632
0.25917;0.193016
0.25917;0.168632
0.229978;0.178386
0.229978;0.178386
0.25917;0.168632
0.229978;0.178386
0.232897;0.119866
0.232897;0.119866
0.229978;0.178386
0.232897;0.119866
0.078182;0.129619
0.078182;0.129619
0.232897;0.119866
0.078182;0.129619
0.066505;0.154002
0.066505;0.154002
0.078182;0.129619
0.066505;0.154002
0.069425;0.193016
0.069425;0.193016
0.066505;0.154002
0.069425;0.193016
0.037314;0.188139
0.037314;0.188139
0.069425;0.193016
0.037314;0.188139
0.034395;0.441726
0.034395;0.441726
0.037314;0.188139
0.034395;0.441726
0.151161;0.441726
0.151161;0.441726
0.034395;0.441726
0.151161;0.441726
0.154718;0.596214
0.154718;0.596214
0.151161;0.441726
0.159918;0.822107
0.159918;0.822107
0.159918;0.822107
0.234514;0.821155
0.234514;0.821155
0.159918;0.822107
0.234514;0.821155
0.306302;0.820757
0.306302;0.820757
0.234514;0.821155
0.306302;0.820757
0.372472;0.821467
0.372472;0.821467
0.306302;0.820757
0.372472;0.821467
0.430217;0.823842
0.430217;0.823842
0.372472;0.821467
0.430217;0.823842
0.476728;0.828434
0.476728;0.828434
0.430217;0.823842
0.476728;0.828434
0.509196;0.835799
0.509196;0.835799
0.476728;0.828434
0.509196;0.835799
0.524813;0.846491
0.524813;0.846491
0.509196;0.835799
0.524813;0.846491
0.531494;0.857467
0.531494;0.857467
0.524813;0.846491
0.531494;0.857467
0.53894;0.865628
0.53894;0.865628
0.531494;0.857467
0.53894;0.865628
0.547026;0.871443
0.547026;0.871443
0.53894;0.865628
0.547026;0.871443
0.555621;0.875381
0.555621;0.875381
0.547026;0.871443
0.555621;0.875381
0.5646;0.877912
0.5646;0.877912
0.555621;0.875381
0.5646;0.877912
0.573834;0.879504
0.573834;0.879504
0.5646;0.877912
0.573834;0.879504
0.583196;0.880627
0.583196;0.880627
0.573834;0.879504
0.583196;0.880627
0.609468;0.851367
0.609468;0.851367
0.583196;0.880627
0.609468;0.851367
0.732073;0.875751
0.732073;0.875751
0.609468;0.851367
0.732073;0.875751
0.953929;0.900134
0.953929;0.900134
0.732073;0.875751
0.953929;0.900134
0.965605;0.49537
0.965605;0.49537
0.953929;0.900134
0.965605;0.49537
0.945171;0.49537
0.945171;0.49537
0.965605;0.49537
0.945171;0.49537
0.953929;0.441727
0.953929;0.441727
0.945171;0.49537
0.953929;0.441727
0.927656;0.358823
0.927656;0.358823
0.953929;0.441727
0.927656;0.358823
0.895546;0.241783
0.895546;0.241783
0.927656;0.358823
0.895546;0.241783
0.863435;0.168633
0.863435;0.168633
0.895546;0.241783
0.25917;0.193016
0.25917;0.168632
0.25917;0.193016
0.25917;0.168632
0.25917;0.168632
0.229978;0.178386
0.25917;0.168632
0.229978;0.178386
0.229978;0.178386
0.232897;0.119866
0.229978;0.178386
0.232897;0.119866
0.232897;0.119866
0.078182;0.129619
0.232897;0.119866
0.078182;0.129619
0.078182;0.129619
0.066505;0.154002
0.078182;0.129619
0.066505;0.154002
0.066505;0.154002
0.069425;0.193016
0.066505;0.154002
0.069425;0.193016
0.069425;0.193016
0.037314;0.188139
0.069425;0.193016
0.037314;0.188139
0.037314;0.188139
0.034395;0.441726
0.037314;0.188139
0.034395;0.441726
0.034395;0.441726
0.151161;0.441726
0.034395;0.441726
0.151161;0.441726
0.151161;0.441726
0.154718;0.596214
0.151161;0.441726
0.154718;0.596214
0.159918;0.822107
0.159918;0.822107
0.159918;0.822107
0.234514;0.821155
0.159918;0.822107
0.234514;0.821155
0.234514;0.821155
0.306302;0.820757
0.234514;0.821155
0.306302;0.820757
0.306302;0.820757
0.372472;0.821467
0.306302;0.820757
0.372472;0.821467
0.372472;0.821467
0.430217;0.823842
0.372472;0.821467
0.430217;0.823842
0.430217;0.823842
0.476728;0.828434
0.430217;0.823842
0.476728;0.828434
0.476728;0.828434
0.509196;0.835799
0.476728;0.828434
0.509196;0.835799
0.509196;0.835799
0.524813;0.846491
0.509196;0.835799
0.524813;0.846491
0.524813;0.846491
0.531494;0.857467
0.524813;0.846491
0.531494;0.857467
0.531494;0.857467
0.53894;0.865628
0.531494;0.857467
0.53894;0.865628
0.53894;0.865628
0.547026;0.871443
0.53894;0.865628
0.547026;0.871443
0.547026;0.871443
0.555621;0.875381
0.547026;0.871443
0.555621;0.875381
0.555621;0.875381
0.5646;0.877912
0.555621;0.875381
0.5646;0.877912
0.5646;0.877912
0.573834;0.879504
0.5646;0.877912
0.573834;0.879504
0.573834;0.879504
0.583196;0.880627
0.573834;0.879504
0.583196;0.880627
0.583196;0.880627
0.609468;0.851367
0.583196;0.880627
0.609468;0.851367
0.609468;0.851367
0.732073;0.875751
0.609468;0.851367
0.732073;0.875751
0.732073;0.875751
0.953929;0.900134
0.732073;0.875751
0.953929;0.900134
0.953929;0.900134
0.965605;0.49537
0.953929;0.900134
0.965605;0.49537
0.965605;0.49537
0.945171;0.49537
0.965605;0.49537
0.945171;0.49537
0.945171;0.49537
0.953929;0.441727
0.945171;0.49537
0.953929;0.441727
0.953929;0.441727
0.927656;0.358823
0.953929;0.441727
0.927656;0.358823
0.927656;0.358823
0.895546;0.241783
0.927656;0.358823
0.895546;0.241783
0.895546;0.241783
0.863435;0.168633
0.895546;0.241783
0.863435;0.168633
}
}
:Mesh
{
:Name=AK 47
:Matrix=0;0;-0.234911;0;0;0.128646;0;0;-0.234911;0;0;0;1.42373;10.1414;17.6731;1
:MatIndex=7
:VertexCount=192
:IndexCount=288
:Indices
{
0;1;2;1;0;3;4;5;6;5;4;7;8;9;10;9;8;11;12;13;14;13;12;15;16;17;18;17;16;19;20;21;22;21;20;23;24;25;26;25;24;27;28;29;30;29;28;31;32;33;34;33;32;35;36;37;38;37;36;39;40;41;42;41;40;43;44;45;46;45;44;47;48;49;50;49;48;51;52;53;54;53;52;55;56;57;58;57;56;59;60;61;62;61;60;63;64;65;66;65;64;67;68;69;70;69;68;71;72;73;74;73;72;75;76;77;78;77;76;79;80;81;82;81;80;83;84;85;86;85;84;87;88;89;90;89;88;91;92;93;94;93;92;95;96;97;98;97;96;99;100;101;102;101;100;103;104;105;106;105;104;107;108;109;110;109;108;111;112;113;114;113;112;115;116;117;118;117;116;119;120;121;122;121;120;123;124;125;126;125;124;127;128;129;130;129;128;131;132;133;134;133;132;135;136;137;138;137;136;139;140;141;142;141;140;143;144;145;146;145;144;147;148;149;150;149;148;151;152;153;154;153;152;155;156;157;158;157;156;159;160;161;162;161;160;163;164;165;166;165;164;167;168;169;170;169;168;171;172;173;174;173;172;175;176;177;178;177;176;179;180;181;182;181;180;183;184;185;186;185;184;187;188;189;190;189;188;191;
}
:Positions
{
51.5745;21.4375;0
-29.4432;19.4805;6.32179
-29.4432;19.4805;0
51.5745;21.4375;6.32179
5.4208;-32.9883;6.24083
-21.1199;-31.8443;-3.75917
5.4208;-32.9883;-3.75917
-21.1199;-31.8443;6.24083
-21.1199;-31.8443;6.24083
-19.1093;-38.3272;-3.75917
-21.1199;-31.8443;-3.75917
-19.1093;-38.3272;6.24083
-19.1093;-38.3272;6.24083
-21.1199;-57.0132;-3.75917
-19.1093;-38.3272;-3.75917
-21.1199;-57.0132;6.24083
-21.1199;-57.0132;6.24083
-24.337;-75.6992;-3.75917
-21.1199;-57.0132;-3.75917
-24.337;-75.6992;6.24083
-24.337;-75.6992;6.24083
-28.7605;-92.8598;-3.75917
-24.337;-75.6992;-3.75917
-28.7605;-92.8598;6.24083
-28.7605;-92.8598;6.24083
-37.6074;-114.215;-3.75917
-28.7605;-92.8598;-3.75917
-37.6074;-114.215;6.24083
-37.6074;-114.215;6.24083
-48.8671;-132.52;-3.75917
-37.6074;-114.215;-3.75917
-48.8671;-132.52;6.24083
-48.8671;-132.52;6.24083
-36.401;-167.985;-3.75917
-48.8671;-132.52;-3.75917
-36.401;-167.985;6.24083
-36.401;-167.985;6.24083
-33.1839;-167.985;-3.75917
-36.401;-167.985;-3.75917
-33.1839;-167.985;6.24083
-33.1839;-167.985;6.24083
-29.5647;-161.884;-3.75917
-33.1839;-167.985;-3.75917
-29.5647;-161.884;6.24083
-29.5647;-161.884;6.24083
-22.3263;-150.062;-3.75917
-29.5647;-161.884;-3.75917
-22.3263;-150.062;6.24083
-22.3263;-150.062;6.24083
-15.4901;-136.333;-3.75917
-22.3263;-150.062;-3.75917
-15.4901;-136.333;6.24083
-15.4901;-136.333;6.24083
-8.65383;-118.41;-3.75917
-15.4901;-136.333;-3.75917
-8.65383;-118.41;6.24083
-8.65383;-118.41;6.24083
-4.23037;-102.393;-3.75917
-8.65383;-118.41;-3.75917
-4.23037;-102.393;6.24083
-4.23037;-102.393;6.24083
-0.209051;-86.3769;-3.75917
-4.23037;-102.393;-3.75917
-0.209051;-86.3769;6.24083
-0.209051;-86.3769;6.24083
3.00801;-69.2163;-3.75917
-0.209051;-86.3769;-3.75917
3.00801;-69.2163;6.24083
3.00801;-69.2163;6.24083
5.01867;-51.6743;-3.75917
3.00801;-69.2163;-3.75917
5.01867;-51.6743;6.24083
5.01867;-51.6743;6.24083
10.2464;-56.2505;-3.75917
5.01867;-51.6743;-3.75917
10.2464;-56.2505;6.24083
10.2464;-56.2505;6.24083
12.6592;-53.1997;-3.75917
10.2464;-56.2505;-3.75917
12.6592;-53.1997;6.24083
12.6592;-53.1997;6.24083
13.4635;-36.4204;-3.75917
12.6592;-53.1997;-3.75917
13.4635;-36.4204;6.24083
13.4635;-36.4204;6.24083
7.02933;-35.6577;-3.75917
13.4635;-36.4204;-3.75917
7.02933;-35.6577;6.24083
7.02933;-35.6577;6.24083
5.4208;-32.9883;-3.75917
7.02933;-35.6577;-3.75917
5.4208;-32.9883;6.24083
-100.285;14.3792;5.00472
-100.285;-23.7397;-4.89528
-100.285;14.3792;-4.89528
-100.285;-23.7397;5.00472
51.5745;21.4375;5.00472
-29.4432;19.4805;-1.31708
51.5745;21.4375;-1.31708
-29.4432;19.4805;5.00472
5.4208;-32.9883;-3.82354
-21.1199;-31.8443;6.17646
-21.1199;-31.8443;-3.82354
5.4208;-32.9883;6.17646
-21.1199;-31.8443;-3.82354
-19.1093;-38.3272;6.17646
-19.1093;-38.3272;-3.82354
-21.1199;-31.8443;6.17646
-19.1093;-38.3272;-3.82354
-21.1199;-57.0132;6.17646
-21.1199;-57.0132;-3.82354
-19.1093;-38.3272;6.17646
-21.1199;-57.0132;-3.82354
-24.337;-75.6992;6.17646
-24.337;-75.6992;-3.82354
-21.1199;-57.0132;6.17646
-24.337;-75.6992;-3.82354
-28.7605;-92.8598;6.17646
-28.7605;-92.8598;-3.82354
-24.337;-75.6992;6.17646
-28.7605;-92.8598;-3.82354
-37.6074;-114.215;6.17646
-37.6074;-114.215;-3.82354
-28.7605;-92.8598;6.17646
-37.6074;-114.215;-3.82354
-48.8671;-132.52;6.17646
-48.8671;-132.52;-3.82354
-37.6074;-114.215;6.17646
-48.8671;-132.52;-3.82354
-36.401;-167.985;6.17646
-36.401;-167.985;-3.82354
-48.8671;-132.52;6.17646
-36.401;-167.985;-3.82354
-33.1839;-167.985;6.17646
-33.1839;-167.985;-3.82354
-36.401;-167.985;6.17646
-33.1839;-167.985;-3.82354
-29.5647;-161.884;6.17646
-29.5647;-161.884;-3.82354
-33.1839;-167.985;6.17646
-29.5647;-161.884;-3.82354
-22.3263;-150.062;6.17646
-22.3263;-150.062;-3.82354
-29.5647;-161.884;6.17646
-22.3263;-150.062;-3.82354
-15.4901;-136.333;6.17646
-15.4901;-136.333;-3.82354
-22.3263;-150.062;6.17646
-15.4901;-136.333;-3.82354
-8.65383;-118.41;6.17646
-8.65383;-118.41;-3.82354
-15.4901;-136.333;6.17646
-8.65383;-118.41;-3.82354
-4.23038;-102.393;6.17646
-4.23038;-102.393;-3.82354
-8.65383;-118.41;6.17646
-4.23038;-102.393;-3.82354
-0.209052;-86.3769;6.17646
-0.209052;-86.3769;-3.82354
-4.23038;-102.393;6.17646
-0.209052;-86.3769;-3.82354
3.00801;-69.2163;6.17646
3.00801;-69.2163;-3.82354
-0.209052;-86.3769;6.17646
3.00801;-69.2163;-3.82354
5.01867;-51.6743;6.17646
5.01867;-51.6743;-3.82354
3.00801;-69.2163;6.17646
5.01867;-51.6743;-3.82354
10.2464;-56.2505;6.17646
10.2464;-56.2505;-3.82354
5.01867;-51.6743;6.17646
10.2464;-56.2505;-3.82354
12.6592;-53.1997;6.17646
12.6592;-53.1997;-3.82354
10.2464;-56.2505;6.17646
12.6592;-53.1997;-3.82354
13.4635;-36.4204;6.17646
13.4635;-36.4204;-3.82354
12.6592;-53.1997;6.17646
13.4635;-36.4204;-3.82354
7.02933;-35.6577;6.17646
7.02933;-35.6577;-3.82354
13.4635;-36.4204;6.17646
7.02933;-35.6577;-3.82354
5.4208;-32.9883;6.17646
5.4208;-32.9883;-3.82354
7.02933;-35.6577;6.17646
-100.285;14.3792;-0.032961
-100.285;-23.7397;9.86704
-100.285;-23.7397;-0.032961
-100.285;14.3792;9.86704
}
:Normals
{
0.024148;-0.999708;0
0.024148;-0.999708;0
0.024148;-0.999708;0
0.024148;-0.999708;0
-0.043065;-0.999072;0
-0.043065;-0.999072;0
-0.043065;-0.999072;0
-0.043065;-0.999072;0
0.955117;0.296229;0
0.955117;0.296229;0
0.955117;0.296229;0
0.955117;0.296229;0
0.994261;-0.106985;0
0.994261;-0.106985;0
0.994261;-0.106985;0
0.994261;-0.106985;0
0.985501;-0.169668;0
0.985501;-0.169668;0
0.985501;-0.169668;0
0.985501;-0.169668;0
0.968347;-0.249609;0
0.968347;-0.249609;0
0.968347;-0.249609;0
0.968347;-0.249609;0
0.923861;-0.382728;0
0.923861;-0.382728;0
0.923861;-0.382728;0
0.923861;-0.382728;0
0.851756;-0.523939;0
0.851756;-0.523939;0
0.851756;-0.523939;0
0.851756;-0.523939;0
0.943416;0.331612;0
0.943416;0.331612;0
0.943416;0.331612;0
0.943416;0.331612;0
0;1;0
0;1;0
0;1;0
0;1;0
-0.860078;0.510162;0
-0.860078;0.510162;0
-0.860078;0.510162;0
-0.860078;0.510162;0
-0.852833;0.522184;0
-0.852833;0.522184;0
-0.852833;0.522184;0
-0.852833;0.522184;0
-0.895156;0.445753;0
-0.895156;0.445753;0
-0.895156;0.445753;0
-0.895156;0.445753;0
-0.934343;0.356374;0
-0.934343;0.356374;0
-0.934343;0.356374;0
-0.934343;0.356374;0
-0.963914;0.266214;0
-0.963914;0.266214;0
-0.963914;0.266214;0
-0.963914;0.266214;0
-0.969897;0.243515;0
-0.969897;0.243515;0
-0.969897;0.243515;0
-0.969897;0.243515;0
-0.982878;0.184258;0
-0.982878;0.184258;0
-0.982878;0.184258;0
-0.982878;0.184258;0
-0.993495;0.113875;0
-0.993495;0.113875;0
-0.993495;0.113875;0
-0.993495;0.113875;0
0.65866;0.752441;0
0.65866;0.752441;0
0.65866;0.752441;0
0.65866;0.752441;0
-0.784346;0.620323;0
-0.784346;0.620323;0
-0.784346;0.620323;0
-0.784346;0.620323;0
-0.998853;0.047877;0
-0.998853;0.047877;0
-0.998853;0.047877;0
-0.998853;0.047877;0
-0.117714;-0.993047;0
-0.117714;-0.993047;0
-0.117714;-0.993047;0
-0.117714;-0.993047;0
-0.856518;-0.516117;0
-0.856518;-0.516117;0
-0.856518;-0.516117;0
-0.856518;-0.516117;0
1;0;0
1;0;0
1;0;0
1;0;0
0.024148;-0.999708;0
0.024148;-0.999708;0
0.024148;-0.999708;0
0.024148;-0.999708;0
-0.043065;-0.999072;0
-0.043065;-0.999072;0
-0.043065;-0.999072;0
-0.043065;-0.999072;0
0.955117;0.296228;0
0.955117;0.296228;0
0.955117;0.296228;0
0.955117;0.296228;0
0.994261;-0.106985;0
0.994261;-0.106985;0
0.994261;-0.106985;0
0.994261;-0.106985;0
0.985501;-0.169668;0
0.985501;-0.169668;0
0.985501;-0.169668;0
0.985501;-0.169668;0
0.968347;-0.249609;0
0.968347;-0.249609;0
0.968347;-0.249609;0
0.968347;-0.249609;0
0.923861;-0.382728;0
0.923861;-0.382728;0
0.923861;-0.382728;0
0.923861;-0.382728;0
0.851756;-0.523939;0
0.851756;-0.523939;0
0.851756;-0.523939;0
0.851756;-0.523939;0
0.943416;0.331612;0
0.943416;0.331612;0
0.943416;0.331612;0
0.943416;0.331612;0
0;1;0
0;1;0
0;1;0
0;1;0
-0.860078;0.510162;0
-0.860078;0.510162;0
-0.860078;0.510162;0
-0.860078;0.510162;0
-0.852833;0.522184;0
-0.852833;0.522184;0
-0.852833;0.522184;0
-0.852833;0.522184;0
-0.895156;0.445753;0
-0.895156;0.445753;0
-0.895156;0.445753;0
-0.895156;0.445753;0
-0.934343;0.356374;0
-0.934343;0.356374;0
-0.934343;0.356374;0
-0.934343;0.356374;0
-0.963914;0.266214;0
-0.963914;0.266214;0
-0.963914;0.266214;0
-0.963914;0.266214;0
-0.969897;0.243515;0
-0.969897;0.243515;0
-0.969897;0.243515;0
-0.969897;0.243515;0
-0.982878;0.184258;0
-0.982878;0.184258;0
-0.982878;0.184258;0
-0.982878;0.184258;0
-0.993495;0.113875;0
-0.993495;0.113875;0
-0.993495;0.113875;0
-0.993495;0.113875;0
0.65866;0.752441;0
0.65866;0.752441;0
0.65866;0.752441;0
0.65866;0.752441;0
-0.784346;0.620323;0
-0.784346;0.620323;0
-0.784346;0.620323;0
-0.784346;0.620323;0
-0.998853;0.047877;0
-0.998853;0.047877;0
-0.998853;0.047877;0
-0.998853;0.047877;0
-0.117714;-0.993047;0
-0.117714;-0.993047;0
-0.117714;-0.993047;0
-0.117714;-0.993047;0
-0.856518;-0.516117;0
-0.856518;-0.516117;0
-0.856518;-0.516117;0
-0.856518;-0.516117;0
1;0;0
1;0;0
1;0;0
1;0;0
}
:TexCoords
{
0.863435;0.168633
0.25917;0.193016
0.25917;0.193016
0.863435;0.168633
0.801397;0.072952
0.455446;0.065652
0.801397;0.072952
0.455446;0.065652
0.455446;0.065652
0.481654;0.107018
0.455446;0.065652
0.481654;0.107018
0.481654;0.107018
0.455446;0.226251
0.481654;0.107018
0.455446;0.226251
0.455446;0.226251
0.413512;0.345484
0.455446;0.226251
0.413512;0.345484
0.413512;0.345484
0.355854;0.454984
0.413512;0.345484
0.355854;0.454984
0.355854;0.454984
0.240537;0.59125
0.355854;0.454984
0.240537;0.59125
0.240537;0.59125
0.09377;0.708049
0.240537;0.59125
0.09377;0.708049
0.09377;0.708049
0.256262;0.934348
0.09377;0.708049
0.256262;0.934348
0.256262;0.934348
0.298195;0.934348
0.256262;0.934348
0.298195;0.934348
0.298195;0.934348
0.34537;0.895415
0.298195;0.934348
0.34537;0.895415
0.34537;0.895415
0.439721;0.819982
0.34537;0.895415
0.439721;0.819982
0.439721;0.819982
0.528829;0.732382
0.439721;0.819982
0.528829;0.732382
0.528829;0.732382
0.617938;0.618016
0.528829;0.732382
0.617938;0.618016
0.617938;0.618016
0.675596;0.515817
0.617938;0.618016
0.675596;0.515817
0.675596;0.515817
0.728013;0.413617
0.675596;0.515817
0.728013;0.413617
0.728013;0.413617
0.769946;0.304118
0.728013;0.413617
0.769946;0.304118
0.769946;0.304118
0.796155;0.192185
0.769946;0.304118
0.796155;0.192185
0.796155;0.192185
0.864297;0.221385
0.796155;0.192185
0.864297;0.221385
0.864297;0.221385
0.895747;0.201918
0.864297;0.221385
0.895747;0.201918
0.895747;0.201918
0.90623;0.094852
0.895747;0.201918
0.90623;0.094852
0.90623;0.094852
0.822363;0.089985
0.90623;0.094852
0.822363;0.089985
0.822363;0.089985
0.801397;0.072952
0.822363;0.089985
0.801397;0.072952
0;1
0.008316;0.739728
0.008316;0.224567
0;1
0.863435;0.168633
0.25917;0.193016
0.863435;0.168633
0.25917;0.193016
0.801397;0.072952
0.455446;0.065652
0.455446;0.065652
0.801397;0.072952
0.455446;0.065652
0.481654;0.107018
0.481654;0.107018
0.455446;0.065652
0.481654;0.107018
0.455446;0.226251
0.455446;0.226251
0.481654;0.107018
0.455446;0.226251
0.413512;0.345484
0.413512;0.345484
0.455446;0.226251
0.413512;0.345484
0.355854;0.454984
0.355854;0.454984
0.413512;0.345484
0.355854;0.454984
0.240537;0.59125
0.240537;0.59125
0.355854;0.454984
0.240537;0.59125
0.09377;0.708049
0.09377;0.708049
0.240537;0.59125
0.09377;0.708049
0.256262;0.934348
0.256262;0.934348
0.09377;0.708049
0.256262;0.934348
0.298195;0.934348
0.298195;0.934348
0.256262;0.934348
0.298195;0.934348
0.34537;0.895415
0.34537;0.895415
0.298195;0.934348
0.34537;0.895415
0.439721;0.819982
0.439721;0.819982
0.34537;0.895415
0.439721;0.819982
0.528829;0.732382
0.528829;0.732382
0.439721;0.819982
0.528829;0.732382
0.617938;0.618016
0.617938;0.618016
0.528829;0.732382
0.617938;0.618016
0.675596;0.515817
0.675596;0.515817
0.617938;0.618016
0.675596;0.515817
0.728013;0.413617
0.728013;0.413617
0.675596;0.515817
0.728013;0.413617
0.769946;0.304118
0.769946;0.304118
0.728013;0.413617
0.769946;0.304118
0.796155;0.192185
0.796155;0.192185
0.769946;0.304118
0.796155;0.192185
0.864297;0.221385
0.864297;0.221385
0.796155;0.192185
0.864297;0.221385
0.895747;0.201918
0.895747;0.201918
0.864297;0.221385
0.895747;0.201918
0.90623;0.094852
0.90623;0.094852
0.895747;0.201918
0.90623;0.094852
0.822363;0.089985
0.822363;0.089985
0.90623;0.094852
0.822363;0.089985
0.801397;0.072952
0.801397;0.072952
0.822363;0.089985
0;1
0.008316;0.739728
0;1
0.008316;0.224567
}
}
:Mesh
{
:Name=AK 47
:Matrix=0;0;-0.234911;0;0;0.128646;0;0;-0.234911;0;0;0;1.42373;10.1414;17.6731;1
:MatIndex=0
:VertexCount=28
:IndexCount=72
:Indices
{
0;1;2;0;3;1;4;3;0;5;6;7;3;6;5;3;8;6;3;9;8;4;9;3;10;9;4;11;9;10;11;12;9;11;13;12;14;15;16;14;17;15;18;19;20;18;21;19;22;21;18;17;21;22;23;24;25;21;24;23;21;26;24;17;26;21;17;27;26;14;27;17;
}
:Positions
{
99.5535;-12.7906;-2.15832
155.875;-22.5563;-2.15832
102.02;-10.537;-2.15832
157.109;-24.8099;-2.15832
96.2646;-15.4198;-2.15832
152.997;-86.0329;-2.15832
146.009;-87.5353;-2.15832
150.531;-88.6621;-2.15832
134.087;-79.2721;-2.15832
95.4424;-55.9848;-2.15832
93.798;-16.5466;-2.15832
83.1092;-13.5418;-2.15832
62.1427;-36.4535;-2.15832
63.7871;-6.02979;-2.15832
83.1092;-13.5418;6.77159
62.1427;-36.4535;6.77159
63.7871;-6.02979;6.77159
95.4424;-55.9848;6.77159
146.009;-87.5353;6.77159
152.997;-86.0329;6.77159
150.531;-88.6621;6.77159
157.109;-24.8099;6.77159
134.087;-79.2721;6.77159
155.875;-22.5563;6.77159
99.5535;-12.7906;6.77159
102.02;-10.537;6.77159
96.2646;-15.4198;6.77159
93.798;-16.5466;6.77159
}
:Normals
{
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
}
:TexCoords
{
0.386165;0.176152
0.966796;0.267674
0.411594;0.155032
0.979511;0.288795
0.352259;0.200793
0.937128;0.862569
0.865079;0.876649
0.9117;0.88721
0.742172;0.799207
0.343783;0.580962
0.32683;0.211353
0.216637;0.183192
0.000489;0.397917
0.017442;0.11279
0.216637;0.183192
0.000489;0.397917
0.017442;0.11279
0.343783;0.580962
0.865079;0.876649
0.937128;0.862569
0.9117;0.88721
0.979511;0.288795
0.742172;0.799207
0.966796;0.267674
0.386165;0.176152
0.411594;0.155032
0.352259;0.200793
0.32683;0.211353
}
}
:Mesh
{
:Name=AK 47
:Matrix=0;0;-0.234911;0;0;0.128646;0;0;-0.234911;0;0;0;1.42373;10.1414;17.6731;1
:MatIndex=6
:VertexCount=440
:IndexCount=660
:Indices
{
0;1;2;1;0;3;4;5;6;5;4;7;8;9;10;9;8;11;12;13;14;13;12;15;16;17;18;17;16;19;20;21;22;21;20;23;24;25;26;25;24;27;28;29;30;29;28;31;32;33;34;33;32;35;36;37;38;37;36;39;40;41;42;41;40;43;44;45;46;45;44;47;48;49;50;49;48;51;52;53;54;53;52;55;56;57;58;57;56;59;60;61;62;61;60;63;64;65;66;65;64;67;68;69;70;69;68;71;72;73;74;73;72;75;76;77;78;77;76;79;80;81;82;81;80;83;84;85;86;85;84;87;88;89;90;89;88;91;92;93;94;93;92;95;96;97;98;97;96;99;100;101;102;101;100;103;104;105;106;105;104;107;108;109;110;109;108;111;112;113;114;113;112;115;116;117;118;117;116;119;120;121;122;121;120;123;124;125;126;125;124;127;128;129;130;129;128;131;132;133;134;133;132;135;136;137;138;137;136;139;140;141;142;141;140;143;144;145;146;145;144;147;148;149;150;149;148;151;152;153;154;153;152;155;156;157;158;157;156;159;160;161;162;161;160;163;164;165;166;165;164;167;168;169;170;169;168;171;172;173;174;173;172;175;176;177;178;177;176;179;180;181;182;181;180;183;184;185;186;185;184;187;188;189;190;189;188;191;192;193;194;193;192;195;196;197;198;197;196;199;200;201;202;201;200;203;204;205;206;205;204;207;208;209;210;209;208;211;212;213;214;213;212;215;216;217;218;217;216;219;220;221;222;221;220;223;224;225;226;225;224;227;228;229;230;229;228;231;232;233;234;233;232;235;236;237;238;237;236;239;240;241;242;241;240;243;244;245;246;245;244;247;248;249;250;249;248;251;252;253;254;253;252;255;256;257;258;257;256;259;260;261;262;261;260;263;264;265;266;265;264;267;268;269;270;269;268;271;272;273;274;273;272;275;276;277;278;277;276;279;280;281;282;281;280;283;284;285;286;285;284;287;288;289;290;289;288;291;292;293;294;293;292;295;296;297;298;297;296;299;300;301;302;301;300;303;304;305;306;305;304;307;308;309;310;309;308;311;312;313;314;313;312;315;316;317;318;317;316;319;320;321;322;321;320;323;324;325;326;325;324;327;328;329;330;329;328;331;332;333;334;333;332;335;336;337;338;337;336;339;340;341;342;341;340;343;344;345;346;345;344;347;348;349;350;349;348;351;352;353;354;353;352;355;356;357;358;357;356;359;360;361;362;361;360;363;364;365;366;365;364;367;368;369;370;369;368;371;372;373;374;373;372;375;376;377;378;377;376;379;380;381;382;381;380;383;384;385;386;385;384;387;388;389;390;389;388;391;392;393;394;393;392;395;396;397;398;397;396;399;400;401;402;401;400;403;404;405;406;405;404;407;408;409;410;409;408;411;412;413;414;413;412;415;416;417;418;417;416;419;420;421;422;421;420;423;424;425;426;425;424;427;428;429;430;429;428;431;432;433;434;433;432;435;436;437;438;437;436;439;
}
:Positions
{
146.009;-87.5353;6.24083
150.531;-88.6621;-2.15832
146.009;-87.5353;-2.15832
150.531;-88.6621;6.24083
150.531;-88.6621;6.24083
152.997;-86.0329;-2.15832
150.531;-88.6621;-2.15832
152.997;-86.0329;6.24083
152.997;-86.0329;6.24083
157.109;-24.8099;-2.15832
152.997;-86.0329;-2.15832
157.109;-24.8099;6.24083
157.109;-24.8099;6.24083
155.875;-22.5563;-2.15832
157.109;-24.8099;-2.15832
155.875;-22.5563;6.24083
155.875;-22.5563;6.24083
102.02;-10.537;-2.15832
155.875;-22.5563;-2.15832
102.02;-10.537;6.24083
102.02;-10.537;6.24083
99.5535;-12.7906;-2.15832
102.02;-10.537;-2.15832
99.5535;-12.7906;6.24083
99.5535;-12.7906;6.24083
96.2646;-15.4198;-2.15832
99.5535;-12.7906;-2.15832
96.2646;-15.4198;6.24083
96.2646;-15.4198;6.24083
93.798;-16.5466;-2.15832
96.2646;-15.4198;-2.15832
93.798;-16.5466;6.24083
93.798;-16.5466;6.24083
83.1092;-13.5418;-2.15832
93.798;-16.5466;-2.15832
83.1092;-13.5418;6.24083
83.1092;-13.5418;6.24083
63.7871;-6.02979;-2.15832
83.1092;-13.5418;-2.15832
63.7871;-6.02979;6.24083
63.7871;-6.02979;6.24083
62.1427;-36.4535;-2.15832
63.7871;-6.02979;-2.15832
62.1427;-36.4535;6.24083
62.1427;-36.4535;6.24083
95.4424;-55.9848;-2.15832
62.1427;-36.4535;-2.15832
95.4424;-55.9848;6.24083
95.4424;-55.9848;6.24083
134.087;-79.2721;-2.15832
95.4424;-55.9848;-2.15832
134.087;-79.2721;6.24083
134.087;-79.2721;6.24083
146.009;-87.5353;-2.15832
134.087;-79.2721;-2.15832
146.009;-87.5353;6.24083
58.2281;-37.688;6.24083
33.9619;-33.8023;-3.75917
58.2281;-37.688;-3.75917
33.9619;-33.8023;6.24083
34.3533;-52.8423;6.24083
35.9189;-55.9508;-3.75917
34.3533;-52.8423;-3.75917
35.9189;-55.9508;6.24083
35.9189;-55.9508;6.24083
39.05;-59.0594;-3.75917
35.9189;-55.9508;-3.75917
39.05;-59.0594;6.24083
39.05;-59.0594;6.24083
43.3553;-76.545;-3.75917
39.05;-59.0594;-3.75917
43.3553;-76.545;6.24083
43.3553;-76.545;6.24083
44.9208;-85.0936;-3.75917
43.3553;-76.545;-3.75917
44.9208;-85.0936;6.24083
44.9208;-85.0936;6.24083
46.095;-91.6993;-3.75917
44.9208;-85.0936;-3.75917
46.095;-91.6993;6.24083
46.095;-91.6993;6.24083
47.2692;-96.7507;-3.75917
46.095;-91.6993;-3.75917
47.2692;-96.7507;6.24083
47.2692;-96.7507;6.24083
48.4433;-101.414;-3.75917
47.2692;-96.7507;-3.75917
48.4433;-101.414;6.24083
48.4433;-101.414;6.24083
48.8347;-115.013;-3.75917
48.4433;-101.414;-3.75917
48.8347;-115.013;6.24083
48.8347;-115.013;6.24083
51.5745;-116.179;-3.75917
48.8347;-115.013;-3.75917
51.5745;-116.179;6.24083
51.5745;-116.179;6.24083
56.2711;-115.013;-3.75917
51.5745;-116.179;-3.75917
56.2711;-115.013;6.24083
56.2711;-115.013;6.24083
60.185;-111.516;-3.75917
56.2711;-115.013;-3.75917
60.185;-111.516;6.24083
60.185;-111.516;6.24083
63.3161;-104.911;-3.75917
60.185;-111.516;-3.75917
63.3161;-104.911;6.24083
63.3161;-104.911;6.24083
62.5334;-93.2536;-3.75917
63.3161;-104.911;-3.75917
62.5334;-93.2536;6.24083
62.5334;-93.2536;6.24083
60.5764;-80.0422;-3.75917
62.5334;-93.2536;-3.75917
60.5764;-80.0422;6.24083
60.5764;-80.0422;6.24083
57.8367;-73.8251;-3.75917
60.5764;-80.0422;-3.75917
57.8367;-73.8251;6.24083
57.8367;-73.8251;6.24083
57.4453;-66.4422;-3.75917
57.8367;-73.8251;-3.75917
57.4453;-66.4422;6.24083
57.4453;-66.4422;6.24083
55.4883;-59.448;-3.75917
57.4453;-66.4422;-3.75917
55.4883;-59.448;6.24083
55.4883;-59.448;6.24083
56.2711;-54.008;-3.75917
55.4883;-59.448;-3.75917
56.2711;-54.008;6.24083
56.2711;-54.008;6.24083
57.4453;-47.4023;-3.75917
56.2711;-54.008;-3.75917
57.4453;-47.4023;6.24083
58.2281;-40.0195;6.24083
58.2281;-37.688;-3.75917
58.2281;-40.0195;-3.75917
58.2281;-37.688;6.24083
-41.9676;-27.8913;5.00472
-42.7504;0.414857;-4.89528
-41.9676;-27.8913;-4.89528
-42.7504;0.414857;5.00472
-42.7504;0.414857;5.00472
-60.3629;0.79227;-4.89528
-42.7504;0.414857;-4.89528
-60.3629;0.79227;5.00472
-60.3629;0.79227;5.00472
-58.406;3.05676;-4.89528
-60.3629;0.79227;-4.89528
-58.406;3.05676;5.00472
-58.406;3.05676;5.00472
-58.0146;6.83091;-4.89528
-58.406;3.05676;-4.89528
-58.0146;6.83091;5.00472
-58.0146;6.83091;5.00472
-57.6232;16.2663;-4.89528
-58.0146;6.83091;-4.89528
-57.6232;16.2663;5.00472
-57.6232;16.2663;5.00472
-57.2318;19.663;-4.89528
-57.6232;16.2663;-4.89528
-57.2318;19.663;5.00472
-57.2318;19.663;5.00472
-58.7974;21.9275;-4.89528
-57.2318;19.663;-4.89528
-58.7974;21.9275;5.00472
-58.7974;21.9275;5.00472
-62.7113;22.3049;-4.89528
-58.7974;21.9275;-4.89528
-62.7113;22.3049;5.00472
-62.7113;22.3049;5.00472
-94.8052;17.7759;-4.89528
-62.7113;22.3049;-4.89528
-94.8052;17.7759;5.00472
-94.8052;17.7759;5.00472
-99.1105;18.1534;-4.89528
-94.8052;17.7759;-4.89528
-99.1105;18.1534;5.00472
-99.1105;18.1534;5.00472
-100.285;14.3792;-4.89528
-99.1105;18.1534;-4.89528
-100.285;14.3792;5.00472
-100.285;-23.7397;5.00472
-97.5449;-26.759;-4.89528
-100.285;-23.7397;-4.89528
-97.5449;-26.759;5.00472
-97.5449;-26.759;5.00472
-93.2396;-26.759;-4.89528
-97.5449;-26.759;-4.89528
-93.2396;-26.759;5.00472
-93.2396;-26.759;5.00472
-67.7993;-26.0042;-4.89528
-93.2396;-26.759;-4.89528
-67.7993;-26.0042;5.00472
-67.7993;-26.0042;5.00472
-59.5801;-26.3816;-4.89528
-67.7993;-26.0042;-4.89528
-59.5801;-26.3816;5.00472
-59.5801;-26.3816;5.00472
-56.0576;-27.8913;-4.89528
-59.5801;-26.3816;-4.89528
-56.0576;-27.8913;5.00472
-56.0576;-27.8913;5.00472
-49.7954;-32.4202;-4.89528
-56.0576;-27.8913;-4.89528
-49.7954;-32.4202;5.00472
-49.7954;-32.4202;5.00472
-46.2729;-34.3073;-4.89528
-49.7954;-32.4202;-4.89528
-46.2729;-34.3073;5.00472
-46.2729;-34.3073;5.00472
-41.9676;-32.0428;-4.89528
-46.2729;-34.3073;-4.89528
-41.9676;-32.0428;5.00472
-41.9676;-32.0428;5.00472
-41.9676;-27.8913;-4.89528
-41.9676;-32.0428;-4.89528
-41.9676;-27.8913;5.00472
58.2281;-37.688;-3.56544
33.9619;-33.8023;6.43456
33.9619;-33.8023;-3.56544
58.2281;-37.688;6.43456
34.3533;-52.8423;-3.56544
35.9189;-55.9508;6.43456
35.9189;-55.9508;-3.56544
34.3533;-52.8423;6.43456
35.9189;-55.9508;-3.56544
39.05;-59.0594;6.43456
39.05;-59.0594;-3.56544
35.9189;-55.9508;6.43456
39.05;-59.0594;-3.56544
43.3553;-76.545;6.43456
43.3553;-76.545;-3.56544
39.05;-59.0594;6.43456
43.3553;-76.545;-3.56544
44.9208;-85.0936;6.43456
44.9208;-85.0936;-3.56544
43.3553;-76.545;6.43456
44.9208;-85.0936;-3.56544
46.095;-91.6993;6.43456
46.095;-91.6993;-3.56544
44.9208;-85.0936;6.43456
46.095;-91.6993;-3.56544
47.2692;-96.7507;6.43456
47.2692;-96.7507;-3.56544
46.095;-91.6993;6.43456
47.2692;-96.7507;-3.56544
48.4433;-101.414;6.43456
48.4433;-101.414;-3.56544
47.2692;-96.7507;6.43456
48.4433;-101.414;-3.56544
48.8347;-115.013;6.43456
48.8347;-115.013;-3.56544
48.4433;-101.414;6.43456
48.8347;-115.013;-3.56544
51.5745;-116.179;6.43456
51.5745;-116.179;-3.56544
48.8347;-115.013;6.43456
51.5745;-116.179;-3.56544
56.2711;-115.013;6.43456
56.2711;-115.013;-3.56544
51.5745;-116.179;6.43456
56.2711;-115.013;-3.56544
60.185;-111.516;6.43456
60.185;-111.516;-3.56544
56.2711;-115.013;6.43456
60.185;-111.516;-3.56544
63.3161;-104.911;6.43456
63.3161;-104.911;-3.56544
60.185;-111.516;6.43456
63.3161;-104.911;-3.56544
62.5334;-93.2535;6.43456
62.5334;-93.2535;-3.56544
63.3161;-104.911;6.43456
62.5334;-93.2535;-3.56544
60.5764;-80.0422;6.43456
60.5764;-80.0422;-3.56544
62.5334;-93.2535;6.43456
60.5764;-80.0422;-3.56544
57.8367;-73.825;6.43456
57.8367;-73.825;-3.56544
60.5764;-80.0422;6.43456
57.8367;-73.825;-3.56544
57.4453;-66.4422;6.43456
57.4453;-66.4422;-3.56544
57.8367;-73.825;6.43456
57.4453;-66.4422;-3.56544
55.4883;-59.448;6.43456
55.4883;-59.448;-3.56544
57.4453;-66.4422;6.43456
55.4883;-59.448;-3.56544
56.2711;-54.008;6.43456
56.2711;-54.008;-3.56544
55.4883;-59.448;6.43456
56.2711;-54.008;-3.56544
57.4453;-47.4023;6.43456
57.4453;-47.4023;-3.56544
56.2711;-54.008;6.43456
58.2281;-40.0195;-3.56544
58.2281;-37.688;6.43456
58.2281;-37.688;-3.56544
58.2281;-40.0195;6.43456
-41.9676;-27.8913;-0.032961
-42.7504;0.414857;9.86704
-42.7504;0.414857;-0.032961
-41.9676;-27.8913;9.86704
-42.7504;0.414857;-0.032961
-60.3629;0.792271;9.86704
-60.3629;0.792271;-0.032961
-42.7504;0.414857;9.86704
-60.3629;0.792271;-0.032961
-58.406;3.05676;9.86704
-58.406;3.05676;-0.032961
-60.3629;0.792271;9.86704
-58.406;3.05676;-0.032961
-58.0146;6.83091;9.86704
-58.0146;6.83091;-0.032961
-58.406;3.05676;9.86704
-58.0146;6.83091;-0.032961
-57.6232;16.2663;9.86704
-57.6232;16.2663;-0.032961
-58.0146;6.83091;9.86704
-57.6232;16.2663;-0.032961
-57.2318;19.663;9.86704
-57.2318;19.663;-0.032961
-57.6232;16.2663;9.86704
-57.2318;19.663;-0.032961
-58.7974;21.9275;9.86704
-58.7974;21.9275;-0.032961
-57.2318;19.663;9.86704
-58.7974;21.9275;-0.032961
-62.7113;22.3049;9.86704
-62.7113;22.3049;-0.032961
-58.7974;21.9275;9.86704
-62.7113;22.3049;-0.032961
-94.8052;17.7759;9.86704
-94.8052;17.7759;-0.032961
-62.7113;22.3049;9.86704
-94.8052;17.7759;-0.032961
-99.1105;18.1534;9.86704
-99.1105;18.1534;-0.032961
-94.8052;17.7759;9.86704
-99.1105;18.1534;-0.032961
-100.285;14.3792;9.86704
-100.285;14.3792;-0.032961
-99.1105;18.1534;9.86704
-100.285;-23.7397;-0.032961
-97.5449;-26.759;9.86704
-97.5449;-26.759;-0.032961
-100.285;-23.7397;9.86704
-97.5449;-26.759;-0.032961
-93.2396;-26.759;9.86704
-93.2396;-26.759;-0.032961
-97.5449;-26.759;9.86704
-93.2396;-26.759;-0.032961
-67.7993;-26.0042;9.86704
-67.7993;-26.0042;-0.032961
-93.2396;-26.759;9.86704
-67.7993;-26.0042;-0.032961
-59.5801;-26.3816;9.86704
-59.5801;-26.3816;-0.032961
-67.7993;-26.0042;9.86704
-59.5801;-26.3816;-0.032961
-56.0576;-27.8913;9.86704
-56.0576;-27.8913;-0.032961
-59.5801;-26.3816;9.86704
-56.0576;-27.8913;-0.032961
-49.7954;-32.4202;9.86704
-49.7954;-32.4202;-0.032961
-56.0576;-27.8913;9.86704
-49.7954;-32.4202;-0.032961
-46.2729;-34.3073;9.86704
-46.2729;-34.3073;-0.032961
-49.7954;-32.4202;9.86704
-46.2729;-34.3073;-0.032961
-41.9676;-32.0428;9.86704
-41.9676;-32.0428;-0.032961
-46.2729;-34.3073;9.86704
-41.9676;-32.0428;-0.032961
-41.9676;-27.8913;9.86704
-41.9676;-27.8913;-0.032961
-41.9676;-32.0428;9.86704
146.009;-87.5353;-1.62755
150.531;-88.6621;6.77159
150.531;-88.6621;-1.62755
146.009;-87.5353;6.77159
150.531;-88.6621;-1.62755
152.997;-86.0329;6.77159
152.997;-86.0329;-1.62755
150.531;-88.6621;6.77159
152.997;-86.0329;-1.62755
157.109;-24.8099;6.77159
157.109;-24.8099;-1.62755
152.997;-86.0329;6.77159
157.109;-24.8099;-1.62755
155.875;-22.5563;6.77159
155.875;-22.5563;-1.62755
157.109;-24.8099;6.77159
155.875;-22.5563;-1.62755
102.02;-10.537;6.77159
102.02;-10.537;-1.62755
155.875;-22.5563;6.77159
102.02;-10.537;-1.62755
99.5535;-12.7906;6.77159
99.5535;-12.7906;-1.62755
102.02;-10.537;6.77159
99.5535;-12.7906;-1.62755
96.2646;-15.4198;6.77159
96.2646;-15.4198;-1.62755
99.5535;-12.7906;6.77159
96.2646;-15.4198;-1.62755
93.798;-16.5466;6.77159
93.798;-16.5466;-1.62755
96.2646;-15.4198;6.77159
93.798;-16.5466;-1.62755
83.1092;-13.5418;6.77159
83.1092;-13.5418;-1.62755
93.798;-16.5466;6.77159
83.1092;-13.5418;-1.62755
63.7871;-6.02979;6.77159
63.7871;-6.02979;-1.62755
83.1092;-13.5418;6.77159
63.7871;-6.02979;-1.62755
62.1427;-36.4535;6.77159
62.1427;-36.4535;-1.62755
63.7871;-6.02979;6.77159
62.1427;-36.4535;-1.62755
95.4424;-55.9848;6.77159
95.4424;-55.9848;-1.62755
62.1427;-36.4535;6.77159
95.4424;-55.9848;-1.62755
134.087;-79.2721;6.77159
134.087;-79.2721;-1.62755
95.4424;-55.9848;6.77159
134.087;-79.2721;-1.62755
146.009;-87.5353;6.77159
146.009;-87.5353;-1.62755
134.087;-79.2721;6.77159
}
:Normals
{
0.241779;0.970331;0
0.241779;0.970331;0
0.241779;0.970331;0
0.241779;0.970331;0
-0.729294;0.684201;0
-0.729294;0.684201;0
-0.729294;0.684201;0
-0.729294;0.684201;0
-0.997753;0.066998;0
-0.997753;0.066998;0
-0.997753;0.066998;0
-0.997753;0.066998;0
-0.877227;-0.480076;0
-0.877227;-0.480076;0
-0.877227;-0.480076;0
-0.877227;-0.480076;0
-0.217819;-0.975989;0
-0.217819;-0.975989;0
-0.217819;-0.975989;0
-0.217819;-0.975989;0
0.674507;-0.738269;0
0.674507;-0.738269;0
0.674507;-0.738268;0
0.674507;-0.738268;0
0.624425;-0.781085;0
0.624425;-0.781085;0
0.624425;-0.781085;0
0.624425;-0.781085;0
0.415514;-0.909587;0
0.415514;-0.909587;0
0.415514;-0.909587;0
0.415514;-0.909587;0
-0.270628;-0.962684;0
-0.270628;-0.962684;0
-0.270628;-0.962684;0
-0.270628;-0.962684;0
-0.362358;-0.932039;0
-0.362358;-0.932039;0
-0.362358;-0.932039;0
-0.362358;-0.932039;0
0.998542;-0.053972;0
0.998542;-0.053972;0
0.998542;-0.053972;0
0.998542;-0.053972;0
0.505927;0.862576;0
0.505927;0.862576;0
0.505927;0.862576;0
0.505927;0.862576;0
0.516138;0.856505;0
0.516138;0.856505;0
0.516138;0.856505;0
0.516138;0.856505;0
0.569651;0.821887;0
0.569651;0.821887;0
0.569651;0.821887;0
0.569651;0.821887;0
-0.158114;-0.987421;0
-0.158114;-0.987421;0
-0.158114;-0.987421;0
-0.158114;-0.987421;0
0.893128;0.449804;0
0.893128;0.449804;0
0.893128;0.449804;0
0.893128;0.449804;0
0.704546;0.709658;0
0.704546;0.709658;0
0.704546;0.709658;0
0.704546;0.709658;0
0.971;0.239078;0
0.971;0.239078;0
0.971;0.239078;0
0.971;0.239078;0
0.983641;0.180141;0
0.983641;0.180141;0
0.983641;0.180141;0
0.983641;0.180141;0
0.984567;0.175008;0
0.984567;0.175008;0
0.984567;0.175008;0
0.984567;0.175008;0
0.974032;0.226408;0
0.974032;0.226408;0
0.974032;0.226408;0
0.974032;0.226408;0
0.969727;0.244191;0
0.969727;0.244191;0
0.969727;0.244191;0
0.969727;0.244191;0
0.999586;0.028767;0
0.999586;0.028767;0
0.999586;0.028767;0
0.999586;0.028767;0
0.391518;0.92017;0
0.391518;0.92017;0
0.391518;0.92017;0
0.391518;0.92017;0
-0.24089;0.970552;0
-0.24089;0.970552;0
-0.24089;0.970552;0
-0.24089;0.970552;0
-0.666289;0.745694;0
-0.666289;0.745694;0
-0.666289;0.745694;0
-0.666289;0.745694;0
-0.903627;0.428321;0
-0.903627;0.428321;0
-0.903627;0.428321;0
-0.903627;0.428321;0
-0.997753;-0.066999;0
-0.997753;-0.066999;0
-0.997753;-0.066999;0
-0.997753;-0.066999;0
-0.989207;-0.146527;0
-0.989207;-0.146527;0
-0.989207;-0.146527;0
-0.989207;-0.146527;0
-0.915088;-0.403255;0
-0.915088;-0.403255;0
-0.915088;-0.403255;0
-0.915088;-0.403255;0
-0.998598;-0.05294;0
-0.998598;-0.05294;0
-0.998598;-0.05294;0
-0.998598;-0.05294;0
-0.963016;-0.269445;0
-0.963016;-0.269445;0
-0.963016;-0.269445;0
-0.963016;-0.269445;0
-0.989805;0.142428;0
-0.989805;0.142428;0
-0.989805;0.142428;0
-0.989805;0.142428;0
-0.984567;0.175007;0
-0.984567;0.175007;0
-0.984567;0.175007;0
-0.984567;0.175007;0
-1;0;0
-1;0;0
-1;0;0
-1;0;0
-0.999618;-0.027644;0
-0.999618;-0.027644;0
-0.999618;-0.027644;0
-0.999618;-0.027644;0
-0.021424;-0.99977;0
-0.021424;-0.99977;0
-0.021424;-0.999771;0
-0.021424;-0.999771;0
-0.756616;0.65386;0
-0.756616;0.653859;0
-0.756616;0.65386;0
-0.756616;0.65386;0
-0.994666;0.103149;0
-0.994666;0.103149;0
-0.994666;0.103149;0
-0.994666;0.103149;0
-0.999141;0.041446;0
-0.999141;0.041446;0
-0.999141;0.041446;0
-0.999141;0.041446;0
-0.993427;0.114467;0
-0.993427;0.114467;0
-0.993427;0.114467;0
-0.993427;0.114467;0
-0.82256;-0.568679;0
-0.82256;-0.568679;0
-0.82256;-0.568679;0
-0.82256;-0.568679;0
-0.095984;-0.995383;0
-0.095984;-0.995383;0
-0.095984;-0.995383;0
-0.095984;-0.995383;0
0.139732;-0.990189;0
0.139732;-0.990189;0
0.139732;-0.990189;0
0.139732;-0.990189;0
-0.087328;-0.99618;0
-0.087328;-0.99618;0
-0.087328;-0.99618;0
-0.087328;-0.99618;0
0.954857;-0.297064;0
0.954857;-0.297064;0
0.954857;-0.297065;0
0.954857;-0.297065;0
0.740563;0.671987;0
0.740563;0.671987;0
0.740563;0.671987;0
0.740563;0.671987;0
0;1;0
0;1;0
0;1;0
0;1;0
-0.029658;0.99956;0
-0.029658;0.99956;0
-0.029658;0.99956;0
-0.029658;0.99956;0
0.045871;0.998947;0
0.045871;0.998947;0
0.045871;0.998947;0
0.045871;0.998947;0
0.393923;0.919144;0
0.393923;0.919144;0
0.393923;0.919144;0
0.393923;0.919144;0
0.586023;0.810295;0
0.586023;0.810295;0
0.586023;0.810295;0
0.586023;0.810295;0
0.472225;0.881478;0
0.472225;0.881478;0
0.472225;0.881478;0
0.472225;0.881478;0
-0.465513;0.885041;0
-0.465513;0.885041;0
-0.465513;0.885041;0
-0.465513;0.885041;0
-1;0;0
-1;0;0
-1;0;0
-1;0;0
-0.158114;-0.987421;0
-0.158114;-0.987421;0
-0.158114;-0.987421;0
-0.158114;-0.987421;0
0.893128;0.449804;0
0.893128;0.449804;0
0.893128;0.449804;0
0.893128;0.449804;0
0.704546;0.709658;0
0.704546;0.709658;0
0.704546;0.709658;0
0.704546;0.709658;0
0.971;0.239078;0
0.971;0.239078;0
0.971;0.239078;0
0.971;0.239078;0
0.983641;0.180141;0
0.983641;0.180141;0
0.983641;0.180141;0
0.983641;0.180141;0
0.984567;0.175008;0
0.984567;0.175008;0
0.984567;0.175008;0
0.984567;0.175008;0
0.974032;0.226408;0
0.974032;0.226408;0
0.974032;0.226408;0
0.974032;0.226408;0
0.969727;0.244191;0
0.969727;0.244191;0
0.969727;0.244191;0
0.969727;0.244191;0
0.999586;0.028767;0
0.999586;0.028767;0
0.999586;0.028767;0
0.999586;0.028767;0
0.391518;0.92017;0
0.391518;0.92017;0
0.391518;0.92017;0
0.391518;0.92017;0
-0.24089;0.970552;0
-0.24089;0.970552;0
-0.24089;0.970552;0
-0.24089;0.970552;0
-0.666289;0.745694;0
-0.666289;0.745694;0
-0.666289;0.745694;0
-0.666289;0.745694;0
-0.903627;0.428321;0
-0.903627;0.428321;0
-0.903627;0.428321;0
-0.903627;0.428321;0
-0.997753;-0.066999;0
-0.997753;-0.066999;0
-0.997753;-0.066999;0
-0.997753;-0.066999;0
-0.989207;-0.146527;0
-0.989207;-0.146527;0
-0.989207;-0.146527;0
-0.989207;-0.146527;0
-0.915088;-0.403255;0
-0.915088;-0.403255;0
-0.915088;-0.403255;0
-0.915088;-0.403255;0
-0.998598;-0.05294;0
-0.998598;-0.05294;0
-0.998598;-0.05294;0
-0.998598;-0.05294;0
-0.963016;-0.269445;0
-0.963016;-0.269445;0
-0.963016;-0.269445;0
-0.963016;-0.269445;0
-0.989805;0.142428;0
-0.989805;0.142428;0
-0.989805;0.142428;0
-0.989805;0.142428;0
-0.984567;0.175007;0
-0.984567;0.175007;0
-0.984567;0.175007;0
-0.984567;0.175007;0
-1;0;0
-1;0;0
-1;0;0
-1;0;0
-0.999618;-0.027644;0
-0.999618;-0.027644;0
-0.999618;-0.027644;0
-0.999618;-0.027644;0
-0.021424;-0.99977;0
-0.021424;-0.99977;0
-0.021424;-0.999771;0
-0.021424;-0.999771;0
-0.756616;0.653859;0
-0.756616;0.65386;0
-0.756616;0.65386;0
-0.756616;0.65386;0
-0.994666;0.103149;0
-0.994666;0.103149;0
-0.994666;0.103149;0
-0.994666;0.103149;0
-0.999141;0.041446;0
-0.999141;0.041446;0
-0.999141;0.041446;0
-0.999141;0.041446;0
-0.993427;0.114467;0
-0.993427;0.114467;0
-0.993427;0.114467;0
-0.993427;0.114467;0
-0.82256;-0.568679;0
-0.82256;-0.568679;0
-0.82256;-0.568679;0
-0.82256;-0.568679;0
-0.095984;-0.995383;0
-0.095984;-0.995383;0
-0.095984;-0.995383;0
-0.095984;-0.995383;0
0.139732;-0.990189;0
0.139732;-0.990189;0
0.139732;-0.990189;0
0.139732;-0.990189;0
-0.087328;-0.99618;0
-0.087328;-0.99618;0
-0.087328;-0.99618;0
-0.087328;-0.99618;0
0.954857;-0.297064;0
0.954857;-0.297064;0
0.954857;-0.297065;0
0.954857;-0.297065;0
0.740563;0.671987;0
0.740563;0.671987;0
0.740563;0.671987;0
0.740563;0.671987;0
0;1;0
0;1;0
0;1;0
0;1;0
-0.029658;0.99956;0
-0.029658;0.99956;0
-0.029658;0.99956;0
-0.029658;0.99956;0
0.045871;0.998947;0
0.045871;0.998947;0
0.045871;0.998947;0
0.045871;0.998947;0
0.393922;0.919144;0
0.393922;0.919144;0
0.393922;0.919144;0
0.393922;0.919144;0
0.586023;0.810295;0
0.586023;0.810295;0
0.586023;0.810295;0
0.586023;0.810295;0
0.472225;0.881478;0
0.472225;0.881478;0
0.472225;0.881478;0
0.472225;0.881478;0
-0.465513;0.885041;0
-0.465513;0.885041;0
-0.465513;0.885041;0
-0.465513;0.885041;0
-1;0;0
-1;0;0
-1;0;0
-1;0;0
0.241779;0.970331;0
0.241779;0.970331;0
0.241779;0.970331;0
0.241779;0.970331;0
-0.729294;0.684201;0
-0.729294;0.684201;0
-0.729294;0.684201;0
-0.729294;0.684201;0
-0.997753;0.066998;0
-0.997753;0.066998;0
-0.997753;0.066998;0
-0.997753;0.066998;0
-0.877227;-0.480076;0
-0.877227;-0.480076;0
-0.877227;-0.480076;0
-0.877227;-0.480076;0
-0.217819;-0.975989;0
-0.217819;-0.975989;0
-0.217819;-0.975989;0
-0.217819;-0.975989;0
0.674507;-0.738269;0
0.674507;-0.738269;0
0.674507;-0.738268;0
0.674507;-0.738268;0
0.624425;-0.781085;0
0.624425;-0.781085;0
0.624425;-0.781085;0
0.624425;-0.781085;0
0.415514;-0.909587;0
0.415514;-0.909587;0
0.415514;-0.909587;0
0.415514;-0.909587;0
-0.270628;-0.962684;0
-0.270628;-0.962684;0
-0.270628;-0.962684;0
-0.270628;-0.962684;0
-0.362358;-0.932039;0
-0.362358;-0.932039;0
-0.362358;-0.932039;0
-0.362358;-0.932039;0
0.998542;-0.053972;0
0.998542;-0.053972;0
0.998542;-0.053972;0
0.998542;-0.053972;0
0.505927;0.862576;0
0.505927;0.862576;0
0.505927;0.862576;0
0.505927;0.862576;0
0.516138;0.856505;0
0.516138;0.856505;0
0.516138;0.856505;0
0.516138;0.856505;0
0.569651;0.821887;0
0.569651;0.821887;0
0.569651;0.821887;0
0.569651;0.821887;0
}
:TexCoords
{
0.882734;0.985878
0.930306;0.9995
0.882734;0.985878
0.930306;0.9995
0.930306;0.9995
0.956254;0.967714
0.930306;0.9995
0.956254;0.967714
0.956254;0.967714
0.999501;0.227545
0.956254;0.967714
0.999501;0.227545
0.999501;0.227545
0.986526;0.2003
0.999501;0.227545
0.986526;0.2003
0.986526;0.2003
0.419993;0.054991
0.986526;0.2003
0.419993;0.054991
0.419993;0.054991
0.394045;0.082236
0.419993;0.054991
0.394045;0.082236
0.394045;0.082236
0.359448;0.114022
0.394045;0.082236
0.359448;0.114022
0.359448;0.114022
0.3335;0.127645
0.359448;0.114022
0.3335;0.127645
0.3335;0.127645
0.221058;0.091318
0.3335;0.127645
0.221058;0.091318
0.221058;0.091318
0.017798;0.000500023
0.221058;0.091318
0.017798;0.000500023
0.017798;0.000500023
0.000499;0.368313
0.017798;0.000500023
0.000499;0.368313
0.000499;0.368313
0.350798;0.604441
0.000499;0.368313
0.350798;0.604441
0.350798;0.604441
0.757318;0.885978
0.350798;0.604441
0.757318;0.885978
0.757318;0.885978
0.882734;0.985878
0.757318;0.885978
0.882734;0.985878
0.733353;0.138178
0.079562;0.097884
0.733353;0.138178
0.079562;0.097884
0.090107;0.295325
0.132287;0.32756
0.090107;0.295325
0.132287;0.32756
0.132287;0.32756
0.216647;0.359795
0.132287;0.32756
0.216647;0.359795
0.216647;0.359795
0.332642;0.541118
0.216647;0.359795
0.332642;0.541118
0.332642;0.541118
0.374822;0.629764
0.332642;0.541118
0.374822;0.629764
0.374822;0.629764
0.406457;0.698264
0.374822;0.629764
0.406457;0.698264
0.406457;0.698264
0.438092;0.750646
0.406457;0.698264
0.438092;0.750646
0.438092;0.750646
0.469727;0.798999
0.438092;0.750646
0.469727;0.798999
0.469727;0.798999
0.480272;0.940027
0.469727;0.798999
0.480272;0.940027
0.480272;0.940027
0.554087;0.952116
0.480272;0.940027
0.554087;0.952116
0.554087;0.952116
0.680628;0.940027
0.554087;0.952116
0.680628;0.940027
0.680628;0.940027
0.786078;0.903763
0.680628;0.940027
0.786078;0.903763
0.786078;0.903763
0.870438;0.835263
0.786078;0.903763
0.870438;0.835263
0.870438;0.835263
0.849348;0.714382
0.870438;0.835263
0.849348;0.714382
0.849348;0.714382
0.796623;0.577382
0.849348;0.714382
0.796623;0.577382
0.796623;0.577382
0.722808;0.512912
0.796623;0.577382
0.722808;0.512912
0.722808;0.512912
0.712263;0.436353
0.722808;0.512912
0.712263;0.436353
0.712263;0.436353
0.659538;0.363824
0.712263;0.436353
0.659538;0.363824
0.659538;0.363824
0.680628;0.307413
0.659538;0.363824
0.680628;0.307413
0.680628;0.307413
0.712263;0.238913
0.680628;0.307413
0.712263;0.238913
0.733353;0.162355
0.733353;0.138178
0.733353;0.162355
0.733353;0.138178
0;1
0.889692;0.41329
0.901684;0.795835
0;1
0;1
0.619883;0.408189
0.889692;0.41329
0;1
0;1
0.649862;0.377585
0.619883;0.408189
0;1
0;1
0.655858;0.326579
0.649862;0.377585
0;1
0;1
0.661854;0.199064
0.655858;0.326579
0;1
0;1
0.66785;0.153159
0.661854;0.199064
0;1
0;1
0.643867;0.122555
0.66785;0.153159
0;1
0;1
0.583909;0.117454
0.643867;0.122555
0;1
0;1
0.092257;0.178662
0.583909;0.117454
0;1
0;1
0.026304;0.173561
0.092257;0.178662
0;1
0;1
0.008316;0.224567
0.026304;0.173561
0;1
0;1
0.050287;0.780533
0.008316;0.739728
0;1
0;1
0.11624;0.780533
0.050287;0.780533
0;1
0;1
0.505964;0.770332
0.11624;0.780533
0;1
0;1
0.631875;0.775433
0.505964;0.770332
0;1
0;1
0.685837;0.795835
0.631875;0.775433
0;1
0;1
0.781769;0.857043
0.685837;0.795835
0;1
0;1
0.835731;0.882546
0.781769;0.857043
0;1
0;1
0.901684;0.851942
0.835731;0.882546
0;1
0;1
0.901684;0.795835
0.901684;0.851942
0;1
0.733353;0.138178
0.079562;0.097884
0.079562;0.097884
0.733353;0.138178
0.090107;0.295325
0.132287;0.32756
0.132287;0.32756
0.090107;0.295325
0.132287;0.32756
0.216647;0.359795
0.216647;0.359795
0.132287;0.32756
0.216647;0.359795
0.332642;0.541118
0.332642;0.541118
0.216647;0.359795
0.332642;0.541118
0.374822;0.629764
0.374822;0.629764
0.332642;0.541118
0.374822;0.629764
0.406457;0.698264
0.406457;0.698264
0.374822;0.629764
0.406457;0.698264
0.438092;0.750646
0.438092;0.750646
0.406457;0.698264
0.438092;0.750646
0.469727;0.798999
0.469727;0.798999
0.438092;0.750646
0.469727;0.798999
0.480272;0.940027
0.480272;0.940027
0.469727;0.798999
0.480272;0.940027
0.554087;0.952116
0.554087;0.952116
0.480272;0.940027
0.554087;0.952116
0.680628;0.940027
0.680628;0.940027
0.554087;0.952116
0.680628;0.940027
0.786078;0.903763
0.786078;0.903763
0.680628;0.940027
0.786078;0.903763
0.870438;0.835263
0.870438;0.835263
0.786078;0.903763
0.870438;0.835263
0.849348;0.714382
0.849348;0.714382
0.870438;0.835263
0.849348;0.714382
0.796623;0.577382
0.796623;0.577382
0.849348;0.714382
0.796623;0.577382
0.722808;0.512912
0.722808;0.512912
0.796623;0.577382
0.722808;0.512912
0.712263;0.436353
0.712263;0.436353
0.722808;0.512912
0.712263;0.436353
0.659538;0.363824
0.659538;0.363824
0.712263;0.436353
0.659538;0.363824
0.680628;0.307413
0.680628;0.307413
0.659538;0.363824
0.680628;0.307413
0.712263;0.238913
0.712263;0.238913
0.680628;0.307413
0.733353;0.162355
0.733353;0.138178
0.733353;0.138178
0.733353;0.162355
0;1
0.889692;0.41329
0;1
0.901684;0.795835
0;1
0.619883;0.408189
0;1
0.889692;0.41329
0;1
0.649862;0.377585
0;1
0.619883;0.408189
0;1
0.655858;0.326579
0;1
0.649862;0.377585
0;1
0.661854;0.199064
0;1
0.655858;0.326579
0;1
0.66785;0.153159
0;1
0.661854;0.199064
0;1
0.643867;0.122555
0;1
0.66785;0.153159
0;1
0.583909;0.117454
0;1
0.643867;0.122555
0;1
0.092257;0.178662
0;1
0.583909;0.117454
0;1
0.026304;0.173561
0;1
0.092257;0.178662
0;1
0.008316;0.224567
0;1
0.026304;0.173561
0;1
0.050287;0.780533
0;1
0.008316;0.739728
0;1
0.11624;0.780533
0;1
0.050287;0.780533
0;1
0.505964;0.770332
0;1
0.11624;0.780533
0;1
0.631875;0.775433
0;1
0.505964;0.770332
0;1
0.685837;0.795835
0;1
0.631875;0.775433
0;1
0.781769;0.857043
0;1
0.685837;0.795835
0;1
0.835731;0.882546
0;1
0.781769;0.857043
0;1
0.901684;0.851942
0;1
0.835731;0.882546
0;1
0.901684;0.795835
0;1
0.901684;0.851942
0.882734;0.985878
0.930306;0.9995
0.930306;0.9995
0.882734;0.985878
0.930306;0.9995
0.956254;0.967714
0.956254;0.967714
0.930306;0.9995
0.956254;0.967714
0.999501;0.227545
0.999501;0.227545
0.956254;0.967714
0.999501;0.227545
0.986526;0.2003
0.986526;0.2003
0.999501;0.227545
0.986526;0.2003
0.419993;0.054991
0.419993;0.054991
0.986526;0.2003
0.419993;0.054991
0.394045;0.082236
0.394045;0.082236
0.419993;0.054991
0.394045;0.082236
0.359448;0.114022
0.359448;0.114022
0.394045;0.082236
0.359448;0.114022
0.3335;0.127645
0.3335;0.127645
0.359448;0.114022
0.3335;0.127645
0.221058;0.091318
0.221058;0.091318
0.3335;0.127645
0.221058;0.091318
0.017798;0.000500023
0.017798;0.000500023
0.221058;0.091318
0.017798;0.000500023
0.000499;0.368313
0.000499;0.368313
0.017798;0.000500023
0.000499;0.368313
0.350798;0.604441
0.350798;0.604441
0.000499;0.368313
0.350798;0.604441
0.757318;0.885978
0.757318;0.885978
0.350798;0.604441
0.757318;0.885978
0.882734;0.985878
0.882734;0.985878
0.757318;0.885978
}
}
:Mesh
{
:Name=AK 47
:Matrix=0;0;-0.234911;0;0;0.128646;0;0;-0.234911;0;0;0;1.42373;10.1414;17.6731;1
:MatIndex=2
:VertexCount=66
:IndexCount=162
:Indices
{
0;1;2;0;3;1;0;4;3;4;5;6;0;5;4;5;7;8;7;9;10;5;9;7;9;11;12;11;13;14;9;13;11;5;13;9;15;16;17;15;18;16;13;18;15;5;18;13;5;19;18;0;19;5;0;20;19;0;21;20;22;23;24;22;25;23;22;26;25;27;28;29;28;27;30;31;0;2;0;31;32;33;34;35;33;36;34;37;38;39;40;38;37;40;41;38;41;42;43;42;44;45;41;44;42;44;46;47;46;48;49;44;48;46;41;48;44;40;48;41;36;48;40;33;48;36;48;50;51;33;50;48;33;52;50;33;53;52;33;54;53;55;56;57;55;58;56;55;59;58;60;61;62;61;60;63;64;33;65;33;64;54;
}
:Positions
{
34.1927;-45.0282;-3.75917
57.4453;-47.4023;-3.75917
58.2281;-40.0195;-3.75917
56.2711;-54.008;-3.75917
55.4883;-59.448;-3.75917
57.8367;-73.8251;-3.75917
57.4453;-66.4422;-3.75917
62.5334;-93.2536;-3.75917
60.5764;-80.0422;-3.75917
60.185;-111.516;-3.75917
63.3161;-104.911;-3.75917
51.5745;-116.179;-3.75917
56.2711;-115.013;-3.75917
48.4433;-101.414;-3.75917
48.8347;-115.013;-3.75917
47.2692;-96.7507;-3.75917
44.9208;-85.0936;-3.75917
46.095;-91.6993;-3.75917
43.3553;-76.545;-3.75917
39.05;-59.0594;-3.75917
35.9189;-55.9508;-3.75917
34.3533;-52.8423;-3.75917
33.9619;-33.8023;6.24083
34.1927;-45.0282;-3.75917
33.9619;-33.8023;-3.75917
34.3533;-52.8423;-3.75917
34.3533;-52.8423;6.24083
57.4453;-47.4023;6.24083
58.2281;-40.0195;-3.75917
57.4453;-47.4023;-3.75917
58.2281;-40.0195;6.24083
58.2281;-37.688;-3.75917
33.9619;-33.8023;-3.75917
34.1927;-45.0282;6.43456
35.9189;-55.9508;6.43456
34.3533;-52.8423;6.43456
39.05;-59.0594;6.43456
44.9208;-85.0936;6.43456
47.2692;-96.7507;6.43456
46.095;-91.6993;6.43456
43.3553;-76.545;6.43456
48.4433;-101.414;6.43456
51.5745;-116.179;6.43456
48.8347;-115.013;6.43456
60.185;-111.516;6.43456
56.2711;-115.013;6.43456
62.5334;-93.2535;6.43456
63.3161;-104.911;6.43456
57.8367;-73.825;6.43456
60.5764;-80.0422;6.43456
55.4883;-59.448;6.43456
57.4453;-66.4422;6.43456
56.2711;-54.008;6.43456
57.4453;-47.4023;6.43456
58.2281;-40.0195;6.43456
33.9619;-33.8023;-3.56544
34.3533;-52.8423;6.43456
34.3533;-52.8423;-3.56544
34.1927;-45.0282;6.43456
33.9619;-33.8023;6.43456
57.4453;-47.4023;-3.56544
58.2281;-40.0195;6.43456
58.2281;-40.0195;-3.56544
57.4453;-47.4023;6.43456
58.2281;-37.688;6.43456
33.9619;-33.8023;6.43456
}
:Normals
{
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0.999789;0.020552;0
0.999789;0.020552;0
0.999789;0.020552;0
0.999789;0.020552;0
0.999789;0.020552;0
-0.994426;0.105437;0
-0.994426;0.105437;0
-0.994426;0.105437;0
-0.994426;0.105437;0
0;0;1
0;0;1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0.999789;0.020552;0
0.999789;0.020552;0
0.999789;0.020552;0
0.999789;0.020552;-0
0.999789;0.020552;0
-0.994426;0.105437;0
-0.994426;0.105437;0
-0.994426;0.105437;0
-0.994426;0.105437;0
0;0;-1
0;0;-1
}
:TexCoords
{
0.085779;0.214294
0.712263;0.238913
0.733353;0.162355
0.680628;0.307413
0.659538;0.363824
0.722808;0.512912
0.712263;0.436353
0.849348;0.714382
0.796623;0.577382
0.786078;0.903763
0.870438;0.835263
0.554087;0.952116
0.680628;0.940027
0.469727;0.798999
0.480272;0.940027
0.438092;0.750646
0.374822;0.629764
0.406457;0.698264
0.332642;0.541118
0.216647;0.359795
0.132287;0.32756
0.090107;0.295325
0.079562;0.097884
0.085779;0.214294
0.079562;0.097884
0.090107;0.295325
0.090107;0.295325
0.712263;0.238913
0.733353;0.162355
0.712263;0.238913
0.733353;0.162355
0.733353;0.138178
0.079562;0.097884
0.085779;0.214294
0.132287;0.32756
0.090107;0.295325
0.216647;0.359795
0.374822;0.629764
0.438092;0.750646
0.406457;0.698264
0.332642;0.541118
0.469727;0.798999
0.554087;0.952116
0.480272;0.940027
0.786078;0.903763
0.680628;0.940027
0.849348;0.714382
0.870438;0.835263
0.722808;0.512912
0.796623;0.577382
0.659538;0.363824
0.712263;0.436353
0.680628;0.307413
0.712263;0.238913
0.733353;0.162355
0.079562;0.097884
0.090107;0.295325
0.090107;0.295325
0.085779;0.214294
0.079562;0.097884
0.712263;0.238913
0.733353;0.162355
0.733353;0.162355
0.712263;0.238913
0.733353;0.138178
0.079562;0.097884
}
}
:Mesh
{
:Name=AK 47
:Matrix=0;0;-0.234911;0;0;0.128646;0;0;-0.234911;0;0;0;1.42373;10.1414;17.6731;1
:MatIndex=3
:VertexCount=44
:IndexCount=120
:Indices
{
0;1;2;3;1;0;4;1;3;5;6;7;8;6;5;9;6;8;9;10;6;9;11;10;12;11;9;13;11;12;13;14;11;15;14;13;15;16;14;17;16;15;17;18;16;1;18;17;1;19;18;4;19;1;20;19;4;20;21;19;22;23;24;25;26;27;25;28;26;25;29;28;30;29;25;31;29;30;31;32;29;31;33;32;34;33;31;34;35;33;36;35;34;36;37;35;38;37;36;38;39;37;23;39;38;39;40;41;39;42;40;39;43;42;23;43;39;22;43;23;
}
:Positions
{
12.6592;-53.1997;-3.75917
5.01867;-51.6743;-3.75917
10.2464;-56.2505;-3.75917
13.4635;-36.4204;-3.75917
7.02933;-35.6577;-3.75917
-29.5647;-161.884;-3.75917
-36.401;-167.985;-3.75917
-33.1839;-167.985;-3.75917
-22.3263;-150.062;-3.75917
-15.4901;-136.333;-3.75917
-48.8671;-132.52;-3.75917
-37.6074;-114.215;-3.75917
-8.65383;-118.41;-3.75917
-4.23037;-102.393;-3.75917
-28.7605;-92.8598;-3.75917
-0.209051;-86.3769;-3.75917
-24.337;-75.6992;-3.75917
3.00801;-69.2163;-3.75917
-21.1199;-57.0132;-3.75917
-19.1093;-38.3272;-3.75917
5.4208;-32.9883;-3.75917
-21.1199;-31.8443;-3.75917
5.4208;-32.9883;6.17646
-19.1093;-38.3272;6.17646
-21.1199;-31.8443;6.17646
-36.401;-167.985;6.17646
-29.5647;-161.884;6.17646
-33.1839;-167.985;6.17646
-22.3263;-150.062;6.17646
-15.4901;-136.333;6.17646
-48.8671;-132.52;6.17646
-37.6074;-114.215;6.17646
-8.65383;-118.41;6.17646
-4.23038;-102.393;6.17646
-28.7605;-92.8598;6.17646
-0.209052;-86.3769;6.17646
-24.337;-75.6992;6.17646
3.00801;-69.2163;6.17646
-21.1199;-57.0132;6.17646
5.01867;-51.6743;6.17646
12.6592;-53.1997;6.17646
10.2464;-56.2505;6.17646
13.4635;-36.4204;6.17646
7.02933;-35.6577;6.17646
}
:Normals
{
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
}
:TexCoords
{
0.895747;0.201918
0.796155;0.192185
0.864297;0.221385
0.90623;0.094852
0.822363;0.089985
0.34537;0.895415
0.256262;0.934348
0.298195;0.934348
0.439721;0.819982
0.528829;0.732382
0.09377;0.708049
0.240537;0.59125
0.617938;0.618016
0.675596;0.515817
0.355854;0.454984
0.728013;0.413617
0.413512;0.345484
0.769946;0.304118
0.455446;0.226251
0.481654;0.107018
0.801397;0.072952
0.455446;0.065652
0.801397;0.072952
0.481654;0.107018
0.455446;0.065652
0.256262;0.934348
0.34537;0.895415
0.298195;0.934348
0.439721;0.819982
0.528829;0.732382
0.09377;0.708049
0.240537;0.59125
0.617938;0.618016
0.675596;0.515817
0.355854;0.454984
0.728013;0.413617
0.413512;0.345484
0.769946;0.304118
0.455446;0.226251
0.796155;0.192185
0.895747;0.201918
0.864297;0.221385
0.90623;0.094852
0.822363;0.089985
}
}
:Mesh
{
:Name=AK 47
:Matrix=0;0;-0.234911;0;0;0.128646;0;0;-0.234911;0;0;0;1.42373;10.1414;17.6731;1
:MatIndex=5
:VertexCount=42
:IndexCount=114
:Indices
{
0;1;2;3;1;0;3;4;1;3;5;4;3;6;5;6;7;8;7;9;10;7;11;9;6;11;7;6;12;11;6;13;12;6;14;13;6;15;14;3;15;6;3;16;15;3;17;16;18;17;3;18;19;17;18;20;19;21;22;23;21;24;22;25;26;27;28;26;25;26;29;30;28;29;26;31;29;28;32;29;31;33;29;32;34;29;33;35;36;37;35;38;36;39;38;35;40;38;39;29;38;40;34;38;29;41;38;34;24;38;41;21;38;24;
}
:Positions
{
-58.7974;21.9275;-4.89528
-57.6232;16.2663;-4.89528
-57.2318;19.663;-4.89528
-62.7113;22.3049;-4.89528
-58.0146;6.83091;-4.89528
-58.406;3.05676;-4.89528
-60.3629;0.79227;-4.89528
-41.9676;-27.8913;-4.89528
-42.7504;0.414857;-4.89528
-46.2729;-34.3073;-4.89528
-41.9676;-32.0428;-4.89528
-49.7954;-32.4202;-4.89528
-56.0576;-27.8913;-4.89528
-59.5801;-26.3816;-4.89528
-67.7993;-26.0042;-4.89528
-93.2396;-26.759;-4.89528
-97.5449;-26.759;-4.89528
-100.285;-23.7397;-4.89528
-94.8052;17.7759;-4.89528
-100.285;14.3792;-4.89528
-99.1105;18.1534;-4.89528
-94.8052;17.7759;9.86704
-100.285;14.3792;9.86704
-99.1105;18.1534;9.86704
-100.285;-23.7397;9.86704
-46.2729;-34.3073;9.86704
-41.9676;-27.8913;9.86704
-41.9676;-32.0428;9.86704
-49.7954;-32.4202;9.86704
-60.3629;0.792271;9.86704
-42.7504;0.414857;9.86704
-56.0576;-27.8913;9.86704
-59.5801;-26.3816;9.86704
-67.7993;-26.0042;9.86704
-93.2396;-26.759;9.86704
-57.6232;16.2663;9.86704
-58.7974;21.9275;9.86704
-57.2318;19.663;9.86704
-62.7113;22.3049;9.86704
-58.0146;6.83091;9.86704
-58.406;3.05676;9.86704
-97.5449;-26.759;9.86704
}
:Normals
{
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
}
:TexCoords
{
0.643867;0.122555
0.661854;0.199064
0.66785;0.153159
0.583909;0.117454
0.655858;0.326579
0.649862;0.377585
0.619883;0.408189
0.901684;0.795835
0.889692;0.41329
0.835731;0.882546
0.901684;0.851942
0.781769;0.857043
0.685837;0.795835
0.631875;0.775433
0.505964;0.770332
0.11624;0.780533
0.050287;0.780533
0.008316;0.739728
0.092257;0.178662
0.008316;0.224567
0.026304;0.173561
0.092257;0.178662
0.008316;0.224567
0.026304;0.173561
0.008316;0.739728
0.835731;0.882546
0.901684;0.795835
0.901684;0.851942
0.781769;0.857043
0.619883;0.408189
0.889692;0.41329
0.685837;0.795835
0.631875;0.775433
0.505964;0.770332
0.11624;0.780533
0.661854;0.199064
0.643867;0.122555
0.66785;0.153159
0.583909;0.117454
0.655858;0.326579
0.649862;0.377585
0.050287;0.780533
}
}
:Mesh
{
:Name=AK 47
:Matrix=0;0;-0.234911;0;0;0.128646;0;0;-0.234911;0;0;0;1.42373;10.1414;17.6731;1
:MatIndex=9
:VertexCount=740
:IndexCount=1974
:Indices
{
0;1;2;0;3;1;4;5;6;7;5;4;7;8;5;9;8;7;3;8;9;0;8;3;10;11;12;10;13;11;14;13;10;14;15;13;14;16;15;17;16;14;17;18;16;17;19;18;20;21;22;21;20;23;24;25;26;25;24;27;28;29;30;29;28;31;32;33;34;33;32;35;36;37;38;37;36;39;40;41;42;41;40;43;44;45;46;45;44;47;48;49;50;49;48;51;52;53;54;53;52;55;56;57;58;57;56;59;60;61;62;61;60;63;64;62;65;62;64;60;60;66;67;66;60;64;68;67;69;67;68;60;60;70;71;70;60;68;72;71;73;71;72;60;60;74;75;74;60;72;76;75;77;75;76;60;60;78;79;78;60;76;80;79;81;79;80;60;60;82;63;82;60;80;83;84;85;84;83;86;87;85;88;85;87;83;83;89;90;89;83;87;91;90;92;90;91;83;83;93;94;93;83;91;95;94;96;94;95;83;83;97;98;97;83;95;99;98;100;98;99;83;83;101;102;101;83;99;103;102;104;102;103;83;83;105;86;105;83;103;106;107;68;107;106;108;109;68;110;68;109;106;106;101;99;101;106;109;108;99;100;99;108;106;111;110;67;110;111;109;112;67;113;67;112;111;111;104;102;104;111;112;109;102;101;102;109;111;114;113;64;113;114;112;115;64;116;64;115;114;114;105;103;105;114;115;112;103;104;103;112;114;117;116;62;116;117;115;118;62;119;62;118;117;117;84;86;84;117;118;115;86;105;86;115;117;120;119;63;119;120;118;121;63;122;63;121;120;120;88;85;88;120;121;118;85;84;85;118;120;123;122;80;122;123;121;124;80;125;80;124;123;123;89;87;89;123;124;121;87;88;87;121;123;126;125;79;125;126;124;127;79;128;79;127;126;126;92;90;92;126;127;124;90;89;90;124;126;129;128;76;128;129;127;130;76;131;76;130;129;129;93;91;93;129;130;127;91;92;91;127;129;132;131;75;131;132;130;133;75;134;75;133;132;132;96;94;96;132;133;130;94;93;94;130;132;135;134;72;134;135;133;136;72;137;72;136;135;135;97;95;97;135;136;133;95;96;95;133;135;138;137;71;137;138;136;108;71;107;71;108;138;138;100;98;100;138;108;136;98;97;98;136;138;139;140;141;139;142;140;139;143;142;139;144;143;145;144;139;145;146;144;145;147;146;141;147;145;141;148;147;141;149;148;141;140;149;150;151;152;150;153;151;150;154;153;152;155;150;156;155;152;157;155;156;158;155;157;158;159;155;160;159;158;154;159;160;150;159;154;161;162;163;162;161;164;165;166;167;166;165;168;169;170;171;170;169;172;173;174;175;174;173;176;177;178;179;178;177;180;181;182;183;182;181;184;185;186;187;186;185;188;189;190;191;190;189;192;193;194;195;194;193;196;197;198;199;198;197;200;201;202;203;202;201;204;205;206;207;208;209;210;209;211;212;209;213;211;208;213;209;208;214;213;215;214;208;216;214;215;217;214;216;214;218;219;217;218;214;206;218;217;218;220;221;206;220;218;205;220;206;205;222;220;223;224;225;224;226;227;226;228;229;230;231;232;233;231;230;231;234;235;233;234;231;228;234;233;228;236;234;228;237;236;228;238;237;226;238;228;226;239;238;224;239;226;223;239;224;223;240;239;241;242;243;242;241;244;245;246;247;246;245;248;249;250;251;250;249;252;253;254;255;254;253;256;257;258;259;258;257;260;261;262;263;262;261;264;265;266;267;266;265;268;269;270;271;270;269;272;273;274;275;274;273;276;277;278;279;278;277;280;281;282;283;282;281;284;285;286;287;286;285;288;289;290;291;290;289;292;293;294;295;294;293;296;297;298;299;298;297;300;301;302;303;302;301;304;305;306;307;306;305;308;309;310;311;310;309;312;313;314;315;314;313;316;317;318;319;318;317;320;320;321;318;321;320;322;322;323;321;323;322;324;324;325;323;325;324;326;327;328;329;330;331;332;315;333;334;333;315;314;319;335;336;335;319;318;318;337;335;337;318;321;321;338;337;338;321;323;323;339;338;339;323;325;329;340;341;342;343;330;334;344;345;344;334;333;336;346;347;346;336;335;335;348;346;348;335;337;337;349;348;349;337;338;338;350;349;350;338;339;341;351;352;353;354;342;345;355;356;355;345;344;347;357;358;357;347;346;346;359;357;359;346;348;348;360;359;360;348;349;349;361;360;361;349;350;352;362;363;364;365;353;356;366;367;366;356;355;358;368;369;368;358;357;357;370;368;370;357;359;359;371;370;371;359;360;360;372;371;372;360;361;363;373;374;375;376;364;367;377;378;377;367;366;369;379;380;379;369;368;368;381;379;381;368;370;370;382;381;382;370;371;371;383;382;383;371;372;374;384;385;386;387;375;378;388;389;388;378;377;380;390;391;390;380;379;379;392;390;392;379;381;381;393;392;393;381;382;382;394;393;394;382;383;385;395;396;397;398;386;389;399;400;399;389;388;391;401;402;401;391;390;390;403;401;403;390;392;392;404;403;404;392;393;393;405;404;405;393;394;396;406;407;408;409;397;400;410;411;410;400;399;402;412;413;412;402;401;401;414;412;414;401;403;403;415;414;415;403;404;404;416;415;416;404;405;407;417;418;419;420;408;411;421;422;421;411;410;413;423;424;423;413;412;412;425;423;425;412;414;414;426;425;426;414;415;415;427;426;427;415;416;418;428;429;430;431;419;422;432;433;432;422;421;424;434;435;434;424;423;423;436;434;436;423;425;425;437;436;437;425;426;426;438;437;438;426;427;429;439;440;441;442;430;433;443;444;443;433;432;435;445;446;445;435;434;434;447;445;447;434;436;436;448;447;448;436;437;437;449;448;449;437;438;440;450;451;452;453;441;444;454;455;454;444;443;446;456;457;456;446;445;445;458;456;458;445;447;447;459;458;459;447;448;448;460;459;460;448;449;451;461;462;463;464;452;455;465;466;465;455;454;457;467;468;467;457;456;456;469;467;469;456;458;458;470;469;470;458;459;459;471;470;471;459;460;462;472;473;474;475;463;466;476;477;476;466;465;468;478;479;478;468;467;467;480;478;480;467;469;469;481;480;481;469;470;470;482;481;482;470;471;473;483;484;485;486;474;477;487;488;487;477;476;479;489;490;489;479;478;478;491;489;491;478;480;480;492;491;492;480;481;481;493;492;493;481;482;484;494;495;494;484;483;496;497;498;497;496;499;499;500;497;500;499;501;501;502;500;502;501;503;503;504;502;504;503;505;506;507;508;507;506;509;510;511;512;511;510;485;488;513;514;513;488;487;490;515;516;515;490;489;489;517;515;517;489;491;491;518;517;518;491;492;492;519;518;519;492;493;495;520;521;520;495;494;498;522;523;522;498;497;497;524;522;524;497;500;500;525;524;525;500;502;502;526;525;526;502;504;508;527;528;527;508;507;512;529;530;529;512;511;514;531;532;531;514;513;516;533;534;533;516;515;515;535;533;535;515;517;517;536;535;536;517;518;518;537;536;537;518;519;521;538;539;538;521;520;523;540;541;540;523;522;522;542;540;542;522;524;524;543;542;543;524;525;525;544;543;544;525;526;528;545;546;545;528;527;530;547;548;547;530;529;549;550;551;550;549;552;553;554;555;554;553;556;556;557;554;557;556;558;558;559;557;560;558;561;561;562;560;562;561;563;563;564;562;564;563;565;565;566;564;566;565;567;567;568;566;568;567;569;569;570;568;570;569;571;571;572;570;572;571;573;573;574;572;574;573;575;575;576;574;576;575;577;577;578;576;579;577;580;580;581;579;581;580;582;582;583;581;583;582;584;584;585;583;585;584;586;586;587;585;587;586;588;588;551;587;551;588;549;589;590;591;590;589;592;592;593;590;593;592;594;594;595;593;595;594;596;596;597;595;597;596;598;598;599;597;599;598;600;600;601;599;601;600;602;602;603;601;603;602;604;604;605;603;605;604;606;606;607;605;607;606;608;608;609;607;610;611;612;612;613;610;614;615;616;616;617;614;617;616;618;618;619;617;619;618;620;620;621;619;621;620;622;622;623;621;623;622;624;624;625;623;625;624;626;627;628;629;628;627;630;630;631;628;631;630;632;633;634;635;636;544;526;637;638;639;638;637;640;641;642;643;644;504;645;646;647;648;649;650;651;652;653;654;653;652;655;656;657;658;659;660;661;662;663;664;663;662;665;666;667;668;667;666;669;670;671;672;671;670;673;674;675;676;675;674;677;678;679;680;679;678;681;682;683;684;683;682;685;686;687;688;687;686;689;690;691;692;691;690;693;694;695;696;695;694;697;698;699;700;699;698;701;702;703;704;703;702;705;706;707;708;707;706;709;710;711;712;711;710;713;714;715;716;715;714;717;718;719;720;719;718;721;722;723;724;723;722;725;726;727;728;727;726;729;730;731;732;731;730;733;661;734;735;734;661;660;655;736;737;736;655;652;651;738;739;738;651;650;
}
:Positions
{
-106.86;0.742922;4.5576
-100.83;14.7917;4.5576
-99.8246;-0.163452;4.5576
-129.975;12.0726;4.5576
-136.508;-4.6953;4.5576
-126.96;-5.60168;4.5576
-142.036;-6.50805;4.5576
-133.493;-0.163452;4.5576
-127.463;0.742922;4.5576
-131.483;5.27478;4.5576
-126.96;-5.60168;0.233129
-136.508;-4.6953;0.233129
-142.036;-6.50805;0.233129
-133.493;-0.163452;0.233129
-127.463;0.742921;0.233129
-131.483;5.27478;0.233129
-129.975;12.0726;0.233129
-106.86;0.742921;0.233129
-100.83;14.7917;0.233129
-99.8246;-0.163452;0.233129
-136.508;-4.6953;4.5576
-142.036;-6.50805;0.233129
-136.508;-4.6953;0.233129
-142.036;-6.50805;4.5576
-142.036;-6.50805;4.5576
-126.96;-5.60168;0.233129
-142.036;-6.50805;0.233129
-126.96;-5.60168;4.5576
-126.96;-5.60168;4.5576
-127.463;0.742921;0.233129
-126.96;-5.60168;0.233129
-127.463;0.742922;4.5576
-127.463;0.742922;4.5576
-106.86;0.742921;0.233129
-127.463;0.742921;0.233129
-106.86;0.742922;4.5576
-106.86;0.742922;4.5576
-99.8246;-0.163452;0.233129
-106.86;0.742921;0.233129
-99.8246;-0.163452;4.5576
-99.8246;-0.163452;4.5576
-100.83;14.7917;0.233129
-99.8246;-0.163452;0.233129
-100.83;14.7917;4.5576
-100.83;14.7917;4.5576
-129.975;12.0726;0.233129
-100.83;14.7917;0.233129
-129.975;12.0726;4.5576
-129.975;12.0726;4.5576
-131.483;5.27478;0.233129
-129.975;12.0726;0.233129
-131.483;5.27478;4.5576
-131.483;5.27478;4.5576
-133.493;-0.163452;0.233129
-131.483;5.27478;0.233129
-133.493;-0.163452;4.5576
-133.493;-0.163452;4.5576
-136.508;-4.6953;0.233129
-133.493;-0.163452;0.233129
-136.508;-4.6953;4.5576
30.1932;-41.6148;3.01932
29.6964;-49.3633;3.01932
29.5144;-44.6062;3.01932
28.6931;-51.9315;3.01932
28.1284;-38.2686;3.01932
29.3325;-39.849;3.01932
26.9243;-36.6882;3.01932
23.9142;-34.7127;3.01932
28.3291;-32.9347;3.01932
20.904;-32.7372;3.01932
35.7541;-33.1323;3.01932
34.7507;-33.9225;3.01932
33.198;-36.0955;3.01932
33.7474;-34.7127;3.01932
32.6486;-37.4784;3.01932
32.4479;-39.2564;3.01932
32.4204;-43.2074;3.01932
32.2472;-41.0343;3.01932
32.5937;-45.3805;3.01932
31.5903;-49.134;3.01932
29.1383;-53.6936;3.01932
30.5869;-52.8874;3.01932
27.6897;-54.4997;3.01932
30.1932;-41.6148;1.51932
29.3565;-47.7727;1.85265
29.0681;-49.3523;1.70682
29.6841;-43.8583;1.70682
29.402;-50.6739;1.70682
28.7852;-51.9433;1.85265
30.3947;-50.6525;1.85265
31.241;-47.2542;1.70682
31.8636;-42.8093;1.70682
31.9347;-45.4889;1.85265
32.1436;-41.2305;1.85265
31.8842;-39.846;1.70682
32.4468;-37.4754;1.70682
32.492;-38.0697;1.85265
33.5038;-35.6771;1.85265
33.6114;-35.8456;1.70682
28.7951;-35.1047;1.70682
32.3268;-34.2723;1.85265
25.4145;-34.4479;1.85265
25.4839;-36.4382;1.70682
28.6446;-39.1052;1.70682
26.6855;-37.1039;1.85265
29.0874;-41.1041;1.85265
28.3291;-32.9347;2.26932
33.647;-33.2804;3.01932
33.647;-33.2804;2.26932
23.5128;-33.2804;2.26932
23.5128;-33.2804;3.01932
23.9142;-34.7127;2.26932
26.4728;-36.5894;2.26932
26.4728;-36.5894;3.01932
28.1284;-38.2686;2.26932
29.0769;-40.6432;2.26932
29.0769;-40.6432;3.01932
29.5144;-44.6062;2.26932
29.4001;-48.8161;2.26932
29.4001;-48.8161;3.01932
28.6931;-51.9315;2.26932
28.3027;-53.6561;2.26932
28.3027;-53.6561;3.01932
29.1383;-53.6936;2.26932
30.4756;-52.1506;2.26932
30.4756;-52.1506;3.01932
31.5903;-49.134;2.26932
32.2995;-45.7756;2.26932
32.2995;-45.7756;3.01932
32.4204;-43.2074;2.26932
32.3407;-41.1331;2.26932
32.3407;-41.1331;3.01932
32.4479;-39.2564;2.26932
32.7357;-37.5772;2.26932
32.7357;-37.5772;3.01932
33.198;-36.0955;2.26932
33.8609;-34.8608;2.26932
33.8609;-34.8608;3.01932
34.7507;-33.9225;2.26932
-171.17;-3.87517;3.77981
-170.346;30.2377;3.77981
-170.478;18.3798;3.77981
-172.797;29.9876;3.77981
-173.094;-4.07092;3.77981
-173.687;-7.24972;3.77981
-166.877;-3.87517;3.77981
-164.787;-7.70383;3.77981
-165.083;-2.70858;3.77981
-168.347;20.4512;3.77981
-169.882;30.4417;3.77981
-170.478;18.3798;1.27844
-169.882;30.4417;1.27844
-170.346;30.2377;1.27844
-168.347;20.4512;1.27844
-165.083;-2.70858;1.27844
-171.17;-3.87517;1.27844
-172.797;29.9876;1.27844
-173.094;-4.07092;1.27844
-173.687;-7.24972;1.27844
-166.877;-3.87517;1.27844
-164.787;-7.70383;1.27844
-173.094;-4.07092;3.77981
-173.687;-7.24972;1.27844
-173.094;-4.07092;1.27844
-173.687;-7.24972;3.77981
-173.687;-7.24972;3.77981
-164.787;-7.70383;1.27844
-173.687;-7.24972;1.27844
-164.787;-7.70383;3.77981
-164.787;-7.70383;3.77981
-165.083;-2.70858;1.27844
-164.787;-7.70383;1.27844
-165.083;-2.70858;3.77981
-165.083;-2.70858;3.77981
-168.347;20.4512;1.27844
-165.083;-2.70858;1.27844
-168.347;20.4512;3.77981
-168.347;20.4512;3.77981
-169.882;30.4417;1.27844
-168.347;20.4512;1.27844
-169.882;30.4417;3.77981
-169.882;30.4417;3.77981
-170.346;30.2377;1.27844
-169.882;30.4417;1.27844
-170.346;30.2377;3.77981
-170.346;30.2377;3.77981
-172.797;29.9876;1.27844
-170.346;30.2377;1.27844
-172.797;29.9876;3.77981
-172.797;29.9876;3.77981
-173.094;-4.07092;1.27844
-172.797;29.9876;1.27844
-173.094;-4.07092;3.77981
-170.478;18.3798;3.77981
-166.877;-3.87517;1.27844
-170.478;18.3798;1.27844
-166.877;-3.87517;3.77981
-166.877;-3.87517;3.77981
-171.17;-3.87517;1.27844
-166.877;-3.87517;1.27844
-171.17;-3.87517;3.77981
-171.17;-3.87517;3.77981
-170.478;18.3798;1.27844
-171.17;-3.87517;1.27844
-170.478;18.3798;3.77981
34.6304;-39.271;3.56757
33.6255;-59.6231;3.56757
33.9909;-51.4489;3.56757
13.5268;-58.789;3.56757
14.6231;-37.6028;3.56757
14.075;-48.7798;3.56757
11.8049;-29.656;3.56757
15.5149;-30.0733;3.56757
12.6076;-34.0201;3.56757
12.6076;-62.3865;3.56757
14.2577;-61.1245;3.56757
17.2725;-62.4591;3.56757
31.4329;-62.7927;3.56757
33.0767;-64.5685;3.56757
17.8252;-64.5685;3.56757
35.0835;-54.5312;3.56757
34.2808;-62.3865;3.56757
35.0835;-33.2655;3.56757
34.6304;-39.271;1.16757
35.0835;-54.5312;1.16757
35.0835;-33.2655;1.16757
33.0767;-64.5685;1.16757
34.2808;-62.3865;1.16757
12.6076;-62.3865;1.16757
17.8252;-64.5685;1.16757
11.8049;-29.656;1.16757
14.6231;-37.6028;1.16757
15.5149;-30.0733;1.16757
12.6076;-34.0201;1.16757
13.5268;-58.789;1.16757
14.075;-48.7798;1.16757
14.2577;-61.1245;1.16757
17.2725;-62.4591;1.16757
31.4329;-62.7927;1.16757
33.6255;-59.6231;1.16757
33.9909;-51.4489;1.16757
11.8049;-29.656;3.56757
12.6076;-34.0201;1.16757
11.8049;-29.656;1.16757
12.6076;-34.0201;3.56757
12.6076;-34.0201;3.56757
12.6076;-62.3865;1.16757
12.6076;-34.0201;1.16757
12.6076;-62.3865;3.56757
12.6076;-62.3865;3.56757
17.8252;-64.5685;1.16757
12.6076;-62.3865;1.16757
17.8252;-64.5685;3.56757
17.8252;-64.5685;3.56757
33.0767;-64.5685;1.16757
17.8252;-64.5685;1.16757
33.0767;-64.5685;3.56757
33.0767;-64.5685;3.56757
34.2808;-62.3865;1.16757
33.0767;-64.5685;1.16757
34.2808;-62.3865;3.56757
34.2808;-62.3865;3.56757
35.0835;-54.5312;1.16757
34.2808;-62.3865;1.16757
35.0835;-54.5312;3.56757
35.0835;-54.5312;3.56757
35.0835;-33.2655;1.16757
35.0835;-54.5312;1.16757
35.0835;-33.2655;3.56757
35.0835;-33.2655;3.56757
34.6304;-39.271;1.16757
35.0835;-33.2655;1.16757
34.6304;-39.271;3.56757
34.6304;-39.271;3.56757
33.9909;-51.4489;1.16757
34.6304;-39.271;1.16757
33.9909;-51.4489;3.56757
33.9909;-51.4489;3.56757
33.6255;-59.6231;1.16757
33.9909;-51.4489;1.16757
33.6255;-59.6231;3.56757
33.6255;-59.6231;3.56757
31.4329;-62.7927;1.16757
33.6255;-59.6231;1.16757
31.4329;-62.7927;3.56757
31.4329;-62.7927;3.56757
17.2725;-62.4591;1.16757
31.4329;-62.7927;1.16757
17.2725;-62.4591;3.56757
17.2725;-62.4591;3.56757
14.2577;-61.1245;1.16757
17.2725;-62.4591;1.16757
14.2577;-61.1245;3.56757
14.2577;-61.1245;3.56757
13.5268;-58.789;1.16757
14.2577;-61.1245;1.16757
13.5268;-58.789;3.56757
13.5268;-58.789;3.56757
14.075;-48.7798;1.16757
13.5268;-58.789;1.16757
14.075;-48.7798;3.56757
14.075;-48.7798;3.56757
14.6231;-37.6028;1.16757
14.075;-48.7798;1.16757
14.6231;-37.6028;3.56757
14.6231;-37.6028;3.56757
15.5149;-30.0733;1.16757
14.6231;-37.6028;1.16757
15.5149;-30.0733;3.56757
15.5149;-30.0733;3.56757
11.8049;-29.656;1.16757
15.5149;-30.0733;1.16757
11.8049;-29.656;3.56757
-185.167;-12.6782;7.84454
-168.084;-15.5681;7.52499
-185.202;-15.4838;7.52499
-168.05;-12.7624;7.84454
-168.05;-12.7624;6.27208
-150.957;-14.8197;6.04736
-168.074;-14.7354;6.04736
-150.933;-12.8467;6.27208
-133.84;-14.904;6.04736
-133.815;-12.931;6.27208
-116.722;-14.9883;6.04736
-116.698;-13.0152;6.27208
-99.6048;-15.0725;6.04736
-99.5805;-13.0995;6.27208
-99.5805;-13.0995;6.27208
-99.5805;-13.0995;2.54589
-99.6048;-15.0725;6.04736
-119.452;-14.4182;5.63396
-119.43;-12.6782;2.54589
-119.43;-12.6782;5.83215
-168.115;-18.0353;6.60489
-185.232;-17.951;6.60489
-150.978;-16.5547;5.40032
-168.096;-16.4705;5.40032
-133.861;-16.639;5.40032
-116.743;-16.7233;5.40032
-99.6261;-16.8076;5.40032
-99.5805;-13.0995;2.54589
-99.6261;-16.8076;5.40032
-119.471;-15.9484;5.06331
-119.43;-12.6782;2.54589
-168.137;-19.8665;5.19521
-185.255;-19.7822;5.19521
-150.994;-17.8425;4.40899
-168.111;-17.7583;4.40899
-133.877;-17.9268;4.40899
-116.759;-18.0111;4.40899
-99.6419;-18.0954;4.40899
-99.5805;-13.0995;2.54589
-99.6419;-18.0954;4.40899
-119.484;-17.0842;4.18902
-119.43;-12.6782;2.54589
-168.149;-20.8409;3.46599
-185.267;-20.7566;3.46599
-151.002;-18.5278;3.19293
-168.12;-18.4435;3.19293
-133.885;-18.612;3.19293
-116.768;-18.6963;3.19293
-99.6504;-18.7806;3.19293
-99.5805;-13.0995;2.54589
-99.6504;-18.7806;3.19293
-119.492;-17.6885;3.11654
-119.43;-12.6782;2.54589
-168.149;-20.8409;1.62579
-185.267;-20.7566;1.62579
-151.002;-18.5278;1.89884
-168.12;-18.4435;1.89884
-133.885;-18.612;1.89884
-116.768;-18.6963;1.89884
-99.6504;-18.7806;1.89884
-99.5805;-13.0995;2.54589
-99.6504;-18.7806;1.89884
-119.492;-17.6885;1.97524
-119.43;-12.6782;2.54589
-168.137;-19.8665;-0.103437
-185.255;-19.7822;-0.103437
-150.994;-17.8425;0.682793
-168.111;-17.7583;0.682793
-133.877;-17.9268;0.682793
-116.759;-18.0111;0.682793
-99.6419;-18.0954;0.682793
-99.5805;-13.0995;2.54589
-99.6419;-18.0954;0.682793
-119.484;-17.0842;0.902761
-119.43;-12.6782;2.54589
-168.115;-18.0353;-1.51311
-185.232;-17.951;-1.51311
-150.978;-16.5547;-0.308539
-168.096;-16.4705;-0.308539
-133.861;-16.639;-0.308539
-116.743;-16.7233;-0.308539
-99.6261;-16.8076;-0.308539
-99.5805;-13.0995;2.54589
-99.6261;-16.8076;-0.308539
-119.471;-15.9484;0.028471
-119.43;-12.6782;2.54589
-168.084;-15.5681;-2.43321
-185.202;-15.4838;-2.43321
-150.957;-14.8197;-0.955586
-168.074;-14.7354;-0.955586
-133.84;-14.904;-0.955586
-116.722;-14.9883;-0.955586
-99.6048;-15.0725;-0.955586
-99.5805;-13.0995;2.54589
-99.6048;-15.0725;-0.955586
-119.452;-14.4182;-0.542182
-119.43;-12.6782;2.54589
-168.05;-12.7624;-2.75276
-185.167;-12.6782;-2.75276
-150.933;-12.8467;-1.1803
-168.05;-12.7624;-1.1803
-133.815;-12.931;-1.1803
-116.698;-13.0152;-1.1803
-99.5805;-13.0995;-1.1803
-99.5805;-13.0995;2.54589
-99.5805;-13.0995;-1.1803
-119.43;-12.6782;-0.740367
-119.43;-12.6782;2.54589
-168.016;-9.9568;-2.43321
-185.133;-9.87253;-2.43321
-150.908;-10.8737;-0.955585
-168.026;-10.7894;-0.955585
-133.791;-10.958;-0.955585
-116.674;-11.0422;-0.955585
-99.5563;-11.1265;-0.955585
-99.5805;-13.0995;2.54589
-99.5563;-11.1265;-0.955585
-119.409;-10.9381;-0.542181
-119.43;-12.6782;2.54589
-167.985;-7.48958;-1.51311
-185.103;-7.4053;-1.51311
-150.887;-9.13865;-0.308538
-168.004;-9.05438;-0.308538
-133.77;-9.22293;-0.308538
-116.652;-9.3072;-0.308538
-99.5349;-9.39147;-0.308538
-99.5805;-13.0995;2.54589
-99.5349;-9.39147;-0.308538
-119.39;-9.4079;0.028472
-119.43;-12.6782;2.54589
-167.963;-5.65833;-0.103435
-185.08;-5.57406;-0.103435
-150.871;-7.85086;0.682795
-167.989;-7.76659;0.682795
-133.754;-7.93513;0.682795
-116.636;-8.01941;0.682795
-99.5191;-8.10368;0.682795
-99.5805;-13.0995;2.54589
-99.5191;-8.10368;0.682795
-119.376;-8.27215;0.902762
-119.43;-12.6782;2.54589
-167.951;-4.68395;1.62579
-185.068;-4.59968;1.62579
-150.863;-7.16564;1.89884
-167.98;-7.08137;1.89884
-133.745;-7.24992;1.89884
-116.628;-7.33419;1.89884
-99.5107;-7.41846;1.89884
-99.5805;-13.0995;2.54589
-99.5107;-7.41846;1.89884
-119.369;-7.66783;1.97524
-119.43;-12.6782;2.54589
-167.951;-4.68395;3.46599
-185.068;-4.59968;3.46599
-150.863;-7.16564;3.19294
-167.98;-7.08137;3.19294
-133.745;-7.24992;3.19294
-116.628;-7.33419;3.19294
-99.5107;-7.41846;3.19294
-99.5805;-13.0995;2.54589
-99.5107;-7.41846;3.19294
-119.369;-7.66783;3.11654
-119.43;-12.6782;2.54589
-167.963;-5.65834;5.19522
-185.08;-5.57406;5.19522
-150.871;-7.85086;4.40899
-167.989;-7.76659;4.40899
-133.754;-7.93514;4.40899
-116.636;-8.01941;4.40899
-99.5191;-8.10368;4.40899
-99.5805;-13.0995;2.54589
-99.5191;-8.10368;4.40899
-119.376;-8.27215;4.18902
-119.43;-12.6782;2.54589
-167.985;-7.48958;6.60489
-185.103;-7.4053;6.60489
-150.887;-9.13865;5.40032
-168.004;-9.05438;5.40032
-133.77;-9.22293;5.40032
-116.652;-9.3072;5.40032
-99.5349;-9.39147;5.40032
-99.5805;-13.0995;2.54589
-99.5349;-9.39147;5.40032
-99.5805;-13.0995;2.54589
-116.698;-13.0152;2.54589
-99.5805;-13.0995;2.54589
-116.698;-13.0152;2.54589
-133.815;-12.931;2.54589
-133.815;-12.931;2.54589
-150.933;-12.8467;2.54589
-150.933;-12.8467;2.54589
-168.05;-12.7624;2.54589
-168.05;-12.7624;2.54589
-168.08;-15.1968;2.54589
-185.197;-15.1126;2.54589
-168.08;-15.1968;2.54589
-185.197;-15.1125;2.54589
-119.43;-12.6782;2.54589
-119.39;-9.4079;5.06331
-119.43;-12.6782;2.54589
-168.016;-9.9568;7.52499
-185.133;-9.87253;7.52499
-150.908;-10.8737;6.04737
-168.026;-10.7894;6.04737
-133.791;-10.958;6.04737
-116.674;-11.0422;6.04737
-99.5563;-11.1265;6.04737
-99.5805;-13.0995;2.54589
-99.5563;-11.1265;6.04737
-116.698;-13.0152;2.54589
-99.5805;-13.0995;2.54589
-133.815;-12.931;2.54589
-150.933;-12.8467;2.54589
-168.05;-12.7624;2.54589
-185.197;-15.1126;2.54589
-168.08;-15.1968;2.54589
-119.409;-10.9381;5.63396
-119.43;-12.6782;2.54589
-168.05;-12.7624;7.84454
-185.167;-12.6782;7.84454
-150.933;-12.8467;6.27208
-168.05;-12.7624;6.27208
-133.815;-12.931;6.27208
-116.698;-13.0152;6.27208
-99.5805;-13.0995;6.27208
-99.5805;-13.0995;2.54589
-99.5805;-13.0995;6.27208
-116.698;-13.0152;2.54589
-99.5805;-13.0995;2.54589
-133.815;-12.931;2.54589
-150.933;-12.8467;2.54589
-168.05;-12.7624;2.54589
-185.197;-15.1125;2.54589
-168.08;-15.1968;2.54589
-119.43;-12.6782;5.83215
-119.43;-12.6782;2.54589
-185.192;-14.6512;6.04736
-185.167;-12.6782;7.84454
-185.202;-15.4838;7.52499
-185.167;-12.6782;6.27208
-185.167;-12.6782;6.27208
-185.133;-9.87253;7.52499
-185.167;-12.6782;7.84454
-185.143;-10.7051;6.04737
-185.103;-7.4053;6.60489
-185.122;-8.97011;5.40032
-185.08;-5.57406;5.19522
-185.08;-5.57406;5.19522
-185.106;-7.68231;4.40899
-185.068;-4.59968;3.46599
-185.098;-6.9971;3.19294
-185.068;-4.59968;1.62579
-185.098;-6.99709;1.89884
-185.08;-5.57406;-0.103435
-185.106;-7.68231;0.682795
-185.103;-7.4053;-1.51311
-185.122;-8.9701;-0.308538
-185.133;-9.87253;-2.43321
-185.143;-10.7051;-0.955585
-185.167;-12.6782;-2.75276
-185.167;-12.6782;-1.1803
-185.202;-15.4838;-2.43321
-185.192;-14.6512;-0.955586
-185.232;-17.951;-1.51311
-185.213;-16.3862;-0.308539
-185.255;-19.7822;-0.103437
-185.255;-19.7822;-0.103437
-185.229;-17.674;0.682793
-185.267;-20.7566;1.62579
-185.237;-18.3592;1.89884
-185.267;-20.7566;3.46599
-185.237;-18.3592;3.19293
-185.255;-19.7822;5.19521
-185.229;-17.674;4.40899
-185.232;-17.951;6.60489
-185.213;-16.3862;5.40032
-168.05;-12.7624;6.27208
-168.084;-15.5681;7.52499
-168.05;-12.7624;7.84454
-168.074;-14.7354;6.04736
-168.115;-18.0353;6.60489
-168.096;-16.4705;5.40032
-168.137;-19.8665;5.19521
-168.111;-17.7583;4.40899
-168.149;-20.8409;3.46599
-168.12;-18.4435;3.19293
-168.149;-20.8409;1.62579
-168.12;-18.4435;1.89884
-168.137;-19.8665;-0.103437
-168.111;-17.7583;0.682793
-168.115;-18.0353;-1.51311
-168.096;-16.4705;-0.308539
-168.084;-15.5681;-2.43321
-168.074;-14.7354;-0.955586
-168.05;-12.7624;-2.75276
-168.05;-12.7624;-1.1803
-168.016;-9.9568;-2.43321
-168.016;-9.9568;-2.43321
-168.05;-12.7624;-1.1803
-168.026;-10.7894;-0.955585
-167.985;-7.48958;-1.51311
-167.985;-7.48958;-1.51311
-168.026;-10.7894;-0.955585
-168.004;-9.05438;-0.308538
-167.963;-5.65833;-0.103435
-167.989;-7.76659;0.682795
-167.951;-4.68395;1.62579
-167.98;-7.08137;1.89884
-167.951;-4.68395;3.46599
-167.98;-7.08137;3.19294
-167.963;-5.65834;5.19522
-167.989;-7.76659;4.40899
-167.985;-7.48958;6.60489
-168.004;-9.05438;5.40032
-168.004;-9.05438;5.40032
-168.016;-9.9568;7.52499
-167.985;-7.48958;6.60489
-168.026;-10.7894;6.04737
-168.05;-12.7624;7.84454
-168.05;-12.7624;6.27208
-168.05;-12.7624;2.54589
-168.08;-15.1968;2.54589
-168.08;-15.1968;2.54589
-168.08;-15.1968;2.54589
-168.05;-12.7624;2.54589
-168.08;-15.1968;2.54589
-168.08;-15.1968;2.54589
-168.05;-12.7624;2.54589
-168.05;-12.7624;2.54589
-168.08;-15.1968;2.54589
-168.08;-15.1968;2.54589
-168.08;-15.1968;2.54589
-168.05;-12.7624;2.54589
-185.167;-12.6782;2.54589
-185.197;-15.1126;2.54589
-185.197;-15.1125;2.54589
-185.197;-15.1126;2.54589
-185.167;-12.6782;2.54589
-185.167;-12.6782;2.54589
-185.167;-12.6782;2.54589
-185.197;-15.1126;2.54589
-185.197;-15.1126;2.54589
-185.167;-12.6782;2.54589
-185.167;-12.6782;2.54589
-185.197;-15.1125;2.54589
-185.197;-15.1126;2.54589
-185.197;-15.1125;2.54589
-185.167;-12.6782;2.54589
-185.167;-12.6782;2.54589
-185.167;-12.6782;6.27208
-119.452;-14.4182;5.63396
-119.43;-12.6782;5.83215
-185.192;-14.6512;6.04736
-185.192;-14.6512;6.04736
-119.471;-15.9484;5.06331
-119.452;-14.4182;5.63396
-185.213;-16.3862;5.40032
-185.213;-16.3862;5.40032
-119.484;-17.0842;4.18902
-119.471;-15.9484;5.06331
-185.229;-17.674;4.40899
-185.229;-17.674;4.40899
-119.492;-17.6885;3.11654
-119.484;-17.0842;4.18902
-185.237;-18.3592;3.19293
-185.237;-18.3592;3.19293
-119.492;-17.6885;1.97524
-119.492;-17.6885;3.11654
-185.237;-18.3592;1.89884
-185.237;-18.3592;1.89884
-119.484;-17.0842;0.902761
-119.492;-17.6885;1.97524
-185.229;-17.674;0.682793
-185.229;-17.674;0.682793
-119.471;-15.9484;0.028471
-119.484;-17.0842;0.902761
-185.213;-16.3862;-0.308539
-185.213;-16.3862;-0.308539
-119.452;-14.4182;-0.542182
-119.471;-15.9484;0.028471
-185.192;-14.6512;-0.955586
-185.192;-14.6512;-0.955586
-119.43;-12.6782;-0.740367
-119.452;-14.4182;-0.542182
-185.167;-12.6782;-1.1803
-185.167;-12.6782;-1.1803
-119.409;-10.9381;-0.542181
-119.43;-12.6782;-0.740367
-185.143;-10.7051;-0.955585
-185.143;-10.7051;-0.955585
-119.39;-9.4079;0.028472
-119.409;-10.9381;-0.542181
-185.122;-8.9701;-0.308538
-185.122;-8.9701;-0.308538
-119.376;-8.27215;0.902762
-119.39;-9.4079;0.028472
-185.106;-7.68231;0.682795
-185.106;-7.68231;0.682795
-119.369;-7.66783;1.97524
-119.376;-8.27215;0.902762
-185.098;-6.99709;1.89884
-185.098;-6.99709;1.89884
-119.369;-7.66783;3.11654
-119.369;-7.66783;1.97524
-185.098;-6.9971;3.19294
-185.098;-6.9971;3.19294
-119.376;-8.27215;4.18902
-119.369;-7.66783;3.11654
-185.106;-7.68231;4.40899
-185.106;-7.68231;4.40899
-119.39;-9.4079;5.06331
-119.376;-8.27215;4.18902
-185.122;-8.97011;5.40032
-185.122;-8.97011;5.40032
-119.409;-10.9381;5.63396
-119.39;-9.4079;5.06331
-185.143;-10.7051;6.04737
-185.143;-10.7051;6.04737
-119.43;-12.6782;5.83215
-119.409;-10.9381;5.63396
-185.167;-12.6782;6.27208
-119.43;-12.6782;2.54589
-119.43;-12.6782;2.54589
-119.43;-12.6782;2.54589
-119.43;-12.6782;2.54589
-119.43;-12.6782;2.54589
-119.43;-12.6782;2.54589
}
:Normals
{
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0.311614;-0.950209;0
0.311614;-0.950209;0
0.311614;-0.950209;0
0.311614;-0.950209;0
-0.060014;0.998198;0
-0.060014;0.998197;0
-0.060014;0.998197;0
-0.060014;0.998197;0
-0.996878;-0.078956;0
-0.996878;-0.078956;0
-0.996878;-0.078956;0
-0.996878;-0.078956;0
0;1;-0
0;1;-0
0;1;-0
0;1;-0
0.127778;0.991803;-0
0.127778;0.991803;-0
0.127778;0.991803;-0
0.127778;0.991803;-0
-0.99775;-0.067052;0
-0.997749;-0.067052;0
-0.99775;-0.067052;0
-0.99775;-0.067052;0
0.09289;-0.995676;0
0.09289;-0.995676;0
0.09289;-0.995676;0
0.09289;-0.995676;0
0.976281;-0.216509;0
0.976281;-0.216509;0
0.976281;-0.216509;0
0.976281;-0.216509;0
0.937979;-0.346692;0
0.937979;-0.346692;0
0.937979;-0.346692;0
0.937979;-0.346692;0
0.832572;-0.553917;0
0.832572;-0.553917;0
0.832572;-0.553917;0
0.832572;-0.553917;0
0;0;-1
0;0;1
0.70567;0.029232;-0.707938
0.689615;-0.156306;0.707107
0.58585;0.383145;0.714128
0;0;1
0;0;1
0.564784;0.391035;-0.726712
0.00238;-0.706277;-0.707931
0;0;-1
0;0;-1
-0.521903;-0.074892;0.849711
-0.650479;0.273147;0.708708
0;0;1
0;0;-1
-0.702005;0.079963;-0.707669
-0.706777;0.003049;-0.70743
0;0;1
0;0;-1
-0.678461;0.195858;-0.708047
-0.264182;0.614647;-0.743248
0;0;-1
0;0;-1
0.071624;0.020268;0.997226
0.967443;-0.092642;-0.235522
0.822771;-0.135742;0.551925
0.663117;0.042038;0.747334
-0.019538;0.090147;0.995737
0.387844;0.153328;0.908883
-0.364048;0.151129;0.919037
-0.2746;0.094198;0.956933
-0.41366;0.016662;0.910279
-0.55334;0.059412;0.830834
-0.625701;-0.03193;0.779409
-0.450491;0.059976;0.890764
-0.674567;-0.355828;-0.646796
-0.798171;0.143997;0.584969
-0.638829;0.518523;-0.568359
-0.812534;0.436213;0.386661
0.007145;-0.134112;0.99094
-0.007281;-0.292584;0.956212
0.068596;-0.161958;0.984411
0.578245;0.687255;0.439674
0.81391;0.384592;-0.435476
0.470989;0.535748;-0.700817
0.852904;0.23525;0.466061
-0.002262;-0.803279;0.595598
-0.29159;-0.956543;0
-0.246958;-0.78921;0.56228
0.70219;-0.500082;0.5068
0.817949;-0.575291;0
0.776311;0.456376;0.434813
0.613587;0.738821;-0.278667
0.653851;0.756623;0
0.798789;0.586928;-0.132103
0.948359;0.281042;-0.147072
0.970138;0.242553;0
0.99322;0.003325;0.116205
0.973933;-0.132514;-0.184104
0.992177;-0.124836;0
0.976888;-0.19388;0.090001
0.669594;0.536672;0.513447
0.795059;0.606532;0
-0.315098;0.768072;0.557475
-0.724927;0.451384;0.52032
-0.86076;0.509012;0
-0.837434;0.25737;0.482146
-0.921021;0.122731;0.369672
-0.991872;0.127244;0
-0.927171;0.020749;0.374063
-0.967133;-0.02421;0.253115
-0.999957;0.009316;0
-0.9403;0.148607;0.306189
-0.94949;0.210363;0.232842
-0.972261;0.2339;0
-0.900011;0.435038;-0.026867
-0.744819;0.587336;-0.316672
-0.810493;0.585748;0
-0.861956;-0.16331;0.479959
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0.983022;-0.183486;-0
0.983022;-0.183486;-0
0.983022;-0.183486;-0
0.983022;-0.183486;-0
0.050957;0.998701;0
0.050957;0.998701;0
0.050957;0.998701;0
0.050957;0.998701;0
-0.998241;-0.059284;-0
-0.998241;-0.059284;-0
-0.998241;-0.059284;-0
-0.998241;-0.059284;-0
-0.990218;-0.139529;0
-0.990218;-0.139529;0
-0.990218;-0.139529;0
-0.990218;-0.139529;0
-0.988393;-0.151916;0
-0.988393;-0.151916;0
-0.988393;-0.151916;0
-0.988393;-0.151916;-0
0.402623;-0.915366;-1e-006
0.402623;-0.915366;-1e-006
0.402623;-0.915366;-1e-006
0.40262;-0.915367;0
0.10152;-0.994833;0
0.10152;-0.994833;0
0.10152;-0.994833;0
0.101521;-0.994833;-1e-006
0.999962;-0.00871;-0
0.999962;-0.00871;-0
0.999962;-0.00871;-0
0.999962;-0.00871;0
0.987162;0.159725;0
0.987162;0.159725;0
0.987162;0.159725;0
0.987162;0.159725;0
0;-1;-0
0;-1;-0
0;-1;-0
0;-1;-0
-0.999516;0.0311;0
-0.999516;0.0311;0
-0.999516;0.0311;0
-0.999516;0.0311;0
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0;0;1
0.983501;0.180902;0
0.983501;0.180902;0
0.983501;0.180902;0
0.983501;0.180902;0
1;0;0
1;0;0
1;0;0
1;0;0
0.385824;0.922572;0
0.385824;0.922572;0
0.385824;0.922572;0
0.385824;0.922572;0
0;1;0
0;1;0
0;1;0
0;1;0
-0.875546;0.483135;0
-0.875546;0.483135;0
-0.875546;0.483135;0
-0.875546;0.483135;0
-0.994819;0.101658;0
-0.994819;0.101658;0
-0.994819;0.101658;0
-0.994819;0.101658;0
-1;0;0
-1;0;0
-1;0;0
-1;0;0
0.997166;-0.075236;0
0.997166;-0.075236;0
0.997166;-0.075236;0
0.997166;-0.075236;0
0.998624;-0.052441;0
0.998624;-0.052441;0
0.998624;-0.052441;0
0.998624;-0.052441;0
0.999002;-0.044661;0
0.999002;-0.044661;0
0.999002;-0.044661;0
0.999002;-0.044661;0
0.822405;-0.568902;0
0.822405;-0.568902;0
0.822405;-0.568902;0
0.822405;-0.568902;0
-0.023555;-0.999722;0
-0.023555;-0.999723;0
-0.023555;-0.999723;0
-0.023555;-0.999723;0
-0.404784;-0.914412;0
-0.404784;-0.914412;0
-0.404784;-0.914412;0
-0.404784;-0.914412;0
-0.954361;-0.298655;0
-0.954361;-0.298655;0
-0.954361;-0.298655;0
-0.954361;-0.298655;0
-0.998504;0.054682;0
-0.998504;0.054682;0
-0.998504;0.054682;0
-0.998504;0.054682;0
-0.9988;0.048983;0
-0.9988;0.048983;0
-0.9988;0.048983;0
-0.9988;0.048983;0
-0.993058;0.117622;0
-0.993058;0.117622;0
-0.993058;0.117622;0
-0.993058;0.117622;0
-0.111778;-0.993733;0
-0.111778;-0.993733;0
-0.111778;-0.993733;0
-0.111778;-0.993733;0
3e-006;0.000531;-1
0.001145;0.232466;-0.972604
0.00115;0.233544;-0.972345
-3e-006;-0.000531;-1
3e-006;0.000531;-1
0.001147;0.233005;-0.972475
0.00115;0.233545;-0.972345
-0;0;-1
0.001147;0.233005;-0.972475
0;0;-1
0.001147;0.233005;-0.972475
0;0;-1
0.001145;0.232466;-0.972604
-3e-006;-0.000531;-1
-0.999924;0.012294;2e-006
-0.971827;0.157371;0.175462
-0.999924;0.012292;2e-006
0.999924;-0.012297;3e-006
0.964392;0.07085;0.254811
0.999924;-0.012296;1e-006
0.002386;0.484563;-0.874753
0.002391;0.485633;-0.87416
0.002388;0.485098;-0.874456
0.002391;0.485633;-0.87416
0.002388;0.485098;-0.874457
0.002388;0.485098;-0.874457
0.002386;0.484563;-0.874753
-0.971827;0.157371;0.175462
-0.999924;0.012294;4e-006
0.999924;-0.012295;4e-006
0.964392;0.07085;0.254811
0.003719;0.755362;-0.655297
0.003723;0.756165;-0.65437
0.003721;0.755764;-0.654834
0.003723;0.756165;-0.65437
0.003721;0.755764;-0.654833
0.003721;0.755764;-0.654834
0.003719;0.755363;-0.655297
-0.971827;0.157371;0.175462
-0.999924;0.012293;1e-006
0.999924;-0.012295;6e-006
0.964392;0.07085;0.254811
0.004762;0.967176;-0.254063
0.004762;0.967329;-0.253479
0.004762;0.967252;-0.253772
0.004762;0.967329;-0.253478
0.004762;0.967253;-0.253771
0.004762;0.967253;-0.253771
0.004762;0.967176;-0.254063
-0.971827;0.157371;0.175462
-0.999924;0.012292;-0
0.999924;-0.012295;3e-006
0.964392;0.07085;0.254811
0.004762;0.967176;0.254063
0.004762;0.967329;0.253479
0.004762;0.967253;0.253771
0.004762;0.967329;0.253479
0.004762;0.967253;0.253771
0.004762;0.967253;0.253771
0.004762;0.967176;0.254063
-0.971827;0.157371;0.175462
-0.999924;0.012292;0
0.999924;-0.012295;-3e-006
0.964392;0.07085;0.254811
0.003719;0.755362;0.655297
0.003723;0.756165;0.65437
0.003721;0.755764;0.654834
0.003723;0.756165;0.65437
0.003721;0.755764;0.654834
0.003721;0.755764;0.654834
0.003719;0.755363;0.655297
-0.971827;0.157371;0.175462
-0.999924;0.012293;-1e-006
0.999924;-0.012295;-6e-006
0.964392;0.07085;0.254811
0.002386;0.484563;0.874753
0.002391;0.485632;0.87416
0.002388;0.485098;0.874457
0.002391;0.485632;0.87416
0.002388;0.485098;0.874457
0.002388;0.485098;0.874457
0.002386;0.484563;0.874753
-0.971827;0.157371;0.175462
-0.999924;0.012294;-4e-006
0.999924;-0.012295;-4e-006
0.964392;0.07085;0.254811
0.001145;0.232466;0.972604
0.00115;0.233544;0.972345
0.001147;0.233005;0.972475
0.00115;0.233544;0.972345
0.001147;0.233005;0.972475
0.001147;0.233005;0.972475
0.001145;0.232466;0.972604
-0.971827;0.157371;0.175462
-0.999924;0.012292;-2e-006
0.999924;-0.012297;-3e-006
0.964392;0.07085;0.254811
-3e-006;-0.000531;1
3e-006;0.000531;1
-0;-0;1
3e-006;0.000531;1
-0;-0;1
-0;-0;1
-3e-006;-0.000531;1
-0.971827;0.157371;0.175462
-0.999924;0.012294;-2e-006
0.999924;-0.012296;-2e-006
0.964392;0.07085;0.254811
-0.00115;-0.233545;0.972345
-0.001144;-0.232466;0.972604
-0.001147;-0.233005;0.972475
-0.001144;-0.232466;0.972604
-0.001147;-0.233005;0.972475
-0.001147;-0.233006;0.972475
-0.00115;-0.233545;0.972345
-0.971827;0.157371;0.175462
-0.999924;0.012295;-2e-006
0.999924;-0.012293;-2e-006
0.964392;0.07085;0.254811
-0.002391;-0.485633;0.87416
-0.002386;-0.484564;0.874753
-0.002388;-0.485098;0.874457
-0.002386;-0.484564;0.874753
-0.002388;-0.485098;0.874457
-0.002388;-0.485098;0.874456
-0.002391;-0.485633;0.87416
-0.971827;0.157371;0.175462
-0.999924;0.012295;-3e-006
0.999924;-0.012295;-4e-006
0.964392;0.07085;0.254811
-0.003723;-0.756165;0.65437
-0.003719;-0.755363;0.655296
-0.003721;-0.755764;0.654834
-0.003719;-0.755363;0.655296
-0.003721;-0.755764;0.654834
-0.003721;-0.755764;0.654834
-0.003723;-0.756166;0.65437
-0.971827;0.157371;0.175462
-0.999924;0.012296;1e-006
0.999924;-0.012293;1e-006
0.964392;0.07085;0.254811
-0.004762;-0.967329;0.253478
-0.004762;-0.967176;0.254063
-0.004762;-0.967253;0.253771
-0.004762;-0.967176;0.254063
-0.004762;-0.967253;0.253771
-0.004762;-0.967253;0.253771
-0.004762;-0.967329;0.253478
-0.971827;0.157371;0.175462
-0.999924;0.012297;1e-006
0.999924;-0.012292;2e-006
0.964392;0.07085;0.254811
-0.004762;-0.967329;-0.253479
-0.004762;-0.967176;-0.254064
-0.004762;-0.967252;-0.253772
-0.004762;-0.967176;-0.254064
-0.004762;-0.967252;-0.253772
-0.004762;-0.967252;-0.253771
-0.004762;-0.967329;-0.253479
-0.971827;0.157371;0.175462
-0.999924;0.012297;-1e-006
0.999924;-0.012292;-2e-006
0.964392;0.07085;0.254811
-0.003723;-0.756165;-0.654371
-0.003719;-0.755362;-0.655297
-0.003721;-0.755763;-0.654834
-0.003719;-0.755363;-0.655297
-0.003721;-0.755763;-0.654834
-0.003721;-0.755764;-0.654834
-0.003723;-0.756165;-0.65437
-0.971827;0.157371;0.175462
-0.999924;0.012296;-1e-006
0.999924;-0.012293;-1e-006
0.964392;0.07085;0.254811
-0.002391;-0.485632;-0.87416
-0.002386;-0.484563;-0.874753
-0.002388;-0.485098;-0.874457
-0.002386;-0.484563;-0.874753
-0.002388;-0.485097;-0.874457
-0.002388;-0.485097;-0.874457
-0.002391;-0.485632;-0.87416
-0.337521;-0.324971;0.883444
-0.999924;0.012294;1e-006
0;0;1
0;0;1
0;0;1
0;0;-1
0;0;1
0;0;1
0;0;1
0;0;-1
0;0;1
0;0;-1
-0.000399;-0.081373;0.996684
-0.000399;-0.081054;0.99671
-0.00041;-0.08321;0.996532
0.00041;0.083847;-0.996479
0.964392;0.07085;0.254811
0.999924;-0.012295;3e-006
0.408627;-0.559965;0.720738
-0.00115;-0.233544;-0.972345
-0.001145;-0.232466;-0.972604
-0.001147;-0.233005;-0.972475
-0.001144;-0.232466;-0.972604
-0.001147;-0.233005;-0.972475
-0.001147;-0.233005;-0.972475
-0.00115;-0.233544;-0.972346
0.025057;0.870858;-0.490896
-0.999923;0.012394;-5.4e-005
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0.000399;0.08105;-0.99671
0.00041;0.083209;-0.996532
0.999924;-0.012294;0
0.086752;0.99623;0
-3e-006;-0.000531;-1
3e-006;0.000531;-1
-0;0;-1
3e-006;0.000531;-1
0;0;-1
0;0;-1
-3e-006;-0.000531;-1
-0.971827;0.157371;0.175462
-0.999924;0.012294;2e-006
0;0;-1
0;0;1
0;0;1
0;0;-1
0;0;-1
0.00041;0.083847;-0.996479
-0.000399;-0.081373;0.996684
0.999924;-0.012296;1e-006
0.964392;0.07085;0.254811
0.999924;-0.012296;0
0.999924;-0.012296;0
0.999924;-0.012296;0
0.999924;-0.012296;0
0.999924;-0.012296;0
0.999924;-0.012296;0
0.999924;-0.012296;0
0.999924;-0.012296;-0
0.999924;-0.012294;-1e-006
0.999924;-0.012294;-1e-006
0.999924;-0.012292;-4e-006
0.999925;-0.012292;8e-006
0.999924;-0.012292;8e-006
0.999924;-0.012289;2e-006
0.999924;-0.012289;1e-006
0.999924;-0.012289;-0
0.999924;-0.012289;-0
0.999924;-0.012289;-2e-006
0.999924;-0.012289;-1e-006
0.999924;-0.012289;-1e-006
0.999924;-0.012297;-2e-006
0.999924;-0.012294;1e-006
0.999924;-0.012294;1e-006
0.999924;-0.012296;0
0.999924;-0.012296;0
0.999924;-0.012296;0
0.999924;-0.012296;-0
0.999924;-0.012294;-1e-006
0.999924;-0.012294;-1e-006
0.999924;-0.012292;-4e-006
0.999924;-0.012292;8e-006
0.999924;-0.012292;8e-006
0.999924;-0.012289;2e-006
0.999924;-0.012289;1e-006
0.999924;-0.012289;0
0.999924;-0.012289;0
0.999925;-0.012289;-2e-006
0.999924;-0.012289;-1e-006
0.999924;-0.012289;-1e-006
0.999924;-0.012297;-2e-006
-0.999924;0.012296;0
-0.999924;0.012296;0
-0.999924;0.012296;0
-0.999924;0.012296;-0
-0.999924;0.012294;-1e-006
-0.999924;0.012294;-1e-006
-0.999924;0.012297;2e-006
-0.999924;0.012297;2e-006
-0.999924;0.012295;-2e-006
-0.999924;0.012295;-2e-006
-0.999924;0.012296;0
-0.999924;0.012296;0
-0.999924;0.012295;2e-006
-0.999924;0.012295;2e-006
-0.999924;0.012296;-2e-006
-0.999924;0.012297;-2e-006
-0.999924;0.012294;1e-006
-0.999924;0.012294;1e-006
-0.999924;0.012296;0
-0.999924;0.012296;0
-0.999924;0.01229;0
-0.999924;0.012295;1e-005
-0.999924;0.012295;1e-005
-0.999924;0.012295;1e-005
-0.999924;0.012296;1e-005
-0.999924;0.012294;-1e-006
-0.999924;0.012294;-1e-006
-0.999925;0.012294;-1e-006
-0.999924;0.012292;-4e-006
-0.999924;0.012293;-8e-006
-0.999924;0.012295;-2e-006
-0.999924;0.012295;-2e-006
-0.999924;0.012296;0
-0.999924;0.012296;0
-0.999924;0.012295;2e-006
-0.999924;0.012295;2e-006
-0.999924;0.012294;6e-006
-0.999924;0.012291;6e-006
-0.999924;0.012299;-4e-006
-0.999924;0.012299;-4e-006
-0.999924;0.012299;-4e-006
-0.999924;0.012291;-7e-006
-0.999924;0.01229;-7e-006
-0.999924;0.012296;0
-0.989234;0.012153;-0.145836
-0.989234;0.012153;-0.145836
-0.989234;0.012153;-0.145836
0;0;-1
1;0;0
1;0;0
1;0;0
1;0;0
0.989213;-0.012165;0.145982
0.989212;-0.012165;0.145982
0.989213;-0.012165;0.145982
0;0;1
0;0;1
-0.015659;0.000192;0.999877
-0.015659;0.000192;0.999877
-0.015659;0.000192;0.999877
0;0;-1
0;0;-1
0;0;-1
1;0;0
1;0;0
1;0;0
1;0;0
0.015659;-0.000192;-0.999877
0.015659;-0.000192;-0.999877
0.015659;-0.000192;-0.999877
0;0;1
0;0;1
0;0;1
0.006649;-0.113242;0.993545
0.006649;-0.113242;0.993545
0.006649;-0.113242;0.993545
0.006649;-0.113242;0.993545
0.00713;-0.34949;0.936913
0.00713;-0.34949;0.936913
0.00713;-0.34949;0.936913
0.00713;-0.349491;0.936913
0.008124;-0.610033;0.792334
0.008124;-0.610033;0.792334
0.008124;-0.610033;0.792334
0.008124;-0.610033;0.792334
0.009458;-0.8712;0.490838
0.009458;-0.8712;0.490838
0.009458;-0.8712;0.490838
0.009458;-0.8712;0.490838
0.010202;-0.999948;0
0.010202;-0.999948;0
0.010202;-0.999948;0
0.010202;-0.999948;0
0.009458;-0.871199;-0.490838
0.009458;-0.871199;-0.490838
0.009458;-0.871199;-0.490838
0.009458;-0.8712;-0.490838
0.008124;-0.610033;-0.792334
0.008124;-0.610033;-0.792334
0.008124;-0.610033;-0.792334
0.008124;-0.610033;-0.792334
0.00713;-0.34949;-0.936913
0.00713;-0.34949;-0.936913
0.00713;-0.34949;-0.936913
0.00713;-0.34949;-0.936913
0.006649;-0.113242;-0.993545
0.006649;-0.113242;-0.993545
0.006649;-0.113242;-0.993545
0.006649;-0.113242;-0.993545
0.006649;0.113081;-0.993564
0.006649;0.113081;-0.993564
0.006649;0.113081;-0.993564
0.006649;0.113081;-0.993564
0.007131;0.349336;-0.93697
0.007131;0.349336;-0.93697
0.007131;0.349336;-0.93697
0.007131;0.349336;-0.93697
0.008125;0.609908;-0.792431
0.008125;0.609908;-0.792431
0.008125;0.609908;-0.792431
0.008125;0.609908;-0.792431
0.00946;0.871143;-0.490937
0.00946;0.871143;-0.490937
0.00946;0.871144;-0.490937
0.00946;0.871143;-0.490937
0.010204;0.999948;1e-006
0.010204;0.999948;1e-006
0.010204;0.999948;1e-006
0.010204;0.999948;1e-006
0.00946;0.871144;0.490937
0.00946;0.871144;0.490937
0.00946;0.871143;0.490937
0.00946;0.871143;0.490938
0.008125;0.609907;0.792431
0.008125;0.609907;0.792431
0.008125;0.609907;0.792431
0.008125;0.609908;0.792431
0.007131;0.349336;0.93697
0.007131;0.349336;0.93697
0.007131;0.349336;0.93697
0.007131;0.349336;0.93697
0.006649;0.11308;0.993564
0.006649;0.11308;0.993564
0.006649;0.11308;0.993564
0.006649;0.11308;0.993564
0;0;1
0;0;1
1;0;0
1;0;0
0;0;-1
0;0;-1
}
:TexCoords
{
0.167;0.659415
0.024285;0.00049901
0.000499;0.701926
0.714072;0.128031
0.868679;0.914479
0.642714;0.95699
0.999501;0.999501
0.797322;0.701926
0.654607;0.659415
0.74975;0.446861
0.357286;0.95699
0.131321;0.914479
0.0005;0.999501
0.202678;0.701926
0.345393;0.659415
0.25025;0.446862
0.285928;0.128031
0.833;0.659415
0.975715;0.000500023
0.999501;0.701926
0.868679;0.9995
0.999501;0.00049901
0.868679;0.00049901
0.999501;0.9995
0.0005;0.9995
0.357286;0.00049901
0.0005;0.00049901
0.357286;0.9995
0.04301;0.9995
0.340585;0.00049901
0.04301;0.00049901
0.340585;0.9995
0.345393;0.9995
0.833;0.00049901
0.345393;0.00049901
0.833;0.9995
0.833;0.9995
0.999501;0.00049901
0.833;0.00049901
0.999501;0.9995
0.298074;0.9995
0.9995;0.00049901
0.298074;0.00049901
0.9995;0.9995
0.024285;0.9995
0.714072;0.00049901
0.024285;0.00049901
0.714072;0.9995
0.128031;0.9995
0.446862;0.00049901
0.128031;0.00049901
0.446862;0.9995
0.446862;0.9995
0.701926;0.00049901
0.446862;0.00049901
0.701926;0.9995
0.797322;0.9995
0.868679;0.00049901
0.797322;0.00049901
0.868679;0.9995
0.313404;1.15182
-0.183304;9.02293
-0.365301;4.19051
-1.18669;11.6317
-1.75137;-2.24733
-0.547298;-0.641911
-2.95543;-3.85275
-5.9656;-5.85953
-1.55069;-7.66563
-8.97577;-7.86631
5.87439;-7.46495
4.871;-6.66224
3.31822;-4.45479
3.86761;-5.85953
2.76882;-3.05004
2.56814;-1.24394
2.54069;2.76961
2.36747;0.562157
2.71391;4.97707
1.71052;8.78995
-0.741474;13.4217
0.707134;12.6028
-2.19008;14.2406
0.313404;1.15182
-0.523243;7.40716
-0.811669;9.01176
-0.195625;3.43084
-0.477755;10.3542
-1.09458;11.6437
0.51498;10.3325
1.36124;6.88041
1.98387;2.36516
2.05498;5.08718
2.26387;0.761461
2.00446;-0.645001
2.56701;-3.05313
2.61224;-2.44938
3.62403;-4.87981
3.7316;-4.70873
-1.08467;-5.46127
2.44701;-6.30686
-4.46522;-6.12848
-4.39585;-4.10669
-1.23517;-1.39754
-3.19426;-3.43048
-0.792355;0.63306
-1.55069;-7.66563
3.76727;-7.31444
3.76727;-7.31444
-6.36696;-7.31444
-6.36696;-7.31444
-5.9656;-5.85953
-3.40696;-3.95309
-3.40696;-3.95309
-1.75137;-2.24733
-0.802816;0.16484
-0.802816;0.16484
-0.365301;4.19051
-0.47965;8.46703
-0.47965;8.46703
-1.18669;11.6317
-1.57708;13.3836
-1.57708;13.3836
-0.741474;13.4217
0.595829;11.8543
0.595829;11.8543
1.71052;8.78995
2.41976;5.37842
2.41976;5.37842
2.54069;2.76961
2.46094;0.662496
2.46094;0.662496
2.56814;-1.24394
2.856;-2.9497
2.856;-2.9497
3.31822;-4.45479
3.98111;-5.70902
3.98111;-5.70902
4.871;-6.66224
0.717029;0.899231
0.624527;0.00584298
0.6393;0.316391
0.8996;0.012393
0.932901;0.904357
0.9995;0.987608
0.235114;0.899231
0.0005;0.999501
0.033799;0.868679
0.400099;0.262143
0.572458;0.000500023
0.3607;0.316391
0.427542;0.00049901
0.375473;0.00584298
0.599901;0.262143
0.966201;0.868679
0.282971;0.899231
0.1004;0.012393
0.067099;0.904357
0.0005;0.987608
0.764886;0.899231
0.9995;0.9995
0.904357;0.9995
0.987608;0.00049901
0.904357;0.00049901
0.987608;0.9995
0.0005;0.9995
0.9995;0.00049901
0.0005;0.00049901
0.9995;0.9995
0.0005;0.9995
0.131321;0.00049901
0.0005;0.00049901
0.131321;0.9995
0.131321;0.9995
0.737857;0.00049901
0.131321;0.00049901
0.737857;0.9995
0.737857;0.9995
0.999501;0.00049901
0.737857;0.00049901
0.999501;0.9995
0.572458;0.9995
0.624527;0.00049901
0.572458;0.00049901
0.624527;0.9995
0.624527;0.9995
0.8996;0.00049901
0.624527;0.00049901
0.8996;0.9995
0.012393;0.9995
0.904357;0.00049901
0.012393;0.00049901
0.904357;0.9995
0.316391;0.9995
0.899231;0.00049901
0.316391;0.00049901
0.899231;0.9995
0.235114;0.9995
0.717029;0.00049901
0.235114;0.00049901
0.717029;0.9995
0.100769;0.9995
0.683609;0.00049901
0.100769;0.00049901
0.683609;0.9995
10.5842;-9.37213
9.57923;9.34535
9.94466;1.82767
-10.5194;8.57824
-9.42312;-10.9064
-9.97127;-0.627081
-12.2413;-18.2149
-8.5313;-17.8311
-11.4386;-14.2013
-11.4386;11.8868
-9.78855;10.7261
-6.77376;11.9535
7.38665;12.2604
9.0305;13.8935
-6.22101;13.8935
11.0373;4.66237
10.2346;11.8868
11.0373;-14.8953
10.5842;-9.37213
11.0373;4.66237
11.0373;-14.8953
9.0305;13.8935
10.2346;11.8868
-11.4386;11.8868
-6.22101;13.8935
-12.2413;-18.2149
-9.42312;-10.9064
-8.5313;-17.8311
-11.4386;-14.2013
-10.5194;8.57824
-9.97127;-0.627081
-9.78855;10.7261
-6.77376;11.9535
7.38665;12.2604
9.57923;9.34535
9.94466;1.82767
-12.2413;-18.2149
-11.4386;-14.2013
-12.2413;-18.2149
-11.4386;-14.2013
-11.4386;-14.2013
-11.4386;11.8868
-11.4386;-14.2013
-11.4386;11.8868
-11.4386;11.8868
-6.22101;13.8935
-11.4386;11.8868
-6.22101;13.8935
-6.22101;13.8935
9.0305;13.8935
-6.22101;13.8935
9.0305;13.8935
9.0305;13.8935
10.2346;11.8868
9.0305;13.8935
10.2346;11.8868
10.2346;11.8868
11.0373;4.66237
10.2346;11.8868
11.0373;4.66237
11.0373;4.66237
11.0373;-14.8953
11.0373;4.66237
11.0373;-14.8953
11.0373;-14.8953
10.5842;-9.37213
11.0373;-14.8953
10.5842;-9.37213
10.5842;-9.37213
9.94466;1.82767
10.5842;-9.37213
9.94466;1.82767
9.94466;1.82767
9.57923;9.34535
9.94466;1.82767
9.57923;9.34535
9.57923;9.34535
7.38665;12.2604
9.57923;9.34535
7.38665;12.2604
7.38665;12.2604
-6.77376;11.9535
7.38665;12.2604
-6.77376;11.9535
-6.77376;11.9535
-9.78855;10.7261
-6.77376;11.9535
-9.78855;10.7261
-9.78855;10.7261
-10.5194;8.57824
-9.78855;10.7261
-10.5194;8.57824
-10.5194;8.57824
-9.97127;-0.627081
-10.5194;8.57824
-9.97127;-0.627081
-9.97127;-0.627081
-9.42312;-10.9064
-9.97127;-0.627081
-9.42312;-10.9064
-9.42312;-10.9064
-8.5313;-17.8311
-9.42312;-10.9064
-8.5313;-17.8311
-8.5313;-17.8311
-12.2413;-18.2149
-8.5313;-17.8311
-12.2413;-18.2149
0;1
0.083333;0.944444
0;0.944444
0.083333;1
0.083333;1
0.166667;0.944444
0.083333;0.944444
0.166667;1
0.25;0.944444
0.25;1
0.333333;0.944444
0.333333;1
0.416667;0.944444
0.416667;1
0.416667;1
0.5;0.944444
0.416667;0.944444
1;0.944444
0.916667;1
1;1
0.083333;0.888889
0;0.888889
0.166667;0.888889
0.083333;0.888889
0.25;0.888889
0.333333;0.888889
0.416667;0.888889
0.5;0.888889
0.416667;0.888889
1;0.888889
0.916667;0.944444
0.083333;0.833333
0;0.833333
0.166667;0.833333
0.083333;0.833333
0.25;0.833333
0.333333;0.833333
0.416667;0.833333
0.5;0.833333
0.416667;0.833333
1;0.833333
0.916667;0.888889
0.083333;0.777778
0;0.777778
0.166667;0.777778
0.083333;0.777778
0.25;0.777778
0.333333;0.777778
0.416667;0.777778
0.5;0.777778
0.416667;0.777778
1;0.777778
0.916667;0.833333
0.083333;0.722222
0;0.722222
0.166667;0.722222
0.083333;0.722222
0.25;0.722222
0.333333;0.722222
0.416667;0.722222
0.5;0.722222
0.416667;0.722222
1;0.722222
0.916667;0.777778
0.083333;0.666667
0;0.666667
0.166667;0.666667
0.083333;0.666667
0.25;0.666667
0.333333;0.666667
0.416667;0.666667
0.5;0.666667
0.416667;0.666667
1;0.666667
0.916667;0.722222
0.083333;0.611111
0;0.611111
0.166667;0.611111
0.083333;0.611111
0.25;0.611111
0.333333;0.611111
0.416667;0.611111
0.5;0.611111
0.416667;0.611111
1;0.611111
0.916667;0.666667
0.083333;0.555556
0;0.555556
0.166667;0.555556
0.083333;0.555556
0.25;0.555556
0.333333;0.555556
0.416667;0.555556
0.5;0.555556
0.416667;0.555556
1;0.555556
0.916667;0.611111
0.083333;0.5
0;0.5
0.166667;0.5
0.083333;0.5
0.25;0.5
0.333333;0.5
0.416667;0.5
0.5;0.5
0.416667;0.5
1;0.5
0.916667;0.555556
0.083333;0.444444
0;0.444444
0.166667;0.444444
0.083333;0.444444
0.25;0.444444
0.333333;0.444444
0.416667;0.444444
0.5;0.444444
0.416667;0.444444
1;0.444444
0.916667;0.5
0.083333;0.388889
0;0.388889
0.166667;0.388889
0.083333;0.388889
0.25;0.388889
0.333333;0.388889
0.416667;0.388889
0.5;0.388889
0.416667;0.388889
1;0.388889
0.916667;0.444444
0.083333;0.333333
0;0.333333
0.166667;0.333333
0.083333;0.333333
0.25;0.333333
0.333333;0.333333
0.416667;0.333333
0.5;0.333333
0.416667;0.333333
1;0.333333
0.916667;0.388889
0.083333;0.277778
0;0.277778
0.166667;0.277778
0.083333;0.277778
0.25;0.277778
0.333333;0.277778
0.416667;0.277778
0.5;0.277778
0.416667;0.277778
1;0.277778
0.916667;0.333333
0.083333;0.222222
0;0.222222
0.166667;0.222222
0.083333;0.222222
0.25;0.222222
0.333333;0.222222
0.416667;0.222222
0.5;0.222222
0.416667;0.222222
1;0.222222
0.916667;0.277778
0.083333;0.166667
0;0.166667
0.166667;0.166667
0.083333;0.166667
0.25;0.166667
0.333333;0.166667
0.416667;0.166667
0.5;0.166667
0.416667;0.166667
1;0.166667
0.916667;0.222222
0.083333;0.111111
0;0.111111
0.166667;0.111111
0.083333;0.111111
0.25;0.111111
0.333333;0.111111
0.416667;0.111111
0.5;0.111111
0.416667;0.111111
0.5;0.166667
0.583333;0.111111
0.5;0.111111
0.583333;0.166667
0.666667;0.111111
0.666667;0.166667
0.75;0.111111
0.75;0.166667
0.833333;0.111111
0.833333;0.166667
0.833333;0.166667
0.916667;0.111111
0.833333;0.111111
0.916667;0.166667
0.916667;0.166667
1;0.111111
0.916667;0.111111
0.083333;0.055556
0;0.055556
0.166667;0.055556
0.083333;0.055556
0.25;0.055556
0.333333;0.055556
0.416667;0.055556
0.5;0.055556
0.416667;0.055556
0.583333;0.055556
0.5;0.055556
0.666667;0.055556
0.75;0.055556
0.833333;0.055556
0.916667;0.055556
0.833333;0.055556
1;0.055556
0.916667;0.055556
0.083333;0
0;0
0.166667;0
0.083333;0
0.25;0
0.333333;0
0.416667;0
0.5;0
0.416667;0
0.583333;0
0.5;0
0.666667;0
0.75;0
0.833333;0
0.916667;0
0.833333;0
1;0
0.916667;0
1;0.944444
0;1
0;0.944444
1;1
1;0
0;0.055556
0;0
1;0.055556
0;0.111111
1;0.111111
0;0.166667
0;0.166667
1;0.166667
0;0.222222
1;0.222222
0;0.277778
1;0.277778
0;0.333333
1;0.333333
0;0.388889
1;0.388889
0;0.444444
1;0.444444
0;0.5
1;0.5
0;0.555556
1;0.555556
0;0.611111
1;0.611111
0;0.666667
0;0.666667
1;0.666667
0;0.722222
1;0.722222
0;0.777778
1;0.777778
0;0.833333
1;0.833333
0;0.888889
1;0.888889
0.083333;1
0.083333;0.944444
0.083333;1
0.083333;0.944444
0.083333;0.888889
0.083333;0.888889
0.083333;0.833333
0.083333;0.833333
0.083333;0.777778
0.083333;0.777778
0.083333;0.722222
0.083333;0.722222
0.083333;0.666667
0.083333;0.666667
0.083333;0.611111
0.083333;0.611111
0.083333;0.555556
0.083333;0.555556
0.083333;0.5
0.083333;0.5
0.083333;0.444444
0.083333;0.444444
0.083333;0.5
0.083333;0.444444
0.083333;0.388889
0.083333;0.388889
0.083333;0.444444
0.083333;0.388889
0.083333;0.333333
0.083333;0.333333
0.083333;0.277778
0.083333;0.277778
0.083333;0.222222
0.083333;0.222222
0.083333;0.166667
0.083333;0.166667
0.083333;0.111111
0.083333;0.111111
0.083333;0.111111
0.083333;0.055556
0.083333;0.111111
0.083333;0.055556
0.083333;0
0.083333;0
0.833333;0
0.833333;0.055556
0.833333;0
0.833333;0.055556
0.833333;0.055556
0.833333;0.111111
0.833333;0.055556
0.833333;0.111111
0.833333;0.111111
0.833333;0.166667
0.833333;0.111111
0.833333;0.166667
0.833333;0.166667
0.916667;0.166667
0.916667;0.111111
0.916667;0.166667
0.916667;0.111111
0.916667;0.166667
0.916667;0.111111
0.916667;0.111111
0.916667;0.055556
0.916667;0.111111
0.916667;0.055556
0.916667;0.055556
0.916667;0
0.916667;0.055556
0.916667;0
0.916667;0.055556
0.916667;0
1;1
1;0.944444
1;1
1;0.944444
1;0.944444
1;0.888889
1;0.944444
1;0.888889
1;0.888889
1;0.833333
1;0.888889
1;0.833333
1;0.833333
1;0.777778
1;0.833333
1;0.777778
1;0.777778
1;0.722222
1;0.777778
1;0.722222
1;0.722222
1;0.666667
1;0.722222
1;0.666667
1;0.666667
1;0.611111
1;0.666667
1;0.611111
1;0.611111
1;0.555556
1;0.611111
1;0.555556
1;0.555556
1;0.5
1;0.555556
1;0.5
1;0.5
1;0.444444
1;0.5
1;0.444444
1;0.444444
1;0.388889
1;0.444444
1;0.388889
1;0.388889
1;0.333333
1;0.388889
1;0.333333
1;0.333333
1;0.277778
1;0.333333
1;0.277778
1;0.277778
1;0.222222
1;0.277778
1;0.222222
1;0.222222
1;0.166667
1;0.222222
1;0.166667
1;0.166667
1;0.111111
1;0.166667
1;0.111111
1;0.111111
1;0.055556
1;0.111111
1;0.055556
1;0.055556
1;0
1;0.055556
1;0
0.916667;0.055556
0.916667;0
0.916667;0.111111
0.916667;0.055556
0.916667;0.166667
0.916667;0.111111
}
}
:Mesh
{
:Name=slider
:Matrix=1;0;0;0;0;1;0;0;0;0;1;0;3e-006;-5e-006;0;1
:MatIndex=4
:VertexCount=4
:IndexCount=6
:Indices
{
0;1;2;1;0;3;
}
:Positions
{
-8.10563;-25.7346;7.95678
-37.8144;-13.2318;7.95678
-7.64475;-16.3154;7.95678
-38.2287;-23.8544;7.95678
}
:Normals
{
0;0;-1
0;0;-1
0;0;-1
0;0;-1
}
:TexCoords
{
0.418314;0.756392
0.196733;0.600608
0.421752;0.63903
0.193643;0.732966
}
:Animation
{
:Length=1
:TicksPerSec=1
:Name=combinedAnim_0
:Positions
{
:Count=31
3e-006;-5e-006;0
0
30.3541;-0.074791;0.256701
0.033333
14.9991;-0.03696;0.126845
0.066667
-0.355986;0.000872;-0.003011
0.1
0.956943;-0.002363;0.008093
0.133333
4.41747;-0.010889;0.037358
0.166667
9.30906;-0.022941;0.078726
0.2
14.916;-0.036755;0.126143
0.233333
20.5229;-0.050569;0.17356
0.266667
25.4145;-0.062621;0.214927
0.3
28.875;-0.071147;0.244193
0.333333
30.188;-0.074382;0.255296
0.366667
0.166134;-0.000414;0.001405
0.4
0.166134;-0.000414;0.001405
0.433333
0.166134;-0.000414;0.001405
0.466667
0.166134;-0.000414;0.001405
0.5
0.166134;-0.000414;0.001405
0.533333
0.166134;-0.000414;0.001405
0.566667
0.166134;-0.000414;0.001405
0.6
0.166134;-0.000414;0.001405
0.633333
0.166134;-0.000414;0.001405
0.666667
0.166134;-0.000414;0.001405
0.7
0.166134;-0.000414;0.001405
0.733333
0.166134;-0.000414;0.001405
0.766667
0.166134;-0.000414;0.001405
0.8
0.166134;-0.000414;0.001405
0.833333
0.166134;-0.000414;0.001405
0.866667
0.166134;-0.000414;0.001405
0.9
0.166134;-0.000414;0.001405
0.933333
0.166134;-0.000414;0.001405
0.966667
0.166134;-0.000414;0.001405
1
}
:Rotations
{
:Count=31
0;0;0;1
0
0;0;0;1
0.033333
0;0;0;1
0.066667
0;0;0;1
0.1
0;0;0;1
0.133333
0;0;0;1
0.166667
0;0;0;1
0.2
0;0;0;1
0.233333
0;0;0;1
0.266667
0;0;0;1
0.3
0;0;0;1
0.333333
0;0;0;1
0.366667
0;0;0;1
0.4
0;0;0;1
0.433333
0;0;0;1
0.466667
0;0;0;1
0.5
0;0;0;1
0.533333
0;0;0;1
0.566667
0;0;0;1
0.6
0;0;0;1
0.633333
0;0;0;1
0.666667
0;0;0;1
0.7
0;0;0;1
0.733333
0;0;0;1
0.766667
0;0;0;1
0.8
0;0;0;1
0.833333
0;0;0;1
0.866667
0;0;0;1
0.9
0;0;0;1
0.933333
0;0;0;1
0.966667
0;0;0;1
1
}
:Scaling
{
:Count=31
1;1;1
0
1;1;1
0.033333
1;1;1
0.066667
1;1;1
0.1
1;1;1
0.133333
1;1;1
0.166667
1;1;1
0.2
1;1;1
0.233333
1;1;1
0.266667
1;1;1
0.3
1;1;1
0.333333
1;1;1
0.366667
1;1;1
0.4
1;1;1
0.433333
1;1;1
0.466667
1;1;1
0.5
1;1;1
0.533333
1;1;1
0.566667
1;1;1
0.6
1;1;1
0.633333
1;1;1
0.666667
1;1;1
0.7
1;1;1
0.733333
1;1;1
0.766667
1;1;1
0.8
1;1;1
0.833333
1;1;1
0.866667
1;1;1
0.9
1;1;1
0.933333
1;1;1
0.966667
1;1;1
1
}
}
}
:Mesh
{
:Name=Case
:Matrix=-3.28114;5.10649;388.804;0;-26.327;-709.502;9.09631;0;-388.569;14.3739;-3.46794;0;-9.45607;-20.4735;4.92625;1
:MatIndex=1
:VertexCount=69
:IndexCount=168
:Indices
{
0;1;2;0;3;4;0;5;3;0;6;5;0;7;6;0;8;7;0;9;8;0;2;9;10;11;12;10;13;11;14;15;16;14;17;15;17;18;15;17;19;18;19;20;18;19;21;20;21;22;20;21;23;22;23;24;22;23;25;24;25;26;24;25;27;26;27;12;26;27;10;12;12;28;29;12;11;28;16;30;31;16;15;30;15;32;30;15;18;32;18;33;32;18;20;33;20;34;33;20;22;34;22;35;34;22;24;35;24;36;35;24;26;36;26;29;36;26;12;29;37;38;39;37;39;40;41;42;43;41;43;44;45;46;47;45;47;48;49;50;51;49;51;52;53;54;55;53;55;56;57;58;59;57;59;60;61;62;63;61;63;64;65;66;67;65;67;68;
}
:Positions
{
0;0;0
0.003536;0.003536;0
0.005;0;0
-0;0.005;0
0.003536;0.003536;0
-0.003536;0.003536;0
-0.005;-0;0
-0.003536;-0.003536;0
0;-0.005;0
0.003536;-0.003536;0
0.005;0;0.027643
0.002622;0.002622;0.033171
0.003708;0;0.033171
0.003536;0.003536;0.027643
0.003536;0.003536;0.027643
-0;0.003708;0.033171
0.002622;0.002622;0.033171
-0;0.005;0.027643
-0.002622;0.002622;0.033171
-0.003536;0.003536;0.027643
-0.003708;-0;0.033171
-0.005;-0;0.027643
-0.002622;-0.002622;0.033171
-0.003536;-0.003536;0.027643
0;-0.003708;0.033171
0;-0.005;0.027643
0.002622;-0.002622;0.033171
0.003536;-0.003536;0.027643
0.002251;0.002251;0.0387
0.003183;0;0.0387
-0;0.003183;0.0387
0.002251;0.002251;0.0387
-0.002251;0.002251;0.0387
-0.003183;-0;0.0387
-0.002251;-0.002251;0.0387
0;-0.003183;0.0387
0.002251;-0.002251;0.0387
-0.005;-0;0.027643
-0.005;-0;0
-0.003536;-0.003536;0
-0.003536;-0.003536;0.027643
-0.003536;-0.003536;0.027643
-0.003536;-0.003536;0
0;-0.005;0
0;-0.005;0.027643
0;-0.005;0.027643
0;-0.005;0
0.003536;-0.003536;0
0.003536;-0.003536;0.027643
0.003536;-0.003536;0.027643
0.003536;-0.003536;0
0.005;0;0
0.005;0;0.027643
0.005;0;0.027643
0.005;0;0
0.003536;0.003536;0
0.003536;0.003536;0.027643
0.003536;0.003536;0.027643
0.003536;0.003536;0
-0;0.005;0
-0;0.005;0.027643
-0;0.005;0.027643
-0;0.005;0
-0.003536;0.003536;0
-0.003536;0.003536;0.027643
-0.003536;0.003536;0.027643
-0.003536;0.003536;0
-0.005;-0;0
-0.005;-0;0.027643
}
:Normals
{
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0.973778;0;0.227501
0.697522;0.697522;0.164093
0.986445;0;0.164093
0.688565;0.688565;0.227501
0.688565;0.688565;0.227501
-0;0.986445;0.164093
0.697522;0.697522;0.164093
-0;0.973778;0.227501
-0.697522;0.697522;0.164093
-0.688565;0.688565;0.227501
-0.986445;-0;0.164093
-0.973778;-0;0.227501
-0.697522;-0.697522;0.164093
-0.688565;-0.688565;0.227501
-0;-0.986445;0.164093
-0;-0.973778;0.227501
0.697522;-0.697522;0.164093
0.688565;-0.688565;0.227501
0.703936;0.703936;0.094595
0.995516;-0;0.094595
0;0.995516;0.094595
0.703936;0.703936;0.094595
-0.703936;0.703936;0.094595
-0.995516;-0;0.094595
-0.703936;-0.703936;0.094595
-0;-0.995516;0.094595
0.703936;-0.703936;0.094595
-0.923879;-0.382684;0
-0.923879;-0.382684;0
-0.923879;-0.382684;0
-0.923879;-0.382684;0
-0.382683;-0.92388;0
-0.382683;-0.92388;0
-0.382683;-0.92388;0
-0.382683;-0.92388;0
0.382683;-0.92388;0
0.382683;-0.92388;0
0.382683;-0.92388;0
0.382683;-0.92388;0
0.92388;-0.382683;0
0.92388;-0.382683;0
0.92388;-0.382683;0
0.92388;-0.382683;0
0.92388;0.382683;0
0.92388;0.382683;0
0.92388;0.382683;0
0.92388;0.382683;0
0.382683;0.92388;0
0.382683;0.92388;0
0.382683;0.92388;0
0.382683;0.92388;0
-0.382683;0.92388;0
-0.382683;0.92388;0
-0.382683;0.92388;0
-0.382683;0.92388;0
-0.92388;0.382683;0
-0.92388;0.382683;0
-0.92388;0.382683;0
-0.92388;0.382683;0
}
:TexCoords
{
0.5;1
0.875;1
0.75;1
0;1
-0.125;1
0.125;1
0.25;1
0.375;1
0.5;1
0.625;1
0.75;0.285714
0.875;0.142857
0.75;0.142857
0.875;0.285714
-0.125;0.285714
0;0.142857
-0.125;0.142857
0;0.285714
0.125;0.142857
0.125;0.285714
0.25;0.142857
0.25;0.285714
0.375;0.142857
0.375;0.285714
0.5;0.142857
0.5;0.285714
0.625;0.142857
0.625;0.285714
0.875;0
0.75;0
0;0
-0.125;0
0.125;0
0.25;0
0.375;0
0.5;0
0.625;0
0.25;0.285714
0.25;1
0.375;1
0.375;0.285714
0.375;0.285714
0.375;1
0.5;1
0.5;0.285714
0.5;0.285714
0.5;1
0.625;1
0.625;0.285714
0.625;0.285714
0.625;1
0.75;1
0.75;0.285714
0.75;0.285714
0.75;1
0.875;1
0.875;0.285714
0.875;0.285714
0.875;1
0;1
0;0.285714
0;0.285714
0;1
0.125;1
0.125;0.285714
0.125;0.285714
0.125;1
0.25;1
0.25;0.285714
}
:Animation
{
:Length=1
:TicksPerSec=1
:Name=combinedAnim_0
:Positions
{
:Count=31
-9.45607;-20.4735;4.92625
0
-9.46652;-20.466;6.07241
0.033333
-9.49795;-20.4136;9.64314
0.066667
-9.55049;-20.2717;15.8383
0.1
-9.62429;-19.9954;24.86
0.133333
-9.71765;-18.0207;36.4811
0.166667
-9.82611;-13.167;50.0084
0.2
-9.94573;-5.96346;64.9478
0.233333
-10.0726;3.06098;80.8058
0.266667
-10.2028;13.3779;97.089
0.3
-10.3323;24.4593;113.304
0.333333
-10.4574;35.777;128.959
0.366667
-10.5739;46.8032;143.559
0.4
-10.6781;57.0099;156.612
0.433333
-10.766;65.8689;167.625
0.466667
-10.8337;72.8519;176.103
0.5
-10.8771;77.4299;181.553
0.533333
-10.8925;79.0736;183.48
0.566667
-9.45607;-20.4735;4.92625
0.6
-9.45607;-20.4735;4.92625
0.633333
-9.45607;-20.4735;4.92625
0.666667
-9.45607;-20.4735;4.92625
0.7
-9.45607;-20.4735;4.92625
0.733333
-9.45607;-20.4735;4.92625
0.766667
-9.45607;-20.4735;4.92625
0.8
-9.45607;-20.4735;4.92625
0.833333
-9.45607;-20.4735;4.92625
0.866667
-9.45607;-20.4735;4.92625
0.9
-9.45607;-20.4735;4.92625
0.933333
-9.45607;-20.4735;4.92625
0.966667
-9.45607;-20.4735;4.92625
1
}
:Rotations
{
:Count=31
0.00850463;0.703895;-0.0176787;0.710033
0
0.00520814;0.699744;-0.0209197;0.714069
0.033333
-0.00341344;0.676197;-0.0294053;0.736126
0.066667
-0.0017974;0.614445;-0.0275311;0.788477
0.1
0.0113035;0.498973;-0.013756;0.866435
0.133333
0.0136974;0.322712;-0.00966906;0.946349
0.166667
0.0179698;0.100814;-0.0022569;0.99474
0.2
0.0230406;-0.151214;0.00755262;0.988204
0.233333
0.0274125;-0.40881;0.0180836;0.912028
0.266667
0.0296589;-0.643043;0.027399;0.764765
0.3
0.0289029;-0.827737;0.0338917;0.559345
0.333333
0.0250927;-0.94641;0.0367482;0.319886
0.366667
0.0189622;-0.996331;0.0361082;0.0752437
0.4
-0.0117274;0.988347;-0.0328921;0.148158
0.433333
-0.00468632;0.943022;-0.0284269;0.33148
0.466667
0.00109117;0.884994;-0.0240585;0.464979
0.5
0.00487928;0.837639;-0.0208951;0.545803
0.533333
0.00622175;0.8191;-0.0197193;0.573279
0.566667
0.00850463;0.703895;-0.0176787;0.710033
0.6
0.00850463;0.703895;-0.0176787;0.710033
0.633333
0.00850463;0.703895;-0.0176787;0.710033
0.666667
0.00850463;0.703895;-0.0176787;0.710033
0.7
0.00850463;0.703895;-0.0176787;0.710033
0.733333
0.00850463;0.703895;-0.0176787;0.710033
0.766667
0.00850463;0.703895;-0.0176787;0.710033
0.8
0.00850463;0.703895;-0.0176787;0.710033
0.833333
0.00850463;0.703895;-0.0176787;0.710033
0.866667
0.00850463;0.703895;-0.0176787;0.710033
0.9
0.00850463;0.703895;-0.0176787;0.710033
0.933333
0.00850463;0.703895;-0.0176787;0.710033
0.966667
0.00850463;0.703895;-0.0176787;0.710033
1
}
:Scaling
{
:Count=31
-388.851;-710.049;-388.85
0
-388.851;-710.049;-388.85
0.033333
-388.851;-710.049;-388.85
0.066667
-388.851;-710.049;-388.85
0.1
-388.851;-710.049;-388.85
0.133333
-388.851;-710.049;-388.85
0.166667
-388.851;-710.049;-388.85
0.2
-388.851;-710.049;-388.85
0.233333
-388.851;-710.049;-388.85
0.266667
-388.851;-710.049;-388.85
0.3
-388.851;-710.049;-388.85
0.333333
-388.851;-710.049;-388.85
0.366667
-388.851;-710.049;-388.85
0.4
-388.851;-710.049;-388.85
0.433333
-388.851;-710.049;-388.85
0.466667
-388.851;-710.049;-388.85
0.5
-388.851;-710.049;-388.85
0.533333
-388.851;-710.049;-388.85
0.566667
-388.851;-710.049;-388.85
0.6
-388.851;-710.049;-388.85
0.633333
-388.851;-710.049;-388.85
0.666667
-388.851;-710.049;-388.85
0.7
-388.851;-710.049;-388.85
0.733333
-388.851;-710.049;-388.85
0.766667
-388.851;-710.049;-388.85
0.8
-388.851;-710.049;-388.85
0.833333
-388.851;-710.049;-388.85
0.866667
-388.851;-710.049;-388.85
0.9
-388.851;-710.049;-388.85
0.933333
-388.851;-710.049;-388.85
0.966667
-388.851;-710.049;-388.85
1
}
}
}
:Mesh
{
:Name=Case001
:Matrix=-3.28114;5.10649;388.804;0;-26.327;-709.502;9.09631;0;-388.569;14.3739;-3.46794;0;7.85428;-20.5161;5.07264;1
:MatIndex=1
:VertexCount=69
:IndexCount=168
:Indices
{
0;1;2;0;3;4;0;5;3;0;6;5;0;7;6;0;8;7;0;9;8;0;2;9;10;11;12;10;13;11;14;15;16;14;17;15;17;18;15;17;19;18;19;20;18;19;21;20;21;22;20;21;23;22;23;24;22;23;25;24;25;26;24;25;27;26;27;12;26;27;10;12;12;28;29;12;11;28;16;30;31;16;15;30;15;32;30;15;18;32;18;33;32;18;20;33;20;34;33;20;22;34;22;35;34;22;24;35;24;36;35;24;26;36;26;29;36;26;12;29;37;38;39;37;39;40;41;42;43;41;43;44;45;46;47;45;47;48;49;50;51;49;51;52;53;54;55;53;55;56;57;58;59;57;59;60;61;62;63;61;63;64;65;66;67;65;67;68;
}
:Positions
{
0;0;0
0.003536;0.003536;0
0.005;0;0
-0;0.005;0
0.003536;0.003536;0
-0.003536;0.003536;0
-0.005;-0;0
-0.003536;-0.003536;0
0;-0.005;0
0.003536;-0.003536;0
0.005;0;0.027643
0.002622;0.002622;0.033171
0.003708;0;0.033171
0.003536;0.003536;0.027643
0.003536;0.003536;0.027643
-0;0.003708;0.033171
0.002622;0.002622;0.033171
-0;0.005;0.027643
-0.002622;0.002622;0.033171
-0.003536;0.003536;0.027643
-0.003708;-0;0.033171
-0.005;-0;0.027643
-0.002622;-0.002622;0.033171
-0.003536;-0.003536;0.027643
0;-0.003708;0.033171
0;-0.005;0.027643
0.002622;-0.002622;0.033171
0.003536;-0.003536;0.027643
0.002251;0.002251;0.0387
0.003183;0;0.0387
-0;0.003183;0.0387
0.002251;0.002251;0.0387
-0.002251;0.002251;0.0387
-0.003183;-0;0.0387
-0.002251;-0.002251;0.0387
0;-0.003183;0.0387
0.002251;-0.002251;0.0387
-0.005;-0;0.027643
-0.005;-0;0
-0.003536;-0.003536;0
-0.003536;-0.003536;0.027643
-0.003536;-0.003536;0.027643
-0.003536;-0.003536;0
0;-0.005;0
0;-0.005;0.027643
0;-0.005;0.027643
0;-0.005;0
0.003536;-0.003536;0
0.003536;-0.003536;0.027643
0.003536;-0.003536;0.027643
0.003536;-0.003536;0
0.005;0;0
0.005;0;0.027643
0.005;0;0.027643
0.005;0;0
0.003536;0.003536;0
0.003536;0.003536;0.027643
0.003536;0.003536;0.027643
0.003536;0.003536;0
-0;0.005;0
-0;0.005;0.027643
-0;0.005;0.027643
-0;0.005;0
-0.003536;0.003536;0
-0.003536;0.003536;0.027643
-0.003536;0.003536;0.027643
-0.003536;0.003536;0
-0.005;-0;0
-0.005;-0;0.027643
}
:Normals
{
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0;0;-1
0.973778;0;0.227501
0.697522;0.697522;0.164093
0.986445;0;0.164093
0.688565;0.688565;0.227501
0.688565;0.688565;0.227501
-0;0.986445;0.164093
0.697522;0.697522;0.164093
-0;0.973778;0.227501
-0.697522;0.697522;0.164093
-0.688565;0.688565;0.227501
-0.986445;-0;0.164093
-0.973778;-0;0.227501
-0.697522;-0.697522;0.164093
-0.688565;-0.688565;0.227501
-0;-0.986445;0.164093
-0;-0.973778;0.227501
0.697522;-0.697522;0.164093
0.688565;-0.688565;0.227501
0.703936;0.703936;0.094595
0.995516;-0;0.094595
0;0.995516;0.094595
0.703936;0.703936;0.094595
-0.703936;0.703936;0.094595
-0.995516;-0;0.094595
-0.703936;-0.703936;0.094595
-0;-0.995516;0.094595
0.703936;-0.703936;0.094595
-0.923879;-0.382684;0
-0.923879;-0.382684;0
-0.923879;-0.382684;0
-0.923879;-0.382684;0
-0.382683;-0.92388;0
-0.382683;-0.92388;0
-0.382683;-0.92388;0
-0.382683;-0.92388;0
0.382683;-0.92388;0
0.382683;-0.92388;0
0.382683;-0.92388;0
0.382683;-0.92388;0
0.92388;-0.382683;0
0.92388;-0.382683;0
0.92388;-0.382683;0
0.92388;-0.382683;0
0.92388;0.382683;0
0.92388;0.382683;0
0.92388;0.382683;0
0.92388;0.382683;0
0.382683;0.92388;0
0.382683;0.92388;0
0.382683;0.92388;0
0.382683;0.92388;0
-0.382683;0.92388;0
-0.382683;0.92388;0
-0.382683;0.92388;0
-0.382683;0.92388;0
-0.92388;0.382683;0
-0.92388;0.382683;0
-0.92388;0.382683;0
-0.92388;0.382683;0
}
:TexCoords
{
0.5;1
0.875;1
0.75;1
0;1
-0.125;1
0.125;1
0.25;1
0.375;1
0.5;1
0.625;1
0.75;0.285714
0.875;0.142857
0.75;0.142857
0.875;0.285714
-0.125;0.285714
0;0.142857
-0.125;0.142857
0;0.285714
0.125;0.142857
0.125;0.285714
0.25;0.142857
0.25;0.285714
0.375;0.142857
0.375;0.285714
0.5;0.142857
0.5;0.285714
0.625;0.142857
0.625;0.285714
0.875;0
0.75;0
0;0
-0.125;0
0.125;0
0.25;0
0.375;0
0.5;0
0.625;0
0.25;0.285714
0.25;1
0.375;1
0.375;0.285714
0.375;0.285714
0.375;1
0.5;1
0.5;0.285714
0.5;0.285714
0.5;1
0.625;1
0.625;0.285714
0.625;0.285714
0.625;1
0.75;1
0.75;0.285714
0.75;0.285714
0.75;1
0.875;1
0.875;0.285714
0.875;0.285714
0.875;1
0;1
0;0.285714
0;0.285714
0;1
0.125;1
0.125;0.285714
0.125;0.285714
0.125;1
0.25;1
0.25;0.285714
}
:Animation
{
:Length=1
:TicksPerSec=1
:Name=combinedAnim_0
:Positions
{
:Count=31
7.85428;-20.5161;5.07264
0
4.13046;-20.5069;5.04115
0.033333
-4.05952;-20.4868;4.97188
0.066667
-12.2495;-20.4666;4.90262
0.1
-15.9733;-20.4574;4.87113
0.133333
-15.9733;-20.4574;4.87113
0.166667
-15.9733;-20.4574;4.87113
0.2
-15.9733;-20.4574;4.87113
0.233333
-15.9733;-20.4574;4.87113
0.266667
-15.9733;-20.4574;4.87113
0.3
-15.9733;-20.4574;4.87113
0.333333
-15.9733;-20.4574;4.87113
0.366667
-15.9733;-20.4574;4.87113
0.4
-15.9733;-20.4574;4.87113
0.433333
-15.9733;-20.4574;4.87113
0.466667
-15.9733;-20.4574;4.87113
0.5
-15.9733;-20.4574;4.87113
0.533333
-15.9733;-20.4574;4.87113
0.566667
-15.9733;-20.4574;4.87113
0.6
-16.1071;-20.0772;20.7232
0.633333
-16.253;-16.5164;38.8119
0.666667
-16.4176;-8.82416;59.2554
0.7
-16.5929;1.93684;81.0501
0.733333
-16.7709;14.7051;103.193
0.766667
-16.9435;28.4197;124.681
0.8
-17.1028;42.0204;144.513
0.833333
-17.2407;54.4466;161.686
0.866667
-17.3491;64.6376;175.196
0.9
-17.42;71.5317;184.039
0.933333
-17.4455;74.0662;187.211
0.966667
7.85428;-20.5161;5.07264
1
}
:Rotations
{
:Count=31
0.00850463;0.703895;-0.0176787;0.710033
0
0.00850463;0.703895;-0.0176787;0.710033
0.033333
0.00850463;0.703895;-0.0176787;0.710033
0.066667
0.00850463;0.703895;-0.0176787;0.710033
0.1
0.00850463;0.703895;-0.0176787;0.710033
0.133333
0.00850463;0.703895;-0.0176787;0.710033
0.166667
0.00850463;0.703895;-0.0176787;0.710033
0.2
0.00850463;0.703895;-0.0176787;0.710033
0.233333
0.00850463;0.703895;-0.0176787;0.710033
0.266667
0.00850463;0.703895;-0.0176787;0.710033
0.3
0.00850463;0.703895;-0.0176787;0.710033
0.333333
0.00850463;0.703895;-0.0176787;0.710033
0.366667
0.00850463;0.703895;-0.0176787;0.710033
0.4
0.00850463;0.703895;-0.0176787;0.710033
0.433333
0.00850463;0.703895;-0.0176787;0.710033
0.466667
0.00850463;0.703895;-0.0176787;0.710033
0.5
0.00850463;0.703895;-0.0176787;0.710033
0.533333
0.00850463;0.703895;-0.0176787;0.710033
0.566667
0.00850463;0.703895;-0.0176787;0.710033
0.6
0.011999;0.430857;-0.0123978;0.902255
0.633333
0.0144;0.169939;-0.0068799;0.985325
0.666667
0.0176499;-0.135251;0.00181181;0.990653
0.7
0.0199885;-0.443537;0.0115781;0.895958
0.733333
0.0199739;-0.707907;0.0200143;0.70574
0.766667
0.0171377;-0.892216;0.0253902;0.450568
0.8
0.0121207;-0.983973;0.0272435;0.175809
0.833333
-0.00626418;0.996879;-0.026324;0.0741876
0.866667
-0.000989458;0.963136;-0.0240562;0.267936
0.9
0.00263413;0.920816;-0.0219191;0.389372
0.933333
0.00394763;0.90191;-0.0210394;0.431393
0.966667
0.00850463;0.703895;-0.0176787;0.710033
1
}
:Scaling
{
:Count=31
-388.851;-710.049;-388.85
0
-388.851;-710.049;-388.85
0.033333
-388.851;-710.049;-388.85
0.066667
-388.851;-710.049;-388.85
0.1
-388.851;-710.049;-388.85
0.133333
-388.851;-710.049;-388.85
0.166667
-388.851;-710.049;-388.85
0.2
-388.851;-710.049;-388.85
0.233333
-388.851;-710.049;-388.85
0.266667
-388.851;-710.049;-388.85
0.3
-388.851;-710.049;-388.85
0.333333
-388.851;-710.049;-388.85
0.366667
-388.851;-710.049;-388.85
0.4
-388.851;-710.049;-388.85
0.433333
-388.851;-710.049;-388.85
0.466667
-388.851;-710.049;-388.85
0.5
-388.851;-710.049;-388.85
0.533333
-388.851;-710.049;-388.85
0.566667
-388.851;-710.049;-388.85
0.6
-388.851;-710.049;-388.85
0.633333
-388.851;-710.049;-388.85
0.666667
-388.851;-710.049;-388.85
0.7
-388.851;-710.049;-388.85
0.733333
-388.851;-710.049;-388.85
0.766667
-388.851;-710.049;-388.85
0.8
-388.851;-710.049;-388.85
0.833333
-388.851;-710.049;-388.85
0.866667
-388.851;-710.049;-388.85
0.9
-388.851;-710.049;-388.85
0.933333
-388.851;-710.049;-388.85
0.966667
-388.851;-710.049;-388.85
1
}
}
}
:Dummy
{
:Name=DirPoint2
:Matrix=0.772445;0.123234;91.3417;0;91.3342;-1.20054;-0.770761;0;1.19945;91.3372;-0.133371;0;0.594134;8.46861;22.1237;1
}
:Dummy
{
:Name=DirPoint1
:Matrix=0.772445;0.123234;91.3417;0;91.3342;-1.20054;-0.770761;0;1.19945;91.3372;-0.133371;0;0.873806;8.51323;55.195;1
}
}
:Connections
{
0;1;1;1;1;1;1;1;1;1;2;3;4;5;6;7;8;9;10;2;3;4;5;6;7;8;9;10;2;3;4;5;6;7;8;9;10;1;1;
}
| [
"erik.repo@hotmail.com"
] | erik.repo@hotmail.com |
b1352a0f4d2240795c005228e62c760cfe397ece | 496b95ce18228acd29ab48586e12694b740fed42 | /microsim/MSVehicleType.cpp | 68bb31612b39a4add2baf64646d29d6ccfcf52ac | [] | no_license | pratik101agrawal/Indian_traffic_control | 11fb0de64e09ab9c658ce6db9f48a364ce98e4f5 | 6de2c6880edc853cce7efacebcb10fce475ba8c1 | refs/heads/master | 2022-12-25T09:43:40.295535 | 2020-09-30T18:57:57 | 2020-09-30T18:57:57 | 300,026,534 | 1 | 0 | null | 2020-09-30T18:56:37 | 2020-09-30T18:56:36 | null | UTF-8 | C++ | false | false | 7,498 | cpp | /****************************************************************************/
/// @file MSVehicleType.cpp
/// @author Christian Roessel
/// @date Tue, 06 Mar 2001
/// @version $Id: MSVehicleType.cpp 8697 2010-04-30 06:34:23Z dkrajzew $
///
// The car-following model and parameter
/****************************************************************************/
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
// Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
/****************************************************************************/
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
/****************************************************************************/
// ===========================================================================
// included modules
// ===========================================================================
#ifdef _MSC_VER
#include <windows_config.h>
#else
#include <config.h>
#endif
#include "MSVehicleType.h"
#include "MSNet.h"
#include "cfmodels/MSCFModel_IDM.h"
#include "cfmodels/MSCFModel_Kerner.h"
#include "cfmodels/MSCFModel_Krauss.h"
#include "cfmodels/MSCFModel_KraussOrig1.h"
#include "cfmodels/MSCFModel_PWag2009.h"
#include "cfmodels/MSCFModel_IITBNN.h"
#include <cassert>
#include <utils/iodevices/BinaryInputDevice.h>
#include <utils/common/FileHelpers.h>
#include <utils/common/RandHelper.h>
#include <utils/common/SUMOVTypeParameter.h>
#ifdef CHECK_MEMORY_LEAKS
#include <foreign/nvwa/debug_new.h>
#endif // CHECK_MEMORY_LEAKS
// ===========================================================================
// method definitions
// ===========================================================================
MSVehicleType::MSVehicleType(const std::string &id, SUMOReal length, size_t stripWidth,
SUMOReal maxSpeed, SUMOReal prob,
SUMOReal speedFactor, SUMOReal speedDev,
SUMOVehicleClass vclass,
SUMOEmissionClass emissionClass,
SUMOVehicleShape shape,
SUMOReal guiWidth, SUMOReal guiOffset,
int cfModel, const std::string &lcModel,
const RGBColor &c) throw()
: myID(id), myLength(length), myStripWidth(stripWidth), myMaxSpeed(maxSpeed),
myDefaultProbability(prob), mySpeedFactor(speedFactor),
mySpeedDev(speedDev), myVehicleClass(vclass),
myLaneChangeModel(lcModel),
myEmissionClass(emissionClass), myColor(c),
myWidth(guiWidth), myOffset(guiOffset), myShape(shape) {
assert(myLength > 0);
assert(getMaxSpeed() > 0);
}
MSVehicleType::~MSVehicleType() throw() {}
void
MSVehicleType::saveState(std::ostream &os) {
FileHelpers::writeString(os, myID);
FileHelpers::writeFloat(os, myLength);
FileHelpers::writeFloat(os, getMaxSpeed());
FileHelpers::writeInt(os, (int) myVehicleClass);
FileHelpers::writeInt(os, (int) myEmissionClass);
FileHelpers::writeInt(os, (int) myShape);
FileHelpers::writeFloat(os, myWidth);
FileHelpers::writeFloat(os, myOffset);
FileHelpers::writeFloat(os, myDefaultProbability);
FileHelpers::writeFloat(os, mySpeedFactor);
FileHelpers::writeFloat(os, mySpeedDev);
FileHelpers::writeFloat(os, myColor.red());
FileHelpers::writeFloat(os, myColor.green());
FileHelpers::writeFloat(os, myColor.blue());
FileHelpers::writeInt(os, myCarFollowModel->getModelID());
FileHelpers::writeString(os, myLaneChangeModel);
//myCarFollowModel->saveState(os);
}
SUMOReal
MSVehicleType::get(const std::map<std::string, SUMOReal> &from, const std::string &name, SUMOReal defaultValue) throw() {
std::map<std::string, SUMOReal>::const_iterator i = from.find(name);
if (i==from.end()) {
return defaultValue;
}
return (*i).second;
}
MSVehicleType *
MSVehicleType::build(SUMOVTypeParameter &from) throw(ProcessError) {
MSVehicleType *vtype = new MSVehicleType(
from.id, from.length, from.stripWidth, from.maxSpeed,
from.defaultProbability, from.speedFactor, from.speedDev, from.vehicleClass, from.emissionClass,
from.shape, from.width, from.offset, from.cfModel, from.lcModel, from.color);
MSCFModel *model = 0;
switch (from.cfModel) {
case SUMO_TAG_CF_IDM:
model = new MSCFModel_IDM(vtype,
get(from.cfParameter, "accel", DEFAULT_VEH_ACCEL),
get(from.cfParameter, "decel", DEFAULT_VEH_DECEL),
get(from.cfParameter, "timeHeadWay", 1.5),
get(from.cfParameter, "minGap", 5.),
get(from.cfParameter, "tau", DEFAULT_VEH_TAU));
break;
case SUMO_TAG_CF_BKERNER:
model = new MSCFModel_Kerner(vtype,
get(from.cfParameter, "accel", DEFAULT_VEH_ACCEL),
get(from.cfParameter, "decel", DEFAULT_VEH_DECEL),
get(from.cfParameter, "tau", DEFAULT_VEH_TAU),
get(from.cfParameter, "k", .5),
get(from.cfParameter, "phi", 5.));
break;
case SUMO_TAG_CF_KRAUSS_ORIG1:
model = new MSCFModel_KraussOrig1(vtype,
get(from.cfParameter, "accel", DEFAULT_VEH_ACCEL),
get(from.cfParameter, "decel", DEFAULT_VEH_DECEL),
get(from.cfParameter, "sigma", DEFAULT_VEH_SIGMA),
get(from.cfParameter, "tau", DEFAULT_VEH_TAU));
break;
case SUMO_TAG_CF_PWAGNER2009:
model = new MSCFModel_PWag2009(vtype,
get(from.cfParameter, "accel", DEFAULT_VEH_ACCEL),
get(from.cfParameter, "decel", DEFAULT_VEH_DECEL),
get(from.cfParameter, "sigma", DEFAULT_VEH_SIGMA),
get(from.cfParameter, "tau", DEFAULT_VEH_TAU));
break;
case SUMO_TAG_CF_IITBNN:
model = new MSCFModel_IITBNN(vtype,
get(from.cfParameter, "accel", DEFAULT_VEH_ACCEL),
get(from.cfParameter, "decel", DEFAULT_VEH_DECEL),
get(from.cfParameter, "sigma", DEFAULT_VEH_SIGMA),
get(from.cfParameter, "tau", DEFAULT_VEH_TAU));
break;
case SUMO_TAG_CF_KRAUSS:
default:
model = new MSCFModel_Krauss(vtype,
get(from.cfParameter, "accel", DEFAULT_VEH_ACCEL),
get(from.cfParameter, "decel", DEFAULT_VEH_DECEL),
get(from.cfParameter, "sigma", DEFAULT_VEH_SIGMA),
get(from.cfParameter, "tau", DEFAULT_VEH_TAU));
break;
}
vtype->myCarFollowModel = model;
return vtype;
}
/****************************************************************************/
| [
"chordiasagar14@gmail.com"
] | chordiasagar14@gmail.com |
f1572fef198043264422f082ea9bf876a911024e | 2fe1ed6a8650b9b153e8b63802f5ed7a56417dfb | /ascii_art.h | ea9c0c8ee0506d35cefdcf87ede0d643d9837a94 | [] | no_license | maxwell-yaron/ascii_art | 9be043fd251e4f57fc2dba5372fb35439b6290d1 | 82edb0504d17f8ff478184f5d6f1626913517001 | refs/heads/master | 2020-05-26T08:58:59.776062 | 2019-05-23T06:33:49 | 2019-05-23T06:33:49 | 188,175,104 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 147 | h | #include <string>
#include "opencv2/core/core.hpp"
std::string asciiFromImage(const cv::Mat& image, int width, int height, bool invert = false);
| [
"maxwell.yaron@gmail.com"
] | maxwell.yaron@gmail.com |
af21f560c314963e688740dcca18a6d192a0257a | 14ce01a6f9199d39e28d036e066d99cfb3e3f211 | /Cpp/SDK/Landscape_structs.h | f5c8cc3e57140d0c64f5b928a091d8e9cd236750 | [] | no_license | zH4x-SDK/zManEater-SDK | 73f14dd8f758bb7eac649f0c66ce29f9974189b7 | d040c05a93c0935d8052dd3827c2ef91c128bce7 | refs/heads/main | 2023-07-19T04:54:51.672951 | 2021-08-27T13:47:27 | 2021-08-27T13:47:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 31,196 | h | #pragma once
// Name: ManEater, Version: 1.0.0
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Enums
//---------------------------------------------------------------------------
// Enum Landscape.ELandscapeBlendMode
enum class Landscape_ELandscapeBlendMode : uint8_t
{
LSBM_AdditiveBlend = 0,
LSBM_AlphaBlend = 1,
LSBM_MAX = 2,
};
// Enum Landscape.ELandscapeSetupErrors
enum class Landscape_ELandscapeSetupErrors : uint8_t
{
LSE_None = 0,
LSE_NoLandscapeInfo = 1,
LSE_CollsionXY = 2,
LSE_NoLayerInfo = 3,
LSE_MAX = 4,
};
// Enum Landscape.ELandscapeClearMode
enum class Landscape_ELandscapeClearMode : uint8_t
{
Clear_Weightmap = 0,
Clear_Heightmap = 1,
Clear_All = 2,
Clear_MAX = 3,
};
// Enum Landscape.ELandscapeGizmoType
enum class Landscape_ELandscapeGizmoType : uint8_t
{
LGT_None = 0,
LGT_Height = 1,
LGT_Weight = 2,
LGT_MAX = 3,
};
// Enum Landscape.EGrassScaling
enum class Landscape_EGrassScaling : uint8_t
{
EGrassScaling__Uniform = 0,
EGrassScaling__Free = 1,
EGrassScaling__LockXY = 2,
EGrassScaling__EGrassScaling_MAX = 3,
};
// Enum Landscape.ESplineModulationColorMask
enum class Landscape_ESplineModulationColorMask : uint8_t
{
ESplineModulationColorMask__Red = 0,
ESplineModulationColorMask__Green = 1,
ESplineModulationColorMask__Blue = 2,
ESplineModulationColorMask__Alpha = 3,
ESplineModulationColorMask__ESplineModulationColorMask_MAX = 4,
};
// Enum Landscape.ELandscapeLODFalloff
enum class Landscape_ELandscapeLODFalloff : uint8_t
{
ELandscapeLODFalloff__Linear = 0,
ELandscapeLODFalloff__SquareRoot = 1,
ELandscapeLODFalloff__ELandscapeLODFalloff_MAX = 2,
};
// Enum Landscape.ELandscapeLayerDisplayMode
enum class Landscape_ELandscapeLayerDisplayMode : uint8_t
{
ELandscapeLayerDisplayMode__Default = 0,
ELandscapeLayerDisplayMode__Alphabetical = 1,
ELandscapeLayerDisplayMode__UserSpecific = 2,
ELandscapeLayerDisplayMode__ELandscapeLayerDisplayMode_MAX = 3,
};
// Enum Landscape.ELandscapeLayerPaintingRestriction
enum class Landscape_ELandscapeLayerPaintingRestriction : uint8_t
{
ELandscapeLayerPaintingRestriction__None = 0,
ELandscapeLayerPaintingRestriction__UseMaxLayers = 1,
ELandscapeLayerPaintingRestriction__ExistingOnly = 2,
ELandscapeLayerPaintingRestriction__UseComponentWhitelist = 3,
ELandscapeLayerPaintingRestriction__ELandscapeLayerPaintingRestriction_MAX = 4,
};
// Enum Landscape.ELandscapeImportAlphamapType
enum class Landscape_ELandscapeImportAlphamapType : uint8_t
{
ELandscapeImportAlphamapType__Additive = 0,
ELandscapeImportAlphamapType__Layered = 1,
ELandscapeImportAlphamapType__ELandscapeImportAlphamapType_MAX = 2,
};
// Enum Landscape.LandscapeSplineMeshOrientation
enum class Landscape_ELandscapeSplineMeshOrientation : uint8_t
{
LSMO_XUp = 0,
LSMO_YUp = 1,
LSMO_MAX = 2,
};
// Enum Landscape.ELandscapeLayerBlendType
enum class Landscape_ELandscapeLayerBlendType : uint8_t
{
LB_WeightBlend = 0,
LB_AlphaBlend = 1,
LB_HeightBlend = 2,
LB_MAX = 3,
};
// Enum Landscape.ELandscapeCustomizedCoordType
enum class Landscape_ELandscapeCustomizedCoordType : uint8_t
{
LCCT_None = 0,
LCCT_CustomUV0 = 1,
LCCT_CustomUV1 = 2,
LCCT_CustomUV2 = 3,
LCCT_WeightMapUV = 4,
LCCT_MAX = 5,
};
// Enum Landscape.ETerrainCoordMappingType
enum class Landscape_ETerrainCoordMappingType : uint8_t
{
TCMT_Auto = 0,
TCMT_XY = 1,
TCMT_XZ = 2,
TCMT_YZ = 3,
TCMT_MAX = 4,
};
//---------------------------------------------------------------------------
// Script Structs
//---------------------------------------------------------------------------
// ScriptStruct Landscape.ForeignControlPointData
// 0x0001
struct FForeignControlPointData
{
unsigned char UnknownData_A249[0x1]; // 0x0000(0x0001) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.LandscapeSplineMeshEntry
// 0x0038
struct FLandscapeSplineMeshEntry
{
class UStaticMesh* Mesh; // 0x0000(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TArray<class UMaterialInterface*> MaterialOverrides; // 0x0008(0x0010) (Edit, ZeroConstructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char bCenterH : 1; // 0x0018(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_C19H[0x3]; // 0x0019(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
struct FVector2D CenterAdjust; // 0x001C(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char bScaleToWidth : 1; // 0x0024(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_YJW4[0x3]; // 0x0025(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
struct FVector Scale; // 0x0028(0x000C) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<Landscape_ELandscapeSplineMeshOrientation> Orientation; // 0x0034(0x0001) (ZeroConstructor, Deprecated, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<Engine_ESplineMeshAxis> ForwardAxis; // 0x0035(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<Engine_ESplineMeshAxis> UpAxis; // 0x0036(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_4SI1[0x1]; // 0x0037(0x0001) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.LandscapeSplineSegmentConnection
// 0x0018
struct FLandscapeSplineSegmentConnection
{
class ULandscapeSplineControlPoint* ControlPoint; // 0x0000(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float TangentLen; // 0x0008(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FName SocketName; // 0x000C(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_FRFR[0x4]; // 0x0014(0x0004) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.LandscapeSplineInterpPoint
// 0x0070
struct FLandscapeSplineInterpPoint
{
struct FVector Center; // 0x0000(0x000C) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector Left; // 0x000C(0x000C) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector Right; // 0x0018(0x000C) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector FalloffLeft; // 0x0024(0x000C) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector FalloffRight; // 0x0030(0x000C) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector LayerLeft; // 0x003C(0x000C) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector LayerRight; // 0x0048(0x000C) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector LayerFalloffLeft; // 0x0054(0x000C) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector LayerFalloffRight; // 0x0060(0x000C) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float StartEndFalloff; // 0x006C(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.GrassInput
// 0x0028
struct FGrassInput
{
struct FName Name; // 0x0000(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class ULandscapeGrassType* GrassType; // 0x0008(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FExpressionInput Input; // 0x0010(0x000C) (NoDestructor, NativeAccessSpecifierPublic)
unsigned char UnknownData_XA2Q[0xC]; // 0x001C(0x000C) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.LayerBlendInput
// 0x0048
struct FLayerBlendInput
{
struct FName LayerName; // 0x0000(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<Landscape_ELandscapeLayerBlendType> BlendType; // 0x0008(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_3AA7[0x3]; // 0x0009(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
struct FExpressionInput LayerInput; // 0x000C(0x000C) (NoDestructor, NativeAccessSpecifierPublic)
unsigned char UnknownData_CH3H[0x8]; // 0x0018(0x0008) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
struct FExpressionInput HeightInput; // 0x0020(0x000C) (NoDestructor, NativeAccessSpecifierPublic)
unsigned char UnknownData_OK7P[0x8]; // 0x002C(0x0008) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
float PreviewWeight; // 0x0034(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FVector ConstLayerInput; // 0x0038(0x000C) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float ConstHeightInput; // 0x0044(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.LandscapeProxyMaterialOverride
// 0x0010
struct FLandscapeProxyMaterialOverride
{
struct FPerPlatformInt LODIndex; // 0x0000(0x0004) (Edit, NoDestructor, NativeAccessSpecifierPublic)
unsigned char UnknownData_DMAH[0x4]; // 0x0004(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
class UMaterialInterface* Material; // 0x0008(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.LandscapeComponentMaterialOverride
// 0x0010
struct FLandscapeComponentMaterialOverride
{
struct FPerPlatformInt LODIndex; // 0x0000(0x0004) (Edit, NoDestructor, NativeAccessSpecifierPublic)
unsigned char UnknownData_DXPN[0x4]; // 0x0004(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
class UMaterialInterface* Material; // 0x0008(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.WeightmapLayerAllocationInfo
// 0x0010
struct FWeightmapLayerAllocationInfo
{
class ULandscapeLayerInfoObject* LayerInfo; // 0x0000(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char WeightmapTextureIndex; // 0x0008(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char WeightmapTextureChannel; // 0x0009(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_18WM[0x6]; // 0x000A(0x0006) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.GrassVariety
// 0x0048
struct FGrassVariety
{
class UStaticMesh* GrassMesh; // 0x0000(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FPerPlatformFloat GrassDensity; // 0x0008(0x0004) (Edit, NoDestructor, NativeAccessSpecifierPublic)
bool bUseGrid; // 0x000C(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_0JRV[0x3]; // 0x000D(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
float PlacementJitter; // 0x0010(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FPerPlatformInt StartCullDistance; // 0x0014(0x0004) (Edit, NoDestructor, NativeAccessSpecifierPublic)
struct FPerPlatformInt EndCullDistance; // 0x0018(0x0004) (Edit, NoDestructor, NativeAccessSpecifierPublic)
int MinLOD; // 0x001C(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<Engine_EDetailMode> DetailMode; // 0x0020(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
Landscape_EGrassScaling Scaling; // 0x0021(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_X5RF[0x2]; // 0x0022(0x0002) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
struct FFloatInterval ScaleX; // 0x0024(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FFloatInterval ScaleY; // 0x002C(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FFloatInterval ScaleZ; // 0x0034(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool RandomRotation; // 0x003C(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool AlignToSurface; // 0x003D(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bUseLandscapeLightmap; // 0x003E(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FLightingChannels LightingChannels; // 0x003F(0x0001) (Edit, NoDestructor, AdvancedDisplay, NativeAccessSpecifierPublic)
bool bReceivesDecals; // 0x0040(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bCastDynamicShadow; // 0x0041(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<Engine_EDetailMode> DynamicShadowDetailMode; // 0x0042(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bVisibleInRayTracing; // 0x0043(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bKeepInstanceBufferCPUCopy; // 0x0044(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_FLKL[0x3]; // 0x0045(0x0003) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.LandscapeMaterialTextureStreamingInfo
// 0x000C
struct FLandscapeMaterialTextureStreamingInfo
{
struct FName TextureName; // 0x0000(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float TexelFactor; // 0x0008(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.LandscapeSplineConnection
// 0x0010
struct FLandscapeSplineConnection
{
class ULandscapeSplineSegment* Segment; // 0x0000(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char End : 1; // 0x0008(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_K7YP[0x7]; // 0x0009(0x0007) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.LandscapeLayerBrush
// 0x0001
struct FLandscapeLayerBrush
{
unsigned char UnknownData_H7M0[0x1]; // 0x0000(0x0001) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.LandscapeLayer
// 0x0088
struct FLandscapeLayer
{
struct FGuid Guid; // 0x0000(0x0010) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FName Name; // 0x0010(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bVisible; // 0x0018(0x0001) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bLocked; // 0x0019(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_6A9Z[0x2]; // 0x001A(0x0002) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
float HeightmapAlpha; // 0x001C(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
float WeightmapAlpha; // 0x0020(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TEnumAsByte<Landscape_ELandscapeBlendMode> BlendMode; // 0x0024(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
unsigned char UnknownData_KT9J[0x3]; // 0x0025(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
TArray<struct FLandscapeLayerBrush> Brushes; // 0x0028(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TMap<class ULandscapeLayerInfoObject*, bool> WeightmapLayerAllocationBlend; // 0x0038(0x0050) (NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.HeightmapData
// 0x0008
struct FHeightmapData
{
class UTexture2D* Texture; // 0x0000(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.WeightmapData
// 0x0030
struct FWeightmapData
{
TArray<class UTexture2D*> Textures; // 0x0000(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TArray<struct FWeightmapLayerAllocationInfo> LayerAllocations; // 0x0010(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
TArray<class ULandscapeWeightmapUsage*> TextureUsages; // 0x0020(0x0010) (ZeroConstructor, Transient, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.LandscapeLayerComponentData
// 0x0038
struct FLandscapeLayerComponentData
{
struct FHeightmapData HeightmapData; // 0x0000(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic)
struct FWeightmapData WeightmapData; // 0x0008(0x0030) (NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.LandscapeEditToolRenderData
// 0x0038
struct FLandscapeEditToolRenderData
{
class UMaterialInterface* ToolMaterial; // 0x0000(0x0008) (ZeroConstructor, IsPlainOldData, NonTransactional, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UMaterialInterface* GizmoMaterial; // 0x0008(0x0008) (ZeroConstructor, IsPlainOldData, NonTransactional, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int SelectedType; // 0x0010(0x0004) (ZeroConstructor, IsPlainOldData, NonTransactional, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int DebugChannelR; // 0x0014(0x0004) (ZeroConstructor, IsPlainOldData, NonTransactional, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int DebugChannelG; // 0x0018(0x0004) (ZeroConstructor, IsPlainOldData, NonTransactional, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int DebugChannelB; // 0x001C(0x0004) (ZeroConstructor, IsPlainOldData, NonTransactional, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UTexture2D* DataTexture; // 0x0020(0x0008) (ZeroConstructor, IsPlainOldData, NonTransactional, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UTexture2D* LayerContributionTexture; // 0x0028(0x0008) (ZeroConstructor, IsPlainOldData, NonTransactional, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
class UTexture2D* DirtyTexture; // 0x0030(0x0008) (ZeroConstructor, IsPlainOldData, NonTransactional, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.GizmoSelectData
// 0x0050
struct FGizmoSelectData
{
unsigned char UnknownData_535L[0x50]; // 0x0000(0x0050) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.LandscapeInfoLayerSettings
// 0x0010
struct FLandscapeInfoLayerSettings
{
class ULandscapeLayerInfoObject* LayerInfoObj; // 0x0000(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
struct FName LayerName; // 0x0008(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.LandscapeImportLayerInfo
// 0x0001
struct FLandscapeImportLayerInfo
{
unsigned char UnknownData_R4SY[0x1]; // 0x0000(0x0001) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.LandscapeLayerStruct
// 0x0008
struct FLandscapeLayerStruct
{
class ULandscapeLayerInfoObject* LayerInfoObj; // 0x0000(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};
// ScriptStruct Landscape.LandscapeEditorLayerSettings
// 0x0001
struct FLandscapeEditorLayerSettings
{
unsigned char UnknownData_SKRT[0x1]; // 0x0000(0x0001) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.ForeignWorldSplineData
// 0x0001
struct FForeignWorldSplineData
{
unsigned char UnknownData_637W[0x1]; // 0x0000(0x0001) MISSED OFFSET (PADDING)
};
// ScriptStruct Landscape.ForeignSplineSegmentData
// 0x0001
struct FForeignSplineSegmentData
{
unsigned char UnknownData_5G9R[0x1]; // 0x0000(0x0001) MISSED OFFSET (PADDING)
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"zp2kshield@gmail.com"
] | zp2kshield@gmail.com |
1aafea89dc14c01bf1b26eb6d18d8b0c14888829 | 2f42593511151f65db255a91f9eb28accb259353 | /code/example/example/hello.cpp | 8bf70cdc4271e07009e6be5b126e3e7c3a4f5713 | [] | no_license | dhkim9210/Algorithm | 7e081841507d9de5e6382018f4dfa290619777b8 | c6e7cf4d0fcf4bad2573ac5ffde33d92b70ffc66 | refs/heads/master | 2022-04-18T03:24:02.387681 | 2020-04-06T11:31:00 | 2020-04-06T11:31:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,028 | cpp | //1697.cpp 숨바꼭질
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
const int MAX = 200000;
bool check[MAX+1];
int dist[MAX + 1];
int main() {
int n, k;
cin >> n >> k;
check[n] = true;
dist[n] = 0;
queue<int> q;
q.push(n);
while (!q.empty()) {
int now = q.front();
q.pop();
if (now - 1 >= 0) {
if (check[now - 1] == false) {
q.push(now - 1);
check[now - 1] = true;
dist[now - 1] = dist[now] + 1;
}
}
if (now + 1 < MAX) {
if (check[now + 1] == false) {
q.push(now + 1);
check[now + 1] = true;
dist[now + 1] = dist[now] + 1;
}
}
if (now * 2 < MAX) {
if (check[now * 2] == false) {
q.push(now * 2);
check[now * 2] = true;
dist[now * 2] = dist[now] + 1;
}
}
}
cout << dist[k] << '\n';
return 0;
}
| [
"rlaehdgkr7@naver.com"
] | rlaehdgkr7@naver.com |
2392b6f518c4f6e8b8be9adf8d0586251ee29507 | 0615e5a3845594451c65838a0d9483db758ad8e0 | /src/irc.cpp | d8aef41c19cee8652f4ecbda9f0fd2f4adb5ed0b | [
"MIT"
] | permissive | GIZMOcoinTEAM/SourceCode | a05e108442e875bb417a6668548f6636aaad45a2 | dab5949a2c253b66818892a645609b2ad344c048 | refs/heads/master | 2021-01-11T08:33:23.770062 | 2015-04-11T13:15:08 | 2015-04-11T13:15:08 | 33,437,163 | 0 | 2 | null | 2015-04-11T13:15:09 | 2015-04-05T10:08:28 | C++ | UTF-8 | C++ | false | false | 11,007 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "irc.h"
#include "net.h"
#include "strlcpy.h"
#include "base58.h"
using namespace std;
using namespace boost;
int nGotIRCAddresses = 0;
void ThreadIRCSeed2(void* parg);
#pragma pack(push, 1)
struct ircaddr
{
struct in_addr ip;
short port;
};
#pragma pack(pop)
string EncodeAddress(const CService& addr)
{
struct ircaddr tmp;
if (addr.GetInAddr(&tmp.ip))
{
tmp.port = htons(addr.GetPort());
vector<unsigned char> vch(UBEGIN(tmp), UEND(tmp));
return string("u") + EncodeBase58Check(vch);
}
return "";
}
bool DecodeAddress(string str, CService& addr)
{
vector<unsigned char> vch;
if (!DecodeBase58Check(str.substr(1), vch))
return false;
struct ircaddr tmp;
if (vch.size() != sizeof(tmp))
return false;
memcpy(&tmp, &vch[0], sizeof(tmp));
addr = CService(tmp.ip, ntohs(tmp.port));
return true;
}
static bool Send(SOCKET hSocket, const char* pszSend)
{
if (strstr(pszSend, "PONG") != pszSend)
printf("IRC SENDING: %s\n", pszSend);
const char* psz = pszSend;
const char* pszEnd = psz + strlen(psz);
while (psz < pszEnd)
{
int ret = send(hSocket, psz, pszEnd - psz, MSG_NOSIGNAL);
if (ret < 0)
return false;
psz += ret;
}
return true;
}
bool RecvLineIRC(SOCKET hSocket, string& strLine)
{
while (true)
{
bool fRet = RecvLine(hSocket, strLine);
if (fRet)
{
if (fShutdown)
return false;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() >= 1 && vWords[0] == "PING")
{
strLine[1] = 'O';
strLine += '\r';
Send(hSocket, strLine.c_str());
continue;
}
}
return fRet;
}
}
int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL, const char* psz4=NULL)
{
while (true)
{
string strLine;
strLine.reserve(10000);
if (!RecvLineIRC(hSocket, strLine))
return 0;
printf("IRC %s\n", strLine.c_str());
if (psz1 && strLine.find(psz1) != string::npos)
return 1;
if (psz2 && strLine.find(psz2) != string::npos)
return 2;
if (psz3 && strLine.find(psz3) != string::npos)
return 3;
if (psz4 && strLine.find(psz4) != string::npos)
return 4;
}
}
bool Wait(int nSeconds)
{
if (fShutdown)
return false;
printf("IRC waiting %d seconds to reconnect\n", nSeconds);
for (int i = 0; i < nSeconds; i++)
{
if (fShutdown)
return false;
MilliSleep(1000);
}
return true;
}
bool RecvCodeLine(SOCKET hSocket, const char* psz1, string& strRet)
{
strRet.clear();
while (true)
{
string strLine;
if (!RecvLineIRC(hSocket, strLine))
return false;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() < 2)
continue;
if (vWords[1] == psz1)
{
printf("IRC %s\n", strLine.c_str());
strRet = strLine;
return true;
}
}
}
bool GetIPFromIRC(SOCKET hSocket, string strMyName, CNetAddr& ipRet)
{
Send(hSocket, strprintf("USERHOST %s\r", strMyName.c_str()).c_str());
string strLine;
if (!RecvCodeLine(hSocket, "302", strLine))
return false;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() < 4)
return false;
string str = vWords[3];
if (str.rfind("@") == string::npos)
return false;
string strHost = str.substr(str.rfind("@")+1);
// Hybrid IRC used by lfnet always returns IP when you userhost yourself,
// but in case another IRC is ever used this should work.
printf("GetIPFromIRC() got userhost %s\n", strHost.c_str());
CNetAddr addr(strHost, true);
if (!addr.IsValid())
return false;
ipRet = addr;
return true;
}
void ThreadIRCSeed(void* parg)
{
// Make this thread recognisable as the IRC seeding thread
RenameThread("GizmoCoin-ircseed");
try
{
ThreadIRCSeed2(parg);
}
catch (std::exception& e) {
PrintExceptionContinue(&e, "ThreadIRCSeed()");
} catch (...) {
PrintExceptionContinue(NULL, "ThreadIRCSeed()");
}
printf("ThreadIRCSeed exited\n");
}
void ThreadIRCSeed2(void* parg)
{
// Don't connect to IRC if we won't use IPv4 connections.
if (IsLimited(NET_IPV4))
return;
// ... or if we won't make outbound connections and won't accept inbound ones.
if (mapArgs.count("-connect") && fNoListen)
return;
// ... or if IRC is not enabled.
if (!GetBoolArg("-irc", false))
return;
printf("ThreadIRCSeed started\n");
int nErrorWait = 10;
int nRetryWait = 10;
int nNameRetry = 0;
while (!fShutdown)
{
CService addrConnect("92.243.23.21", 6667); // irc.lfnet.org
CService addrIRC("irc.lfnet.org", 6667, true);
if (addrIRC.IsValid())
addrConnect = addrIRC;
SOCKET hSocket;
if (!ConnectSocket(addrConnect, hSocket))
{
printf("IRC connect failed\n");
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
if (!RecvUntil(hSocket, "Found your hostname", "using your IP address instead", "Couldn't look up your hostname", "ignoring hostname"))
{
closesocket(hSocket);
hSocket = INVALID_SOCKET;
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
CNetAddr addrIPv4("1.2.3.4"); // arbitrary IPv4 address to make GetLocal prefer IPv4 addresses
CService addrLocal;
string strMyName;
// Don't use our IP as our nick if we're not listening
// or if it keeps failing because the nick is already in use.
if (!fNoListen && GetLocal(addrLocal, &addrIPv4) && nNameRetry<3)
strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
if (strMyName == "")
strMyName = strprintf("x%"PRIu64"", GetRand(1000000000));
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str());
int nRet = RecvUntil(hSocket, " 004 ", " 433 ");
if (nRet != 1)
{
closesocket(hSocket);
hSocket = INVALID_SOCKET;
if (nRet == 2)
{
printf("IRC name already in use\n");
nNameRetry++;
Wait(10);
continue;
}
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
nNameRetry = 0;
MilliSleep(500);
// Get our external IP from the IRC server and re-nick before joining the channel
CNetAddr addrFromIRC;
if (GetIPFromIRC(hSocket, strMyName, addrFromIRC))
{
printf("GetIPFromIRC() returned %s\n", addrFromIRC.ToString().c_str());
// Don't use our IP as our nick if we're not listening
if (!fNoListen && addrFromIRC.IsRoutable())
{
// IRC lets you to re-nick
AddLocal(addrFromIRC, LOCAL_IRC);
strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
}
}
if (fTestNet) {
Send(hSocket, "JOIN #GizmoCoinTEST\r");
Send(hSocket, "WHO #GizmoCoinTEST\r");
} else {
// randomly join #GizmoCoin00-#GizmoCoin05
//int channel_number = GetRandInt(5);
int channel_number = 0;
// Channel number is always 0 for initial release
//int channel_number = 0;
Send(hSocket, strprintf("JOIN #GizmoCoin%02d\r", channel_number).c_str());
Send(hSocket, strprintf("WHO #GizmoCoin%02d\r", channel_number).c_str());
}
int64_t nStart = GetTime();
string strLine;
strLine.reserve(10000);
while (!fShutdown && RecvLineIRC(hSocket, strLine))
{
if (strLine.empty() || strLine.size() > 900 || strLine[0] != ':')
continue;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() < 2)
continue;
char pszName[10000];
pszName[0] = '\0';
if (vWords[1] == "352" && vWords.size() >= 8)
{
// index 7 is limited to 16 characters
// could get full length name at index 10, but would be different from join messages
strlcpy(pszName, vWords[7].c_str(), sizeof(pszName));
printf("IRC got who\n");
}
if (vWords[1] == "JOIN" && vWords[0].size() > 1)
{
// :username!username@50000007.F000000B.90000002.IP JOIN :#channelname
strlcpy(pszName, vWords[0].c_str() + 1, sizeof(pszName));
if (strchr(pszName, '!'))
*strchr(pszName, '!') = '\0';
printf("IRC got join\n");
}
if (pszName[0] == 'u')
{
CAddress addr;
if (DecodeAddress(pszName, addr))
{
addr.nTime = GetAdjustedTime();
if (addrman.Add(addr, addrConnect, 51 * 60))
printf("IRC got new address: %s\n", addr.ToString().c_str());
nGotIRCAddresses++;
}
else
{
printf("IRC decode failed\n");
}
}
}
closesocket(hSocket);
hSocket = INVALID_SOCKET;
if (GetTime() - nStart > 20 * 60)
{
nErrorWait /= 3;
nRetryWait /= 3;
}
nRetryWait = nRetryWait * 11 / 10;
if (!Wait(nRetryWait += 60))
return;
}
}
#ifdef TEST
int main(int argc, char *argv[])
{
WSADATA wsadata;
if (WSAStartup(MAKEWORD(2,2), &wsadata) != NO_ERROR)
{
printf("Error at WSAStartup()\n");
return false;
}
ThreadIRCSeed(NULL);
WSACleanup();
return 0;
}
#endif
| [
"gizmocoin@yahoo.com"
] | gizmocoin@yahoo.com |
9da26bb846c97ea9b0ec9ca5240db269a9a7bc7a | b0b2abc823b81320d71899a626c187f9487534f2 | /Project code/Project Code/BBB Code/TestMotion2.cpp | 27fc6667faa4e8eeb713f803590f93df58e47ae2 | [] | no_license | dwhiting95337/autogarage | cd98c0f518f63b09c15c440775d4236d07e33faf | 114a1fb946eec13d7a67473ab2575f2ec118f8f6 | refs/heads/master | 2021-01-10T12:23:51.344102 | 2015-12-14T23:19:29 | 2015-12-14T23:19:29 | 48,005,574 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,940 | cpp |
#include <iostream>
#include <string>
#include <unistd.h>
#include "SimpleGPIO.h"
#include<opencv2/opencv.hpp>
using namespace cv;
using namespace std;
//unsigned int LEDGPIO = 60; // GPIO1_28 = (1x32) + 28 = 60
unsigned int LEDGPIO = 23; //GPIO0_23 = (0*32) + 23 = 50
//unsigned int ButtonGPIO = 15; // GPIO0_15 = (0x32) + 15 = 15
unsigned int SensorOut = 61; //GPIO1_29 = (1*32) + 29 = 61
int main(int argc, char *argv[]){
cout << "Testing the PIR Motion Sensor!" << endl;
gpio_export(LEDGPIO); // The LED
//gpio_export(ButtonGPIO); // The push button switch
gpio_export(SensorOut); //The Output of the PIR Sensor
gpio_set_dir(LEDGPIO, OUTPUT_PIN); // The LED is an output
//gpio_set_dir(ButtonGPIO, INPUT_PIN); // The push button input
gpio_set_dir(SensorOut, INPUT_PIN);
// Flash the LED 5 times
for(int i=0; i<5; i++){
cout << "Setting the LED on" << endl;
gpio_set_value(LEDGPIO, HIGH);
usleep(200000); // on for 200ms
cout << "Setting the LED off" << endl;
gpio_set_value(LEDGPIO, LOW);
usleep(200000); // off for 200ms
}
// Wait for the push button to be pressed
unsigned int value = LOW;
//cout << "Sensor will now start detecting!" << endl;
bool detect = true;
while(detect){
gpio_get_value(SensorOut, &value);
if(value == HIGH){
usleep(5000000);
gpio_get_value(SensorOut, &value);
if(value==HIGH){
cout<<"Motion Detected"<<endl;
cout << endl << "End of Motion Detection!" << endl;
//cout << "Finished Testing the Motion Sensor & GPIO Pins" << endl;
detect = false;
}
}
usleep(1000000);
}
gpio_unexport(LEDGPIO); // unexport the LED
gpio_unexport(SensorOut); // unexport the push button
return 0;
}
| [
"dwhiting95337@yahoo.com"
] | dwhiting95337@yahoo.com |
a6d3bd0bd9a61f43b0986ecfd5459b1d8f686069 | 9f53d66c8e0af093239cc74645b7ad83313e86c3 | /MKS_Stock/entities/producto.h | 9ac315d7c38e6b174bca0a177b93bcd8be0394ea | [] | no_license | diegowald/MKSStock | 981808fc10e153e7ad2929bfbcde13e1e21dd817 | d7807368d90ffa4cf916df5d05c58fc1899350ec | refs/heads/master | 2021-01-20T15:41:57.794320 | 2016-07-22T19:59:51 | 2016-07-22T19:59:51 | 62,821,182 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 491 | h | #ifndef PRODUCTO_H
#define PRODUCTO_H
#include <QObject>
#include "entidadbase.h"
class Producto : public EntidadBase
{
Q_OBJECT
public:
explicit Producto(QObject *parent = 0);
QString nombre() const;
QString descripcion() const;
void setNombre(const QString &value);
void setDescripcion(const QString &value);
signals:
public slots:
private:
QString _nombre;
QString _descripcion;
};
typedef QSharedPointer<Producto> ProductoPtr;
#endif // PRODUCTO_H
| [
"diego.wald@gmail.com"
] | diego.wald@gmail.com |
a9102a25dab4a56503b60964beebc97ed0c2af78 | 6f6b0e47b1b20b3cd3cd70863c12e3474921b463 | /Zbar_recoganition/zbartest2/QRdecoder.h | 80034212b2b704fdedac990c89c5c876dd3b197f | [] | no_license | 1093842024/glenngit | ccae76f23e690b85d0109a087016bfe8f30c6726 | b033e1df84beb368ff54a8077d7ed0bb1b42df6b | refs/heads/master | 2021-05-12T19:28:24.245528 | 2018-07-26T03:16:19 | 2018-07-26T03:16:19 | 117,094,189 | 2 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,043 | h | #ifndef _QRDECODER_H
#define _QRDECODER_H
#include <iostream>
#include <string.h>
using namespace std;
//基本的二维码识别算法接口,速度快,但识别精度一般,恶劣条件识别率低
string QRDecoder(unsigned char* img,int cols,int rows);
//优化加强的二维码识别算法接口,恶劣条件下速度稍慢,但识别精度很高 n代表间隔多少次库扫描方法后,进行优化方法扫描
string QRDecoder_improve1(unsigned char* img,int cols,int rows,int n);
//升级版优化加强的二维码识别算法接口,恶劣条件下识别速度最慢,但识别精度最高
string QRDecoder_improve2(unsigned char* img,int cols,int rows,int n);
string QRDecoder_improve(unsigned char* img,int cols,int rows,int n,int m);//该接口为improve1的修改版,速度比直接的库识别慢4倍
string QRDecoder_improve_ROI(unsigned char* img,int cols,int rows,int n,int m);//该接口为improve的修改版,对传入的图像进行抠图以后再识别
#endif | [
"1093842024@qq.com"
] | 1093842024@qq.com |
8f752a3e2ec2bfc7673eb63426079d294bbb59d5 | 21a880dcdf84fd0c812f8506763a689fde297ba7 | /src/main/tradematching/trade_matching_exchange_alpha_test.cc | f97ba509c3d08fb16ae371e89003654b5f12f1c1 | [] | no_license | chenlucan/fix_handler | 91df9037eeb675b0c7ea6f22d541da74b220092f | 765462ff1a85567f43f63e04c29dbc9546a6c2e1 | refs/heads/master | 2021-03-22T02:07:39.016551 | 2017-08-01T02:02:20 | 2017-08-01T02:02:20 | 84,138,943 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 790 | cc |
#include "core/assist/logger.h"
#include "tmalpha/exchange/tmalpha_exchange_application.h"
int main(int argc, char** argv)
{
try
{
if (argc != 1)
{
LOG_ERROR("Usage: trade_matching_exchange_alpha_test");
LOG_ERROR("Ex: trade_matching_exchange_alpha_test");
return 1;
}
fh::tmalpha::exchange::TmalphaExchangeApplication a;
if(a.Start())
{
std::thread t([&a](){
std::cin.get();
a.Stop();
});
t.detach();
a.Join();
}
}
catch (std::exception& e)
{
LOG_ERROR("Exception: ", e.what());
}
return 0;
}
// ./trade_matching_exchange_alpha_test
| [
"ycyang77@hotmail.com"
] | ycyang77@hotmail.com |
6a2a0735d1934e84baaf22bb18d3898f60f3a351 | a3f6c837c2f016bb9a406b83f263ae121bec5a57 | /Unit00/chapter13/TableTennisPlayer.cpp | 06db96c0d93302a79e42f270558e505fce0e7a2f | [] | no_license | alanlyang/DSA | 8524db6392c685dde0f9836821b4d3ce055cc4fb | d9c5549ce81b5bb9af0a5b09ab80c8bfce9ba794 | refs/heads/main | 2023-07-02T04:25:10.518681 | 2021-07-30T13:13:30 | 2021-07-30T13:13:30 | 387,321,726 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 926 | cpp | //
// Created by 86185 on 2021/7/26.
//
#include "iostream"
#include "cstring"
#include "TableTennisPlayer.h"
using namespace std;
TableTennisPlayer::TableTennisPlayer(const char *fn, const char *ln, bool ht) {
strncpy(first_name, fn, LIM-1); // 不能用first_name = fn, 这样只是复制了fn的地址
first_name[LIM-1] = '\0';
strncpy(last_name, ln, LIM-1);
last_name[LIM-1] = '\0';
has_table = ht;
}
void TableTennisPlayer::Name() const {
cout << first_name << " " << last_name;
}
//int _main(){
// TableTennisPlayer player1("Alan", "lyang", true);
// TableTennisPlayer player2("Arya", "lpei", false);
// player1.Name();
// if(player1.hasTable())
// cout << ": has a table\n";
// else
// cout << ": hasn't a table \n";
//
// player2.Name();
// if(player2.hasTable())
// cout << ": has a table\n";
// else
// cout << ": hasn't a table \n";
//} | [
"alanyang414@gmail.com"
] | alanyang414@gmail.com |
86de3ebc8ce1fdc91c2d73d61b7699be4119604d | 9b4f17cebafb06a484305da8f93db626f7ab6b03 | /Items/Item 08 Ensure exceptions dont leave destructors.cpp | a96f9048ddd721d060226b343efcf9feee7523f6 | [] | no_license | jordantonni/Effective_Cpp | 729fecc254588ec9944b08586efe80959a302938 | 36844651dbf00410473f254e4d7caa7f4bb5ddcb | refs/heads/master | 2021-04-29T04:01:43.507134 | 2017-01-19T18:51:19 | 2017-01-19T18:51:19 | 78,031,467 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,739 | cpp | /*
* Prevent exceptions from leaving destructors
*
* If a dtor throws an unmanaged exception, c++ undefined behaviour occurs!
*
* If you have code in dtor that can throw an exception:
* 2 ways to fix:
* 1 - Try block in dtor, catch and terminate program -> Good option if the program would be unable to continue after exception.
* 2 - Try block in dtor, catch and swallow -> Only applicable if the program could continure correctly even after exception.
*
* Best solution:
* Move the possible exception throwing code from dtor into a "close()" method, this allows two things:
* 1 - Caller can call close() themselves from a try block and handle it how they want if it throws
* 2 - Dtor checks if close() has been called, if not try call it from dtor anyway. If throws just term or swallow as above
* Why?
* Allows user to try and handle the dtor stuff themself, if they dont it still gets called from dtor anyway but at least gave user the chance.
*
*
*
*/
#include <vector>
namespace item08
{
class Widget
{
public:
bool closed;
void close()
{
// Exception throwing code here necessary to close the object
closed = true;
}
// Dtor
~Widget()
{
if (!closed)
{
try
{
close();
}
catch (...)
{
// Log and terminate
}
}
}
};
void doSomething()
{
std::vector<Widget> v;
} // v destroyed here, if first Widget in v dtor thows and emits exception, all others will be destroyed -> Resource leaks!
}
| [
"jordantonni@outlook.com"
] | jordantonni@outlook.com |
a146c8aa38e5106a4e80ae7cb65354e98cee68a8 | 8ec95c6d35ddb9368d7b1363979536d1d9289be2 | /remove-character-string-make-palindrome.cpp | 24483ab1a310277383f7383751685be188bb6f6a | [] | no_license | vnrk/Algorithms | 71a2a118ab07c11dcfab40729a43d9a87f9d87e6 | d0349b8843c38c4f19310ee86036ff5992d4778a | refs/heads/master | 2021-01-17T07:23:54.331089 | 2018-01-03T02:16:27 | 2018-01-03T02:16:27 | 35,828,653 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 888 | cpp | #include <iostream>
using namespace std;
bool isPalindrome(string::iterator low, string::iterator high)
{
while (low < high)
{
if (*low != *high)
return false;
low++;
high--;
}
return true;
}
int possiblePalinByRemovingOneChar(string str)
{
int low = 0, high = str.length() - 1;
while (low < high)
{
if (str[low] == str[high])
{
low++;
high--;
}
else
{
if (isPalindrome(str.begin() + low + 1, str.begin() + high))
return low;
if (isPalindrome(str.begin() + low, str.begin() + high - 1))
return high;
return -1;
}
}
return -2;
}
int main()
{
string str = "abecebaa";
int idx = possiblePalinByRemovingOneChar(str);
if (idx == -1)
cout << "Not Possible \n";
else if (idx == -2)
cout << "Possible without removing any character";
else
cout << "Possible by removing character"
<< " at index " << idx << "\n";
return 0;
} | [
"koppu.venkata@gmail.com"
] | koppu.venkata@gmail.com |
fcabcf0f31f698b051d189bad2e5f8a88a21352a | 7d792544345c3c20cf9c63674ad79a4eab10e895 | /src/sbbs3/listfile.cpp | 3e0c8d959a5fd53efdc0ac295c373fbd94ebdfef | [
"Artistic-2.0"
] | permissive | mattzorzin/synchronet | 5d7dfddb8b067daa202e54f53e932a29eb02847e | b975055ea71a337a1bd63dd128995016f482c689 | refs/heads/master | 2021-01-11T01:33:28.835494 | 2014-09-19T02:40:49 | 2014-09-19T02:40:49 | 24,213,567 | 1 | 1 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 39,977 | cpp | /* listfile.cpp */
/* Synchronet file database listing functions */
/* $Id: listfile.cpp,v 1.55 2011/10/19 07:08:31 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
#include "sbbs.h"
#define BF_MAX 26 /* Batch Flag max: A-Z */
int extdesclines(char *str);
/*****************************************************************************/
/* List files in directory 'dir' that match 'filespec'. Filespec must be */
/* padded. ex: FILE* .EXT, not FILE*.EXT. 'mode' determines other critiria */
/* the files must meet before they'll be listed. 'mode' bit FL_NOHDR doesn't */
/* list the directory header. */
/* Returns -1 if the listing was aborted, otherwise total files listed */
/*****************************************************************************/
int sbbs_t::listfiles(uint dirnum, const char *filespec, int tofile, long mode)
{
char str[256],hdr[256],c,d,letter='A',*p,*datbuf,ext[513];
char tmp[512];
uchar* ixbbuf;
uchar flagprompt=0;
uint i,j;
int file,found=0,lastbat=0,disp;
long m=0,n,anchor=0,next,datbuflen;
int32_t l;
file_t f,bf[26]; /* bf is batch flagged files */
if(mode&FL_ULTIME) {
last_ns_time=now;
sprintf(str,"%s%s.dab",cfg.dir[dirnum]->data_dir,cfg.dir[dirnum]->code);
if((file=nopen(str,O_RDONLY))!=-1) {
read(file,&l,4);
close(file);
if(ns_time>(time_t)l)
return(0);
}
}
sprintf(str,"%s%s.ixb",cfg.dir[dirnum]->data_dir,cfg.dir[dirnum]->code);
if((file=nopen(str,O_RDONLY))==-1)
return(0);
l=(long)filelength(file);
if(!l) {
close(file);
return(0);
}
if((ixbbuf=(uchar *)malloc(l))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,l);
return(0);
}
if(lread(file,ixbbuf,l)!=l) {
close(file);
errormsg(WHERE,ERR_READ,str,l);
free((char *)ixbbuf);
return(0);
}
close(file);
sprintf(str,"%s%s.dat",cfg.dir[dirnum]->data_dir,cfg.dir[dirnum]->code);
if((file=nopen(str,O_RDONLY))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_RDONLY);
free((char *)ixbbuf);
return(0);
}
datbuflen=(long)filelength(file);
if((datbuf=(char *)malloc(datbuflen))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,datbuflen);
free((char *)ixbbuf);
return(0);
}
if(lread(file,datbuf,datbuflen)!=datbuflen) {
close(file);
errormsg(WHERE,ERR_READ,str,datbuflen);
free((char *)datbuf);
free((char *)ixbbuf);
return(0);
}
close(file);
if(!tofile) {
action=NODE_LFIL;
getnodedat(cfg.node_num,&thisnode,0);
if(thisnode.action!=NODE_LFIL) { /* was a sync */
if(getnodedat(cfg.node_num,&thisnode,true)==0) {
thisnode.action=NODE_LFIL;
putnodedat(cfg.node_num,&thisnode);
}
}
}
while(online && found<MAX_FILES) {
if(found<0)
found=0;
if(m>=l || flagprompt) { /* End of list */
if(useron.misc&BATCHFLAG && !tofile && found && found!=lastbat
&& !(mode&(FL_EXFIND|FL_VIEW))) {
flagprompt=0;
lncntr=0;
if((i=batchflagprompt(dirnum,bf,letter-'A',l/F_IXBSIZE))==2) {
m=anchor;
found-=letter-'A';
letter='A';
}
else if(i==3) {
if((long)anchor-((letter-'A')*F_IXBSIZE)<0) {
m=0;
found=0;
}
else {
m=anchor-((letter-'A')*F_IXBSIZE);
found-=letter-'A';
}
letter='A';
}
else if((int)i==-1) {
free((char *)ixbbuf);
free((char *)datbuf);
return(-1);
}
else
break;
getnodedat(cfg.node_num,&thisnode,0);
nodesync();
}
else
break;
}
if(letter>'Z')
letter='A';
if(letter=='A')
anchor=m;
if(msgabort()) { /* used to be !tofile && msgabort() */
free((char *)ixbbuf);
free((char *)datbuf);
return(-1);
}
for(j=0;j<12 && m<l;j++)
if(j==8)
str[j]=ixbbuf[m]>' ' ? '.' : ' ';
else
str[j]=ixbbuf[m++]; /* Turns FILENAMEEXT into FILENAME.EXT */
str[j]=0;
if(!(mode&(FL_FINDDESC|FL_EXFIND)) && filespec[0]
&& !filematch(str,filespec)) {
m+=11;
continue;
}
n=ixbbuf[m]|((long)ixbbuf[m+1]<<8)|((long)ixbbuf[m+2]<<16);
if(n>=datbuflen) { /* out of bounds */
m+=11;
continue;
}
if(mode&(FL_FINDDESC|FL_EXFIND)) {
getrec((char *)&datbuf[n],F_DESC,LEN_FDESC,tmp);
strupr(tmp);
p=strstr(tmp,filespec);
if(!(mode&FL_EXFIND) && p==NULL) {
m+=11;
continue;
}
getrec((char *)&datbuf[n],F_MISC,1,tmp);
j=tmp[0]; /* misc bits */
if(j) j-=' ';
if(mode&FL_EXFIND && j&FM_EXTDESC) { /* search extended description */
getextdesc(&cfg,dirnum,n,ext);
strupr(ext);
if(!strstr(ext,filespec) && !p) { /* not in description or */
m+=11; /* extended description */
continue;
}
}
else if(!p) { /* no extended description and not in desc */
m+=11;
continue; }
}
if(mode&FL_ULTIME) {
if(ns_time>(ixbbuf[m+3]|((long)ixbbuf[m+4]<<8)|((long)ixbbuf[m+5]<<16)
|((long)ixbbuf[m+6]<<24))) {
m+=11;
continue; }
}
if(useron.misc&BATCHFLAG && letter=='A' && found && !tofile
&& !(mode&(FL_EXFIND|FL_VIEW))
&& (!mode || !(useron.misc&EXPERT)))
bputs(text[FileListBatchCommands]);
m+=11;
if(!found && !(mode&(FL_EXFIND|FL_VIEW))) {
for(i=0;i<usrlibs;i++)
if(usrlib[i]==cfg.dir[dirnum]->lib)
break;
for(j=0;j<usrdirs[i];j++)
if(usrdir[i][j]==dirnum)
break; /* big header */
if((!mode || !(useron.misc&EXPERT)) && !tofile && (!filespec[0]
|| (strchr(filespec,'*') || strchr(filespec,'?')))) {
sprintf(hdr,"%s%s.hdr",cfg.dir[dirnum]->data_dir,cfg.dir[dirnum]->code);
if(fexistcase(hdr))
printfile(hdr,0); /* Use DATA\DIRS\<CODE>.HDR */
else {
if(useron.misc&BATCHFLAG)
bputs(text[FileListBatchCommands]);
else {
CLS;
d=strlen(cfg.lib[usrlib[i]]->lname)>strlen(cfg.dir[dirnum]->lname) ?
strlen(cfg.lib[usrlib[i]]->lname)+17
: strlen(cfg.dir[dirnum]->lname)+17;
if(i>8 || j>8) d++;
attr(cfg.color[clr_filelsthdrbox]);
bputs("ÉÍ"); /* use to start with \r\n */
for(c=0;c<d;c++)
outchar('Í');
bputs("»\r\nº ");
sprintf(hdr,text[BoxHdrLib],i+1,cfg.lib[usrlib[i]]->lname);
bputs(hdr);
for(c=bstrlen(hdr);c<d;c++)
outchar(' ');
bputs("º\r\nº ");
sprintf(hdr,text[BoxHdrDir],j+1,cfg.dir[dirnum]->lname);
bputs(hdr);
for(c=bstrlen(hdr);c<d;c++)
outchar(' ');
bputs("º\r\nº ");
sprintf(hdr,text[BoxHdrFiles],l/F_IXBSIZE);
bputs(hdr);
for(c=bstrlen(hdr);c<d;c++)
outchar(' ');
bputs("º\r\nÈÍ");
for(c=0;c<d;c++)
outchar('Í');
bputs("¼\r\n");
}
}
}
else { /* short header */
if(tofile) {
sprintf(hdr,"(%u) %s ",i+1,cfg.lib[usrlib[i]]->sname);
write(tofile,crlf,2);
write(tofile,hdr,strlen(hdr));
}
else {
sprintf(hdr,text[ShortHdrLib],i+1,cfg.lib[usrlib[i]]->sname);
bputs("\r\1>\r\n");
bputs(hdr);
}
c=bstrlen(hdr);
if(tofile) {
sprintf(hdr,"(%u) %s",j+1,cfg.dir[dirnum]->lname);
write(tofile,hdr,strlen(hdr));
}
else {
sprintf(hdr,text[ShortHdrDir],j+1,cfg.dir[dirnum]->lname);
bputs(hdr);
}
c+=bstrlen(hdr);
if(tofile) {
write(tofile,crlf,2);
sprintf(hdr,"%*s",c,nulstr);
memset(hdr,'Ä',c);
strcat(hdr,crlf);
write(tofile,hdr,strlen(hdr));
}
else {
CRLF;
attr(cfg.color[clr_filelstline]);
while(c--)
outchar('Ä');
CRLF;
}
}
}
next=m;
disp=1;
if(mode&(FL_EXFIND|FL_VIEW)) {
f.dir=dirnum;
strcpy(f.name,str);
m-=11;
f.datoffset=n;
f.dateuled=ixbbuf[m+3]|((long)ixbbuf[m+4]<<8)
|((long)ixbbuf[m+5]<<16)|((long)ixbbuf[m+6]<<24);
f.datedled=ixbbuf[m+7]|((long)ixbbuf[m+8]<<8)
|((long)ixbbuf[m+9]<<16)|((long)ixbbuf[m+10]<<24);
m+=11;
f.size=0;
getfiledat(&cfg,&f);
if(!found)
bputs("\r\1>");
if(mode&FL_EXFIND) {
if(!viewfile(&f,1)) {
free((char *)ixbbuf);
free((char *)datbuf);
return(-1); }
}
else {
if(!viewfile(&f,0)) {
free((char *)ixbbuf);
free((char *)datbuf);
return(-1);
}
}
}
else if(tofile)
listfiletofile(str,&datbuf[n],dirnum,tofile);
else if(mode&FL_FINDDESC)
disp=listfile(str,&datbuf[n],dirnum,filespec,letter,n);
else
disp=listfile(str,&datbuf[n],dirnum,nulstr,letter,n);
if(!disp && letter>'A') {
next=m-F_IXBSIZE;
letter--;
}
else {
disp=1;
found++;
}
if(sys_status&SS_ABORT) {
free((char *)ixbbuf);
free((char *)datbuf);
return(-1);
}
if(mode&(FL_EXFIND|FL_VIEW))
continue;
if(useron.misc&BATCHFLAG && !tofile) {
if(disp) {
strcpy(bf[letter-'A'].name,str);
m-=11;
bf[letter-'A'].datoffset=n;
bf[letter-'A'].dateuled=ixbbuf[m+3]|((long)ixbbuf[m+4]<<8)
|((long)ixbbuf[m+5]<<16)|((long)ixbbuf[m+6]<<24);
bf[letter-'A'].datedled=ixbbuf[m+7]|((long)ixbbuf[m+8]<<8)
|((long)ixbbuf[m+9]<<16)|((long)ixbbuf[m+10]<<24);
}
m+=11;
if(flagprompt || letter=='Z' || !disp ||
(filespec[0] && !strchr(filespec,'*') && !strchr(filespec,'?')
&& !(mode&FL_FINDDESC))
|| (useron.misc&BATCHFLAG && !tofile && lncntr>=rows-2)
) {
flagprompt=0;
lncntr=0;
lastbat=found;
if((int)(i=batchflagprompt(dirnum,bf,letter-'A'+1,l/F_IXBSIZE))<1) {
free((char *)ixbbuf);
free((char *)datbuf);
if((int)i==-1)
return(-1);
else
return(found);
}
if(i==2) {
next=anchor;
found-=(letter-'A')+1;
}
else if(i==3) {
if((long)anchor-((letter-'A'+1)*F_IXBSIZE)<0) {
next=0;
found=0;
}
else {
next=anchor-((letter-'A'+1)*F_IXBSIZE);
found-=letter-'A'+1; }
}
getnodedat(cfg.node_num,&thisnode,0);
nodesync();
letter='A'; }
else letter++;
}
if(useron.misc&BATCHFLAG && !tofile
&& lncntr>=rows-2) {
lncntr=0; /* defeat pause() */
flagprompt=1;
}
m=next;
if(mode&FL_FINDDESC) continue;
if(filespec[0] && !strchr(filespec,'*') && !strchr(filespec,'?') && m)
break;
}
free((char *)ixbbuf);
free((char *)datbuf);
return(found);
}
/****************************************************************************/
/* Prints one file's information on a single line */
/* Return 1 if displayed, 0 otherwise */
/****************************************************************************/
bool sbbs_t::listfile(const char *fname, const char *buf, uint dirnum
, const char *search, const char letter, ulong datoffset)
{
char str[256],ext[513]="",*ptr,*cr,*lf,exist=1;
char path[MAX_PATH+1];
char tmp[512];
uchar alt;
int i,j;
ulong cdt;
if(buf[F_MISC]!=ETX && (buf[F_MISC]-' ')&FM_EXTDESC && useron.misc&EXTDESC) {
getextdesc(&cfg,dirnum,datoffset,ext);
if(useron.misc&BATCHFLAG && lncntr+extdesclines(ext)>=rows-2 && letter!='A')
return(false);
}
attr(cfg.color[clr_filename]);
bputs(fname);
getrec(buf,F_ALTPATH,2,str);
alt=(uchar)ahtoul(str);
sprintf(path,"%s%s",alt>0 && alt<=cfg.altpaths ? cfg.altpath[alt-1]:cfg.dir[dirnum]->path
,unpadfname(fname,tmp));
if(buf[F_MISC]!=ETX && (buf[F_MISC]-' ')&FM_EXTDESC) {
if(!(useron.misc&EXTDESC))
outchar('+');
else
outchar(' ');
}
else
outchar(' ');
if(useron.misc&BATCHFLAG) {
attr(cfg.color[clr_filedesc]);
bprintf("%c",letter);
}
if(cfg.dir[dirnum]->misc&DIR_FCHK && !fexistcase(path)) {
exist=0;
attr(cfg.color[clr_err]);
}
else
attr(cfg.color[clr_filecdt]);
getrec(buf,F_CDT,LEN_FCDT,str);
cdt=atol(str);
if(useron.misc&BATCHFLAG) {
if(!cdt) {
attr(curatr^(HIGH|BLINK));
bputs(" FREE");
}
else {
if(cdt<1024) /* 1k is smallest size */
cdt=1024;
if(cdt>(99999*1024))
bprintf("%5luM",cdt/(1024*1024));
else
bprintf("%5luk",cdt/1024L); }
}
else {
if(!cdt) { /* FREE file */
attr(curatr^(HIGH|BLINK));
bputs(" FREE");
}
else if(cdt>9999999L)
bprintf("%6luk",cdt/1024L);
else
bprintf("%7lu",cdt);
}
if(exist)
outchar(' ');
else
outchar('-');
getrec(buf,F_DESC,LEN_FDESC,str);
attr(cfg.color[clr_filedesc]);
#ifdef _WIN32
if(exist && !(cfg.file_misc&FM_NO_LFN)) {
fexistcase(path); /* Get real (long?) filename */
ptr=getfname(path);
if(stricmp(ptr,tmp) && stricmp(ptr,str))
bprintf("%.*s\r\n%21s",LEN_FDESC,ptr,"");
}
#endif
if(!ext[0]) {
if(search[0]) { /* high-light string in string */
strcpy(tmp,str);
strupr(tmp);
ptr=strstr(tmp,search);
i=strlen(search);
j=ptr-tmp;
bprintf("%.*s",j,str);
attr(cfg.color[clr_filedesc]^HIGH);
bprintf("%.*s",i,str+j);
attr(cfg.color[clr_filedesc]);
bprintf("%.*s",strlen(str)-(j+i),str+j+i);
}
else
bputs(str);
CRLF;
}
ptr=ext;
while(*ptr && ptr<ext+512 && !msgabort()) {
cr=strchr(ptr,CR);
lf=strchr(ptr,LF);
if(lf && (lf<cr || !cr)) cr=lf;
if(cr>ptr+LEN_FDESC)
cr=ptr+LEN_FDESC;
else if(cr)
*cr=0;
sprintf(str,"%.*s\r\n",LEN_FDESC,ptr);
putmsg(str,P_NOATCODES|P_SAVEATR);
if(!cr) {
if(strlen(ptr)>LEN_FDESC)
cr=ptr+LEN_FDESC;
else
break;
}
if(!(*(cr+1)) || !(*(cr+2)))
break;
bprintf("%21s",nulstr);
ptr=cr;
if(!(*ptr)) ptr++;
while(*ptr==LF || *ptr==CR) ptr++;
}
return(true);
}
/****************************************************************************/
/* Remove credits from uploader of file 'f' */
/****************************************************************************/
bool sbbs_t::removefcdt(file_t* f)
{
char str[128];
char tmp[512];
int u;
long cdt;
if((u=matchuser(&cfg,f->uler,TRUE /*sysop_alias*/))==0) {
bputs(text[UnknownUser]);
return(false);
}
cdt=0L;
if(cfg.dir[f->dir]->misc&DIR_CDTMIN && cur_cps) {
if(cfg.dir[f->dir]->misc&DIR_CDTUL)
cdt=((ulong)(f->cdt*(cfg.dir[f->dir]->up_pct/100.0))/cur_cps)/60;
if(cfg.dir[f->dir]->misc&DIR_CDTDL
&& f->timesdled) /* all downloads */
cdt+=((ulong)((long)f->timesdled
*f->cdt*(cfg.dir[f->dir]->dn_pct/100.0))/cur_cps)/60;
adjustuserrec(&cfg,u,U_MIN,10,-cdt);
sprintf(str,"%lu minute",cdt);
sprintf(tmp,text[FileRemovedUserMsg]
,f->name,cdt ? str : text[No]);
putsmsg(&cfg,u,tmp);
}
else {
if(cfg.dir[f->dir]->misc&DIR_CDTUL)
cdt=(ulong)(f->cdt*(cfg.dir[f->dir]->up_pct/100.0));
if(cfg.dir[f->dir]->misc&DIR_CDTDL
&& f->timesdled) /* all downloads */
cdt+=(ulong)((long)f->timesdled
*f->cdt*(cfg.dir[f->dir]->dn_pct/100.0));
adjustuserrec(&cfg,u,U_CDT,10,-cdt);
sprintf(tmp,text[FileRemovedUserMsg]
,f->name,cdt ? ultoac(cdt,str) : text[No]);
putsmsg(&cfg,u,tmp);
}
adjustuserrec(&cfg,u,U_ULB,10,-f->size);
adjustuserrec(&cfg,u,U_ULS,5,-1);
return(true);
}
bool sbbs_t::removefile(file_t* f)
{
char str[256];
if(removefiledat(&cfg,f)) {
SAFEPRINTF4(str,"%s removed %s from %s %s"
,useron.alias
,f->name
,cfg.lib[cfg.dir[f->dir]->lib]->sname,cfg.dir[f->dir]->sname);
logline("U-",str);
return(true);
}
SAFEPRINTF2(str,"%s %s",cfg.lib[cfg.dir[f->dir]->lib]->sname,cfg.dir[f->dir]->sname);
errormsg(WHERE, ERR_REMOVE, f->name, 0, str);
return(false);
}
/****************************************************************************/
/* Move file 'f' from f.dir to newdir */
/****************************************************************************/
bool sbbs_t::movefile(file_t* f, int newdir)
{
char str[MAX_PATH+1],path[MAX_PATH+1],fname[128],ext[1024];
int olddir=f->dir;
if(findfile(&cfg,newdir,f->name)) {
bprintf(text[FileAlreadyThere],f->name);
return(false);
}
getextdesc(&cfg,olddir,f->datoffset,ext);
if(cfg.dir[olddir]->misc&DIR_MOVENEW)
f->dateuled=time32(NULL);
unpadfname(f->name,fname);
removefiledat(&cfg,f);
f->dir=newdir;
addfiledat(&cfg,f);
bprintf(text[MovedFile],f->name
,cfg.lib[cfg.dir[f->dir]->lib]->sname,cfg.dir[f->dir]->sname);
sprintf(str,"%s moved %s to %s %s",f->name
,useron.alias
,cfg.lib[cfg.dir[f->dir]->lib]->sname,cfg.dir[f->dir]->sname);
logline(nulstr,str);
if(!f->altpath) { /* move actual file */
sprintf(str,"%s%s",cfg.dir[olddir]->path,fname);
if(fexistcase(str)) {
sprintf(path,"%s%s",cfg.dir[f->dir]->path,getfname(str));
mv(str,path,0);
}
}
if(f->misc&FM_EXTDESC)
putextdesc(&cfg,f->dir,f->datoffset,ext);
return(true);
}
/****************************************************************************/
/* Batch flagging prompt for download, extended info, and archive viewing */
/* Returns -1 if 'Q' or Ctrl-C, 0 if skip, 1 if [Enter], 2 otherwise */
/* or 3, backwards. */
/****************************************************************************/
int sbbs_t::batchflagprompt(uint dirnum, file_t* bf, uint total
,long totalfiles)
{
char ch,c,d,str[256],fname[128],*p,remcdt=0,remfile=0;
char tmp[512];
uint i,j,ml=0,md=0,udir,ulib;
file_t f;
for(ulib=0;ulib<usrlibs;ulib++)
if(usrlib[ulib]==cfg.dir[dirnum]->lib)
break;
for(udir=0;udir<usrdirs[ulib];udir++)
if(usrdir[ulib][udir]==dirnum)
break;
CRLF;
while(online) {
bprintf(text[BatchFlagPrompt]
,ulib+1
,cfg.lib[cfg.dir[dirnum]->lib]->sname
,udir+1
,cfg.dir[dirnum]->sname
,totalfiles);
ch=getkey(K_UPPER);
clearline();
if(ch=='?') {
menu("batflag");
if(lncntr)
pause();
return(2);
}
if(ch=='Q' || sys_status&SS_ABORT)
return(-1);
if(ch=='S')
return(0);
if(ch=='P' || ch=='-')
return(3);
if(ch=='B') { /* Flag for batch download */
if(useron.rest&FLAG('D')) {
bputs(text[R_Download]);
return(2);
}
if(total==1) {
f.dir=dirnum;
strcpy(f.name,bf[0].name);
f.datoffset=bf[0].datoffset;
f.size=0;
getfiledat(&cfg,&f);
addtobatdl(&f);
CRLF;
return(2);
}
bputs(text[BatchDlFlags]);
d=getstr(str,BF_MAX,K_UPPER|K_LOWPRIO|K_NOCRLF);
lncntr=0;
if(sys_status&SS_ABORT)
return(-1);
if(d) { /* d is string length */
CRLF;
lncntr=0;
for(c=0;c<d;c++) {
if(batdn_total>=cfg.max_batdn) {
bprintf(text[BatchDlQueueIsFull],str+c);
break;
}
if(strchr(str+c,'.')) { /* filename or spec given */
f.dir=dirnum;
p=strchr(str+c,' ');
if(!p) p=strchr(str+c,',');
if(p) *p=0;
for(i=0;i<total;i++) {
if(batdn_total>=cfg.max_batdn) {
bprintf(text[BatchDlQueueIsFull],str+c);
break;
}
padfname(str+c,tmp);
if(filematch(bf[i].name,tmp)) {
strcpy(f.name,bf[i].name);
f.datoffset=bf[i].datoffset;
f.size=0;
getfiledat(&cfg,&f);
addtobatdl(&f);
}
}
}
if(strchr(str+c,'.'))
c+=strlen(str+c);
else if(str[c]<'A'+(char)total && str[c]>='A') {
f.dir=dirnum;
strcpy(f.name,bf[str[c]-'A'].name);
f.datoffset=bf[str[c]-'A'].datoffset;
f.size=0;
getfiledat(&cfg,&f);
addtobatdl(&f); }
}
CRLF;
return(2);
}
clearline();
continue;
}
if(ch=='E' || ch=='V') { /* Extended Info */
if(total==1) {
f.dir=dirnum;
strcpy(f.name,bf[0].name);
f.datoffset=bf[0].datoffset;
f.dateuled=bf[0].dateuled;
f.datedled=bf[0].datedled;
f.size=0;
getfiledat(&cfg,&f);
if(!viewfile(&f,ch=='E'))
return(-1);
return(2);
}
bputs(text[BatchDlFlags]);
d=getstr(str,BF_MAX,K_UPPER|K_LOWPRIO|K_NOCRLF);
lncntr=0;
if(sys_status&SS_ABORT)
return(-1);
if(d) { /* d is string length */
CRLF;
lncntr=0;
for(c=0;c<d;c++) {
if(strchr(str+c,'.')) { /* filename or spec given */
f.dir=dirnum;
p=strchr(str+c,' ');
if(!p) p=strchr(str+c,',');
if(p) *p=0;
for(i=0;i<total;i++) {
padfname(str+c,tmp);
if(filematch(bf[i].name,tmp)) {
strcpy(f.name,bf[i].name);
f.datoffset=bf[i].datoffset;
f.dateuled=bf[i].dateuled;
f.datedled=bf[i].datedled;
f.size=0;
getfiledat(&cfg,&f);
if(!viewfile(&f,ch=='E'))
return(-1);
}
}
}
if(strchr(str+c,'.'))
c+=strlen(str+c);
else if(str[c]<'A'+(char)total && str[c]>='A') {
f.dir=dirnum;
strcpy(f.name,bf[str[c]-'A'].name);
f.datoffset=bf[str[c]-'A'].datoffset;
f.dateuled=bf[str[c]-'A'].dateuled;
f.datedled=bf[str[c]-'A'].datedled;
f.size=0;
getfiledat(&cfg,&f);
if(!viewfile(&f,ch=='E'))
return(-1); }
}
return(2);
}
clearline();
continue;
}
if((ch=='D' || ch=='M') /* Delete or Move */
&& !(useron.rest&FLAG('R'))
&& (dir_op(dirnum) || useron.exempt&FLAG('R'))) {
if(total==1) {
strcpy(str,"A");
d=1;
}
else {
bputs(text[BatchDlFlags]);
d=getstr(str,BF_MAX,K_UPPER|K_LOWPRIO|K_NOCRLF);
}
lncntr=0;
if(sys_status&SS_ABORT)
return(-1);
if(d) { /* d is string length */
CRLF;
if(ch=='D') {
if(noyes(text[AreYouSureQ]))
return(2);
remcdt=remfile=1;
if(dir_op(dirnum)) {
remcdt=!noyes(text[RemoveCreditsQ]);
remfile=!noyes(text[DeleteFileQ]); }
}
else if(ch=='M') {
CRLF;
for(i=0;i<usrlibs;i++)
bprintf(text[MoveToLibLstFmt],i+1,cfg.lib[usrlib[i]]->lname);
SYNC;
bprintf(text[MoveToLibPrompt],cfg.dir[dirnum]->lib+1);
if((int)(ml=getnum(usrlibs))==-1)
return(2);
if(!ml)
ml=cfg.dir[dirnum]->lib;
else
ml--;
CRLF;
for(j=0;j<usrdirs[ml];j++)
bprintf(text[MoveToDirLstFmt]
,j+1,cfg.dir[usrdir[ml][j]]->lname);
SYNC;
bprintf(text[MoveToDirPrompt],usrdirs[ml]);
if((int)(md=getnum(usrdirs[ml]))==-1)
return(2);
if(!md)
md=usrdirs[ml]-1;
else md--;
CRLF;
}
lncntr=0;
for(c=0;c<d;c++) {
if(strchr(str+c,'.')) { /* filename or spec given */
f.dir=dirnum;
p=strchr(str+c,' ');
if(!p) p=strchr(str+c,',');
if(p) *p=0;
for(i=0;i<total;i++) {
padfname(str+c,tmp);
if(filematch(bf[i].name,tmp)) {
strcpy(f.name,bf[i].name);
unpadfname(f.name,fname);
f.datoffset=bf[i].datoffset;
f.dateuled=bf[i].dateuled;
f.datedled=bf[i].datedled;
f.size=0;
getfiledat(&cfg,&f);
if(f.opencount) {
bprintf(text[FileIsOpen]
,f.opencount,f.opencount>1 ? "s":nulstr);
continue;
}
if(ch=='D') {
removefile(&f);
if(remfile) {
sprintf(tmp,"%s%s",cfg.dir[f.dir]->path,fname);
remove(tmp);
}
if(remcdt)
removefcdt(&f);
}
else if(ch=='M')
movefile(&f,usrdir[ml][md]);
}
}
}
if(strchr(str+c,'.'))
c+=strlen(str+c);
else if(str[c]<'A'+(char)total && str[c]>='A') {
f.dir=dirnum;
strcpy(f.name,bf[str[c]-'A'].name);
unpadfname(f.name,fname);
f.datoffset=bf[str[c]-'A'].datoffset;
f.dateuled=bf[str[c]-'A'].dateuled;
f.datedled=bf[str[c]-'A'].datedled;
f.size=0;
getfiledat(&cfg,&f);
if(f.opencount) {
bprintf(text[FileIsOpen]
,f.opencount,f.opencount>1 ? "s":nulstr);
continue;
}
if(ch=='D') {
removefile(&f);
if(remfile) {
sprintf(tmp,"%s%s",cfg.dir[f.dir]->path,fname);
remove(tmp);
}
if(remcdt)
removefcdt(&f);
}
else if(ch=='M')
movefile(&f,usrdir[ml][md]); }
}
return(2);
}
clearline();
continue;
}
return(1);
}
return(-1);
}
/****************************************************************************/
/* List detailed information about the files in 'filespec'. Prompts for */
/* action depending on 'mode.' */
/* Returns number of files matching filespec that were found */
/****************************************************************************/
int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
{
char str[258],path[258],dirpath[256],done=0,ch,fname[13],ext[513];
char tmp[512];
uchar *ixbbuf,*usrxfrbuf=NULL,*p;
int file;
int error;
int found=0;
uint i,j;
long usrxfrlen=0;
long m,l;
long usrcdt;
time_t start,end,t;
file_t f;
struct tm tm;
sprintf(str,"%sxfer.ixt",cfg.data_dir);
if(mode==FI_USERXFER) {
if(flength(str)<1L)
return(0);
if((file=nopen(str,O_RDONLY))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_RDONLY);
return(0);
}
usrxfrlen=(long)filelength(file);
if((usrxfrbuf=(uchar *)malloc(usrxfrlen))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,usrxfrlen);
return(0);
}
if(read(file,usrxfrbuf,usrxfrlen)!=usrxfrlen) {
close(file);
free(usrxfrbuf);
errormsg(WHERE,ERR_READ,str,usrxfrlen);
return(0);
}
close(file);
}
sprintf(str,"%s%s.ixb",cfg.dir[dirnum]->data_dir,cfg.dir[dirnum]->code);
if((file=nopen(str,O_RDONLY))==-1)
return(0);
l=(long)filelength(file);
if(!l) {
close(file);
return(0);
}
if((ixbbuf=(uchar *)malloc(l))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,l);
return(0);
}
if(lread(file,ixbbuf,l)!=l) {
close(file);
errormsg(WHERE,ERR_READ,str,l);
free((char *)ixbbuf);
if(usrxfrbuf)
free(usrxfrbuf);
return(0);
}
close(file);
sprintf(str,"%s%s.dat",cfg.dir[dirnum]->data_dir,cfg.dir[dirnum]->code);
if((file=nopen(str,O_RDONLY))==-1) {
errormsg(WHERE,ERR_READ,str,O_RDONLY);
free((char *)ixbbuf);
if(usrxfrbuf)
free(usrxfrbuf);
return(0);
}
close(file);
m=0;
while(online && !done && m<l) {
if(mode==FI_REMOVE && dir_op(dirnum))
action=NODE_SYSP;
else action=NODE_LFIL;
if(msgabort()) {
found=-1;
break;
}
for(i=0;i<12 && m<l;i++)
if(i==8)
str[i]=ixbbuf[m]>' ' ? '.' : ' ';
else
str[i]=ixbbuf[m++]; /* Turns FILENAMEEXT into FILENAME.EXT */
str[i]=0;
unpadfname(str,fname);
if(filespec[0] && !filematch(str,filespec)) {
m+=11;
continue;
}
f.datoffset=ixbbuf[m]|((long)ixbbuf[m+1]<<8)|((long)ixbbuf[m+2]<<16);
f.dateuled=ixbbuf[m+3]|((long)ixbbuf[m+4]<<8)
|((long)ixbbuf[m+5]<<16)|((long)ixbbuf[m+6]<<24);
f.datedled=ixbbuf[m+7]|((long)ixbbuf[m+8]<<8)
|((long)ixbbuf[m+9]<<16)|((long)ixbbuf[m+10]<<24);
m+=11;
if(mode==FI_OLD && f.datedled>ns_time)
continue;
if((mode==FI_OLDUL || mode==FI_OLD) && f.dateuled>ns_time)
continue;
f.dir=curdirnum=dirnum;
strcpy(f.name,str);
f.size=0;
getfiledat(&cfg,&f);
if(mode==FI_OFFLINE && f.size>=0)
continue;
if(f.altpath>0 && f.altpath<=cfg.altpaths)
strcpy(dirpath,cfg.altpath[f.altpath-1]);
else
strcpy(dirpath,cfg.dir[f.dir]->path);
if(mode==FI_CLOSE && !f.opencount)
continue;
if(mode==FI_USERXFER) {
for(p=usrxfrbuf;p<usrxfrbuf+usrxfrlen;p+=24) {
sprintf(str,"%17.17s",p); /* %4.4u %12.12s */
if(!strcmp(str+5,f.name) && useron.number==atoi(str))
break;
}
if(p>=usrxfrbuf+usrxfrlen) /* file wasn't found */
continue;
}
if((mode==FI_REMOVE) && (!dir_op(dirnum) && stricmp(f.uler
,useron.alias) && !(useron.exempt&FLAG('R'))))
continue;
found++;
if(mode==FI_INFO) {
if(!viewfile(&f,1)) {
done=1;
found=-1; }
}
else
fileinfo(&f);
if(mode==FI_CLOSE) {
if(!noyes(text[CloseFileRecordQ])) {
f.opencount=0;
putfiledat(&cfg,&f); }
}
else if(mode==FI_REMOVE || mode==FI_OLD || mode==FI_OLDUL
|| mode==FI_OFFLINE) {
SYNC;
CRLF;
if(f.opencount) {
mnemonics(text[QuitOrNext]);
strcpy(str,"Q\r");
}
else if(dir_op(dirnum)) {
mnemonics(text[SysopRemoveFilePrompt]);
strcpy(str,"VEFMCQR\r");
}
else if(useron.exempt&FLAG('R')) {
mnemonics(text[RExemptRemoveFilePrompt]);
strcpy(str,"VEMQR\r");
}
else {
mnemonics(text[UserRemoveFilePrompt]);
strcpy(str,"VEQR\r");
}
switch(getkeys(str,0)) {
case 'V':
viewfilecontents(&f);
CRLF;
ASYNC;
pause();
m-=F_IXBSIZE;
continue;
case 'E': /* edit file information */
if(dir_op(dirnum)) {
bputs(text[EditFilename]);
strcpy(str,fname);
if(!getstr(str,12,K_EDIT|K_AUTODEL))
break;
if(strcmp(str,fname)) { /* rename */
padfname(str,path);
if(stricmp(str,fname)
&& findfile(&cfg,f.dir,path))
bprintf(text[FileAlreadyThere],path);
else {
sprintf(path,"%s%s",dirpath,fname);
sprintf(tmp,"%s%s",dirpath,str);
if(fexistcase(path) && rename(path,tmp))
bprintf(text[CouldntRenameFile],path,tmp);
else {
bprintf(text[FileRenamed],path,tmp);
strcpy(fname,str);
removefiledat(&cfg,&f);
strcpy(f.name,padfname(str,tmp));
addfiledat(&cfg,&f);
}
}
}
}
bputs(text[EditDescription]);
getstr(f.desc,LEN_FDESC,K_LINE|K_EDIT|K_AUTODEL);
if(sys_status&SS_ABORT)
break;
if(f.misc&FM_EXTDESC) {
if(!noyes(text[DeleteExtDescriptionQ])) {
remove(str);
f.misc&=~FM_EXTDESC; }
}
if(!dir_op(dirnum)) {
putfiledat(&cfg,&f);
break;
}
bputs(text[EditUploader]);
if(!getstr(f.uler,LEN_ALIAS,K_EDIT|K_AUTODEL))
break;
ultoa(f.cdt,str,10);
bputs(text[EditCreditValue]);
getstr(str,10,K_NUMBER|K_EDIT|K_AUTODEL);
if(sys_status&SS_ABORT)
break;
f.cdt=atol(str);
ultoa(f.timesdled,str,10);
bputs(text[EditTimesDownloaded]);
getstr(str,5,K_NUMBER|K_EDIT|K_AUTODEL);
if(sys_status&SS_ABORT)
break;
f.timesdled=atoi(str);
if(f.opencount) {
ultoa(f.opencount,str,10);
bputs(text[EditOpenCount]);
getstr(str,3,K_NUMBER|K_EDIT|K_AUTODEL);
f.opencount=atoi(str);
}
if(cfg.altpaths || f.altpath) {
ultoa(f.altpath,str,10);
bputs(text[EditAltPath]);
getstr(str,3,K_NUMBER|K_EDIT|K_AUTODEL);
f.altpath=atoi(str);
if(f.altpath>cfg.altpaths)
f.altpath=0;
}
if(sys_status&SS_ABORT)
break;
putfiledat(&cfg,&f);
inputnstime32(&f.dateuled);
update_uldate(&cfg, &f);
break;
case 'F': /* delete file only */
sprintf(str,"%s%s",dirpath,fname);
if(!fexistcase(str))
bprintf(text[FileDoesNotExist],str);
else {
if(!noyes(text[AreYouSureQ])) {
if(remove(str))
bprintf(text[CouldntRemoveFile],str);
else {
sprintf(tmp,"%s deleted %s"
,useron.alias
,str);
logline(nulstr,tmp);
}
}
}
break;
case 'R': /* remove file from database */
if(noyes(text[AreYouSureQ]))
break;
removefile(&f);
sprintf(str,"%s%s",dirpath,fname);
if(fexistcase(str)) {
if(dir_op(dirnum)) {
if(!noyes(text[DeleteFileQ])) {
if(remove(str))
bprintf(text[CouldntRemoveFile],str);
else {
sprintf(tmp,"%s deleted %s"
,useron.alias
,str);
logline(nulstr,tmp);
}
}
}
else if(remove(str)) /* always remove if not sysop */
bprintf(text[CouldntRemoveFile],str);
}
if(dir_op(dirnum) || useron.exempt&FLAG('R')) {
i=cfg.lib[cfg.dir[f.dir]->lib]->offline_dir;
if(i!=dirnum && i!=INVALID_DIR
&& !findfile(&cfg,i,f.name)) {
sprintf(str,text[AddToOfflineDirQ]
,fname,cfg.lib[cfg.dir[i]->lib]->sname,cfg.dir[i]->sname);
if(yesno(str)) {
getextdesc(&cfg,f.dir,f.datoffset,ext);
f.dir=i;
addfiledat(&cfg,&f);
if(f.misc&FM_EXTDESC)
putextdesc(&cfg,f.dir,f.datoffset,ext);
}
}
}
if(dir_op(dirnum) || stricmp(f.uler,useron.alias)) {
if(noyes(text[RemoveCreditsQ]))
/* Fall through */ break;
}
case 'C': /* remove credits only */
if((i=matchuser(&cfg,f.uler,TRUE /*sysop_alias*/))==0) {
bputs(text[UnknownUser]);
break;
}
if(dir_op(dirnum)) {
usrcdt=(ulong)(f.cdt*(cfg.dir[f.dir]->up_pct/100.0));
if(f.timesdled) /* all downloads */
usrcdt+=(ulong)((long)f.timesdled
*f.cdt*(cfg.dir[f.dir]->dn_pct/100.0));
ultoa(usrcdt,str,10);
bputs(text[CreditsToRemove]);
getstr(str,10,K_NUMBER|K_LINE|K_EDIT|K_AUTODEL);
f.cdt=atol(str);
}
usrcdt=adjustuserrec(&cfg,i,U_CDT,10,-(long)f.cdt);
if(i==useron.number)
useron.cdt=usrcdt;
sprintf(str,text[FileRemovedUserMsg]
,f.name,f.cdt ? ultoac(f.cdt,tmp) : text[No]);
putsmsg(&cfg,i,str);
usrcdt=adjustuserrec(&cfg,i,U_ULB,10,-f.size);
if(i==useron.number)
useron.ulb=usrcdt;
usrcdt=adjustuserrec(&cfg,i,U_ULS,5,-1);
if(i==useron.number)
useron.uls=(ushort)usrcdt;
break;
case 'M': /* move the file to another dir */
CRLF;
for(i=0;i<usrlibs;i++)
bprintf(text[MoveToLibLstFmt],i+1,cfg.lib[usrlib[i]]->lname);
SYNC;
bprintf(text[MoveToLibPrompt],cfg.dir[dirnum]->lib+1);
if((int)(i=getnum(usrlibs))==-1)
continue;
if(!i)
i=cfg.dir[dirnum]->lib;
else
i--;
CRLF;
for(j=0;j<usrdirs[i];j++)
bprintf(text[MoveToDirLstFmt]
,j+1,cfg.dir[usrdir[i][j]]->lname);
SYNC;
bprintf(text[MoveToDirPrompt],usrdirs[i]);
if((int)(j=getnum(usrdirs[i]))==-1)
continue;
if(!j)
j=usrdirs[i]-1;
else j--;
CRLF;
movefile(&f,usrdir[i][j]);
break;
case 'Q': /* quit */
found=-1;
done=1;
break; }
}
else if(mode==FI_DOWNLOAD || mode==FI_USERXFER) {
sprintf(path,"%s%s",dirpath,fname);
if(f.size<1L) { /* getfiledat will set this to -1 if non-existant */
SYNC; /* and 0 byte files shouldn't be d/led */
mnemonics(text[QuitOrNext]);
if(getkeys("\rQ",0)=='Q') {
found=-1;
break;
}
continue;
}
if(!is_download_free(&cfg,f.dir,&useron,&client)
&& f.cdt>(useron.cdt+useron.freecdt)) {
SYNC;
bprintf(text[YouOnlyHaveNCredits]
,ultoac(useron.cdt+useron.freecdt,tmp));
mnemonics(text[QuitOrNext]);
if(getkeys("\rQ",0)=='Q') {
found=-1;
break;
}
continue;
}
if(!chk_ar(cfg.dir[f.dir]->dl_ar,&useron,&client)) {
SYNC;
bputs(text[CantDownloadFromDir]);
mnemonics(text[QuitOrNext]);
if(getkeys("\rQ",0)=='Q') {
found=-1;
break;
}
continue;
}
if(!(cfg.dir[f.dir]->misc&DIR_TFREE) && f.timetodl>timeleft && !dir_op(dirnum)
&& !(useron.exempt&FLAG('T'))) {
SYNC;
bputs(text[NotEnoughTimeToDl]);
mnemonics(text[QuitOrNext]);
if(getkeys("\rQ",0)=='Q') {
found=-1;
break;
}
continue;
}
xfer_prot_menu(XFER_DOWNLOAD);
openfile(&f);
SYNC;
mnemonics(text[ProtocolBatchQuitOrNext]);
strcpy(str,"BQ\r");
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->dlcmd[0]
&& chk_ar(cfg.prot[i]->ar,&useron,&client)) {
sprintf(tmp,"%c",cfg.prot[i]->mnemonic);
strcat(str,tmp);
}
// ungetkey(useron.prot);
ch=(char)getkeys(str,0);
if(ch=='Q') {
found=-1;
done=1;
}
else if(ch=='B') {
if(!addtobatdl(&f)) {
closefile(&f);
break; }
}
else if(ch!=CR) {
for(i=0;i<cfg.total_prots;i++)
if(cfg.prot[i]->dlcmd[0] && cfg.prot[i]->mnemonic==ch
&& chk_ar(cfg.prot[i]->ar,&useron,&client))
break;
if(i<cfg.total_prots) {
{
delfiles(cfg.temp_dir,ALLFILES);
if(cfg.dir[f.dir]->seqdev) {
lncntr=0;
seqwait(cfg.dir[f.dir]->seqdev);
bprintf(text[RetrievingFile],fname);
sprintf(str,"%s%s",dirpath,fname);
sprintf(path,"%s%s",cfg.temp_dir,fname);
mv(str,path,1); /* copy the file to temp dir */
if(getnodedat(cfg.node_num,&thisnode,true)==0) {
thisnode.aux=0xf0;
putnodedat(cfg.node_num,&thisnode);
}
CRLF;
}
for(j=0;j<cfg.total_dlevents;j++)
if(!stricmp(cfg.dlevent[j]->ext,f.name+9)
&& chk_ar(cfg.dlevent[j]->ar,&useron,&client)) {
bputs(cfg.dlevent[j]->workstr);
external(cmdstr(cfg.dlevent[j]->cmd,path,nulstr,NULL)
,EX_OUTL);
CRLF;
}
getnodedat(cfg.node_num,&thisnode,1);
action=NODE_DLNG;
t=now+f.timetodl;
localtime_r(&t,&tm);
thisnode.aux=(tm.tm_hour*60)+tm.tm_min;
putnodedat(cfg.node_num,&thisnode); /* calculate ETA */
start=time(NULL);
error=protocol(cfg.prot[i],XFER_DOWNLOAD,path,nulstr,false);
end=time(NULL);
if(cfg.dir[f.dir]->misc&DIR_TFREE)
starttime+=end-start;
if(checkprotresult(cfg.prot[i],error,&f))
downloadfile(&f);
else
notdownloaded(f.size,start,end);
delfiles(cfg.temp_dir,ALLFILES);
autohangup();
}
}
}
closefile(&f);
}
if(filespec[0] && !strchr(filespec,'*') && !strchr(filespec,'?'))
break;
}
free((char *)ixbbuf);
if(usrxfrbuf)
free(usrxfrbuf);
return(found);
}
/****************************************************************************/
/* Prints one file's information on a single line to a file 'file' */
/****************************************************************************/
void sbbs_t::listfiletofile(char *fname, char *buf, uint dirnum, int file)
{
char str[256];
char tmp[512];
uchar alt;
ulong cdt;
bool exist=true;
strcpy(str,fname);
if(buf[F_MISC]!=ETX && (buf[F_MISC]-' ')&FM_EXTDESC)
strcat(str,"+");
else
strcat(str," ");
write(file,str,13);
getrec((char *)buf,F_ALTPATH,2,str);
alt=(uchar)ahtoul(str);
sprintf(str,"%s%s",alt>0 && alt<=cfg.altpaths ? cfg.altpath[alt-1]
: cfg.dir[dirnum]->path,unpadfname(fname,tmp));
if(cfg.dir[dirnum]->misc&DIR_FCHK && !fexistcase(str))
exist=false;
getrec((char *)buf,F_CDT,LEN_FCDT,str);
cdt=atol(str);
if(!cdt)
strcpy(str," FREE");
else
sprintf(str,"%7lu",cdt);
if(exist)
strcat(str," ");
else
strcat(str,"-");
write(file,str,8);
getrec((char *)buf,F_DESC,LEN_FDESC,str);
write(file,str,strlen(str));
write(file,crlf,2);
}
int extdesclines(char *str)
{
int i,lc,last;
for(i=lc=last=0;str[i];i++)
if(str[i]==LF || i-last>LEN_FDESC) {
lc++;
last=i;
}
return(lc);
}
| [
"matt.zorzin@sendgrid.com"
] | matt.zorzin@sendgrid.com |
d2147042fa1efd5eacda41febb73e0869f88275d | 32cbb0a1fc652005198d6ed5ed52e25572612057 | /core/unit_test/openmptarget/TestOpenMPTarget_AtomicOperations_double.cpp | a278b89bca4faed21b4b176af64df945e8a9e853 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | ORNL-CEES/kokkos | 3874d42a685084f0eb7999939cd9f1da9d42a2a6 | 70d113838b7dade09218a46c1e8aae44b6dbd321 | refs/heads/hip | 2020-05-04T03:32:58.012717 | 2020-01-24T20:43:25 | 2020-01-24T20:43:25 | 178,948,568 | 1 | 1 | NOASSERTION | 2020-03-01T19:21:45 | 2019-04-01T21:19:04 | C++ | UTF-8 | C++ | false | false | 2,062 | cpp | /*
//@HEADER
// ************************************************************************
//
// Kokkos v. 2.0
// Copyright (2014) Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Christian R. Trott (crtrott@sandia.gov)
//
// ************************************************************************
//@HEADER
*/
#include <openmptarget/TestOpenMPTarget_Category.hpp>
#include <TestAtomicOperations_double.hpp>
| [
"crtrott@sandia.gov"
] | crtrott@sandia.gov |
f79244676ad7e2878f6d9c9074375099ada171b8 | 30a9b10558e71bf05128c2aff3eee23298ebcbe4 | /external/asio/include/asio/impl/read.hpp | fa9d59709e127e9ab5a3af4d260563a433eebf68 | [
"BSL-1.0"
] | permissive | obergner/wally-io | e404718ddc585cedfd31cbcf720f143280d0b798 | ece72f22f24c7b91dc6338be18c1cf8c766a7acc | refs/heads/master | 2020-04-12T06:41:17.001595 | 2020-02-02T17:21:02 | 2020-02-02T17:21:02 | 37,421,244 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 31,987 | hpp | //
// impl/read.hpp
// ~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef ASIO_IMPL_READ_HPP
#define ASIO_IMPL_READ_HPP
#if defined( _MSC_VER ) && ( _MSC_VER >= 1200 )
#pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/buffer.hpp"
#include "asio/completion_condition.hpp"
#include "asio/detail/array_fwd.hpp"
#include "asio/detail/base_from_completion_cond.hpp"
#include "asio/detail/bind_handler.hpp"
#include "asio/detail/consuming_buffers.hpp"
#include "asio/detail/dependent_type.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
#include "asio/detail/handler_invoke_helpers.hpp"
#include "asio/detail/handler_type_requirements.hpp"
#include "asio/detail/throw_error.hpp"
#include "asio/error.hpp"
#include <algorithm>
#include "asio/detail/push_options.hpp"
namespace asio
{
template <typename SyncReadStream, typename MutableBufferSequence, typename CompletionCondition>
std::size_t read( SyncReadStream& s,
const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
asio::error_code& ec )
{
ec = asio::error_code( );
asio::detail::consuming_buffers<mutable_buffer, MutableBufferSequence> tmp( buffers );
std::size_t total_transferred = 0;
tmp.prepare( detail::adapt_completion_condition_result( completion_condition( ec, total_transferred ) ) );
while ( tmp.begin( ) != tmp.end( ) )
{
std::size_t bytes_transferred = s.read_some( tmp, ec );
tmp.consume( bytes_transferred );
total_transferred += bytes_transferred;
tmp.prepare( detail::adapt_completion_condition_result( completion_condition( ec, total_transferred ) ) );
}
return total_transferred;
}
template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read( SyncReadStream& s, const MutableBufferSequence& buffers )
{
asio::error_code ec;
std::size_t bytes_transferred = read( s, buffers, transfer_all( ), ec );
asio::detail::throw_error( ec, "read" );
return bytes_transferred;
}
template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read( SyncReadStream& s, const MutableBufferSequence& buffers, asio::error_code& ec )
{
return read( s, buffers, transfer_all( ), ec );
}
template <typename SyncReadStream, typename MutableBufferSequence, typename CompletionCondition>
inline std::size_t read( SyncReadStream& s,
const MutableBufferSequence& buffers,
CompletionCondition completion_condition )
{
asio::error_code ec;
std::size_t bytes_transferred = read( s, buffers, completion_condition, ec );
asio::detail::throw_error( ec, "read" );
return bytes_transferred;
}
#if !defined( ASIO_NO_IOSTREAM )
template <typename SyncReadStream, typename Allocator, typename CompletionCondition>
std::size_t read( SyncReadStream& s,
asio::basic_streambuf<Allocator>& b,
CompletionCondition completion_condition,
asio::error_code& ec )
{
ec = asio::error_code( );
std::size_t total_transferred = 0;
std::size_t max_size =
detail::adapt_completion_condition_result( completion_condition( ec, total_transferred ) );
std::size_t bytes_available = read_size_helper( b, max_size );
while ( bytes_available > 0 )
{
std::size_t bytes_transferred = s.read_some( b.prepare( bytes_available ), ec );
b.commit( bytes_transferred );
total_transferred += bytes_transferred;
max_size = detail::adapt_completion_condition_result( completion_condition( ec, total_transferred ) );
bytes_available = read_size_helper( b, max_size );
}
return total_transferred;
}
template <typename SyncReadStream, typename Allocator>
inline std::size_t read( SyncReadStream& s, asio::basic_streambuf<Allocator>& b )
{
asio::error_code ec;
std::size_t bytes_transferred = read( s, b, transfer_all( ), ec );
asio::detail::throw_error( ec, "read" );
return bytes_transferred;
}
template <typename SyncReadStream, typename Allocator>
inline std::size_t read( SyncReadStream& s, asio::basic_streambuf<Allocator>& b, asio::error_code& ec )
{
return read( s, b, transfer_all( ), ec );
}
template <typename SyncReadStream, typename Allocator, typename CompletionCondition>
inline std::size_t read( SyncReadStream& s,
asio::basic_streambuf<Allocator>& b,
CompletionCondition completion_condition )
{
asio::error_code ec;
std::size_t bytes_transferred = read( s, b, completion_condition, ec );
asio::detail::throw_error( ec, "read" );
return bytes_transferred;
}
#endif // !defined(ASIO_NO_IOSTREAM)
namespace detail
{
template <typename AsyncReadStream,
typename MutableBufferSequence,
typename CompletionCondition,
typename ReadHandler>
class read_op : detail::base_from_completion_cond<CompletionCondition>
{
public:
read_op( AsyncReadStream& stream,
const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
ReadHandler& handler )
: detail::base_from_completion_cond<CompletionCondition>( completion_condition ),
stream_( stream ),
buffers_( buffers ),
start_( 0 ),
total_transferred_( 0 ),
handler_( ASIO_MOVE_CAST( ReadHandler )( handler ) )
{
}
#if defined( ASIO_HAS_MOVE )
read_op( const read_op& other )
: detail::base_from_completion_cond<CompletionCondition>( other ),
stream_( other.stream_ ),
buffers_( other.buffers_ ),
start_( other.start_ ),
total_transferred_( other.total_transferred_ ),
handler_( other.handler_ )
{
}
read_op( read_op&& other )
: detail::base_from_completion_cond<CompletionCondition>( other ),
stream_( other.stream_ ),
buffers_( other.buffers_ ),
start_( other.start_ ),
total_transferred_( other.total_transferred_ ),
handler_( ASIO_MOVE_CAST( ReadHandler )( other.handler_ ) )
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator( )( const asio::error_code& ec, std::size_t bytes_transferred, int start = 0 )
{
switch ( start_ = start )
{
case 1:
buffers_.prepare( this->check_for_completion( ec, total_transferred_ ) );
for ( ;; )
{
stream_.async_read_some( buffers_, ASIO_MOVE_CAST( read_op )( *this ) );
return;
default:
total_transferred_ += bytes_transferred;
buffers_.consume( bytes_transferred );
buffers_.prepare( this->check_for_completion( ec, total_transferred_ ) );
if ( ( !ec && bytes_transferred == 0 ) || buffers_.begin( ) == buffers_.end( ) )
break;
}
handler_( ec, static_cast<const std::size_t&>( total_transferred_ ) );
}
}
// private:
AsyncReadStream& stream_;
asio::detail::consuming_buffers<mutable_buffer, MutableBufferSequence> buffers_;
int start_;
std::size_t total_transferred_;
ReadHandler handler_;
};
template <typename AsyncReadStream, typename CompletionCondition, typename ReadHandler>
class read_op<AsyncReadStream, asio::mutable_buffers_1, CompletionCondition, ReadHandler>
: detail::base_from_completion_cond<CompletionCondition>
{
public:
read_op( AsyncReadStream& stream,
const asio::mutable_buffers_1& buffers,
CompletionCondition completion_condition,
ReadHandler& handler )
: detail::base_from_completion_cond<CompletionCondition>( completion_condition ),
stream_( stream ),
buffer_( buffers ),
start_( 0 ),
total_transferred_( 0 ),
handler_( ASIO_MOVE_CAST( ReadHandler )( handler ) )
{
}
#if defined( ASIO_HAS_MOVE )
read_op( const read_op& other )
: detail::base_from_completion_cond<CompletionCondition>( other ),
stream_( other.stream_ ),
buffer_( other.buffer_ ),
start_( other.start_ ),
total_transferred_( other.total_transferred_ ),
handler_( other.handler_ )
{
}
read_op( read_op&& other )
: detail::base_from_completion_cond<CompletionCondition>( other ),
stream_( other.stream_ ),
buffer_( other.buffer_ ),
start_( other.start_ ),
total_transferred_( other.total_transferred_ ),
handler_( ASIO_MOVE_CAST( ReadHandler )( other.handler_ ) )
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator( )( const asio::error_code& ec, std::size_t bytes_transferred, int start = 0 )
{
std::size_t n = 0;
switch ( start_ = start )
{
case 1:
n = this->check_for_completion( ec, total_transferred_ );
for ( ;; )
{
stream_.async_read_some( asio::buffer( buffer_ + total_transferred_, n ),
ASIO_MOVE_CAST( read_op )( *this ) );
return;
default:
total_transferred_ += bytes_transferred;
if ( ( !ec && bytes_transferred == 0 ) ||
( n = this->check_for_completion( ec, total_transferred_ ) ) == 0 ||
total_transferred_ == asio::buffer_size( buffer_ ) )
break;
}
handler_( ec, static_cast<const std::size_t&>( total_transferred_ ) );
}
}
// private:
AsyncReadStream& stream_;
asio::mutable_buffer buffer_;
int start_;
std::size_t total_transferred_;
ReadHandler handler_;
};
template <typename AsyncReadStream, typename Elem, typename CompletionCondition, typename ReadHandler>
class read_op<AsyncReadStream, boost::array<Elem, 2>, CompletionCondition, ReadHandler>
: detail::base_from_completion_cond<CompletionCondition>
{
public:
read_op( AsyncReadStream& stream,
const boost::array<Elem, 2>& buffers,
CompletionCondition completion_condition,
ReadHandler& handler )
: detail::base_from_completion_cond<CompletionCondition>( completion_condition ),
stream_( stream ),
buffers_( buffers ),
start_( 0 ),
total_transferred_( 0 ),
handler_( ASIO_MOVE_CAST( ReadHandler )( handler ) )
{
}
#if defined( ASIO_HAS_MOVE )
read_op( const read_op& other )
: detail::base_from_completion_cond<CompletionCondition>( other ),
stream_( other.stream_ ),
buffers_( other.buffers_ ),
start_( other.start_ ),
total_transferred_( other.total_transferred_ ),
handler_( other.handler_ )
{
}
read_op( read_op&& other )
: detail::base_from_completion_cond<CompletionCondition>( other ),
stream_( other.stream_ ),
buffers_( other.buffers_ ),
start_( other.start_ ),
total_transferred_( other.total_transferred_ ),
handler_( ASIO_MOVE_CAST( ReadHandler )( other.handler_ ) )
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator( )( const asio::error_code& ec, std::size_t bytes_transferred, int start = 0 )
{
typename asio::detail::dependent_type<Elem, boost::array<asio::mutable_buffer, 2>>::type bufs = {
{asio::mutable_buffer( buffers_[0] ), asio::mutable_buffer( buffers_[1] )}};
std::size_t buffer_size0 = asio::buffer_size( bufs[0] );
std::size_t buffer_size1 = asio::buffer_size( bufs[1] );
std::size_t n = 0;
switch ( start_ = start )
{
case 1:
n = this->check_for_completion( ec, total_transferred_ );
for ( ;; )
{
bufs[0] = asio::buffer( bufs[0] + total_transferred_, n );
bufs[1] = asio::buffer(
bufs[1] + ( total_transferred_ < buffer_size0 ? 0 : total_transferred_ - buffer_size0 ),
n - asio::buffer_size( bufs[0] ) );
stream_.async_read_some( bufs, ASIO_MOVE_CAST( read_op )( *this ) );
return;
default:
total_transferred_ += bytes_transferred;
if ( ( !ec && bytes_transferred == 0 ) ||
( n = this->check_for_completion( ec, total_transferred_ ) ) == 0 ||
total_transferred_ == buffer_size0 + buffer_size1 )
break;
}
handler_( ec, static_cast<const std::size_t&>( total_transferred_ ) );
}
}
// private:
AsyncReadStream& stream_;
boost::array<Elem, 2> buffers_;
int start_;
std::size_t total_transferred_;
ReadHandler handler_;
};
#if defined( ASIO_HAS_STD_ARRAY )
template <typename AsyncReadStream, typename Elem, typename CompletionCondition, typename ReadHandler>
class read_op<AsyncReadStream, std::array<Elem, 2>, CompletionCondition, ReadHandler>
: detail::base_from_completion_cond<CompletionCondition>
{
public:
read_op( AsyncReadStream& stream,
const std::array<Elem, 2>& buffers,
CompletionCondition completion_condition,
ReadHandler& handler )
: detail::base_from_completion_cond<CompletionCondition>( completion_condition ),
stream_( stream ),
buffers_( buffers ),
start_( 0 ),
total_transferred_( 0 ),
handler_( ASIO_MOVE_CAST( ReadHandler )( handler ) )
{
}
#if defined( ASIO_HAS_MOVE )
read_op( const read_op& other )
: detail::base_from_completion_cond<CompletionCondition>( other ),
stream_( other.stream_ ),
buffers_( other.buffers_ ),
start_( other.start_ ),
total_transferred_( other.total_transferred_ ),
handler_( other.handler_ )
{
}
read_op( read_op&& other )
: detail::base_from_completion_cond<CompletionCondition>( other ),
stream_( other.stream_ ),
buffers_( other.buffers_ ),
start_( other.start_ ),
total_transferred_( other.total_transferred_ ),
handler_( ASIO_MOVE_CAST( ReadHandler )( other.handler_ ) )
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator( )( const asio::error_code& ec, std::size_t bytes_transferred, int start = 0 )
{
typename asio::detail::dependent_type<Elem, std::array<asio::mutable_buffer, 2>>::type bufs = {
{asio::mutable_buffer( buffers_[0] ), asio::mutable_buffer( buffers_[1] )}};
std::size_t buffer_size0 = asio::buffer_size( bufs[0] );
std::size_t buffer_size1 = asio::buffer_size( bufs[1] );
std::size_t n = 0;
switch ( start_ = start )
{
case 1:
n = this->check_for_completion( ec, total_transferred_ );
for ( ;; )
{
bufs[0] = asio::buffer( bufs[0] + total_transferred_, n );
bufs[1] = asio::buffer(
bufs[1] + ( total_transferred_ < buffer_size0 ? 0 : total_transferred_ - buffer_size0 ),
n - asio::buffer_size( bufs[0] ) );
stream_.async_read_some( bufs, ASIO_MOVE_CAST( read_op )( *this ) );
return;
default:
total_transferred_ += bytes_transferred;
if ( ( !ec && bytes_transferred == 0 ) ||
( n = this->check_for_completion( ec, total_transferred_ ) ) == 0 ||
total_transferred_ == buffer_size0 + buffer_size1 )
break;
}
handler_( ec, static_cast<const std::size_t&>( total_transferred_ ) );
}
}
// private:
AsyncReadStream& stream_;
std::array<Elem, 2> buffers_;
int start_;
std::size_t total_transferred_;
ReadHandler handler_;
};
#endif // defined(ASIO_HAS_STD_ARRAY)
template <typename AsyncReadStream,
typename MutableBufferSequence,
typename CompletionCondition,
typename ReadHandler>
inline void* asio_handler_allocate(
std::size_t size,
read_op<AsyncReadStream, MutableBufferSequence, CompletionCondition, ReadHandler>* this_handler )
{
return asio_handler_alloc_helpers::allocate( size, this_handler->handler_ );
}
template <typename AsyncReadStream,
typename MutableBufferSequence,
typename CompletionCondition,
typename ReadHandler>
inline void asio_handler_deallocate(
void* pointer,
std::size_t size,
read_op<AsyncReadStream, MutableBufferSequence, CompletionCondition, ReadHandler>* this_handler )
{
asio_handler_alloc_helpers::deallocate( pointer, size, this_handler->handler_ );
}
template <typename AsyncReadStream,
typename MutableBufferSequence,
typename CompletionCondition,
typename ReadHandler>
inline bool asio_handler_is_continuation(
read_op<AsyncReadStream, MutableBufferSequence, CompletionCondition, ReadHandler>* this_handler )
{
return this_handler->start_ == 0 ? true
: asio_handler_cont_helpers::is_continuation( this_handler->handler_ );
}
template <typename Function,
typename AsyncReadStream,
typename MutableBufferSequence,
typename CompletionCondition,
typename ReadHandler>
inline void asio_handler_invoke(
Function& function,
read_op<AsyncReadStream, MutableBufferSequence, CompletionCondition, ReadHandler>* this_handler )
{
asio_handler_invoke_helpers::invoke( function, this_handler->handler_ );
}
template <typename Function,
typename AsyncReadStream,
typename MutableBufferSequence,
typename CompletionCondition,
typename ReadHandler>
inline void asio_handler_invoke(
const Function& function,
read_op<AsyncReadStream, MutableBufferSequence, CompletionCondition, ReadHandler>* this_handler )
{
asio_handler_invoke_helpers::invoke( function, this_handler->handler_ );
}
} // namespace detail
template <typename AsyncReadStream,
typename MutableBufferSequence,
typename CompletionCondition,
typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE( ReadHandler, void( asio::error_code, std::size_t ) )
async_read( AsyncReadStream& s,
const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
ASIO_MOVE_ARG( ReadHandler ) handler )
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
ASIO_READ_HANDLER_CHECK( ReadHandler, handler ) type_check;
detail::async_result_init<ReadHandler, void( asio::error_code, std::size_t )> init(
ASIO_MOVE_CAST( ReadHandler )( handler ) );
detail::read_op<AsyncReadStream, MutableBufferSequence, CompletionCondition,
ASIO_HANDLER_TYPE( ReadHandler, void( asio::error_code, std::size_t ) )>(
s, buffers, completion_condition, init.handler )( asio::error_code( ), 0, 1 );
return init.result.get( );
}
template <typename AsyncReadStream, typename MutableBufferSequence, typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE( ReadHandler, void( asio::error_code, std::size_t ) )
async_read( AsyncReadStream& s, const MutableBufferSequence& buffers, ASIO_MOVE_ARG( ReadHandler ) handler )
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
ASIO_READ_HANDLER_CHECK( ReadHandler, handler ) type_check;
detail::async_result_init<ReadHandler, void( asio::error_code, std::size_t )> init(
ASIO_MOVE_CAST( ReadHandler )( handler ) );
detail::read_op<AsyncReadStream, MutableBufferSequence, detail::transfer_all_t,
ASIO_HANDLER_TYPE( ReadHandler, void( asio::error_code, std::size_t ) )>(
s, buffers, transfer_all( ), init.handler )( asio::error_code( ), 0, 1 );
return init.result.get( );
}
#if !defined( ASIO_NO_IOSTREAM )
namespace detail
{
template <typename AsyncReadStream, typename Allocator, typename CompletionCondition, typename ReadHandler>
class read_streambuf_op : detail::base_from_completion_cond<CompletionCondition>
{
public:
read_streambuf_op( AsyncReadStream& stream,
basic_streambuf<Allocator>& streambuf,
CompletionCondition completion_condition,
ReadHandler& handler )
: detail::base_from_completion_cond<CompletionCondition>( completion_condition ),
stream_( stream ),
streambuf_( streambuf ),
start_( 0 ),
total_transferred_( 0 ),
handler_( ASIO_MOVE_CAST( ReadHandler )( handler ) )
{
}
#if defined( ASIO_HAS_MOVE )
read_streambuf_op( const read_streambuf_op& other )
: detail::base_from_completion_cond<CompletionCondition>( other ),
stream_( other.stream_ ),
streambuf_( other.streambuf_ ),
start_( other.start_ ),
total_transferred_( other.total_transferred_ ),
handler_( other.handler_ )
{
}
read_streambuf_op( read_streambuf_op&& other )
: detail::base_from_completion_cond<CompletionCondition>( other ),
stream_( other.stream_ ),
streambuf_( other.streambuf_ ),
start_( other.start_ ),
total_transferred_( other.total_transferred_ ),
handler_( ASIO_MOVE_CAST( ReadHandler )( other.handler_ ) )
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator( )( const asio::error_code& ec, std::size_t bytes_transferred, int start = 0 )
{
std::size_t max_size, bytes_available;
switch ( start_ = start )
{
case 1:
max_size = this->check_for_completion( ec, total_transferred_ );
bytes_available = read_size_helper( streambuf_, max_size );
for ( ;; )
{
stream_.async_read_some( streambuf_.prepare( bytes_available ),
ASIO_MOVE_CAST( read_streambuf_op )( *this ) );
return;
default:
total_transferred_ += bytes_transferred;
streambuf_.commit( bytes_transferred );
max_size = this->check_for_completion( ec, total_transferred_ );
bytes_available = read_size_helper( streambuf_, max_size );
if ( ( !ec && bytes_transferred == 0 ) || bytes_available == 0 )
break;
}
handler_( ec, static_cast<const std::size_t&>( total_transferred_ ) );
}
}
// private:
AsyncReadStream& stream_;
asio::basic_streambuf<Allocator>& streambuf_;
int start_;
std::size_t total_transferred_;
ReadHandler handler_;
};
template <typename AsyncReadStream, typename Allocator, typename CompletionCondition, typename ReadHandler>
inline void* asio_handler_allocate(
std::size_t size,
read_streambuf_op<AsyncReadStream, Allocator, CompletionCondition, ReadHandler>* this_handler )
{
return asio_handler_alloc_helpers::allocate( size, this_handler->handler_ );
}
template <typename AsyncReadStream, typename Allocator, typename CompletionCondition, typename ReadHandler>
inline void asio_handler_deallocate(
void* pointer,
std::size_t size,
read_streambuf_op<AsyncReadStream, Allocator, CompletionCondition, ReadHandler>* this_handler )
{
asio_handler_alloc_helpers::deallocate( pointer, size, this_handler->handler_ );
}
template <typename AsyncReadStream, typename Allocator, typename CompletionCondition, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_streambuf_op<AsyncReadStream, Allocator, CompletionCondition, ReadHandler>* this_handler )
{
return this_handler->start_ == 0 ? true
: asio_handler_cont_helpers::is_continuation( this_handler->handler_ );
}
template <typename Function,
typename AsyncReadStream,
typename Allocator,
typename CompletionCondition,
typename ReadHandler>
inline void asio_handler_invoke(
Function& function,
read_streambuf_op<AsyncReadStream, Allocator, CompletionCondition, ReadHandler>* this_handler )
{
asio_handler_invoke_helpers::invoke( function, this_handler->handler_ );
}
template <typename Function,
typename AsyncReadStream,
typename Allocator,
typename CompletionCondition,
typename ReadHandler>
inline void asio_handler_invoke(
const Function& function,
read_streambuf_op<AsyncReadStream, Allocator, CompletionCondition, ReadHandler>* this_handler )
{
asio_handler_invoke_helpers::invoke( function, this_handler->handler_ );
}
} // namespace detail
template <typename AsyncReadStream, typename Allocator, typename CompletionCondition, typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE( ReadHandler, void( asio::error_code, std::size_t ) )
async_read( AsyncReadStream& s,
asio::basic_streambuf<Allocator>& b,
CompletionCondition completion_condition,
ASIO_MOVE_ARG( ReadHandler ) handler )
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
ASIO_READ_HANDLER_CHECK( ReadHandler, handler ) type_check;
detail::async_result_init<ReadHandler, void( asio::error_code, std::size_t )> init(
ASIO_MOVE_CAST( ReadHandler )( handler ) );
detail::read_streambuf_op<AsyncReadStream, Allocator, CompletionCondition,
ASIO_HANDLER_TYPE( ReadHandler, void( asio::error_code, std::size_t ) )>(
s, b, completion_condition, init.handler )( asio::error_code( ), 0, 1 );
return init.result.get( );
}
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE( ReadHandler, void( asio::error_code, std::size_t ) )
async_read( AsyncReadStream& s, asio::basic_streambuf<Allocator>& b, ASIO_MOVE_ARG( ReadHandler ) handler )
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
ASIO_READ_HANDLER_CHECK( ReadHandler, handler ) type_check;
detail::async_result_init<ReadHandler, void( asio::error_code, std::size_t )> init(
ASIO_MOVE_CAST( ReadHandler )( handler ) );
detail::read_streambuf_op<AsyncReadStream, Allocator, detail::transfer_all_t,
ASIO_HANDLER_TYPE( ReadHandler, void( asio::error_code, std::size_t ) )>(
s, b, transfer_all( ), init.handler )( asio::error_code( ), 0, 1 );
return init.result.get( );
}
#endif // !defined(ASIO_NO_IOSTREAM)
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_IMPL_READ_HPP
| [
"olaf.bergner@gmx.de"
] | olaf.bergner@gmx.de |
374991d29137fb8e8bd4b8410b6c995894165476 | 44e4ed207423da70c8370522f955bfac3fd04bda | /src/axl_spy/axl_spy_HookCommon.h | 095713f8212a44c5b2acd0883fc9071896b6c522 | [
"MIT"
] | permissive | igorsafo/axl | caf690fc3a397c4cb88f17084c37625aad20bd50 | c73a3e3fb0d1b99ad200d14b80f8bcc1f8bc6315 | refs/heads/master | 2023-05-05T12:36:26.313259 | 2021-02-05T05:21:22 | 2021-02-05T05:21:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 672 | h | #pragma once
#include "axl_spy_Hook.h"
namespace axl {
namespace spy {
//..............................................................................
struct HookCommonContext
{
void* m_targetFunc;
void* m_callbackParam;
HookEnterFunc* m_enterFunc;
HookLeaveFunc* m_leaveFunc;
};
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
HookAction
hookEnterCommon(
HookCommonContext* context,
size_t frameBase,
size_t originalRet
);
size_t
hookLeaveCommon(
HookCommonContext* context,
size_t frameBase
);
//..............................................................................
} // namespace spy
} // namespace axl
| [
"vovkos@gmail.com"
] | vovkos@gmail.com |
71678d057c29d4bab1244362eb904d357f39671e | a0f6003678029b878162ffa9edbcfbf64223082e | /src/spu_emu_int_xor.cpp | cda5378146def60acbdb41e9c60af717c33b043c | [] | no_license | grumpos/spuc | 4c8d09ff79b9b990e7dce07b9374c77465fe25e1 | 8934a7dd2a7909dead3e49c723e10e172cbf76d2 | refs/heads/master | 2020-12-24T13:18:11.123570 | 2011-07-06T18:46:49 | 2011-07-06T18:46:49 | 1,429,833 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,344 | cpp | #include "spu_emu.h"
inline GPR_t si_xor( GPR_t RA, GPR_t RB )
{
return _mm_xor_ps( RA, RB );
}
inline GPR_t si_xorbi( GPR_t RA, int64_t IMM )
{
return _mm_xor_ps( RA, _mm_castsi128_ps( _mm_set1_epi8((uint8_t)IMM) ) );
}
inline GPR_t si_xorhi( GPR_t RA, int64_t IMM )
{
return _mm_xor_ps( RA, _mm_castsi128_ps( _mm_set1_epi16((int16_t)IMM) ) );
}
inline GPR_t si_xori( GPR_t RA, int64_t IMM )
{
return _mm_xor_ps( RA, _mm_castsi128_ps( _mm_set1_epi32((int32_t)IMM) ) );
}
//void spu_xor( SPU_t* SPU, SPU_INSTRUCTION op )
//{
// SPU->GPR[op.RR.RT] = si_xor( SPU->GPR[op.RR.RA], SPU->GPR[op.RR.RB] );
//}
//
//void spu_xorbi( SPU_t* SPU, SPU_INSTRUCTION op )
//{
// SPU->GPR[op.RI10.RT] = _mm_castsi128_ps(
// _mm_xor_si128(
// _mm_castps_si128( SPU->GPR[op.RI10.RA] ),
// _mm_set1_epi8( 0xff & op.RI10.I10 ) ) );
//}
//
//void spu_xorhi( SPU_t* SPU, SPU_INSTRUCTION op )
//{
// SPU->GPR[op.RI10.RT] = _mm_castsi128_ps(
// _mm_xor_si128(
// _mm_castps_si128( SPU->GPR[op.RI10.RA] ),
// _mm_set1_epi16( static_cast<int16_t>(SignExtend( op.RI10.I10, 10 ) ) ) ) );
//}
//
//void spu_xori( SPU_t* SPU, SPU_INSTRUCTION op )
//{
// SPU->GPR[op.RI10.RT] = _mm_castsi128_ps(
// _mm_xor_si128(
// _mm_castps_si128( SPU->GPR[op.RI10.RA] ),
// _mm_set1_epi32( static_cast<int32_t>(SignExtend( op.RI10.I10, 10 ) ) ) ) );
//} | [
"fnorbert84@gmail.com"
] | fnorbert84@gmail.com |
ff0b27f4c378ec2f32fcb6c0d325a60ef5117c17 | 485faf9d4ec7def9a505149c6a491d6133e68750 | /include/inv/ChemKit/ChemSelection.H | 5150d3c5e196c525661685578d2488e816f3f7fd | [
"LicenseRef-scancode-warranty-disclaimer",
"ECL-2.0"
] | permissive | ohlincha/ECCE | af02101d161bae7e9b05dc7fe6b10ca07f479c6b | 7461559888d829338f29ce5fcdaf9e1816042bfe | refs/heads/master | 2020-06-25T20:59:27.882036 | 2017-06-16T10:45:21 | 2017-06-16T10:45:21 | 94,240,259 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 27,185 | h | /*
* ChemSelection.h
*
* This file defines the ChemSelection node class.
*
* Copyright 1996, 1997, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
*
* UNPUBLISHED -- Rights reserved under the copyright laws of the United
* States. Use of a copyright notice is precautionary only and does not
* imply publication or disclosure.
*
* U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
* in similar or successor clauses in the FAR, or the DOD or NASA FAR
* Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
* 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
*
* THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
* INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
* DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
* PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
* GRAPHICS, INC.
*/
/**************************************************************************\
*
* OpenMOIV - C++ library for molecular visualization using Inventor.
* Copyright (C) 2001-2003 Universitat Pompeu Fabra - Barcelona (Spain)
*
* Developers: Interactive Technology Group (GTI)
* Team: Josep Blat, Eduard Gonzalez, Sergi Gonzalez,
* Daniel Soto, Alejandro Ramirez, Oscar Civit.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details (see the file
* LICENSE.LGPL at the root directory).
*
* REMARK: This library is a derived product.
* You need also to accept all other applicable licenses.
*
* Homepage: http://www.tecn.upf.es/openMOIV/
* Contact: openmoiv@upf.es
*
\**************************************************************************/
#ident "$Revision: 22148 $"
#ifndef __CHEM_SELECTION_H__
#define __CHEM_SELECTION_H__
#include "inv/nodes/SoIndexedLineSet.H"
#include "inv/nodes/SoLineSet.H"
#include "inv/fields/SoSFBitMask.H"
#include "inv/fields/SoSFBool.H"
#include "inv/fields/SoSFColor.H"
#include "inv/fields/SoSFName.H"
#include "inv/fields/SoSFNode.H"
#include "inv/fields/SoSFUShort.H"
#include "inv/misc/SoCallbackList.H"
#include "inv/nodes/SoOrthographicCamera.H"
#include "inv/nodes/SoSelection.H"
#include "inv/nodes/SoSeparator.H"
#include "inv/nodes/SoSubNode.H"
#include "inv/ChemKit/ChemBBoxAction.H"
#include "inv/ChemKit/ChemDisplayPathList.H"
#include "inv/ChemKit/ChemLabelPathList.H"
#include "inv/ChemKit/ChemMonitorPathList.H"
#include "inv/ChemKit/ChemkitBasic.H"
class SoColorIndex;
class SoComplexity;
class SoCoordinate3;
class SoDrawStyle;
class SoEvent;
class SoFieldSensor;
class SoFont;
class SoGetMatrixAction;
class SoHandleEventAction;
class SoMaterial;
class SoPickAction;
class SoPickedPoint;
class SoPickedPointList;
class SoSearchAction;
class SoSensor;
class SoSphere;
class SoSwitch;
class SoText2;
class SoTransform;
class SoTypeList;
#ifndef __nogl
class SoXtGLWidget;
#endif
class ChemBitmapFontCache;
class ChemAtomBBox;
class ChemBondBBox;
class ChemLabelBBox;
class ChemDisplayPath;
class ChemDisplayPathList;
class ChemLabelPath;
class ChemLabelPathList;
class ChemMonitorPath;
class ChemMonitorPathList;
class ChemPath;
class ChemSelection;
// Callback function prototypes
typedef void ChemSelectionPathCB(void *userData, ChemPath *path);
typedef void ChemSelectionClassCB(void *userData, ChemSelection *sel);
typedef ChemPath * ChemSelectionPickCB(void *userData,
const SoPickedPoint *pick);
//////////////////////////////////////////////////////////////////////////////
//
// Class: ChemSelection
//
// Selection group node: Manages selection lists from picks of its children.
//
//////////////////////////////////////////////////////////////////////////////
class CHEMKIT_DLL_API ChemSelection : public SoSeparator {
SO_NODE_HEADER(ChemSelection);
public:
// Constructor. nChildren is the approximate number of children.
ChemSelection();
ChemSelection(int nChildren);
//
// Enums
// -------------------------
// Default selection toggle policy is ChemSelection::SHIFT.
enum TogglePolicy {
// left mouse pick on object clears selection, then selects object.
// left mouse pick on nothing clears selection.
// only one object may be selected at a time.
SINGLE,
// left mouse pick on object toggles its selection status.
// left mouse pick on nothing does nothing.
// multiple objects may be selected.
TOGGLE,
// when shift key is down, selection policy is TOGGLE.
// when shift key is up, selection policy is SINGLE.
// multiple objects may be selected.
SHIFT
};
// Whether lassoing is used or not, and what type of lassoing.
enum LassoType {
NOLASSO,
// Left mouse down starts picking operation. As mouse is
// dragged, the lasso outline is drawn. Left mouse up initiates
// the lasso pick.
LASSO,
// Left mouse down starts a drag selection. As mouse is moved,
// a rectangle is drawn. Left mouse up initiates the pick.
DRAGGER
};
// These are the items which can be selected.
enum ChemPart {
ATOMS = 0x01,
BONDS = 0x02,
ATOMLABELS = 0x04,
BONDLABELS = 0x08,
CHEMLABELS = 0x10,
CHEMMONITORS = 0x20,
// --> residue selection
RESIDUES = 0x40,
RESIDUELABELS = 0x80,
ALL = 0xFF
//ALL = 0x3F,
// <-- residue selection
};
// When lassoing, this determines if the item has been selected.
enum LassoPolicy {
CENTER,
THRU_BBOX,
ENTIRE_BBOX
};
enum RadiusSelectSphereDrawStyle {
FILLED,
LINES,
POINTS
};
//
// Fields
// -------------------------
SoSFBitMask parts;
SoSFEnum togglePolicy;
SoSFEnum atomLassoPolicy;
SoSFEnum bondLassoPolicy;
SoSFEnum atomLabelLassoPolicy;
SoSFEnum bondLabelLassoPolicy;
SoSFEnum chemLabelLassoPolicy;
SoSFEnum chemMonitorLassoPolicy;
// --> residue selection
SoSFEnum residueLassoPolicy;
SoSFEnum residueLabelLassoPolicy;
// <-- residue selection
SoSFBool selectInvisibleHydrogens;
// The following fields have to do with the drawing of the lasso
// and the cutoff beneath which the lasso will not be in effect.
SoSFFloat lassoSelectCutoff;
SoSFEnum lassoType;
SoSFFloat lassoLineWidth;
SoSFUShort lassoLinePattern;
SoSFUShort lassoLineColorIndex;
SoSFNode lassoPoints;
// Values for the sphere portion of the radiusSelect
SoSFBool radiusSelect;
SoSFFloat radiusSelectCutoff;
SoSFColor radiusSelectSphereColor;
SoSFFloat radiusSelectSphereTransparency;
SoSFEnum radiusSelectSphereDrawStyle;
SoSFFloat radiusSelectSphereComplexity;
// The font color, name and size to use for the radius selection display.
SoSFColor radiusSelectLabelColor;
SoSFName radiusSelectLabelFontName;
SoSFFloat radiusSelectLabelFontSize;
//
// Methods
// -------------------------
#ifndef __nogl
// The following method sets the SoXtViewer being used. It is necessary
// to have access to the viewer in order to determine if the viewer is
// in stereo mode or not. Stereo may affect the lasso rendering.
void setViewer(SoXtGLWidget *_viewer) { viewer = _viewer; }
#endif
// The following method returns the sceneGraph used to draw the lasso.
// This is used in conjunction with the viewer's setOverlaySceneGraph
// method.
SoNode *getSceneGraph() const { return (SoNode *)lassoRoot; }
//
// Child node management
// -------------------------
// Adds a child as last one in group
void addChild(SoNode *child);
// Adds a child so that it becomes the one with the given index
void insertChild(SoNode *child, int newChildIndex);
// Returns pointer to nth child node
SoNode * getChild(int index) const;
// Finds index of given child within group
int findChild(const SoNode *child) const;
// Returns number of children
int getNumChildren() const;
// Removes child with given index from group
void removeChild(int index);
// Removes first instance of given child from group
void removeChild(SoNode *child);
// Removes all children from group
void removeAllChildren();
// Replaces child with given index with new child
void replaceChild(int index, SoNode *newChild);
// Replaces first instance of given child with new child
void replaceChild(SoNode *oldChild, SoNode *newChild);
//
// Selection list management
// -------------------------
// select() adds a path to the selection lists.
// 'this' must lie in the path, and when added to the list,
// the path will be truncated such that 'this' is the head.
// select() makes a copy of the passed path.
void select(const ChemPath *path);
// deselect removes a path from the selection lists by path.
void deselect(ChemPath *path);
// deselect all the paths in the selection lists (i.e. clear)
void deselectAll();
// deselect all paths in the displaySelectionList
void deselectAllDisplays();
// deselect all paths in the labelSelectionList
void deselectAllLabels();
// deselect all paths in the monitorSelectionList
void deselectAllMonitors();
// toggles a path in the selection lists - if the path is not there,
// it is selected; if a path is there, it is deselected.
void toggle(const ChemPath *path);
// merges a path into the selection lists - if the path is not there,
// it is selected; if a path is there, it remains selected.
void merge(const ChemPath *path);
// returns TRUE if the path is selected
SbBool isSelected(const ChemPath *path) const;
// This convenience version of isSelected will search for the first instance
// of the passed node under this selection node, and return whether
// that path is selected.
SbBool isSelected(SoNode *node) const;
// Get information about the displaySelectionList
int getNumDisplaysSelected() const
{ return displaySelectionList.getLength(); }
const ChemDisplayPathList *getDisplaySelectionList() const
{ return &displaySelectionList; }
ChemDisplayPath *getDisplayPath(int index) const;
// Get information about the labelSelectionList
int getNumLabelsSelected() const
{ return labelSelectionList.getLength(); }
const ChemLabelPathList *getLabelSelectionList() const
{ return &labelSelectionList; }
ChemLabelPath *getLabelPath(int index) const;
// Get information about the monitorSelectionList
int getNumMonitorsSelected() const
{ return monitorSelectionList.getLength(); }
const ChemMonitorPathList *getMonitorSelectionList() const
{ return &monitorSelectionList; }
ChemMonitorPath *getMonitorPath(int index) const;
//
// Selection change callbacks
// --------------------------
//
// Callbacks are invoked:
// 1) when a lasso is started and stopped.
// 2) when an object is selected or deselected.
// 3) when the delete key is pressed and objects have been selected.
//
// These callbacks are invoked whenever the selection changes.
void addChangeCallback(ChemSelectionClassCB *f, void *userData = NULL);
void removeChangeCallback(ChemSelectionClassCB *f, void *userData = NULL);
// These callbacks are invoked every time an object is selected, whether
// it be from user interaction or from program call to select() or
// toggle().
// This is invoked after the object has been added to the selection lists.
void addSelectionCallback(ChemSelectionPathCB *f, void *userData = NULL);
void removeSelectionCallback(ChemSelectionPathCB *f, void *userData = NULL);
// These callbacks are invoked every time an object is deselected, whether
// it be from user interaction or from program call to deselect() or
// toggle().
// This is invoked after the object has been removed from the selection
// list.
void addDeselectionCallback(ChemSelectionPathCB *f, void *userData = NULL);
void removeDeselectionCallback(ChemSelectionPathCB *f,
void *userData = NULL);
// Invoked when the user has initiated a change to the selection lists
// by picking objects. This will be followed by invocations of the select
// and/or deselect callbacks, finally followed by the finish callback.
void addStartCallback(ChemSelectionClassCB *f, void *userData = NULL);
void removeStartCallback(ChemSelectionClassCB *f, void *userData = NULL);
// Invoked when the user has finished changing the selection lists
// by picking objects. This was preceeded by an invocation of the start
// callback, and invocations of the select and/or deselect callbacks.
void addFinishCallback(ChemSelectionClassCB *f, void *userData = NULL);
void removeFinishCallback(ChemSelectionClassCB *f, void *userData = NULL);
// Invoked when the user has initiated a change to the selection lists
// by lassoing objects. This will be followed by invocations of the select
// and/or deselect callbacks, finally followed by the finish callback.
void addLassoStartCallback(ChemSelectionClassCB *f, void *userData = NULL);
void removeLassoStartCallback(ChemSelectionClassCB *f,
void *userData = NULL);
// Invoked when the user has finished changing the selection lists
// by lassoing objects. This was preceeded by an invocation of the
// lassoStart // callback, and invocations of the select and/or
// deselect callbacks.
void addLassoFinishCallback(ChemSelectionClassCB *f, void *userData = NULL);
void removeLassoFinishCallback(ChemSelectionClassCB *f,
void *userData = NULL);
//
// Selection interaction - selection will pick once on mouse down
// and once on mouse up, and make sure the picks match before changing
// the selection lists. This allows the user to pick down on an object,
// change their mind and drag off the object, release the mouse button
// and not affect the selection. Pass TRUE to enable this behavior.
// Pass FALSE to disable this, meaning whatever is picked on a mouse
// release is added to/removed from the selection lists.
// Default is pick-matching on.
//
void setPickMatching(SbBool pickTwice) { pickMatching = pickTwice; }
SbBool isPickMatching() const { return pickMatching; }
// Provided for backwards compatibility
SbBool getPickMatching() const { return pickMatching; }
SoEXTENDER public:
virtual void GLRender(SoGLRenderAction *action);
virtual void getBoundingBox(SoGetBoundingBoxAction *action);
virtual void write(SoWriteAction *action);
virtual void GLRenderBelowPath(SoGLRenderAction *action);
virtual void GLRenderInPath(SoGLRenderAction *action);
virtual void GLRenderOffPath(SoGLRenderAction *action);
virtual void pick(SoPickAction *action);
SoINTERNAL public:
// Internal:
virtual void notify(SoNotList *list);
static void initClass();
// Returns the points which comprise the lasso.
SoVertexProperty *getLassoPoints()
{ return ((SoVertexProperty *)lassoPoints.getValue()); }
// Invoked when a pick has occurred and the selection node is about
// to change the selection lists. The callback function returns the
// path that the selection node should use when selecting and deselecting.
// If no pick callback is registered (the default), the selection node
// will use the path returned by SoPickedPoin::getPath().
// The returned path need not be ref'd - selection will ref() and unref()
// it.
//
// Note that a picked object may or may not be a child of the selection
// node. A selection node will only select paths that pass through it.
//
// Nothing picked - selection policy applied, traversal halts
// Object picked under selection - policy applied, traversal halts
// Object picked not under selection - event ignored, traversal
// continues
//
// In the case of nothing picked, the pick callback is not invoked.
// In the other cases, the pick callback is invoked, giving it the chance
// to decide what path gets selected and deselected.
//
// Return values from the callback:
//
// NULL - selection behaves as if nothing was picked (i.e. for
// SINGLE and SHIFT policies, this clears the selection lists)
//
// path - this path will be selected/deselected according to
// the selection policy (it must lie under the selection node)
//
// path not passing through the selection node - selection ignores
// this pick event and no change is made to the selection lists
//
// path containing ONLY the selection node - apply the selection
// policy as if nothing was picked, but continue traversal
//
// A simple way to tell selection to ignore the pick is to return
// an ChemPath with no nodes in it. (i.e. return new ChemPath;)
//
// Selection will always ref the path returned by the callback, make a
// copy of the path, then unref the path.
//
void setPickFilterCallback(ChemSelectionPickCB *f,
void *userData = NULL,
SbBool callOnlyIfSelectable = TRUE);
protected:
SbBool lassoActive;
SbBox3f lassoBBox;
SbBox3f sphereBBox;
const SoEvent *currentEvent;
// Local sceneGraph for rendering the lasso into the overlay plane
SoSeparator *lassoRoot;
// Camera for rendering the lasso
SoOrthographicCamera *orthoCam;
// Nodes we need access to for the display of the lasso
SoColorIndex *lassoColorIndex;
SoDrawStyle *lassoDrawStyle;
// Nodes we need access to for the display of the radiusSelection
SoSwitch *sceneSwitch;
SoSeparator *sphereRoot;
SoMaterial *sphereMaterial;
SoDrawStyle *sphereDrawStyle;
SoComplexity *sphereComplexity;
SoTransform *sphereTransform;
SoSphere *sphere;
SoMaterial *labelMaterial;
SoFont *labelFont;
SoTransform *labelTransform;
SoText2 *labelText;
// List of paths of selected objects
ChemDisplayPathList displaySelectionList;
ChemLabelPathList labelSelectionList;
ChemMonitorPathList monitorSelectionList;
// Selection callback lists
SoCallbackList *selCBList;
SoCallbackList *deselCBList;
SoCallbackList *startCBList;
SoCallbackList *finishCBList;
SoCallbackList *lassoStartCBList;
SoCallbackList *lassoFinishCBList;
SoCallbackList *changeCBList;
// Pick filter is a single callback function, not a list
ChemSelectionPickCB *pickCBFunc;
void *pickCBData;
SbBool callPickCBOnlyIfSelectable;
// Mouse down picked path
ChemPath *mouseDownPickPath;
SbBool pickMatching;
// Selection policies (shiftSelection is a combination of these)
// invokeSelectionPolicy() is called from handleEvent() - for a customized
// selection policy, either derive a class and write a new handleEvent()
// method, or use an SoEventCallback node placed such that it receives
// events before the selection node.
void invokeSelectionPolicy(ChemPath *path,
SbBool shiftDown,
SbBool ctrlDown,
SbBool notify);
void performSingleSelection(ChemPath *path, SbBool notify);
void performToggleSelection(ChemPath *path, SbBool ctrlDown,
SbBool notify);
// This copies the path so the copy is rooted by 'this'.
// Returns NULL if 'this' not found in the passed path.
ChemPath *copyFromThis(const ChemPath *path) const;
// addPath() assumes the path is rooted by 'this'
void addPath(ChemPath *path, SbBool toggle);
void removeDisplayPath(int which);
void removeLabelPath(int which);
void removeMonitorPath(int which);
// This locates path in the selection lists. The head of this path
// does not necessarily have to be 'this'.
int findPath(const ChemPath *path) const;
// Traversal routine for SoHandleEventAction - this will call
// action->setHandled() if the event is handled
virtual void handleEvent(SoHandleEventAction *action);
// Returns the event being handled by the lasso selection.
const SoEvent * getCurrentEvent() const
{ return (lassoActive) ? NULL : currentEvent; }
// Converts the mouse coordinates to the coordinates for the lasso.
SbVec2f getModelCoordinates(SoHandleEventAction *action);
// Returns the paths to all nodes of type classTypeId.
SoPathList * getPathList(SoType classTypeId);
ChemPath *processPickedPoint(const SoPickedPoint *pp);
virtual SbBool readInstance(SoInput *in, unsigned short flags);
// Destructor removes everything from the list.
virtual ~ChemSelection();
private:
#ifndef __nogl
// The viewer being used. This is required in order to determine
// if the application is using stereo.
SoXtGLWidget *viewer;
#endif
// Whether to use radiusSelection or not
SbBool useRadiusSelection;
// Current orthocam width and height
float orthoCamXres;
float orthoCamYres;
static SbVec2f ringCoords[16];
SoFieldSensor *lassoLineWidthSensor;
SoFieldSensor *lassoLinePatternSensor;
SoFieldSensor *lassoLineColorIndexSensor;
SoFieldSensor *radiusSelectSphereColorSensor;
SoFieldSensor *radiusSelectSphereTransparencySensor;
SoFieldSensor *radiusSelectSphereDrawStyleSensor;
SoFieldSensor *radiusSelectSphereComplexitySensor;
SoFieldSensor *radiusSelectLabelColorSensor;
SoFieldSensor *radiusSelectLabelFontNameSensor;
SoFieldSensor *radiusSelectLabelFontSizeSensor;
static void selectSensorCB(void *, SoSensor *);
// Selected atom on which the radiusSelect was started.
// This is the coordinate as returned from ChemData.
SbVec3f selectedAtomCoord;
// This is the value of selectedAtomCoord after all transforms in the
// scene graph are applied to it.
SbVec3f selectedAtomCoordX;
// This is the center of the radius selection sphere. It is
// selectedAtomCoordX with all transforms before the ChemSelection
// removed (that is, selectedAtomCoordX is multiplied by
// currentModelMatrixInverse).
SbVec3f sphereCoord;
// If some sort of scaling occurs before the ChemSelection node,
// we have to take that into account when determining the radius
// of the selection sphere
float sphereRadiusScaleFactor;
// The inverse of the ChemSelection modelMatrix. It is used to position
// the radius selection sphere correctly. Applying this to
// selectedAtomCoordX gives sphereCoord.
SbMatrix currentModelMatrix;
SbMatrix currentModelMatrixInverse;
SbRotation currentRotation;
SbViewVolume currentViewVolume;
SbMatrix currentViewMatrix;
// The radius of the "radiusSelect".
float selectedRadius;
float selectedRadiusSquared;
// Some things need to be initialized when the radiusSelected is
// started and this flag is used to signal that fact.
SbBool radiusSelectionFirstPoint;
void startRadiusSelection(ChemDisplayPath *chemPath);
void stopRadiusSelection();
void getSelectedAtomCoord(ChemDisplayPath *chemPath);
// This action is used to search for Chem type nodes.
static SoSearchAction *searchAction;
// Get the various bounding boxes from the ChemDisplay node.
static ChemBBoxAction *chemBBoxAction;
// this is called from the two constructors.
void constructorCommon();
void reallyHandleEvent(SoHandleEventAction *action);
// Adds a point to the lasso coordinate list.
void addPointToLasso(SoHandleEventAction *action);
// Left mouse button UP invokes the selection of objects within the lasso
// which is handled here.
void doLassoPick(SbBool shiftDown, SbBool ctrlDown);
void doRadiusPick(SbBool shiftDown, SbBool ctrlDown);
void lassoChemDisplay(int32_t numLassoVertices,
short theLassoType,
const SbVec3f &lassoMin,
const SbVec3f &lassoMax,
SbPList *selectedItemList);
void lassoChemLabel(int32_t numLassoVertices,
short theLassoType,
const SbVec3f &lassoMin,
const SbVec3f &lassoMax,
SbPList *selectedItemList);
void lassoChemMonitor(int32_t numLassoVertices,
short theLassoType,
const SbVec3f &lassoMin,
const SbVec3f &lassoMax,
SbPList *selectedItemList);
void radiusPickChemDisplay(SbPList *selectedItemList);
void radiusPickChemLabel(SbPList *selectedItemList);
void radiusPickChemMonitor(SbPList *selectedItemList);
};
#endif /* !__CHEM_SELECTION_H__ */
| [
"andre.ohlin@umu.se"
] | andre.ohlin@umu.se |
134052e3ac57c2bd435c20f32927da1b28f055c7 | dabd8bc7e10a5bb78e4effcc6319131fb66f1c14 | /Bison_PascaltoC/main.cpp | abcaabc2ff923789a9612899de92c55fdd69dbca | [] | no_license | maxLundin/translation_methods | 0a3bb1de7eeaec7cda06da8399fae8b1ab613f81 | 5a401064e6d27bd1a60d428487ead85c390a9919 | refs/heads/master | 2021-01-26T07:18:47.227673 | 2020-02-26T20:48:39 | 2020-02-26T20:48:39 | 243,362,320 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,142 | cpp | #include <iostream>
#include <sstream>
#include <map>
#include "expression.tab.hpp"
#include "expression.lexer.hpp"
using namespace std;
extern std::string *result;
extern std::map<std::string, std::string> variables_map;
extern std::map<std::string, std::string> variables_map_read;
void yyerror(const char *error) {
cerr << error;
}
int yywrap() {
return 1;
}
void setup(){
variables_map_read.insert(std::make_pair("int32_t","%d"));
variables_map_read.insert(std::make_pair("float","%f"));
variables_map_read.insert(std::make_pair("char","%c"));
variables_map_read.insert(std::make_pair("_Bool","%d"));
variables_map_read.insert(std::make_pair("int64_t","%lld"));
}
int main() {
stringstream ss;
string expression;
freopen("gcd.txt","r",stdin);
setup();
while (getline(cin, expression)) {
ss << expression << " ";
}
yy_scan_string(ss.str().c_str());
yyparse();
if (result != nullptr) {
std::cout << *result << std::endl;
}
// for (auto &x : variables_map) {
// std::cout << x.first << " " << x.second << std::endl;
// }
return 0;
}
| [
"lundin.m@mail.ru"
] | lundin.m@mail.ru |
d2975ea0bcca9a09368c6b63bd50813e5c508d02 | a740ec3c2a3c71b2196f3fc2ecf02ea6a1332d53 | /AgendaModel/xmlmananger.cpp | 847122fa44333ccce74130ccde5f3dfb99c3e7cc | [] | no_license | luisfernando7/AgendaProject | 0d3f8c560ecd429079b1482ca428dd6040198faa | 115b2598bb726f3bc017ec9afd0951fb471badd9 | refs/heads/master | 2021-01-21T08:01:40.017516 | 2014-05-16T17:52:48 | 2014-05-16T17:52:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,303 | cpp | #include "xmlmananger.h"
#include <QXmlStreamWriter>
#include <QXmlStreamReader>
#include <qdebug.h>
#include <iostream>
XMLMananger::XMLMananger()
{
}
QString XMLMananger::BuildRequestMaterial(model::RequestMaterials request)
{
QString output;
QXmlStreamWriter stream(&output);
stream.setAutoFormatting(true);
stream.writeStartDocument();
stream.writeStartElement("root");
stream.writeStartElement("request_materials");//Primeiro Elemento
stream.writeTextElement("id", QString::number(request.id()));
stream.writeStartElement("material");//Segundo elemento
stream.writeTextElement("material_id",QString::number(request.material().getId()));
stream.writeTextElement("material_name",request.material().name());
stream.writeTextElement("material_prince",QString::number(request.material().prince()));
stream.writeTextElement("material_unit",request.material().unity());
stream.writeEndElement();//Segundo elemento
stream.writeTextElement("date",request.date().toString("dd/MM/yyyy"));
stream.writeTextElement("qtd",QString::number(request.qtd()));
stream.writeStartElement("provider");//Terceiro elemento
stream.writeTextElement("provider_id",QString::number(request.provider().getId()));
stream.writeTextElement("provider_name",request.provider().name());
stream.writeTextElement("provider_street",request.provider().street());
stream.writeTextElement("provider_number",QString::number(request.provider().number()));
stream.writeTextElement("provider_phonenumber",request.provider().phoneNumber());
stream.writeEndElement();//Terceiro elemento
stream.writeEndElement();//Primeiro Elemento
stream.writeEndElement();
stream.writeEndDocument();
return output;
}
model::RequestMaterials XMLMananger::ParseRequestMaterial(QString source)
{
model::RequestMaterials rm;
model::Material m;
model::Provider p;
QXmlStreamReader xs(source);
while (!xs.atEnd()) {
if (xs.readNextStartElement())
{
if(xs.name() =="id")
rm.setId(xs.readElementText().toInt());
if(xs.name() == "material_id")
m.setId(xs.readElementText().toInt());
if(xs.name() == "material_name")
m.setName(xs.readElementText());
if(xs.name()=="material_prince")
m.setPrince(xs.readElementText().toDouble());
if(xs.name() == "material_unit")
m.setUnity(xs.readElementText());
if(xs.name() == "date")
rm.setDate(QDate::fromString(xs.readElementText(),"dd/MM/yyyy"));
if(xs.name() == "qtd")
rm.setQtd(xs.readElementText().toInt());
if(xs.name() == "provider_id")
p.setId(xs.readElementText().toInt());
if(xs.name() == "provider_name")
p.setName(xs.readElementText());
if(xs.name() == "provider_street")
p.setStreet(xs.readElementText());
if(xs.name() == "provider_number")
p.setNumber(xs.readElementText().toInt());
if(xs.name() == "provider_phonenumber")
p.setPhoneNumber(xs.readElementText());
}
}
rm.setMaterial(m);
rm.setProvider(p);
return rm;
}
| [
"luis.moraes@nddigital.com.br"
] | luis.moraes@nddigital.com.br |
3d184de66a70adea58f83ac14fa6636c011c54ce | dfcff435ba01cea22e25ede2312d6223bf3ef389 | /src/common/RgnDetect.cpp | ac0b21e2193bf5e406c1f1d082f2ca94dccdec2e | [
"BSD-3-Clause"
] | permissive | shubham-theway/ConEmu | 79ee4d221f05558b87d970adaa47363fdcd51822 | 0cbba13abc7884e2af71c5feefd2295e39362d75 | refs/heads/master | 2021-01-22T02:40:27.766328 | 2018-10-17T20:36:40 | 2018-10-17T20:36:40 | 102,248,837 | 0 | 0 | null | 2017-09-03T07:41:41 | 2017-09-03T07:41:41 | null | UTF-8 | C++ | false | false | 83,286 | cpp |
/*
Copyright (c) 2009-2017 Maximus5
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define HIDE_USE_EXCEPTION_INFO
#include <windows.h>
#include "Common.h"
#include "RgnDetect.h"
#include "UnicodeChars.h"
#ifndef RGN_ERROR
#define RGN_ERROR 0
#endif
WARNING("Заменить *mp_FarInfo на instance копию m_FarInfo");
static bool gbInTransparentAssert = false;
//#ifdef _DEBUG
// #undef _ASSERTE
// #define _ASSERTE(expr) gbInTransparentAssert=true; _ASSERT_EXPR((expr), _CRT_WIDE(#expr)); gbInTransparentAssert=false;
// #undef _ASSERT
// #define _ASSERT(expr) gbInTransparentAssert=true; _ASSERT_EXPR((expr), _CRT_WIDE(#expr)); gbInTransparentAssert=false;
//#endif
CRgnDetect::CRgnDetect()
{
mn_DetectCallCount = 0;
mn_AllFlagsSaved = 0;
memset(&m_DetectedDialogs, 0, sizeof(m_DetectedDialogs));
mp_FarInfo = NULL;
// Флаги
mn_NextDlgId = 0; mb_NeedPanelDetect = TRUE;
memset(&mrc_LeftPanel,0,sizeof(mrc_LeftPanel));
memset(&mrc_RightPanel,0,sizeof(mrc_RightPanel));
memset(&mrc_FarRect, 0, sizeof(mrc_FarRect)); // по умолчанию - не используется
//
mpsz_Chars = NULL;
mp_Attrs = mp_AttrsWork = NULL;
mn_CurWidth = mn_CurHeight = mn_MaxCells = 0;
mb_SBI_Loaded = false;
mb_TableCreated = false;
mb_NeedTransparency = false;
//
nUserBackIdx = nMenuBackIdx = 0;
crUserBack = crMenuTitleBack = 0;
nPanelTabsBackIdx = nPanelTabsForeIdx = 0; bPanelTabsSeparate = TRUE;
bShowKeyBar = true; nBottomLines = 2;
bAlwaysShowMenuBar = false; nTopLines = 0;
}
CRgnDetect::~CRgnDetect()
{
if (mpsz_Chars)
{
free(mpsz_Chars); mpsz_Chars = NULL;
}
if (mp_Attrs)
{
free(mp_Attrs); mp_Attrs = NULL;
}
if (mp_AttrsWork)
{
free(mp_AttrsWork); mp_AttrsWork = NULL;
}
}
//#ifdef _DEBUG
const DetectedDialogs* CRgnDetect::GetDetectedDialogsPtr() const
{
return &m_DetectedDialogs;
}
//#endif
int CRgnDetect::GetDetectedDialogs(int anMaxCount, SMALL_RECT* rc, DWORD* rf, DWORD anMask/*=-1*/, DWORD anTest/*=-1*/) const
{
if (!this) return 0;
int nCount = m_DetectedDialogs.Count;
if (nCount > 0 && anMaxCount > 0 && (rc || rf))
{
_ASSERTE(sizeof(*rc) == sizeof(m_DetectedDialogs.Rects[0]));
_ASSERTE(sizeof(*rf) == sizeof(m_DetectedDialogs.DlgFlags[0]));
if (anMask == (DWORD)-1)
{
if (nCount > anMaxCount)
nCount = anMaxCount;
if (rc)
memmove(rc, m_DetectedDialogs.Rects, nCount*sizeof(*rc));
if (rf)
memmove(rf, m_DetectedDialogs.DlgFlags, nCount*sizeof(*rf));
}
else
{
nCount = 0; DWORD nF;
for(int i = 0; i < m_DetectedDialogs.Count && nCount < anMaxCount; i++)
{
nF = m_DetectedDialogs.DlgFlags[i];
if ((nF & anMask) == anTest)
{
if (rc)
rc[nCount] = m_DetectedDialogs.Rects[i];
if (rf)
rf[nCount] = m_DetectedDialogs.DlgFlags[i];
nCount++;
}
}
}
}
return nCount;
}
DWORD CRgnDetect::GetDialog(DWORD nDlgID, SMALL_RECT* rc) const
{
if (!nDlgID)
{
_ASSERTE(nDlgID!=0);
return 0;
}
//DWORD nMask = nDlgID;
//if ((nDlgID & FR_FREEDLG_MASK) != 0) {
// nMask |= FR_FREEDLG_MASK;
//}
for(int i = 0; i < m_DetectedDialogs.Count; i++)
{
if ((m_DetectedDialogs.DlgFlags[i] & FR_ALLDLG_MASK) == nDlgID)
{
if (rc) *rc = m_DetectedDialogs.Rects[i];
_ASSERTE(m_DetectedDialogs.DlgFlags[i] != 0);
return m_DetectedDialogs.DlgFlags[i];
}
}
// Такого нету
return 0;
}
DWORD CRgnDetect::GetFlags() const
{
// чтобы не драться с другими нитями во время детекта возвращаем сохраненную mn_AllFlagsSaved
// а не то что лежит в m_DetectedDialogs.AllFlags (оно может сейчас меняться)
//return m_DetectedDialogs.AllFlags;
return mn_AllFlagsSaved;
}
/* ****************************************** */
/* Поиск диалогов и пометка "прозрачных" мест */
/* ****************************************** */
// Найти правую границу
bool CRgnDetect::FindFrameRight_ByTop(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostRight)
{
wchar_t wcMostRight = 0;
int n;
int nShift = nWidth*nFromY;
wchar_t wc = pChar[nShift+nFromX];
nMostRight = nFromX;
if (wc != ucBoxSinglDownRight && wc != ucBoxDblDownRight)
{
// нетривиальная ситуация - возможно диалог на экране неполный
int nMostTop = nFromY;
if (FindFrameTop_ByLeft(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostTop))
nFromY = nMostTop; // этот диалог продолжается сверху
}
if (wc != ucBoxSinglDownRight && wc != ucBoxDblDownRight)
{
wchar_t c;
// Придется попробовать идти просто до границы
if (wc == ucBoxSinglVert || wc == ucBoxSinglVertRight)
{
while(++nMostRight < nWidth)
{
c = pChar[nShift+nMostRight];
if (c == ucBoxSinglVert || c == ucBoxSinglVertLeft)
{
nMostRight++; break;
}
}
}
else if (wc == ucBoxDblDownRight)
{
while(++nMostRight < nWidth)
{
c = pChar[nShift+nMostRight];
if (c == ucBoxDblVert || c == ucBoxDblVertLeft || c == ucBoxDblVertSinglLeft)
{
nMostRight++; break;
}
}
}
}
else
{
if (wc == ucBoxSinglDownRight)
{
wcMostRight = ucBoxSinglDownLeft;
}
else if (wc == ucBoxDblDownRight)
{
wcMostRight = ucBoxDblDownLeft;
}
// Найти правую границу
while(++nMostRight < nWidth)
{
n = nShift+nMostRight;
//if (pAttr[n].crBackColor != nBackColor)
// break; // конец цвета фона диалога
if (pChar[n] == wcMostRight)
{
nMostRight++;
break; // закрывающая угловая рамка
}
}
}
nMostRight--;
_ASSERTE(nMostRight<nWidth);
return (nMostRight > nFromX);
}
// Найти левую границу
bool CRgnDetect::FindFrameLeft_ByTop(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostLeft)
{
wchar_t wcMostLeft;
int n;
int nShift = nWidth*nFromY;
wchar_t wc = pChar[nShift+nFromX];
nMostLeft = nFromX;
if (wc != ucBoxSinglDownLeft && wc != ucBoxDblDownLeft)
{
// нетривиальная ситуация - возможно диалог на экране неполный
int nMostTop = nFromY;
if (FindFrameTop_ByRight(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostTop))
nFromY = nMostTop; // этот диалог продолжается сверху
}
if (wc != ucBoxSinglDownLeft && wc != ucBoxDblDownLeft)
{
wchar_t c;
// Придется попробовать идти просто до границы
if (wc == ucBoxSinglVert || wc == ucBoxSinglVertLeft)
{
while(--nMostLeft >= 0)
{
c = pChar[nShift+nMostLeft];
if (c == ucBoxSinglVert || c == ucBoxSinglVertRight)
{
nMostLeft--; break;
}
}
}
else if (wc == ucBoxDblDownRight)
{
while(--nMostLeft >= 0)
{
c = pChar[nShift+nMostLeft];
if (c == ucBoxDblVert || c == ucBoxDblVertLeft || c == ucBoxDblVertSinglLeft)
{
nMostLeft--; break;
}
}
}
}
else
{
if (wc == ucBoxSinglDownLeft)
{
wcMostLeft = ucBoxSinglDownRight;
}
else if (wc == ucBoxDblDownLeft)
{
wcMostLeft = ucBoxDblDownRight;
}
else
{
_ASSERTE(wc == ucBoxSinglDownLeft || wc == ucBoxDblDownLeft);
return false;
}
// Найти левую границу
while(--nMostLeft >= 0)
{
n = nShift+nMostLeft;
//if (pAttr[n].crBackColor != nBackColor)
// break; // конец цвета фона диалога
if (pChar[n] == wcMostLeft)
{
nMostLeft--;
break; // закрывающая угловая рамка
}
}
}
nMostLeft++;
_ASSERTE(nMostLeft>=0);
return (nMostLeft < nFromX);
}
bool CRgnDetect::FindFrameRight_ByBottom(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostRight)
{
wchar_t wcMostRight;
int n;
int nShift = nWidth*nFromY;
wchar_t wc = pChar[nShift+nFromX];
nMostRight = nFromX;
if (wc == ucBoxSinglUpRight || wc == ucBoxSinglHorz || wc == ucBoxSinglUpHorz || wc == ucBoxDblUpSinglHorz)
{
wcMostRight = ucBoxSinglUpLeft;
}
else if (wc == ucBoxDblUpRight || wc == ucBoxSinglUpDblHorz || wc == ucBoxDblUpDblHorz || wc == ucBoxDblHorz)
{
wcMostRight = ucBoxDblUpLeft;
}
else
{
return false; // найти правый нижний угол мы не сможем
}
// Найти правую границу
while(++nMostRight < nWidth)
{
n = nShift+nMostRight;
//if (pAttr[n].crBackColor != nBackColor)
// break; // конец цвета фона диалога
if (pChar[n] == wcMostRight)
{
nMostRight++;
break; // закрывающая угловая рамка
}
}
nMostRight--;
_ASSERTE(nMostRight<nWidth);
return (nMostRight > nFromX);
}
bool CRgnDetect::FindFrameLeft_ByBottom(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostLeft)
{
wchar_t wcMostLeft;
int n;
int nShift = nWidth*nFromY;
wchar_t wc = pChar[nShift+nFromX];
nMostLeft = nFromX;
if (wc == ucBoxSinglUpLeft || wc == ucBoxSinglHorz || wc == ucBoxSinglUpHorz || wc == ucBoxDblUpSinglHorz)
{
wcMostLeft = ucBoxSinglUpRight;
}
else if (wc == ucBoxDblUpLeft || wc == ucBoxSinglUpDblHorz || wc == ucBoxDblUpDblHorz || wc == ucBoxDblHorz)
{
wcMostLeft = ucBoxDblUpRight;
}
else
{
return false; // найти левый нижний угол мы не сможем
}
// Найти левую границу
while(--nMostLeft >= 0)
{
n = nShift+nMostLeft;
//if (pAttr[n].crBackColor != nBackColor)
// break; // конец цвета фона диалога
if (pChar[n] == wcMostLeft)
{
nMostLeft--;
break; // закрывающая угловая рамка
}
}
nMostLeft++;
_ASSERTE(nMostLeft>=0);
return (nMostLeft < nFromX);
}
// Диалог без окантовки. Все просто - идем по рамке
bool CRgnDetect::FindDialog_TopLeft(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostRight, int &nMostBottom, bool &bMarkBorder)
{
bMarkBorder = TRUE;
#ifdef _DEBUG
int nShift = nWidth*nFromY;
#endif
int nMostRightBottom;
// Найти правую границу по верху
nMostRight = nFromX;
FindFrameRight_ByTop(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostRight);
_ASSERTE(nMostRight<nWidth);
// Найти нижнюю границу
nMostBottom = nFromY;
FindFrameBottom_ByLeft(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostBottom);
_ASSERTE(nMostBottom<nHeight);
// Найти нижнюю границу по правой стороне
nMostRightBottom = nFromY;
if (FindFrameBottom_ByRight(pChar, pAttr, nWidth, nHeight, nMostRight, nFromY, nMostRightBottom))
{
_ASSERTE(nMostRightBottom<nHeight);
// Результатом считаем - наиБОЛЬШУЮ высоту
if (nMostRightBottom > nMostBottom)
nMostBottom = nMostRightBottom;
}
return true;
}
// Диалог без окантовки. Все просто - идем по рамке
bool CRgnDetect::FindDialog_TopRight(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostRight, int &nMostBottom, bool &bMarkBorder)
{
bMarkBorder = TRUE;
#ifdef _DEBUG
int nShift = nWidth*nFromY;
#endif
int nX;
nMostRight = nFromX;
nMostBottom = nFromY;
// Найти левую границу по верху
if (FindFrameLeft_ByTop(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nX))
{
_ASSERTE(nX>=0);
nFromX = nX;
}
// Найти нижнюю границу
nMostBottom = nFromY;
FindFrameBottom_ByRight(pChar, pAttr, nWidth, nHeight, nMostRight, nFromY, nMostBottom);
_ASSERTE(nMostBottom<nHeight);
// найти левую границу по низу
if (FindFrameLeft_ByBottom(pChar, pAttr, nWidth, nHeight, nMostRight, nMostBottom, nX))
{
_ASSERTE(nX>=0);
if (nFromX > nX) nFromX = nX;
}
return true;
}
// Это может быть нижний кусок диалога
// левая граница рамки
// Диалог без окантовки, но начинается не с угла
bool CRgnDetect::FindDialog_Left(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostRight, int &nMostBottom, bool &bMarkBorder)
{
bMarkBorder = TRUE;
//nBackColor = pAttr[nFromX+nWidth*nFromY].crBackColor; // но на всякий случай сохраним цвет фона для сравнения
wchar_t wcMostRight, wcMostBottom, wcMostRightBottom, wcMostTop, wcNotMostBottom1;
int nShift = nWidth*nFromY;
int nMostTop, nY, nX;
wchar_t wc = pChar[nShift+nFromX];
if (wc == ucBoxSinglVert || wc == ucBoxSinglVertRight)
{
wcMostRight = ucBoxSinglUpLeft; wcMostBottom = ucBoxSinglUpRight; wcMostRightBottom = ucBoxSinglUpLeft; wcMostTop = ucBoxSinglDownLeft;
// наткнулись на вертикальную линию на панели
if (wc == ucBoxSinglVert)
{
wcNotMostBottom1 = ucBoxSinglUpHorz; //wcNotMostBottom2 = ucBoxSinglUpDblHorz;
nMostBottom = nFromY;
while(++nMostBottom < nHeight)
{
wc = pChar[nFromX+nMostBottom*nWidth];
if (wc == wcNotMostBottom1 || wc == ucBoxDblUpSinglHorz || wc == ucBoxSinglUpDblHorz || wc == ucBoxDblUpDblHorz)
return false;
}
}
}
else
{
wcMostRight = ucBoxDblUpLeft; wcMostBottom = ucBoxDblUpRight; wcMostRightBottom = ucBoxDblUpLeft; wcMostTop = ucBoxDblDownLeft;
}
// попытаться подняться вверх, может угол все-таки есть?
if (FindFrameTop_ByLeft(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nY))
{
_ASSERTE(nY >= 0);
nFromY = nY;
}
// Найти нижнюю границу
nMostBottom = nFromY;
FindFrameBottom_ByLeft(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostBottom);
_ASSERTE(nMostBottom<nHeight);
// Найти правую границу по верху
nMostRight = nFromX;
if (FindFrameRight_ByTop(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nX))
{
_ASSERTE(nX<nWidth);
nMostRight = nX;
}
// попробовать найти правую границу по низу
if (FindFrameRight_ByBottom(pChar, pAttr, nWidth, nHeight, nFromX, nMostBottom, nX))
{
_ASSERTE(nX<nWidth);
if (nX > nMostRight) nMostRight = nX;
}
_ASSERTE(nMostRight>=0);
// Попытаться подняться вверх по правой границе?
if (FindFrameTop_ByRight(pChar, pAttr, nWidth, nHeight, nMostRight, nFromY, nMostTop))
{
_ASSERTE(nMostTop>=0);
nFromY = nMostTop;
}
return true;
}
bool CRgnDetect::FindFrameTop_ByLeft(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostTop)
{
wchar_t c;
// Попытаемся подняться вверх вдоль правой рамки до угла
int nY = nFromY;
while(nY > 0)
{
c = pChar[(nY-1)*nWidth+nFromX];
if (c == ucBoxDblDownRight || c == ucBoxSinglDownRight // двойной и одинарный угол (левый верхний)
|| c == ucBoxDblVertRight || c == ucBoxDblVertSinglRight || c == ucBoxSinglVertRight
|| c == ucBoxDblVert || c == ucBoxSinglVert
) // пересечение (правая граница)
{
nY--; continue;
}
// Другие символы недопустимы
break;
}
_ASSERTE(nY >= 0);
nMostTop = nY;
return (nMostTop < nFromY);
}
bool CRgnDetect::FindFrameTop_ByRight(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostTop)
{
wchar_t c;
// Попытаемся подняться вверх вдоль правой рамки до угла
int nY = nFromY;
while(nY > 0)
{
c = pChar[(nY-1)*nWidth+nFromX];
if (c == ucBoxDblDownLeft || c == ucBoxSinglDownLeft // двойной и одинарный угол (правый верхний)
|| c == ucBoxDblVertLeft || c == ucBoxDblVertSinglLeft || c == ucBoxSinglVertLeft // пересечение (правая граница)
|| c == ucBoxDblVert || c == ucBoxSinglVert
|| c == L'}' // На правой границе панели могут быть признаки обрезанности имени файла
|| (c >= ucBox25 && c <= ucBox75) || c == ucUpScroll || c == ucDnScroll) // полоса прокрутки может быть только справа
{
nY--; continue;
}
// Другие символы недопустимы
break;
}
_ASSERTE(nY >= 0);
nMostTop = nY;
return (nMostTop < nFromY);
}
bool CRgnDetect::FindFrameBottom_ByRight(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostBottom)
{
// Попытаемся спуститься вдоль правой рамки до угла
int nY = nFromY;
int nEnd = nHeight - 1;
wchar_t c; //, cd = ucBoxDblVert;
//// В случае с правой панелью в правом верхнем углу могут быть часы, а не собственно угол
//// "<=1" т.к. надо учесть возможность постоянного меню
//c = pChar[nY*nWidth+nFromX];
//if (nFromY <= 1 && nFromX == (nWidth-1)) {
// if (isDigit(c)) {
// cd = c;
// }
//}
while(nY < nEnd)
{
c = pChar[(nY+1)*nWidth+nFromX];
if (c == ucBoxDblUpLeft || c == ucBoxSinglUpLeft // двойной и одинарный угол (правый нижний)
//|| c == cd // учесть часы на правой панели
|| c == ucBoxDblVertLeft || c == ucBoxDblVertSinglLeft || c == ucBoxSinglVertLeft // пересечение (правая граница)
|| c == ucBoxDblVert || c == ucBoxSinglVert
|| (c >= ucBox25 && c <= ucBox75) || c == ucUpScroll || c == ucDnScroll) // полоса прокрутки может быть только справа
{
nY++; continue;
}
// Другие символы недопустимы
break;
}
_ASSERTE(nY < nHeight);
nMostBottom = nY;
return (nMostBottom > nFromY);
}
bool CRgnDetect::FindFrameBottom_ByLeft(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostBottom)
{
// Попытаемся спуститься вдоль левой рамки до угла
int nY = nFromY;
int nEnd = nHeight - 1;
wchar_t c;
while(nY < nEnd)
{
c = pChar[(nY+1)*nWidth+nFromX];
if (c == ucBoxDblUpRight || c == ucBoxSinglUpRight // двойной и одинарный угол (левый нижний)
|| c == ucBoxDblVertRight || c == ucBoxDblVertSinglRight || c == ucBoxSinglVertRight
|| c == ucBoxDblVert || c == ucBoxSinglVert
) // пересечение (правая граница)
{
nY++; continue;
}
// Другие символы недопустимы
break;
}
_ASSERTE(nY < nHeight);
nMostBottom = nY;
return (nMostBottom > nFromY);
}
// Мы на правой границе рамки. Найти диалог слева
bool CRgnDetect::FindDialog_Right(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostRight, int &nMostBottom, bool &bMarkBorder)
{
bMarkBorder = TRUE;
int nY = nFromY;
int nX = nFromX;
nMostRight = nFromX;
nMostBottom = nFromY; // сразу запомним
// Попытаемся подняться вверх вдоль правой рамки до угла
if (FindFrameTop_ByRight(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nY))
nFromY = nY;
// Попытаемся спуститься вдоль правой рамки до угла
if (FindFrameBottom_ByRight(pChar, pAttr, nWidth, nHeight, nFromX, nMostBottom, nY))
nMostBottom = nY;
// Теперь можно искать диалог
// по верху
if (FindFrameLeft_ByTop(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nX))
nFromX = nX;
// по низу
if (FindFrameLeft_ByBottom(pChar, pAttr, nWidth, nHeight, nFromX, nMostBottom, nX))
if (nX < nFromX) nFromX = nX;
_ASSERTE(nFromX>=0 && nFromY>=0);
return true;
}
// Диалог может быть как слева, так и справа от вертикальной линии
bool CRgnDetect::FindDialog_Any(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostRight, int &nMostBottom, bool &bMarkBorder)
{
wchar_t c;
wchar_t wc = pChar[nFromY*nWidth+nFromX];
// Так что сначала нужно подняться (или опуститься) по рамке до угла
for(int ii = 0; ii <= 1; ii++)
{
int nY = nFromY;
int nYEnd = (!ii) ? -1 : nHeight;
int nYStep = (!ii) ? -1 : 1;
wchar_t wcCorn1 = (!ii) ? ucBoxSinglDownLeft : ucBoxSinglUpLeft;
wchar_t wcCorn2 = (!ii) ? ucBoxDblDownLeft : ucBoxDblUpLeft;
wchar_t wcCorn3 = (!ii) ? ucBoxDblDownRight : ucBoxDblUpRight;
wchar_t wcCorn4 = (!ii) ? ucBoxSinglDownRight : ucBoxSinglUpRight;
// TODO: если можно - определим какой угол мы ищем (двойной/одинарный)
// поехали
while(nY != nYEnd)
{
c = pChar[nY*nWidth+nFromX];
if (c == wcCorn1 || c == wcCorn2 // двойной и одинарный угол (правый верхний/нижний)
|| c == ucBoxDblVertLeft || c == ucBoxDblVertSinglLeft || c == ucBoxSinglVertLeft // пересечение (правая граница)
|| c == L'}' // На правой границе панели могут быть признаки обрезанности имени файла
|| (c >= ucBox25 && c <= ucBox75) || c == ucUpScroll || c == ucDnScroll) // полоса прокрутки может быть только справа
{
if (FindDialog_Right(pChar, pAttr, nWidth, nHeight, nFromX, nY, nMostRight, nMostBottom, bMarkBorder))
{
nFromY = nY;
return true;
}
return false; // непонятно что...
}
if (c == wcCorn3 || c == wcCorn4 // двойной и одинарный угол (левый верхний/нижний)
|| c == ucBoxDblVertRight || c == ucBoxDblVertSinglRight || c == ucBoxSinglVertRight) // пересечение (правая граница)
{
if (FindDialog_Left(pChar, pAttr, nWidth, nHeight, nFromX, nY, nMostRight, nMostBottom, bMarkBorder))
{
nFromY = nY;
return true;
}
return false; // непонятно что...
}
if (c != wc)
{
// Другие символы недопустимы
break;
}
// Сдвигаемся (вверх или вниз)
nY += nYStep;
}
}
return false;
}
// Function marks Far Panel vertical single lines (column separators)
bool CRgnDetect::FindDialog_Inner(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY)
{
// наткнулись на вертикальную линию на панели
int nShift = nWidth*nFromY;
wchar_t wc = pChar[nShift+nFromX];
if (wc != ucBoxSinglVert)
{
_ASSERTE(wc == ucBoxSinglVert);
return false;
}
// Поверх панели может быть диалог... хорошо бы это учитывать
int nY = nFromY;
while(++nY < nHeight)
{
wc = pChar[nFromX+nY*nWidth];
switch(wc)
{
// на панелях вертикальная линия может прерываться '}' (когда имя файла в колонку не влезает)
case ucBoxSinglVert:
case L'}':
continue;
// Если мы натыкаемся на угловой рамочный символ - значит это часть диалога. выходим
case ucBoxSinglUpRight:
case ucBoxSinglUpLeft:
case ucBoxSinglVertRight:
case ucBoxSinglVertLeft:
return false;
// достигли низа панели
case ucBoxSinglUpHorz:
case ucBoxDblUpSinglHorz:
case ucBoxSinglUpDblHorz:
case ucBoxDblUpDblHorz:
nY++; // пометить все сверху (включая)
// иначе - прервать поиск и пометить все сверху (не включая)
default:
nY--;
{
// Пометить всю линию до верха (содержащую допустимые символы) как часть рамки
CharAttr* p = pAttr+(nWidth*nY+nFromX);
while(nY-- >= nFromY)
{
//_ASSERTE(p->bDialog);
_ASSERTE(p >= pAttr);
p->Flags |= CharAttr_DialogVBorder;
p -= nWidth;
}
// мы могли начать не с верха панели
while(nY >= 0)
{
wc = pChar[nFromX+nY*nWidth];
if (wc != ucBoxSinglVert && wc != ucBoxSinglDownHorz
&& wc != ucBoxSinglDownDblHorz && wc != ucBoxDblDownDblHorz)
{
break;
}
//_ASSERTE(p->bDialog);
_ASSERTE(p >= pAttr);
p->Flags |= CharAttr_DialogVBorder;
p -= nWidth;
nY --;
}
}
return true;
}
}
return false;
}
// Попытаемся найти рамку?
bool CRgnDetect::FindFrame_TopLeft(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nFrameX, int &nFrameY)
{
// Попытаемся найти рамку?
nFrameX = -1; nFrameY = -1;
int nShift = nWidth*nFromY;
int nFindFrom = nShift+nFromX;
int nMaxAdd = min(5,(nWidth - nFromX - 1));
wchar_t wc;
// в этой же строке
for(int n = 1; n <= nMaxAdd; n++)
{
wc = pChar[nFindFrom+n];
if (wc == ucBoxSinglDownRight || wc == ucBoxDblDownRight)
{
nFrameX = nFromX+n; nFrameY = nFromY;
return true;
}
}
if (nFrameY == -1)
{
// строкой ниже
nFindFrom = nShift+nWidth+nFromX;
for(int n = 0; n <= nMaxAdd; n++)
{
wc = pChar[nFindFrom+n];
if (wc == ucBoxSinglDownRight || wc == ucBoxDblDownRight)
{
nFrameX = nFromX+n; nFrameY = nFromY+1;
return true;
}
}
}
return false;
}
bool CRgnDetect::ExpandDialogFrame(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int nFrameX, int nFrameY, int &nMostRight, int &nMostBottom)
{
bool bExpanded = false;
#ifdef _DEBUG
int nStartRight = nMostRight;
int nStartBottom = nMostBottom;
#endif
// Теперь расширить nMostRight & nMostBottom на окантовку
int n, n2, nShift = nWidth*nFromY;
wchar_t wc = pChar[nShift+nFromX];
DWORD nColor = pAttr[nShift+nFromX].crBackColor;
if (nFromX == nFrameX && nFromY == nFrameY)
{
if (wc != ucBoxDblDownRight && wc != ucBoxSinglDownRight)
return false;
//Сначала нужно пройти вверх и влево
if (nFromY) // Пробуем вверх
{
n = (nFromY-1)*nWidth+nFromX;
n2 = (nFromY-1)*nWidth+nMostRight;
if ((pAttr[n].crBackColor == nColor && (pChar[n] == L' ' || pChar[n] == ucNoBreakSpace))
&& (pAttr[n2].crBackColor == nColor && (pChar[n2] == L' ' || pChar[n2] == ucNoBreakSpace)))
{
nFromY--; bExpanded = true;
}
}
if (nFromX) // Пробуем влево
{
int nMinMargin = nFromX-3; if (nMinMargin<0) nMinMargin = 0;
n = nFromY*nWidth+nFromX;
n2 = nMostBottom*nWidth+nFromX;
while (nFromX > nMinMargin)
{
n--; n2--;
// Проверяем цвет и символ
if ((((pAttr[n].crBackColor == nColor) && ((pChar[n] == L' ') || (pChar[n] == ucNoBreakSpace)))
// "\\" - пометка что диалог в Far двигается с клавиатуры (Ctrl+F5)
|| (pChar[n] == L'\\'))
// Строка n2 соответствует не самой нижней строке диалога,
// а предпоследней строке на которой рисуется рамка.
// Поэтому тут проверяем только на " "
&& ((pAttr[n2].crBackColor == nColor) && ((pChar[n2] == L' ') || (pChar[n2] == ucNoBreakSpace))))
{
nFromX--;
}
else
{
break;
}
}
bExpanded = (nFromX<nFrameX);
}
_ASSERTE(nFromX>=0 && nFromY>=0);
}
else
{
if (wc != ucSpace && wc != ucNoBreakSpace)
return false;
}
if (nMostRight < (nWidth-1))
{
int nMaxMargin = 3+(nFrameX - nFromX);
if ((nMaxMargin+nMostRight) >= nWidth) nMaxMargin = nWidth - nMostRight - 1;
int nFindFrom = nShift+nWidth+nMostRight+1;
n = 0;
wc = pChar[nShift+nFromX];
while(n < nMaxMargin)
{
if (pAttr[nFindFrom].crBackColor != nColor || (pChar[nFindFrom] != L' ' && pChar[nFindFrom] != ucNoBreakSpace))
break;
n++; nFindFrom++;
}
if (n)
{
nMostRight += n;
bExpanded = true;
}
}
_ASSERTE(nMostRight<nWidth);
// nMostBottom
if (nFrameY > nFromY && nMostBottom < (nHeight-1))
{
// Если в фаре диалог двигается с клавиатуры (Ctrl+F5)
// то по углам диалога ставятся красные метки "\/"
// Поэтому проверяем не по углу диалога, а "под углом рамки"
n = (nMostBottom+1)*nWidth+nFrameX;
if (pAttr[n].crBackColor == nColor && (pChar[n] == L' ' || pChar[n] == ucNoBreakSpace))
{
nMostBottom ++; bExpanded = true;
}
}
_ASSERTE(nMostBottom<nHeight);
return bExpanded;
}
// В идеале - сюда попадать не должны. Это может быть или кусок диалога
// другая часть которого или скрыта, или вытащена за границы экрана
bool CRgnDetect::FindByBackground(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int &nFromX, int &nFromY, int &nMostRight, int &nMostBottom, bool &bMarkBorder)
{
// Придется идти просто по цвету фона
// Это может быть диалог, рамка которого закрыта другим диалогом,
// или вообще кусок диалога, у которого видна только часть рамки
DWORD nBackColor = pAttr[nFromX+nWidth*nFromY].crBackColor;
int n, nMostRightBottom, nShift = nWidth*nFromY;
// Найти правую границу
nMostRight = nFromX;
while(++nMostRight < nWidth)
{
n = nShift+nMostRight;
if (pAttr[n].crBackColor != nBackColor)
break; // конец цвета фона диалога
}
nMostRight--;
_ASSERTE(nMostRight<nWidth);
//2010-06-27 все-таки лишнее. Если уж пошли "по фону" то не нужно на рамки ориентироваться, иначе зациклимся
#if 0
wchar_t wc = pChar[nFromY*nWidth+nMostRight];
if (wc >= ucBoxSinglHorz && wc <= ucBoxDblVertHorz)
{
switch(wc)
{
case ucBoxSinglDownRight: case ucBoxDblDownRight:
case ucBoxSinglUpRight: case ucBoxDblUpRight:
case ucBoxSinglDownLeft: case ucBoxDblDownLeft:
case ucBoxSinglUpLeft: case ucBoxDblUpLeft:
case ucBoxDblVert: case ucBoxSinglVert:
{
DetectDialog(pChar, pAttr, nWidth, nHeight, nMostRight, nFromY);
if (pAttr[nShift+nFromX].bDialog)
return false; // все уже обработано
}
}
}
else if (nMostRight && ((wc >= ucBox25 && wc <= ucBox75) || wc == ucUpScroll || wc == ucDnScroll))
{
int nX = nMostRight;
if (FindDialog_Right(pChar, pAttr, nWidth, nHeight, nX, nFromY, nMostRight, nMostBottom, bMarkBorder))
{
nFromX = nX;
return false;
}
}
#endif
// Найти нижнюю границу
nMostBottom = nFromY;
while(++nMostBottom < nHeight)
{
n = nFromX+nMostBottom*nWidth;
if (pAttr[n].crBackColor != nBackColor)
break; // конец цвета фона диалога
}
nMostBottom--;
_ASSERTE(nMostBottom<nHeight);
// Найти нижнюю границу по правой стороне
nMostRightBottom = nFromY;
while(++nMostRightBottom < nHeight)
{
n = nMostRight+nMostRightBottom*nWidth;
if (pAttr[n].crBackColor != nBackColor)
break; // конец цвета фона диалога
}
nMostRightBottom--;
_ASSERTE(nMostRightBottom<nHeight);
// Результатом считаем - наибольшую высоту
if (nMostRightBottom > nMostBottom)
nMostBottom = nMostRightBottom;
return true;
}
bool CRgnDetect::DetectDialog(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int nFromX, int nFromY, int *pnMostRight, int *pnMostBottom)
{
if (nFromX >= nWidth || nFromY >= nHeight)
{
_ASSERTE(nFromX<nWidth);
_ASSERTE(nFromY<nHeight);
return false;
}
#ifdef _DEBUG
if (nFromX == 69 && nFromY == 12)
{
nFromX = nFromX;
}
#endif
// защита от переполнения стека (быть не должно)
if (mn_DetectCallCount >= 3)
{
_ASSERTE(mn_DetectCallCount<3);
return false;
}
/* *********************************************** */
/* После этой строки 'return' использовать нельзя! */
/* *********************************************** */
bool lbDlgFound = false;
mn_DetectCallCount++;
wchar_t wc; //, wcMostRight, wcMostBottom, wcMostRightBottom, wcMostTop, wcNotMostBottom1, wcNotMostBottom2;
int nMostRight, nMostBottom; //, nMostRightBottom, nMostTop, nShift, n;
//DWORD nBackColor;
bool bMarkBorder = false;
// Самое противное - детект диалога, который частично перекрыт другим диалогом
int nShift = nWidth*nFromY;
wc = pChar[nShift+nFromX];
WARNING("Доделать detect");
/*
Если нижний-левый угол диалога не нашли - он может быть закрыт другим диалогом?
попытаться найти правый-нижний угол?
*/
/*
Если у панелей закрыта середина нижней линии (меню плагинов) то ошибочно считается,
что это один большой диалог. А ведь можно по верху определить.
*/
if (wc >= ucBoxSinglHorz && wc <= ucBoxDblVertHorz)
{
switch(wc)
{
// Верхний левый угол?
case ucBoxSinglDownRight: case ucBoxDblDownRight:
{
// Диалог без окантовки. Все просто - идем по рамке
if (!FindDialog_TopLeft(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostRight, nMostBottom, bMarkBorder))
goto fin;
goto done;
}
// Нижний левый угол?
case ucBoxSinglUpRight: case ucBoxDblUpRight:
{
// Сначала нужно будет подняться по рамке вверх
if (!FindDialog_TopLeft(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostRight, nMostBottom, bMarkBorder))
goto fin;
goto done;
}
// Верхний правый угол?
case ucBoxSinglDownLeft: case ucBoxDblDownLeft:
{
// Диалог без окантовки. Все просто - идем по рамке
if (!FindDialog_TopRight(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostRight, nMostBottom, bMarkBorder))
goto fin;
goto done;
}
// Нижний правый угол?
case ucBoxSinglUpLeft: case ucBoxDblUpLeft:
{
// Сначала нужно будет подняться по рамке вверх
if (!FindDialog_Right(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostRight, nMostBottom, bMarkBorder))
goto fin;
goto done;
}
case ucBoxDblVert: case ucBoxSinglVert:
{
// наткнулись на вертикальную линию на панели
if (wc == ucBoxSinglVert)
{
if (FindDialog_Inner(pChar, pAttr, nWidth, nHeight, nFromX, nFromY))
goto fin;
}
// Диалог может быть как слева, так и справа от вертикальной линии
if (FindDialog_Any(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostRight, nMostBottom, bMarkBorder))
goto done;
}
}
}
if (wc == ucSpace || wc == ucNoBreakSpace)
{
// Попытаемся найти рамку?
int nFrameX = -1, nFrameY = -1;
if (FindFrame_TopLeft(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nFrameX, nFrameY))
{
// Если угол нашли - ищем рамку по рамке :)
DetectDialog(pChar, pAttr, nWidth, nHeight, nFrameX, nFrameY, &nMostRight, &nMostBottom);
//// Теперь расширить nMostRight & nMostBottom на окантовку
//ExpandDialogFrame(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nFrameX, nFrameY, nMostRight, nMostBottom);
//
goto done;
}
}
// Придется идти просто по цвету фона
// Это может быть диалог, рамка которого закрыта другим диалогом,
// или вообще кусок диалога, у которого видна только часть рамки
// 100627 - но только если это не вьювер/редактор. там слишком много мусора будет
if ((m_DetectedDialogs.AllFlags & FR_VIEWEREDITOR))
goto fin;
if (!FindByBackground(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostRight, nMostBottom, bMarkBorder))
goto fin; // значит уже все пометили, или диалога нет
done:
#ifdef _DEBUG
if (nFromX<0 || nFromX>=nWidth || nMostRight<nFromX || nMostRight>=nWidth
|| nFromY<0 || nFromY>=nHeight || nMostBottom<nFromY || nMostBottom>=nHeight)
{
//_ASSERT(FALSE);
// Это происходит, если обновление внутренних буферов произошло ДО
// завершения обработки диалогов (быстрый драг панелей, диалогов, и т.п.)
goto fin;
}
#endif
// Забить атрибуты
MarkDialog(pChar, pAttr, nWidth, nHeight, nFromX, nFromY, nMostRight, nMostBottom, (bMarkBorder ? CharAttr_DialogRect : 0));
lbDlgFound = true;
// Вернуть размеры, если просили
if (pnMostRight) *pnMostRight = nMostRight;
if (pnMostBottom) *pnMostBottom = nMostBottom;
fin:
mn_DetectCallCount--;
_ASSERTE(mn_DetectCallCount>=0);
return lbDlgFound;
}
int CRgnDetect::MarkDialog(wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight, int nX1, int nY1, int nX2, int nY2, UINT bMarkBorder /*= 0*/, bool bFindExterior /*= TRUE*/, DWORD nFlags /*= -1*/)
{
if (nX1<0 || nX1>=nWidth || nX2<nX1 || nX2>=nWidth
|| nY1<0 || nY1>=nHeight || nY2<nY1 || nY2>=nHeight)
{
_ASSERTE(nX1>=0 && nX1<nWidth); _ASSERTE(nX2>=0 && nX2<nWidth);
_ASSERTE(nY1>=0 && nY1<nHeight); _ASSERTE(nY2>=0 && nY2<nHeight);
return -1;
}
int nDlgIdx = -1;
DWORD DlgFlags = bMarkBorder ? FR_HASBORDER : 0;
int nWidth_1 = nWidth - 1;
int nHeight_1 = nHeight - 1;
//RECT r = {nX1,nY1,nX2,nY2};
if (nFlags != (DWORD)-1)
{
DlgFlags |= nFlags;
}
else if (!nX1 && !nY1 && !nY2 && nX2 == nWidth_1)
{
if ((mp_FarInfo->FarInterfaceSettings.AlwaysShowMenuBar) == 0)
{
DlgFlags |= FR_ACTIVEMENUBAR;
}
else
{
DlgFlags |= FR_MENUBAR;
// Попытаться подхватить флаг FR_ACTIVEMENUBAR даже когда меню всегда видно
BYTE btMenuInactiveFore = CONFORECOLOR(mp_FarInfo->nFarColors[col_HMenuText]);
BYTE btMenuInactiveBack = CONBACKCOLOR(mp_FarInfo->nFarColors[col_HMenuText]);
int nShift = nY1 * nWidth + nX1;
for(int nX = nX1; nX <= nX2; nX++, nShift++)
{
if (pAttr[nShift].nForeIdx != btMenuInactiveFore
|| pAttr[nShift].nBackIdx != btMenuInactiveBack)
{
DlgFlags |= FR_ACTIVEMENUBAR;
break;
}
}
}
}
else if (bMarkBorder && bFindExterior && mb_NeedPanelDetect) // должно быть так при пометке панелей
//&& !(m_DetectedDialogs.AllFlags & FR_FULLPANEL) // если еще не нашли полноэкранную панель
//&& ((m_DetectedDialogs.AllFlags & (FR_LEFTPANEL|FR_RIGHTPANEL)) != (FR_LEFTPANEL|FR_RIGHTPANEL)) // и не нашли или правую или левую панель
//)
{
if ((!nY1 || ((m_DetectedDialogs.AllFlags & FR_MENUBAR) && (nY1 == 1))) // условие для верхней границы панелей
&& (nY2 >= (nY1 + 3))) // и минимальная высота панелей
{
// Console API uses SHORT
_ASSERTE(!HIWORD(nX1) && !HIWORD(nY1) && !HIWORD(nX2) && !HIWORD(nY2));
SMALL_RECT sr = {(SHORT)nX1, (SHORT)nY1, (SHORT)nX2, (SHORT)nY2};
DWORD nPossible = 0;
if (!nX1)
{
if (nX2 == nWidth_1)
{
nPossible |= FR_FULLPANEL;
//r.Left = nX1; r.Top = nY1; r.Right = nX2; r.Bottom = nY2;
}
else if (nX2 < (nWidth-9))
{
nPossible |= FR_LEFTPANEL;
//r.Left = nX1; r.Top = nY1; r.Right = nX2; r.Bottom = nY2;
}
}
else if (nX1 >= 10 && nX2 == nWidth_1)
{
nPossible |= FR_RIGHTPANEL;
//r.Left = nX1; r.Top = nY1; r.Right = nX2; r.Bottom = nY2;
}
if (nPossible)
{
// Нужно чтобы хотя бы в одном углу этого прямоугольника были цвета рамки панелей!
// Иначе - считаем что вся панель перекрыта диалогами и не видима
BYTE btPanelFore = CONFORECOLOR(mp_FarInfo->nFarColors[col_PanelBox]);
BYTE btPanelBack = CONBACKCOLOR(mp_FarInfo->nFarColors[col_PanelBox]);
int nShift = 0;
for(int i = 0; i < 4; i++) //-V112
{
switch(i)
{
case 0: nShift = nY1 * nWidth + nX1; break;
case 1: nShift = nY2 * nWidth + nX1; break;
case 2: nShift = nY1 * nWidth + nX2; break;
case 3: nShift = nY2 * nWidth + nX2; break;
}
// Если цвет угла совпал с рамкой панели - то считаем, что это она
if (pAttr[nShift].nForeIdx == btPanelFore && pAttr[nShift].nBackIdx == btPanelBack)
{
if ((nPossible & FR_RIGHTPANEL))
mrc_RightPanel = sr; // только правая
else
mrc_LeftPanel = sr; // левая или полноэкранная
DlgFlags |= nPossible;
bFindExterior = false;
// Может все панели уже нашли?
if ((nPossible & FR_FULLPANEL))
mb_NeedPanelDetect = FALSE;
else if ((m_DetectedDialogs.AllFlags & (FR_LEFTPANEL|FR_RIGHTPANEL)) == (FR_LEFTPANEL|FR_RIGHTPANEL))
mb_NeedPanelDetect = FALSE;
break;
}
}
}
}
}
// Может быть это QSearch?
if (!(DlgFlags & FR_COMMONDLG_MASK) && bMarkBorder && bFindExterior)
{
// QSearch начинается строго на нижней рамке панели, за исключением того случая,
// когда KeyBar отключен и панель занимает (nHeight-1) строку
SMALL_RECT *prc = NULL;
if ((m_DetectedDialogs.AllFlags & FR_FULLPANEL))
{
prc = &mrc_LeftPanel;
}
else if ((m_DetectedDialogs.AllFlags & FR_LEFTPANEL) && nX2 < mrc_LeftPanel.Right)
{
prc = &mrc_LeftPanel;
}
else if ((m_DetectedDialogs.AllFlags & FR_RIGHTPANEL) && nX1 > mrc_RightPanel.Left)
{
prc = &mrc_RightPanel;
}
// проверяем
if (prc)
{
if ((nY1+2) == nY2 && prc->Left < nX1 && prc->Right > nX2
&& (nY1 == prc->Bottom || (nY1 == (prc->Bottom-1) && prc->Bottom == nHeight_1)))
{
DlgFlags |= FR_QSEARCH;
}
}
if (!(DlgFlags & FR_QSEARCH))
{
// Ширина диалога:
// г========== Unicode CharMap =======[¦]=¬ .
if ((nX1+39) == nX2 && nY2 >= (nY1 + 23))
{
wchar_t* pchTitle = pChar + (nY1 * nWidth + nX1 + 12);
if (!wmemcmp(pchTitle, L"Unicode CharMap", 15))
{
DlgFlags |= FR_UCHARMAP;
int nSourceIdx = MarkDialog(pChar, pAttr, nWidth, nHeight, nX1+6, nY1+3, nX2-1, nY2-5, false/*bMarkBorder*/, false/*bFindExterior*/);
if (nSourceIdx != -1)
{
m_DetectedDialogs.DlgFlags[nSourceIdx] |= FR_UCHARMAPGLYPH;
m_DetectedDialogs.AllFlags |= FR_UCHARMAPGLYPH;
}
}
}
}
}
if (!(DlgFlags & FR_COMMONDLG_MASK))
{
mn_NextDlgId++;
DlgFlags |= mn_NextDlgId<<8;
// "Красненький" диалог?
BYTE btWarnBack = CONBACKCOLOR(mp_FarInfo->nFarColors[col_WarnDialogBox]);
if (pAttr[nY1 * nWidth + nX1].nBackIdx == btWarnBack)
{
BYTE btNormBack = CONBACKCOLOR(mp_FarInfo->nFarColors[col_DialogBox]);
if (btNormBack != btWarnBack)
DlgFlags |= FR_ERRORCOLOR;
}
}
// Занести координаты в новый массив прямоугольников, обнаруженных в консоли
if (m_DetectedDialogs.Count < MAX_DETECTED_DIALOGS)
{
nDlgIdx = m_DetectedDialogs.Count++;
m_DetectedDialogs.Rects[nDlgIdx].Left = nX1;
m_DetectedDialogs.Rects[nDlgIdx].Top = nY1;
m_DetectedDialogs.Rects[nDlgIdx].Right = nX2;
m_DetectedDialogs.Rects[nDlgIdx].Bottom = nY2;
//m_DetectedDialogs.bWasFrame[nDlgIdx] = bMarkBorder;
m_DetectedDialogs.DlgFlags[nDlgIdx] = DlgFlags;
}
#ifdef _DEBUG
if (nX1 == 57 && nY1 == 0)
{
nX2 = nX2;
}
#endif
if (bMarkBorder)
{
pAttr[nY1 * nWidth + nX1].Flags2 |= CharAttr2_DialogCorner;
pAttr[nY1 * nWidth + nX2].Flags2 |= CharAttr2_DialogCorner;
pAttr[nY2 * nWidth + nX1].Flags2 |= CharAttr2_DialogCorner;
pAttr[nY2 * nWidth + nX2].Flags2 |= CharAttr2_DialogCorner;
}
_ASSERTE(!bMarkBorder || bMarkBorder==CharAttr_DialogPanel || bMarkBorder==CharAttr_DialogRect);
for (int nY = nY1; nY <= nY2; nY++)
{
CharAttr* pAttrShift = pAttr + nY * nWidth + nX1;
if (bMarkBorder & CharAttr_DialogRect)
{
// Mark vertical borders only if region was not marked as dialog yet
// Otherwise we may harm nice text flow if one dialog is displayed
// over Far panels, and font is proportional...
if (!(pAttrShift->Flags & CharAttr_DialogRect))
pAttrShift->Flags |= CharAttr_DialogVBorder;
if (!(pAttrShift[nX2-nX1].Flags & CharAttr_DialogRect))
pAttrShift[nX2-nX1].Flags |= CharAttr_DialogVBorder;
}
for(int nX = nX2 - nX1 + 1; nX > 0; nX--, pAttrShift++)
{
/*
if (nY > 0 && nX >= 58)
{
nX = nX;
}
*/
pAttrShift->Flags = (pAttrShift->Flags | bMarkBorder) & ~CharAttr_Transparent;
}
}
// If dialog was marked by Pseudographic frame, try to detect dialog rim (spaces and shadow)
if (bFindExterior && bMarkBorder)
{
int nMostRight = nX2, nMostBottom = nY2;
int nNewX1 = nX1, nNewY1 = nY1;
_ASSERTE(nMostRight<nWidth);
_ASSERTE(nMostBottom<nHeight);
if (ExpandDialogFrame(pChar, pAttr, nWidth, nHeight, nNewX1, nNewY1, nX1, nY1, nMostRight, nMostBottom))
{
_ASSERTE(nNewX1>=0 && nNewY1>=0);
DlgFlags |= FR_HASEXTENSION;
if (nDlgIdx >= 0)
m_DetectedDialogs.DlgFlags[nDlgIdx] = DlgFlags;
//Optimize: помечать можно только окантовку - сам диалог уже помечен
MarkDialog(pChar, pAttr, nWidth, nHeight, nNewX1, nNewY1, nMostRight, nMostBottom, CharAttr_DialogRect, false);
// Еще нужно "пометить" тень под диалогом
if (((nMostBottom+1) < nHeight) && ((nNewX1+2) < nWidth))
MarkDialog(pChar, pAttr, nWidth, nHeight, nNewX1+2, nMostBottom+1, min(nMostRight+2,nWidth-1), nMostBottom+1, CharAttr_DialogRect, false);
// И справа от диалога
if (((nMostRight+1) < nWidth) && ((nNewY1+1) < nHeight))
MarkDialog(pChar, pAttr, nWidth, nHeight, nMostRight+1, nNewY1+1, min(nMostRight+2,nWidth-1), nMostBottom, CharAttr_DialogRect, false);
}
}
if ((DlgFlags & (FR_LEFTPANEL|FR_RIGHTPANEL|FR_FULLPANEL)) != 0)
{
// Для детекта наличия PanelTabs
bool bSeparateTabs = false;
RECT r = {nX1,nY1,nX2,nY2};
int nBottom = r.bottom;
int nLeft = r.left;
// SeparateTabs может быть не проинициализирован
if (r.left /*&& mp_FarInfo->PanelTabs.SeparateTabs == 0*/
&& (m_DetectedDialogs.AllFlags & FR_LEFTPANEL))
{
if (mrc_LeftPanel.Bottom > r.bottom
&& nHeight > (nBottomLines+mrc_LeftPanel.Bottom+1))
{
nBottom = mrc_LeftPanel.Bottom;
nLeft = 0;
}
else if (nHeight > (nBottomLines+mrc_LeftPanel.Bottom+1))
{
nLeft = 0;
}
}
// SeparateTabs может быть не проинициализирован
int nIdxLeft, nIdxRight;
if (DlgFlags & FR_LEFTPANEL)
{
nIdxLeft = nWidth*(r.bottom+1)+r.right-1;
nIdxRight = nWidth*(r.bottom+1)+(nWidth-2);
}
else
{
nIdxLeft = nWidth*(r.bottom+1)+r.left-2;
nIdxRight = nWidth*(r.bottom+1)+r.right-1;
}
if ((pChar[nIdxRight-1] == 9616 && pChar[nIdxRight] == L'+' && pChar[nIdxRight+1] == 9616)
&& !(pChar[nIdxLeft-1] == 9616 && pChar[nIdxLeft] == L'+' && pChar[nIdxLeft+1] == 9616))
bSeparateTabs = false; // Есть только одна строка табов (одна на обе панели)
else
bSeparateTabs = true;
if (!bSeparateTabs)
{
r.left = nLeft;
r.bottom = nBottom;
}
if (nHeight > (nBottomLines+r.bottom+1))
{
int nIdx = nWidth*(r.bottom+1)+r.right-1;
if (pChar[nIdx-1] == 9616 && pChar[nIdx] == L'+' && pChar[nIdx+1] == 9616
/* -- может быть НЕ проинициализировано
&& pAttr[nIdx].nBackIdx == nPanelTabsBackIdx
&& pAttr[nIdx].nForeIdx == nPanelTabsForeIdx
*/
)
{
MarkDialog(pChar, pAttr, nWidth, nHeight, r.left, r.bottom+1, r.right, r.bottom+1,
false, false, FR_PANELTABS|(DlgFlags & (FR_LEFTPANEL|FR_RIGHTPANEL|FR_FULLPANEL)));
}
#ifdef _DEBUG
else
{
int nDbg2 = 0;
}
#endif
}
#ifdef _DEBUG
else if (!(DlgFlags & FR_PANELTABS))
{
int nDbg = 0;
}
#endif
}
m_DetectedDialogs.AllFlags |= DlgFlags;
return nDlgIdx;
}
void CRgnDetect::OnWindowSizeChanged()
{
mb_SBI_Loaded = false; // данные должны быть перечитаны
}
//lpBuffer
//The data to be written to the console screen buffer. This pointer is treated as the origin of a
//two-dimensional array of CHAR_INFO structures whose size is specified by the dwBufferSize parameter.
//The total size of the array must be less than 64K.
//
//dwBufferSize
//The size of the buffer pointed to by the lpBuffer parameter, in character cells.
//The X member of the COORD structure is the number of columns; the Y member is the number of rows.
//
//dwBufferCoord
//The coordinates of the upper-left cell in the buffer pointed to by the lpBuffer parameter.
//The X member of the COORD structure is the column, and the Y member is the row.
//
//lpWriteRegion
//A pointer to a SMALL_RECT structure. On input, the structure members specify the upper-left and lower-right
//coordinates of the console screen buffer rectangle to write to.
//On output, the structure members specify the actual rectangle that was used.
void CRgnDetect::OnWriteConsoleOutput(const CHAR_INFO *lpBuffer,COORD dwBufferSize,COORD dwBufferCoord,PSMALL_RECT lpWriteRegion, const COLORREF *apColors)
{
mp_Colors = apColors;
if (!mb_SBI_Loaded)
{
if (!InitializeSBI(apColors))
return;
}
if (!mpsz_Chars || !mp_Attrs || !mp_AttrsWork)
return; // буфер еще не был выделен
if ((dwBufferCoord.X >= dwBufferSize.X) || (dwBufferCoord.Y >= dwBufferSize.Y))
{
_ASSERTE(dwBufferCoord.X < dwBufferSize.X);
_ASSERTE(dwBufferCoord.Y < dwBufferSize.Y);
return; // Ошибка в параметрах
}
_ASSERTE(mb_TableCreated);
SMALL_RECT rcRegion;
rcRegion.Left = lpWriteRegion->Left - m_sbi.srWindow.Left;
rcRegion.Right = lpWriteRegion->Right - m_sbi.srWindow.Left;
rcRegion.Top = lpWriteRegion->Top - m_sbi.srWindow.Top;
rcRegion.Bottom = lpWriteRegion->Bottom - m_sbi.srWindow.Top;
// На некорректных координатах - сразу выйдем
if (rcRegion.Left >= mn_CurWidth || rcRegion.Top >= mn_CurHeight
|| rcRegion.Left > rcRegion.Right || rcRegion.Top > rcRegion.Bottom
|| rcRegion.Left < 0 || rcRegion.Top < 0)
{
_ASSERTE(rcRegion.Left < mn_CurWidth && rcRegion.Top < mn_CurHeight);
_ASSERTE(rcRegion.Left <= rcRegion.Right && rcRegion.Top <= rcRegion.Bottom);
_ASSERTE(rcRegion.Left >= 0 && rcRegion.Top >= 0);
return;
}
// Расфуговка буфера CHAR_INFO на текст и атрибуты
int nX1 = max(0,rcRegion.Left);
int nX2 = min(rcRegion.Right,(mn_CurWidth-1));
int nY1 = max(0,rcRegion.Top);
int nY2 = min(rcRegion.Bottom,(mn_CurHeight-1));
if ((dwBufferSize.X - dwBufferCoord.X - 1) < (nX2 - nX1))
nX2 = nX1 + (dwBufferSize.X - dwBufferCoord.X - 1);
if ((dwBufferSize.Y - dwBufferCoord.Y - 1) < (nY2 - nY1))
nY2 = nY1 + (dwBufferSize.Y - dwBufferCoord.Y - 1);
const CHAR_INFO *pSrcLine = lpBuffer + dwBufferCoord.Y * dwBufferSize.X;
if ((mn_MaxCells+1) > (mn_CurWidth*mn_CurHeight))
mpsz_Chars[mn_CurWidth*mn_CurHeight] = 0;
for (int Y = nY1; Y <= nY2; Y++)
{
const CHAR_INFO *pCharInfo = pSrcLine + dwBufferCoord.X;
wchar_t *pChar = mpsz_Chars + Y * mn_CurWidth + rcRegion.Left;
CharAttr *pAttr = mp_Attrs + Y * mn_CurWidth + rcRegion.Left;
for (int X = nX1; X <= nX2; X++, pCharInfo++)
{
TODO("OPTIMIZE: *(lpAttr++) = lpCur->Attributes;");
*(pAttr++) = mca_Table[pCharInfo->Attributes & 0xFF];
TODO("OPTIMIZE: ch = lpCur->Char.UnicodeChar;");
*(pChar++) = pCharInfo->Char.UnicodeChar;
}
pSrcLine += dwBufferSize.X;
}
}
void CRgnDetect::SetFarRect(SMALL_RECT *prcFarRect)
{
if (prcFarRect)
{
mrc_FarRect = *prcFarRect;
// Скопировать в m_sbi.srWindow
if (mrc_FarRect.Bottom)
{
// Сначала подправим вертикаль
if (mrc_FarRect.Bottom == m_sbi.srWindow.Bottom)
{
if (mrc_FarRect.Top != m_sbi.srWindow.Top)
m_sbi.srWindow.Top = mrc_FarRect.Top;
}
else if (mrc_FarRect.Top == m_sbi.srWindow.Top)
{
if (mrc_FarRect.Bottom != m_sbi.srWindow.Bottom)
m_sbi.srWindow.Bottom = mrc_FarRect.Bottom;
}
// Теперь - горизонталь
if (mrc_FarRect.Left == m_sbi.srWindow.Left)
{
if (mrc_FarRect.Right != m_sbi.srWindow.Right)
m_sbi.srWindow.Right = mrc_FarRect.Right;
}
else if (mrc_FarRect.Right == m_sbi.srWindow.Right)
{
if (mrc_FarRect.Left != m_sbi.srWindow.Left)
m_sbi.srWindow.Left = mrc_FarRect.Left;
}
// Иначе - считаем что фар выбился из окна, и панели будут скрыты
}
}
else
{
memset(&mrc_FarRect, 0, sizeof(mrc_FarRect));
}
}
BOOL CRgnDetect::InitializeSBI(const COLORREF *apColors)
{
//if (mb_SBI_Loaded) - всегда. Если вызвали - значит нужно все перечитать
// return TRUE;
m_DetectedDialogs.AllFlags = 0;
mp_Colors = apColors;
//if (!mb_TableCreated) - тоже всегда. цвета могли измениться
{
mb_TableCreated = true;
// формирование умолчательных цветов, по атрибутам консоли
int nColorIndex = 0;
CharAttr lca;
for(int nBack = 0; nBack <= 0xF; nBack++)
{
for(int nFore = 0; nFore <= 0xF; nFore++, nColorIndex++)
{
memset(&lca, 0, sizeof(lca));
lca.nForeIdx = nFore;
lca.nBackIdx = nBack;
lca.crForeColor = lca.crOrigForeColor = mp_Colors[lca.nForeIdx];
lca.crBackColor = lca.crOrigBackColor = mp_Colors[lca.nBackIdx];
mca_Table[nColorIndex] = lca;
}
}
}
HANDLE hStd = GetStdHandle(STD_OUTPUT_HANDLE);
mb_SBI_Loaded = GetConsoleScreenBufferInfo(hStd, &m_sbi)!=0;
if (!mb_SBI_Loaded)
return FALSE;
if (mrc_FarRect.Right && mrc_FarRect.Bottom)
{
// FAR2 /w - рисует в видимой части буфера
TODO("Возможно, нужно в srWindow копировать mrc_FarRect?");
}
else
{
// Нужно скорректировать srWindow, т.к. ФАР в любом случае забивает на видимый регион и рисует на весь буфер.
if (m_sbi.srWindow.Left)
m_sbi.srWindow.Left = 0;
if ((m_sbi.srWindow.Right+1) != m_sbi.dwSize.X)
m_sbi.srWindow.Right = m_sbi.dwSize.X - 1;
if (m_sbi.srWindow.Top)
m_sbi.srWindow.Top = 0;
if ((m_sbi.srWindow.Bottom+1) != m_sbi.dwSize.Y)
m_sbi.srWindow.Bottom = m_sbi.dwSize.Y - 1;
}
int nTextWidth = TextWidth();
int nTextHeight = TextHeight();
// Выделить память, при необходимости увеличить
if (!mpsz_Chars || !mp_Attrs || !mp_AttrsWork || (nTextWidth * nTextHeight) > mn_MaxCells)
{
if (mpsz_Chars) free(mpsz_Chars);
mn_MaxCells = (nTextWidth * nTextHeight);
// Чтобы безопасно использовать строковые функции - гарантированно делаем ASCIIZ. Хотя mpsz_Chars может и \0 содержать?
mpsz_Chars = (wchar_t*)calloc(mn_MaxCells+1, sizeof(wchar_t));
mp_Attrs = (CharAttr*)calloc(mn_MaxCells, sizeof(CharAttr));
mp_AttrsWork = (CharAttr*)calloc(mn_MaxCells, sizeof(CharAttr));
}
mn_CurWidth = nTextWidth;
mn_CurHeight = nTextHeight;
if (!mpsz_Chars || !mp_Attrs || !mp_AttrsWork)
{
_ASSERTE(mpsz_Chars && mp_Attrs && mp_AttrsWork);
return FALSE;
}
if (!mn_MaxCells)
{
_ASSERTE(mn_MaxCells>0);
return FALSE;
}
CHAR_INFO *pCharInfo = (CHAR_INFO*)calloc(mn_MaxCells, sizeof(CHAR_INFO));
if (!pCharInfo)
{
_ASSERTE(pCharInfo);
return FALSE;
}
#ifdef _DEBUG
CHAR_INFO *pCharInfoEnd = pCharInfo+mn_MaxCells;
#endif
BOOL bReadOk = FALSE;
COORD bufSize, bufCoord;
SMALL_RECT rgn;
// Если весь буфер больше 30К - и пытаться не будем
if ((mn_MaxCells*sizeof(CHAR_INFO)) < 30000)
{
bufSize.X = nTextWidth; bufSize.Y = nTextHeight;
bufCoord.X = 0; bufCoord.Y = 0;
rgn = m_sbi.srWindow;
if (ReadConsoleOutput(hStd, pCharInfo, bufSize, bufCoord, &rgn))
bReadOk = TRUE;
}
if (!bReadOk)
{
// Придется читать построчно
bufSize.X = nTextWidth; bufSize.Y = 1;
bufCoord.X = 0; bufCoord.Y = 0;
CONSOLE_SCREEN_BUFFER_INFO sbi = m_sbi;
_ASSERTE(sbi.srWindow.Right>sbi.srWindow.Left);
_ASSERTE(sbi.srWindow.Bottom>sbi.srWindow.Top);
rgn = sbi.srWindow;
CHAR_INFO* pLine = pCharInfo;
SMALL_RECT rcFar = mrc_FarRect;
#ifdef _DEBUG
int nFarWidth = rcFar.Right - rcFar.Left + 1;
#endif
for (SHORT y = sbi.srWindow.Top; y <= sbi.srWindow.Bottom; y++, rgn.Top++, pLine+=nTextWidth)
{
rgn.Bottom = rgn.Top;
rgn.Right = rgn.Left+nTextWidth-1;
ReadConsoleOutput(hStd, pLine, bufSize, bufCoord, &rgn);
}
}
// Теперь нужно перекинуть данные в mpsz_Chars & mp_Attrs
COORD crNul = {0,0};
// Console API uses SHORT
_ASSERTE(!HIWORD(nTextWidth) && !HIWORD(nTextHeight));
COORD crSize = {(SHORT)nTextWidth, (SHORT)nTextHeight};
OnWriteConsoleOutput(pCharInfo, crSize, crNul, &m_sbi.srWindow, mp_Colors);
// Буфер CHAR_INFO больше не нужен
free(pCharInfo);
return TRUE;
}
int CRgnDetect::TextWidth()
{
int nWidth = 0;
if (mrc_FarRect.Right && mrc_FarRect.Bottom)
{
// FAR2 /w - рисует в видимой части буфера
nWidth = m_sbi.srWindow.Right - m_sbi.srWindow.Left + 1;
}
else
{
nWidth = m_sbi.dwSize.X;
}
return nWidth;
}
int CRgnDetect::TextHeight()
{
int nHeight = 0;
if (mrc_FarRect.Right && mrc_FarRect.Bottom)
{
// FAR2 /w - рисует в видимой части буфера
nHeight = m_sbi.srWindow.Bottom - m_sbi.srWindow.Top + 1;
}
else
{
nHeight = m_sbi.dwSize.Y;
}
return nHeight;
}
BOOL CRgnDetect::GetCharAttr(int x, int y, wchar_t& rc, CharAttr& ra)
{
if (!mpsz_Chars || !mp_Attrs)
return FALSE;
if (x < 0 || x >= mn_CurWidth || y < 0 || y >= mn_CurHeight)
return FALSE;
rc = mpsz_Chars[x + y*mn_CurWidth];
ra = mp_Attrs[x + y*mn_CurWidth];
return TRUE;
}
// Эта функция вызывается из плагинов (ConEmuTh)
void CRgnDetect::PrepareTransparent(const CEFAR_INFO_MAPPING *apFarInfo, const COLORREF *apColors)
{
if (gbInTransparentAssert)
return;
mp_FarInfo = apFarInfo;
mp_Colors = apColors;
// Сброс флагов и прямоугольников панелей
m_DetectedDialogs.AllFlags = 0; mn_NextDlgId = 0; mb_NeedPanelDetect = TRUE;
memset(&mrc_LeftPanel,0,sizeof(mrc_LeftPanel));
memset(&mrc_RightPanel,0,sizeof(mrc_RightPanel));
if (!mb_SBI_Loaded)
{
if (!InitializeSBI(apColors))
return;
}
memmove(mp_AttrsWork, mp_Attrs, mn_CurWidth*mn_CurHeight*sizeof(*mp_AttrsWork));
PrepareTransparent(apFarInfo, apColors, &m_sbi, mpsz_Chars, mp_AttrsWork, mn_CurWidth, mn_CurHeight);
}
// Эта функция вызывается из GUI
void CRgnDetect::PrepareTransparent(const CEFAR_INFO_MAPPING *apFarInfo, const COLORREF *apColors, const CONSOLE_SCREEN_BUFFER_INFO *apSbi,
wchar_t* pChar, CharAttr* pAttr, int nWidth, int nHeight)
{
_ASSERTE(pAttr!=mp_Attrs);
mp_FarInfo = apFarInfo;
mp_Colors = apColors;
_ASSERTE(mp_Colors && (mp_Colors[1] || mp_Colors[2]));
_ASSERTE(pChar[nWidth*nHeight] == 0); // Должен быть ASCIIZ
if (apSbi != &m_sbi)
m_sbi = *apSbi;
mb_BufferHeight = !mrc_FarRect.Bottom && (m_sbi.dwSize.Y > (m_sbi.srWindow.Bottom - m_sbi.srWindow.Top + 10));
if (gbInTransparentAssert)
return;
// Сброс флагов и прямоугольников панелей
m_DetectedDialogs.AllFlags = 0; mn_NextDlgId = 0; mb_NeedPanelDetect = TRUE;
memset(&mrc_LeftPanel,0,sizeof(mrc_LeftPanel));
memset(&mrc_RightPanel,0,sizeof(mrc_RightPanel));
// !!! После "m_DetectedDialogs.AllFlags = 0" - никаких return !!!
m_DetectedDialogs.Count = 0;
//if (!mp_ConsoleInfo || !gSet.NeedDialogDetect())
// goto wrap;
// !!! в буферном режиме - никакой прозрачности, но диалоги - детектим, пригодится при отрисовке
// В редакторах-вьюверах тоже нужен детект
//if (!mp_FarInfo->bFarPanelAllowed)
// goto wrap;
//if (nCurFarPID && pRCon->mn_LastFarReadIdx != pRCon->mp_ConsoleInfo->nFarReadIdx) {
//if (isPressed(VK_CONTROL) && isPressed(VK_SHIFT) && isPressed(VK_MENU))
// goto wrap;
WARNING("Если информация в FarInfo не заполнена - брать умолчания!");
WARNING("Учитывать возможность наличия номеров окон, символа записи 'R', и по хорошему, ч/б режима");
//COLORREF crColorKey = gSet.ColorKey;
// реальный цвет, заданный в фаре
nUserBackIdx = CONBACKCOLOR(mp_FarInfo->nFarColors[col_CommandLineUserScreen]);
crUserBack = mp_Colors[nUserBackIdx];
nMenuBackIdx = CONBACKCOLOR(mp_FarInfo->nFarColors[col_HMenuText]);
crMenuTitleBack = mp_Colors[nMenuBackIdx];
// COL_PANELBOX
int nPanelBox = CONBACKCOLOR(mp_FarInfo->nFarColors[col_PanelBox]);
crPanelsBorderBack = mp_Colors[nPanelBox];
nPanelBox = CONFORECOLOR(mp_FarInfo->nFarColors[col_PanelBox]);
crPanelsBorderFore = mp_Colors[nPanelBox];
// COL_PANELSCREENSNUMBER
int nPanelNum = CONBACKCOLOR(mp_FarInfo->nFarColors[col_PanelScreensNumber]);
crPanelsNumberBack = mp_Colors[nPanelNum];
nPanelNum = CONFORECOLOR(mp_FarInfo->nFarColors[col_PanelScreensNumber]);
crPanelsNumberFore = mp_Colors[nPanelNum];
// Цвета диалогов
nDlgBorderBackIdx = CONBACKCOLOR(mp_FarInfo->nFarColors[col_DialogBox]);
nDlgBorderForeIdx = CONFORECOLOR(mp_FarInfo->nFarColors[col_DialogBox]);
nErrBorderBackIdx = CONBACKCOLOR(mp_FarInfo->nFarColors[col_WarnDialogBox]);
nErrBorderForeIdx = CONFORECOLOR(mp_FarInfo->nFarColors[col_WarnDialogBox]);
// Для детекта наличия PanelTabs
bPanelTabsSeparate = (mp_FarInfo->PanelTabs.SeparateTabs != 0);
if (mp_FarInfo->PanelTabs.ButtonColor != -1)
{
nPanelTabsBackIdx = CONBACKCOLOR(mp_FarInfo->PanelTabs.ButtonColor);
nPanelTabsForeIdx = CONFORECOLOR(mp_FarInfo->PanelTabs.ButtonColor);
}
else
{
nPanelTabsBackIdx = CONBACKCOLOR(mp_FarInfo->nFarColors[col_PanelText]);
nPanelTabsForeIdx = CONFORECOLOR(mp_FarInfo->nFarColors[col_PanelText]);
}
// При bUseColorKey Если панель погашена (или панели) то
// 1. UserScreen под ним заменяется на crColorKey
// 2. а текст - на пробелы
// Проверять наличие KeyBar по настройкам (Keybar + CmdLine)
bShowKeyBar = (mp_FarInfo->FarInterfaceSettings.ShowKeyBar) != 0;
nBottomLines = bShowKeyBar ? 2 : 1;
// Проверять наличие MenuBar по настройкам
// Или может быть меню сейчас показано?
// 1 - при видимом сейчас или постоянно меню
bAlwaysShowMenuBar = (mp_FarInfo->FarInterfaceSettings.AlwaysShowMenuBar) != 0;
if (bAlwaysShowMenuBar)
m_DetectedDialogs.AllFlags |= FR_MENUBAR; // ставим сразу, чтобы детектор панелей не запутался
nTopLines = bAlwaysShowMenuBar ? 1 : 0;
// Проверка теперь в другом месте (по плагину), да и левый нижний угол могут закрыть диалогом...
//// Проверим, что фар загрузился
//if (bShowKeyBar) {
// // в левом-нижнем углу должна быть цифра 1
// if (pChar[nWidth*(nHeight-1)] != L'1')
// goto wrap;
// // соответствующего цвета
// BYTE KeyBarNoColor = mp_FarInfo->nFarColors[col_KeyBarNum];
// if (pAttr[nWidth*(nHeight-1)].nBackIdx != ((KeyBarNoColor & 0xF0)>>4))
// goto wrap;
// if (pAttr[nWidth*(nHeight-1)].nForeIdx != (KeyBarNoColor & 0xF))
// goto wrap;
//}
// Теперь информация о панелях хронически обновляется плагином
//if (mb_LeftPanel)
// MarkDialog(pAttr, nWidth, nHeight, mr_LeftPanelFull.left, mr_LeftPanelFull.top, mr_LeftPanelFull.right, mr_LeftPanelFull.bottom);
//if (mb_RightPanel)
// MarkDialog(pAttr, nWidth, nHeight, mr_RightPanelFull.left, mr_RightPanelFull.top, mr_RightPanelFull.right, mr_RightPanelFull.bottom);
// Пометить непрозрачными панели
RECT r;
bool lbLeftVisible = false, lbRightVisible = false, lbFullPanel = false;
// Хотя информация о панелях хронически обновляется плагином, но это могут и отключить,
// да и отрисовка на экране может несколько задержаться
//if (mb_LeftPanel) {
if (mp_FarInfo->bFarLeftPanel)
{
lbLeftVisible = true;
//r = mr_LeftPanelFull;
r = mp_FarInfo->FarLeftPanel.PanelRect;
}
// -- Ветка никогда не активировалась
_ASSERTE(mp_FarInfo->bFarLeftPanel || !mp_FarInfo->FarLeftPanel.Visible);
//else
//{
// // Но если часть панели скрыта диалогами - наш детект панели мог не сработать
// if (mp_FarInfo->bFarLeftPanel && mp_FarInfo->FarLeftPanel.Visible)
// {
// // В "буферном" режиме размер панелей намного больше экрана
// lbLeftVisible = ConsoleRect2ScreenRect(mp_FarInfo->FarLeftPanel.PanelRect, &r);
// }
//}
//RECT rLeft = {0}, rRight = {0};
if (lbLeftVisible)
{
if (r.right == (nWidth-1))
lbFullPanel = true; // значит правой быть не может
if (r.right >= nWidth || r.bottom >= nHeight)
{
if (r.right >= nWidth) r.right = nWidth - 1;
if (r.bottom >= nHeight) r.bottom = nHeight - 1;
}
MarkDialog(pChar, pAttr, nWidth, nHeight, r.left, r.top, r.right, r.bottom, CharAttr_DialogPanel);
}
if (!lbFullPanel)
{
//if (mb_RightPanel) {
if (mp_FarInfo->bFarRightPanel)
{
lbRightVisible = true;
r = mp_FarInfo->FarRightPanel.PanelRect; // mr_RightPanelFull;
}
_ASSERTE(mp_FarInfo->bFarRightPanel || !mp_FarInfo->FarRightPanel.Visible);
if (lbRightVisible)
{
if (r.right >= nWidth || r.bottom >= nHeight)
{
if (r.right >= nWidth) r.right = nWidth - 1;
if (r.bottom >= nHeight) r.bottom = nHeight - 1;
}
MarkDialog(pChar, pAttr, nWidth, nHeight, r.left, r.top, r.right, r.bottom, CharAttr_DialogPanel);
}
}
mb_NeedPanelDetect = TRUE;
// Может быть первая строка - меню? постоянное или текущее
if (bAlwaysShowMenuBar // всегда
|| (pAttr->crBackColor == crMenuTitleBack
&& (pChar[0] == L' ' && pChar[1] == L' ' && pChar[2] == L' ' && pChar[3] == L' ' && pChar[4] != L' '))
)
{
MarkDialog(pChar, pAttr, nWidth, nHeight, 0, 0, nWidth-1, 0, false, false, FR_MENUBAR);
}
// Редактор/вьювер
if (mp_FarInfo->bViewerOrEditor
&& 0 == (m_DetectedDialogs.AllFlags & (FR_LEFTPANEL|FR_RIGHTPANEL|FR_FULLPANEL)))
{
// Покроем полностью, включая меню и кейбар
MarkDialog(pChar, pAttr, nWidth, nHeight, 0, 0, nWidth-1, nHeight-1, false, false, FR_VIEWEREDITOR);
}
if (mn_DetectCallCount != 0)
{
_ASSERT(mn_DetectCallCount == 0);
}
wchar_t* pszDst = pChar;
CharAttr* pnDst = pAttr;
const wchar_t szCornerChars[] = {
ucBoxSinglDownRight,ucBoxSinglDownLeft,ucBoxSinglUpRight,ucBoxSinglUpLeft,
ucBoxDblDownRight,ucBoxDblDownLeft,ucBoxDblUpRight,ucBoxDblUpLeft,
0}; // ASCIIZ
for (int nY = 0; nY < nHeight; nY++)
{
if (nY >= nTopLines && nY < (nHeight-nBottomLines))
{
// ! первый cell - резервируем для скрытия/показа панелей
int nX1 = 0;
int nX2 = nWidth-1; // по умолчанию - на всю ширину
//if (!mb_LeftPanel && mb_RightPanel) {
if (!mp_FarInfo->bFarLeftPanel && mp_FarInfo->bFarRightPanel)
{
// Погашена только левая панель
nX2 = /*mr_RightPanelFull*/ mp_FarInfo->FarRightPanel.PanelRect.left-1;
//} else if (mb_LeftPanel && !mb_RightPanel) {
}
else if (mp_FarInfo->bFarLeftPanel && !mp_FarInfo->bFarRightPanel)
{
// Погашена только правая панель
nX1 = /*mr_LeftPanelFull*/ mp_FarInfo->FarLeftPanel.PanelRect.right+1;
}
else
{
//Внимание! Панели могут быть, но они могут быть перекрыты PlugMenu!
}
#ifdef _DEBUG
if (nY == 16)
{
nY = nY;
}
#endif
#if 0
int nShift = nY*nWidth+nX1;
#endif
//int nX = nX1;
if (nY == nTopLines
&& (m_DetectedDialogs.AllFlags == 0 || m_DetectedDialogs.AllFlags == FR_MENUBAR)
&& ((*pszDst == L'[' && pnDst->crBackColor == crPanelsNumberBack && pnDst->crForeColor == crPanelsNumberFore)
|| (!nY
&& ((*pszDst == L'P' && (pnDst->nBackIdx & 7) == 0x2 && pnDst->nForeIdx == 0xF)
|| (*pszDst == L'R' && (pnDst->nBackIdx & 7) == 0x4 && pnDst->nForeIdx == 0xF))))
&& (pszDst[nWidth] == ucBoxDblVert && pnDst[nWidth].crBackColor == crPanelsBorderBack && pnDst[nWidth].crForeColor == crPanelsBorderFore)
)
{
// Принудительно сдетектить, как панель
DetectDialog(pChar, pAttr, nWidth, nHeight, 0/*nX*/, nY+1);
}
//wchar_t* pszDstX = pszDst + nX;
//CharAttr* pnDstX = pnDst + nX;
wchar_t *pszFrom = pszDst;
wchar_t *pszEnd = pszDst + nWidth;
while (pszFrom < pszEnd)
{
//DWORD DstFlags = pnDst[nX].Flags;
wchar_t cSave = pszDst[nWidth];
pszDst[nWidth] = 0;
wchar_t* pszCorner = wcspbrk(pszFrom, szCornerChars);
// Если не нашли - может в консоли '\0' есть?
while (!pszCorner)
{
pszFrom += lstrlen(pszFrom)+1;
if (pszFrom >= (pszDst + nWidth))
{
break;
}
pszCorner = wcspbrk(pszFrom, szCornerChars);
}
pszDst[nWidth] = cSave;
if (!pszCorner)
break;
pszFrom = pszCorner + 1; // сразу накрутим, чтобы не забыть
int nX = (int)(pszCorner - pszDst);
if (
!(pnDst[nX].Flags2/*DstFlags*/ & CharAttr2_DialogCorner)
)
{
switch (pszDst[nX])
{
case ucBoxSinglDownRight:
case ucBoxSinglDownLeft:
case ucBoxSinglUpRight:
case ucBoxSinglUpLeft:
case ucBoxDblDownRight:
case ucBoxDblDownLeft:
case ucBoxDblUpRight:
case ucBoxDblUpLeft:
// Это правый кусок диалога, который не полностью влез на экран
// Пометить "рамкой" до его низа
// 100627 - во вьювере(?) будем обрабатывать только цвета диалога, во избежание замусоривания
if (!(m_DetectedDialogs.AllFlags & FR_VIEWEREDITOR) ||
(pnDst[nX].nBackIdx == nDlgBorderBackIdx && pnDst[nX].nForeIdx == nDlgBorderForeIdx) ||
(pnDst[nX].nBackIdx == nErrBorderBackIdx && pnDst[nX].nForeIdx == nErrBorderForeIdx)
)
DetectDialog(pChar, pAttr, nWidth, nHeight, nX, nY);
}
}
//nX++;
//pszDstX++;
//pnDstX++;
#if 0
nShift++;
#endif
}
}
pszDst += nWidth;
pnDst += nWidth;
}
if (mn_DetectCallCount != 0)
{
_ASSERT(mn_DetectCallCount == 0);
}
if (mb_BufferHeight) // при "far /w" mb_BufferHeight==false
goto wrap; // в буферном режиме - никакой прозрачности
if (!lbLeftVisible && !lbRightVisible)
{
if (isPressed(VK_CONTROL) && isPressed(VK_SHIFT) && isPressed(VK_MENU))
goto wrap; // По CtrlAltShift - показать UserScreen (не делать его прозрачным)
}
// 0x0 должен быть непрозрачным
//pAttr[0].bDialog = TRUE;
pszDst = pChar;
pnDst = pAttr;
// Только если это реально нужно, т.к. занимает значительное время.
// Возможно, стоит необходимые проверки уже при отрисовке проводить
if (mb_NeedTransparency)
{
for(int nY = 0; nY < nHeight; nY++)
{
if (nY >= nTopLines && nY < (nHeight-nBottomLines))
{
// ! первый cell - резервируем для скрытия/показа панелей
int nX1 = 0;
int nX2 = nWidth-1; // по умолчанию - на всю ширину
// Все-таки, если панели приподняты - делаем UserScreen прозрачным
// Ведь остается возможность посмотреть его по CtrlAltShift
//if (!mb_LeftPanel && mb_RightPanel) {
// // Погашена только левая панель
// nX2 = mr_RightPanelFull.left-1;
//} else if (mb_LeftPanel && !mb_RightPanel) {
// // Погашена только правая панель
// nX1 = mr_LeftPanelFull.right+1;
//} else {
// //Внимание! Панели могут быть, но они могут быть перекрыты PlugMenu!
//}
//TODO: Far Manager: blinking on startup? until panels don't appear? become transparent?
CharAttr* pnDstShift = pnDst + /*nY*nWidth +*/ nX1;
CharAttr* pnDstEnd = pnDst + nX2 + 1;
while (pnDstShift < pnDstEnd)
{
// If it was not marked as "Dialog"
if (!(pnDstShift->Flags & (CharAttr_DialogPanel|CharAttr_DialogRect)))
{
if (pnDstShift->crBackColor == crUserBack)
{
pnDstShift->Flags |= CharAttr_Transparent;
}
}
pnDstShift++;
}
}
pszDst += nWidth;
pnDst += nWidth;
}
}
// Некрасиво...
//// 0x0 должен быть непрозрачным
//pAttr[0].bTransparent = FALSE;
wrap:
mn_AllFlagsSaved = m_DetectedDialogs.AllFlags;
}
// Преобразовать абсолютные координаты консоли в координаты нашего буфера
// (вычесть номер верхней видимой строки и скорректировать видимую высоту)
bool CRgnDetect::ConsoleRect2ScreenRect(const RECT &rcCon, RECT *prcScr)
{
if (!this) return false;
*prcScr = rcCon;
int nTopVisibleLine = m_sbi.srWindow.Top;
_ASSERTE(m_sbi.srWindow.Left==0); // при работе в ConEmu - пока всегда прижато к левому краю
int nTextWidth = (m_sbi.srWindow.Right - m_sbi.srWindow.Left + 1);
int nTextHeight = (m_sbi.srWindow.Bottom - m_sbi.srWindow.Top + 1);
if (mb_BufferHeight && nTopVisibleLine)
{
prcScr->top -= nTopVisibleLine;
prcScr->bottom -= nTopVisibleLine;
}
bool lbRectOK = true;
if (prcScr->left == 0 && prcScr->right >= nTextWidth)
prcScr->right = nTextWidth - 1;
if (prcScr->left)
{
if (prcScr->left >= nTextWidth)
return false;
if (prcScr->right >= nTextWidth)
prcScr->right = nTextWidth - 1;
}
if (prcScr->bottom < 0)
{
lbRectOK = false; // полностью уехал за границу вверх
}
else if (prcScr->top >= nTextHeight)
{
lbRectOK = false; // полностью уехал за границу вниз
}
else
{
// Скорректировать по видимому прямоугольнику
if (prcScr->top < 0)
prcScr->top = 0;
if (prcScr->bottom >= nTextHeight)
prcScr->bottom = nTextHeight - 1;
lbRectOK = (prcScr->bottom > prcScr->top);
}
return lbRectOK;
}
CRgnRects::CRgnRects()
{
nRectCount = 0;
nRgnState = NULLREGION;
nFieldMaxCells = nFieldWidth = nFieldHeight = 0;
pFieldCells = NULL;
memset(rcRect, 0, sizeof(rcRect));
}
CRgnRects::~CRgnRects()
{
if (pFieldCells) free(pFieldCells);
}
// Сброс всего в NULLREGION
void CRgnRects::Reset()
{
nRectCount = 0;
nRgnState = NULLREGION;
}
// Сбросить все прямоугольники и установить rcRect[0]
void CRgnRects::Init(LPRECT prcInit)
{
// Установим начальный прямоугольник
nRectCount = 1;
rcRect[0] = *prcInit;
nRgnState = SIMPLEREGION;
// готовим поле для проверки
nFieldWidth = prcInit->right - prcInit->left + 1;
nFieldHeight = prcInit->bottom - prcInit->top + 1;
if (nFieldWidth<1 || nFieldHeight<1)
{
nRgnState = NULLREGION;
return;
}
if (!nFieldMaxCells || !pFieldCells || nFieldMaxCells < (nFieldWidth*nFieldHeight))
{
if (pFieldCells) free(pFieldCells);
nFieldMaxCells = nFieldWidth*nFieldHeight;
_ASSERTE(sizeof(*pFieldCells)==1);
pFieldCells = (bool*)calloc(nFieldMaxCells,1);
if (!pFieldCells)
{
_ASSERTE(pFieldCells!=NULL);
nRgnState = RGN_ERROR;
return;
}
}
else
{
memset(pFieldCells, 0, nFieldMaxCells);
}
}
// Combines the parts of rcRect[..] that are not part of prcAddDiff.
int CRgnRects::Diff(LPRECT prcAddDiff)
{
if (!pFieldCells || nRectCount>=MAX_RGN_RECTS || nRgnState <= NULLREGION)
return nRgnState; // регион уже пустой, ничего делать не нужно
if (prcAddDiff->left > prcAddDiff->right || prcAddDiff->top > prcAddDiff->bottom)
{
_ASSERTE(prcAddDiff->left <= prcAddDiff->right && prcAddDiff->top <= prcAddDiff->bottom);
return nRgnState; // не валидный prcAddDiff
}
// поехали
int X1 = rcRect[0].left, X2 = rcRect[0].right;
if (prcAddDiff->left > X2 || prcAddDiff->right < X1)
return nRgnState; // prcAddDiff не пересекается с rcRect[0]
int iX1 = max(prcAddDiff->left,X1);
int iX2 = min(prcAddDiff->right,X2);
if (iX2 < iX1)
{
_ASSERTE(iX2 >= iX1);
return nRgnState; // пустая область?
}
int Y1 = rcRect[0].top, Y2 = rcRect[0].bottom;
if (prcAddDiff->top > Y2 || prcAddDiff->bottom < Y1)
return nRgnState; // prcAddDiff не пересекается с rcRect[0]
int iY1 = max(prcAddDiff->top,Y1);
int iY2 = min(prcAddDiff->bottom,Y2);
// Ладно, добавим этот прямоугольник в список вычитаемых
rcRect[nRectCount++] = *prcAddDiff;
int Y, iy = iY1 - rcRect[0].top;
int nSubWidth = iX2 - iX1 + 1;
_ASSERTE(iy>=0);
for(Y = iY1; Y <= iY2; Y++, iy++)
{
int ix = iX1 - X1;
_ASSERTE(ix>=0);
int ii = (iy*nFieldWidth) + ix;
memset(pFieldCells+ii, 1, nSubWidth);
//for (int X = iX1; X <= iX2; X++, ii++) {
// if (!pFieldCells[ii]) {
// pFieldCells[ii] = true;
// }
//}
}
// Теперь проверить, а осталось ли еще что-то?
Y2 = nFieldWidth * nFieldHeight;
void* ptrCellLeft = memchr(pFieldCells, 0, Y2);
//bool lbAreCellLeft = (ptrCellLeft != NULL);
//for (Y = 0; Y < Y2; Y++) {
// if (!pFieldCells[ii]) {
// lbAreCellLeft = true;
// break;
// }
//}
if (ptrCellLeft != NULL)
{
nRgnState = COMPLEXREGION;
}
else
{
nRgnState = NULLREGION;
}
return nRgnState;
}
int CRgnRects::DiffSmall(SMALL_RECT *prcAddDiff)
{
if (!prcAddDiff)
return Diff(NULL);
RECT rc = {prcAddDiff->Left,prcAddDiff->Top,prcAddDiff->Right,prcAddDiff->Bottom};
return Diff(&rc);
}
// Скопировать ИЗ pRgn, вернуть true - если были отличия
bool CRgnRects::LoadFrom(CRgnRects* pRgn)
{
bool lbChanges = false;
if (!pRgn)
{
// Если до этого был НЕ пустой регион
lbChanges = (nRgnState >= SIMPLEREGION);
// сброс
Reset();
}
else
{
if (nRectCount != pRgn->nRectCount || nRgnState != pRgn->nRgnState)
{
lbChanges = true;
}
else if (pRgn->nRectCount)
{
if (memcmp(rcRect, pRgn->rcRect, pRgn->nRectCount * sizeof(RECT)) != 0)
lbChanges = true;
}
nRectCount = pRgn->nRectCount;
nRgnState = pRgn->nRgnState;
if (nRectCount > 0)
{
memmove(rcRect, pRgn->rcRect, nRectCount * sizeof(RECT));
}
}
// Нас интересуют только прямоугольники
if (pFieldCells)
{
free(pFieldCells); pFieldCells = NULL;
}
return lbChanges;
}
void CRgnDetect::SetNeedTransparency(bool abNeed)
{
mb_NeedTransparency = abNeed;
} | [
"ConEmu.Maximus5@gmail.com"
] | ConEmu.Maximus5@gmail.com |
0a39079eeb928f5e1354955ade53416ab8d6b812 | 4d0300263d28fb461f285cc2c3dfd7c51621cb4d | /external/Angle/Project/src/libGLESv2/renderer/Image9.cpp | 22183cd4de7a21c8c82b7b1f9428e487b8421e0d | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-free-unknown"
] | permissive | coronalabs/corona | 6a108e8bfc8026e8c85e6768cdd8590b5a83bdc2 | 5e853b590f6857f43f4d1eb98ee2b842f67eef0d | refs/heads/master | 2023-08-30T14:29:19.542726 | 2023-08-22T15:18:29 | 2023-08-22T15:18:29 | 163,527,358 | 2,487 | 326 | MIT | 2023-09-02T16:46:40 | 2018-12-29T17:05:15 | C++ | UTF-8 | C++ | false | false | 23,766 | cpp | #include "precompiled.h"
//
// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Image9.cpp: Implements the rx::Image9 class, which acts as the interface to
// the actual underlying surfaces of a Texture.
#include "libGLESv2/renderer/Image9.h"
#include "libGLESv2/main.h"
#include "libGLESv2/Framebuffer.h"
#include "libGLESv2/Renderbuffer.h"
#include "libGLESv2/renderer/Renderer9.h"
#include "libGLESv2/renderer/RenderTarget9.h"
#include "libGLESv2/renderer/TextureStorage9.h"
#include "libGLESv2/renderer/renderer9_utils.h"
#include "libGLESv2/renderer/generatemip.h"
namespace rx
{
Image9::Image9()
{
mSurface = NULL;
mRenderer = NULL;
mD3DPool = D3DPOOL_SYSTEMMEM;
mD3DFormat = D3DFMT_UNKNOWN;
}
Image9::~Image9()
{
if (mSurface)
{
mSurface->Release();
}
}
void Image9::generateMip(IDirect3DSurface9 *destSurface, IDirect3DSurface9 *sourceSurface)
{
D3DSURFACE_DESC destDesc;
HRESULT result = destSurface->GetDesc(&destDesc);
ASSERT(SUCCEEDED(result));
D3DSURFACE_DESC sourceDesc;
result = sourceSurface->GetDesc(&sourceDesc);
ASSERT(SUCCEEDED(result));
ASSERT(sourceDesc.Format == destDesc.Format);
ASSERT(sourceDesc.Width == 1 || sourceDesc.Width / 2 == destDesc.Width);
ASSERT(sourceDesc.Height == 1 || sourceDesc.Height / 2 == destDesc.Height);
D3DLOCKED_RECT sourceLocked = {0};
result = sourceSurface->LockRect(&sourceLocked, NULL, D3DLOCK_READONLY);
ASSERT(SUCCEEDED(result));
D3DLOCKED_RECT destLocked = {0};
result = destSurface->LockRect(&destLocked, NULL, 0);
ASSERT(SUCCEEDED(result));
const unsigned char *sourceData = reinterpret_cast<const unsigned char*>(sourceLocked.pBits);
unsigned char *destData = reinterpret_cast<unsigned char*>(destLocked.pBits);
if (sourceData && destData)
{
switch (sourceDesc.Format)
{
case D3DFMT_L8:
GenerateMip<L8>(sourceDesc.Width, sourceDesc.Height, sourceData, sourceLocked.Pitch, destData, destLocked.Pitch);
break;
case D3DFMT_A8L8:
GenerateMip<A8L8>(sourceDesc.Width, sourceDesc.Height, sourceData, sourceLocked.Pitch, destData, destLocked.Pitch);
break;
case D3DFMT_A8R8G8B8:
case D3DFMT_X8R8G8B8:
GenerateMip<A8R8G8B8>(sourceDesc.Width, sourceDesc.Height, sourceData, sourceLocked.Pitch, destData, destLocked.Pitch);
break;
case D3DFMT_A16B16G16R16F:
GenerateMip<A16B16G16R16F>(sourceDesc.Width, sourceDesc.Height, sourceData, sourceLocked.Pitch, destData, destLocked.Pitch);
break;
case D3DFMT_A32B32G32R32F:
GenerateMip<A32B32G32R32F>(sourceDesc.Width, sourceDesc.Height, sourceData, sourceLocked.Pitch, destData, destLocked.Pitch);
break;
default:
UNREACHABLE();
break;
}
destSurface->UnlockRect();
sourceSurface->UnlockRect();
}
}
Image9 *Image9::makeImage9(Image *img)
{
ASSERT(HAS_DYNAMIC_TYPE(rx::Image9*, img));
return static_cast<rx::Image9*>(img);
}
void Image9::generateMipmap(Image9 *dest, Image9 *source)
{
IDirect3DSurface9 *sourceSurface = source->getSurface();
if (sourceSurface == NULL)
return gl::error(GL_OUT_OF_MEMORY);
IDirect3DSurface9 *destSurface = dest->getSurface();
generateMip(destSurface, sourceSurface);
dest->markDirty();
}
void Image9::copyLockableSurfaces(IDirect3DSurface9 *dest, IDirect3DSurface9 *source)
{
D3DLOCKED_RECT sourceLock = {0};
D3DLOCKED_RECT destLock = {0};
source->LockRect(&sourceLock, NULL, 0);
dest->LockRect(&destLock, NULL, 0);
if (sourceLock.pBits && destLock.pBits)
{
D3DSURFACE_DESC desc;
source->GetDesc(&desc);
int rows = d3d9::IsCompressedFormat(desc.Format) ? desc.Height / 4 : desc.Height;
int bytes = d3d9::ComputeRowSize(desc.Format, desc.Width);
ASSERT(bytes <= sourceLock.Pitch && bytes <= destLock.Pitch);
for(int i = 0; i < rows; i++)
{
memcpy((char*)destLock.pBits + destLock.Pitch * i, (char*)sourceLock.pBits + sourceLock.Pitch * i, bytes);
}
source->UnlockRect();
dest->UnlockRect();
}
else UNREACHABLE();
}
bool Image9::redefine(rx::Renderer *renderer, GLint internalformat, GLsizei width, GLsizei height, bool forceRelease)
{
if (mWidth != width ||
mHeight != height ||
mInternalFormat != internalformat ||
forceRelease)
{
mRenderer = Renderer9::makeRenderer9(renderer);
mWidth = width;
mHeight = height;
mInternalFormat = internalformat;
// compute the d3d format that will be used
mD3DFormat = mRenderer->ConvertTextureInternalFormat(internalformat);
mActualFormat = d3d9_gl::GetEquivalentFormat(mD3DFormat);
if (mSurface)
{
mSurface->Release();
mSurface = NULL;
}
return true;
}
return false;
}
void Image9::createSurface()
{
if(mSurface)
{
return;
}
IDirect3DTexture9 *newTexture = NULL;
IDirect3DSurface9 *newSurface = NULL;
const D3DPOOL poolToUse = D3DPOOL_SYSTEMMEM;
const D3DFORMAT d3dFormat = getD3DFormat();
ASSERT(d3dFormat != D3DFMT_INTZ); // We should never get here for depth textures
if (mWidth != 0 && mHeight != 0)
{
int levelToFetch = 0;
GLsizei requestWidth = mWidth;
GLsizei requestHeight = mHeight;
gl::MakeValidSize(true, gl::IsCompressed(mInternalFormat), &requestWidth, &requestHeight, &levelToFetch);
IDirect3DDevice9 *device = mRenderer->getDevice();
HRESULT result = device->CreateTexture(requestWidth, requestHeight, levelToFetch + 1, 0, d3dFormat,
poolToUse, &newTexture, NULL);
if (FAILED(result))
{
ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
ERR("Creating image surface failed.");
return gl::error(GL_OUT_OF_MEMORY);
}
newTexture->GetSurfaceLevel(levelToFetch, &newSurface);
newTexture->Release();
}
mSurface = newSurface;
mDirty = false;
mD3DPool = poolToUse;
}
HRESULT Image9::lock(D3DLOCKED_RECT *lockedRect, const RECT *rect)
{
createSurface();
HRESULT result = D3DERR_INVALIDCALL;
if (mSurface)
{
result = mSurface->LockRect(lockedRect, rect, 0);
ASSERT(SUCCEEDED(result));
mDirty = true;
}
return result;
}
void Image9::unlock()
{
if (mSurface)
{
HRESULT result = mSurface->UnlockRect();
ASSERT(SUCCEEDED(result));
}
}
bool Image9::isRenderableFormat() const
{
return TextureStorage9::IsTextureFormatRenderable(getD3DFormat());
}
D3DFORMAT Image9::getD3DFormat() const
{
// this should only happen if the image hasn't been redefined first
// which would be a bug by the caller
ASSERT(mD3DFormat != D3DFMT_UNKNOWN);
return mD3DFormat;
}
IDirect3DSurface9 *Image9::getSurface()
{
createSurface();
return mSurface;
}
void Image9::setManagedSurface(TextureStorageInterface2D *storage, int level)
{
TextureStorage9_2D *storage9 = TextureStorage9_2D::makeTextureStorage9_2D(storage->getStorageInstance());
setManagedSurface(storage9->getSurfaceLevel(level, false));
}
void Image9::setManagedSurface(TextureStorageInterfaceCube *storage, int face, int level)
{
TextureStorage9_Cube *storage9 = TextureStorage9_Cube::makeTextureStorage9_Cube(storage->getStorageInstance());
setManagedSurface(storage9->getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, level, false));
}
void Image9::setManagedSurface(IDirect3DSurface9 *surface)
{
D3DSURFACE_DESC desc;
surface->GetDesc(&desc);
ASSERT(desc.Pool == D3DPOOL_MANAGED);
if ((GLsizei)desc.Width == mWidth && (GLsizei)desc.Height == mHeight)
{
if (mSurface)
{
copyLockableSurfaces(surface, mSurface);
mSurface->Release();
}
mSurface = surface;
mD3DPool = desc.Pool;
}
}
bool Image9::updateSurface(TextureStorageInterface2D *storage, int level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, bool mipped)
{
ASSERT(getSurface() != NULL);
TextureStorage9_2D *storage9 = TextureStorage9_2D::makeTextureStorage9_2D(storage->getStorageInstance());
return updateSurface(storage9->getSurfaceLevel(level, true), xoffset, yoffset, width, height);
}
bool Image9::updateSurface(TextureStorageInterfaceCube *storage, int face, int level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
{
ASSERT(getSurface() != NULL);
TextureStorage9_Cube *storage9 = TextureStorage9_Cube::makeTextureStorage9_Cube(storage->getStorageInstance());
return updateSurface(storage9->getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, level, true), xoffset, yoffset, width, height);
}
bool Image9::updateSurface(IDirect3DSurface9 *destSurface, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
{
if (!destSurface)
return false;
IDirect3DSurface9 *sourceSurface = getSurface();
if (sourceSurface && sourceSurface != destSurface)
{
RECT rect;
rect.left = xoffset;
rect.top = yoffset;
rect.right = xoffset + width;
rect.bottom = yoffset + height;
POINT point = {rect.left, rect.top};
IDirect3DDevice9 *device = mRenderer->getDevice();
if (mD3DPool == D3DPOOL_MANAGED)
{
D3DSURFACE_DESC desc;
sourceSurface->GetDesc(&desc);
IDirect3DSurface9 *surf = 0;
HRESULT result = device->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &surf, NULL);
if (SUCCEEDED(result))
{
copyLockableSurfaces(surf, sourceSurface);
result = device->UpdateSurface(surf, &rect, destSurface, &point);
ASSERT(SUCCEEDED(result));
surf->Release();
}
}
else
{
// UpdateSurface: source must be SYSTEMMEM, dest must be DEFAULT pools
HRESULT result = device->UpdateSurface(sourceSurface, &rect, destSurface, &point);
ASSERT(SUCCEEDED(result));
}
}
destSurface->Release();
return true;
}
// Store the pixel rectangle designated by xoffset,yoffset,width,height with pixels stored as format/type at input
// into the target pixel rectangle.
void Image9::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
GLint unpackAlignment, const void *input)
{
RECT lockRect =
{
xoffset, yoffset,
xoffset + width, yoffset + height
};
D3DLOCKED_RECT locked;
HRESULT result = lock(&locked, &lockRect);
if (FAILED(result))
{
return;
}
GLsizei inputPitch = gl::ComputePitch(width, mInternalFormat, unpackAlignment);
switch (mInternalFormat)
{
case GL_ALPHA8_EXT:
if (gl::supportsSSE2())
{
loadAlphaDataToBGRASSE2(width, height, inputPitch, input, locked.Pitch, locked.pBits);
}
else
{
loadAlphaDataToBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
}
break;
case GL_LUMINANCE8_EXT:
loadLuminanceDataToNativeOrBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits, getD3DFormat() == D3DFMT_L8);
break;
case GL_ALPHA32F_EXT:
loadAlphaFloatDataToRGBA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_LUMINANCE32F_EXT:
loadLuminanceFloatDataToRGBA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_ALPHA16F_EXT:
loadAlphaHalfFloatDataToRGBA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_LUMINANCE16F_EXT:
loadLuminanceHalfFloatDataToRGBA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_LUMINANCE8_ALPHA8_EXT:
loadLuminanceAlphaDataToNativeOrBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits, getD3DFormat() == D3DFMT_A8L8);
break;
case GL_LUMINANCE_ALPHA32F_EXT:
loadLuminanceAlphaFloatDataToRGBA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_LUMINANCE_ALPHA16F_EXT:
loadLuminanceAlphaHalfFloatDataToRGBA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_RGB8_OES:
loadRGBUByteDataToBGRX(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_RGB565:
loadRGB565DataToBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_RGBA8_OES:
if (gl::supportsSSE2())
{
loadRGBAUByteDataToBGRASSE2(width, height, inputPitch, input, locked.Pitch, locked.pBits);
}
else
{
loadRGBAUByteDataToBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
}
break;
case GL_RGBA4:
loadRGBA4444DataToBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_RGB5_A1:
loadRGBA5551DataToBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_BGRA8_EXT:
loadBGRADataToBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
// float textures are converted to RGBA, not BGRA, as they're stored that way in D3D
case GL_RGB32F_EXT:
loadRGBFloatDataToRGBA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_RGB16F_EXT:
loadRGBHalfFloatDataToRGBA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_RGBA32F_EXT:
loadRGBAFloatDataToRGBA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
case GL_RGBA16F_EXT:
loadRGBAHalfFloatDataToRGBA(width, height, inputPitch, input, locked.Pitch, locked.pBits);
break;
default: UNREACHABLE();
}
unlock();
}
void Image9::loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
const void *input)
{
ASSERT(xoffset % 4 == 0);
ASSERT(yoffset % 4 == 0);
RECT lockRect = {
xoffset, yoffset,
xoffset + width, yoffset + height
};
D3DLOCKED_RECT locked;
HRESULT result = lock(&locked, &lockRect);
if (FAILED(result))
{
return;
}
GLsizei inputSize = gl::ComputeCompressedSize(width, height, mInternalFormat);
GLsizei inputPitch = gl::ComputeCompressedPitch(width, mInternalFormat);
int rows = inputSize / inputPitch;
for (int i = 0; i < rows; ++i)
{
memcpy((void*)((BYTE*)locked.pBits + i * locked.Pitch), (void*)((BYTE*)input + i * inputPitch), inputPitch);
}
unlock();
}
// This implements glCopyTex[Sub]Image2D for non-renderable internal texture formats and incomplete textures
void Image9::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source)
{
RenderTarget9 *renderTarget = NULL;
IDirect3DSurface9 *surface = NULL;
gl::Renderbuffer *colorbuffer = source->getColorbuffer(0);
if (colorbuffer)
{
renderTarget = RenderTarget9::makeRenderTarget9(colorbuffer->getRenderTarget());
}
if (renderTarget)
{
surface = renderTarget->getSurface();
}
if (!surface)
{
ERR("Failed to retrieve the render target.");
return gl::error(GL_OUT_OF_MEMORY);
}
IDirect3DDevice9 *device = mRenderer->getDevice();
IDirect3DSurface9 *renderTargetData = NULL;
D3DSURFACE_DESC description;
surface->GetDesc(&description);
HRESULT result = device->CreateOffscreenPlainSurface(description.Width, description.Height, description.Format, D3DPOOL_SYSTEMMEM, &renderTargetData, NULL);
if (FAILED(result))
{
ERR("Could not create matching destination surface.");
surface->Release();
return gl::error(GL_OUT_OF_MEMORY);
}
result = device->GetRenderTargetData(surface, renderTargetData);
if (FAILED(result))
{
ERR("GetRenderTargetData unexpectedly failed.");
renderTargetData->Release();
surface->Release();
return gl::error(GL_OUT_OF_MEMORY);
}
RECT sourceRect = {x, y, x + width, y + height};
RECT destRect = {xoffset, yoffset, xoffset + width, yoffset + height};
D3DLOCKED_RECT sourceLock = {0};
result = renderTargetData->LockRect(&sourceLock, &sourceRect, 0);
if (FAILED(result))
{
ERR("Failed to lock the source surface (rectangle might be invalid).");
renderTargetData->Release();
surface->Release();
return gl::error(GL_OUT_OF_MEMORY);
}
D3DLOCKED_RECT destLock = {0};
result = lock(&destLock, &destRect);
if (FAILED(result))
{
ERR("Failed to lock the destination surface (rectangle might be invalid).");
renderTargetData->UnlockRect();
renderTargetData->Release();
surface->Release();
return gl::error(GL_OUT_OF_MEMORY);
}
if (destLock.pBits && sourceLock.pBits)
{
unsigned char *source = (unsigned char*)sourceLock.pBits;
unsigned char *dest = (unsigned char*)destLock.pBits;
switch (description.Format)
{
case D3DFMT_X8R8G8B8:
case D3DFMT_A8R8G8B8:
switch(getD3DFormat())
{
case D3DFMT_X8R8G8B8:
case D3DFMT_A8R8G8B8:
for(int y = 0; y < height; y++)
{
memcpy(dest, source, 4 * width);
source += sourceLock.Pitch;
dest += destLock.Pitch;
}
break;
case D3DFMT_L8:
for(int y = 0; y < height; y++)
{
for(int x = 0; x < width; x++)
{
dest[x] = source[x * 4 + 2];
}
source += sourceLock.Pitch;
dest += destLock.Pitch;
}
break;
case D3DFMT_A8L8:
for(int y = 0; y < height; y++)
{
for(int x = 0; x < width; x++)
{
dest[x * 2 + 0] = source[x * 4 + 2];
dest[x * 2 + 1] = source[x * 4 + 3];
}
source += sourceLock.Pitch;
dest += destLock.Pitch;
}
break;
default:
UNREACHABLE();
}
break;
case D3DFMT_R5G6B5:
switch(getD3DFormat())
{
case D3DFMT_X8R8G8B8:
for(int y = 0; y < height; y++)
{
for(int x = 0; x < width; x++)
{
unsigned short rgb = ((unsigned short*)source)[x];
unsigned char red = (rgb & 0xF800) >> 8;
unsigned char green = (rgb & 0x07E0) >> 3;
unsigned char blue = (rgb & 0x001F) << 3;
dest[x + 0] = blue | (blue >> 5);
dest[x + 1] = green | (green >> 6);
dest[x + 2] = red | (red >> 5);
dest[x + 3] = 0xFF;
}
source += sourceLock.Pitch;
dest += destLock.Pitch;
}
break;
case D3DFMT_L8:
for(int y = 0; y < height; y++)
{
for(int x = 0; x < width; x++)
{
unsigned char red = source[x * 2 + 1] & 0xF8;
dest[x] = red | (red >> 5);
}
source += sourceLock.Pitch;
dest += destLock.Pitch;
}
break;
default:
UNREACHABLE();
}
break;
case D3DFMT_A1R5G5B5:
switch(getD3DFormat())
{
case D3DFMT_X8R8G8B8:
for(int y = 0; y < height; y++)
{
for(int x = 0; x < width; x++)
{
unsigned short argb = ((unsigned short*)source)[x];
unsigned char red = (argb & 0x7C00) >> 7;
unsigned char green = (argb & 0x03E0) >> 2;
unsigned char blue = (argb & 0x001F) << 3;
dest[x + 0] = blue | (blue >> 5);
dest[x + 1] = green | (green >> 5);
dest[x + 2] = red | (red >> 5);
dest[x + 3] = 0xFF;
}
source += sourceLock.Pitch;
dest += destLock.Pitch;
}
break;
case D3DFMT_A8R8G8B8:
for(int y = 0; y < height; y++)
{
for(int x = 0; x < width; x++)
{
unsigned short argb = ((unsigned short*)source)[x];
unsigned char red = (argb & 0x7C00) >> 7;
unsigned char green = (argb & 0x03E0) >> 2;
unsigned char blue = (argb & 0x001F) << 3;
unsigned char alpha = (signed short)argb >> 15;
dest[x + 0] = blue | (blue >> 5);
dest[x + 1] = green | (green >> 5);
dest[x + 2] = red | (red >> 5);
dest[x + 3] = alpha;
}
source += sourceLock.Pitch;
dest += destLock.Pitch;
}
break;
case D3DFMT_L8:
for(int y = 0; y < height; y++)
{
for(int x = 0; x < width; x++)
{
unsigned char red = source[x * 2 + 1] & 0x7C;
dest[x] = (red << 1) | (red >> 4);
}
source += sourceLock.Pitch;
dest += destLock.Pitch;
}
break;
case D3DFMT_A8L8:
for(int y = 0; y < height; y++)
{
for(int x = 0; x < width; x++)
{
unsigned char red = source[x * 2 + 1] & 0x7C;
dest[x * 2 + 0] = (red << 1) | (red >> 4);
dest[x * 2 + 1] = (signed char)source[x * 2 + 1] >> 7;
}
source += sourceLock.Pitch;
dest += destLock.Pitch;
}
break;
default:
UNREACHABLE();
}
break;
default:
UNREACHABLE();
}
}
unlock();
renderTargetData->UnlockRect();
renderTargetData->Release();
surface->Release();
mDirty = true;
}
} | [
"vlad@coronalabs.com"
] | vlad@coronalabs.com |
782a71cf2498be03138c949b928f4acfcf414663 | fd0d0369a3884db59b97c51d7b6c9253ede3502c | /scratch_ana/bin/tmp/ana.h | 761ee6ae97d5bf9cc177deb6ccb7ce58629eeb88 | [] | no_license | kaleko/KalekoAna | b54b6a7b480a8bd188b8cdc3f6f867b790bc4f2a | 5b4284c1cf9abc494f1e1c8b8815be1f886147e0 | refs/heads/master | 2020-04-03T20:18:31.061721 | 2017-04-06T18:52:57 | 2017-04-06T18:52:57 | 25,654,547 | 0 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 1,412 | h | /**
* \file Ana_Class_Name.h
*
* \ingroup Working_Package
*
* \brief Class def header for a class Ana_Class_Name
*
* @author davidkaleko
*/
/** \addtogroup Working_Package
@{*/
#ifndef LARLITE_ANA_CLASS_NAME_H
#define LARLITE_ANA_CLASS_NAME_H
#include "Analysis/ana_base.h"
namespace larlite {
/**
\class Ana_Class_Name
User custom analysis class made by davidkaleko
*/
class Ana_Class_Name : public ana_base{
public:
/// Default constructor
Ana_Class_Name(){ _name="Ana_Class_Name"; _fout=0;};
/// Default destructor
virtual ~Ana_Class_Name(){};
/** IMPLEMENT in Ana_Class_Name.cc!
Initialization method to be called before the analysis event loop.
*/
virtual bool initialize();
/** IMPLEMENT in Ana_Class_Name.cc!
Analyze a data event-by-event
*/
virtual bool analyze(storage_manager* storage);
/** IMPLEMENT in Ana_Class_Name.cc!
Finalize method to be called after all events processed.
*/
virtual bool finalize();
protected:
};
}
#endif
//**************************************************************************
//
// For Analysis framework documentation, read Manual.pdf here:
//
// http://microboone-docdb.fnal.gov:8080/cgi-bin/ShowDocument?docid=3183
//
//**************************************************************************
/** @} */ // end of doxygen group
| [
"kaleko@nevis.columbia.edu"
] | kaleko@nevis.columbia.edu |
5ed46a5737cfed784fcdb3ad17302d750000388c | a5df30d1e0eaeb39b5d352914b29c5fa5cde2007 | /UVA/uva11631.cpp | 9b09db51b1a85ea788788f76738be91ea5356eae | [] | no_license | aninda052/Computative_Programming- | 8bf967cb1b6d96cc2f594af429c836670f98fe2f | 6bc342964eb1e8d0ea1bc9b8bd9b1cdc550e525a | refs/heads/master | 2023-08-11T07:59:17.460798 | 2023-08-04T19:01:06 | 2023-08-04T19:01:06 | 107,792,073 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,303 | cpp | #include<bits/stdc++.h>
#define mx 200001
int arr[mx],n;
using namespace std;
pair<int,pair<int ,int> >p[mx];
void init(int n){
for(int i=0;i<n;i++){
arr[i]=i;
}
}
int root(int i){
while(arr[i]!=i){
arr[i] = arr[arr[i]];
i=arr[i];
}
return i;
}
//int unin(int x,int y){
// int i=root(x);
// int j=root(y);
// arr[i]=arr[j];
//}
int krushkal(pair<int,pair<int ,int> >p[],int edges){
int mincost=0;
int cnt=1;
for(int i=0;i<edges;i++){
int x=p[i].second.first;
int y=p[i].second.second;
int X=root(x);
int Y=root(y);
if(X!=Y){
mincost+=p[i].first;
arr[X]=arr[Y];
cnt++;
}
if(cnt==n)break;
}
return mincost;
}
int main(){
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int x,y,length,res,m;
while(scanf("%d %d",&n,&m)){
if(n==0 && m==0)break;
init(n);
int total=0;
for(int i=0;i<m;i++){
scanf("%d %d %d",&x,&y,&length);
total+=length;
p[i]=make_pair(length,make_pair(x,y));
}
sort(p,p+m);
res=krushkal(p,m);
printf("%d\n",total-res);
}
return 0;}
| [
"anindahalder052@gmail.com"
] | anindahalder052@gmail.com |
73ebc4519a5d4b4a6ac3f34a953d3f43ca41bfcd | 39241d24ac34343bd60391990f89051d5773567f | /src/xtd.core/include/xtd/internal/__currency_formater.h | 589bd0988a16718d176b055ebc21f60aa7c6c497 | [
"MIT"
] | permissive | fikarzlf/xtd | e0ddf7128a8ca6961a23d50a07ac204eed54e1f3 | 9879fd9eefbff3853cbcf74e7b6702dbee989894 | refs/heads/master | 2023-07-17T20:37:27.484556 | 2021-09-06T21:37:28 | 2021-09-06T21:37:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 630 | h | /// @file
/// @brief Contains __currency_formater method.
#pragma once
/// @cond
#ifndef __XTD_CORE_INTERNAL__
#error "Do not include this file: Internal use only"
#endif
/// @endcond
#include "__binary_formater.h"
#include <cmath>
#include <locale>
#include <sstream>
/// @cond
template<typename char_t>
inline std::basic_string<char_t> __currency_formater(long double value, const std::locale& loc) {
std::basic_stringstream<char_t> ss;
ss.imbue(loc);
ss << std::showbase << std::fixed << std::put_money(value*std::pow(10, std::use_facet<std::moneypunct<char_t>>(loc).frac_digits()));
return ss.str();
}
/// @endcond
| [
"gammasoft71@gmail.com"
] | gammasoft71@gmail.com |
3bc7d23a69a0f15e283ba2e25498ef500ada3f09 | b0e6305c81cf3e799a4ce56f02ef69b616d38647 | /Source/Tools/Editor/Tabs/ResourceTab.h | 6b3581e90c9ea1d622a1354146dfff5bdaa374c4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | JSandusky/rbfx | 9331074ea11b2fad48bd68e23416f70dbcd0fb3d | 36fcc929f19dccddda666c5a378105a1229e31fe | refs/heads/master | 2022-11-26T15:38:55.475680 | 2020-01-25T14:04:34 | 2020-01-25T14:04:54 | 236,247,918 | 0 | 1 | MIT | 2020-01-26T00:14:37 | 2020-01-26T00:14:37 | null | UTF-8 | C++ | false | false | 2,016 | h | //
// Copyright (c) 2017-2020 the rbfx project.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#pragma once
#include <EASTL/utility.h>
#include <Toolbox/SystemUI/ResourceBrowser.h>
#include "Tabs/Tab.h"
namespace Urho3D
{
/// Resource browser tab.
class ResourceTab : public Tab
{
URHO3D_OBJECT(ResourceTab, Tab)
public:
/// Construct.
explicit ResourceTab(Context* context);
/// Render content of tab window. Returns false if tab was closed.
bool RenderWindowContent() override;
protected:
/// Constructs a name for newly created resource based on specified template name.
ea::string GetNewResourcePath(const ea::string& name);
/// Select current item in attribute inspector.
void SelectCurrentItemInspector();
/// Current open resource path.
ea::string resourcePath_;
/// Current selected resource file name.
ea::string resourceSelection_;
/// Resource browser flags.
ResourceBrowserFlags flags_{RBF_NONE};
};
}
| [
"rokups@zoho.com"
] | rokups@zoho.com |
2baba1b464513d1acf5b8472c2d626225b3441dc | 5f7cfde6e76d2fb899ba853b8e55f6809e9f40af | /src/gl/data/gl_vertexbuffer.cpp | c07b6cea3ad6c8a3e906ccfa494b58954db889ba | [] | no_license | CarlKenner/gz3doom | 57ca8ad174d9f30f8acbb59e923bfed76a119a2a | 3aec97008ff01ef53a59eaec194b568b209c2225 | refs/heads/master | 2021-01-09T07:33:41.002482 | 2016-04-16T21:23:09 | 2016-04-16T21:23:09 | 56,433,000 | 1 | 0 | null | 2016-04-17T11:31:28 | 2016-04-17T11:31:28 | null | UTF-8 | C++ | false | false | 12,333 | cpp | /*
** glc_vertexbuffer.cpp
** Vertex buffer handling.
**
**---------------------------------------------------------------------------
** Copyright 2005 Christoph Oelckers
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission.
** 4. When not used as part of GZDoom or a GZDoom derivative, this code will be
** covered by the terms of the GNU Lesser General Public License as published
** by the Free Software Foundation; either version 2.1 of the License, or (at
** your option) any later version.
** 5. Full disclosure of the entire project's source code, except for third
** party libraries is mandatory. (NOTE: This clause is non-negotiable!)
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
*/
#include "gl/system/gl_system.h"
#include "doomtype.h"
#include "p_local.h"
#include "m_argv.h"
#include "c_cvars.h"
#include "gl/system/gl_interface.h"
#include "gl/renderer/gl_renderer.h"
#include "gl/data/gl_data.h"
#include "gl/data/gl_vertexbuffer.h"
CUSTOM_CVAR(Int, gl_usevbo, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
if (self < -1 || self > 2)
{
self = 0;
}
else if (self == -1)
{
if (!(gl.flags & RFL_NVIDIA)) self = 0;
else self = 2;
}
else if (GLRenderer != NULL && GLRenderer->mVBO != NULL && GLRenderer->mVBO->vbo_arg != self)
{
Printf("Vertex buffer use will be changed for the next level.\n");
}
}
//==========================================================================
//
// Create / destroy the VBO
//
//==========================================================================
FVertexBuffer::FVertexBuffer()
{
vbo_id = 0;
if (gl_usevbo == -1) gl_usevbo.Callback();
glGenBuffers(1, &vbo_id);
}
FVertexBuffer::~FVertexBuffer()
{
if (vbo_id != 0)
{
glDeleteBuffers(1, &vbo_id);
}
}
//==========================================================================
//
//
//
//==========================================================================
FFlatVertexBuffer::FFlatVertexBuffer()
: FVertexBuffer()
{
vbo_arg = gl_usevbo;
map = NULL;
}
FFlatVertexBuffer::~FFlatVertexBuffer()
{
UnmapVBO();
}
//==========================================================================
//
// Initialize a single vertex
//
//==========================================================================
void FFlatVertex::SetFlatVertex(vertex_t *vt, const secplane_t & plane)
{
x = vt->fx;
y = vt->fy;
z = plane.ZatPoint(vt->fx, vt->fy);
u = vt->fx/64.f;
v = -vt->fy/64.f;
w = /*dc = df =*/ 0;
}
//==========================================================================
//
// Find a 3D floor
//
//==========================================================================
static F3DFloor *Find3DFloor(sector_t *target, sector_t *model)
{
for(unsigned i=0; i<target->e->XFloor.ffloors.Size(); i++)
{
F3DFloor *ffloor = target->e->XFloor.ffloors[i];
if (ffloor->model == model) return ffloor;
}
return NULL;
}
//==========================================================================
//
// Creates the vertices for one plane in one subsector
//
//==========================================================================
int FFlatVertexBuffer::CreateSubsectorVertices(subsector_t *sub, const secplane_t &plane, int floor)
{
int idx = vbo_shadowdata.Reserve(sub->numlines);
for(unsigned int k=0; k<sub->numlines; k++, idx++)
{
vbo_shadowdata[idx].SetFlatVertex(sub->firstline[k].v1, plane);
if (sub->sector->transdoor && floor) vbo_shadowdata[idx].z -= 1.f;
}
return idx;
}
//==========================================================================
//
// Creates the vertices for one plane in one subsector
//
//==========================================================================
int FFlatVertexBuffer::CreateSectorVertices(sector_t *sec, const secplane_t &plane, int floor)
{
int rt = vbo_shadowdata.Size();
// First calculate the vertices for the sector itself
for(int j=0; j<sec->subsectorcount; j++)
{
subsector_t *sub = sec->subsectors[j];
CreateSubsectorVertices(sub, plane, floor);
}
return rt;
}
//==========================================================================
//
//
//
//==========================================================================
int FFlatVertexBuffer::CreateVertices(int h, sector_t *sec, const secplane_t &plane, int floor)
{
// First calculate the vertices for the sector itself
sec->vboheight[h] = sec->GetPlaneTexZ(h);
sec->vboindex[h] = CreateSectorVertices(sec, plane, floor);
// Next are all sectors using this one as heightsec
TArray<sector_t *> &fakes = sec->e->FakeFloor.Sectors;
for (unsigned g=0; g<fakes.Size(); g++)
{
sector_t *fsec = fakes[g];
fsec->vboindex[2+h] = CreateSectorVertices(fsec, plane, false);
}
// and finally all attached 3D floors
TArray<sector_t *> &xf = sec->e->XFloor.attached;
for (unsigned g=0; g<xf.Size(); g++)
{
sector_t *fsec = xf[g];
F3DFloor *ffloor = Find3DFloor(fsec, sec);
if (ffloor != NULL && ffloor->flags & FF_RENDERPLANES)
{
bool dotop = (ffloor->top.model == sec) && (ffloor->top.isceiling == h);
bool dobottom = (ffloor->bottom.model == sec) && (ffloor->bottom.isceiling == h);
if (dotop || dobottom)
{
if (dotop) ffloor->top.vindex = vbo_shadowdata.Size();
if (dobottom) ffloor->bottom.vindex = vbo_shadowdata.Size();
CreateSectorVertices(fsec, plane, false);
}
}
}
sec->vbocount[h] = vbo_shadowdata.Size() - sec->vboindex[h];
return sec->vboindex[h];
}
//==========================================================================
//
//
//
//==========================================================================
void FFlatVertexBuffer::CreateFlatVBO()
{
for (int h = sector_t::floor; h <= sector_t::ceiling; h++)
{
for(int i=0; i<numsectors;i++)
{
CreateVertices(h, §ors[i], sectors[i].GetSecPlane(h), h == sector_t::floor);
}
}
// We need to do a final check for Vavoom water and FF_FIX sectors.
// No new vertices are needed here. The planes come from the actual sector
for(int i=0; i<numsectors;i++)
{
for(unsigned j=0;j<sectors[i].e->XFloor.ffloors.Size(); j++)
{
F3DFloor *ff = sectors[i].e->XFloor.ffloors[j];
if (ff->top.model == §ors[i])
{
ff->top.vindex = sectors[i].vboindex[ff->top.isceiling];
}
if (ff->bottom.model == §ors[i])
{
ff->bottom.vindex = sectors[i].vboindex[ff->top.isceiling];
}
}
}
}
//==========================================================================
//
//
//
//==========================================================================
void FFlatVertexBuffer::MapVBO()
{
if (map == NULL)
{
glBindBuffer(GL_ARRAY_BUFFER, vbo_id);
map = (FFlatVertex*)glMapBufferRange(GL_ARRAY_BUFFER, 0, vbo_shadowdata.Size() * sizeof(FFlatVertex),
GL_MAP_WRITE_BIT|GL_MAP_FLUSH_EXPLICIT_BIT|GL_MAP_UNSYNCHRONIZED_BIT);
}
}
//==========================================================================
//
//
//
//==========================================================================
void FFlatVertexBuffer::UnmapVBO()
{
if (map != NULL)
{
glUnmapBuffer(GL_ARRAY_BUFFER);
map = NULL;
}
}
//==========================================================================
//
//
//
//==========================================================================
void FFlatVertexBuffer::UpdatePlaneVertices(sector_t *sec, int plane)
{
int startvt = sec->vboindex[plane];
int countvt = sec->vbocount[plane];
secplane_t &splane = sec->GetSecPlane(plane);
FFlatVertex *vt = &vbo_shadowdata[startvt];
for(int i=0; i<countvt; i++, vt++)
{
vt->z = splane.ZatPoint(vt->x, vt->y);
if (plane == sector_t::floor && sec->transdoor) vt->z -= 1;
}
if (gl.flags & RFL_MAP_BUFFER_RANGE)
{
MapVBO();
if (map == NULL) return; // Error
memcpy(&map[startvt], &vbo_shadowdata[startvt], countvt * sizeof(FFlatVertex));
glFlushMappedBufferRange(GL_ARRAY_BUFFER, startvt * sizeof(FFlatVertex), countvt * sizeof(FFlatVertex));
}
else
{
glBufferSubData(GL_ARRAY_BUFFER, startvt * sizeof(FFlatVertex), countvt * sizeof(FFlatVertex), &vbo_shadowdata[startvt]);
}
}
//==========================================================================
//
//
//
//==========================================================================
void FFlatVertexBuffer::CreateVBO()
{
vbo_shadowdata.Clear();
if (vbo_arg > 0)
{
CreateFlatVBO();
glBindBuffer(GL_ARRAY_BUFFER, vbo_id);
glBufferData(GL_ARRAY_BUFFER, vbo_shadowdata.Size() * sizeof(FFlatVertex), &vbo_shadowdata[0], GL_DYNAMIC_DRAW);
}
else if (sectors)
{
// set all VBO info to invalid values so that we can save some checks in the rendering code
for(int i=0;i<numsectors;i++)
{
sectors[i].vboindex[3] = sectors[i].vboindex[2] =
sectors[i].vboindex[1] = sectors[i].vboindex[0] = -1;
sectors[i].vboheight[1] = sectors[i].vboheight[0] = FIXED_MIN;
}
}
}
//==========================================================================
//
//
//
//==========================================================================
void FFlatVertexBuffer::BindVBO()
{
if (vbo_arg > 0)
{
UnmapVBO();
glBindBuffer(GL_ARRAY_BUFFER, vbo_id);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
glVertexPointer(3,GL_FLOAT, sizeof(FFlatVertex), &VTO->x);
glTexCoordPointer(2,GL_FLOAT, sizeof(FFlatVertex), &VTO->u);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_INDEX_ARRAY);
}
}
//==========================================================================
//
//
//
//==========================================================================
void FFlatVertexBuffer::CheckPlanes(sector_t *sector)
{
if (sector->GetPlaneTexZ(sector_t::ceiling) != sector->vboheight[sector_t::ceiling])
{
if (sector->ceilingdata == NULL) // only update if there's no thinker attached
{
UpdatePlaneVertices(sector, sector_t::ceiling);
sector->vboheight[sector_t::ceiling] = sector->GetPlaneTexZ(sector_t::ceiling);
}
}
if (sector->GetPlaneTexZ(sector_t::floor) != sector->vboheight[sector_t::floor])
{
if (sector->floordata == NULL) // only update if there's no thinker attached
{
UpdatePlaneVertices(sector, sector_t::floor);
sector->vboheight[sector_t::floor] = sector->GetPlaneTexZ(sector_t::floor);
}
}
}
//==========================================================================
//
// checks the validity of all planes attached to this sector
// and updates them if possible. Anything moving will not be
// updated unless it stops. This is to ensure that we never
// have to synchronize with the rendering process.
//
//==========================================================================
void FFlatVertexBuffer::CheckUpdate(sector_t *sector)
{
if (vbo_arg == 2)
{
CheckPlanes(sector);
sector_t *hs = sector->GetHeightSec();
if (hs != NULL) CheckPlanes(hs);
for(unsigned i = 0; i < sector->e->XFloor.ffloors.Size(); i++)
CheckPlanes(sector->e->XFloor.ffloors[i]->model);
}
} | [
"coelckers@zdoom.fake"
] | coelckers@zdoom.fake |
45ec3f0b49bc135e979570110ccef9173f3a3de2 | 481ff5af691f12dd066547538f6b0d3610f8804a | /Code/AlgApi_eclipse/BRCCommon.h | 9a73a1db464612e9da3987e541ced4d6caf38be2 | [] | no_license | lightindarkgit/irisembx00 | 909a1ff0fe10165537cf03f78f310f2329c62da4 | 3fa3ca437246172dfa0b6adbbddda418c60ee7a6 | refs/heads/master | 2020-04-11T06:45:09.549740 | 2018-03-09T03:32:23 | 2018-03-09T03:32:23 | 124,330,594 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,497 | h | /******************************************************************************************
** 文件名: BRCCommon.h
×× 主要类: NULL
**
** Copyright (c) 中科虹霸有限公司
** 创建人: lizhl hezhf
** 日 期: 2013-11-18
** 修改人:
** 日 期:
** 描 述: 算法相关处理的通用函数
*×× 主要模块说明:
**
** 版 本: 1.0.0
** 备 注:
**
*****************************************************************************************/
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "IK_IR_DLL.h"
#include "AlgApi.h"
//函数返回结果字符串需要分配的长度
const int g_constLengthOfStrFunRts = 260; //函数返回结果字符串的长度
const int g_constIREnrollImgNum = 3; //注册过程中算法使用的注册图像数
const int g_constIREnrollTimeNum = g_constIREnrollImgNum+2;//为注册开辟的空间
const float g_constMatchScoreWeight = 0.95; //注册过程中,选择图像时比对分数所占权重
//注册时结果标记
//#define IK_Enr_UpdateWithNewIm 2120 //注册过程中,当前图像质量较好,替换或者直接加入到注册图像中,对已有的注册结果进行了更新
//#define IK_Enr_DiscardNewIm 2121 //注册过程中,当前图像质量一般,没有改变原来已有的注册结果
const int g_constEnrUpdateWithNewImg = 2120; //注册过程中,当前图像质量较好,替换或者直接加入到注册图像中,对已有的注册结果进行了更新
const int g_constEnrDiscardNewImg = 2121; //注册过程中,当前图像质量一般,没有改变原来已有的注册结果
//20130427增加一个数据结构用来存储注册图像相互比对分数等信息
//#define IK_MaxMatchScoreTh 0.9
const float g_constIRMaxMatchScoreTh = 0.9;
//#define IK_MaxMatchFailedNum 5
const int g_constIRMaxMatchFailedNum = 5;
//#define IK_CompositeScoreInitValue 2
const int g_constIRCompositeScoreInitValue = 2;//综合比对分数初始值
//#define IK_CompositeScoreMinValue -5
const int g_constIRCompositeScoreMinValue = -5;
//注册过程中图像比对信息结构体
struct IKIREnrMatchImInfo
{
//当前注册图像的综合分数,由scoretable[focus][occlusion]得到
float QualityScore; //int
//matchScore[0],matchScore[1]分别表示当前图像与最好的第一幅注册图像、第二幅注册图像之间的比对分数,由IK_Match得到
float MatchScore[g_constIREnrollImgNum-1];
//第一副注册图像的compositeScore[0]为初始值,compositeScore[1]无意义
//第二幅注册图像的compositeScore[1]为初始值
float CompositeScore[g_constIREnrollImgNum-1];
//图像与其它注册图像比对时的累计比对失败次数,初始化为0
//比对成功一次,该值-1
//比对失败一次,该值+1
float FailedMatchCount;//int
};
//^^^^^^^^^^^^^^^^^^^^^^^^
//bmp图像格式相关定义
#pragma pack(push, 1)
typedef unsigned char U8;
typedef unsigned short U16;
typedef unsigned int U32;
typedef struct tagBITMAPFILEHEADER
{
U16 bfType;
U32 bfSize;
U16 bfReserved1;
U16 bfReserved2;
U32 bfOffBits;
} BITMAPFILEHEADER,*LPBITMAPFILEHEADER;
typedef struct tagBITMAPINFOHEADER
{
U32 biSize;
U32 biWidth;
U32 biHeight;
U16 biPlanes;
U16 biBitCount;
U32 biCompression;
U32 biSizeImage;
U32 biXPelsPerMeter;
U32 biYPelsPerMeter;
U32 biClrUsed;
U32 biClrImportant;
} BITMAPINFOHEADER,*LPBITMAPINFOHEADER;
typedef struct tagRGBQUAD
{
U8 rgbBlue;
U8 rgbGreen;
U8 rgbRed;
U8 rgbReserved;
} RGBQUAD;
typedef struct tagBITMAPINFO
{
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[1];
} BITMAPINFO;
typedef struct tagBITMAP
{
BITMAPFILEHEADER bfHeader;
BITMAPINFO biInfo;
}BITMAPFILE;
#pragma pack(pop)
//vvvvvvvvvvvvvvvvvvvvvv
void CASIAGenInitIrisInfo(OUT pIrisImageInfo pDestImginfo); //初始化
void CASIAGenCopyIrisInfo(OUT pIrisImageInfo pDestImginfo,IN pIrisImageInfo pSrcImgInfo); //pIrisImageInfo结构体间拷贝
void IKInitAPIIrisInfo(OUT APIIrisInfo *pDestAPIIrisInfo); //初始化APIIrisInfo
void IKCopyIRIrisInfo2APIIrisInfo(OUT APIIrisInfo* pDestAPIIrisInfo, IN pIrisImageInfo pSrcAPIIrisInfo); //pIrisImageInfo拷贝到APIIrisInfo
void IKCopyAPIIrisInfo2IRIrisInfo(OUT pIrisImageInfo pDestImginfo, IN APIIrisInfo* pSrcAPIIrisInfo); //APIIrisInfo拷贝到pIrisImageInfo
void IKInsertIRMtOutput2APIMtOutput(OUT APIMatchOutput* pAPIOutputDest, IN MatchOutput* pIROutputSrc, IN int leftRightFlag);//比对信息插入
void IKInitAPIMatchOutput(OUT APIMatchOutput *pAPIMatchOutput); //初始化APIMatchOutput信息
void SetFunRt(OUT char *strFunRts, IN const int errCode, IN const char *strFunResults); //设置输出字符串信息
/*****************************************************************************
* 获取最小值
* 函 数 名:GetMinValue
* 功 能:获取最小值
* 说 明:
* 参 数:value1:输入参数
* value2:输入参数
* 返 回 值:最小值
* 创 建 人:lizhl
* 创建时间:2013-11-22
* 修 改 人:
* 修改时间:
*****************************************************************************/
template <typename Tmin>
Tmin GetMinValue(IN Tmin value1, IN Tmin value2)
{
return value1 < value2 ? value1 : value2;
}
//注册特征
//返回值说明
//2120 注册过程中,当前图像质量较好,替换或者直接加入到注册图像中,对已有的注册结果进行了更新
//2121 注册过程中,当前图像质量一般,没有改变原来已有的注册结果
int IKEnrollLRFeature(IN HANDLE pIRAlgHandle, IN int ifSpoofDetect, OUT pIrisImageInfo pEnrImages, OUT int* existedNum,
OUT pIrisImageInfo curBestIm, OUT IKIREnrMatchImInfo* pEnrMatchImInfo,
OUT IKIREnrMatchImInfo* pCurBestEnrMatchImInfo, OUT char *strFunRts);//注册特征
//从N幅图像中选择一幅好图像给注册或识别
int IKSelectImg(HANDLE pIRAlgHandle, int minSelectCount, int qualityMode, pIrisImageInfo pCurIrisImg, pIrisImageInfo pBestIrisImg, char *strFunRts);
//识别特征
int IKIdenFeature(HANDLE pIRAlgHandle, unsigned char* codeList, int codeNum, pIrisImageInfo pBestIrisImg, MatchInput inputPara, pMatchOutput pMatchOutputPara, char* strFunRts);
//图像镜像
bool ImageMirror(unsigned char *objIm, unsigned char *srcIm, int nImH, int nImW, bool bDirection);
//特征装载
int FeatrueLoad(const char* fileName, unsigned char *irisFeat, int featLen);
//特征保存
int FeatureSave(const char* fileName, unsigned char *irisFeat, int featLen);
//保存ppm图像,pImgBuffer为裸数据(不包含ppm格式文件头),其大小为width*height
int SaveGrayPPMFile(const char* fileName, unsigned char *pImgBuffer, int width, int height);
//保存bmp图像,pImgBuffer为裸数据(不包含bmp格式文件头),其大小为width*height
int SaveGrayBMPFile(const char* filename, unsigned char* pImgBuffer, int height, int width);
//给裸数据加bmp头,将其转换为完整的bmp图像格式,rawBuffer为裸数据(不包含bmp格式文件头),其大小为width*height;
//bmpBuffer为完整的bmp图像,其大小为width*height+g_constBMPHeaderLength
int ConvertRaw2Bmp(unsigned char* bmpBuffer, unsigned char* rawBuffer, int height, int width);
| [
"guowen@irisking.com"
] | guowen@irisking.com |
49a7764166173bf98dba3b55b982579b2754d0eb | 8e6721940ab42d730ff004c2ba6f928db43b6dab | /common/core/tinyxml/tinyxml.h | 75d28ed8561bd1ff9127a5392edf1a297f601ba1 | [] | no_license | Koukan/rtype | cbb23cf458a87bf7395958ecb05563b16cca581a | fb2931e93f5ae9c9f8a49aa182d0519f94d5e03d | refs/heads/master | 2021-01-22T11:11:08.292944 | 2012-01-15T21:49:34 | 2012-01-15T21:49:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 20,428 | h | /*
Copyright (c) 2000 Lee Thomason (www.grinninglizard.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#ifndef TINYXML_INCLUDED
#define TINYXML_INCLUDED
#include <stdlib.h>
#include <string.h>
#include <string>
#include <stdio.h>
#include <assert.h>
class TiXmlDocument;
class TiXmlElement;
class TiXmlComment;
class TiXmlUnknown;
class TiXmlAttribute;
class TiXmlText;
class TiXmlDeclaration;
/** TiXmlBase is a base class for every class in TinyXml.
It does little except to establist that TinyXml classes
can be printed and provide some utility functions.
In XML, the document and elements can contain
other elements and other types of nodes.
@verbatim
A Document can contain: Element (container or leaf)
Comment (leaf)
Unknown (leaf)
Declaration( leaf )
An Element can contain: Element (container or leaf)
Text (leaf)
Attributes (not on tree)
Comment (leaf)
Unknown (leaf)
A Decleration contains: Attributes (not on tree)
@endverbatim
*/
class TiXmlBase
{
friend class TiXmlNode;
friend class TiXmlElement;
friend class TiXmlDocument;
public:
TiXmlBase() {}
virtual ~TiXmlBase() {}
/* All TinyXml classes can print themselves to a filestream.
*/
virtual void Print( FILE* fp, int depth ) = 0;
protected:
/* General parsing helper method. Takes a pointer in,
skips all the white space it finds, and returns a pointer
to the first non-whitespace data.
*/
static const char* SkipWhiteSpace( const char* p );
/* Reads an XML name into the string provided. Returns
a pointer just past the last character of the name,
or 0 if the function has an error.
*/
static const char* ReadName( const char* p, std::string* name );
/* Reads text. Returns a pointer past the given end tag.
Wickedly complex options, but it keeps the (sensitive)
code in one place.
*/
static const char* ReadText( const char* in, // where to start
std::string* text, // the string read
bool ignoreWhiteSpace, // whether to keep the white space
const char* endTag, // what ends this text
bool ignoreCase ); // whether to ignore case in the end tag
enum
{
TIXML_NO_ERROR = 0,
TIXML_ERROR_OPENING_FILE,
TIXML_ERROR_OUT_OF_MEMORY,
TIXML_ERROR_PARSING_ELEMENT,
TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME,
TIXML_ERROR_READING_ELEMENT_VALUE,
TIXML_ERROR_READING_ATTRIBUTES,
TIXML_ERROR_PARSING_EMPTY,
TIXML_ERROR_READING_END_TAG,
TIXML_ERROR_PARSING_UNKNOWN,
TIXML_ERROR_PARSING_COMMENT,
TIXML_ERROR_PARSING_DECLARATION,
TIXML_ERROR_STRING_COUNT
};
static const char* errorString[ TIXML_ERROR_STRING_COUNT ];
};
/** The parent class for everything in the Document Object Model.
(Except for attributes, which are contained in elements.)
Nodes have siblings, a parent, and children. A node can be
in a document, or stand on its own. The type of a TyXmlNode
can be queried, and it can be cast to its more defined type.
*/
class TiXmlNode : public TiXmlBase
{
public:
/** The types of XML nodes supported by TinyXml. (All the
unsupported types are picked up by UNKNOWN.)
*/
enum NodeType
{
DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, DECLARATION, TYPECOUNT
};
virtual ~TiXmlNode();
/** The meaning of 'value' changes for the specific type of
TiXmlNode.
@verbatim
Document: filename of the xml file
Element: name of the element
Comment: the comment text
Unknown: the tag contents
Text: the text string
@endverbatim
The subclasses will wrap this function.
*/
const std::string& Value() const { return value; }
/** Changes the value of the node. Defined as:
@verbatim
Document: filename of the xml file
Element: name of the element
Comment: the comment text
Unknown: the tag contents
Text: the text string
@endverbatim
*/
void SetValue( const std::string& _value ) { value = _value; }
/// Delete all the children of this node. Does not affect 'this'.
void Clear();
/// One step up the DOM.
TiXmlNode* Parent() const { return parent; }
TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children.
TiXmlNode* FirstChild( const std::string& value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found.
TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children.
TiXmlNode* LastChild( const std::string& value ) const; /// The last child of this node matching 'value'. Will be null if there are no children.
/** An alternate way to walk the children of a node.
One way to iterate over nodes is:
@verbatim
for( child = parent->FirstChild(); child; child = child->NextSibling() )
@endverbatim
IterateChildren does the same thing with the syntax:
@verbatim
child = 0;
while( child = parent->IterateChildren( child ) )
@endverbatim
IterateChildren takes the previous child as input and finds
the next one. If the previous child is null, it returns the
first. IterateChildren will return null when done.
*/
TiXmlNode* IterateChildren( TiXmlNode* previous );
/// This flavor of IterateChildren searches for children with a particular 'value'
TiXmlNode* IterateChildren( const std::string& value, TiXmlNode* previous );
/** Add a new node related to this. Adds a child past the LastChild.
Returns a pointer to the new object or NULL if an error occured.
*/
TiXmlNode* InsertEndChild( const TiXmlNode& addThis );
/** Add a new node related to this. Adds a child before the specified child.
Returns a pointer to the new object or NULL if an error occured.
*/
TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis );
/** Add a new node related to this. Adds a child after the specified child.
Returns a pointer to the new object or NULL if an error occured.
*/
TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis );
/** Replace a child of this node.
Returns a pointer to the new object or NULL if an error occured.
*/
TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis );
/// Delete a child of this node.
bool RemoveChild( TiXmlNode* removeThis );
/// Navigate to a sibling node.
TiXmlNode* PreviousSibling() const { return prev; }
/// Navigate to a sibling node.
TiXmlNode* PreviousSibling( const std::string& ) const;
/// Navigate to a sibling node.
TiXmlNode* NextSibling() const { return next; }
/// Navigate to a sibling node with the given 'value'.
TiXmlNode* NextSibling( const std::string& ) const;
/** Convenience function to get through elements.
Calls NextSibling and ToElement. Will skip all non-Element
nodes. Returns 0 if there is not another element.
*/
TiXmlElement* NextSiblingElement() const;
/** Convenience function to get through elements.
Calls NextSibling and ToElement. Will skip all non-Element
nodes. Returns 0 if there is not another element.
*/
TiXmlElement* NextSiblingElement( const std::string& ) const;
/// Convenience function to get through elements.
TiXmlElement* FirstChildElement() const;
/// Convenience function to get through elements.
TiXmlElement* FirstChildElement( const std::string& value ) const;
/// Query the type (as an enumerated value, above) of this node.
virtual int Type() { return type; }
/** Return a pointer to the Document this node lives in.
Returns null if not in a document.
*/
TiXmlDocument* GetDocument() const;
TiXmlDocument* ToDocument() const { return ( type == DOCUMENT ) ? (TiXmlDocument*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type.
TiXmlElement* ToElement() const { return ( type == ELEMENT ) ? (TiXmlElement*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type.
TiXmlComment* ToComment() const { return ( type == COMMENT ) ? (TiXmlComment*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type.
TiXmlUnknown* ToUnknown() const { return ( type == UNKNOWN ) ? (TiXmlUnknown*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type.
TiXmlText* ToText() const { return ( type == TEXT ) ? (TiXmlText*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type.
TiXmlDeclaration* ToDeclaration() const { return ( type == DECLARATION ) ? (TiXmlDeclaration*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type.
virtual TiXmlNode* Clone() const = 0;
protected:
TiXmlNode( NodeType type );
virtual const char* Parse( const char* ) = 0;
// The node is passed in by ownership. This object will delete it.
TiXmlNode* LinkEndChild( TiXmlNode* addThis );
// Figure out what is at *p, and parse it. Return a node if
// successful, and update p.
TiXmlNode* IdentifyAndParse( const char** p );
void CopyToClone( TiXmlNode* target ) const { target->value = value; }
TiXmlNode* parent;
NodeType type;
TiXmlNode* firstChild;
TiXmlNode* lastChild;
std::string value;
TiXmlNode* prev;
TiXmlNode* next;
};
/** An attribute is a name-value pair. Elements have an arbitrary
number of attributes, each with a unique name.
@note The attributes are not TiXmlNodes, since they are not
part of the tinyXML document object model. There are other
suggested ways to look at this problem.
@note Attributes have a parent
*/
class TiXmlAttribute : public TiXmlBase
{
friend class TiXmlAttributeSet;
public:
/// Construct an empty attribute.
TiXmlAttribute() : prev( 0 ), next( 0 ) {}
/// Construct an attribute with a name and value.
TiXmlAttribute( const std::string& _name, const std::string& _value ) : name( _name ), value( _value ), prev( 0 ), next( 0 ) {}
const std::string& Name() const { return name; } ///< Return the name of this attribute.
const std::string& Value() const { return value; } ///< Return the value of this attribute.
void SetName( const std::string& _name ) { name = _name; } ///< Set the name of this attribute.
void SetValue( const std::string& _value ) { value = _value; } ///< Set the value.
/// Get the next sibling attribute in the DOM. Returns null at end.
TiXmlAttribute* Next();
/// Get the previous sibling attribute in the DOM. Returns null at beginning.
TiXmlAttribute* Previous();
bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; }
bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; }
bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; }
/* [internal use]
Attribtue parsing starts: first letter of the name
returns: the next char after the value end quote
*/
const char* Parse( const char* );
// [internal use]
virtual void Print( FILE* fp, int depth );
// [internal use]
// Set the document pointer so the attribute can report errors.
void SetDocument( TiXmlDocument* doc ) { document = doc; }
private:
TiXmlDocument* document; // A pointer back to a document, for error reporting.
std::string name;
std::string value;
TiXmlAttribute* prev;
TiXmlAttribute* next;
};
/* A class used to manage a group of attributes.
It is only used internally, both by the ELEMENT and the DECLARATION.
The set can be changed transparent to the Element and Declaration
classes that use it, but NOT transparent to the Attribute
which has to implement a next() and previous() method. Which makes
it a bit problematic and prevents the use of STL.
This version is implemented with circular lists because:
- I like circular lists
- it demonstrates some independence from the (typical) doubly linked list.
*/
class TiXmlAttributeSet
{
public:
TiXmlAttributeSet();
~TiXmlAttributeSet();
void Add( TiXmlAttribute* attribute );
void Remove( TiXmlAttribute* attribute );
TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
TiXmlAttribute* Find( const std::string& name ) const;
private:
TiXmlAttribute sentinel;
};
/** The element is a container class. It has a value, the element name,
and can contain other elements, text, comments, and unknowns.
Elements also contain an arbitrary number of attributes.
*/
class TiXmlElement : public TiXmlNode
{
public:
/// Construct an element.
TiXmlElement( const std::string& value );
virtual ~TiXmlElement();
/** Given an attribute name, attribute returns the value
for the attribute of that name, or null if none exists.
*/
const std::string* Attribute( const std::string& name ) const;
/** Given an attribute name, attribute returns the value
for the attribute of that name, or null if none exists.
*/
const std::string* Attribute( const std::string& name, int* i ) const;
/** Sets an attribute of name to a given value. The attribute
will be created if it does not exist, or changed if it does.
*/
void SetAttribute( const std::string& name,
const std::string& value );
/** Sets an attribute of name to a given value. The attribute
will be created if it does not exist, or changed if it does.
*/
void SetAttribute( const std::string& name,
int value );
/** Deletes an attribute with the given name.
*/
void RemoveAttribute( const std::string& name );
TiXmlAttribute* FirstAttribute() { return attributeSet.First(); } ///< Access the first attribute in this element.
TiXmlAttribute* LastAttribute() { return attributeSet.Last(); } ///< Access the last attribute in this element.
// [internal use] Creates a new Element and returs it.
virtual TiXmlNode* Clone() const;
// [internal use]
virtual void Print( FILE* fp, int depth );
protected:
/* [internal use]
Attribtue parsing starts: next char past '<'
returns: next char past '>'
*/
virtual const char* Parse( const char* );
const char* ReadValue( const char* p );
private:
TiXmlAttributeSet attributeSet;
};
/** An XML comment.
*/
class TiXmlComment : public TiXmlNode
{
public:
/// Constructs an empty comment.
TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {}
virtual ~TiXmlComment() {}
// [internal use] Creates a new Element and returs it.
virtual TiXmlNode* Clone() const;
// [internal use]
virtual void Print( FILE* fp, int depth );
protected:
/* [internal use]
Attribtue parsing starts: at the ! of the !--
returns: next char past '>'
*/
virtual const char* Parse( const char* );
};
/** XML text. Contained in an element.
*/
class TiXmlText : public TiXmlNode
{
public:
TiXmlText() : TiXmlNode( TiXmlNode::TEXT ) {}
virtual ~TiXmlText() {}
// [internal use] Creates a new Element and returns it.
virtual TiXmlNode* Clone() const;
// [internal use]
virtual void Print( FILE* fp, int depth );
// [internal use]
bool Blank(); // returns true if all white space and new lines
/* [internal use]
Attribtue parsing starts: First char of the text
returns: next char past '>'
*/
virtual const char* Parse( const char* );
};
/** XML Cdata section. Contained in an element.
* Always start with <![CDATA[ and end with ]]>
*/
class TiXmlCData : public TiXmlText
{
friend class TiXmlElement;
public:
/// Constructor.
TiXmlCData ()
{}
virtual ~TiXmlCData() {}
protected :
virtual const char* Parse( const char* p );
};
/** In correct XML the declaration is the first entry in the file.
@verbatim
<?xml version="1.0" standalone="yes"?>
@endverbatim
TinyXml will happily read or write files without a declaration,
however. There are 3 possible attributes to the declaration:
version, encoding, and standalone.
Note: In this version of the code, the attributes are
handled as special cases, not generic attributes, simply
because there can only be at most 3 and they are always the same.
*/
class TiXmlDeclaration : public TiXmlNode
{
public:
/// Construct an empty declaration.
TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {}
/// Construct.
TiXmlDeclaration( const std::string& version,
const std::string& encoding,
const std::string& standalone );
virtual ~TiXmlDeclaration() {}
/// Version. Will return empty if none was found.
const std::string& Version() { return version; }
/// Encoding. Will return empty if none was found.
const std::string& Encoding() { return encoding; }
/// Is this a standalone document?
const std::string& Standalone() { return standalone; }
// [internal use] Creates a new Element and returs it.
virtual TiXmlNode* Clone() const;
// [internal use]
virtual void Print( FILE* fp, int depth );
protected:
// [internal use]
// Attribtue parsing starts: next char past '<'
// returns: next char past '>'
virtual const char* Parse( const char* );
private:
std::string version;
std::string encoding;
std::string standalone;
};
/** Any tag that tinyXml doesn't recognize is save as an
unknown. It is a tag of text, but should not be modified.
It will be written back to the XML, unchanged, when the file
is saved.
*/
class TiXmlUnknown : public TiXmlNode
{
public:
TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN ) {}
virtual ~TiXmlUnknown() {}
// [internal use]
virtual TiXmlNode* Clone() const;
// [internal use]
virtual void Print( FILE* fp, int depth );
protected:
/* [internal use]
Attribute parsing starts: First char of the text
returns: next char past '>'
*/
virtual const char* Parse( const char* );
};
/** Always the top level node. A document binds together all the
XML pieces. It can be saved, loaded, and printed to the screen.
The 'value' of a document node is the xml file name.
*/
class TiXmlDocument : public TiXmlNode
{
public:
/// Create an empty document, that has no name.
TiXmlDocument();
/// Create a document with a name. The name of the document is also the filename of the xml.
TiXmlDocument( const std::string& documentName );
virtual ~TiXmlDocument() {}
/** Load a file using the current document value.
Returns true if successful. Will delete any existing
document data before loading.
*/
bool LoadFile();
/// Save a file using the current document value. Returns true if successful.
bool SaveFile();
/// Load a file using the given filename. Returns true if successful.
bool LoadFile( const std::string& filename );
/// Save a file using the given filename. Returns true if successful.
bool SaveFile( const std::string& filename );
/// Load a file using the given file pointer. Returns true if successful.
bool LoadFile(FILE* fp);
/// Parse the given null terminated block of xml data.
const char* Parse( const char* );
/// If, during parsing, a error occurs, Error will be set to true.
bool Error() { return error; }
/// Contains a textual (english) description of the error if one occurs.
const std::string& ErrorDesc() { return errorDesc; }
/// Write the document to a file -- usually invoked by SaveFile.
virtual void Print( FILE* fp, int depth = 0 );
/// Dump the document to standard out.
void Print() { Print( stdout, 0 ); }
// [internal use]
virtual TiXmlNode* Clone() const;
// [internal use]
void SetError( int err ) { assert( err > 0 && err < TIXML_ERROR_STRING_COUNT );
error = true;
errorId = err;
errorDesc = errorString[ errorId ]; }
private:
bool error;
int errorId;
std::string errorDesc;
};
#endif
| [
"Laurine@.(none)"
] | Laurine@.(none) |
385e3706f3b076f38d22b46ef4cfeb1eece649ae | b59b4f6727a13398db8612e19112e2f834685d83 | /DP Practice/Balance.cpp | bff711365fc14ceaaf5902dd6e89a462e8a99cb6 | [] | no_license | sushiljacksparrow/Code | c968ab944d70333d7b4139b7ac1bde5929e9e188 | 208d8170e908fa03c1b7c27def2a41f3183b70c1 | refs/heads/master | 2020-05-19T23:03:16.722977 | 2013-03-15T11:05:02 | 2013-03-15T11:05:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,880 | cpp | /*Sushil Kumar Singh */
#include <cfloat>
#include <cmath>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>
#include <ext/numeric>
#include <ext/hash_map>
#include <ext/hash_set>
#include <ext/algorithm>
using namespace std;
using namespace __gnu_cxx;
#define pb push_back
#define vi vector<int>
#define vii vector<vi>
#define ii pair<int,int>
#define vs vector<string>
#define all(v) (v).begin(), (v).end()
#define For(i,x) for(int i=0;i<x;i++)
int ans[100][2];
struct balance
{
int weight;
int lweight, rweight;
vector<int>left;
vector<int>right;
};
vector<balance>g;
int solve(int bal)
{
if(g[bal].weight>=0)
return g[bal].weight;
int lwet=g[bal].lweight;
int rwet=g[bal].rweight;
for(int i=0;i<g[bal].left.size();i++)
lwet+=solve(g[bal].left[i]);
for(int j=0;j<g[bal].right.size();j++)
rwet+=solve(g[bal].right[j]);
//cout<<bal<<" "<<lwet<<" "<<rwet<<endl;
if(lwet>rwet)
ans[bal][1]=lwet-rwet;
else if(rwet>lwet)
ans[bal][0]=rwet-lwet;
//ans[bal][0]=lwet-g[bal].lweight;
//ans[bal][1]=rwet-g[bal].rweight;
g[bal].weight = max(lwet, rwet)*2+10;
return g[bal].weight;
}
void printG()
{
int n=g.size();
for(int i=0;i<n;i++)
{
cout<<"bal "<<i<<endl;
cout<<g[i].lweight<<" "<<g[i].rweight<<endl;
for(int j=0;j<g[i].left.size();j++)
cout<<g[i].left[j]<<" ";
cout<<endl;
for(int j=0;j<g[i].right.size();j++)
cout<<g[i].right[j]<<" ";
cout<<endl<<endl;
}
}
int main()
{
//freopen("inout.txt","r",stdin);
//freopen("out.txt","w",stdout);
int n, val;
vector<int>other;
char linput[1000];
char rinput[1000];
balance bal;
scanf("%d", &n);
cin.getline(linput, 1000);
for(int i=0;i<n;i++)
{
//cout<<"dasdasd\n";
cin.getline(linput, 1000);
bal.weight = -1;
stringstream ss1(linput);
ss1>>val;
bal.lweight = val;
other.clear();
while(ss1>>val)
{
//cout<<val<<" ";
other.push_back(val);
}
//for(int j=0;j<other.size();j++)
// cout<<other[j]<<" ";
//cout<<endl;
bal.left = other;
other.clear();
cin.getline(rinput, 1000);
stringstream ss2(rinput);
ss2>>val;
bal.rweight = val;
while(ss2>>val)
{
//cout<<val<<" ";
other.push_back(val);
}
bal.right = other;
//for(int j=0;j<other.size();j++)
// cout<<other[j]<<" ";
//cout<<endl;
g.push_back(bal);
}
//printG();
solve(0);
for(int i=0;i<n;i++)
cout<<i<<": "<<ans[i][0]<<" "<<ans[i][1]<<endl;
system("pause");
}
| [
"sushiljacksparrow@gmail.com"
] | sushiljacksparrow@gmail.com |
b0fec188303f6e2c4aac7d4319903cdafe7f5935 | 75fc8b7594b2075ff487dc05afdd5ad0a7408c1f | /ElDorito/Source/Server/ServerChat.cpp | 6c7772f3a85c513c5453b1949d16366d514f7a14 | [] | no_license | NoShotz/ElDorito | 929e7b4e033914d15257419c8978d0f5fa598177 | a6d2d681e999d2d21f3f8bb3bd272f0771f2d1fe | refs/heads/master | 2021-07-25T18:26:25.982270 | 2020-05-08T17:17:17 | 2020-05-08T17:17:17 | 167,758,023 | 26 | 35 | null | 2019-11-24T05:36:13 | 2019-01-27T01:35:22 | C++ | UTF-8 | C++ | false | false | 16,957 | cpp | #define _CRT_SECURE_NO_WARNINGS
#include "ServerChat.hpp"
#include "Rcon.hpp"
#include "../Patches/CustomPackets.hpp"
#include "../Modules/ModuleServer.hpp"
#include "../Modules/ModuleGame.hpp"
#include "../Utils/String.hpp"
#include <unordered_map>
#include <fstream>
#include <chrono>
#include <iomanip>
#include <Windows.h>
#include "../ChatCommands/ChatCommandMap.hpp"
namespace
{
using namespace Server::Chat;
typedef Patches::CustomPackets::Packet<ChatMessage> ChatMessagePacket;
typedef Patches::CustomPackets::PacketSender<ChatMessage> ChatMessagePacketSender;
std::shared_ptr<ChatMessagePacketSender> PacketSender;
bool HostReceivedMessage(Blam::Network::Session *session, int peer, const ChatMessage &message);
void ClientReceivedMessage(const ChatMessage &message);
struct ClientSpamStats
{
ClientSpamStats() : SpamScore(0), TimeoutSeconds(0), NextTimeoutSeconds(0), TimeoutResetSeconds(0) {}
int SpamScore; // Decreased by 1 each second.
int TimeoutSeconds; // The number of seconds that the client is timed out for.
int NextTimeoutSeconds; // The length of the next timeout period in seconds (0 = default).
int TimeoutResetSeconds; // The number of seconds remaining before the next timeout length is reset.
};
// Maps IP addresses to spam statistics.
std::unordered_map<uint32_t, ClientSpamStats> SpamStats;
DWORD LastTimeMs; // The time, in milliseconds, of the last tick.
DWORD SpamUpdateMs; // Number of milliseconds since the last spam score decrement.
// Packet handler for chat messages.
class ChatMessagePacketHandler: public Patches::CustomPackets::PacketHandler<ChatMessage>
{
public:
void Serialize(Blam::BitStream *stream, const ChatMessage *data) override
{
// Message type
stream->WriteUnsigned(static_cast<uint32_t>(data->Type), 0U, static_cast<uint32_t>(ChatMessageType::Count));
// Body
stream->WriteString(data->Body);
// For non-server messages, serialize the sender index
if (data->Type != ChatMessageType::Server)
stream->WriteUnsigned<uint8_t>(data->SenderPlayer, 0, Blam::Network::MaxPlayers - 1);
// For whisper messages, serialize the target index
if (data->Type == ChatMessageType::Whisper)
stream->WriteUnsigned<uint8_t>(data->TargetPlayer, 0, Blam::Network::MaxPlayers - 1);
}
bool Deserialize(Blam::BitStream *stream, ChatMessage *data) override
{
memset(data, 0, sizeof(*data));
// Message type
data->Type = static_cast<ChatMessageType>(stream->ReadUnsigned(0U, static_cast<uint32_t>(ChatMessageType::Count)));
if (static_cast<uint32_t>(data->Type) >= static_cast<uint32_t>(ChatMessageType::Count))
return false;
// Body
if (!stream->ReadString(data->Body))
return false;
// For non-server messages, deserialize the sender index
if (data->Type != ChatMessageType::Server)
data->SenderPlayer = stream->ReadUnsigned<uint8_t>(0, Blam::Network::MaxPlayers - 1);
// For whisper messages, deserialize the target index
if (data->Type == ChatMessageType::Whisper)
data->TargetPlayer = stream->ReadUnsigned<uint8_t>(0, Blam::Network::MaxPlayers - 1);
return true;
}
void HandlePacket(Blam::Network::ObserverChannel *sender, const ChatMessagePacket *packet) override
{
auto session = Blam::Network::GetActiveSession();
if (!session)
return;
auto peer = session->GetChannelPeer(sender);
if (peer < 0)
return;
if (session->IsHost())
HostReceivedMessage(session, peer, packet->Data);
else if (peer == session->MembershipInfo.HostPeerIndex)
ClientReceivedMessage(packet->Data);
}
};
// Registered chat handlers
std::vector<std::shared_ptr<ChatHandler>> chatHandlers;
// Sends a message to a peer as a packet.
bool SendMessagePacket(int peer, const ChatMessage &message)
{
if (peer < 0)
return false;
auto packet = PacketSender->New();
packet.Data = message;
PacketSender->Send(peer, packet);
return true;
}
// Broadcasts a message to a set of peers.
bool BroadcastMessage(Blam::Network::Session *session, int senderPeer, ChatMessage *message, PeerBitSet peers)
{
if (senderPeer < 0)
return false;
// Run the message through each registered handler
auto ignore = false;
for (auto &&handler : chatHandlers)
handler->MessageSent(senderPeer, message, &ignore);
if (ignore)
return true; // Message was rejected by a handler
// Loop through each peer and send them a packet (or handle the message
// immediately if it's being sent to the local peer)
auto membership = &session->MembershipInfo;
for (auto peer = membership->FindFirstPeer(); peer >= 0; peer = membership->FindNextPeer(peer))
{
if (!peers[peer])
continue; // Not being sent to this peer
if (peer == membership->LocalPeerIndex)
ClientReceivedMessage(*message);
else if (!SendMessagePacket(peer, *message))
return false;
}
return true;
}
// Gets a bitset of peers on the same team as a peer.
bool GetTeamPeers(Blam::Network::Session *session, int senderPeer, PeerBitSet *result)
{
result->reset();
// Get the sender's team
if (!session->HasTeams())
return false;
auto membership = &session->MembershipInfo;
auto senderTeam = membership->GetPeerTeam(senderPeer);
if (senderTeam < 0)
return false;
// Loop through each peer and check if the peer is on the sender's team
for (auto peer = membership->FindFirstPeer(); peer >= 0; peer = membership->FindNextPeer(peer))
{
if (membership->GetPeerTeam(peer) == senderTeam)
result->set(peer);
}
return true;
}
// Gets a bitset of peers to send a message to.
bool GetMessagePeers(Blam::Network::Session *session, int senderPeer, const ChatMessage &message, PeerBitSet *result)
{
switch (message.Type)
{
case ChatMessageType::Global:
result->set();
break;
case ChatMessageType::Team:
GetTeamPeers(session, senderPeer, result);
break;
// TODO: ChatMessageType::Whisper
default:
return false;
}
return true;
}
// Gets the name of a message's sender.
std::string GetSenderName(Blam::Network::Session *session, const ChatMessage &message)
{
if (message.Type == ChatMessageType::Server || message.SenderPlayer >= Blam::Network::MaxPlayers)
return "SERVER";
auto &membership = session->MembershipInfo;
auto &player = membership.PlayerSessions[message.SenderPlayer];
return Utils::String::ThinString(player.Properties.DisplayName);
}
// Calculates the spam score of a message.
int CalculateSpamScore(uint32_t ip, ClientSpamStats *stats, const ChatMessage &message)
{
// Compute a score between the short and long scores based on the message length
// Messages which are closer to the maximum length will have a score closer to the maximum score
auto &serverModule = Modules::ModuleServer::Instance();
auto shortScore = serverModule.VarFloodMessageScoreShort->ValueInt;
auto longScore = serverModule.VarFloodMessageScoreLong->ValueInt;
return shortScore + strlen(message.Body) * (longScore + 1 - shortScore) / (MaxMessageLength + 1);
}
// Checks a message against the flood filter and returns true if it should be thrown out.
bool FloodFilterMessage(Blam::Network::Session *session, int peer, const ChatMessage &message)
{
// Increase the IP's spam score and put it in timeout if it exceeds the maximum
auto ip = session->GetPeerAddress(peer).Address.IPv4;
auto spamIt = SpamStats.find(ip);
if (spamIt == SpamStats.end())
spamIt = SpamStats.insert({ ip, ClientSpamStats() }).first;
if (spamIt->second.TimeoutSeconds <= 0)
{
// Calculate the message's spam score and add it to the IP's total score
auto score = CalculateSpamScore(ip, &spamIt->second, message);
spamIt->second.SpamScore += score;
// If the total score reached the timeout score, then start a timeout
auto &serverModule = Modules::ModuleServer::Instance();
if (spamIt->second.SpamScore >= static_cast<int>(serverModule.VarFloodTimeoutScore->ValueInt))
{
// If the IP had a previous timeout that hasn't been reset yet, double it, otherwise start with the default
if (spamIt->second.NextTimeoutSeconds > 0)
spamIt->second.NextTimeoutSeconds *= 2;
else
spamIt->second.NextTimeoutSeconds = serverModule.VarFloodTimeoutSeconds->ValueInt;
spamIt->second.TimeoutSeconds = spamIt->second.NextTimeoutSeconds;
spamIt->second.TimeoutResetSeconds = serverModule.VarFloodTimeoutResetSeconds->ValueInt;
}
}
// If the IP is in a timeout state, send an error and return
if (spamIt->second.TimeoutSeconds > 0)
{
PeerBitSet targetPeers;
targetPeers.set(peer);
SendServerMessage("You have exceeded the server's spam limit. You can chat again in " + std::to_string(spamIt->second.TimeoutSeconds) + " second(s).", targetPeers);
return true;
}
return false;
}
// Writes a message to the log file.
std::string GetLogString(Blam::Network::Session *session, int peer, const ChatMessage &message)
{
// Get the UTC time
auto now = std::chrono::system_clock::now();
auto time = std::chrono::system_clock::to_time_t(now);
struct tm gmTime;
gmtime_s(&gmTime, &time);
// Get the name and IP address
auto sender = GetSenderName(session, message);
auto ip = session->GetPeerAddress(peer).Address.IPv4;
// Get the UID
uint64_t uid = 0;
auto playerIndex = session->MembershipInfo.GetPeerPlayer(peer);
if (playerIndex >= 0)
uid = session->MembershipInfo.PlayerSessions[playerIndex].Properties.Uid;
std::ostringstream ss;
char uidStr[17];
Blam::Players::FormatUid(uidStr, uid);
ss << "[" << std::put_time(&gmTime, "%m/%d/%y %H:%M:%S") << "] "; // Timestamp
ss << "<" << sender << "/"; // Sender name
ss << uidStr << "/"; // UID
ss << (ip >> 24) << "." << ((ip >> 16) & 0xFF) << "." << ((ip >> 8) & 0xFF) << "." << (ip & 0xFF) << "> "; // IP address
ss << message.Body; // Message body
return ss.str();
}
// Writes a message to the log file.
void LogMessage(Blam::Network::Session *session, int peer, const ChatMessage &message)
{
auto &serverModule = Modules::ModuleServer::Instance();
if (!serverModule.VarChatLogEnabled->ValueInt)
return;
// Try to open the log file for appending
auto chatLogFile = Modules::ModuleServer::Instance().VarChatLogFile->ValueString;
std::ofstream logFile(chatLogFile, std::ios::app);
if (!logFile)
return;
logFile << GetLogString(session,peer, message) << "\n";
}
// Callback for when a message is received as the host.
bool HostReceivedMessage(Blam::Network::Session *session, int peer, const ChatMessage &message)
{
// Verify that the message isn't empty and that the type is valid
// TODO: Implement support for message types other than Global
if (peer < 0 || !message.Body[0] || message.Type == ChatMessageType::Server)
return false;
// Don't trust the sender field
auto broadcastMessage = message;
auto player = session->MembershipInfo.GetPeerPlayer(peer);
if (player < 0)
return false;
broadcastMessage.SenderPlayer = player;
// Check the message against the flood filter if it's enabled
auto &serverModule = Modules::ModuleServer::Instance();
if (peer != session->MembershipInfo.LocalPeerIndex)
{
if (serverModule.VarFloodFilterEnabled->ValueInt)
{
if (FloodFilterMessage(session, peer, broadcastMessage))
return true; // Message was thrown out
}
}
if (Modules::ModuleServer::Instance().VarSendChatToRconClients->ValueInt == 1)
Server::Rcon::SendMessageToClients(GetLogString(session, peer, broadcastMessage));
LogMessage(session, peer, broadcastMessage);
//Intercept the message. Don't forward the message on if it's a chat command
if (message.Type != Server::Chat::ChatMessageType::Team)
{
if (ChatCommands::handleChatMessage(message, peer)){
return true;
}
}
PeerBitSet targetPeers;
if (!GetMessagePeers(session, peer, message, &targetPeers))
return false;
return BroadcastMessage(session, peer, &broadcastMessage, targetPeers);
}
// Callback for when a message is received as the client.
void ClientReceivedMessage(const ChatMessage &message)
{
// Send the message out to handlers
for (auto &&handler : chatHandlers)
handler->MessageReceived(message);
}
// Sends a message as a client.
bool SendClientMessage(Blam::Network::Session *session, const ChatMessage &message)
{
if (session->IsHost())
{
// We're the host, so pretend a client sent us the message
return HostReceivedMessage(session, session->MembershipInfo.LocalPeerIndex, message);
}
// Send the message across the network to the host
return SendMessagePacket(session->MembershipInfo.HostPeerIndex, message);
}
}
namespace Server::Chat
{
void Initialize()
{
LastTimeMs = timeGetTime();
// Register custom packet type
auto handler = std::make_shared<ChatMessagePacketHandler>();
PacketSender = Patches::CustomPackets::RegisterPacket<ChatMessage>("eldewrito-text-chat", handler);
}
void Tick()
{
// Compute the time delta (the game also uses timeGetTime in its various subsystems to do this)
auto currentTimeMs = timeGetTime();
auto timeDeltaMs = currentTimeMs - LastTimeMs;
LastTimeMs = currentTimeMs;
// Update the flood filter for each second that has passed since the last flood filter update
SpamUpdateMs += timeDeltaMs;
while (SpamUpdateMs >= 1000)
{
SpamUpdateMs -= 1000;
// Decrease each spam score and timeout, and remove empty structures to save memory
auto it = SpamStats.begin();
while (it != SpamStats.end())
{
auto nextIt = it;
++nextIt;
if (it->second.SpamScore > 0)
it->second.SpamScore--;
if (it->second.TimeoutSeconds > 0)
it->second.TimeoutSeconds--;
else if (it->second.TimeoutResetSeconds > 0)
it->second.TimeoutResetSeconds--; // Only decrement the timeout reset if no timeout is active
if (it->second.TimeoutResetSeconds == 0)
it->second.NextTimeoutSeconds = 0;
if (it->second.TimeoutSeconds <= 0 && it->second.SpamScore <= 0 && it->second.TimeoutResetSeconds <= 0)
SpamStats.erase(it);
it = nextIt;
}
}
}
bool SendGlobalMessage(const std::string &body)
{
auto session = Blam::Network::GetActiveSession();
if (!session || !session->IsEstablished())
return false;
ChatMessage message(ChatMessageType::Global, body);
return SendClientMessage(session, message);
}
//Sends a server message to all peers.
bool SendServerMessage(const std::string &body)
{
auto session = Blam::Network::GetActiveSession();
if (!session || !session->IsEstablished() || !session->IsHost())
return false;
PeerBitSet p;
p.set();
ChatMessage message(ChatMessageType::Server, body);
return BroadcastMessage(session, session->MembershipInfo.LocalPeerIndex, &message, p);
}
bool SendTeamMessage(const std::string &body)
{
auto session = Blam::Network::GetActiveSession();
if (!session || !session->IsEstablished() || !session->HasTeams())
return false;
ChatMessage message(ChatMessageType::Team, body);
return SendClientMessage(session, message);
}
bool SendAndLogServerMessage(const std::string &body)
{
auto session = Blam::Network::GetActiveSession();
if (!session || !session->IsEstablished() || !session->IsHost())
return false;
PeerBitSet p;
p.set();
ChatMessage message(ChatMessageType::Server, body);
if (Modules::ModuleServer::Instance().VarSendChatToRconClients->ValueInt == 1)
Server::Rcon::SendMessageToClients(GetLogString(session, session->MembershipInfo.LocalPeerIndex, message));
LogMessage(session, session->MembershipInfo.LocalPeerIndex, message);
return BroadcastMessage(session, session->MembershipInfo.LocalPeerIndex, &message, p);
}
//So I dont have to create a new PeerBitSet all the time when sending it to just one peer
bool SendServerMessage(const std::string &body, int peer)
{
auto session = Blam::Network::GetActiveSession();
if (!session || !session->IsEstablished() || !session->IsHost())
return false;
PeerBitSet peers;
peers.set(peer);
ChatMessage message(ChatMessageType::Server, body);
return BroadcastMessage(session, session->MembershipInfo.LocalPeerIndex, &message, peers);
}
bool SendServerMessage(const std::string &body, PeerBitSet peers)
{
auto session = Blam::Network::GetActiveSession();
if (!session || !session->IsEstablished() || !session->IsHost())
return false;
ChatMessage message(ChatMessageType::Server, body);
return BroadcastMessage(session, session->MembershipInfo.LocalPeerIndex, &message, peers);
}
void AddHandler(std::shared_ptr<ChatHandler> handler)
{
chatHandlers.push_back(handler);
}
std::string GetSenderName(const ChatMessage &message)
{
return ::GetSenderName(Blam::Network::GetActiveSession(), message);
}
ChatMessage::ChatMessage(ChatMessageType type, const std::string &body)
{
memset(this, 0, sizeof(*this));
Type = type;
strncpy(Body, body.c_str(), sizeof(Body) / sizeof(Body[0]) - 1);
}
}
| [
"noshotz@protonmail.com"
] | noshotz@protonmail.com |
c3d92075d2bb7c49e8cda20f1fae284c055ad5b2 | 9d129ad5a23e9171c0a947d67a286ddd56a65cb3 | /server/main.cpp | 734baabe7dbc657fdc50ebdf5f5ffe77135e530f | [
"MIT"
] | permissive | inrg/ZLMediaKit | 604e005e8ec5f4b5d1727d280fda97a07ebcca3f | ccbd1d4a831433d88c31757067793b1c714c17a2 | refs/heads/master | 2020-09-04T10:18:45.231402 | 2019-11-05T02:27:28 | 2019-11-05T02:27:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,053 | cpp | /*
* MIT License
*
* Copyright (c) 2016-2019 xiongziliang <771730766@qq.com>
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <map>
#include <signal.h>
#include <iostream>
#include "Util/MD5.h"
#include "Util/File.h"
#include "Util/logger.h"
#include "Util/SSLBox.h"
#include "Util/onceToken.h"
#include "Util/CMD.h"
#include "Network/TcpServer.h"
#include "Poller/EventPoller.h"
#include "Common/config.h"
#include "Rtsp/UDPServer.h"
#include "Rtsp/RtspSession.h"
#include "Rtmp/RtmpSession.h"
#include "Shell/ShellSession.h"
#include "Rtmp/FlvMuxer.h"
#include "Player/PlayerProxy.h"
#include "Http/WebSocketSession.h"
#include "WebApi.h"
#include "WebHook.h"
#if !defined(_WIN32)
#include "System.h"
#endif//!defined(_WIN32)
using namespace std;
using namespace toolkit;
using namespace mediakit;
namespace mediakit {
////////////HTTP配置///////////
namespace Http {
#define HTTP_FIELD "http."
#define HTTP_PORT 80
const string kPort = HTTP_FIELD"port";
#define HTTPS_PORT 443
const string kSSLPort = HTTP_FIELD"sslport";
onceToken token1([](){
mINI::Instance()[kPort] = HTTP_PORT;
mINI::Instance()[kSSLPort] = HTTPS_PORT;
},nullptr);
}//namespace Http
////////////SHELL配置///////////
namespace Shell {
#define SHELL_FIELD "shell."
#define SHELL_PORT 9000
const string kPort = SHELL_FIELD"port";
onceToken token1([](){
mINI::Instance()[kPort] = SHELL_PORT;
},nullptr);
} //namespace Shell
////////////RTSP服务器配置///////////
namespace Rtsp {
#define RTSP_FIELD "rtsp."
#define RTSP_PORT 554
#define RTSPS_PORT 322
const string kPort = RTSP_FIELD"port";
const string kSSLPort = RTSP_FIELD"sslport";
onceToken token1([](){
mINI::Instance()[kPort] = RTSP_PORT;
mINI::Instance()[kSSLPort] = RTSPS_PORT;
},nullptr);
} //namespace Rtsp
////////////RTMP服务器配置///////////
namespace Rtmp {
#define RTMP_FIELD "rtmp."
#define RTMP_PORT 1935
const string kPort = RTMP_FIELD"port";
onceToken token1([](){
mINI::Instance()[kPort] = RTMP_PORT;
},nullptr);
} //namespace RTMP
} // namespace mediakit
class CMD_main : public CMD {
public:
CMD_main() {
_parser.reset(new OptionParser(nullptr));
#if !defined(_WIN32)
(*_parser) << Option('d',/*该选项简称,如果是\x00则说明无简称*/
"daemon",/*该选项全称,每个选项必须有全称;不得为null或空字符串*/
Option::ArgNone,/*该选项后面必须跟值*/
nullptr,/*该选项默认值*/
false,/*该选项是否必须赋值,如果没有默认值且为ArgRequired时用户必须提供该参数否则将抛异常*/
"是否以Daemon方式启动",/*该选项说明文字*/
nullptr);
#endif//!defined(_WIN32)
(*_parser) << Option('l',/*该选项简称,如果是\x00则说明无简称*/
"level",/*该选项全称,每个选项必须有全称;不得为null或空字符串*/
Option::ArgRequired,/*该选项后面必须跟值*/
to_string(LTrace).data(),/*该选项默认值*/
false,/*该选项是否必须赋值,如果没有默认值且为ArgRequired时用户必须提供该参数否则将抛异常*/
"日志等级,LTrace~LError(0~4)",/*该选项说明文字*/
nullptr);
(*_parser) << Option('m',/*该选项简称,如果是\x00则说明无简称*/
"max_day",/*该选项全称,每个选项必须有全称;不得为null或空字符串*/
Option::ArgRequired,/*该选项后面必须跟值*/
"7",/*该选项默认值*/
false,/*该选项是否必须赋值,如果没有默认值且为ArgRequired时用户必须提供该参数否则将抛异常*/
"日志最多保存天数",/*该选项说明文字*/
nullptr);
(*_parser) << Option('c',/*该选项简称,如果是\x00则说明无简称*/
"config",/*该选项全称,每个选项必须有全称;不得为null或空字符串*/
Option::ArgRequired,/*该选项后面必须跟值*/
(exeDir() + "config.ini").data(),/*该选项默认值*/
false,/*该选项是否必须赋值,如果没有默认值且为ArgRequired时用户必须提供该参数否则将抛异常*/
"配置文件路径",/*该选项说明文字*/
nullptr);
(*_parser) << Option('s',/*该选项简称,如果是\x00则说明无简称*/
"ssl",/*该选项全称,每个选项必须有全称;不得为null或空字符串*/
Option::ArgRequired,/*该选项后面必须跟值*/
(exeDir() + "ssl.p12").data(),/*该选项默认值*/
false,/*该选项是否必须赋值,如果没有默认值且为ArgRequired时用户必须提供该参数否则将抛异常*/
"ssl证书路径,支持p12/pem类型",/*该选项说明文字*/
nullptr);
(*_parser) << Option('t',/*该选项简称,如果是\x00则说明无简称*/
"threads",/*该选项全称,每个选项必须有全称;不得为null或空字符串*/
Option::ArgRequired,/*该选项后面必须跟值*/
to_string(thread::hardware_concurrency()).data(),/*该选项默认值*/
false,/*该选项是否必须赋值,如果没有默认值且为ArgRequired时用户必须提供该参数否则将抛异常*/
"启动事件触发线程数",/*该选项说明文字*/
nullptr);
}
virtual ~CMD_main() {}
virtual const char *description() const {
return "主程序命令参数";
}
};
#if !defined(_WIN32)
static void inline listen_shell_input(){
cout << "> 欢迎进入命令模式,你可以输入\"help\"命令获取帮助" << endl;
cout << "> " << std::flush;
signal(SIGTTOU,SIG_IGN);
signal(SIGTTIN,SIG_IGN);
SockUtil::setNoBlocked(STDIN_FILENO);
auto oninput = [](int event) {
if (event & Event_Read) {
char buf[1024];
int n = read(STDIN_FILENO, buf, sizeof(buf));
if (n > 0) {
buf[n] = '\0';
try {
CMDRegister::Instance()(buf);
cout << "> " << std::flush;
} catch (ExitException &ex) {
InfoL << "ExitException";
kill(getpid(), SIGINT);
} catch (std::exception &ex) {
cout << ex.what() << endl;
}
} else {
DebugL << get_uv_errmsg();
EventPollerPool::Instance().getFirstPoller()->delEvent(STDIN_FILENO);
}
}
if (event & Event_Error) {
WarnL << "Event_Error";
EventPollerPool::Instance().getFirstPoller()->delEvent(STDIN_FILENO);
}
};
EventPollerPool::Instance().getFirstPoller()->addEvent(STDIN_FILENO, Event_Read | Event_Error | Event_LT,oninput);
}
#endif//!defined(_WIN32)
//全局变量,在WebApi中用于保存配置文件用
string g_ini_file;
int start_main(int argc,char *argv[]) {
{
CMD_main cmd_main;
try {
cmd_main.operator()(argc, argv);
} catch (std::exception &ex) {
cout << ex.what() << endl;
return -1;
}
bool bDaemon = cmd_main.hasKey("daemon");
LogLevel logLevel = (LogLevel) cmd_main["level"].as<int>();
logLevel = MIN(MAX(logLevel, LTrace), LError);
g_ini_file = cmd_main["config"];
string ssl_file = cmd_main["ssl"];
int threads = cmd_main["threads"];
//设置日志
Logger::Instance().add(std::make_shared<ConsoleChannel>("ConsoleChannel", logLevel));
#ifndef ANDROID
auto fileChannel = std::make_shared<FileChannel>("FileChannel", exeDir() + "log/", logLevel);
//日志最多保存天数
fileChannel->setMaxDay(cmd_main["max_day"]);
Logger::Instance().add(fileChannel);
#endif//
#if !defined(_WIN32)
if (bDaemon) {
//启动守护进程
System::startDaemon();
}
//开启崩溃捕获等
System::systemSetup();
#endif//!defined(_WIN32)
//启动异步日志线程
Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());
//加载配置文件,如果配置文件不存在就创建一个
loadIniConfig(g_ini_file.data());
//加载证书,证书包含公钥和私钥
SSL_Initor::Instance().loadCertificate(ssl_file.data());
//信任某个自签名证书
SSL_Initor::Instance().trustCertificate(ssl_file.data());
//不忽略无效证书证书(例如自签名或过期证书)
SSL_Initor::Instance().ignoreInvalidCertificate(true);
uint16_t shellPort = mINI::Instance()[Shell::kPort];
uint16_t rtspPort = mINI::Instance()[Rtsp::kPort];
uint16_t rtspsPort = mINI::Instance()[Rtsp::kSSLPort];
uint16_t rtmpPort = mINI::Instance()[Rtmp::kPort];
uint16_t httpPort = mINI::Instance()[Http::kPort];
uint16_t httpsPort = mINI::Instance()[Http::kSSLPort];
//设置poller线程数,该函数必须在使用ZLToolKit网络相关对象之前调用才能生效
EventPollerPool::setPoolSize(threads);
//简单的telnet服务器,可用于服务器调试,但是不能使用23端口,否则telnet上了莫名其妙的现象
//测试方法:telnet 127.0.0.1 9000
TcpServer::Ptr shellSrv(new TcpServer());
TcpServer::Ptr rtspSrv(new TcpServer());
TcpServer::Ptr rtmpSrv(new TcpServer());
TcpServer::Ptr httpSrv(new TcpServer());
shellSrv->start<ShellSession>(shellPort);
rtspSrv->start<RtspSession>(rtspPort);//默认554
rtmpSrv->start<RtmpSession>(rtmpPort);//默认1935
//http服务器
httpSrv->start<HttpSession>(httpPort);//默认80
//如果支持ssl,还可以开启https服务器
TcpServer::Ptr httpsSrv(new TcpServer());
//https服务器,支持websocket
httpsSrv->start<HttpsSession>(httpsPort);//默认443
//支持ssl加密的rtsp服务器,可用于诸如亚马逊echo show这样的设备访问
TcpServer::Ptr rtspSSLSrv(new TcpServer());
rtspSSLSrv->start<RtspSessionWithSSL>(rtspsPort);//默认322
installWebApi();
InfoL << "已启动http api 接口";
installWebHook();
InfoL << "已启动http hook 接口";
#if !defined(_WIN32) && !defined(ANDROID)
if (!bDaemon) {
//交互式shell输入
listen_shell_input();
}
#endif
//设置退出信号处理函数
static semaphore sem;
signal(SIGINT, [](int) {
InfoL << "SIGINT:exit";
signal(SIGINT, SIG_IGN);// 设置退出信号
sem.post();
});// 设置退出信号
#if !defined(_WIN32)
signal(SIGHUP, [](int) { mediakit::loadIniConfig(g_ini_file.data()); });
#endif
sem.wait();
}
unInstallWebApi();
unInstallWebHook();
//休眠1秒再退出,防止资源释放顺序错误
InfoL << "程序退出中,请等待...";
sleep(1);
InfoL << "程序退出完毕!";
return 0;
}
#ifndef DISABLE_MAIN
int main(int argc,char *argv[]) {
return start_main(argc,argv);
}
#endif //DISABLE_MAIN
| [
"771730766@qq.com"
] | 771730766@qq.com |
47a68a4db4f233387a1eef0bb8ccc5b90c5cf162 | 55bff01fd3acdb05c78ca18141e1862287cb6cd9 | /tuple/include/bounds_on_ratios_in_sampled_sets.hpp | 39accd54a7b8137d9ff6d6d8f460c521673ce494 | [
"Apache-2.0",
"MIT",
"BSL-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | chenqin/datasketches-cpp | 448b9f2958a45fbda4f3b434f9c70b13cc4abf0e | 9fd6f0fe90f4566f42daebc2d2323ce09f5f7c55 | refs/heads/master | 2023-02-10T20:17:49.417137 | 2021-01-06T01:51:06 | 2021-01-06T01:51:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,945 | hpp | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef BOUNDS_ON_RATIOS_IN_SAMPLED_SETS_HPP_
#define BOUNDS_ON_RATIOS_IN_SAMPLED_SETS_HPP_
#include <cstdint>
#include <bounds_binomial_proportions.hpp>
namespace datasketches {
/**
* This class is used to compute the bounds on the estimate of the ratio <i>|B| / |A|</i>, where:
* <ul>
* <li><i>|A|</i> is the unknown size of a set <i>A</i> of unique identifiers.</li>
* <li><i>|B|</i> is the unknown size of a subset <i>B</i> of <i>A</i>.</li>
* <li><i>a</i> = <i>|S<sub>A</sub>|</i> is the observed size of a sample of <i>A</i>
* that was obtained by Bernoulli sampling with a known inclusion probability <i>f</i>.</li>
* <li><i>b</i> = <i>|S<sub>A</sub> ∩ B|</i> is the observed size of a subset
* of <i>S<sub>A</sub></i>.</li>
* </ul>
*/
class bounds_on_ratios_in_sampled_sets {
public:
static constexpr double NUM_STD_DEVS = 2.0;
/**
* Return the approximate lower bound based on a 95% confidence interval
* @param a See class javadoc
* @param b See class javadoc
* @param f the inclusion probability used to produce the set with size <i>a</i> and should
* generally be less than 0.5. Above this value, the results not be reliable.
* When <i>f</i> = 1.0 this returns the estimate.
* @return the approximate upper bound
*/
static double lower_bound_for_b_over_a(uint64_t a, uint64_t b, double f) {
check_inputs(a, b, f);
if (a == 0) return 0.0;
if (f == 1.0) return static_cast<double>(b) / static_cast<double>(a);
return bounds_binomial_proportions::approximate_lower_bound_on_p(a, b, NUM_STD_DEVS * hacky_adjuster(f));
}
/**
* Return the approximate upper bound based on a 95% confidence interval
* @param a See class javadoc
* @param b See class javadoc
* @param f the inclusion probability used to produce the set with size <i>a</i>.
* @return the approximate lower bound
*/
static double upper_bound_for_b_over_a(uint64_t a, uint64_t b, double f) {
check_inputs(a, b, f);
if (a == 0) return 1.0;
if (f == 1.0) return static_cast<double>(b) / static_cast<double>(a);
return bounds_binomial_proportions::approximate_upper_bound_on_p(a, b, NUM_STD_DEVS * hacky_adjuster(f));
}
/**
* Return the estimate of b over a
* @param a See class javadoc
* @param b See class javadoc
* @return the estimate of b over a
*/
static double get_estimate_of_b_over_a(uint64_t a, uint64_t b) {
check_inputs(a, b, 0.3);
if (a == 0) return 0.5;
return static_cast<double>(b) / static_cast<double>(a);
}
/**
* Return the estimate of A. See class javadoc.
* @param a See class javadoc
* @param f the inclusion probability used to produce the set with size <i>a</i>.
* @return the approximate lower bound
*/
static double estimate_of_a(uint64_t a, uint64_t f) {
check_inputs(a, 1, f);
return a / f;
}
/**
* Return the estimate of B. See class javadoc.
* @param b See class javadoc
* @param f the inclusion probability used to produce the set with size <i>b</i>.
* @return the approximate lower bound
*/
static double estimate_of_b(uint64_t b, double f) {
check_inputs(b + 1, b, f);
return b / f;
}
private:
/**
* This hackyAdjuster is tightly coupled with the width of the confidence interval normally
* specified with number of standard deviations. To simplify this interface the number of
* standard deviations has been fixed to 2.0, which corresponds to a confidence interval of
* 95%.
* @param f the inclusion probability used to produce the set with size <i>a</i>.
* @return the hacky Adjuster
*/
static double hacky_adjuster(double f) {
const double tmp = sqrt(1.0 - f);
return (f <= 0.5) ? tmp : tmp + (0.01 * (f - 0.5));
}
static void check_inputs(uint64_t a, uint64_t b, double f) {
if (a < b) {
throw std::invalid_argument("a must be >= b: a = " + std::to_string(a) + ", b = " + std::to_string(b));
}
if ((f > 1.0) || (f <= 0.0)) {
throw std::invalid_argument("Required: ((f <= 1.0) && (f > 0.0)): " + std::to_string(f));
}
}
};
} /* namespace datasketches */
# endif
| [
"AlexanderSaydakov@users.noreply.github.com"
] | AlexanderSaydakov@users.noreply.github.com |
9063e96ed1ea70cd6dc11306df99d61b4d3bee8d | 0387ffc70f45fa9b5c3b599290ee3523f1c8867c | /src/coding_interview/src/ch_3/spiral_matrix.cpp | 5fc50f2d1184556126035200e0770d4b7476229a | [] | no_license | rabbicse/learn-coding | bbd00d7021819617f6ae3a4033dc2c3ccdcca110 | c616bc08c969f7c06594b1d1aae3b9f03e69fead | refs/heads/master | 2023-02-11T12:52:49.289541 | 2021-01-06T02:44:17 | 2021-01-06T02:44:17 | 295,914,630 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,084 | cpp | #include <iostream>
using namespace std;
void spiral_mat(int **mat, int row, int column)
{
cout << "Original matrix: " << endl;
for (int i = 0; i < row; i++)
{
for (int j = 0; j < column; j++)
{
cout << mat[i][j] << " ";
}
cout << endl;
}
cout << "operations: " << endl;
int direction = 0;
int left = 0, right = column - 1, bottom = row - 1, top = 0;
int spiralMatrix[row * column];
int index = 0;
while (true)
{
cout << "direction --> " << direction << endl;
/* traverse from left to right */
if (direction == 0)
{
for (int i = left; i < right + 1; i++)
{
spiralMatrix[index++] = mat[top][i];
}
++top;
}
/* traverse from top to bottom */
else if (direction == 1)
{
for (int i = top; i < bottom + 1; i++)
{
spiralMatrix[index++] = mat[i][right];
}
--right;
}
/* traverse from right to left */
else if (direction == 2)
{
for (int i = right; i >= left; i--)
{
spiralMatrix[index++] = mat[bottom][i];
}
--bottom;
}
/* traverse from bottom to top */
else
{
// cout << "left: " << left << endl;
for (int i = bottom; i >= top; i--)
{
spiralMatrix[index++] = mat[i][left];
}
++left;
}
if (left > right || top > bottom)
{
break;
}
direction = (direction + 1) % 4;
}
cout << "Spiral Array: ";
for (int i = 0; i < (row * column); i++)
{
cout << spiralMatrix[i] << " ";
}
cout << endl;
}
int main()
{
int **m = new int *[4] {
new int[4]{1, 2, 3, 4},
new int[4]{5, 6, 7, 8},
new int[4]{9, 10, 11, 12},
new int[4]{13, 14, 15, 16},
};
spiral_mat(m, 4, 4);
} | [
"rabbi.se@gmail.com"
] | rabbi.se@gmail.com |
a37420b9572e7823c0eb2b836bb26a68e92b4d79 | 4cb0f2cfb9ec3ec8c851f83ff3ea73ca5a62aa70 | /democodebase/pt/quaternion.cpp | c665296f146a85de63d1fba1b8d448bf25f1fb84 | [] | no_license | Codarki/Pyrotech_2016 | 99733bb543621d755dc0451cee86e3988021a1e2 | 5e7a71b9ec751061285f3f784e861ac8f2726ee1 | refs/heads/main | 2023-05-30T08:11:30.626406 | 2021-06-24T23:13:53 | 2021-06-24T23:13:53 | 380,065,207 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 59 | cpp | #include "quaternion.h"
namespace pt {
} // namespace pt
| [
"pietila.kimmo@gmail.com"
] | pietila.kimmo@gmail.com |
745a12a83603736218ced7268d716dfb2310c8b5 | f09774159c0a5791af0bab7550e7d877d6376ac8 | /src/states/State.hpp | 0cb741f8b1e3b1cd1808e52a4f2fcd533403c7be | [] | no_license | WathisLove/PokemonAE | df2dfca499ba14de3c782f5f007af9c5bb3101c2 | 344d0ae38522f5b4aa7a56a2dc8fac83f00faf4d | refs/heads/master | 2023-04-21T00:33:44.450187 | 2021-05-07T13:57:43 | 2021-05-07T13:57:43 | 364,509,897 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,211 | hpp | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: State.hpp
* Author: Redbuzard
*
* Created on 4 juillet 2018, 10:40
*/
#ifndef STATE_HPP
#define STATE_HPP
#include <SFML/Graphics.hpp>
#include "StateStack.hpp"
#include "GameEvent.hpp"
class State {
public:
State(StateStack* stack);
virtual ~State();
/**
* Draw the state
*/
virtual void draw() = 0;
/**
* Update the State
* @param dt time elapsed since last frame
* @return false if the next State in the stack must not be updated
*/
virtual bool update(float dt) = 0;
/**
* A late update that occur after the update of the stages
* It concerns all the stages and is mostly a utility method
* @param dt time elapsed since last frame in seconds
*/
virtual void lateUpdate(float dt);
/**
* @return true if the State must be popped
*/
virtual bool isCompleted() const;
/**
* Act on the stack when the goal of the state is achieved
*/
virtual void actionOnCompletion() = 0;
/**
* Manage an incoming Event
* @return false if the next State must not handle Events
*/
virtual bool handleEvent(sf::Event& event);
/**
* Manage an incoming GameEvent
* @param event a const reference to the GameEvent
*/
virtual void handleGameEvent(const GameEvent& event);
/**
* @return the id of the state
*/
virtual StateID getID() const;
/**
* Check if the State waits a special action before closing
* @return ture if the State waits before closing
*/
bool waitBeforeClosing();
/**
* Set if the state must wait before closing
* @param wait true if the state must wait before closing
*/
void waitBeforeClosing(bool wait);
/**
* Set the state to be a secondary state or not
* @param val true if the state is a secondary state (false otherwise)
*/
virtual void setAsSecondaryState(bool val = true);
/**
* Check if the state is a secondary one
* @return true if the state is a secondary state
*/
bool isSecondaryState();
/**
* Set the State to be shown or not
* @param shown true if the state must be shown
*/
void show(bool shown);
/**
* Set the State to let pass events to lower states
* @param letPass true if the State must let pass events
*/
void letEventPass(bool letPass);
/**
* Set the state to ignore event management
* @param ignore true if the state must ignore events
*/
void ignoreEvents(bool ignore);
protected:
//=================// Private methods //==================//
void requestStackPush(StateID id);
void requestStackPop();
void requestStackClear();
/**
* Get the key pressed in a game event
* @param event a reference to the game event
* @return the key as a Keyboad Key
*/
sf::Keyboard::Key getKeyPressed(sf::Event& event);
/**
* Get the RenderWindow from the stack context
* @return a reference to the render window
*/
sf::RenderWindow& getRenderWindow();
//=================// Attributes //==================//
// A pointer to the stack
StateStack* m_stack;
// A boolean that stores wether the state is completed or not
bool m_isCompleted;
// ID of the State
StateID m_id;
// A boolean that stores if a state wait before beeing popped
bool m_waitBeforeClosing;
// A boolean that stores if the state is a secondary one or not
bool m_isSecondaryState;
// A boolean to know if the state is shown or not
bool m_isShown;
// A boolean to know if the state let pass events to lower states or not
bool m_letEventsPass;
// A boolean to know if the state should ignore events
bool m_ignoreEvents;
};
#endif /* STATE_HPP */
| [
"mrredbuzard@gmail.com"
] | mrredbuzard@gmail.com |
a1081d6a568e0af69f0af3320c0979b0811c88a5 | fbd981d8ba94411ef5183f1b2f4a8b58740c36e4 | /dojo2/sistema_facturacion.h | 995be2eea55fa4961f3d99f0fbf7f45daa4f3632 | [] | no_license | bjjdiaz209/C- | 78a31ff17425569224cfeef432ca474d99c0af79 | 3fd21408d9beb063fc88e0d1772e8b754952a71e | refs/heads/master | 2020-04-07T06:40:41.156449 | 2019-02-05T13:27:55 | 2019-02-05T13:27:55 | 158,146,205 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 480 | h | #include <iostream>
#include "array_list.h"
#include "m_string.h"
#pragma once
using namespace std;
class factura;
class sistema_facturacion
{
array_list facturas;
array_list productos;
public:
void agregar_producto(const m_string &nombre, const m_string &marca, const m_string &codigo, size_t cantidad, double precio);
factura& crear_factura(const m_string &nombre, const m_string &nit = "0");
array_list obtener_facturas_de_hoy() const;
}; | [
"quintanajuancito34@gmail.com"
] | quintanajuancito34@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.