blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
201
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
7
100
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
260 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
11.4k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
80 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
8
9.86M
extension
stringclasses
52 values
content
stringlengths
8
9.86M
authors
listlengths
1
1
author
stringlengths
0
119
24894cfb87229f155e6fb20ac5c06d39f81834c5
889cab2ec483b8dd8bd4ac4a457b1034fec157ab
/AniTool/Reference/Headers/ParticleBuffer.h
58be12a68c7ce351743e52715952c1435ebded73
[]
no_license
wunjang/AniTool
550bf9adfcaee06c5c77d7a4a9544be2cc692e87
f365e1b40f5b5b7a904e04900fd002d36bdba464
refs/heads/master
2022-12-08T07:23:06.979280
2020-08-31T05:29:24
2020-08-31T05:29:24
287,473,679
0
0
null
null
null
null
UHC
C++
false
false
853
h
#pragma once #include "VIBuffer.h" BEGIN(ENGINE) class ENGINE_DLL CParticleBuffer : public CVIBuffer { private: explicit CParticleBuffer(LPDIRECT3DDEVICE9 pGraphicDev); explicit CParticleBuffer(const CParticleBuffer& rhs); virtual ~CParticleBuffer(void); public: virtual HRESULT Ready_Component_Prototype(void); virtual void Render_Instance_Buffer(DWORD dwRenderCount); void UpdateInstance(void * pData, _uint iSize); private: LPDIRECT3DVERTEXBUFFER9 m_pVBTransform; // 기존 정점 정보를 복제하기 위한 VB LPDIRECT3DVERTEXDECLARATION9 m_pDeclaration; // Element를 보관하고 관리하는 컴객체(버텍스 쉐이더로 입력되는 정점의 데어트 정보를 보관) public: static CParticleBuffer* Create(LPDIRECT3DDEVICE9 pGraphicDev); virtual CComponent* Clone(void * pArg); virtual void Free(void); }; END
[ "ahfrhgkwl@naver.com" ]
ahfrhgkwl@naver.com
30e0b47cdb0970f4843794a41826ee02610cbdf2
67e5d8bdbbeb0d093f21d48f0e6b724339594a8e
/rutil/ssl/OpenSSLInit.cxx
32ea222fb9e6861695f2cba2826f547073972652
[ "BSD-3-Clause", "VSL-1.0", "BSD-2-Clause" ]
permissive
heibao111728/resiprocate-1.8.14
7e5e46a04bfef72e95852a598774cb8d5aa0d699
f8ddf70a6b7620fb535baec04901a4912172d4ed
refs/heads/master
2020-04-16T01:48:14.942715
2019-11-09T14:29:12
2019-11-09T14:29:12
145,299,918
1
0
null
null
null
null
UTF-8
C++
false
false
3,146
cxx
#if defined(HAVE_CONFIG_H) #include "config.h" #endif #include "rutil/Mutex.hxx" #include "rutil/Lock.hxx" #include "rutil/Logger.hxx" #ifdef USE_SSL #include "rutil/ssl/OpenSSLInit.hxx" #include <openssl/e_os2.h> #include <openssl/rand.h> #include <openssl/err.h> #include <openssl/crypto.h> #include <openssl/ssl.h> #define OPENSSL_THREAD_DEFINES #include <openssl/opensslconf.h> #define RESIPROCATE_SUBSYSTEM Subsystem::SIP using namespace resip; using namespace std; #include <iostream> static bool invokeOpenSSLInit = OpenSSLInit::init(); //.dcm. - only in hxx volatile bool OpenSSLInit::mInitialized = false; Mutex* OpenSSLInit::mMutexes; bool OpenSSLInit::init() { static OpenSSLInit instance; return true; } OpenSSLInit::OpenSSLInit() { int locks = CRYPTO_num_locks(); mMutexes = new Mutex[locks]; CRYPTO_set_locking_callback(::resip_OpenSSLInit_lockingFunction); #if !defined(WIN32) #if defined(_POSIX_THREADS) CRYPTO_set_id_callback(::resip_OpenSSLInit_threadIdFunction); #else #error Cannot set OpenSSL up to be threadsafe! #endif #endif #if 0 //?dcm? -- not used by OpenSSL yet? CRYPTO_set_dynlock_create_callback(::resip_OpenSSLInit_dynCreateFunction); CRYPTO_set_dynlock_destroy_callback(::resip_OpenSSLInit_dynDestroyFunction); CRYPTO_set_dynlock_lock_callback(::resip_OpenSSLInit_dynLockFunction); #endif CRYPTO_malloc_debug_init(); CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL); CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); SSL_library_init(); SSL_load_error_strings(); OpenSSL_add_all_algorithms(); assert(EVP_des_ede3_cbc()); mInitialized = true; } OpenSSLInit::~OpenSSLInit() { mInitialized = false; ERR_free_strings();// Clean up data allocated during SSL_load_error_strings ERR_remove_state(0);// free thread error queue CRYPTO_cleanup_all_ex_data(); EVP_cleanup();// Clean up data allocated during OpenSSL_add_all_algorithms //!dcm! We know we have a leak; see BaseSecurity::~BaseSecurity for //!details. // CRYPTO_mem_leaks_fp(stderr); delete [] mMutexes; } void resip_OpenSSLInit_lockingFunction(int mode, int n, const char* file, int line) { if(!resip::OpenSSLInit::mInitialized) return; if (mode & CRYPTO_LOCK) { OpenSSLInit::mMutexes[n].lock(); } else { OpenSSLInit::mMutexes[n].unlock(); } } unsigned long resip_OpenSSLInit_threadIdFunction() { #if defined(WIN32) assert(0); #else #ifndef _POSIX_THREADS assert(0); #endif unsigned long ret; ret= (unsigned long)pthread_self(); return ret; #endif return 0; } CRYPTO_dynlock_value* resip_OpenSSLInit_dynCreateFunction(char* file, int line) { CRYPTO_dynlock_value* dynLock = new CRYPTO_dynlock_value; dynLock->mutex = new Mutex; return dynLock; } void resip_OpenSSLInit_dynDestroyFunction(CRYPTO_dynlock_value* dynlock, const char* file, int line) { delete dynlock->mutex; delete dynlock; } void resip_OpenSSLInit_dynLockFunction(int mode, struct CRYPTO_dynlock_value* dynlock, const char* file, int line) { if (mode & CRYPTO_LOCK) { dynlock->mutex->lock(); } else { dynlock->mutex->unlock(); } } #endif
[ "heibao111728@126.com" ]
heibao111728@126.com
d8e2f7d3ddab10ca3c1a6f7027606a9bd30d7a02
7ca64d793a916e9f73a3f3bfb808445a5347d885
/modbus/mainwindow.cpp
87e722e354d4f0aa48ab903fed03417e3b0a6520
[]
no_license
zhaoyu811/Modbus
f0b4abd6cf2a7252b3ca75c10ce600eaaf6fde0f
4d0e8dca50de6ebe0894babfc409421df4a5e49a
refs/heads/master
2023-04-20T22:42:40.823197
2019-07-26T02:50:44
2019-07-26T02:50:44
366,989,993
1
0
null
null
null
null
UTF-8
C++
false
false
5,011
cpp
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QDebug> #include <QMessageBox> #include <QDateTime> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->centralWidget->setLayout(ui->hL_MainLayout); s = new settings(this); this->setTabOrder(ui->lE_Slave_W, ui->lE_Registor_W); this->setTabOrder(ui->lE_Registor_W, ui->lE_Data_W); this->setTabOrder(ui->lE_Data_W, ui->pB_Send_W); this->setTabOrder(ui->pB_Send_W, ui->lE_Slave_R); this->setTabOrder(ui->lE_Slave_R, ui->lE_Registor_R); this->setTabOrder(ui->lE_Registor_R, ui->lE_Data_R); this->setTabOrder(ui->lE_Data_R, ui->pB_Send_R); connect(ui->action, &QAction::triggered, this, &MainWindow::SettingsUI_Show); } MainWindow::~MainWindow() { delete ui; } void MainWindow::SettingsUI_Show(void) { s->show(); } void MainWindow::on_pB_Send_W_clicked() { qint64 start = QDateTime::currentDateTime().toMSecsSinceEpoch(); ctx = modbus_new_rtu(s->serial.name, s->serial.baudRate, s->serial.parity,\ s->serial.dataBits, s->serial.stopBits); QStringList dataList; dataList = ui->lE_Data_W->text().split(" "); unsigned short *data = new unsigned short[dataList.length()]; for(int i=0; i<dataList.length(); i++) { data[i] = dataList.at(i).toUShort(); } if (modbus_connect(ctx) == -1) { qint64 end = QDateTime::currentDateTime().toMSecsSinceEpoch(); QMessageBox::information(this,tr("打开串口失败"),tr("打开串口失败, 耗时%1ms").arg(end-start),QMessageBox::Yes); modbus_free(ctx); return; } modbus_set_slave(ctx, ui->lE_Slave_W->text().toInt()); if(dataList.length()==1) { if (modbus_write_register(ctx, ui->lE_Registor_W->text().toInt(), ui->lE_Data_W->text().toInt()) == 1) { qint64 end = QDateTime::currentDateTime().toMSecsSinceEpoch(); modbus_close(ctx); modbus_free(ctx); QMessageBox::information(this,tr("写入成功"),tr("写入成功, 耗时%1ms").arg(end-start),QMessageBox::Yes); } else { qint64 end = QDateTime::currentDateTime().toMSecsSinceEpoch(); modbus_close(ctx); modbus_free(ctx); QMessageBox::information(this,tr("写入失败"),tr("写入失败, 耗时%1ms").arg(end-start),QMessageBox::Yes); } } else if(dataList.length()>1) { if(modbus_write_registers(ctx, ui->lE_Registor_W->text().toInt(), dataList.length(), data) == dataList.length()) { qint64 end = QDateTime::currentDateTime().toMSecsSinceEpoch(); modbus_close(ctx); modbus_free(ctx); QMessageBox::information(this,tr("写入成功"),tr("写入成功, 耗时%1ms").arg(end-start),QMessageBox::Yes); } else { qint64 end = QDateTime::currentDateTime().toMSecsSinceEpoch(); modbus_close(ctx); modbus_free(ctx); QMessageBox::information(this,tr("写入失败"),tr("写入失败, 耗时%1ms").arg(end-start),QMessageBox::Yes); } } } void MainWindow::on_pB_Send_R_clicked() { uint16_t dest[100] = {0}; qDebug()<<s->serial.name; qint64 start = QDateTime::currentDateTime().toMSecsSinceEpoch(); ctx = modbus_new_rtu(s->serial.name, s->serial.baudRate, s->serial.parity,\ s->serial.dataBits, s->serial.stopBits); if (modbus_connect(ctx) == -1) { qint64 end = QDateTime::currentDateTime().toMSecsSinceEpoch(); QMessageBox::information(this,tr("打开串口失败"),tr("打开串口失败, 耗时%1ms").arg(end-start),QMessageBox::Yes); modbus_free(ctx); return; } modbus_set_slave(ctx, ui->lE_Slave_R->text().toInt()); if (modbus_read_input_registers(ctx, ui->lE_Registor_R->text().toInt(), ui->lE_Data_R->text().toInt(), dest)\ == ui->lE_Data_R->text().toInt()) { qint64 end = QDateTime::currentDateTime().toMSecsSinceEpoch(); QString ret_data = tr("数据:"); for(int i=0; i<ui->lE_Data_R->text().toInt(); i++) { ret_data += QString("%1 ").arg(dest[i]); } modbus_close(ctx); modbus_free(ctx); QMessageBox::information(this,tr("读取成功"),tr("%1, 耗时%2ms").arg(ret_data).arg(end-start),QMessageBox::Yes); qDebug()<<"从机地址"<<ui->lE_Slave_R->text().toInt()\ <<"寄存器地址"<<ui->lE_Registor_R->text().toInt()\ <<"个数"<<ui->lE_Data_R->text().toInt()\ <<ret_data; } else { qint64 end = QDateTime::currentDateTime().toMSecsSinceEpoch(); modbus_close(ctx); modbus_free(ctx); QMessageBox::information(this,tr("读取失败"),tr("读取失败, 耗时%1ms").arg(end-start),QMessageBox::Yes); } }
[ "860150543@qq.com" ]
860150543@qq.com
b95e146766c2b8e9439c606931c97cba77201352
4c870578972f8df9235ad09cff2393c9a4ebbf05
/CheetSheets/Beginner Problems/Pattern/Q7_LCM.cpp
359887bfc9ff87ff103ea5bcf3fba711e4989081
[]
no_license
AshishJha30/Practise_Everyday
93295589ae7430b6604ddb8ba94f519ddf341c68
3b0c0a1095609a71532c1f03df992645f5875e98
refs/heads/main
2023-08-07T09:07:30.217358
2021-09-23T16:16:09
2021-09-23T16:16:09
405,442,421
1
0
null
2021-09-12T17:43:22
2021-09-11T17:33:42
null
UTF-8
C++
false
false
407
cpp
#include<iostream> using namespace std; int main(){ int n1, n2, max; cout << "Enter two numbers whose LCM you want to take: "; cin >> n1 >> n2; max = (n1 > n2)? n1:n2; do { if (max % n1 == 0 && max % n2 == 0) { cout << "LCM = " << max; break; } else ++max; } while(true); return 0; }
[ "noreply@github.com" ]
noreply@github.com
a64db30a2a76c71b2cea19b41fa62104f159de3c
8c2bfccddf1d8606db9f91539959cf601664ece8
/src/raytracer/intersections/IIntersect.h
b7e9ab26f2c5ec9fd73b118d19048490f578b73d
[ "Unlicense" ]
permissive
extramask93/RayTracer
ca1cb20ac0fcba5123ad478b315804b2f7ad6bab
ba7f46fb212971e47b296991a7a7e981fef50dda
refs/heads/master
2022-12-02T17:38:59.266307
2020-08-19T12:44:25
2020-08-19T12:44:25
266,415,298
0
0
null
null
null
null
UTF-8
C++
false
false
571
h
// // Created by damian on 09.07.2020. // #ifndef MYPROJECT_IINTERSECT_H #define MYPROJECT_IINTERSECT_H #include <ray/Ray.h> namespace rt { class Intersections; class IIntersect { public: virtual Intersections intersect(const Ray &ray) const = 0; virtual ~IIntersect() = default; IIntersect() = default; IIntersect(const IIntersect &copyFrom) = default; IIntersect(IIntersect &&moveFrom) = default; IIntersect& operator=(const IIntersect &assignFrom) = default; IIntersect& operator=(IIntersect &&moveFrom) = default; }; } #endif//MYPROJECT_IINTERSECT_H
[ "jozwiak.damian02@gmail.com" ]
jozwiak.damian02@gmail.com
f0c31285070468c91673415c1e10490121ef92d4
98a8f84c5df608937f07e95cdd7b05d1f5b636cd
/src/cam_radar_fusion.cpp
ad1af201da3bd1d63d15bce7f20e5cb1ddd6d825
[]
no_license
camera-radar/cam_radar_fusion
81a09d398c243841577d87209d6c1a8943702c33
a2f94f19e5decca747504d12d4f77613cd269de9
refs/heads/main
2023-03-29T15:58:44.530440
2021-04-04T15:48:17
2021-04-04T15:48:17
488,059,951
0
1
null
2022-05-03T02:55:23
2022-05-03T02:55:22
null
UTF-8
C++
false
false
6,387
cpp
/* ******************** * v1.0: amc-nu (braca51e@gmail.com) * * cam_radar_fusion.cpp * * */ #include "cam_radar_fusion/cam_radar_fusion.h" pcl::PointXYZ CamRadarFusionApp::TransformPoint(const pcl::PointXYZ &in_point, const tf::StampedTransform &in_transform) { tf::Vector3 tf_point(in_point.x, in_point.y, in_point.z); tf::Vector3 tf_point_t = in_transform * tf_point; return pcl::PointXYZ(tf_point_t.x(), tf_point_t.y(), tf_point_t.z()); } void CamRadarFusionApp::FusionCallback(const sensor_msgs::CompressedImageConstPtr &in_image_msg , const sensor_msgs::PointCloud2ConstPtr &in_cloud_msg) { if (!cam_radar_tf_ok_) { cam_radar_tf_ = FindTransform(in_image_msg->header.frame_id, in_cloud_msg->header.frame_id); } if (!camera_info_ok_ || !cam_radar_tf_ok_) { ROS_INFO("[%s] Waiting for Camera-Radar TF and Intrinsics to be available.", __APP_NAME__); return; } //ROS_INFO("[%s] Transforming point starts!", __APP_NAME__); // Get image cv_bridge::CvImagePtr cv_image = cv_bridge::toCvCopy(in_image_msg, sensor_msgs::image_encodings::BGR8); image_size_.height = cv_image->image.rows; image_size_.width = cv_image->image.cols; pcl::PointCloud<pcl::PointXYZ>::Ptr in_cloud(new pcl::PointCloud<pcl::PointXYZ>); pcl::fromROSMsg(*in_cloud_msg, *in_cloud); //std::vector<pcl::PointXYZ> cam_cloud(in_cloud->points.size()); pcl::PointXYZ transformed_point; for (size_t i = 0; i < in_cloud->points.size(); i++) { //ROS_INFO("[%s] x: %.4f y: %.4f z: %.4f", __APP_NAME__, in_cloud->points[i].x, in_cloud->points[i].y, in_cloud->points[i].z); if (in_cloud->points[i].x > 0) { transformed_point = TransformPoint(in_cloud->points[i], cam_radar_tf_); cv::Point2d xy_point = cam_model_.project3dToPixel(cv::Point3d(transformed_point.x, transformed_point.y, transformed_point.z)); if ((xy_point.x >= 0) && (xy_point.x < image_size_.width) && (xy_point.y >= 0) && (xy_point.y < image_size_.height) //&& transformed_point.z > 0 ) { // draw circle cv::circle(cv_image->image, cv::Point(xy_point.x, xy_point.y), 3, cv::Scalar(0, 255, 0), 5); std::ostringstream ss; //sprintf(buffer, "%d plus %d is %d", a, b, a+b); ss << std::setprecision(2) << transformed_point.z << "m"; cv::putText(cv_image->image, ss.str(), cv::Point(xy_point.x, xy_point.y-2), cv::FONT_HERSHEY_DUPLEX, 0.9, cv::Scalar(0,0,255), 1, false); } } } sensor_msgs::ImagePtr msg = cv_bridge::CvImage(std_msgs::Header(), "bgr8", cv_image->image).toImageMsg(); publisher_fused_image_.publish(msg); } void CamRadarFusionApp::IntrinsicsCallback(const sensor_msgs::CameraInfo &in_message) { image_size_.height = in_message.height; image_size_.width = in_message.width; cam_model_.fromCameraInfo(in_message); intrinsics_subscriber_.shutdown(); camera_info_ok_ = true; ROS_INFO("[%s] CameraIntrinsics obtained.", __APP_NAME__); } tf::StampedTransform CamRadarFusionApp::FindTransform(const std::string &in_target_frame, const std::string &in_source_frame) { tf::StampedTransform transform; cam_radar_tf_ok_ = false; try { transform_listener_->lookupTransform(in_target_frame, in_source_frame, ros::Time(0), transform); cam_radar_tf_ok_ = true; ROS_INFO("[%s] Camera-Radar TF obtained", __APP_NAME__); } catch (tf::TransformException ex) { ROS_ERROR("[%s] %s", __APP_NAME__, ex.what()); } return transform; } void CamRadarFusionApp::InitializeRosIo(ros::NodeHandle &in_private_handle) { //get params std::string points_src, image_src, camera_info_src, fused_topic_str = "/points_fused"; std::string name_space_str = ros::this_node::getNamespace(); ROS_INFO("[%s] This node requires: Registered TF(Camera-Radar), CameraInfo, Image, and PointCloud.", __APP_NAME__); in_private_handle.param<std::string>("points_src", points_src, "/points_raw"); ROS_INFO("[%s] points_src: %s", __APP_NAME__, points_src.c_str()); in_private_handle.param<std::string>("image_src", image_src, "/image_rectified"); ROS_INFO("[%s] image_src: %s", __APP_NAME__, image_src.c_str()); // Keep frame id to register to center clouds image_frame_id_ = image_src; in_private_handle.param<std::string>("camera_info_src", camera_info_src, "/camera_info"); ROS_INFO("[%s] camera_info_src: %s", __APP_NAME__, camera_info_src.c_str()); if (name_space_str != "/") { if (name_space_str.substr(0, 2) == "//") { name_space_str.erase(name_space_str.begin()); } image_src = name_space_str + image_src; fused_topic_str = name_space_str + fused_topic_str; camera_info_src = name_space_str + camera_info_src; } //generate subscribers and sychronizers ROS_INFO("[%s] Subscribing to... %s", __APP_NAME__, camera_info_src.c_str()); intrinsics_subscriber_ = in_private_handle.subscribe(camera_info_src, 1, &CamRadarFusionApp::IntrinsicsCallback, this); ROS_INFO("[%s] Subscribing to... %s", __APP_NAME__, points_src.c_str()); cloud_subscriber_.subscribe(in_private_handle, points_src.c_str(), 1); ROS_INFO("[%s] Subscribing to... %s", __APP_NAME__, image_src.c_str()); image_subscriber_.subscribe(in_private_handle, image_src.c_str(), 1); ROS_INFO("[%s] Subscribing to %s and %s to approximate time synchronizer.", __APP_NAME__, image_src.c_str(), points_src.c_str()); cloud_synchronizer_.reset(new Cloud_Sync(SyncPolicyT(10), image_subscriber_, cloud_subscriber_)); cloud_synchronizer_->registerCallback(boost::bind(&CamRadarFusionApp::FusionCallback, this, _1, _2)); image_transport::ImageTransport image_transport_(in_private_handle); publisher_fused_image_ = image_transport_.advertise(fused_topic_str, 1); ROS_INFO("[%s] Publishing fused pointcloud in %s", __APP_NAME__, fused_topic_str.c_str()); } void CamRadarFusionApp::Run() { ros::NodeHandle private_node_handle("~"); tf::TransformListener transform_listener; transform_listener_ = &transform_listener; InitializeRosIo(private_node_handle); ROS_INFO("[%s] Ready. Waiting for data...", __APP_NAME__); ros::spin(); ROS_INFO("[%s] END", __APP_NAME__); } CamRadarFusionApp::CamRadarFusionApp() { cam_radar_tf_ok_ = false; camera_info_ok_ = false; image_frame_id_ = ""; }
[ "braca51e@gmail.com" ]
braca51e@gmail.com
143f2dc4671143d0e61d182aeb4b5685fc830eb0
ab081da353991a435f2db8b030cb8f909393eb5d
/web_server/src/myserver/master.cpp
afd6fff26cdf7a1159ab16c9d443847f82cb54a8
[ "MIT" ]
permissive
hovnatan/Parallel_Optimization
8334527c431b0e5e6e715d3a519218c182e97381
bef1091802b8c514eab5ca9588909df1dfc4747d
refs/heads/main
2021-06-19T17:32:52.248064
2017-07-17T00:47:02
2017-07-17T00:47:02
null
0
0
null
null
null
null
UTF-8
C++
false
false
25,434
cpp
/** * @file master.cpp * @brief This file contains the implementation of master(or load balancer) node * @author Qiaoyu Deng(qdeng) * @bug No know bugs */ #include <glog/logging.h> #include <stdio.h> #include <stdlib.h> #include <string> #include <map> #include <sstream> #include <stdlib.h> /* user defined include */ #include "server/messages.h" #include "server/master.h" #include "server/worker.h" #include "tools/work_queue.h" #include "request_type_def.h" #include "lru_cache.h" /* for cahe */ #include "master.h" /* used for print loging message such as worker status */ // #define LOG_P #ifdef LOG_P #define LOG_PRINT printf #else #define LOG_PRINT(...) #endif static struct Master_state { // The mstate struct collects all the master node state into one // place. You do not need to preserve any of the fields below, they // exist only to implement the basic functionality of the starter // code. bool server_ready; int next_request_tag; /* used for mapping request to client */ my_worker_info_t my_worker[MAX_WORKERS]; int max_num_workers; int num_workers_run; /* the number of current worker that actually running */ int num_workers_recv; /* the number of workers that can receive new request, this one is less than num_workers_run */ int num_workers_plan; /* the number of workers that will be running, this one is used to indicate all worker has been launched */ int idx_array[MAX_WORKERS]; /* array store the id of each worker */ std::map<int, client_request_item_t> response_client_map; std::map<int, comppri_item_t> comppri_map; /* map from request tag to compareprimes struct */ int num_cpu_intensive; int num_projectidea; int time_since_last_new; int if_booted; /* indicate whether the server has booted */ int if_scaling_out; /* indicate whether server has finished lanched new worker */ } mstate; lru_cache<std::string, Response_msg> master_cache(MAX_CACHE_SIZE); /** * This function is called when start the program. * @param max_workers the max number of workers that master can fire * @param tick_period handle_tick function is called for every tick_period s */ void master_node_init(int max_workers, int& tick_period) { tick_period = 1; mstate.max_num_workers = max_workers; mstate.next_request_tag = 0; mstate.time_since_last_new = 0; mstate.if_booted = 0; mstate.if_scaling_out = 0; /* initailize worker struct */ for (int i = 0; i < max_workers; i++) { mstate.my_worker[i].worker = NULL; for (int j = 0; j < NUM_TYPES; j++) mstate.my_worker[i].num_request_each_type[j] = 0; mstate.my_worker[i].sum_primes_countprimes = 0; mstate.my_worker[i].time_to_be_killed = -1; } mstate.num_workers_plan = INITIAL_WORKER_NUM; mstate.num_workers_run = 0; mstate.num_workers_recv = 0; mstate.server_ready = false; /* fire new worker */ std::string name_field = "worker_id"; for (int i = 0; i < mstate.num_workers_plan; i++) { int worker_idx = i; mstate.idx_array[i] = worker_idx; Request_msg req(worker_idx); std::string id = std::to_string(worker_idx); req.set_arg(name_field, id); request_new_worker_node(req); } } /** * Handle new fried worker, add it into scheduler. * @param worker_handle the new handler of newly created worker * @param tag tag that can be used to identify which worker is fired. */ void handle_new_worker_online(Worker_handle worker_handle, int tag) { mstate.num_workers_run++; mstate.num_workers_recv++; int idx = tag; mstate.my_worker[idx].worker = worker_handle; mstate.my_worker[idx].sum_primes_countprimes = 0; mstate.my_worker[idx].time_to_be_killed = -1; /* complete scale out */ if (mstate.if_booted && mstate.num_workers_run == mstate.num_workers_plan) { mstate.if_scaling_out = 0; } if (!mstate.if_booted && mstate.num_workers_run == mstate.num_workers_plan) { server_init_complete(); mstate.server_ready = true; mstate.if_booted = 1; } } /** * Handle client request when there are new request from client. * @param client_handle * @param client_req */ void handle_client_request(Client_handle client_handle, const Request_msg& client_req) { DLOG(INFO) << "Received request: " << client_req.get_request_string() << std::endl; Response_msg cached_resp; /* check whether cache hit. */ std::string cached_req_desp = client_req.get_request_string(); if (master_cache.exist(cached_req_desp) == true) { cached_resp = master_cache.get(cached_req_desp); send_client_response(client_handle, cached_resp); return; } /* End request handling */ if (client_req.get_arg("cmd") == "lastrequest") { Response_msg resp(0); resp.set_response("ack"); send_client_response(client_handle, resp); return; } if (client_req.get_arg("cmd").compare("compareprimes") == 0) return handle_comppri_req(client_handle, client_req); int request_tag = mstate.next_request_tag++; client_request_item_t client_request_item; client_request_item.client_handle = client_handle; client_request_item.client_req = client_req; int worker_idx = 0; if (client_req.get_arg("cmd").compare("418wisdom") == 0) { mstate.num_cpu_intensive++; worker_idx = get_next_worker_idx(WISDOM418); client_request_item.request_type = WISDOM418; } else if (client_req.get_arg("cmd").compare("projectidea") == 0) { mstate.num_projectidea++; worker_idx = get_next_worker_idx(PROJECTIDEA); client_request_item.request_type = PROJECTIDEA; } else if (client_req.get_arg("cmd").compare("tellmenow") == 0) { worker_idx = get_next_worker_idx(TELLMENOW); client_request_item.request_type = TELLMENOW; } else if (client_req.get_arg("cmd").compare("countprimes") == 0) { mstate.num_cpu_intensive++; /* n can indicate the running time of this request */ int n = atoi(client_req.get_arg("n").c_str()); worker_idx = get_next_worker_idx_cntpri(n); client_request_item.request_type = COUNTERPRIMES; client_request_item.counter_primes_n = n; } else { Response_msg resp(0); resp.set_response("Oh no! This type of request is not supported by server"); send_client_response(client_handle, resp); mstate.response_client_map.erase(request_tag); return; } client_request_item.worker_idx = worker_idx; mstate.response_client_map[request_tag] = client_request_item; Request_msg worker_req(request_tag, client_req); send_request_to_worker(mstate.my_worker[worker_idx].worker, worker_req); } /** * Handle compareprimes request by groupign all the result from countprimes * @param worker_handle * @param resp response from worker * @param client_request_item */ void handle_comppri_req(Client_handle &client_handle, const Request_msg &client_req) { int main_tag = mstate.next_request_tag++; int req_tag[COMPPRI_NUM]; client_request_item_t clt_req_item[COMPPRI_NUM]; comppri_item_t comppri_item; /* break into four request */ comppri_item.params[0] = atoi(client_req.get_arg("n1").c_str()); comppri_item.params[1] = atoi(client_req.get_arg("n2").c_str()); comppri_item.params[2] = atoi(client_req.get_arg("n3").c_str()); comppri_item.params[3] = atoi(client_req.get_arg("n4").c_str()); /* check whether those four requests are already cached into memory */ int if_cached[COMPPRI_NUM] = {0}; int cnt_cached[COMPPRI_NUM]; for (int i = 0; i < COMPPRI_NUM; i++) { Request_msg dummy_req(0); Response_msg dummy_resp(0); create_comppri_req(dummy_req, comppri_item.params[i]); std::string req_desp = dummy_req.get_request_string(); if (master_cache.exist(req_desp) == true) { if_cached[i] = 1; dummy_resp = master_cache.get(req_desp); cnt_cached[i] = atoi(dummy_resp.get_response().c_str()); } } /* for request that has not been cached, we create new struct for mapping */ for (int i = 0; i < COMPPRI_NUM; i++) { if (if_cached[i]) continue; req_tag[i] = mstate.next_request_tag++; clt_req_item[i].client_handle = client_handle; clt_req_item[i].client_req = client_req; clt_req_item[i].counter_primes_n = comppri_item.params[i]; clt_req_item[i].request_type = COMPAREPRIMES; clt_req_item[i].worker_idx = get_next_worker_idx_cntpri(comppri_item.params[i]); clt_req_item[i].idx_if_compppri = main_tag; } /* if check whether all four n's result is cached */ int if_all_cached = 1; for (int i = 0; i < COMPPRI_NUM; i++) { if (if_cached[i]) comppri_item.counts[i] = cnt_cached[i]; else { if_all_cached = 0; comppri_item.counts[i] = -1; } } /* if all cached, return result directly to client */ if (if_all_cached) { Response_msg resp_comppri; if (comppri_item.counts[1] - comppri_item.counts[0] > \ comppri_item.counts[3] - comppri_item.counts[2]) resp_comppri.set_response("There are more primes in first range."); else resp_comppri.set_response("There are more primes in second range."); std::string req_desp = client_req.get_request_string(); master_cache.put(req_desp, resp_comppri); send_client_response(client_handle, resp_comppri); } else { mstate.comppri_map[main_tag] = comppri_item; for (int i = 0; i < COMPPRI_NUM; i++) { if (if_cached[i]) continue; mstate.num_cpu_intensive++; Request_msg req_created(0); create_comppri_req(req_created, comppri_item.params[i]); Request_msg worker_req(req_tag[i], req_created); mstate.response_client_map[req_tag[i]] = clt_req_item[i]; send_request_to_worker(mstate.my_worker[clt_req_item[i].worker_idx].worker, worker_req); } } } /** * This function is called when new worker result is returned to master. * @param worker_handle * @param resp response */ void handle_worker_response(Worker_handle worker_handle, const Response_msg& resp) { DLOG(INFO) << "Master received a response from a worker: [" << resp.get_tag() << ":" << resp.get_response() << "]" << std::endl; int request_tag = resp.get_tag(); client_request_item_t client_request_item = mstate.response_client_map[request_tag]; int request_type = client_request_item.request_type; if (request_type == WISDOM418 || request_type == COUNTERPRIMES) { mstate.num_cpu_intensive--; } else if (request_type == COMPAREPRIMES) { mstate.num_cpu_intensive--; return handle_comppri_resp(worker_handle, resp, client_request_item); } else if (request_type == PROJECTIDEA) { mstate.num_projectidea--; } int worker_idx = client_request_item.worker_idx; int counter_primes_n = client_request_item.counter_primes_n; mstate.my_worker[worker_idx].num_request_each_type[request_type]--; if (request_type == COUNTERPRIMES) mstate.my_worker[worker_idx].sum_primes_countprimes -= counter_primes_n; mstate.response_client_map.erase(request_tag); std::string req_desp = client_request_item.client_req.get_request_string(); master_cache.put(req_desp, resp); send_client_response(client_request_item.client_handle, resp); } /** * Handle compareprimes request by groupign all the result from countprimes * @param worker_handle * @param resp response from worker * @param client_request_item */ void handle_comppri_resp(Worker_handle worker_handle, const Response_msg& resp, client_request_item_t &client_request_item) { int request_tag = resp.get_tag(); int worker_idx = client_request_item.worker_idx; int counter_primes_n = client_request_item.counter_primes_n; int main_tag = client_request_item.idx_if_compppri; int count = atoi(resp.get_response().c_str()); mstate.my_worker[worker_idx].num_request_each_type[COUNTERPRIMES] -= 1; mstate.my_worker[worker_idx].sum_primes_countprimes -= counter_primes_n; comppri_item_t comppri_item; comppri_item = mstate.comppri_map[main_tag]; /* save the result for further grouping */ for (int i = 0; i < COMPPRI_NUM; i++) { if (comppri_item.params[i] == counter_primes_n) { comppri_item.counts[i] = count; break; } } mstate.comppri_map[main_tag] = comppri_item; /* check whether all four requests has completed */ int if_completed = 1; for (int i = 0; i < COMPPRI_NUM; i++) { if (comppri_item.counts[i] == -1) { if_completed = 0; break; } } if (if_completed) { Response_msg resp_comppri; if (comppri_item.counts[1] - comppri_item.counts[0] > \ comppri_item.counts[3] - comppri_item.counts[2]) resp_comppri.set_response("There are more primes in first range."); else resp_comppri.set_response("There are more primes in second range."); std::string req_desp = client_request_item.client_req.get_request_string(); master_cache.put(req_desp, resp_comppri); send_client_response(client_request_item.client_handle, resp_comppri); mstate.comppri_map.erase(main_tag); } mstate.response_client_map.erase(request_tag); } /** * Get the index of next worker that will be assigned request by load balancer. * @param request_type the type of current request * @return the index of worker */ int get_next_worker_idx(int request_type) { int num_recv = mstate.num_workers_recv; int num_run = mstate.num_workers_run; int worker_idx = mstate.idx_array[0]; int min_num_request = mstate.my_worker[worker_idx].num_request_each_type[request_type]; /** * find the worker with least number of that type of request * check worker within recv range, which means we do not consider the worker */ for (int i = 1; i < num_recv; i++) { int new_worker_idx = mstate.idx_array[i]; int new_request_num = mstate.my_worker[new_worker_idx].num_request_each_type[request_type]; if (new_request_num < min_num_request) { min_num_request = new_request_num; worker_idx = new_worker_idx; } } /** * For projectidea request, if choosen worker has already PROJECTIDEA * requests, we may search free worker that is in to be killed list. * if we can find that worker scale it back to recv worker. */ int proj_worker_idx = worker_idx; int proj_min_num_request = min_num_request; if (request_type == PROJECTIDEA && min_num_request >= PROJECTIDEA && num_recv < num_run) { for (int i = num_recv; i < num_run; i++) { int new_worker_idx = mstate.idx_array[i]; int new_request_num = mstate.my_worker[new_worker_idx].num_request_each_type[request_type]; if (new_request_num < proj_min_num_request) { proj_min_num_request = proj_worker_idx; proj_worker_idx = new_worker_idx; } } } if (worker_idx != proj_worker_idx) { worker_idx = proj_worker_idx; } /** * For other types of request, if the choosen worker's cpu intensive requests * has already reach NUM_CONTEXT, which means the number of hardware context * it has, we search for new worker in to be killed worker list. */ if (get_num_cpu_intensive_per_worker(worker_idx) >= NUM_CONTEXT - MAX_RUNNING_PROJECTIDEA && (request_type == WISDOM418 || COUNTERPRIMES) && num_recv < num_run) { worker_idx = mstate.idx_array[num_recv]; mstate.my_worker[worker_idx].time_to_be_killed = -1; mstate.num_workers_recv++; } mstate.my_worker[worker_idx].num_request_each_type[request_type]++; return worker_idx; } /** * Get the index of next worker that will be assigned countprimes request by load balancer. * @param n paramter that needs to compute primes. * @return the index of worker */ int get_next_worker_idx_cntpri(int n) { int worker_idx = mstate.idx_array[0]; int min_primes_sum = mstate.my_worker[worker_idx].sum_primes_countprimes; for (int i = 1; i < mstate.num_workers_recv; i++) { int new_worker_idx = mstate.idx_array[i]; int new_request_primes_sum = mstate.my_worker[new_worker_idx].sum_primes_countprimes; if (new_request_primes_sum < min_primes_sum) { min_primes_sum = new_request_primes_sum; worker_idx = new_worker_idx; } } if (get_num_cpu_intensive_per_worker(worker_idx) >= NUM_CONTEXT - MAX_RUNNING_PROJECTIDEA && mstate.num_workers_recv < mstate.num_workers_run) { worker_idx = mstate.idx_array[mstate.num_workers_recv]; mstate.my_worker[worker_idx].time_to_be_killed = -1; mstate.num_workers_recv++; } mstate.my_worker[worker_idx].num_request_each_type[COUNTERPRIMES]++; mstate.my_worker[worker_idx].sum_primes_countprimes += n; return worker_idx; } /** * Create new countprimes request * @param req request that will be created * @param n parameter that will be entered into request */ static void create_comppri_req(Request_msg& req, int n) { std::ostringstream oss; oss << n; req.set_arg("cmd", "countprimes"); req.set_arg("n", oss.str()); } /** * This function is used for auto scaling. */ void handle_tick() { #ifdef LOG_P printf_worker_info(); #endif if (mstate.server_ready != true) return; update_time(); int if_scale = ck_scale_cond(); if (if_scale == 1) scale_out(); else if (if_scale == -1) scale_in(); kill_worker(); } /** * Update time var for scale out and scale in. */ void update_time() { mstate.time_since_last_new++; for (int i = 0; i < mstate.num_workers_run; i++) { int worker_idx = mstate.idx_array[i]; if (mstate.my_worker[worker_idx].time_to_be_killed != -1) mstate.my_worker[worker_idx].time_to_be_killed++; } } /** * Check whether the condition for scale out and scale in is meeted. * @return 1 for scale out, -1 for scale in, 0 for nothing. */ int ck_scale_cond() { int num_workers_recv = mstate.num_workers_recv; int num_workers_run = mstate.num_workers_run; int ave_cpu_intensive = mstate.num_cpu_intensive / num_workers_recv; int num_slots_proj = num_workers_run * MAX_RUNNING_PROJECTIDEA; int remaining_slots = num_slots_proj - mstate.num_projectidea; /* If master is launching new worker, don not scale out or in again. */ if (mstate.if_scaling_out) { return 0; } /* Scale out rules */ if (num_workers_recv < mstate.max_num_workers && mstate.time_since_last_new >= MIN_TIME_BEFORE_NEXT_WORKER) { if (ave_cpu_intensive >= SCALEOUT_THRESHOLD || (remaining_slots <= 2 && num_workers_run > 1) || (remaining_slots <= 1 && num_workers_run == 1)) { return 1; } } /* Scale in rules */ if (num_workers_recv > 1) { if (ave_cpu_intensive < SCALEIN_THRESHOLD && remaining_slots > 3) { return -1; } } return 0; } /** * Perform scale out operation * @return 0 as success, -1 as failed */ int scale_out() { int if_scale_back = 0; while (mstate.num_workers_recv < mstate.num_workers_run) { /* If there is worker waiting to be killed, just put it back to scheduler */ int worker_idx = mstate.idx_array[mstate.num_workers_recv]; mstate.my_worker[worker_idx].time_to_be_killed = -1; mstate.num_workers_recv++; if_scale_back = 1; /* after scale out, check condition again */ if (if_scale_back && ck_scale_cond() != 1) return 0; } /* require new worker */ if (mstate.num_workers_plan < mstate.max_num_workers && ck_scale_cond()) { int worker_idx = get_free_idx(); mstate.idx_array[mstate.num_workers_plan++] = worker_idx; mstate.my_worker[worker_idx].worker = NULL; for (int i = 0; i < NUM_TYPES; i++) mstate.my_worker[worker_idx].num_request_each_type[i] = 0; mstate.my_worker[worker_idx].sum_primes_countprimes = 0; mstate.my_worker[worker_idx].time_to_be_killed = -1; Request_msg req(worker_idx); std::string idx_str = std::to_string(worker_idx); req.set_arg("worker_id", idx_str); request_new_worker_node(req); mstate.if_scaling_out = 1; } else return -1; return 0; } /** * Perform scale in operation. * @return 0 as success, never return -1, but reserved for future use. */ int scale_in() { if (mstate.num_workers_recv == 1) return -1; mstate.num_workers_recv--; int worker_idx = mstate.idx_array[mstate.num_workers_recv]; mstate.my_worker[worker_idx].time_to_be_killed = 0; return 0; } void kill_worker() { if (mstate.if_scaling_out == 1) return; for (int i = mstate.num_workers_recv; i < mstate.num_workers_run; i++) { int worker_idx = mstate.idx_array[i]; int num_works = get_works_num(worker_idx); /* If the worker is waiting to be closed, and it has no running request */ if (mstate.my_worker[worker_idx].time_to_be_killed >= MIN_TIME_BEFORE_GET_KILLED && num_works == 0) { kill_worker_node(mstate.my_worker[worker_idx].worker); clear_worker_info(i); mstate.num_workers_run--; mstate.num_workers_plan--; } } } /** * Clear the information structure of worker that is being killed. * @param worker_idx the index of worker */ void clear_worker_info(int iterator) { for (int i = iterator + 1; i < mstate.num_workers_run; i++) { mstate.idx_array[i - 1] = mstate.idx_array[i]; } } /** * Get the total number of request that a worker is owning. * @param worker_idx the index of worker * @return the total number of request */ int get_works_num(int worker_idx) { int num_works = 0; for (int i = 0; i < NUM_TYPES - 1; i++) { num_works += mstate.my_worker[worker_idx].num_request_each_type[i]; } return num_works; } /** * Get the total number of request that a worker is owning. * @param worker_idx the index of worker * @return the total number of request */ int get_num_cpu_intensive_per_worker(int worker_id) { int result = mstate.my_worker[worker_id].num_request_each_type[WISDOM418] + mstate.my_worker[worker_id].num_request_each_type[COUNTERPRIMES]; return result; } /** * Get the number of cpu intensive request that a worker owns. * @param worker_idx the index of worker * @return the total number of request */ int get_num_projectidea_per_worker(int worker_id) { return mstate.my_worker[worker_id].num_request_each_type[PROJECTIDEA]; } /** * Get a free index that no worker is using. * @return free index */ int get_free_idx() { int num_worker_plan = mstate.num_workers_plan; if (num_worker_plan == mstate.max_num_workers) return -1; int if_occupy[MAX_WORKERS] = {0}; for (int i = 0; i < num_worker_plan; i++) { if_occupy[mstate.idx_array[i]] = 1; } for (int i = 0; i < MAX_WORKERS; i++) { if (if_occupy[i] == 0) return i; } return -1; } /** * print the number of work that all worker is running and queuing. */ void printf_worker_info() { LOG_PRINT("\n\n######################################################\n\n"); for (int i = 0; i < mstate.num_workers_run; i++) { int worker_idx = mstate.idx_array[i]; int num_cpu_intensive = 0; int num_works_total = 0; for (int j = 0; j < NUM_TYPES - 1; j++) { if (j == WISDOM418 || j == COUNTERPRIMES) { num_cpu_intensive += mstate.my_worker[worker_idx].num_request_each_type[j]; } num_works_total += mstate.my_worker[worker_idx].num_request_each_type[j]; } LOG_PRINT("Worker %d, 418wisdom: %d, countprimes: %d, countprimes_sum: %d, cpu_intensive:%d, projectidea: %d, tellmenow: %d, works_total: %d\n", worker_idx, mstate.my_worker[worker_idx].num_request_each_type[WISDOM418], mstate.my_worker[worker_idx].num_request_each_type[COUNTERPRIMES], mstate.my_worker[worker_idx].sum_primes_countprimes, num_cpu_intensive, mstate.my_worker[worker_idx].num_request_each_type[PROJECTIDEA], mstate.my_worker[worker_idx].num_request_each_type[TELLMENOW], num_works_total ); } LOG_PRINT("\n\n######################################################\n\n"); }
[ "deng.qiaoyu@gmail.com" ]
deng.qiaoyu@gmail.com
5b3493a7df73072f01a70c9a8f841ef98831c884
156d7b3e35d249377df5923017cc8af52489f97f
/brlycmbd/CrdBrlyPty/CrdBrlyPty_blks.cpp
39bddfe24504a2717ab72c59453959b612e12e18
[ "MIT" ]
permissive
mpsitech/brly-BeamRelay
fa11efae1fdd34110505ac10dee9d2e96a5ea8bd
ade30cfa9285360618d9d8c717fe6591da0c8683
refs/heads/master
2022-09-30T21:12:35.188234
2022-09-12T20:46:24
2022-09-12T20:46:24
282,705,295
0
0
null
null
null
null
UTF-8
C++
false
false
12,985
cpp
/** * \file CrdBrlyPty_blks.cpp * job handler for job CrdBrlyPty (implementation of blocks) * \copyright (C) 2016-2020 MPSI Technologies GmbH * \author Alexander Wirthmueller (auto-generation) * \date created: 11 Jan 2021 */ // IP header --- ABOVE using namespace std; using namespace Sbecore; using namespace Xmlio; /****************************************************************************** class CrdBrlyPty::VecVDo ******************************************************************************/ uint CrdBrlyPty::VecVDo::getIx( const string& sref ) { string s = StrMod::lc(sref); if (s == "close") return CLOSE; if (s == "mitappabtclick") return MITAPPABTCLICK; return(0); }; string CrdBrlyPty::VecVDo::getSref( const uint ix ) { if (ix == CLOSE) return("close"); if (ix == MITAPPABTCLICK) return("MitAppAbtClick"); return(""); }; /****************************************************************************** class CrdBrlyPty::VecVSge ******************************************************************************/ uint CrdBrlyPty::VecVSge::getIx( const string& sref ) { string s = StrMod::lc(sref); if (s == "idle") return IDLE; if (s == "alrbrlyabt") return ALRBRLYABT; return(0); }; string CrdBrlyPty::VecVSge::getSref( const uint ix ) { if (ix == IDLE) return("idle"); if (ix == ALRBRLYABT) return("alrbrlyabt"); return(""); }; void CrdBrlyPty::VecVSge::fillFeed( Feed& feed ) { feed.clear(); for (unsigned int i = 1; i <= 2; i++) feed.appendIxSrefTitles(i, getSref(i), getSref(i)); }; /****************************************************************************** class CrdBrlyPty::ContInf ******************************************************************************/ CrdBrlyPty::ContInf::ContInf( const uint numFSge , const string& MrlAppHlp , const string& MtxCrdPty ) : Block() { this->numFSge = numFSge; this->MrlAppHlp = MrlAppHlp; this->MtxCrdPty = MtxCrdPty; mask = {NUMFSGE, MRLAPPHLP, MTXCRDPTY}; }; void CrdBrlyPty::ContInf::writeJSON( Json::Value& sup , string difftag ) { if (difftag.length() == 0) difftag = "ContInfBrlyPty"; Json::Value& me = sup[difftag] = Json::Value(Json::objectValue); me["numFSge"] = numFSge; me["MrlAppHlp"] = MrlAppHlp; me["MtxCrdPty"] = MtxCrdPty; }; void CrdBrlyPty::ContInf::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "ContInfBrlyPty"; string itemtag; if (shorttags) itemtag = "Ci"; else itemtag = "ContitemInfBrlyPty"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeUintAttr(wr, itemtag, "sref", "numFSge", numFSge); writeStringAttr(wr, itemtag, "sref", "MrlAppHlp", MrlAppHlp); writeStringAttr(wr, itemtag, "sref", "MtxCrdPty", MtxCrdPty); xmlTextWriterEndElement(wr); }; set<uint> CrdBrlyPty::ContInf::comm( const ContInf* comp ) { set<uint> items; if (numFSge == comp->numFSge) insert(items, NUMFSGE); if (MrlAppHlp == comp->MrlAppHlp) insert(items, MRLAPPHLP); if (MtxCrdPty == comp->MtxCrdPty) insert(items, MTXCRDPTY); return(items); }; set<uint> CrdBrlyPty::ContInf::diff( const ContInf* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {NUMFSGE, MRLAPPHLP, MTXCRDPTY}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** class CrdBrlyPty::StatApp ******************************************************************************/ void CrdBrlyPty::StatApp::writeJSON( Json::Value& sup , string difftag , const uint ixBrlyVReqitmode , const usmallint latency , const string& shortMenu , const uint widthMenu , const bool initdoneHeadbar , const bool initdoneList , const bool initdoneRec ) { if (difftag.length() == 0) difftag = "StatAppBrlyPty"; Json::Value& me = sup[difftag] = Json::Value(Json::objectValue); me["srefIxBrlyVReqitmode"] = VecBrlyVReqitmode::getSref(ixBrlyVReqitmode); me["latency"] = latency; me["shortMenu"] = shortMenu; me["widthMenu"] = widthMenu; me["initdoneHeadbar"] = initdoneHeadbar; me["initdoneList"] = initdoneList; me["initdoneRec"] = initdoneRec; }; void CrdBrlyPty::StatApp::writeXML( xmlTextWriter* wr , string difftag , bool shorttags , const uint ixBrlyVReqitmode , const usmallint latency , const string& shortMenu , const uint widthMenu , const bool initdoneHeadbar , const bool initdoneList , const bool initdoneRec ) { if (difftag.length() == 0) difftag = "StatAppBrlyPty"; string itemtag; if (shorttags) itemtag = "Si"; else itemtag = "StatitemAppBrlyPty"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeStringAttr(wr, itemtag, "sref", "srefIxBrlyVReqitmode", VecBrlyVReqitmode::getSref(ixBrlyVReqitmode)); writeUsmallintAttr(wr, itemtag, "sref", "latency", latency); writeStringAttr(wr, itemtag, "sref", "shortMenu", shortMenu); writeUintAttr(wr, itemtag, "sref", "widthMenu", widthMenu); writeBoolAttr(wr, itemtag, "sref", "initdoneHeadbar", initdoneHeadbar); writeBoolAttr(wr, itemtag, "sref", "initdoneList", initdoneList); writeBoolAttr(wr, itemtag, "sref", "initdoneRec", initdoneRec); xmlTextWriterEndElement(wr); }; /****************************************************************************** class CrdBrlyPty::StatShr ******************************************************************************/ CrdBrlyPty::StatShr::StatShr( const ubigint jrefHeadbar , const ubigint jrefList , const ubigint jrefRec ) : Block() { this->jrefHeadbar = jrefHeadbar; this->jrefList = jrefList; this->jrefRec = jrefRec; mask = {JREFHEADBAR, JREFLIST, JREFREC}; }; void CrdBrlyPty::StatShr::writeJSON( Json::Value& sup , string difftag ) { if (difftag.length() == 0) difftag = "StatShrBrlyPty"; Json::Value& me = sup[difftag] = Json::Value(Json::objectValue); me["scrJrefHeadbar"] = Scr::scramble(jrefHeadbar); me["scrJrefList"] = Scr::scramble(jrefList); me["scrJrefRec"] = Scr::scramble(jrefRec); }; void CrdBrlyPty::StatShr::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "StatShrBrlyPty"; string itemtag; if (shorttags) itemtag = "Si"; else itemtag = "StatitemShrBrlyPty"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeStringAttr(wr, itemtag, "sref", "scrJrefHeadbar", Scr::scramble(jrefHeadbar)); writeStringAttr(wr, itemtag, "sref", "scrJrefList", Scr::scramble(jrefList)); writeStringAttr(wr, itemtag, "sref", "scrJrefRec", Scr::scramble(jrefRec)); xmlTextWriterEndElement(wr); }; set<uint> CrdBrlyPty::StatShr::comm( const StatShr* comp ) { set<uint> items; if (jrefHeadbar == comp->jrefHeadbar) insert(items, JREFHEADBAR); if (jrefList == comp->jrefList) insert(items, JREFLIST); if (jrefRec == comp->jrefRec) insert(items, JREFREC); return(items); }; set<uint> CrdBrlyPty::StatShr::diff( const StatShr* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {JREFHEADBAR, JREFLIST, JREFREC}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** class CrdBrlyPty::Tag ******************************************************************************/ void CrdBrlyPty::Tag::writeJSON( const uint ixBrlyVLocale , Json::Value& sup , string difftag ) { if (difftag.length() == 0) difftag = "TagBrlyPty"; Json::Value& me = sup[difftag] = Json::Value(Json::objectValue); if (ixBrlyVLocale == VecBrlyVLocale::ENUS) { } else if (ixBrlyVLocale == VecBrlyVLocale::DECH) { }; me["MitAppAbt"] = StrMod::cap(VecBrlyVTag::getTitle(VecBrlyVTag::ABOUT, ixBrlyVLocale)) + " ..."; me["MrlAppHlp"] = StrMod::cap(VecBrlyVTag::getTitle(VecBrlyVTag::HELP, ixBrlyVLocale)) + " ..."; }; void CrdBrlyPty::Tag::writeXML( const uint ixBrlyVLocale , xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "TagBrlyPty"; string itemtag; if (shorttags) itemtag = "Ti"; else itemtag = "TagitemBrlyPty"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); if (ixBrlyVLocale == VecBrlyVLocale::ENUS) { } else if (ixBrlyVLocale == VecBrlyVLocale::DECH) { }; writeStringAttr(wr, itemtag, "sref", "MitAppAbt", StrMod::cap(VecBrlyVTag::getTitle(VecBrlyVTag::ABOUT, ixBrlyVLocale)) + " ..."); writeStringAttr(wr, itemtag, "sref", "MrlAppHlp", StrMod::cap(VecBrlyVTag::getTitle(VecBrlyVTag::HELP, ixBrlyVLocale)) + " ..."); xmlTextWriterEndElement(wr); }; /****************************************************************************** class CrdBrlyPty::DpchAppDo ******************************************************************************/ CrdBrlyPty::DpchAppDo::DpchAppDo() : DpchAppBrly(VecBrlyVDpch::DPCHAPPBRLYPTYDO) { ixVDo = 0; }; string CrdBrlyPty::DpchAppDo::getSrefsMask() { vector<string> ss; string srefs; if (has(JREF)) ss.push_back("jref"); if (has(IXVDO)) ss.push_back("ixVDo"); StrMod::vectorToString(ss, srefs); return(srefs); }; void CrdBrlyPty::DpchAppDo::readJSON( const Json::Value& sup , bool addbasetag ) { clear(); bool basefound; const Json::Value& me = [&]{if (!addbasetag) return sup; return sup["DpchAppBrlyPtyDo"];}(); basefound = (me != Json::nullValue); if (basefound) { if (me.isMember("scrJref")) {jref = Scr::descramble(me["scrJref"].asString()); add(JREF);}; if (me.isMember("srefIxVDo")) {ixVDo = VecVDo::getIx(me["srefIxVDo"].asString()); add(IXVDO);}; } else { }; }; void CrdBrlyPty::DpchAppDo::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); string scrJref; string srefIxVDo; bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchAppBrlyPtyDo"); else basefound = checkXPath(docctx, basexpath); if (basefound) { if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) { jref = Scr::descramble(scrJref); add(JREF); }; if (extractStringUclc(docctx, basexpath, "srefIxVDo", "", srefIxVDo)) { ixVDo = VecVDo::getIx(srefIxVDo); add(IXVDO); }; } else { }; }; /****************************************************************************** class CrdBrlyPty::DpchEngData ******************************************************************************/ CrdBrlyPty::DpchEngData::DpchEngData( const ubigint jref , ContInf* continf , Feed* feedFSge , StatShr* statshr , const set<uint>& mask ) : DpchEngBrly(VecBrlyVDpch::DPCHENGBRLYPTYDATA, jref) { if (find(mask, ALL)) this->mask = {JREF, CONTINF, FEEDFSGE, STATAPP, STATSHR, TAG}; else this->mask = mask; if (find(this->mask, CONTINF) && continf) this->continf = *continf; if (find(this->mask, FEEDFSGE) && feedFSge) this->feedFSge = *feedFSge; if (find(this->mask, STATSHR) && statshr) this->statshr = *statshr; }; string CrdBrlyPty::DpchEngData::getSrefsMask() { vector<string> ss; string srefs; if (has(JREF)) ss.push_back("jref"); if (has(CONTINF)) ss.push_back("continf"); if (has(FEEDFSGE)) ss.push_back("feedFSge"); if (has(STATAPP)) ss.push_back("statapp"); if (has(STATSHR)) ss.push_back("statshr"); if (has(TAG)) ss.push_back("tag"); StrMod::vectorToString(ss, srefs); return(srefs); }; void CrdBrlyPty::DpchEngData::merge( DpchEngBrly* dpcheng ) { DpchEngData* src = (DpchEngData*) dpcheng; if (src->has(JREF)) {jref = src->jref; add(JREF);}; if (src->has(CONTINF)) {continf = src->continf; add(CONTINF);}; if (src->has(FEEDFSGE)) {feedFSge = src->feedFSge; add(FEEDFSGE);}; if (src->has(STATAPP)) add(STATAPP); if (src->has(STATSHR)) {statshr = src->statshr; add(STATSHR);}; if (src->has(TAG)) add(TAG); }; void CrdBrlyPty::DpchEngData::writeJSON( const uint ixBrlyVLocale , Json::Value& sup ) { Json::Value& me = sup["DpchEngBrlyPtyData"] = Json::Value(Json::objectValue); if (has(JREF)) me["scrJref"] = Scr::scramble(jref); if (has(CONTINF)) continf.writeJSON(me); if (has(FEEDFSGE)) feedFSge.writeJSON(me); if (has(STATAPP)) StatApp::writeJSON(me); if (has(STATSHR)) statshr.writeJSON(me); if (has(TAG)) Tag::writeJSON(ixBrlyVLocale, me); }; void CrdBrlyPty::DpchEngData::writeXML( const uint ixBrlyVLocale , xmlTextWriter* wr ) { xmlTextWriterStartElement(wr, BAD_CAST "DpchEngBrlyPtyData"); xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/brly"); if (has(JREF)) writeString(wr, "scrJref", Scr::scramble(jref)); if (has(CONTINF)) continf.writeXML(wr); if (has(FEEDFSGE)) feedFSge.writeXML(wr); if (has(STATAPP)) StatApp::writeXML(wr); if (has(STATSHR)) statshr.writeXML(wr); if (has(TAG)) Tag::writeXML(ixBrlyVLocale, wr); xmlTextWriterEndElement(wr); };
[ "aw@mpsitech.com" ]
aw@mpsitech.com
df74cfed75491031e48b3c0f2478ab17ea3b5cc3
b5f6d2410a794a9acba9a0f010f941a1d35e46ce
/game/client/entity_client_tools.cpp
d6ed5c9a6cb1dbe26d23445cb692d1ed84f2ef20
[]
no_license
chrizonix/RCBot2
0a58591101e4537b166a672821ea28bc3aa486c6
ef0572f45c9542268923d500e64bb4cd037077eb
refs/heads/master
2021-01-19T12:55:49.003814
2018-08-27T08:48:55
2018-08-27T08:48:55
44,916,746
4
0
null
null
null
null
WINDOWS-1252
C++
false
false
25,018
cpp
//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======= // // Purpose: // //============================================================================= #include "cbase.h" #include "toolframework/itoolentity.h" #include "tier1/KeyValues.h" #include "sprite.h" #include "enginesprite.h" #include "toolframework_client.h" #include "particles/particles.h" #include "particle_parse.h" #include "rendertexture.h" #ifdef PORTAL #include "portalrender.h" #endif #pragma warning( disable: 4355 ) // warning C4355: 'this' : used in base member initializer list class CClientTools; void DrawSpriteModel( IClientEntity *baseentity, CEngineSprite *psprite, const Vector &origin, float fscale, float frame, int rendermode, int r, int g, int b, int a, const Vector& forward, const Vector& right, const Vector& up, float flHDRColorScale = 1.0f ); float StandardGlowBlend( const pixelvis_queryparams_t &params, pixelvis_handle_t *queryHandle, int rendermode, int renderfx, int alpha, float *pscale ); // Interface from engine to tools for manipulating entities class CClientTools : public IClientTools, public IClientEntityListener { public: CClientTools(); virtual HTOOLHANDLE AttachToEntity( EntitySearchResult entityToAttach ); virtual void DetachFromEntity( EntitySearchResult entityToDetach ); virtual bool IsValidHandle( HTOOLHANDLE handle ); virtual int GetNumRecordables(); virtual HTOOLHANDLE GetRecordable( int index ); // Iterates through ALL entities (separate list for client vs. server) virtual EntitySearchResult NextEntity( EntitySearchResult currentEnt ); // Use this to turn on/off the presence of an underlying game entity virtual void SetEnabled( HTOOLHANDLE handle, bool enabled ); virtual void SetRecording( HTOOLHANDLE handle, bool recording ); virtual bool ShouldRecord( HTOOLHANDLE handle ); virtual int GetModelIndex( HTOOLHANDLE handle ); virtual const char* GetModelName ( HTOOLHANDLE handle ); virtual const char* GetClassname ( HTOOLHANDLE handle ); virtual HTOOLHANDLE GetToolHandleForEntityByIndex( int entindex ); virtual void AddClientRenderable( IClientRenderable *pRenderable, int renderGroup ); virtual void RemoveClientRenderable( IClientRenderable *pRenderable ); virtual void SetRenderGroup( IClientRenderable *pRenderable, int renderGroup ); virtual void MarkClientRenderableDirty( IClientRenderable *pRenderable ); virtual bool DrawSprite( IClientRenderable *pRenderable, float scale, float frame, int rendermode, int renderfx, const Color &color, float flProxyRadius, int *pVisHandle ); virtual bool GetLocalPlayerEyePosition( Vector& org, QAngle& ang, float &fov ); virtual EntitySearchResult GetLocalPlayer(); virtual ClientShadowHandle_t CreateShadow( CBaseHandle h, int nFlags ); virtual void DestroyShadow( ClientShadowHandle_t h ); virtual ClientShadowHandle_t CreateFlashlight( const FlashlightState_t &lightState ); virtual void DestroyFlashlight( ClientShadowHandle_t h ); virtual void UpdateFlashlightState( ClientShadowHandle_t h, const FlashlightState_t &flashlightState ); virtual void AddToDirtyShadowList( ClientShadowHandle_t h, bool force = false ); virtual void MarkRenderToTextureShadowDirty( ClientShadowHandle_t h ); virtual void UpdateProjectedTexture( ClientShadowHandle_t h, bool bForce ); // Global toggle for recording virtual void EnableRecordingMode( bool bEnable ); virtual bool IsInRecordingMode() const; // Trigger a temp entity virtual void TriggerTempEntity( KeyValues *pKeyValues ); // get owning weapon (for viewmodels) virtual int GetOwningWeaponEntIndex( int entindex ); virtual int GetEntIndex( EntitySearchResult entityToAttach ); virtual int FindGlobalFlexcontroller( char const *name ); virtual char const *GetGlobalFlexControllerName( int idx ); // helper for traversing ownership hierarchy virtual EntitySearchResult GetOwnerEntity( EntitySearchResult currentEnt ); // common and useful types to query for hierarchically virtual bool IsPlayer( EntitySearchResult entityToAttach ); virtual bool IsBaseCombatCharacter( EntitySearchResult entityToAttach ); virtual bool IsNPC( EntitySearchResult entityToAttach ); virtual Vector GetAbsOrigin( HTOOLHANDLE handle ); virtual QAngle GetAbsAngles( HTOOLHANDLE handle ); virtual void ReloadParticleDefintions( const char *pFileName, const void *pBufData, int nLen ); // Sends a mesage from the tool to the client virtual void PostToolMessage( KeyValues *pKeyValues ); // Indicates whether the client should render particle systems virtual void EnableParticleSystems( bool bEnable ); // Is the game rendering in 3rd person mode? virtual bool IsRenderingThirdPerson() const; public: C_BaseEntity *LookupEntity( HTOOLHANDLE handle ); // IClientEntityListener methods void OnEntityDeleted( C_BaseEntity *pEntity ); void OnEntityCreated( C_BaseEntity *pEntity ); private: struct HToolEntry_t { HToolEntry_t() : m_Handle( 0 ) {} HToolEntry_t( int handle, C_BaseEntity *pEntity = NULL ) : m_Handle( handle ), m_hEntity( pEntity ) { if ( pEntity ) { m_hEntity->SetToolHandle( m_Handle ); } } int m_Handle; EHANDLE m_hEntity; }; static int s_nNextHandle; static bool HandleLessFunc( const HToolEntry_t& lhs, const HToolEntry_t& rhs ) { return lhs.m_Handle < rhs.m_Handle; } CUtlRBTree< HToolEntry_t > m_Handles; CUtlVector< int > m_ActiveHandles; bool m_bInRecordingMode; }; //----------------------------------------------------------------------------- // Statics //----------------------------------------------------------------------------- int CClientTools::s_nNextHandle = 1; //----------------------------------------------------------------------------- // Singleton instance //----------------------------------------------------------------------------- static CClientTools s_ClientTools; IClientTools *clienttools = &s_ClientTools; EXPOSE_SINGLE_INTERFACE_GLOBALVAR( CClientTools, IClientTools, VCLIENTTOOLS_INTERFACE_VERSION, s_ClientTools ); //----------------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------------- CClientTools::CClientTools() : m_Handles( 0, 0, HandleLessFunc ) { m_bInRecordingMode = false; cl_entitylist->AddListenerEntity( this ); } //----------------------------------------------------------------------------- // Global toggle for recording //----------------------------------------------------------------------------- void CClientTools::EnableRecordingMode( bool bEnable ) { m_bInRecordingMode = bEnable; } bool CClientTools::IsInRecordingMode() const { return m_bInRecordingMode; } //----------------------------------------------------------------------------- // Trigger a temp entity //----------------------------------------------------------------------------- void CClientTools::TriggerTempEntity( KeyValues *pKeyValues ) { te->TriggerTempEntity( pKeyValues ); } //----------------------------------------------------------------------------- // get owning weapon (for viewmodels) //----------------------------------------------------------------------------- int CClientTools::GetOwningWeaponEntIndex( int entindex ) { C_BaseEntity *pEnt = C_BaseEntity::Instance( entindex ); C_BaseViewModel *pViewModel = dynamic_cast< C_BaseViewModel* >( pEnt ); if ( pViewModel ) { C_BaseCombatWeapon *pWeapon = pViewModel->GetOwningWeapon(); if ( pWeapon ) { return pWeapon->entindex(); } } return -1; } int CClientTools::GetEntIndex( EntitySearchResult entityToAttach ) { C_BaseEntity *ent = reinterpret_cast< C_BaseEntity * >( entityToAttach ); return ent ? ent->entindex() : 0; } void CClientTools::AddClientRenderable( IClientRenderable *pRenderable, int renderGroup ) { Assert( pRenderable ); cl_entitylist->AddNonNetworkableEntity( pRenderable->GetIClientUnknown() ); ClientRenderHandle_t handle = pRenderable->RenderHandle(); if ( INVALID_CLIENT_RENDER_HANDLE == handle ) { // create new renderer handle ClientLeafSystem()->AddRenderable( pRenderable, (RenderGroup_t)renderGroup ); } else { // handle already exists, just update group & origin ClientLeafSystem()->SetRenderGroup( pRenderable->RenderHandle(), (RenderGroup_t)renderGroup ); ClientLeafSystem()->RenderableChanged( pRenderable->RenderHandle() ); } } void CClientTools::RemoveClientRenderable( IClientRenderable *pRenderable ) { ClientRenderHandle_t handle = pRenderable->RenderHandle(); if( handle != INVALID_CLIENT_RENDER_HANDLE ) { ClientLeafSystem()->RemoveRenderable( handle ); } cl_entitylist->RemoveEntity( pRenderable->GetIClientUnknown()->GetRefEHandle() ); } void CClientTools::MarkClientRenderableDirty( IClientRenderable *pRenderable ) { ClientRenderHandle_t handle = pRenderable->RenderHandle(); if ( INVALID_CLIENT_RENDER_HANDLE != handle ) { // handle already exists, just update group & origin ClientLeafSystem()->RenderableChanged( pRenderable->RenderHandle() ); } } void CClientTools::SetRenderGroup( IClientRenderable *pRenderable, int renderGroup ) { ClientRenderHandle_t handle = pRenderable->RenderHandle(); if ( INVALID_CLIENT_RENDER_HANDLE == handle ) { // create new renderer handle ClientLeafSystem()->AddRenderable( pRenderable, (RenderGroup_t)renderGroup ); } else { // handle already exists, just update group & origin ClientLeafSystem()->SetRenderGroup( pRenderable->RenderHandle(), (RenderGroup_t)renderGroup ); ClientLeafSystem()->RenderableChanged( pRenderable->RenderHandle() ); } } bool CClientTools::DrawSprite( IClientRenderable *pRenderable, float scale, float frame, int rendermode, int renderfx, const Color &color, float flProxyRadius, int *pVisHandle ) { Vector origin = pRenderable->GetRenderOrigin(); QAngle angles = pRenderable->GetRenderAngles(); // Get extra data CEngineSprite *psprite = (CEngineSprite *)modelinfo->GetModelExtraData( pRenderable->GetModel() ); if ( !psprite ) return false; // Get orthonormal bases for current view - re-align to current camera (vs. recorded camera) Vector forward, right, up; C_SpriteRenderer::GetSpriteAxes( ( C_SpriteRenderer::SPRITETYPE )psprite->GetOrientation(), origin, angles, forward, right, up ); int r = color.r(); int g = color.g(); int b = color.b(); float oldBlend = render->GetBlend(); if ( rendermode != kRenderNormal ) { // kRenderGlow and kRenderWorldGlow have a special blending function if (( rendermode == kRenderGlow ) || ( rendermode == kRenderWorldGlow )) { pixelvis_queryparams_t params; if ( flProxyRadius != 0.0f ) { params.Init( origin, flProxyRadius ); params.bSizeInScreenspace = true; } else { params.Init( origin ); } float blend = oldBlend * StandardGlowBlend( params, ( pixelvis_handle_t* )pVisHandle, rendermode, renderfx, color.a(), &scale ); if ( blend <= 0.0f ) return false; //Fade out the sprite depending on distance from the view origin. r *= blend; g *= blend; b *= blend; render->SetBlend( blend ); } } DrawSpriteModel( ( IClientEntity* )pRenderable, psprite, origin, scale, frame, rendermode, r, g, b, color.a(), forward, right, up ); if (( rendermode == kRenderGlow ) || ( rendermode == kRenderWorldGlow )) { render->SetBlend( oldBlend ); } return true; } HTOOLHANDLE CClientTools::AttachToEntity( EntitySearchResult entityToAttach ) { C_BaseEntity *ent = reinterpret_cast< C_BaseEntity * >( entityToAttach ); Assert( ent ); if ( !ent ) return (HTOOLHANDLE)0; HTOOLHANDLE curHandle = ent->GetToolHandle(); if ( curHandle != 0 ) return curHandle; // Already attaached HToolEntry_t newHandle( s_nNextHandle++, ent ); m_Handles.Insert( newHandle ); m_ActiveHandles.AddToTail( newHandle.m_Handle ); return (HTOOLHANDLE)newHandle.m_Handle; } void CClientTools::DetachFromEntity( EntitySearchResult entityToDetach ) { C_BaseEntity *ent = reinterpret_cast< C_BaseEntity * >( entityToDetach ); Assert( ent ); if ( !ent ) return; HTOOLHANDLE handle = ent->GetToolHandle(); ent->SetToolHandle( (HTOOLHANDLE)0 ); if ( handle == (HTOOLHANDLE)0 ) { Assert( 0 ); return; } int idx = m_Handles.Find( HToolEntry_t( handle ) ); if ( idx == m_Handles.InvalidIndex() ) { Assert( 0 ); return; } m_Handles.RemoveAt( idx ); m_ActiveHandles.FindAndRemove( handle ); } //----------------------------------------------------------------------------- // Purpose: // Input : handle - // Output : C_BaseEntity //----------------------------------------------------------------------------- C_BaseEntity *CClientTools::LookupEntity( HTOOLHANDLE handle ) { int idx = m_Handles.Find( HToolEntry_t( handle ) ); if ( idx == m_Handles.InvalidIndex() ) return NULL; return m_Handles[ idx ].m_hEntity; } int CClientTools::GetNumRecordables() { return m_ActiveHandles.Count(); } HTOOLHANDLE CClientTools::GetRecordable( int index ) { if ( index < 0 || index >= m_ActiveHandles.Count() ) { Assert( 0 ); return (HTOOLHANDLE)0; } return m_ActiveHandles[ index ]; } //----------------------------------------------------------------------------- // Iterates through ALL entities (separate list for client vs. server) //----------------------------------------------------------------------------- EntitySearchResult CClientTools::NextEntity( EntitySearchResult currentEnt ) { C_BaseEntity *ent = reinterpret_cast< C_BaseEntity* >( currentEnt ); if ( ent == NULL ) { ent = cl_entitylist->FirstBaseEntity(); } else { ent = cl_entitylist->NextBaseEntity( ent ); } return reinterpret_cast< EntitySearchResult >( ent ); } //----------------------------------------------------------------------------- // Use this to turn on/off the presence of an underlying game entity //----------------------------------------------------------------------------- void CClientTools::SetEnabled( HTOOLHANDLE handle, bool enabled ) { int idx = m_Handles.Find( HToolEntry_t( handle ) ); if ( idx == m_Handles.InvalidIndex() ) return; HToolEntry_t *slot = &m_Handles[ idx ]; Assert( slot ); if ( slot == NULL ) return; C_BaseEntity *ent = slot->m_hEntity.Get(); if ( ent == NULL || ent->entindex() == 0 ) return; // Don't disable/enable the "world" ent->EnableInToolView( enabled ); } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CClientTools::SetRecording( HTOOLHANDLE handle, bool recording ) { int idx = m_Handles.Find( HToolEntry_t( handle ) ); if ( idx == m_Handles.InvalidIndex() ) return; HToolEntry_t &entry = m_Handles[ idx ]; if ( entry.m_hEntity ) { entry.m_hEntity->SetToolRecording( recording ); } } bool CClientTools::ShouldRecord( HTOOLHANDLE handle ) { int idx = m_Handles.Find( HToolEntry_t( handle ) ); if ( idx == m_Handles.InvalidIndex() ) return false; HToolEntry_t &entry = m_Handles[ idx ]; return entry.m_hEntity && entry.m_hEntity->ShouldRecordInTools(); } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- int CClientTools::GetModelIndex( HTOOLHANDLE handle ) { int idx = m_Handles.Find( HToolEntry_t( handle ) ); if ( idx == m_Handles.InvalidIndex() ) return NULL; HToolEntry_t &entry = m_Handles[ idx ]; if ( entry.m_hEntity ) { return entry.m_hEntity->GetModelIndex(); } Assert( 0 ); return 0; } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- const char* CClientTools::GetModelName( HTOOLHANDLE handle ) { int idx = m_Handles.Find( HToolEntry_t( handle ) ); if ( idx == m_Handles.InvalidIndex() ) return NULL; HToolEntry_t &entry = m_Handles[ idx ]; if ( entry.m_hEntity ) { return STRING( entry.m_hEntity->GetModelName() ); } Assert( 0 ); return NULL; } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- const char* CClientTools::GetClassname( HTOOLHANDLE handle ) { int idx = m_Handles.Find( HToolEntry_t( handle ) ); if ( idx == m_Handles.InvalidIndex() ) return NULL; HToolEntry_t &entry = m_Handles[ idx ]; if ( entry.m_hEntity ) { return STRING( entry.m_hEntity->GetClassname() ); } Assert( 0 ); return NULL; } //----------------------------------------------------------------------------- // Purpose: // Input : handle - //----------------------------------------------------------------------------- bool CClientTools::IsValidHandle( HTOOLHANDLE handle ) { return m_Handles.Find( HToolEntry_t( handle ) ) != m_Handles.InvalidIndex(); } void CClientTools::OnEntityDeleted( CBaseEntity *pEntity ) { HTOOLHANDLE handle = pEntity ? pEntity->GetToolHandle() : (HTOOLHANDLE)0; if ( handle == (HTOOLHANDLE)0 ) return; if ( m_bInRecordingMode ) { // Send deletion message to tool interface KeyValues *kv = new KeyValues( "deleted" ); ToolFramework_PostToolMessage( handle, kv ); kv->deleteThis(); } DetachFromEntity( pEntity ); } void CClientTools::OnEntityCreated( CBaseEntity *pEntity ) { if ( !m_bInRecordingMode ) return; HTOOLHANDLE h = AttachToEntity( pEntity ); // Send deletion message to tool interface KeyValues *kv = new KeyValues( "created" ); ToolFramework_PostToolMessage( h, kv ); kv->deleteThis(); } HTOOLHANDLE CClientTools::GetToolHandleForEntityByIndex( int entindex ) { C_BaseEntity *ent = C_BaseEntity::Instance( entindex ); if ( !ent ) return (HTOOLHANDLE)0; return ent->GetToolHandle(); } EntitySearchResult CClientTools::GetLocalPlayer() { C_BasePlayer *p = C_BasePlayer::GetLocalPlayer(); return reinterpret_cast< EntitySearchResult >( p ); } bool CClientTools::GetLocalPlayerEyePosition( Vector& org, QAngle& ang, float &fov ) { C_BasePlayer *pl = C_BasePlayer::GetLocalPlayer(); if ( pl == NULL ) return false; org = pl->EyePosition(); ang = pl->EyeAngles(); fov = pl->GetFOV(); return true; } //----------------------------------------------------------------------------- // Create, destroy shadow //----------------------------------------------------------------------------- ClientShadowHandle_t CClientTools::CreateShadow( CBaseHandle h, int nFlags ) { return g_pClientShadowMgr->CreateShadow( h, nFlags ); } void CClientTools::DestroyShadow( ClientShadowHandle_t h ) { g_pClientShadowMgr->DestroyShadow( h ); } ClientShadowHandle_t CClientTools::CreateFlashlight( const FlashlightState_t &lightState ) { return g_pClientShadowMgr->CreateFlashlight( lightState ); } void CClientTools::DestroyFlashlight( ClientShadowHandle_t h ) { g_pClientShadowMgr->DestroyFlashlight( h ); } void CClientTools::UpdateFlashlightState( ClientShadowHandle_t h, const FlashlightState_t &lightState ) { g_pClientShadowMgr->UpdateFlashlightState( h, lightState ); } void CClientTools::AddToDirtyShadowList( ClientShadowHandle_t h, bool force ) { g_pClientShadowMgr->AddToDirtyShadowList( h, force ); } void CClientTools::MarkRenderToTextureShadowDirty( ClientShadowHandle_t h ) { g_pClientShadowMgr->MarkRenderToTextureShadowDirty( h ); } void CClientTools::UpdateProjectedTexture( ClientShadowHandle_t h, bool bForce ) { g_pClientShadowMgr->UpdateProjectedTexture( h, bForce ); } int CClientTools::FindGlobalFlexcontroller( char const *name ) { return C_BaseFlex::AddGlobalFlexController( (char *)name ); } char const *CClientTools::GetGlobalFlexControllerName( int idx ) { return C_BaseFlex::GetGlobalFlexControllerName( idx ); } //----------------------------------------------------------------------------- // helper for traversing ownership hierarchy //----------------------------------------------------------------------------- EntitySearchResult CClientTools::GetOwnerEntity( EntitySearchResult currentEnt ) { C_BaseEntity *ent = reinterpret_cast< C_BaseEntity* >( currentEnt ); return ent ? ent->GetOwnerEntity() : NULL; } //----------------------------------------------------------------------------- // common and useful types to query for hierarchically //----------------------------------------------------------------------------- bool CClientTools::IsPlayer( EntitySearchResult currentEnt ) { C_BaseEntity *ent = reinterpret_cast< C_BaseEntity* >( currentEnt ); return ent ? ent->IsPlayer() : false; } bool CClientTools::IsBaseCombatCharacter( EntitySearchResult currentEnt ) { C_BaseEntity *ent = reinterpret_cast< C_BaseEntity* >( currentEnt ); return ent ? ent->IsBaseCombatCharacter() : false; } bool CClientTools::IsNPC( EntitySearchResult currentEnt ) { C_BaseEntity *ent = reinterpret_cast< C_BaseEntity* >( currentEnt ); return ent ? ent->IsNPC() : false; } Vector CClientTools::GetAbsOrigin( HTOOLHANDLE handle ) { int idx = m_Handles.Find( HToolEntry_t( handle ) ); if ( idx == m_Handles.InvalidIndex() ) return vec3_origin; HToolEntry_t &entry = m_Handles[ idx ]; if ( entry.m_hEntity ) { return entry.m_hEntity->GetAbsOrigin(); } Assert( 0 ); return vec3_origin; } QAngle CClientTools::GetAbsAngles( HTOOLHANDLE handle ) { int idx = m_Handles.Find( HToolEntry_t( handle ) ); if ( idx == m_Handles.InvalidIndex() ) return vec3_angle; HToolEntry_t &entry = m_Handles[ idx ]; if ( entry.m_hEntity ) { return entry.m_hEntity->GetAbsAngles(); } Assert( 0 ); return vec3_angle; } //----------------------------------------------------------------------------- // Sends a mesage from the tool to the client //----------------------------------------------------------------------------- void CClientTools::PostToolMessage( KeyValues *pKeyValues ) { if ( !Q_stricmp( pKeyValues->GetName(), "QueryParticleManifest" ) ) { // NOTE: This cannot be done during particle system init because tools aren't set up at that point CUtlVector<CUtlString> files; GetParticleManifest( files ); int nCount = files.Count(); for ( int i = 0; i < nCount; ++i ) { char pTemp[256]; Q_snprintf( pTemp, sizeof(pTemp), "%d", i ); KeyValues *pSubKey = pKeyValues->FindKey( pTemp, true ); pSubKey->SetString( "file", files[i] ); } return; } if ( !Q_stricmp( pKeyValues->GetName(), "QueryMonitorTexture" ) ) { pKeyValues->SetPtr( "texture", GetCameraTexture() ); return; } #ifdef PORTAL if ( !Q_stricmp( pKeyValues->GetName(), "portals" ) ) { g_pPortalRender->HandlePortalPlaybackMessage( pKeyValues ); return; } if ( !Q_stricmp( pKeyValues->GetName(), "query CPortalRenderer" ) ) { pKeyValues->SetInt( "IsRenderingPortal", g_pPortalRender->IsRenderingPortal() ? 1 : 0 ); return; } #endif } //----------------------------------------------------------------------------- // Indicates whether the client should render particle systems //----------------------------------------------------------------------------- void CClientTools::EnableParticleSystems( bool bEnable ) { ParticleMgr()->RenderParticleSystems( bEnable ); } //----------------------------------------------------------------------------- // Is the game rendering in 3rd person mode? //----------------------------------------------------------------------------- bool CClientTools::IsRenderingThirdPerson() const { return C_BasePlayer::ShouldDrawLocalPlayer(); } //----------------------------------------------------------------------------- // Reload particle definitions //----------------------------------------------------------------------------- void CClientTools::ReloadParticleDefintions( const char *pFileName, const void *pBufData, int nLen ) { // Remove all new effects, because we are going to free internal structures they point to ParticleMgr()->RemoveAllNewEffects(); // FIXME: Use file name to determine if we care about this data CUtlBuffer buf( pBufData, nLen, CUtlBuffer::READ_ONLY ); g_pParticleSystemMgr->ReadParticleConfigFile( buf, true ); }
[ "christian.pichler.msc@gmail.com" ]
christian.pichler.msc@gmail.com
6615fe8aff62d26451fb316a9ff68c3c167067c8
f4a52a7dd6f6266878f4351934f99ea5174663e4
/hw15/test.cpp
731ffd93d24c87b2ccd9e5435591639d2660f8fd
[]
no_license
askoulwassim/Algorithms-and-Data-Structures
8aa8e831c5e6bdc788a59f1c4033f4496ae2f3d4
60e15c8a1bb463ed46dafaecbdc2ec2d952e395b
refs/heads/master
2020-04-08T01:21:25.054788
2018-11-24T01:13:45
2018-11-24T01:13:45
158,890,506
0
0
null
null
null
null
UTF-8
C++
false
false
1,444
cpp
#include <iostream> #include <vector> #include <math.h> using namespace std; struct node{ int data[3]; node* next; }; struct linkedList{ node *startnode; int max[3]; vector<node* > tracker; linkedList(){ startnode = new node; max[0] = 10; max[1] = 7; max[2] = 4; startnode->data[0] = 0; startnode->data[1] = 7; startnode->data[2] = 4; }; node pour(node* state, int i, int j){ int A = state->data[i]; int B = state->data[j]; int change = min(A, max[j]-B); A-=change; B+=change; node next = *state; next.data[i]=A; next.data[j]=B; return next; } void printNode(node* n){ for(int i = 0; i < 3; i++){ cout << n->data[i]<<" "; } cout << endl; } bool found(node* find){ for(vector<node*>::iterator i = tracker.begin(); i != tracker.end(); i++) { if (equal(begin(find->data), end(find->data), begin((*i)->data))) return true; } return false; } void DFS(){ explore(startnode); } void explore(node* state){ printNode(state); tracker.push_back(state); while(state->data[1] != 2 && state->data[2] != 2){ for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ node* newState = new node; *newState = pour(state,i,j); if(i!=j && !found(newState)){ explore(newState); } } } } } }; int main(){ linkedList l1; l1.DFS(); }
[ "noreply@github.com" ]
noreply@github.com
995037b3da88c6dde50220ec6f2ab385150a29f0
29cfa88958191bf51aff9edf7bd111413fb809d5
/2019/LinkedIn-Network-Project-master/date.cpp
347c1f3150e7267c6e2ea38571f1791f1f75ad82
[]
no_license
asvilesov/silver-invention
11a6b28cb549c8c1c6c44e2da16e016b87a24f1a
b2f6008a98203f9d727cb0f39fdfee12befe8dfb
refs/heads/master
2021-01-06T10:00:40.252121
2020-05-15T00:46:24
2020-05-15T00:46:24
241,289,115
1
0
null
null
null
null
UTF-8
C++
false
false
3,565
cpp
#include "date.h" Date::Date(){ day = 1; month = 1; year = 1970; } Date::Date(int day, int month, int year){ set_date(day, month, year); } Date::Date(string str){ // input format is M/D/YYYY set_date(str); } bool Date::operator==(const Date& rhs){ if ( (day == rhs.day) && (month == rhs.month) && (year == rhs.year)) return true; else return false; } bool Date::operator!=(const Date& rhs){ return !(*this == rhs); } bool Date::check_date(){ // Leap years are those years divisible by 4, // except for century years whose number is not divisible by 400. if (day<1) return false; // 31: Jan March May July August October December // 30: April, June, September, November, // 29: Feb switch (month){ case Jan: case Mar: case May: case Jul: case Aug: case Oct: case Dec: if (day>31) return false; break; case Apr: case Jun: case Sep: case Nov: if (day > 30) return false; break; case Feb: if (day > 29) return false; else if (day == 28 & year%4 == 0){ if (year%100 == 0 & year%400 == 0) return false; else return true; } else return true; break; default: return false; } return true; } bool Date::set_date(string str){ // input format is M/D/YYYY month = atoi(str.substr(0, str.find('/')).c_str()); str = str.substr(str.find('/')+1).c_str(); day = atoi(str.substr(0, str.find('/')).c_str()); str = str.substr(str.find('/')+1).c_str(); year = atoi(str.c_str()); if (check_date()==false){ cout << "Error! Invalid date!" << endl; cout << "Date set to default!" << endl; day = 1; month = 1; year = 1970; return false; } return true; } bool Date::set_date(int day, int month, int year){ this->month = month; this->day = day; this->year = year; if (check_date()==false){ cout << "Error! Invalid date!" << endl; cout << "Date set to default!" << endl; this->day = 1; this->month = 1; this->year = 1970; return false; } return true; } void Date::print_date(string type){ string month_str; switch( month ) { case Jan: month_str = "January"; break; case Feb: month_str = "February"; break; case Mar: month_str = "March"; break; case Apr: month_str = "April"; break; case May: month_str = "May"; break; case Jun: month_str = "June"; break; case Jul: month_str = "July"; break; case Aug: month_str = "August"; break; case Sep: month_str = "September"; break; case Oct: month_str = "October"; break; case Nov: month_str = "November"; break; case Dec: month_str = "December"; break; } if (type == "M/D/YYYY") cout << month <<'/' << day << '/' << year << endl; else if (type == "Month D, YYYY") cout << month_str <<' ' << day << ", " << year << endl; else if (type == "D-Month-YYYY") cout << day << '-' << month_str << '-' << year << endl; else cout << "Wrong print type!" << endl; } string Date::get_date(){ ostringstream ss; ss << month << "/" << day << "/" << year; string str = ss.str(); return str; }
[ "asvilesov@gmail.com" ]
asvilesov@gmail.com
0f90aca22358b6dd0a2278449b80851a24a354fb
9225506f780f76d3f1fbd4a20c6c935b622de57e
/middle-of-the-linked-list/middle-of-the-linked-list.cpp
83aba12e3bc0b7e3868d7ed9c249a8ba57a4d783
[]
no_license
james1993/Algorithm-Solutions
fe73f9ef6fc655aea3fedec34db3a6c2d130c785
4914b820c8ad390d4241ff36f349a7e7b58af9a4
refs/heads/main
2023-07-10T06:00:38.235476
2021-08-12T02:19:48
2021-08-12T02:19:48
350,109,520
1
0
null
null
null
null
UTF-8
C++
false
false
576
cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* middleNode(ListNode* head) { ListNode* slow = head; ListNode* fast = head; while(fast != NULL && fast->next != NULL) { slow = slow->next; fast = fast->next->next; } return slow; } };
[ "jamesogletree@gmail.com" ]
jamesogletree@gmail.com
229e81564290d5a3d9bdefcf745d633032b7b2fa
d0ae6a4d45f1fc2a224a0f7a962bff66a8db7d38
/src/Urho3D/Source/Game/MayaScape/BUFF.cpp
921049874984a3d9178f8821adccdaa8be7a4627
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
ajaybhaga/MSLegacy_Build1
3b62cdfd6f5f06e56f5583ca3e0fdf4d95aac526
6922b9d6a7af2b5f79b84735494adc7b431b50cc
refs/heads/master
2022-12-08T01:44:11.046343
2020-08-26T14:22:34
2020-08-26T14:22:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,157
cpp
#include <Urho3D/Core/Context.h> #include <Urho3D/Graphics/AnimationController.h> #include <Urho3D/Graphics/Graphics.h> #include <Urho3D/Resource/ResourceCache.h> #include <Urho3D/IO/MemoryBuffer.h> #include <Urho3D/Physics/PhysicsEvents.h> #include <Urho3D/Physics/PhysicsWorld.h> #include <Urho3D/Physics/RigidBody.h> #include <Urho3D/Scene/Scene.h> #include <Urho3D/Input/Input.h> #include <Urho3D/Scene/SceneEvents.h> #include <Urho3D/IO/Log.h> #include <Urho3D/Urho2D/Sprite2D.h> #include <Urho3D/Urho2D/CollisionBox2D.h> #include <Urho3D/Urho2D/PhysicsWorld2D.h> #include <Urho3D/Urho2D/PhysicsEvents2D.h> #include <Urho3D/Urho2D/RigidBody2D.h> #include <Urho3D/Network/Network.h> #include <Urho3D/Network/NetworkEvents.h> #include <Urho3D/Urho2D/Sprite2D.h> #include <Urho3D/Urho2D/AnimatedSprite2D.h> #include <Urho3D/Urho2D/AnimationSet2D.h> #include "BUFF.h" BUFF::BUFF(Context *context) : LogicComponent(context) { //SetUpdateEventMask(USE_FIXEDUPDATE); //SetUpdateEventMask(USE_UPDATE); } void BUFF::RegisterObject(Context* context) { context->RegisterFactory<BUFF>(); } void BUFF::Start() { } void BUFF::Update(float timeStep) { }
[ "nitro-kitty@localhost.localdomain" ]
nitro-kitty@localhost.localdomain
3c446af4841d13b06ee2f2470ffb7ef3105f29ea
fb6c478b0ae9c7ada173a8e38191cce7a928b8bc
/src/base/components/CastShadow.h
0a11389153f37fda973c5416c526b5ead83ee6f9
[ "MIT" ]
permissive
sleepy-monax/oke-oyibo
93986ede8175c4df984ee7874c70d5b45c2d98dd
211b607149299e750ebaf5f9a0127ce3428d74d2
refs/heads/main
2023-02-04T16:25:15.661603
2020-12-08T17:50:34
2020-12-08T17:50:34
299,573,509
1
1
null
null
null
null
UTF-8
C++
false
false
157
h
#pragma once #include <utils/Vec.h> namespace base { struct CastShadow { int size; utils::Vec2f offset; }; } // namespace base
[ "nicolas.van.bossuyt@gmail.com" ]
nicolas.van.bossuyt@gmail.com
eb4e45345f72ada631e0a98a0df1210b4a8033b3
349f6a9ef0f285fe3fa9c38df6a549f652587cbe
/common/src/ICDCode.cpp
46d44e0801660d3eb9a8fa4ad8b66314caa4e820
[]
no_license
metaldrummer610/spsu-swe3613-team-7
f863de427bdb8c7efcb661ba2642d9ba203da8a6
ecf9991087d564fefbc67a43e5092be9fdd0be26
refs/heads/master
2021-01-15T10:42:44.546440
2011-11-15T06:17:26
2011-11-15T06:17:26
32,129,811
0
0
null
null
null
null
UTF-8
C++
false
false
519
cpp
#include "ICDCode.h" #include <string> #include <sstream> #include <iostream> std::ostream& operator<<(std::ostream& out, ICDCode* code) { std::string codeType; if(code->getType() == CodeType::ICD9) codeType = "ICD 9"; else if(code->getType() == CodeType::ICD10) codeType = "ICD 10"; else codeType = "Unknown!"; std::stringstream ss; ss << codeType << "[code: " << code->getCode() << ", desc: " << code->getDesc() << ", flags: " << code->getFlags() << "]"; out << ss.str(); return out; }
[ "metaldrummer610@gmail.com@ed6783c8-10f8-4bb5-9a95-a202f4ab0a17" ]
metaldrummer610@gmail.com@ed6783c8-10f8-4bb5-9a95-a202f4ab0a17
86e02fefa66f0ae26e032fb2fa20638139b62d4c
4bdf5f0909597a11891594871ee8e834b42877ee
/leetcode/979/979.cpp
f2671c7a5f38bb84b6bd06d92e2d9eadd1fa344e
[]
no_license
john801205/practice
5832c15e2f6814f315a45a24191a44e628641361
58d3ac34101ea5941b34f699f074e9da54420873
refs/heads/master
2021-03-27T11:00:25.428040
2019-07-20T15:22:44
2019-07-20T15:22:44
113,650,225
0
0
null
null
null
null
UTF-8
C++
false
false
1,078
cpp
#include <cassert> #include <cmath> struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class Solution { public: int distributeCoins(TreeNode* root) { int moves = 0; dfs(root, moves); return moves; } int dfs(TreeNode *node, int &moves) { if (node == nullptr) return 0; int value = node->val; value -= dfs(node->left, moves); value -= dfs(node->right, moves); moves += std::abs(1 - value); return 1 - value; } }; int main() { Solution s; TreeNode *root = new TreeNode(1); root->left = new TreeNode(0); root->right = new TreeNode(0); root->left->right = new TreeNode(3); assert(s.distributeCoins(root) == 4); root = new TreeNode(3); root->left = new TreeNode(0); root->right = new TreeNode(0); assert(s.distributeCoins(root) == 2); root = new TreeNode(0); root->left = new TreeNode(3); root->right = new TreeNode(0); assert(s.distributeCoins(root) == 3); return 0; }
[ "b99902018@ntu.edu.tw" ]
b99902018@ntu.edu.tw
9f371a59d9383c1757f0f318ed1a54c08aa3be4b
43fdb7daaf010408214f47550db790e7b44a78e7
/main_5.cpp
f896efea48b636ed61f36e9485e86c4b6046ee44
[]
no_license
Sofia-17/task_5
40d9112cda6b699378086ac223e2f46b73d45470
14a93a39db043427832effa38883c024772cbd18
refs/heads/main
2023-05-10T13:56:11.555513
2021-06-02T07:18:04
2021-06-02T07:18:04
373,075,793
0
0
null
null
null
null
UTF-8
C++
false
false
11,130
cpp
#include <cmath> #include <iostream> #include <vector> #include <chrono> #include <algorithm> #include <float.h> #include <fstream> #include "CImg.h" using namespace std; struct Color { int red; int green; int blue; inline Color(int r = 0, int g = 0, int b = 0) { red = r; green = g; blue = b; } }; #define PI 3.1415926 double xl = 0, yl = 0, zl = 0; double maxDist = 0; double minDist = DBL_MAX; #define SPECULARITY 10 class Vector3 { public: double x, y, z; Vector3(double x = 0, double y = 0, double z = 0) { this->x = x; this->y = y; this->z = z; } Vector3 normalize() { double r = sqrt(x * x + y * y + z * z); return Vector3(x / r, y / r, z / r); } double operator*(const Vector3& r) { double touch = 0; touch += x * r.x + y * r.y + z * r.z; return touch; } Vector3 operator*(double r) { return {x*r,y*r,z*r}; } Vector3 operator-(const Vector3& r) { return Vector3(x - r.x,y - r.y,z - r.z); } Vector3 operator+(const Vector3& r) { return Vector3(x + r.x, y + r.y, z + r.z); } double length() const { return sqrt(x * x + y * y + z * z); } bool operator>(const Vector3& r) { if (length() > r.length()) { return true; } return false; } Vector3 crossProduct(Vector3 b) { Vector3 c; c.x = y * b.z - z * b.y; c.y = z * b.x - x * b.z; c.z = x * b.y - y * b.x; return c; } Vector3 operator-() { return Vector3(-x, -y, -z); } }; class Object { protected: Vector3 v0; public: Color col; virtual bool intersect(double, double, double, double, double, double, double&, bool&) = 0; virtual Color pixelColor(double, double, double) = 0; virtual void setColor(Color) = 0; virtual Vector3 getCenter() = 0; }; class Sphere : public Object { double R; public: Sphere(Vector3 v0, double R, Color col = Color(255,0,0)) { this->v0 = v0; this->R = R; this->col = col; } bool intersect(double A, double B, double C, double xc, double yc, double zc, double& touch, bool& tch) override { double d1 = ((v0.x-xc) * A / B + (v0.y-yc) + (v0.z-zc) * C / B) * ((v0.x-xc) * A / B + (v0.y-yc) + (v0.z-zc) * C / B) - (A * A / (B * B) + 1 + C * C / (B * B)) * ((v0.x-xc) * (v0.x-xc) + (v0.y-yc) * (v0.y-yc) + (v0.z-zc) * (v0.z-zc) - R * R); if (d1 >= 0) { double y1 = (((v0.x-xc) * A / B + (v0.y-yc) + (v0.z-zc) * C / B) + sqrt(d1)) / (A * A / (B * B) + 1 + C * C / (B * B)); double y2 = (((v0.x-xc) * A / B + (v0.y-yc) + (v0.z-zc) * C / B) - sqrt(d1)) / (A * A / (B * B) + 1 + C * C / (B * B)); if (d1 == 0) { tch = true; } else { tch = false; } touch = min(y1, y2); return true; } touch = 0; tch = 0; return false; } Color pixelColor(double x, double y, double z) override { Vector3 n(2 * (x - v0.x), 2 * (y - v0.y), 2 * (z - v0.z)); n = n.normalize(); Vector3 a(xl - x, yl - y, zl - z); a = a.normalize(); Color c = col; double light = n * a; Vector3 gloss = (n * (n * a)) * 2 - a; gloss = gloss.normalize(); double glossiness = - (gloss * Vector3(x,y,z).normalize()); if (glossiness < 0) { glossiness = 0; } glossiness = pow(glossiness, SPECULARITY); if (light < 0) { light = 0; glossiness = 0; } c.red = static_cast<int>(min(c.red * light + 10 + 255*glossiness,255.0)); c.green = static_cast<int>(min(c.green * light + 10+255*glossiness, 255.0)); c.blue = static_cast<int>(min(c.blue * light + 10+255*glossiness, 255.0)); return c; } void setColor(Color c) override { col = c; } Vector3 getCenter() override { return v0; } }; class Treygolnik : public Object { Vector3 v1; Vector3 v2; double Ap, Bp, Cp, Dp; public: Treygolnik(Vector3 v0, Vector3 v1, Vector3 v2, Color col = Color(255, 0, 0)) { this->v0 = v0; this->v1 = v1; this->v2 = v2; this->col = col; Ap = (v1.y - v0.y) * (v2.z - v0.z) - (v1.z - v0.z) * (v2.y - v0.y); Bp = (v1.z - v0.z) * (v2.x - v0.x) - (v1.x - v0.x) * (v2.z - v0.z); Cp = (v1.x - v0.x) * (v2.y - v0.y) - (v1.y - v0.y) * (v2.x - v0.x); Dp = -Ap * v0.x - Bp * v0.y - Cp * v0.z; } bool intersect(double A, double B, double C, double xc, double yc, double zc, double& touch, bool& tch) override { double nozir = (Ap * A + Bp * B + Cp * C); if (abs(nozir) < DBL_MIN) { return false; } double t = - Dp / nozir; double xo = A * t; double yo = B * t; double zo = C * t; Vector3 o(xo, yo, zo); Vector3 a(v0.x, v0.y, v0.z); Vector3 b(v1.x, v1.y, v1.z); Vector3 c(v2.x, v2.y, v2.z); Vector3 n1 = (o - a).crossProduct(b - a); Vector3 n2 = (o - b).crossProduct(c - b); Vector3 n3 = (o - c).crossProduct(a - c); if (n1 * n2 < 0 || n1 * n3 < 0 || n2 * n3 < 0) { touch = 0; tch = false; return false; } touch = yo; tch = false; return true; } Color pixelColor(double x, double y, double z) override { Vector3 n(Ap, Bp, Cp); n = n.normalize(); Vector3 a(xl - x, yl - y, zl - z); if (a * n < 0) { n = -n; } a = a.normalize(); Color c = col; double light = n * a; if (light < 0) { light = 0; } c.red = static_cast<int>(min(c.red * light + 10, 255.0)); c.green = static_cast<int>(min(c.green * light + 10, 255.0)); c.blue = static_cast<int>(min(c.blue * light + 10, 255.0)); return c; } void setColor(Color c) override { col = c; } Vector3 getCenter() override { Vector3 center; center.x = min(min(v0.x,v1.x),v2.x) + (max(max(v0.x,v1.x),v2.x) - min(min(v0.x,v1.x),v2.x))/2; center.y = min(min(v0.y,v1.y),v2.y) + (max(max(v0.y,v1.y),v2.y) - min(min(v0.y,v1.y),v2.y))/2;; center.z = min(min(v0.z,v1.z),v2.z) + (max(max(v0.z,v1.z),v2.z) - min(min(v0.z,v1.z),v2.z))/2;; return center; } }; class Cube : public Object { vector<Treygolnik*> s; int c = 0; public: Cube(Vector3 center, Vector3 v0,Vector3 v1,Vector3 v2,Vector3 v3, double a) { this->v0 = center; Vector3 point2 = v0 - v1 * a; Vector3 point3 = v0 - v2 * a; Vector3 point4 = v0 - v3 * a; Vector3 point5 = v0 - v1 * a - v2 * a; Vector3 point6 = v0 - v1 * a - v3 * a; Vector3 point7 = v0 - v2 * a - v3 * a; Vector3 point8 = v0 - v1 * a - v2 * a - v3 * a; s.push_back(new Treygolnik(v0, point2, point3)); s.push_back(new Treygolnik(point3, point2, point5)); s.push_back(new Treygolnik(point7, point4, point6)); s.push_back(new Treygolnik(point7, point6, point8)); s.push_back(new Treygolnik(point3, v0, point4)); s.push_back(new Treygolnik(point3, point4, point7)); s.push_back(new Treygolnik(point5, point2, point6)); s.push_back(new Treygolnik(point5, point6, point8)); s.push_back(new Treygolnik(point3, point7, point5)); s.push_back(new Treygolnik(point7, point8, point5)); s.push_back(new Treygolnik(v0, point4, point2)); s.push_back(new Treygolnik(point4, point2, point6)); } bool intersect(double A, double B, double C, double xc, double yc, double zc, double &touch, bool &tch) override { double cubeymax = DBL_MAX; bool found = false; double touch1 = 0; double tch1 = 0; for (int i = 0; i < s.size(); i++) { if (s[i]->intersect(A, B, C, xc, yc, zc, touch, tch)) { if (touch < cubeymax) { cubeymax = touch; c = i; found = true; touch1 = touch; tch1 = tch; } } } touch = touch1; tch = tch1; return found; } Color pixelColor(double x, double y, double z) override { return s[c]->pixelColor(x,y,z); } void setColor(Color c) override { col = c; for (int i = 0; i < s.size(); i++) { s[i]->col = c; } } Vector3 getCenter() override { return v0; } }; int main() { vector<Object*> objs; double fov; int x, y; ifstream in("conf.txt"); in >> fov >> x >> y; if (x % 2 != 0) { x++; } if (y % 2 != 0) { y++; } cimg_library::CImg<unsigned char> image(x,y,1,3,0); cimg_library::CImgDisplay display(image, "raytracing"); double scry = sqrt(static_cast<double>(x * x) / (2 * (1 - cos(fov / 180 * PI))) - static_cast<double>(x * x) / 4); in >> xl >> yl >> zl; while (!in.eof()) { std::string name; in >> name; if (name == "sphere") { double x0, y0, z0, r; in >> x0 >> y0 >> z0 >> r; Vector3 v0 = Vector3(x0,y0,z0); if (v0.length() > maxDist) { maxDist = v0.length(); } if (v0.length() < minDist) { minDist = v0.length(); } objs.push_back(new Sphere(v0, r)); } else if (name == "cube") { double x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4, a; in >> x1 >> y1 >> z1 >> x2 >> y2 >> z2 >> x3 >> y3 >> z3 >> x4 >> y4 >> z4 >> a; Vector3 v0; v0 = Vector3(x1, y1, z1) - Vector3(x2, y2, z2) * (a / 2) - Vector3(x3, y3, z3) * (a / 2) - Vector3(x4, y4, z4) * (a / 2); if (v0.length() > maxDist) { maxDist = v0.length(); } if (v0.length() < minDist) { minDist = v0.length(); } objs.push_back(new Cube(v0,Vector3(x1, y1, z1), Vector3(x2, y2, z2), Vector3(x3, y3, z3), Vector3(x4,y4,z4),a)); } } for (Object* o : objs) { double shade; if (maxDist == minDist) { shade = 0; } else { shade = ((255.0 / (maxDist - minDist))) * o->getCenter().length() - (255.0 * minDist) / (maxDist - minDist); } if (shade < 0) shade = 0; if (shade > 255) shade = 255; Color c(255 - shade, shade, 0); o->setColor(c); } std::chrono::time_point<std::chrono::system_clock> start = std::chrono::system_clock::now(); #pragma omp parallel for for (int i = -y / 2; i < y / 2; i++) { #pragma omp parallel for for (int j = -x / 2; j < x / 2; j++) { bool pixelSet = false; double cury = DBL_MAX; for (Object* o : objs) { double yx; bool tch; if (o->intersect(j, scry, i, 0, 0, 0, yx, tch)) { if (yx < cury) { cury = yx; Color c = o->pixelColor(static_cast<double>(j) * yx / scry, yx, static_cast<double>(i) * yx / scry); unsigned char color[3] = { (unsigned char)c.red,(unsigned char)c.green,(unsigned char)c.blue }; image.draw_point(x / 2 + j, y / 2 + i, color); pixelSet = true; } } } if (!pixelSet) { unsigned char color[3] = {(unsigned char)0,(unsigned char)0,(unsigned char)0}; image.draw_point(x / 2 + j, y / 2 + i, color); } } } std::chrono::time_point<std::chrono::system_clock> end = std::chrono::system_clock::now(); int elapsed_ms = static_cast<int>(std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count()); std::cout << "Render took: " << elapsed_ms << " ms\n"; display.display(image); image.save("test.bmp"); while (!display.is_closed()) display.wait(); }
[ "noreply@github.com" ]
noreply@github.com
836a360dc5577551d7ad86ebcdaf27fc35643be0
b37d708f880ccd1b97eec929d603e860d0a202e2
/autogenerated/claimresponse-pskel.cxx
295c9411a70c28cb2f8787d4abba76dc03ad7611
[]
no_license
lucatoldo/arduino-fhir
a19b03e0a194fd54b31036da504c21dd06929fd0
d591300758fb7e294265ccf974036fff706d9fcb
refs/heads/master
2021-05-17T12:19:47.518299
2020-03-28T11:05:15
2020-03-28T11:05:15
250,772,241
0
0
null
2020-03-28T11:03:27
2020-03-28T11:03:27
null
UTF-8
C++
false
false
205,626
cxx
// Copyright (c) 2005-2020 Code Synthesis Tools CC. // // This program was generated by CodeSynthesis XSD/e, an XML Schema // to C++ data binding compiler for embedded systems. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // 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. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // // // Begin prologue. // // // End prologue. #include <xsde/cxx/pre.hxx> #include "claimresponse-pskel.hxx" namespace fhir { // ClaimResponse_pskel // void ClaimResponse_pskel:: identifier_parser (::fhir::Identifier_pskel& p) { this->identifier_parser_ = &p; } void ClaimResponse_pskel:: status_parser (::fhir::FinancialResourceStatusCodes_pskel& p) { this->status_parser_ = &p; } void ClaimResponse_pskel:: type_parser (::fhir::CodeableConcept_pskel& p) { this->type_parser_ = &p; } void ClaimResponse_pskel:: subType_parser (::fhir::CodeableConcept_pskel& p) { this->subType_parser_ = &p; } void ClaimResponse_pskel:: use_parser (::fhir::Use_pskel& p) { this->use_parser_ = &p; } void ClaimResponse_pskel:: patient_parser (::fhir::Reference_pskel& p) { this->patient_parser_ = &p; } void ClaimResponse_pskel:: created_parser (::fhir::dateTime_pskel& p) { this->created_parser_ = &p; } void ClaimResponse_pskel:: insurer_parser (::fhir::Reference_pskel& p) { this->insurer_parser_ = &p; } void ClaimResponse_pskel:: requestor_parser (::fhir::Reference_pskel& p) { this->requestor_parser_ = &p; } void ClaimResponse_pskel:: request_parser (::fhir::Reference_pskel& p) { this->request_parser_ = &p; } void ClaimResponse_pskel:: outcome_parser (::fhir::ClaimProcessingCodes_pskel& p) { this->outcome_parser_ = &p; } void ClaimResponse_pskel:: disposition_parser (::fhir::string_pskel& p) { this->disposition_parser_ = &p; } void ClaimResponse_pskel:: preAuthRef_parser (::fhir::string_pskel& p) { this->preAuthRef_parser_ = &p; } void ClaimResponse_pskel:: preAuthPeriod_parser (::fhir::Period_pskel& p) { this->preAuthPeriod_parser_ = &p; } void ClaimResponse_pskel:: payeeType_parser (::fhir::CodeableConcept_pskel& p) { this->payeeType_parser_ = &p; } void ClaimResponse_pskel:: item_parser (::fhir::ClaimResponse_Item_pskel& p) { this->item_parser_ = &p; } void ClaimResponse_pskel:: addItem_parser (::fhir::ClaimResponse_AddItem_pskel& p) { this->addItem_parser_ = &p; } void ClaimResponse_pskel:: adjudication_parser (::fhir::ClaimResponse_Adjudication_pskel& p) { this->adjudication_parser_ = &p; } void ClaimResponse_pskel:: total_parser (::fhir::ClaimResponse_Total_pskel& p) { this->total_parser_ = &p; } void ClaimResponse_pskel:: payment_parser (::fhir::ClaimResponse_Payment_pskel& p) { this->payment_parser_ = &p; } void ClaimResponse_pskel:: fundsReserve_parser (::fhir::CodeableConcept_pskel& p) { this->fundsReserve_parser_ = &p; } void ClaimResponse_pskel:: formCode_parser (::fhir::CodeableConcept_pskel& p) { this->formCode_parser_ = &p; } void ClaimResponse_pskel:: form_parser (::fhir::Attachment_pskel& p) { this->form_parser_ = &p; } void ClaimResponse_pskel:: processNote_parser (::fhir::ClaimResponse_ProcessNote_pskel& p) { this->processNote_parser_ = &p; } void ClaimResponse_pskel:: communicationRequest_parser (::fhir::Reference_pskel& p) { this->communicationRequest_parser_ = &p; } void ClaimResponse_pskel:: insurance_parser (::fhir::ClaimResponse_Insurance_pskel& p) { this->insurance_parser_ = &p; } void ClaimResponse_pskel:: error_parser (::fhir::ClaimResponse_Error_pskel& p) { this->error_parser_ = &p; } void ClaimResponse_pskel:: parsers (::fhir::id_pskel& id, ::fhir::Meta_pskel& meta, ::fhir::uri_pskel& implicitRules, ::fhir::code_pskel& language, ::fhir::Narrative_pskel& text, ::fhir::ResourceContainer_pskel& contained, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::Identifier_pskel& identifier, ::fhir::FinancialResourceStatusCodes_pskel& status, ::fhir::CodeableConcept_pskel& type, ::fhir::CodeableConcept_pskel& subType, ::fhir::Use_pskel& use, ::fhir::Reference_pskel& patient, ::fhir::dateTime_pskel& created, ::fhir::Reference_pskel& insurer, ::fhir::Reference_pskel& requestor, ::fhir::Reference_pskel& request, ::fhir::ClaimProcessingCodes_pskel& outcome, ::fhir::string_pskel& disposition, ::fhir::string_pskel& preAuthRef, ::fhir::Period_pskel& preAuthPeriod, ::fhir::CodeableConcept_pskel& payeeType, ::fhir::ClaimResponse_Item_pskel& item, ::fhir::ClaimResponse_AddItem_pskel& addItem, ::fhir::ClaimResponse_Adjudication_pskel& adjudication, ::fhir::ClaimResponse_Total_pskel& total, ::fhir::ClaimResponse_Payment_pskel& payment, ::fhir::CodeableConcept_pskel& fundsReserve, ::fhir::CodeableConcept_pskel& formCode, ::fhir::Attachment_pskel& form, ::fhir::ClaimResponse_ProcessNote_pskel& processNote, ::fhir::Reference_pskel& communicationRequest, ::fhir::ClaimResponse_Insurance_pskel& insurance, ::fhir::ClaimResponse_Error_pskel& error) { this->id_parser_ = &id; this->meta_parser_ = &meta; this->implicitRules_parser_ = &implicitRules; this->language_parser_ = &language; this->text_parser_ = &text; this->contained_parser_ = &contained; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->identifier_parser_ = &identifier; this->status_parser_ = &status; this->type_parser_ = &type; this->subType_parser_ = &subType; this->use_parser_ = &use; this->patient_parser_ = &patient; this->created_parser_ = &created; this->insurer_parser_ = &insurer; this->requestor_parser_ = &requestor; this->request_parser_ = &request; this->outcome_parser_ = &outcome; this->disposition_parser_ = &disposition; this->preAuthRef_parser_ = &preAuthRef; this->preAuthPeriod_parser_ = &preAuthPeriod; this->payeeType_parser_ = &payeeType; this->item_parser_ = &item; this->addItem_parser_ = &addItem; this->adjudication_parser_ = &adjudication; this->total_parser_ = &total; this->payment_parser_ = &payment; this->fundsReserve_parser_ = &fundsReserve; this->formCode_parser_ = &formCode; this->form_parser_ = &form; this->processNote_parser_ = &processNote; this->communicationRequest_parser_ = &communicationRequest; this->insurance_parser_ = &insurance; this->error_parser_ = &error; } ClaimResponse_pskel:: ClaimResponse_pskel (::fhir::DomainResource_pskel* tiein) : ::fhir::DomainResource_pskel (tiein, 0), ClaimResponse_impl_ (0), identifier_parser_ (0), status_parser_ (0), type_parser_ (0), subType_parser_ (0), use_parser_ (0), patient_parser_ (0), created_parser_ (0), insurer_parser_ (0), requestor_parser_ (0), request_parser_ (0), outcome_parser_ (0), disposition_parser_ (0), preAuthRef_parser_ (0), preAuthPeriod_parser_ (0), payeeType_parser_ (0), item_parser_ (0), addItem_parser_ (0), adjudication_parser_ (0), total_parser_ (0), payment_parser_ (0), fundsReserve_parser_ (0), formCode_parser_ (0), form_parser_ (0), processNote_parser_ (0), communicationRequest_parser_ (0), insurance_parser_ (0), error_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_pskel:: ClaimResponse_pskel (ClaimResponse_pskel* impl, void*) : ::fhir::DomainResource_pskel (impl, 0), ClaimResponse_impl_ (impl), identifier_parser_ (0), status_parser_ (0), type_parser_ (0), subType_parser_ (0), use_parser_ (0), patient_parser_ (0), created_parser_ (0), insurer_parser_ (0), requestor_parser_ (0), request_parser_ (0), outcome_parser_ (0), disposition_parser_ (0), preAuthRef_parser_ (0), preAuthPeriod_parser_ (0), payeeType_parser_ (0), item_parser_ (0), addItem_parser_ (0), adjudication_parser_ (0), total_parser_ (0), payment_parser_ (0), fundsReserve_parser_ (0), formCode_parser_ (0), form_parser_ (0), processNote_parser_ (0), communicationRequest_parser_ (0), insurance_parser_ (0), error_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_Item_pskel // void ClaimResponse_Item_pskel:: itemSequence_parser (::fhir::positiveInt_pskel& p) { this->itemSequence_parser_ = &p; } void ClaimResponse_Item_pskel:: noteNumber_parser (::fhir::positiveInt_pskel& p) { this->noteNumber_parser_ = &p; } void ClaimResponse_Item_pskel:: adjudication_parser (::fhir::ClaimResponse_Adjudication_pskel& p) { this->adjudication_parser_ = &p; } void ClaimResponse_Item_pskel:: detail_parser (::fhir::ClaimResponse_Detail_pskel& p) { this->detail_parser_ = &p; } void ClaimResponse_Item_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::positiveInt_pskel& itemSequence, ::fhir::positiveInt_pskel& noteNumber, ::fhir::ClaimResponse_Adjudication_pskel& adjudication, ::fhir::ClaimResponse_Detail_pskel& detail) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->itemSequence_parser_ = &itemSequence; this->noteNumber_parser_ = &noteNumber; this->adjudication_parser_ = &adjudication; this->detail_parser_ = &detail; } ClaimResponse_Item_pskel:: ClaimResponse_Item_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_Item_impl_ (0), itemSequence_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), detail_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_Item_pskel:: ClaimResponse_Item_pskel (ClaimResponse_Item_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_Item_impl_ (impl), itemSequence_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), detail_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_Adjudication_pskel // void ClaimResponse_Adjudication_pskel:: category_parser (::fhir::CodeableConcept_pskel& p) { this->category_parser_ = &p; } void ClaimResponse_Adjudication_pskel:: reason_parser (::fhir::CodeableConcept_pskel& p) { this->reason_parser_ = &p; } void ClaimResponse_Adjudication_pskel:: amount_parser (::fhir::Money_pskel& p) { this->amount_parser_ = &p; } void ClaimResponse_Adjudication_pskel:: value_parser (::fhir::decimal_pskel& p) { this->value_parser_ = &p; } void ClaimResponse_Adjudication_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::CodeableConcept_pskel& category, ::fhir::CodeableConcept_pskel& reason, ::fhir::Money_pskel& amount, ::fhir::decimal_pskel& value) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->category_parser_ = &category; this->reason_parser_ = &reason; this->amount_parser_ = &amount; this->value_parser_ = &value; } ClaimResponse_Adjudication_pskel:: ClaimResponse_Adjudication_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_Adjudication_impl_ (0), category_parser_ (0), reason_parser_ (0), amount_parser_ (0), value_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_Adjudication_pskel:: ClaimResponse_Adjudication_pskel (ClaimResponse_Adjudication_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_Adjudication_impl_ (impl), category_parser_ (0), reason_parser_ (0), amount_parser_ (0), value_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_Detail_pskel // void ClaimResponse_Detail_pskel:: detailSequence_parser (::fhir::positiveInt_pskel& p) { this->detailSequence_parser_ = &p; } void ClaimResponse_Detail_pskel:: noteNumber_parser (::fhir::positiveInt_pskel& p) { this->noteNumber_parser_ = &p; } void ClaimResponse_Detail_pskel:: adjudication_parser (::fhir::ClaimResponse_Adjudication_pskel& p) { this->adjudication_parser_ = &p; } void ClaimResponse_Detail_pskel:: subDetail_parser (::fhir::ClaimResponse_SubDetail_pskel& p) { this->subDetail_parser_ = &p; } void ClaimResponse_Detail_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::positiveInt_pskel& detailSequence, ::fhir::positiveInt_pskel& noteNumber, ::fhir::ClaimResponse_Adjudication_pskel& adjudication, ::fhir::ClaimResponse_SubDetail_pskel& subDetail) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->detailSequence_parser_ = &detailSequence; this->noteNumber_parser_ = &noteNumber; this->adjudication_parser_ = &adjudication; this->subDetail_parser_ = &subDetail; } ClaimResponse_Detail_pskel:: ClaimResponse_Detail_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_Detail_impl_ (0), detailSequence_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), subDetail_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_Detail_pskel:: ClaimResponse_Detail_pskel (ClaimResponse_Detail_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_Detail_impl_ (impl), detailSequence_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), subDetail_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_SubDetail_pskel // void ClaimResponse_SubDetail_pskel:: subDetailSequence_parser (::fhir::positiveInt_pskel& p) { this->subDetailSequence_parser_ = &p; } void ClaimResponse_SubDetail_pskel:: noteNumber_parser (::fhir::positiveInt_pskel& p) { this->noteNumber_parser_ = &p; } void ClaimResponse_SubDetail_pskel:: adjudication_parser (::fhir::ClaimResponse_Adjudication_pskel& p) { this->adjudication_parser_ = &p; } void ClaimResponse_SubDetail_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::positiveInt_pskel& subDetailSequence, ::fhir::positiveInt_pskel& noteNumber, ::fhir::ClaimResponse_Adjudication_pskel& adjudication) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->subDetailSequence_parser_ = &subDetailSequence; this->noteNumber_parser_ = &noteNumber; this->adjudication_parser_ = &adjudication; } ClaimResponse_SubDetail_pskel:: ClaimResponse_SubDetail_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_SubDetail_impl_ (0), subDetailSequence_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_SubDetail_pskel:: ClaimResponse_SubDetail_pskel (ClaimResponse_SubDetail_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_SubDetail_impl_ (impl), subDetailSequence_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_AddItem_pskel // void ClaimResponse_AddItem_pskel:: itemSequence_parser (::fhir::positiveInt_pskel& p) { this->itemSequence_parser_ = &p; } void ClaimResponse_AddItem_pskel:: detailSequence_parser (::fhir::positiveInt_pskel& p) { this->detailSequence_parser_ = &p; } void ClaimResponse_AddItem_pskel:: subdetailSequence_parser (::fhir::positiveInt_pskel& p) { this->subdetailSequence_parser_ = &p; } void ClaimResponse_AddItem_pskel:: provider_parser (::fhir::Reference_pskel& p) { this->provider_parser_ = &p; } void ClaimResponse_AddItem_pskel:: productOrService_parser (::fhir::CodeableConcept_pskel& p) { this->productOrService_parser_ = &p; } void ClaimResponse_AddItem_pskel:: modifier_parser (::fhir::CodeableConcept_pskel& p) { this->modifier_parser_ = &p; } void ClaimResponse_AddItem_pskel:: programCode_parser (::fhir::CodeableConcept_pskel& p) { this->programCode_parser_ = &p; } void ClaimResponse_AddItem_pskel:: servicedDate_parser (::fhir::date_pskel& p) { this->servicedDate_parser_ = &p; } void ClaimResponse_AddItem_pskel:: servicedPeriod_parser (::fhir::Period_pskel& p) { this->servicedPeriod_parser_ = &p; } void ClaimResponse_AddItem_pskel:: locationCodeableConcept_parser (::fhir::CodeableConcept_pskel& p) { this->locationCodeableConcept_parser_ = &p; } void ClaimResponse_AddItem_pskel:: locationAddress_parser (::fhir::Address_pskel& p) { this->locationAddress_parser_ = &p; } void ClaimResponse_AddItem_pskel:: locationReference_parser (::fhir::Reference_pskel& p) { this->locationReference_parser_ = &p; } void ClaimResponse_AddItem_pskel:: quantity_parser (::fhir::Quantity_pskel& p) { this->quantity_parser_ = &p; } void ClaimResponse_AddItem_pskel:: unitPrice_parser (::fhir::Money_pskel& p) { this->unitPrice_parser_ = &p; } void ClaimResponse_AddItem_pskel:: factor_parser (::fhir::decimal_pskel& p) { this->factor_parser_ = &p; } void ClaimResponse_AddItem_pskel:: net_parser (::fhir::Money_pskel& p) { this->net_parser_ = &p; } void ClaimResponse_AddItem_pskel:: bodySite_parser (::fhir::CodeableConcept_pskel& p) { this->bodySite_parser_ = &p; } void ClaimResponse_AddItem_pskel:: subSite_parser (::fhir::CodeableConcept_pskel& p) { this->subSite_parser_ = &p; } void ClaimResponse_AddItem_pskel:: noteNumber_parser (::fhir::positiveInt_pskel& p) { this->noteNumber_parser_ = &p; } void ClaimResponse_AddItem_pskel:: adjudication_parser (::fhir::ClaimResponse_Adjudication_pskel& p) { this->adjudication_parser_ = &p; } void ClaimResponse_AddItem_pskel:: detail_parser (::fhir::ClaimResponse_Detail1_pskel& p) { this->detail_parser_ = &p; } void ClaimResponse_AddItem_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::positiveInt_pskel& itemSequence, ::fhir::positiveInt_pskel& detailSequence, ::fhir::positiveInt_pskel& subdetailSequence, ::fhir::Reference_pskel& provider, ::fhir::CodeableConcept_pskel& productOrService, ::fhir::CodeableConcept_pskel& modifier, ::fhir::CodeableConcept_pskel& programCode, ::fhir::date_pskel& servicedDate, ::fhir::Period_pskel& servicedPeriod, ::fhir::CodeableConcept_pskel& locationCodeableConcept, ::fhir::Address_pskel& locationAddress, ::fhir::Reference_pskel& locationReference, ::fhir::Quantity_pskel& quantity, ::fhir::Money_pskel& unitPrice, ::fhir::decimal_pskel& factor, ::fhir::Money_pskel& net, ::fhir::CodeableConcept_pskel& bodySite, ::fhir::CodeableConcept_pskel& subSite, ::fhir::positiveInt_pskel& noteNumber, ::fhir::ClaimResponse_Adjudication_pskel& adjudication, ::fhir::ClaimResponse_Detail1_pskel& detail) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->itemSequence_parser_ = &itemSequence; this->detailSequence_parser_ = &detailSequence; this->subdetailSequence_parser_ = &subdetailSequence; this->provider_parser_ = &provider; this->productOrService_parser_ = &productOrService; this->modifier_parser_ = &modifier; this->programCode_parser_ = &programCode; this->servicedDate_parser_ = &servicedDate; this->servicedPeriod_parser_ = &servicedPeriod; this->locationCodeableConcept_parser_ = &locationCodeableConcept; this->locationAddress_parser_ = &locationAddress; this->locationReference_parser_ = &locationReference; this->quantity_parser_ = &quantity; this->unitPrice_parser_ = &unitPrice; this->factor_parser_ = &factor; this->net_parser_ = &net; this->bodySite_parser_ = &bodySite; this->subSite_parser_ = &subSite; this->noteNumber_parser_ = &noteNumber; this->adjudication_parser_ = &adjudication; this->detail_parser_ = &detail; } ClaimResponse_AddItem_pskel:: ClaimResponse_AddItem_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_AddItem_impl_ (0), itemSequence_parser_ (0), detailSequence_parser_ (0), subdetailSequence_parser_ (0), provider_parser_ (0), productOrService_parser_ (0), modifier_parser_ (0), programCode_parser_ (0), servicedDate_parser_ (0), servicedPeriod_parser_ (0), locationCodeableConcept_parser_ (0), locationAddress_parser_ (0), locationReference_parser_ (0), quantity_parser_ (0), unitPrice_parser_ (0), factor_parser_ (0), net_parser_ (0), bodySite_parser_ (0), subSite_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), detail_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_AddItem_pskel:: ClaimResponse_AddItem_pskel (ClaimResponse_AddItem_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_AddItem_impl_ (impl), itemSequence_parser_ (0), detailSequence_parser_ (0), subdetailSequence_parser_ (0), provider_parser_ (0), productOrService_parser_ (0), modifier_parser_ (0), programCode_parser_ (0), servicedDate_parser_ (0), servicedPeriod_parser_ (0), locationCodeableConcept_parser_ (0), locationAddress_parser_ (0), locationReference_parser_ (0), quantity_parser_ (0), unitPrice_parser_ (0), factor_parser_ (0), net_parser_ (0), bodySite_parser_ (0), subSite_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), detail_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_Detail1_pskel // void ClaimResponse_Detail1_pskel:: productOrService_parser (::fhir::CodeableConcept_pskel& p) { this->productOrService_parser_ = &p; } void ClaimResponse_Detail1_pskel:: modifier_parser (::fhir::CodeableConcept_pskel& p) { this->modifier_parser_ = &p; } void ClaimResponse_Detail1_pskel:: quantity_parser (::fhir::Quantity_pskel& p) { this->quantity_parser_ = &p; } void ClaimResponse_Detail1_pskel:: unitPrice_parser (::fhir::Money_pskel& p) { this->unitPrice_parser_ = &p; } void ClaimResponse_Detail1_pskel:: factor_parser (::fhir::decimal_pskel& p) { this->factor_parser_ = &p; } void ClaimResponse_Detail1_pskel:: net_parser (::fhir::Money_pskel& p) { this->net_parser_ = &p; } void ClaimResponse_Detail1_pskel:: noteNumber_parser (::fhir::positiveInt_pskel& p) { this->noteNumber_parser_ = &p; } void ClaimResponse_Detail1_pskel:: adjudication_parser (::fhir::ClaimResponse_Adjudication_pskel& p) { this->adjudication_parser_ = &p; } void ClaimResponse_Detail1_pskel:: subDetail_parser (::fhir::ClaimResponse_SubDetail1_pskel& p) { this->subDetail_parser_ = &p; } void ClaimResponse_Detail1_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::CodeableConcept_pskel& productOrService, ::fhir::CodeableConcept_pskel& modifier, ::fhir::Quantity_pskel& quantity, ::fhir::Money_pskel& unitPrice, ::fhir::decimal_pskel& factor, ::fhir::Money_pskel& net, ::fhir::positiveInt_pskel& noteNumber, ::fhir::ClaimResponse_Adjudication_pskel& adjudication, ::fhir::ClaimResponse_SubDetail1_pskel& subDetail) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->productOrService_parser_ = &productOrService; this->modifier_parser_ = &modifier; this->quantity_parser_ = &quantity; this->unitPrice_parser_ = &unitPrice; this->factor_parser_ = &factor; this->net_parser_ = &net; this->noteNumber_parser_ = &noteNumber; this->adjudication_parser_ = &adjudication; this->subDetail_parser_ = &subDetail; } ClaimResponse_Detail1_pskel:: ClaimResponse_Detail1_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_Detail1_impl_ (0), productOrService_parser_ (0), modifier_parser_ (0), quantity_parser_ (0), unitPrice_parser_ (0), factor_parser_ (0), net_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), subDetail_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_Detail1_pskel:: ClaimResponse_Detail1_pskel (ClaimResponse_Detail1_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_Detail1_impl_ (impl), productOrService_parser_ (0), modifier_parser_ (0), quantity_parser_ (0), unitPrice_parser_ (0), factor_parser_ (0), net_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), subDetail_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_SubDetail1_pskel // void ClaimResponse_SubDetail1_pskel:: productOrService_parser (::fhir::CodeableConcept_pskel& p) { this->productOrService_parser_ = &p; } void ClaimResponse_SubDetail1_pskel:: modifier_parser (::fhir::CodeableConcept_pskel& p) { this->modifier_parser_ = &p; } void ClaimResponse_SubDetail1_pskel:: quantity_parser (::fhir::Quantity_pskel& p) { this->quantity_parser_ = &p; } void ClaimResponse_SubDetail1_pskel:: unitPrice_parser (::fhir::Money_pskel& p) { this->unitPrice_parser_ = &p; } void ClaimResponse_SubDetail1_pskel:: factor_parser (::fhir::decimal_pskel& p) { this->factor_parser_ = &p; } void ClaimResponse_SubDetail1_pskel:: net_parser (::fhir::Money_pskel& p) { this->net_parser_ = &p; } void ClaimResponse_SubDetail1_pskel:: noteNumber_parser (::fhir::positiveInt_pskel& p) { this->noteNumber_parser_ = &p; } void ClaimResponse_SubDetail1_pskel:: adjudication_parser (::fhir::ClaimResponse_Adjudication_pskel& p) { this->adjudication_parser_ = &p; } void ClaimResponse_SubDetail1_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::CodeableConcept_pskel& productOrService, ::fhir::CodeableConcept_pskel& modifier, ::fhir::Quantity_pskel& quantity, ::fhir::Money_pskel& unitPrice, ::fhir::decimal_pskel& factor, ::fhir::Money_pskel& net, ::fhir::positiveInt_pskel& noteNumber, ::fhir::ClaimResponse_Adjudication_pskel& adjudication) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->productOrService_parser_ = &productOrService; this->modifier_parser_ = &modifier; this->quantity_parser_ = &quantity; this->unitPrice_parser_ = &unitPrice; this->factor_parser_ = &factor; this->net_parser_ = &net; this->noteNumber_parser_ = &noteNumber; this->adjudication_parser_ = &adjudication; } ClaimResponse_SubDetail1_pskel:: ClaimResponse_SubDetail1_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_SubDetail1_impl_ (0), productOrService_parser_ (0), modifier_parser_ (0), quantity_parser_ (0), unitPrice_parser_ (0), factor_parser_ (0), net_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_SubDetail1_pskel:: ClaimResponse_SubDetail1_pskel (ClaimResponse_SubDetail1_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_SubDetail1_impl_ (impl), productOrService_parser_ (0), modifier_parser_ (0), quantity_parser_ (0), unitPrice_parser_ (0), factor_parser_ (0), net_parser_ (0), noteNumber_parser_ (0), adjudication_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_Total_pskel // void ClaimResponse_Total_pskel:: category_parser (::fhir::CodeableConcept_pskel& p) { this->category_parser_ = &p; } void ClaimResponse_Total_pskel:: amount_parser (::fhir::Money_pskel& p) { this->amount_parser_ = &p; } void ClaimResponse_Total_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::CodeableConcept_pskel& category, ::fhir::Money_pskel& amount) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->category_parser_ = &category; this->amount_parser_ = &amount; } ClaimResponse_Total_pskel:: ClaimResponse_Total_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_Total_impl_ (0), category_parser_ (0), amount_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_Total_pskel:: ClaimResponse_Total_pskel (ClaimResponse_Total_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_Total_impl_ (impl), category_parser_ (0), amount_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_Payment_pskel // void ClaimResponse_Payment_pskel:: type_parser (::fhir::CodeableConcept_pskel& p) { this->type_parser_ = &p; } void ClaimResponse_Payment_pskel:: adjustment_parser (::fhir::Money_pskel& p) { this->adjustment_parser_ = &p; } void ClaimResponse_Payment_pskel:: adjustmentReason_parser (::fhir::CodeableConcept_pskel& p) { this->adjustmentReason_parser_ = &p; } void ClaimResponse_Payment_pskel:: date_parser (::fhir::date_pskel& p) { this->date_parser_ = &p; } void ClaimResponse_Payment_pskel:: amount_parser (::fhir::Money_pskel& p) { this->amount_parser_ = &p; } void ClaimResponse_Payment_pskel:: identifier_parser (::fhir::Identifier_pskel& p) { this->identifier_parser_ = &p; } void ClaimResponse_Payment_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::CodeableConcept_pskel& type, ::fhir::Money_pskel& adjustment, ::fhir::CodeableConcept_pskel& adjustmentReason, ::fhir::date_pskel& date, ::fhir::Money_pskel& amount, ::fhir::Identifier_pskel& identifier) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->type_parser_ = &type; this->adjustment_parser_ = &adjustment; this->adjustmentReason_parser_ = &adjustmentReason; this->date_parser_ = &date; this->amount_parser_ = &amount; this->identifier_parser_ = &identifier; } ClaimResponse_Payment_pskel:: ClaimResponse_Payment_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_Payment_impl_ (0), type_parser_ (0), adjustment_parser_ (0), adjustmentReason_parser_ (0), date_parser_ (0), amount_parser_ (0), identifier_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_Payment_pskel:: ClaimResponse_Payment_pskel (ClaimResponse_Payment_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_Payment_impl_ (impl), type_parser_ (0), adjustment_parser_ (0), adjustmentReason_parser_ (0), date_parser_ (0), amount_parser_ (0), identifier_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_ProcessNote_pskel // void ClaimResponse_ProcessNote_pskel:: number_parser (::fhir::positiveInt_pskel& p) { this->number_parser_ = &p; } void ClaimResponse_ProcessNote_pskel:: type_parser (::fhir::NoteType_pskel& p) { this->type_parser_ = &p; } void ClaimResponse_ProcessNote_pskel:: text_parser (::fhir::string_pskel& p) { this->text_parser_ = &p; } void ClaimResponse_ProcessNote_pskel:: language_parser (::fhir::CodeableConcept_pskel& p) { this->language_parser_ = &p; } void ClaimResponse_ProcessNote_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::positiveInt_pskel& number, ::fhir::NoteType_pskel& type, ::fhir::string_pskel& text, ::fhir::CodeableConcept_pskel& language) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->number_parser_ = &number; this->type_parser_ = &type; this->text_parser_ = &text; this->language_parser_ = &language; } ClaimResponse_ProcessNote_pskel:: ClaimResponse_ProcessNote_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_ProcessNote_impl_ (0), number_parser_ (0), type_parser_ (0), text_parser_ (0), language_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_ProcessNote_pskel:: ClaimResponse_ProcessNote_pskel (ClaimResponse_ProcessNote_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_ProcessNote_impl_ (impl), number_parser_ (0), type_parser_ (0), text_parser_ (0), language_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_Insurance_pskel // void ClaimResponse_Insurance_pskel:: sequence_parser (::fhir::positiveInt_pskel& p) { this->sequence_parser_ = &p; } void ClaimResponse_Insurance_pskel:: focal_parser (::fhir::boolean_pskel& p) { this->focal_parser_ = &p; } void ClaimResponse_Insurance_pskel:: coverage_parser (::fhir::Reference_pskel& p) { this->coverage_parser_ = &p; } void ClaimResponse_Insurance_pskel:: businessArrangement_parser (::fhir::string_pskel& p) { this->businessArrangement_parser_ = &p; } void ClaimResponse_Insurance_pskel:: claimResponse_parser (::fhir::Reference_pskel& p) { this->claimResponse_parser_ = &p; } void ClaimResponse_Insurance_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::positiveInt_pskel& sequence, ::fhir::boolean_pskel& focal, ::fhir::Reference_pskel& coverage, ::fhir::string_pskel& businessArrangement, ::fhir::Reference_pskel& claimResponse) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->sequence_parser_ = &sequence; this->focal_parser_ = &focal; this->coverage_parser_ = &coverage; this->businessArrangement_parser_ = &businessArrangement; this->claimResponse_parser_ = &claimResponse; } ClaimResponse_Insurance_pskel:: ClaimResponse_Insurance_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_Insurance_impl_ (0), sequence_parser_ (0), focal_parser_ (0), coverage_parser_ (0), businessArrangement_parser_ (0), claimResponse_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_Insurance_pskel:: ClaimResponse_Insurance_pskel (ClaimResponse_Insurance_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_Insurance_impl_ (impl), sequence_parser_ (0), focal_parser_ (0), coverage_parser_ (0), businessArrangement_parser_ (0), claimResponse_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimResponse_Error_pskel // void ClaimResponse_Error_pskel:: itemSequence_parser (::fhir::positiveInt_pskel& p) { this->itemSequence_parser_ = &p; } void ClaimResponse_Error_pskel:: detailSequence_parser (::fhir::positiveInt_pskel& p) { this->detailSequence_parser_ = &p; } void ClaimResponse_Error_pskel:: subDetailSequence_parser (::fhir::positiveInt_pskel& p) { this->subDetailSequence_parser_ = &p; } void ClaimResponse_Error_pskel:: code_parser (::fhir::CodeableConcept_pskel& p) { this->code_parser_ = &p; } void ClaimResponse_Error_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::Extension_pskel& modifierExtension, ::fhir::positiveInt_pskel& itemSequence, ::fhir::positiveInt_pskel& detailSequence, ::fhir::positiveInt_pskel& subDetailSequence, ::fhir::CodeableConcept_pskel& code) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->modifierExtension_parser_ = &modifierExtension; this->itemSequence_parser_ = &itemSequence; this->detailSequence_parser_ = &detailSequence; this->subDetailSequence_parser_ = &subDetailSequence; this->code_parser_ = &code; } ClaimResponse_Error_pskel:: ClaimResponse_Error_pskel (::fhir::BackboneElement_pskel* tiein) : ::fhir::BackboneElement_pskel (tiein, 0), ClaimResponse_Error_impl_ (0), itemSequence_parser_ (0), detailSequence_parser_ (0), subDetailSequence_parser_ (0), code_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } ClaimResponse_Error_pskel:: ClaimResponse_Error_pskel (ClaimResponse_Error_pskel* impl, void*) : ::fhir::BackboneElement_pskel (impl, 0), ClaimResponse_Error_impl_ (impl), itemSequence_parser_ (0), detailSequence_parser_ (0), subDetailSequence_parser_ (0), code_parser_ (0), v_state_stack_ (sizeof (v_state_), &v_state_first_) { } // ClaimProcessingCodes_list_pskel // ClaimProcessingCodes_list_pskel:: ClaimProcessingCodes_list_pskel (::fhir::code_primitive_pskel* tiein) : ::fhir::code_primitive_pskel (tiein, 0), ClaimProcessingCodes_list_impl_ (0) { this->_enumeration_facet (_xsde_ClaimProcessingCodes_list_pskel_enums_, 4UL); } ClaimProcessingCodes_list_pskel:: ClaimProcessingCodes_list_pskel (ClaimProcessingCodes_list_pskel* impl, void*) : ::fhir::code_primitive_pskel (impl, 0), ClaimProcessingCodes_list_impl_ (impl) { this->_enumeration_facet (_xsde_ClaimProcessingCodes_list_pskel_enums_, 4UL); } // ClaimProcessingCodes_pskel // void ClaimProcessingCodes_pskel:: value_parser (::fhir::ClaimProcessingCodes_list_pskel& p) { this->value_parser_ = &p; } void ClaimProcessingCodes_pskel:: parsers (::fhir::string_primitive_pskel& id, ::fhir::Extension_pskel& extension, ::fhir::ClaimProcessingCodes_list_pskel& value) { this->id_parser_ = &id; this->extension_parser_ = &extension; this->value_parser_ = &value; } ClaimProcessingCodes_pskel:: ClaimProcessingCodes_pskel (::fhir::Element_pskel* tiein) : ::fhir::Element_pskel (tiein, 0), ClaimProcessingCodes_impl_ (0), value_parser_ (0) { } ClaimProcessingCodes_pskel:: ClaimProcessingCodes_pskel (ClaimProcessingCodes_pskel* impl, void*) : ::fhir::Element_pskel (impl, 0), ClaimProcessingCodes_impl_ (impl), value_parser_ (0) { } } #include <assert.h> namespace fhir { // ClaimResponse_pskel // void ClaimResponse_pskel:: identifier () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->identifier (); } void ClaimResponse_pskel:: status () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->status (); } void ClaimResponse_pskel:: type () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->type (); } void ClaimResponse_pskel:: subType () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->subType (); } void ClaimResponse_pskel:: use () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->use (); } void ClaimResponse_pskel:: patient () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->patient (); } void ClaimResponse_pskel:: created () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->created (); } void ClaimResponse_pskel:: insurer () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->insurer (); } void ClaimResponse_pskel:: requestor () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->requestor (); } void ClaimResponse_pskel:: request () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->request (); } void ClaimResponse_pskel:: outcome () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->outcome (); } void ClaimResponse_pskel:: disposition () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->disposition (); } void ClaimResponse_pskel:: preAuthRef () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->preAuthRef (); } void ClaimResponse_pskel:: preAuthPeriod () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->preAuthPeriod (); } void ClaimResponse_pskel:: payeeType () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->payeeType (); } void ClaimResponse_pskel:: item () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->item (); } void ClaimResponse_pskel:: addItem () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->addItem (); } void ClaimResponse_pskel:: adjudication () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->adjudication (); } void ClaimResponse_pskel:: total () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->total (); } void ClaimResponse_pskel:: payment () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->payment (); } void ClaimResponse_pskel:: fundsReserve () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->fundsReserve (); } void ClaimResponse_pskel:: formCode () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->formCode (); } void ClaimResponse_pskel:: form () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->form (); } void ClaimResponse_pskel:: processNote () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->processNote (); } void ClaimResponse_pskel:: communicationRequest () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->communicationRequest (); } void ClaimResponse_pskel:: insurance () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->insurance (); } void ClaimResponse_pskel:: error () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->error (); } void ClaimResponse_pskel:: post_ClaimResponse () { if (this->ClaimResponse_impl_) this->ClaimResponse_impl_->post_ClaimResponse (); else post_DomainResource (); } void ClaimResponse_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::DomainResource_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->identifier_parser_) this->identifier_parser_->_reset (); if (this->status_parser_) this->status_parser_->_reset (); if (this->type_parser_) this->type_parser_->_reset (); if (this->subType_parser_) this->subType_parser_->_reset (); if (this->use_parser_) this->use_parser_->_reset (); if (this->patient_parser_) this->patient_parser_->_reset (); if (this->created_parser_) this->created_parser_->_reset (); if (this->insurer_parser_) this->insurer_parser_->_reset (); if (this->requestor_parser_) this->requestor_parser_->_reset (); if (this->request_parser_) this->request_parser_->_reset (); if (this->outcome_parser_) this->outcome_parser_->_reset (); if (this->disposition_parser_) this->disposition_parser_->_reset (); if (this->preAuthRef_parser_) this->preAuthRef_parser_->_reset (); if (this->preAuthPeriod_parser_) this->preAuthPeriod_parser_->_reset (); if (this->payeeType_parser_) this->payeeType_parser_->_reset (); if (this->item_parser_) this->item_parser_->_reset (); if (this->addItem_parser_) this->addItem_parser_->_reset (); if (this->adjudication_parser_) this->adjudication_parser_->_reset (); if (this->total_parser_) this->total_parser_->_reset (); if (this->payment_parser_) this->payment_parser_->_reset (); if (this->fundsReserve_parser_) this->fundsReserve_parser_->_reset (); if (this->formCode_parser_) this->formCode_parser_->_reset (); if (this->form_parser_) this->form_parser_->_reset (); if (this->processNote_parser_) this->processNote_parser_->_reset (); if (this->communicationRequest_parser_) this->communicationRequest_parser_->_reset (); if (this->insurance_parser_) this->insurance_parser_->_reset (); if (this->error_parser_) this->error_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_Item_pskel // void ClaimResponse_Item_pskel:: itemSequence () { if (this->ClaimResponse_Item_impl_) this->ClaimResponse_Item_impl_->itemSequence (); } void ClaimResponse_Item_pskel:: noteNumber () { if (this->ClaimResponse_Item_impl_) this->ClaimResponse_Item_impl_->noteNumber (); } void ClaimResponse_Item_pskel:: adjudication () { if (this->ClaimResponse_Item_impl_) this->ClaimResponse_Item_impl_->adjudication (); } void ClaimResponse_Item_pskel:: detail () { if (this->ClaimResponse_Item_impl_) this->ClaimResponse_Item_impl_->detail (); } void ClaimResponse_Item_pskel:: post_ClaimResponse_Item () { if (this->ClaimResponse_Item_impl_) this->ClaimResponse_Item_impl_->post_ClaimResponse_Item (); else post_BackboneElement (); } void ClaimResponse_Item_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->itemSequence_parser_) this->itemSequence_parser_->_reset (); if (this->noteNumber_parser_) this->noteNumber_parser_->_reset (); if (this->adjudication_parser_) this->adjudication_parser_->_reset (); if (this->detail_parser_) this->detail_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_Adjudication_pskel // void ClaimResponse_Adjudication_pskel:: category () { if (this->ClaimResponse_Adjudication_impl_) this->ClaimResponse_Adjudication_impl_->category (); } void ClaimResponse_Adjudication_pskel:: reason () { if (this->ClaimResponse_Adjudication_impl_) this->ClaimResponse_Adjudication_impl_->reason (); } void ClaimResponse_Adjudication_pskel:: amount () { if (this->ClaimResponse_Adjudication_impl_) this->ClaimResponse_Adjudication_impl_->amount (); } void ClaimResponse_Adjudication_pskel:: value () { if (this->ClaimResponse_Adjudication_impl_) this->ClaimResponse_Adjudication_impl_->value (); } void ClaimResponse_Adjudication_pskel:: post_ClaimResponse_Adjudication () { if (this->ClaimResponse_Adjudication_impl_) this->ClaimResponse_Adjudication_impl_->post_ClaimResponse_Adjudication (); else post_BackboneElement (); } void ClaimResponse_Adjudication_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->category_parser_) this->category_parser_->_reset (); if (this->reason_parser_) this->reason_parser_->_reset (); if (this->amount_parser_) this->amount_parser_->_reset (); if (this->value_parser_) this->value_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_Detail_pskel // void ClaimResponse_Detail_pskel:: detailSequence () { if (this->ClaimResponse_Detail_impl_) this->ClaimResponse_Detail_impl_->detailSequence (); } void ClaimResponse_Detail_pskel:: noteNumber () { if (this->ClaimResponse_Detail_impl_) this->ClaimResponse_Detail_impl_->noteNumber (); } void ClaimResponse_Detail_pskel:: adjudication () { if (this->ClaimResponse_Detail_impl_) this->ClaimResponse_Detail_impl_->adjudication (); } void ClaimResponse_Detail_pskel:: subDetail () { if (this->ClaimResponse_Detail_impl_) this->ClaimResponse_Detail_impl_->subDetail (); } void ClaimResponse_Detail_pskel:: post_ClaimResponse_Detail () { if (this->ClaimResponse_Detail_impl_) this->ClaimResponse_Detail_impl_->post_ClaimResponse_Detail (); else post_BackboneElement (); } void ClaimResponse_Detail_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->detailSequence_parser_) this->detailSequence_parser_->_reset (); if (this->noteNumber_parser_) this->noteNumber_parser_->_reset (); if (this->adjudication_parser_) this->adjudication_parser_->_reset (); if (this->subDetail_parser_) this->subDetail_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_SubDetail_pskel // void ClaimResponse_SubDetail_pskel:: subDetailSequence () { if (this->ClaimResponse_SubDetail_impl_) this->ClaimResponse_SubDetail_impl_->subDetailSequence (); } void ClaimResponse_SubDetail_pskel:: noteNumber () { if (this->ClaimResponse_SubDetail_impl_) this->ClaimResponse_SubDetail_impl_->noteNumber (); } void ClaimResponse_SubDetail_pskel:: adjudication () { if (this->ClaimResponse_SubDetail_impl_) this->ClaimResponse_SubDetail_impl_->adjudication (); } void ClaimResponse_SubDetail_pskel:: post_ClaimResponse_SubDetail () { if (this->ClaimResponse_SubDetail_impl_) this->ClaimResponse_SubDetail_impl_->post_ClaimResponse_SubDetail (); else post_BackboneElement (); } void ClaimResponse_SubDetail_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->subDetailSequence_parser_) this->subDetailSequence_parser_->_reset (); if (this->noteNumber_parser_) this->noteNumber_parser_->_reset (); if (this->adjudication_parser_) this->adjudication_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_AddItem_pskel // void ClaimResponse_AddItem_pskel:: itemSequence () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->itemSequence (); } void ClaimResponse_AddItem_pskel:: detailSequence () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->detailSequence (); } void ClaimResponse_AddItem_pskel:: subdetailSequence () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->subdetailSequence (); } void ClaimResponse_AddItem_pskel:: provider () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->provider (); } void ClaimResponse_AddItem_pskel:: productOrService () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->productOrService (); } void ClaimResponse_AddItem_pskel:: modifier () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->modifier (); } void ClaimResponse_AddItem_pskel:: programCode () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->programCode (); } void ClaimResponse_AddItem_pskel:: servicedDate () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->servicedDate (); } void ClaimResponse_AddItem_pskel:: servicedPeriod () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->servicedPeriod (); } void ClaimResponse_AddItem_pskel:: locationCodeableConcept () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->locationCodeableConcept (); } void ClaimResponse_AddItem_pskel:: locationAddress () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->locationAddress (); } void ClaimResponse_AddItem_pskel:: locationReference () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->locationReference (); } void ClaimResponse_AddItem_pskel:: quantity () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->quantity (); } void ClaimResponse_AddItem_pskel:: unitPrice () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->unitPrice (); } void ClaimResponse_AddItem_pskel:: factor () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->factor (); } void ClaimResponse_AddItem_pskel:: net () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->net (); } void ClaimResponse_AddItem_pskel:: bodySite () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->bodySite (); } void ClaimResponse_AddItem_pskel:: subSite () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->subSite (); } void ClaimResponse_AddItem_pskel:: noteNumber () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->noteNumber (); } void ClaimResponse_AddItem_pskel:: adjudication () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->adjudication (); } void ClaimResponse_AddItem_pskel:: detail () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->detail (); } void ClaimResponse_AddItem_pskel:: post_ClaimResponse_AddItem () { if (this->ClaimResponse_AddItem_impl_) this->ClaimResponse_AddItem_impl_->post_ClaimResponse_AddItem (); else post_BackboneElement (); } void ClaimResponse_AddItem_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->itemSequence_parser_) this->itemSequence_parser_->_reset (); if (this->detailSequence_parser_) this->detailSequence_parser_->_reset (); if (this->subdetailSequence_parser_) this->subdetailSequence_parser_->_reset (); if (this->provider_parser_) this->provider_parser_->_reset (); if (this->productOrService_parser_) this->productOrService_parser_->_reset (); if (this->modifier_parser_) this->modifier_parser_->_reset (); if (this->programCode_parser_) this->programCode_parser_->_reset (); if (this->servicedDate_parser_) this->servicedDate_parser_->_reset (); if (this->servicedPeriod_parser_) this->servicedPeriod_parser_->_reset (); if (this->locationCodeableConcept_parser_) this->locationCodeableConcept_parser_->_reset (); if (this->locationAddress_parser_) this->locationAddress_parser_->_reset (); if (this->locationReference_parser_) this->locationReference_parser_->_reset (); if (this->quantity_parser_) this->quantity_parser_->_reset (); if (this->unitPrice_parser_) this->unitPrice_parser_->_reset (); if (this->factor_parser_) this->factor_parser_->_reset (); if (this->net_parser_) this->net_parser_->_reset (); if (this->bodySite_parser_) this->bodySite_parser_->_reset (); if (this->subSite_parser_) this->subSite_parser_->_reset (); if (this->noteNumber_parser_) this->noteNumber_parser_->_reset (); if (this->adjudication_parser_) this->adjudication_parser_->_reset (); if (this->detail_parser_) this->detail_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_Detail1_pskel // void ClaimResponse_Detail1_pskel:: productOrService () { if (this->ClaimResponse_Detail1_impl_) this->ClaimResponse_Detail1_impl_->productOrService (); } void ClaimResponse_Detail1_pskel:: modifier () { if (this->ClaimResponse_Detail1_impl_) this->ClaimResponse_Detail1_impl_->modifier (); } void ClaimResponse_Detail1_pskel:: quantity () { if (this->ClaimResponse_Detail1_impl_) this->ClaimResponse_Detail1_impl_->quantity (); } void ClaimResponse_Detail1_pskel:: unitPrice () { if (this->ClaimResponse_Detail1_impl_) this->ClaimResponse_Detail1_impl_->unitPrice (); } void ClaimResponse_Detail1_pskel:: factor () { if (this->ClaimResponse_Detail1_impl_) this->ClaimResponse_Detail1_impl_->factor (); } void ClaimResponse_Detail1_pskel:: net () { if (this->ClaimResponse_Detail1_impl_) this->ClaimResponse_Detail1_impl_->net (); } void ClaimResponse_Detail1_pskel:: noteNumber () { if (this->ClaimResponse_Detail1_impl_) this->ClaimResponse_Detail1_impl_->noteNumber (); } void ClaimResponse_Detail1_pskel:: adjudication () { if (this->ClaimResponse_Detail1_impl_) this->ClaimResponse_Detail1_impl_->adjudication (); } void ClaimResponse_Detail1_pskel:: subDetail () { if (this->ClaimResponse_Detail1_impl_) this->ClaimResponse_Detail1_impl_->subDetail (); } void ClaimResponse_Detail1_pskel:: post_ClaimResponse_Detail1 () { if (this->ClaimResponse_Detail1_impl_) this->ClaimResponse_Detail1_impl_->post_ClaimResponse_Detail1 (); else post_BackboneElement (); } void ClaimResponse_Detail1_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->productOrService_parser_) this->productOrService_parser_->_reset (); if (this->modifier_parser_) this->modifier_parser_->_reset (); if (this->quantity_parser_) this->quantity_parser_->_reset (); if (this->unitPrice_parser_) this->unitPrice_parser_->_reset (); if (this->factor_parser_) this->factor_parser_->_reset (); if (this->net_parser_) this->net_parser_->_reset (); if (this->noteNumber_parser_) this->noteNumber_parser_->_reset (); if (this->adjudication_parser_) this->adjudication_parser_->_reset (); if (this->subDetail_parser_) this->subDetail_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_SubDetail1_pskel // void ClaimResponse_SubDetail1_pskel:: productOrService () { if (this->ClaimResponse_SubDetail1_impl_) this->ClaimResponse_SubDetail1_impl_->productOrService (); } void ClaimResponse_SubDetail1_pskel:: modifier () { if (this->ClaimResponse_SubDetail1_impl_) this->ClaimResponse_SubDetail1_impl_->modifier (); } void ClaimResponse_SubDetail1_pskel:: quantity () { if (this->ClaimResponse_SubDetail1_impl_) this->ClaimResponse_SubDetail1_impl_->quantity (); } void ClaimResponse_SubDetail1_pskel:: unitPrice () { if (this->ClaimResponse_SubDetail1_impl_) this->ClaimResponse_SubDetail1_impl_->unitPrice (); } void ClaimResponse_SubDetail1_pskel:: factor () { if (this->ClaimResponse_SubDetail1_impl_) this->ClaimResponse_SubDetail1_impl_->factor (); } void ClaimResponse_SubDetail1_pskel:: net () { if (this->ClaimResponse_SubDetail1_impl_) this->ClaimResponse_SubDetail1_impl_->net (); } void ClaimResponse_SubDetail1_pskel:: noteNumber () { if (this->ClaimResponse_SubDetail1_impl_) this->ClaimResponse_SubDetail1_impl_->noteNumber (); } void ClaimResponse_SubDetail1_pskel:: adjudication () { if (this->ClaimResponse_SubDetail1_impl_) this->ClaimResponse_SubDetail1_impl_->adjudication (); } void ClaimResponse_SubDetail1_pskel:: post_ClaimResponse_SubDetail1 () { if (this->ClaimResponse_SubDetail1_impl_) this->ClaimResponse_SubDetail1_impl_->post_ClaimResponse_SubDetail1 (); else post_BackboneElement (); } void ClaimResponse_SubDetail1_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->productOrService_parser_) this->productOrService_parser_->_reset (); if (this->modifier_parser_) this->modifier_parser_->_reset (); if (this->quantity_parser_) this->quantity_parser_->_reset (); if (this->unitPrice_parser_) this->unitPrice_parser_->_reset (); if (this->factor_parser_) this->factor_parser_->_reset (); if (this->net_parser_) this->net_parser_->_reset (); if (this->noteNumber_parser_) this->noteNumber_parser_->_reset (); if (this->adjudication_parser_) this->adjudication_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_Total_pskel // void ClaimResponse_Total_pskel:: category () { if (this->ClaimResponse_Total_impl_) this->ClaimResponse_Total_impl_->category (); } void ClaimResponse_Total_pskel:: amount () { if (this->ClaimResponse_Total_impl_) this->ClaimResponse_Total_impl_->amount (); } void ClaimResponse_Total_pskel:: post_ClaimResponse_Total () { if (this->ClaimResponse_Total_impl_) this->ClaimResponse_Total_impl_->post_ClaimResponse_Total (); else post_BackboneElement (); } void ClaimResponse_Total_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->category_parser_) this->category_parser_->_reset (); if (this->amount_parser_) this->amount_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_Payment_pskel // void ClaimResponse_Payment_pskel:: type () { if (this->ClaimResponse_Payment_impl_) this->ClaimResponse_Payment_impl_->type (); } void ClaimResponse_Payment_pskel:: adjustment () { if (this->ClaimResponse_Payment_impl_) this->ClaimResponse_Payment_impl_->adjustment (); } void ClaimResponse_Payment_pskel:: adjustmentReason () { if (this->ClaimResponse_Payment_impl_) this->ClaimResponse_Payment_impl_->adjustmentReason (); } void ClaimResponse_Payment_pskel:: date () { if (this->ClaimResponse_Payment_impl_) this->ClaimResponse_Payment_impl_->date (); } void ClaimResponse_Payment_pskel:: amount () { if (this->ClaimResponse_Payment_impl_) this->ClaimResponse_Payment_impl_->amount (); } void ClaimResponse_Payment_pskel:: identifier () { if (this->ClaimResponse_Payment_impl_) this->ClaimResponse_Payment_impl_->identifier (); } void ClaimResponse_Payment_pskel:: post_ClaimResponse_Payment () { if (this->ClaimResponse_Payment_impl_) this->ClaimResponse_Payment_impl_->post_ClaimResponse_Payment (); else post_BackboneElement (); } void ClaimResponse_Payment_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->type_parser_) this->type_parser_->_reset (); if (this->adjustment_parser_) this->adjustment_parser_->_reset (); if (this->adjustmentReason_parser_) this->adjustmentReason_parser_->_reset (); if (this->date_parser_) this->date_parser_->_reset (); if (this->amount_parser_) this->amount_parser_->_reset (); if (this->identifier_parser_) this->identifier_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_ProcessNote_pskel // void ClaimResponse_ProcessNote_pskel:: number () { if (this->ClaimResponse_ProcessNote_impl_) this->ClaimResponse_ProcessNote_impl_->number (); } void ClaimResponse_ProcessNote_pskel:: type () { if (this->ClaimResponse_ProcessNote_impl_) this->ClaimResponse_ProcessNote_impl_->type (); } void ClaimResponse_ProcessNote_pskel:: text () { if (this->ClaimResponse_ProcessNote_impl_) this->ClaimResponse_ProcessNote_impl_->text (); } void ClaimResponse_ProcessNote_pskel:: language () { if (this->ClaimResponse_ProcessNote_impl_) this->ClaimResponse_ProcessNote_impl_->language (); } void ClaimResponse_ProcessNote_pskel:: post_ClaimResponse_ProcessNote () { if (this->ClaimResponse_ProcessNote_impl_) this->ClaimResponse_ProcessNote_impl_->post_ClaimResponse_ProcessNote (); else post_BackboneElement (); } void ClaimResponse_ProcessNote_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->number_parser_) this->number_parser_->_reset (); if (this->type_parser_) this->type_parser_->_reset (); if (this->text_parser_) this->text_parser_->_reset (); if (this->language_parser_) this->language_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_Insurance_pskel // void ClaimResponse_Insurance_pskel:: sequence () { if (this->ClaimResponse_Insurance_impl_) this->ClaimResponse_Insurance_impl_->sequence (); } void ClaimResponse_Insurance_pskel:: focal () { if (this->ClaimResponse_Insurance_impl_) this->ClaimResponse_Insurance_impl_->focal (); } void ClaimResponse_Insurance_pskel:: coverage () { if (this->ClaimResponse_Insurance_impl_) this->ClaimResponse_Insurance_impl_->coverage (); } void ClaimResponse_Insurance_pskel:: businessArrangement () { if (this->ClaimResponse_Insurance_impl_) this->ClaimResponse_Insurance_impl_->businessArrangement (); } void ClaimResponse_Insurance_pskel:: claimResponse () { if (this->ClaimResponse_Insurance_impl_) this->ClaimResponse_Insurance_impl_->claimResponse (); } void ClaimResponse_Insurance_pskel:: post_ClaimResponse_Insurance () { if (this->ClaimResponse_Insurance_impl_) this->ClaimResponse_Insurance_impl_->post_ClaimResponse_Insurance (); else post_BackboneElement (); } void ClaimResponse_Insurance_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->sequence_parser_) this->sequence_parser_->_reset (); if (this->focal_parser_) this->focal_parser_->_reset (); if (this->coverage_parser_) this->coverage_parser_->_reset (); if (this->businessArrangement_parser_) this->businessArrangement_parser_->_reset (); if (this->claimResponse_parser_) this->claimResponse_parser_->_reset (); this->resetting_ = false; } // ClaimResponse_Error_pskel // void ClaimResponse_Error_pskel:: itemSequence () { if (this->ClaimResponse_Error_impl_) this->ClaimResponse_Error_impl_->itemSequence (); } void ClaimResponse_Error_pskel:: detailSequence () { if (this->ClaimResponse_Error_impl_) this->ClaimResponse_Error_impl_->detailSequence (); } void ClaimResponse_Error_pskel:: subDetailSequence () { if (this->ClaimResponse_Error_impl_) this->ClaimResponse_Error_impl_->subDetailSequence (); } void ClaimResponse_Error_pskel:: code () { if (this->ClaimResponse_Error_impl_) this->ClaimResponse_Error_impl_->code (); } void ClaimResponse_Error_pskel:: post_ClaimResponse_Error () { if (this->ClaimResponse_Error_impl_) this->ClaimResponse_Error_impl_->post_ClaimResponse_Error (); else post_BackboneElement (); } void ClaimResponse_Error_pskel:: _reset () { if (this->resetting_) return; typedef ::fhir::BackboneElement_pskel base; base::_reset (); this->v_state_stack_.clear (); this->resetting_ = true; if (this->itemSequence_parser_) this->itemSequence_parser_->_reset (); if (this->detailSequence_parser_) this->detailSequence_parser_->_reset (); if (this->subDetailSequence_parser_) this->subDetailSequence_parser_->_reset (); if (this->code_parser_) this->code_parser_->_reset (); this->resetting_ = false; } // ClaimProcessingCodes_list_pskel // void ClaimProcessingCodes_list_pskel:: post_ClaimProcessingCodes_list () { if (this->ClaimProcessingCodes_list_impl_) this->ClaimProcessingCodes_list_impl_->post_ClaimProcessingCodes_list (); else post_code_primitive (); } const char* const ClaimProcessingCodes_list_pskel::_xsde_ClaimProcessingCodes_list_pskel_enums_[4UL] = { "complete", "error", "partial", "queued" }; // ClaimProcessingCodes_pskel // void ClaimProcessingCodes_pskel:: value () { if (this->ClaimProcessingCodes_impl_) this->ClaimProcessingCodes_impl_->value (); } void ClaimProcessingCodes_pskel:: post_ClaimProcessingCodes () { if (this->ClaimProcessingCodes_impl_) this->ClaimProcessingCodes_impl_->post_ClaimProcessingCodes (); else post_Element (); } void ClaimProcessingCodes_pskel:: _reset () { typedef ::fhir::Element_pskel base; base::_reset (); if (this->value_parser_) this->value_parser_->_reset (); } } #include <assert.h> namespace fhir { // Element validation and dispatch functions for ClaimResponse_pskel. // bool ClaimResponse_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::DomainResource_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "identifier" && ns == "http://hl7.org/fhir") s = 0UL; else if (n == "status" && ns == "http://hl7.org/fhir") s = 1UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::DomainResource_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::DomainResource_pskel base; base::_pre_e_validate (); } void ClaimResponse_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::DomainResource_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "identifier" && ns == "http://hl7.org/fhir") { if (start) { if (this->identifier_parser_) { this->identifier_parser_->pre (); ctx.nested_parser (this->identifier_parser_); } } else { if (this->identifier_parser_ != 0) { this->identifier_parser_->post_Identifier (); this->identifier (); } count++; } break; } else { assert (start); count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "status" && ns == "http://hl7.org/fhir") { if (start) { if (this->status_parser_) { this->status_parser_->pre (); ctx.nested_parser (this->status_parser_); } } else { if (this->status_parser_ != 0) { this->status_parser_->post_FinancialResourceStatusCodes (); this->status (); } count = 0; state = 2UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "type" && ns == "http://hl7.org/fhir") { if (start) { if (this->type_parser_) { this->type_parser_->pre (); ctx.nested_parser (this->type_parser_); } } else { if (this->type_parser_ != 0) { this->type_parser_->post_CodeableConcept (); this->type (); } count = 0; state = 3UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "subType" && ns == "http://hl7.org/fhir") { if (start) { if (this->subType_parser_) { this->subType_parser_->pre (); ctx.nested_parser (this->subType_parser_); } } else { if (this->subType_parser_ != 0) { this->subType_parser_->post_CodeableConcept (); this->subType (); } count = 0; state = 4UL; } break; } else { assert (start); count = 0; state = 4UL; // Fall through. } } case 4UL: { if (n == "use" && ns == "http://hl7.org/fhir") { if (start) { if (this->use_parser_) { this->use_parser_->pre (); ctx.nested_parser (this->use_parser_); } } else { if (this->use_parser_ != 0) { this->use_parser_->post_Use (); this->use (); } count = 0; state = 5UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 5UL; // Fall through. } } case 5UL: { if (n == "patient" && ns == "http://hl7.org/fhir") { if (start) { if (this->patient_parser_) { this->patient_parser_->pre (); ctx.nested_parser (this->patient_parser_); } } else { if (this->patient_parser_ != 0) { this->patient_parser_->post_Reference (); this->patient (); } count = 0; state = 6UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 6UL; // Fall through. } } case 6UL: { if (n == "created" && ns == "http://hl7.org/fhir") { if (start) { if (this->created_parser_) { this->created_parser_->pre (); ctx.nested_parser (this->created_parser_); } } else { if (this->created_parser_ != 0) { this->created_parser_->post_dateTime (); this->created (); } count = 0; state = 7UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 7UL; // Fall through. } } case 7UL: { if (n == "insurer" && ns == "http://hl7.org/fhir") { if (start) { if (this->insurer_parser_) { this->insurer_parser_->pre (); ctx.nested_parser (this->insurer_parser_); } } else { if (this->insurer_parser_ != 0) { this->insurer_parser_->post_Reference (); this->insurer (); } count = 0; state = 8UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 8UL; // Fall through. } } case 8UL: { if (n == "requestor" && ns == "http://hl7.org/fhir") { if (start) { if (this->requestor_parser_) { this->requestor_parser_->pre (); ctx.nested_parser (this->requestor_parser_); } } else { if (this->requestor_parser_ != 0) { this->requestor_parser_->post_Reference (); this->requestor (); } count = 0; state = 9UL; } break; } else { assert (start); count = 0; state = 9UL; // Fall through. } } case 9UL: { if (n == "request" && ns == "http://hl7.org/fhir") { if (start) { if (this->request_parser_) { this->request_parser_->pre (); ctx.nested_parser (this->request_parser_); } } else { if (this->request_parser_ != 0) { this->request_parser_->post_Reference (); this->request (); } count = 0; state = 10UL; } break; } else { assert (start); count = 0; state = 10UL; // Fall through. } } case 10UL: { if (n == "outcome" && ns == "http://hl7.org/fhir") { if (start) { if (this->outcome_parser_) { this->outcome_parser_->pre (); ctx.nested_parser (this->outcome_parser_); } } else { if (this->outcome_parser_ != 0) { this->outcome_parser_->post_ClaimProcessingCodes (); this->outcome (); } count = 0; state = 11UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 11UL; // Fall through. } } case 11UL: { if (n == "disposition" && ns == "http://hl7.org/fhir") { if (start) { if (this->disposition_parser_) { this->disposition_parser_->pre (); ctx.nested_parser (this->disposition_parser_); } } else { if (this->disposition_parser_ != 0) { this->disposition_parser_->post_string (); this->disposition (); } count = 0; state = 12UL; } break; } else { assert (start); count = 0; state = 12UL; // Fall through. } } case 12UL: { if (n == "preAuthRef" && ns == "http://hl7.org/fhir") { if (start) { if (this->preAuthRef_parser_) { this->preAuthRef_parser_->pre (); ctx.nested_parser (this->preAuthRef_parser_); } } else { if (this->preAuthRef_parser_ != 0) { this->preAuthRef_parser_->post_string (); this->preAuthRef (); } count = 0; state = 13UL; } break; } else { assert (start); count = 0; state = 13UL; // Fall through. } } case 13UL: { if (n == "preAuthPeriod" && ns == "http://hl7.org/fhir") { if (start) { if (this->preAuthPeriod_parser_) { this->preAuthPeriod_parser_->pre (); ctx.nested_parser (this->preAuthPeriod_parser_); } } else { if (this->preAuthPeriod_parser_ != 0) { this->preAuthPeriod_parser_->post_Period (); this->preAuthPeriod (); } count = 0; state = 14UL; } break; } else { assert (start); count = 0; state = 14UL; // Fall through. } } case 14UL: { if (n == "payeeType" && ns == "http://hl7.org/fhir") { if (start) { if (this->payeeType_parser_) { this->payeeType_parser_->pre (); ctx.nested_parser (this->payeeType_parser_); } } else { if (this->payeeType_parser_ != 0) { this->payeeType_parser_->post_CodeableConcept (); this->payeeType (); } count = 0; state = 15UL; } break; } else { assert (start); count = 0; state = 15UL; // Fall through. } } case 15UL: { if (n == "item" && ns == "http://hl7.org/fhir") { if (start) { if (this->item_parser_) { this->item_parser_->pre (); ctx.nested_parser (this->item_parser_); } } else { if (this->item_parser_ != 0) { this->item_parser_->post_ClaimResponse_Item (); this->item (); } count++; } break; } else { assert (start); count = 0; state = 16UL; // Fall through. } } case 16UL: { if (n == "addItem" && ns == "http://hl7.org/fhir") { if (start) { if (this->addItem_parser_) { this->addItem_parser_->pre (); ctx.nested_parser (this->addItem_parser_); } } else { if (this->addItem_parser_ != 0) { this->addItem_parser_->post_ClaimResponse_AddItem (); this->addItem (); } count++; } break; } else { assert (start); count = 0; state = 17UL; // Fall through. } } case 17UL: { if (n == "adjudication" && ns == "http://hl7.org/fhir") { if (start) { if (this->adjudication_parser_) { this->adjudication_parser_->pre (); ctx.nested_parser (this->adjudication_parser_); } } else { if (this->adjudication_parser_ != 0) { this->adjudication_parser_->post_ClaimResponse_Adjudication (); this->adjudication (); } count++; } break; } else { assert (start); count = 0; state = 18UL; // Fall through. } } case 18UL: { if (n == "total" && ns == "http://hl7.org/fhir") { if (start) { if (this->total_parser_) { this->total_parser_->pre (); ctx.nested_parser (this->total_parser_); } } else { if (this->total_parser_ != 0) { this->total_parser_->post_ClaimResponse_Total (); this->total (); } count++; } break; } else { assert (start); count = 0; state = 19UL; // Fall through. } } case 19UL: { if (n == "payment" && ns == "http://hl7.org/fhir") { if (start) { if (this->payment_parser_) { this->payment_parser_->pre (); ctx.nested_parser (this->payment_parser_); } } else { if (this->payment_parser_ != 0) { this->payment_parser_->post_ClaimResponse_Payment (); this->payment (); } count = 0; state = 20UL; } break; } else { assert (start); count = 0; state = 20UL; // Fall through. } } case 20UL: { if (n == "fundsReserve" && ns == "http://hl7.org/fhir") { if (start) { if (this->fundsReserve_parser_) { this->fundsReserve_parser_->pre (); ctx.nested_parser (this->fundsReserve_parser_); } } else { if (this->fundsReserve_parser_ != 0) { this->fundsReserve_parser_->post_CodeableConcept (); this->fundsReserve (); } count = 0; state = 21UL; } break; } else { assert (start); count = 0; state = 21UL; // Fall through. } } case 21UL: { if (n == "formCode" && ns == "http://hl7.org/fhir") { if (start) { if (this->formCode_parser_) { this->formCode_parser_->pre (); ctx.nested_parser (this->formCode_parser_); } } else { if (this->formCode_parser_ != 0) { this->formCode_parser_->post_CodeableConcept (); this->formCode (); } count = 0; state = 22UL; } break; } else { assert (start); count = 0; state = 22UL; // Fall through. } } case 22UL: { if (n == "form" && ns == "http://hl7.org/fhir") { if (start) { if (this->form_parser_) { this->form_parser_->pre (); ctx.nested_parser (this->form_parser_); } } else { if (this->form_parser_ != 0) { this->form_parser_->post_Attachment (); this->form (); } count = 0; state = 23UL; } break; } else { assert (start); count = 0; state = 23UL; // Fall through. } } case 23UL: { if (n == "processNote" && ns == "http://hl7.org/fhir") { if (start) { if (this->processNote_parser_) { this->processNote_parser_->pre (); ctx.nested_parser (this->processNote_parser_); } } else { if (this->processNote_parser_ != 0) { this->processNote_parser_->post_ClaimResponse_ProcessNote (); this->processNote (); } count++; } break; } else { assert (start); count = 0; state = 24UL; // Fall through. } } case 24UL: { if (n == "communicationRequest" && ns == "http://hl7.org/fhir") { if (start) { if (this->communicationRequest_parser_) { this->communicationRequest_parser_->pre (); ctx.nested_parser (this->communicationRequest_parser_); } } else { if (this->communicationRequest_parser_ != 0) { this->communicationRequest_parser_->post_Reference (); this->communicationRequest (); } count++; } break; } else { assert (start); count = 0; state = 25UL; // Fall through. } } case 25UL: { if (n == "insurance" && ns == "http://hl7.org/fhir") { if (start) { if (this->insurance_parser_) { this->insurance_parser_->pre (); ctx.nested_parser (this->insurance_parser_); } } else { if (this->insurance_parser_ != 0) { this->insurance_parser_->post_ClaimResponse_Insurance (); this->insurance (); } count++; } break; } else { assert (start); count = 0; state = 26UL; // Fall through. } } case 26UL: { if (n == "error" && ns == "http://hl7.org/fhir") { if (start) { if (this->error_parser_) { this->error_parser_->pre (); ctx.nested_parser (this->error_parser_); } } else { if (this->error_parser_ != 0) { this->error_parser_->post_ClaimResponse_Error (); this->error (); } count++; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_Item_pskel. // bool ClaimResponse_Item_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "itemSequence" && ns == "http://hl7.org/fhir") s = 0UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_Item_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_Item_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_Item_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_Item_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_Item_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "itemSequence" && ns == "http://hl7.org/fhir") { if (start) { if (this->itemSequence_parser_) { this->itemSequence_parser_->pre (); ctx.nested_parser (this->itemSequence_parser_); } } else { if (this->itemSequence_parser_ != 0) { this->itemSequence_parser_->post_positiveInt (); this->itemSequence (); } count = 0; state = 1UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "noteNumber" && ns == "http://hl7.org/fhir") { if (start) { if (this->noteNumber_parser_) { this->noteNumber_parser_->pre (); ctx.nested_parser (this->noteNumber_parser_); } } else { if (this->noteNumber_parser_ != 0) { this->noteNumber_parser_->post_positiveInt (); this->noteNumber (); } count++; } break; } else { assert (start); count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "adjudication" && ns == "http://hl7.org/fhir") { if (start) { if (this->adjudication_parser_) { this->adjudication_parser_->pre (); ctx.nested_parser (this->adjudication_parser_); } } else { if (this->adjudication_parser_ != 0) { this->adjudication_parser_->post_ClaimResponse_Adjudication (); this->adjudication (); } count++; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "detail" && ns == "http://hl7.org/fhir") { if (start) { if (this->detail_parser_) { this->detail_parser_->pre (); ctx.nested_parser (this->detail_parser_); } } else { if (this->detail_parser_ != 0) { this->detail_parser_->post_ClaimResponse_Detail (); this->detail (); } count++; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_Adjudication_pskel. // bool ClaimResponse_Adjudication_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "category" && ns == "http://hl7.org/fhir") s = 0UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_Adjudication_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_Adjudication_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_Adjudication_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_Adjudication_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_Adjudication_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "category" && ns == "http://hl7.org/fhir") { if (start) { if (this->category_parser_) { this->category_parser_->pre (); ctx.nested_parser (this->category_parser_); } } else { if (this->category_parser_ != 0) { this->category_parser_->post_CodeableConcept (); this->category (); } count = 0; state = 1UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "reason" && ns == "http://hl7.org/fhir") { if (start) { if (this->reason_parser_) { this->reason_parser_->pre (); ctx.nested_parser (this->reason_parser_); } } else { if (this->reason_parser_ != 0) { this->reason_parser_->post_CodeableConcept (); this->reason (); } count = 0; state = 2UL; } break; } else { assert (start); count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "amount" && ns == "http://hl7.org/fhir") { if (start) { if (this->amount_parser_) { this->amount_parser_->pre (); ctx.nested_parser (this->amount_parser_); } } else { if (this->amount_parser_ != 0) { this->amount_parser_->post_Money (); this->amount (); } count = 0; state = 3UL; } break; } else { assert (start); count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "value" && ns == "http://hl7.org/fhir") { if (start) { if (this->value_parser_) { this->value_parser_->pre (); ctx.nested_parser (this->value_parser_); } } else { if (this->value_parser_ != 0) { this->value_parser_->post_decimal (); this->value (); } count = 0; state = ~0UL; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_Detail_pskel. // bool ClaimResponse_Detail_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "detailSequence" && ns == "http://hl7.org/fhir") s = 0UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_Detail_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_Detail_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_Detail_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_Detail_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_Detail_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "detailSequence" && ns == "http://hl7.org/fhir") { if (start) { if (this->detailSequence_parser_) { this->detailSequence_parser_->pre (); ctx.nested_parser (this->detailSequence_parser_); } } else { if (this->detailSequence_parser_ != 0) { this->detailSequence_parser_->post_positiveInt (); this->detailSequence (); } count = 0; state = 1UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "noteNumber" && ns == "http://hl7.org/fhir") { if (start) { if (this->noteNumber_parser_) { this->noteNumber_parser_->pre (); ctx.nested_parser (this->noteNumber_parser_); } } else { if (this->noteNumber_parser_ != 0) { this->noteNumber_parser_->post_positiveInt (); this->noteNumber (); } count++; } break; } else { assert (start); count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "adjudication" && ns == "http://hl7.org/fhir") { if (start) { if (this->adjudication_parser_) { this->adjudication_parser_->pre (); ctx.nested_parser (this->adjudication_parser_); } } else { if (this->adjudication_parser_ != 0) { this->adjudication_parser_->post_ClaimResponse_Adjudication (); this->adjudication (); } count++; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "subDetail" && ns == "http://hl7.org/fhir") { if (start) { if (this->subDetail_parser_) { this->subDetail_parser_->pre (); ctx.nested_parser (this->subDetail_parser_); } } else { if (this->subDetail_parser_ != 0) { this->subDetail_parser_->post_ClaimResponse_SubDetail (); this->subDetail (); } count++; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_SubDetail_pskel. // bool ClaimResponse_SubDetail_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "subDetailSequence" && ns == "http://hl7.org/fhir") s = 0UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_SubDetail_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_SubDetail_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_SubDetail_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_SubDetail_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_SubDetail_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "subDetailSequence" && ns == "http://hl7.org/fhir") { if (start) { if (this->subDetailSequence_parser_) { this->subDetailSequence_parser_->pre (); ctx.nested_parser (this->subDetailSequence_parser_); } } else { if (this->subDetailSequence_parser_ != 0) { this->subDetailSequence_parser_->post_positiveInt (); this->subDetailSequence (); } count = 0; state = 1UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "noteNumber" && ns == "http://hl7.org/fhir") { if (start) { if (this->noteNumber_parser_) { this->noteNumber_parser_->pre (); ctx.nested_parser (this->noteNumber_parser_); } } else { if (this->noteNumber_parser_ != 0) { this->noteNumber_parser_->post_positiveInt (); this->noteNumber (); } count++; } break; } else { assert (start); count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "adjudication" && ns == "http://hl7.org/fhir") { if (start) { if (this->adjudication_parser_) { this->adjudication_parser_->pre (); ctx.nested_parser (this->adjudication_parser_); } } else { if (this->adjudication_parser_ != 0) { this->adjudication_parser_->post_ClaimResponse_Adjudication (); this->adjudication (); } count++; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_AddItem_pskel. // bool ClaimResponse_AddItem_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "itemSequence" && ns == "http://hl7.org/fhir") s = 0UL; else if (n == "detailSequence" && ns == "http://hl7.org/fhir") s = 1UL; else if (n == "subdetailSequence" && ns == "http://hl7.org/fhir") s = 2UL; else if (n == "provider" && ns == "http://hl7.org/fhir") s = 3UL; else if (n == "productOrService" && ns == "http://hl7.org/fhir") s = 4UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_AddItem_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_AddItem_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_AddItem_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_AddItem_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_AddItem_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "itemSequence" && ns == "http://hl7.org/fhir") { if (start) { if (this->itemSequence_parser_) { this->itemSequence_parser_->pre (); ctx.nested_parser (this->itemSequence_parser_); } } else { if (this->itemSequence_parser_ != 0) { this->itemSequence_parser_->post_positiveInt (); this->itemSequence (); } count++; } break; } else { assert (start); count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "detailSequence" && ns == "http://hl7.org/fhir") { if (start) { if (this->detailSequence_parser_) { this->detailSequence_parser_->pre (); ctx.nested_parser (this->detailSequence_parser_); } } else { if (this->detailSequence_parser_ != 0) { this->detailSequence_parser_->post_positiveInt (); this->detailSequence (); } count++; } break; } else { assert (start); count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "subdetailSequence" && ns == "http://hl7.org/fhir") { if (start) { if (this->subdetailSequence_parser_) { this->subdetailSequence_parser_->pre (); ctx.nested_parser (this->subdetailSequence_parser_); } } else { if (this->subdetailSequence_parser_ != 0) { this->subdetailSequence_parser_->post_positiveInt (); this->subdetailSequence (); } count++; } break; } else { assert (start); count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "provider" && ns == "http://hl7.org/fhir") { if (start) { if (this->provider_parser_) { this->provider_parser_->pre (); ctx.nested_parser (this->provider_parser_); } } else { if (this->provider_parser_ != 0) { this->provider_parser_->post_Reference (); this->provider (); } count++; } break; } else { assert (start); count = 0; state = 4UL; // Fall through. } } case 4UL: { if (n == "productOrService" && ns == "http://hl7.org/fhir") { if (start) { if (this->productOrService_parser_) { this->productOrService_parser_->pre (); ctx.nested_parser (this->productOrService_parser_); } } else { if (this->productOrService_parser_ != 0) { this->productOrService_parser_->post_CodeableConcept (); this->productOrService (); } count = 0; state = 5UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 5UL; // Fall through. } } case 5UL: { if (n == "modifier" && ns == "http://hl7.org/fhir") { if (start) { if (this->modifier_parser_) { this->modifier_parser_->pre (); ctx.nested_parser (this->modifier_parser_); } } else { if (this->modifier_parser_ != 0) { this->modifier_parser_->post_CodeableConcept (); this->modifier (); } count++; } break; } else { assert (start); count = 0; state = 6UL; // Fall through. } } case 6UL: { if (n == "programCode" && ns == "http://hl7.org/fhir") { if (start) { if (this->programCode_parser_) { this->programCode_parser_->pre (); ctx.nested_parser (this->programCode_parser_); } } else { if (this->programCode_parser_ != 0) { this->programCode_parser_->post_CodeableConcept (); this->programCode (); } count++; } break; } else { assert (start); count = 0; state = 7UL; // Fall through. } } case 7UL: { if (n == "servicedDate" && ns == "http://hl7.org/fhir") { if (start) { if (this->servicedDate_parser_) { this->servicedDate_parser_->pre (); ctx.nested_parser (this->servicedDate_parser_); } } else { if (this->servicedDate_parser_ != 0) { this->servicedDate_parser_->post_date (); this->servicedDate (); } count = 0; state = 8UL; } break; } else { assert (start); count = 0; state = 8UL; // Fall through. } } case 8UL: { if (n == "servicedPeriod" && ns == "http://hl7.org/fhir") { if (start) { if (this->servicedPeriod_parser_) { this->servicedPeriod_parser_->pre (); ctx.nested_parser (this->servicedPeriod_parser_); } } else { if (this->servicedPeriod_parser_ != 0) { this->servicedPeriod_parser_->post_Period (); this->servicedPeriod (); } count = 0; state = 9UL; } break; } else { assert (start); count = 0; state = 9UL; // Fall through. } } case 9UL: { if (n == "locationCodeableConcept" && ns == "http://hl7.org/fhir") { if (start) { if (this->locationCodeableConcept_parser_) { this->locationCodeableConcept_parser_->pre (); ctx.nested_parser (this->locationCodeableConcept_parser_); } } else { if (this->locationCodeableConcept_parser_ != 0) { this->locationCodeableConcept_parser_->post_CodeableConcept (); this->locationCodeableConcept (); } count = 0; state = 10UL; } break; } else { assert (start); count = 0; state = 10UL; // Fall through. } } case 10UL: { if (n == "locationAddress" && ns == "http://hl7.org/fhir") { if (start) { if (this->locationAddress_parser_) { this->locationAddress_parser_->pre (); ctx.nested_parser (this->locationAddress_parser_); } } else { if (this->locationAddress_parser_ != 0) { this->locationAddress_parser_->post_Address (); this->locationAddress (); } count = 0; state = 11UL; } break; } else { assert (start); count = 0; state = 11UL; // Fall through. } } case 11UL: { if (n == "locationReference" && ns == "http://hl7.org/fhir") { if (start) { if (this->locationReference_parser_) { this->locationReference_parser_->pre (); ctx.nested_parser (this->locationReference_parser_); } } else { if (this->locationReference_parser_ != 0) { this->locationReference_parser_->post_Reference (); this->locationReference (); } count = 0; state = 12UL; } break; } else { assert (start); count = 0; state = 12UL; // Fall through. } } case 12UL: { if (n == "quantity" && ns == "http://hl7.org/fhir") { if (start) { if (this->quantity_parser_) { this->quantity_parser_->pre (); ctx.nested_parser (this->quantity_parser_); } } else { if (this->quantity_parser_ != 0) { this->quantity_parser_->post_Quantity (); this->quantity (); } count = 0; state = 13UL; } break; } else { assert (start); count = 0; state = 13UL; // Fall through. } } case 13UL: { if (n == "unitPrice" && ns == "http://hl7.org/fhir") { if (start) { if (this->unitPrice_parser_) { this->unitPrice_parser_->pre (); ctx.nested_parser (this->unitPrice_parser_); } } else { if (this->unitPrice_parser_ != 0) { this->unitPrice_parser_->post_Money (); this->unitPrice (); } count = 0; state = 14UL; } break; } else { assert (start); count = 0; state = 14UL; // Fall through. } } case 14UL: { if (n == "factor" && ns == "http://hl7.org/fhir") { if (start) { if (this->factor_parser_) { this->factor_parser_->pre (); ctx.nested_parser (this->factor_parser_); } } else { if (this->factor_parser_ != 0) { this->factor_parser_->post_decimal (); this->factor (); } count = 0; state = 15UL; } break; } else { assert (start); count = 0; state = 15UL; // Fall through. } } case 15UL: { if (n == "net" && ns == "http://hl7.org/fhir") { if (start) { if (this->net_parser_) { this->net_parser_->pre (); ctx.nested_parser (this->net_parser_); } } else { if (this->net_parser_ != 0) { this->net_parser_->post_Money (); this->net (); } count = 0; state = 16UL; } break; } else { assert (start); count = 0; state = 16UL; // Fall through. } } case 16UL: { if (n == "bodySite" && ns == "http://hl7.org/fhir") { if (start) { if (this->bodySite_parser_) { this->bodySite_parser_->pre (); ctx.nested_parser (this->bodySite_parser_); } } else { if (this->bodySite_parser_ != 0) { this->bodySite_parser_->post_CodeableConcept (); this->bodySite (); } count = 0; state = 17UL; } break; } else { assert (start); count = 0; state = 17UL; // Fall through. } } case 17UL: { if (n == "subSite" && ns == "http://hl7.org/fhir") { if (start) { if (this->subSite_parser_) { this->subSite_parser_->pre (); ctx.nested_parser (this->subSite_parser_); } } else { if (this->subSite_parser_ != 0) { this->subSite_parser_->post_CodeableConcept (); this->subSite (); } count++; } break; } else { assert (start); count = 0; state = 18UL; // Fall through. } } case 18UL: { if (n == "noteNumber" && ns == "http://hl7.org/fhir") { if (start) { if (this->noteNumber_parser_) { this->noteNumber_parser_->pre (); ctx.nested_parser (this->noteNumber_parser_); } } else { if (this->noteNumber_parser_ != 0) { this->noteNumber_parser_->post_positiveInt (); this->noteNumber (); } count++; } break; } else { assert (start); count = 0; state = 19UL; // Fall through. } } case 19UL: { if (n == "adjudication" && ns == "http://hl7.org/fhir") { if (start) { if (this->adjudication_parser_) { this->adjudication_parser_->pre (); ctx.nested_parser (this->adjudication_parser_); } } else { if (this->adjudication_parser_ != 0) { this->adjudication_parser_->post_ClaimResponse_Adjudication (); this->adjudication (); } count++; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 20UL; // Fall through. } } case 20UL: { if (n == "detail" && ns == "http://hl7.org/fhir") { if (start) { if (this->detail_parser_) { this->detail_parser_->pre (); ctx.nested_parser (this->detail_parser_); } } else { if (this->detail_parser_ != 0) { this->detail_parser_->post_ClaimResponse_Detail1 (); this->detail (); } count++; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_Detail1_pskel. // bool ClaimResponse_Detail1_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "productOrService" && ns == "http://hl7.org/fhir") s = 0UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_Detail1_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_Detail1_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_Detail1_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_Detail1_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_Detail1_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "productOrService" && ns == "http://hl7.org/fhir") { if (start) { if (this->productOrService_parser_) { this->productOrService_parser_->pre (); ctx.nested_parser (this->productOrService_parser_); } } else { if (this->productOrService_parser_ != 0) { this->productOrService_parser_->post_CodeableConcept (); this->productOrService (); } count = 0; state = 1UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "modifier" && ns == "http://hl7.org/fhir") { if (start) { if (this->modifier_parser_) { this->modifier_parser_->pre (); ctx.nested_parser (this->modifier_parser_); } } else { if (this->modifier_parser_ != 0) { this->modifier_parser_->post_CodeableConcept (); this->modifier (); } count++; } break; } else { assert (start); count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "quantity" && ns == "http://hl7.org/fhir") { if (start) { if (this->quantity_parser_) { this->quantity_parser_->pre (); ctx.nested_parser (this->quantity_parser_); } } else { if (this->quantity_parser_ != 0) { this->quantity_parser_->post_Quantity (); this->quantity (); } count = 0; state = 3UL; } break; } else { assert (start); count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "unitPrice" && ns == "http://hl7.org/fhir") { if (start) { if (this->unitPrice_parser_) { this->unitPrice_parser_->pre (); ctx.nested_parser (this->unitPrice_parser_); } } else { if (this->unitPrice_parser_ != 0) { this->unitPrice_parser_->post_Money (); this->unitPrice (); } count = 0; state = 4UL; } break; } else { assert (start); count = 0; state = 4UL; // Fall through. } } case 4UL: { if (n == "factor" && ns == "http://hl7.org/fhir") { if (start) { if (this->factor_parser_) { this->factor_parser_->pre (); ctx.nested_parser (this->factor_parser_); } } else { if (this->factor_parser_ != 0) { this->factor_parser_->post_decimal (); this->factor (); } count = 0; state = 5UL; } break; } else { assert (start); count = 0; state = 5UL; // Fall through. } } case 5UL: { if (n == "net" && ns == "http://hl7.org/fhir") { if (start) { if (this->net_parser_) { this->net_parser_->pre (); ctx.nested_parser (this->net_parser_); } } else { if (this->net_parser_ != 0) { this->net_parser_->post_Money (); this->net (); } count = 0; state = 6UL; } break; } else { assert (start); count = 0; state = 6UL; // Fall through. } } case 6UL: { if (n == "noteNumber" && ns == "http://hl7.org/fhir") { if (start) { if (this->noteNumber_parser_) { this->noteNumber_parser_->pre (); ctx.nested_parser (this->noteNumber_parser_); } } else { if (this->noteNumber_parser_ != 0) { this->noteNumber_parser_->post_positiveInt (); this->noteNumber (); } count++; } break; } else { assert (start); count = 0; state = 7UL; // Fall through. } } case 7UL: { if (n == "adjudication" && ns == "http://hl7.org/fhir") { if (start) { if (this->adjudication_parser_) { this->adjudication_parser_->pre (); ctx.nested_parser (this->adjudication_parser_); } } else { if (this->adjudication_parser_ != 0) { this->adjudication_parser_->post_ClaimResponse_Adjudication (); this->adjudication (); } count++; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 8UL; // Fall through. } } case 8UL: { if (n == "subDetail" && ns == "http://hl7.org/fhir") { if (start) { if (this->subDetail_parser_) { this->subDetail_parser_->pre (); ctx.nested_parser (this->subDetail_parser_); } } else { if (this->subDetail_parser_ != 0) { this->subDetail_parser_->post_ClaimResponse_SubDetail1 (); this->subDetail (); } count++; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_SubDetail1_pskel. // bool ClaimResponse_SubDetail1_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "productOrService" && ns == "http://hl7.org/fhir") s = 0UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_SubDetail1_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_SubDetail1_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_SubDetail1_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_SubDetail1_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_SubDetail1_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "productOrService" && ns == "http://hl7.org/fhir") { if (start) { if (this->productOrService_parser_) { this->productOrService_parser_->pre (); ctx.nested_parser (this->productOrService_parser_); } } else { if (this->productOrService_parser_ != 0) { this->productOrService_parser_->post_CodeableConcept (); this->productOrService (); } count = 0; state = 1UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "modifier" && ns == "http://hl7.org/fhir") { if (start) { if (this->modifier_parser_) { this->modifier_parser_->pre (); ctx.nested_parser (this->modifier_parser_); } } else { if (this->modifier_parser_ != 0) { this->modifier_parser_->post_CodeableConcept (); this->modifier (); } count++; } break; } else { assert (start); count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "quantity" && ns == "http://hl7.org/fhir") { if (start) { if (this->quantity_parser_) { this->quantity_parser_->pre (); ctx.nested_parser (this->quantity_parser_); } } else { if (this->quantity_parser_ != 0) { this->quantity_parser_->post_Quantity (); this->quantity (); } count = 0; state = 3UL; } break; } else { assert (start); count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "unitPrice" && ns == "http://hl7.org/fhir") { if (start) { if (this->unitPrice_parser_) { this->unitPrice_parser_->pre (); ctx.nested_parser (this->unitPrice_parser_); } } else { if (this->unitPrice_parser_ != 0) { this->unitPrice_parser_->post_Money (); this->unitPrice (); } count = 0; state = 4UL; } break; } else { assert (start); count = 0; state = 4UL; // Fall through. } } case 4UL: { if (n == "factor" && ns == "http://hl7.org/fhir") { if (start) { if (this->factor_parser_) { this->factor_parser_->pre (); ctx.nested_parser (this->factor_parser_); } } else { if (this->factor_parser_ != 0) { this->factor_parser_->post_decimal (); this->factor (); } count = 0; state = 5UL; } break; } else { assert (start); count = 0; state = 5UL; // Fall through. } } case 5UL: { if (n == "net" && ns == "http://hl7.org/fhir") { if (start) { if (this->net_parser_) { this->net_parser_->pre (); ctx.nested_parser (this->net_parser_); } } else { if (this->net_parser_ != 0) { this->net_parser_->post_Money (); this->net (); } count = 0; state = 6UL; } break; } else { assert (start); count = 0; state = 6UL; // Fall through. } } case 6UL: { if (n == "noteNumber" && ns == "http://hl7.org/fhir") { if (start) { if (this->noteNumber_parser_) { this->noteNumber_parser_->pre (); ctx.nested_parser (this->noteNumber_parser_); } } else { if (this->noteNumber_parser_ != 0) { this->noteNumber_parser_->post_positiveInt (); this->noteNumber (); } count++; } break; } else { assert (start); count = 0; state = 7UL; // Fall through. } } case 7UL: { if (n == "adjudication" && ns == "http://hl7.org/fhir") { if (start) { if (this->adjudication_parser_) { this->adjudication_parser_->pre (); ctx.nested_parser (this->adjudication_parser_); } } else { if (this->adjudication_parser_ != 0) { this->adjudication_parser_->post_ClaimResponse_Adjudication (); this->adjudication (); } count++; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_Total_pskel. // bool ClaimResponse_Total_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "category" && ns == "http://hl7.org/fhir") s = 0UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_Total_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_Total_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_Total_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_Total_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_Total_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "category" && ns == "http://hl7.org/fhir") { if (start) { if (this->category_parser_) { this->category_parser_->pre (); ctx.nested_parser (this->category_parser_); } } else { if (this->category_parser_ != 0) { this->category_parser_->post_CodeableConcept (); this->category (); } count = 0; state = 1UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "amount" && ns == "http://hl7.org/fhir") { if (start) { if (this->amount_parser_) { this->amount_parser_->pre (); ctx.nested_parser (this->amount_parser_); } } else { if (this->amount_parser_ != 0) { this->amount_parser_->post_Money (); this->amount (); } count = 0; state = ~0UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_Payment_pskel. // bool ClaimResponse_Payment_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "type" && ns == "http://hl7.org/fhir") s = 0UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_Payment_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_Payment_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_Payment_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_Payment_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_Payment_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "type" && ns == "http://hl7.org/fhir") { if (start) { if (this->type_parser_) { this->type_parser_->pre (); ctx.nested_parser (this->type_parser_); } } else { if (this->type_parser_ != 0) { this->type_parser_->post_CodeableConcept (); this->type (); } count = 0; state = 1UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "adjustment" && ns == "http://hl7.org/fhir") { if (start) { if (this->adjustment_parser_) { this->adjustment_parser_->pre (); ctx.nested_parser (this->adjustment_parser_); } } else { if (this->adjustment_parser_ != 0) { this->adjustment_parser_->post_Money (); this->adjustment (); } count = 0; state = 2UL; } break; } else { assert (start); count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "adjustmentReason" && ns == "http://hl7.org/fhir") { if (start) { if (this->adjustmentReason_parser_) { this->adjustmentReason_parser_->pre (); ctx.nested_parser (this->adjustmentReason_parser_); } } else { if (this->adjustmentReason_parser_ != 0) { this->adjustmentReason_parser_->post_CodeableConcept (); this->adjustmentReason (); } count = 0; state = 3UL; } break; } else { assert (start); count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "date" && ns == "http://hl7.org/fhir") { if (start) { if (this->date_parser_) { this->date_parser_->pre (); ctx.nested_parser (this->date_parser_); } } else { if (this->date_parser_ != 0) { this->date_parser_->post_date (); this->date (); } count = 0; state = 4UL; } break; } else { assert (start); count = 0; state = 4UL; // Fall through. } } case 4UL: { if (n == "amount" && ns == "http://hl7.org/fhir") { if (start) { if (this->amount_parser_) { this->amount_parser_->pre (); ctx.nested_parser (this->amount_parser_); } } else { if (this->amount_parser_ != 0) { this->amount_parser_->post_Money (); this->amount (); } count = 0; state = 5UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 5UL; // Fall through. } } case 5UL: { if (n == "identifier" && ns == "http://hl7.org/fhir") { if (start) { if (this->identifier_parser_) { this->identifier_parser_->pre (); ctx.nested_parser (this->identifier_parser_); } } else { if (this->identifier_parser_ != 0) { this->identifier_parser_->post_Identifier (); this->identifier (); } count = 0; state = ~0UL; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_ProcessNote_pskel. // bool ClaimResponse_ProcessNote_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "number" && ns == "http://hl7.org/fhir") s = 0UL; else if (n == "type" && ns == "http://hl7.org/fhir") s = 1UL; else if (n == "text" && ns == "http://hl7.org/fhir") s = 2UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_ProcessNote_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_ProcessNote_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_ProcessNote_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_ProcessNote_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_ProcessNote_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "number" && ns == "http://hl7.org/fhir") { if (start) { if (this->number_parser_) { this->number_parser_->pre (); ctx.nested_parser (this->number_parser_); } } else { if (this->number_parser_ != 0) { this->number_parser_->post_positiveInt (); this->number (); } count = 0; state = 1UL; } break; } else { assert (start); count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "type" && ns == "http://hl7.org/fhir") { if (start) { if (this->type_parser_) { this->type_parser_->pre (); ctx.nested_parser (this->type_parser_); } } else { if (this->type_parser_ != 0) { this->type_parser_->post_NoteType (); this->type (); } count = 0; state = 2UL; } break; } else { assert (start); count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "text" && ns == "http://hl7.org/fhir") { if (start) { if (this->text_parser_) { this->text_parser_->pre (); ctx.nested_parser (this->text_parser_); } } else { if (this->text_parser_ != 0) { this->text_parser_->post_string (); this->text (); } count = 0; state = 3UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "language" && ns == "http://hl7.org/fhir") { if (start) { if (this->language_parser_) { this->language_parser_->pre (); ctx.nested_parser (this->language_parser_); } } else { if (this->language_parser_ != 0) { this->language_parser_->post_CodeableConcept (); this->language (); } count = 0; state = ~0UL; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_Insurance_pskel. // bool ClaimResponse_Insurance_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "sequence" && ns == "http://hl7.org/fhir") s = 0UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_Insurance_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_Insurance_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_Insurance_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_Insurance_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_Insurance_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "sequence" && ns == "http://hl7.org/fhir") { if (start) { if (this->sequence_parser_) { this->sequence_parser_->pre (); ctx.nested_parser (this->sequence_parser_); } } else { if (this->sequence_parser_ != 0) { this->sequence_parser_->post_positiveInt (); this->sequence (); } count = 0; state = 1UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "focal" && ns == "http://hl7.org/fhir") { if (start) { if (this->focal_parser_) { this->focal_parser_->pre (); ctx.nested_parser (this->focal_parser_); } } else { if (this->focal_parser_ != 0) { this->focal_parser_->post_boolean (); this->focal (); } count = 0; state = 2UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "coverage" && ns == "http://hl7.org/fhir") { if (start) { if (this->coverage_parser_) { this->coverage_parser_->pre (); ctx.nested_parser (this->coverage_parser_); } } else { if (this->coverage_parser_ != 0) { this->coverage_parser_->post_Reference (); this->coverage (); } count = 0; state = 3UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "businessArrangement" && ns == "http://hl7.org/fhir") { if (start) { if (this->businessArrangement_parser_) { this->businessArrangement_parser_->pre (); ctx.nested_parser (this->businessArrangement_parser_); } } else { if (this->businessArrangement_parser_ != 0) { this->businessArrangement_parser_->post_string (); this->businessArrangement (); } count = 0; state = 4UL; } break; } else { assert (start); count = 0; state = 4UL; // Fall through. } } case 4UL: { if (n == "claimResponse" && ns == "http://hl7.org/fhir") { if (start) { if (this->claimResponse_parser_) { this->claimResponse_parser_->pre (); ctx.nested_parser (this->claimResponse_parser_); } } else { if (this->claimResponse_parser_ != 0) { this->claimResponse_parser_->post_Reference (); this->claimResponse (); } count = 0; state = ~0UL; } break; } else { assert (start); count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } // Element validation and dispatch functions for ClaimResponse_Error_pskel. // bool ClaimResponse_Error_pskel:: _start_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { ::xsde::cxx::parser::context& ctx = this->_context (); v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); if (vd->func == 0 && vd->state == 0) { typedef ::fhir::BackboneElement_pskel base; if (base::_start_element_impl (ns, n)) return true; else vd->state = 1; } while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, ns, n, true); vd = vs.data + (vs.size - 1); if (vd->state == ~0UL && !ctx.error_type ()) vd = vs.data + (--vs.size - 1); else break; } if (vd->func == 0) { if (vd->state != ~0UL) { unsigned long s = ~0UL; if (n == "itemSequence" && ns == "http://hl7.org/fhir") s = 0UL; else if (n == "detailSequence" && ns == "http://hl7.org/fhir") s = 1UL; else if (n == "subDetailSequence" && ns == "http://hl7.org/fhir") s = 2UL; else if (n == "code" && ns == "http://hl7.org/fhir") s = 3UL; if (s != ~0UL) { vd->count++; vd->state = ~0UL; vd = vs.data + vs.size++; vd->func = &ClaimResponse_Error_pskel::sequence_0; vd->state = s; vd->count = 0; this->sequence_0 (vd->state, vd->count, ns, n, true); } else { if (vd->count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); return true; } return false; } } else return false; } return true; } bool ClaimResponse_Error_pskel:: _end_element_impl (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n) { v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size - 1]; if (vd.func == 0 && vd.state == 0) { typedef ::fhir::BackboneElement_pskel base; if (!base::_end_element_impl (ns, n)) assert (false); return true; } assert (vd.func != 0); (this->*vd.func) (vd.state, vd.count, ns, n, false); if (vd.state == ~0UL) vs.size--; return true; } void ClaimResponse_Error_pskel:: _pre_e_validate () { this->v_state_stack_.push (); static_cast< v_state_* > (this->v_state_stack_.top ())->size = 0; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_& vd = vs.data[vs.size++]; vd.func = 0; vd.state = 0; vd.count = 0; typedef ::fhir::BackboneElement_pskel base; base::_pre_e_validate (); } void ClaimResponse_Error_pskel:: _post_e_validate () { ::xsde::cxx::parser::context& ctx = this->_context (); typedef ::fhir::BackboneElement_pskel base; base::_post_e_validate (); if (ctx.error_type ()) return; v_state_& vs = *static_cast< v_state_* > (this->v_state_stack_.top ()); v_state_descr_* vd = vs.data + (vs.size - 1); ::xsde::cxx::ro_string empty; while (vd->func != 0) { (this->*vd->func) (vd->state, vd->count, empty, empty, true); if (ctx.error_type ()) return; assert (vd->state == ~0UL); vd = vs.data + (--vs.size - 1); } if (vd->count < 1UL) this->_schema_error (::xsde::cxx::schema_error::expected_element); this->v_state_stack_.pop (); } void ClaimResponse_Error_pskel:: sequence_0 (unsigned long& state, unsigned long& count, const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, bool start) { ::xsde::cxx::parser::context& ctx = this->_context (); XSDE_UNUSED (ctx); switch (state) { case 0UL: { if (n == "itemSequence" && ns == "http://hl7.org/fhir") { if (start) { if (this->itemSequence_parser_) { this->itemSequence_parser_->pre (); ctx.nested_parser (this->itemSequence_parser_); } } else { if (this->itemSequence_parser_ != 0) { this->itemSequence_parser_->post_positiveInt (); this->itemSequence (); } count = 0; state = 1UL; } break; } else { assert (start); count = 0; state = 1UL; // Fall through. } } case 1UL: { if (n == "detailSequence" && ns == "http://hl7.org/fhir") { if (start) { if (this->detailSequence_parser_) { this->detailSequence_parser_->pre (); ctx.nested_parser (this->detailSequence_parser_); } } else { if (this->detailSequence_parser_ != 0) { this->detailSequence_parser_->post_positiveInt (); this->detailSequence (); } count = 0; state = 2UL; } break; } else { assert (start); count = 0; state = 2UL; // Fall through. } } case 2UL: { if (n == "subDetailSequence" && ns == "http://hl7.org/fhir") { if (start) { if (this->subDetailSequence_parser_) { this->subDetailSequence_parser_->pre (); ctx.nested_parser (this->subDetailSequence_parser_); } } else { if (this->subDetailSequence_parser_ != 0) { this->subDetailSequence_parser_->post_positiveInt (); this->subDetailSequence (); } count = 0; state = 3UL; } break; } else { assert (start); count = 0; state = 3UL; // Fall through. } } case 3UL: { if (n == "code" && ns == "http://hl7.org/fhir") { if (start) { if (this->code_parser_) { this->code_parser_->pre (); ctx.nested_parser (this->code_parser_); } } else { if (this->code_parser_ != 0) { this->code_parser_->post_CodeableConcept (); this->code (); } count = 0; state = ~0UL; } break; } else { assert (start); if (count < 1UL) { this->_schema_error (::xsde::cxx::schema_error::expected_element); break; } count = 0; state = ~0UL; // Fall through. } } case ~0UL: break; } } } namespace fhir { // Attribute validation and dispatch functions for ClaimProcessingCodes_pskel. // bool ClaimProcessingCodes_pskel:: _attribute_impl_phase_one (const ::xsde::cxx::ro_string& ns, const ::xsde::cxx::ro_string& n, const ::xsde::cxx::ro_string& s) { ::xsde::cxx::parser::context& ctx = this->_context (); if (n == "value" && ns.empty ()) { if (this->value_parser_) { this->value_parser_->pre (); this->value_parser_->_pre_impl (ctx); if (!ctx.error_type ()) this->value_parser_->_characters (s); if (!ctx.error_type ()) this->value_parser_->_post_impl (); if (!ctx.error_type ()) this->value_parser_->post_ClaimProcessingCodes_list (); this->value (); } return true; } typedef ::fhir::Element_pskel base; return base::_attribute_impl_phase_one (ns, n, s); } } namespace fhir { } #include <xsde/cxx/post.hxx> // Begin epilogue. // // // End epilogue.
[ "luca.toldo@sap.com" ]
luca.toldo@sap.com
ec08c107c7344067e832b41edc8363d0b091a8d6
45364deefe009a0df9e745a4dd4b680dcedea42b
/SDK/FSD_WeaponDisplay_GatlingGun_AmmoCount_parameters.hpp
c87e09dd1af258dc2d01df8238bd00450decaecb
[]
no_license
RussellJerome/DeepRockGalacticSDK
5ae9b59c7324f2a97035f28545f92773526ed99e
f13d9d8879a645c3de89ad7dc6756f4a7a94607e
refs/heads/master
2022-11-26T17:55:08.185666
2020-07-26T21:39:30
2020-07-26T21:39:30
277,796,048
0
0
null
null
null
null
UTF-8
C++
false
false
2,930
hpp
#pragma once // DeepRockGalactic SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "FSD_WeaponDisplay_GatlingGun_AmmoCount_classes.hpp" namespace SDK { //--------------------------------------------------------------------------- //Parameters //--------------------------------------------------------------------------- // Function WeaponDisplay_GatlingGun_AmmoCount.WeaponDisplay_GatlingGun_AmmoCount_C.AdjustPercentage struct UWeaponDisplay_GatlingGun_AmmoCount_C_AdjustPercentage_Params { }; // Function WeaponDisplay_GatlingGun_AmmoCount.WeaponDisplay_GatlingGun_AmmoCount_C.AnimateClipCount struct UWeaponDisplay_GatlingGun_AmmoCount_C_AnimateClipCount_Params { }; // Function WeaponDisplay_GatlingGun_AmmoCount.WeaponDisplay_GatlingGun_AmmoCount_C.AdjustProgressBar struct UWeaponDisplay_GatlingGun_AmmoCount_C_AdjustProgressBar_Params { }; // Function WeaponDisplay_GatlingGun_AmmoCount.WeaponDisplay_GatlingGun_AmmoCount_C.SetClipCount struct UWeaponDisplay_GatlingGun_AmmoCount_C_SetClipCount_Params { int* Value; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) }; // Function WeaponDisplay_GatlingGun_AmmoCount.WeaponDisplay_GatlingGun_AmmoCount_C.Check AmmoLow struct UWeaponDisplay_GatlingGun_AmmoCount_C_Check_AmmoLow_Params { }; // Function WeaponDisplay_GatlingGun_AmmoCount.WeaponDisplay_GatlingGun_AmmoCount_C.SetTotalCount struct UWeaponDisplay_GatlingGun_AmmoCount_C_SetTotalCount_Params { int* Value; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) }; // Function WeaponDisplay_GatlingGun_AmmoCount.WeaponDisplay_GatlingGun_AmmoCount_C.SetMaxAmmo struct UWeaponDisplay_GatlingGun_AmmoCount_C_SetMaxAmmo_Params { int* Value; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) }; // Function WeaponDisplay_GatlingGun_AmmoCount.WeaponDisplay_GatlingGun_AmmoCount_C.Construct struct UWeaponDisplay_GatlingGun_AmmoCount_C_Construct_Params { }; // Function WeaponDisplay_GatlingGun_AmmoCount.WeaponDisplay_GatlingGun_AmmoCount_C.OnAmmoLowFinished struct UWeaponDisplay_GatlingGun_AmmoCount_C_OnAmmoLowFinished_Params { }; // Function WeaponDisplay_GatlingGun_AmmoCount.WeaponDisplay_GatlingGun_AmmoCount_C.ExecuteUbergraph_WeaponDisplay_GatlingGun_AmmoCount struct UWeaponDisplay_GatlingGun_AmmoCount_C_ExecuteUbergraph_WeaponDisplay_GatlingGun_AmmoCount_Params { int* EntryPoint; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "darkmanvoo@gmail.com" ]
darkmanvoo@gmail.com
804fa0830e1340277716473355c4ec0ad5233562
e6b668c5afc2a333a836bd8dc1dce6e04a5ef328
/light oj/1085.cpp
4c7a7392b69461e89dcedd8c2eccada85fe2e641
[]
no_license
mahim007/Online-Judge
13b48cfe8fe1e8a723ea8e9e2ad40efec266e7ee
f703fe624035a86d7c6433c9111a3e3ee3e43a77
refs/heads/master
2020-03-11T21:02:04.724870
2018-04-20T11:28:42
2018-04-20T11:28:42
130,253,727
2
0
null
null
null
null
UTF-8
C++
false
false
1,379
cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int #define mod 1000000007 #define mxn 100009 ll a[mxn],b[mxn]; ll tree[4*mxn]; void update(ll idx,ll l,ll r,ll x,ll y){ if(l>x || r<x) return; if(l==x && r==x){ tree[idx]+=y; tree[idx]%=mod; return; } ll mid=(l+r)>>1; ll L=idx<<1; ll R=L+1; update(L,l,mid,x,y); update(R,mid+1,r,x,y); tree[idx]=(tree[L]+tree[R])%mod; } ll query(ll idx,ll l,ll r,ll x,ll y){ if(l>y || r<x) return 0; if(l>=x && r<=y) return tree[idx]; ll mid=(l+r)>>1; ll L=idx<<1; ll R=L+1; ll p1=query(L,l,mid,x,y); ll p2=query(R,mid+1,r,x,y); return (p1+p2)%mod; } int main(){ ll t,T,i,n,sum,j; scanf("%lld",&T); for(t=1;t<=T;t++){ scanf("%lld",&n); for(i=1;i<=n;i++){ scanf("%lld",&a[i]); b[i]=a[i]; } sort(b+1,b+n+1); memset(tree,0,sizeof tree); for(i=1;i<=n;i++){ ll val=a[i]; ll pos=lower_bound(b+1,b+1+n,val)-b; //cout<<pos<<"\n"; if(pos==1){ update(1,1,n,1,1); } else{ ll res=query(1,1,n,1,pos-1)+1; res%=mod; update(1,1,n,pos,res); } } printf("Case %lld: %lld\n",t,tree[1]); } return 0; }
[ "ashrafulmahim@gmail.com" ]
ashrafulmahim@gmail.com
dbe1afe783aa205d1b4c400695db7082fe1a7a9b
8f1e048b57256a53ddd38a0c9e5deca7a4748904
/Practicas/P4/ejercicio6/src/Skyline.cpp
cdeede331167ef1afca9ae6e45d6808ce5b87f7d
[]
no_license
xexugarcia95/MP
821ddb517212ed65d1ade3e4911a1fd9b7febd8a
bf8346d46edc0c33347db3341f2fb77637e1454a
refs/heads/master
2021-04-28T02:51:31.190823
2018-06-08T17:19:22
2018-06-08T17:19:22
122,126,250
0
0
null
null
null
null
UTF-8
C++
false
false
679
cpp
#include "Skyline.h" #include <cassert> Skyline::Skyline() { abscisas = 0; alturas = 0; n = 0; } Skyline::Skyline(double ab1,double ab2,double alt) { abscisas = new double[2]; alturas = new double[2]; abscisas[0] = ab1; abscisas[1] = ab2; alturas[0] = alt; alturas[1] = 0; n = 2; } Skyline::Skyline(const Skyline& s) { n = s.n; abscisas = new double[n]; alturas = new double[n]; for(int i=0;i<n;i++) { abscisas[i] = s.abscisas[i]; alturas[i] = s.alturas[i]; } } Skyline::~Skyline() { delete [] abscisas; delete [] alturas; n = 0; } double& Skyline::operator[](int i) { assert(i>=0); assert(i<=n); return abscisas[i]; }
[ "xexugarcia95@gmail.com" ]
xexugarcia95@gmail.com
b022dc3d8df092a0a0fe168044959258d257c949
6a881bd00b282e36606a6ae286e06b0dc304c7ea
/DirectX/Component/Game/Enemy/OctopusHead.cpp
6fdcf574d65868bac8f8b437343d4890b11960c5
[]
no_license
soelusoelu/U22
4888aae858991a97bddd924b84a92857e14e1938
7456dbbbbff272f8523e2122917bdbfa9cf74e2c
refs/heads/master
2023-08-14T13:25:22.355532
2021-09-09T08:45:04
2021-09-09T08:45:04
365,081,987
0
0
null
null
null
null
UTF-8
C++
false
false
1,396
cpp
#include "OctopusHead.h" #include "../../Engine/Collider/OBBCollider.h" #include "../../../Engine/DebugManager/DebugUtility/Debug.h" #include "../../../Utility/JsonHelper.h" OctopusHead::OctopusHead() : Component() , mIsDestroy(false) { } OctopusHead::~OctopusHead() = default; void OctopusHead::start() { //全コライダーから対象ボーンのコライダーを抜き出す auto colliders = getComponents<OBBCollider>(); for (const auto& c : colliders) { auto no = c->getBone().number; auto result = std::find(mTargetBoneNo.begin(), mTargetBoneNo.end(), no); if (result != mTargetBoneNo.end()) { mColliders.emplace_back(c); } } } void OctopusHead::saveAndLoad(rapidjson::Value& inObj, rapidjson::Document::AllocatorType& alloc, FileMode mode) { JsonHelper::getSet(mTargetBoneNo, "targetBoneNo", inObj, alloc, mode); } const OBBColliderPtrArray& OctopusHead::getColliders() const { return mColliders; } void OctopusHead::takeDamage(int damage) { mIsDestroy = true; mOnDestroy(); Debug::log("death"); } int OctopusHead::getHp() const { //頭はHP1で固定だから生きてたら1、死んでたら0 return (isDestroy()) ? 0 : 1; } bool OctopusHead::isDestroy() const { return mIsDestroy; } void OctopusHead::onDestroy(const std::function<void()>& f) { mOnDestroy += f; }
[ "llmn.0419@gmail.com" ]
llmn.0419@gmail.com
551becb62c503969a05ee4f6d90e8e8371df91f1
2154a4943bed2c7fe95f481371136f64a2023aa5
/partie.hpp
1ebb38edd600b89df32691f69d49414057ba3854
[]
no_license
nocro/LoupGarouServ
6ff01c3e05603912ee198edf028f8c2167514466
4f31c1b5099845ebbe4f13a0c427670ac877a467
refs/heads/main
2023-02-24T14:53:53.242821
2021-01-18T23:46:25
2021-01-18T23:46:25
328,189,518
0
0
null
null
null
null
UTF-8
C++
false
false
870
hpp
#ifndef PARTIE_HPP #define PARTIE_HPP #include "joueur.hpp" #include <vector> #include "serveur.hpp" #include <algorithm> #include "utils.hpp" class Partie { private: std::vector<Joueur> joueurs; // on peut mettre le rôle dedans faudra juste lire tous les clients au lieux de lire juste les rôle actifs mais c'est negligeable std::vector<std::string> role_actif;// je sais pas si ya vraiment besoin de faire un type Role std::map<std::string, int> role_joueur; // une map qui associe un role a l'indice du joueur concerné std::map<std::string, std::string> pseudo_role; // associe un pseudo a un role Server server; bool enAttenteDeCo; std::thread portier; // celui qui vas gérer les connexions public: Partie(); ~Partie(); void demarage(); void waitingClient(); void run(); bool isEnd(); }; #endif
[ "simon.monteiro@gmail.com" ]
simon.monteiro@gmail.com
dc85b8626a2a31e4dc4b07112cc83508770caf77
45d0a93e87e096cffd6e47c683ab5c7a6faae30a
/Barricade.cpp
44db7dfd5f29238e3812085e572672645271825b
[]
no_license
Mini0040/OldGame
426357ca239affbd5561db42ce3087a9f42db9aa
f1c0d51180d60a4b591ad0b0bdb9c43c83f070ea
refs/heads/master
2021-01-12T09:58:30.406772
2016-12-13T03:54:40
2016-12-13T03:54:40
76,320,644
0
0
null
null
null
null
UTF-8
C++
false
false
2,770
cpp
#include "Barricade.h" #include <iostream> Barricade::Barricade(std::string Filename) { objPosition.xPos = objPosition.yPos = objPosition.boxRadius = 0; toDraw = false; health = armor = 0; this->loadTexture(Filename); } Barricade::Barricade() { objPosition.xPos = objPosition.yPos = objPosition.boxRadius = 0; toDraw = false; health = armor = 0; this->loadTexture("Barricade.png"); } Barricade::~Barricade() { objPosition.xPos = objPosition.yPos = objPosition.boxRadius = 0; toDraw = false; health = armor = 0; this->deleteTexture(); } void Barricade::newBarricade(double xPos, double yPos, int armor, double Rotation) { objPosition.xPos = xPos; objPosition.yPos = yPos; this->armor = armor; health = 100; objPosition.boxRadius = 0.1; toDraw = true; this->Rotation = Rotation; } bool Barricade::interactedBarricade(unsigned int itemID) { if(toDraw) { switch(itemID) { case 200: if(health - (1 - armor) <= 5) { health = 5; return true; break; } health = health - (1 - armor); return true; break; default: return false; } } return false; } void Barricade::removeBarricade() { health = armor = 0; objPosition.xPos = objPosition.yPos = objPosition.boxRadius = 0; toDraw = false; } bool Barricade::determineToDraw() { if(health > 5) { toDraw = true; return true; } toDraw = false; return false; } double Barricade::getX() { return objPosition.xPos; } double Barricade::getY() { return objPosition.yPos; } unsigned int Barricade::getHealth() { return health; } double Barricade::getBoxRadius() { return objPosition.boxRadius; } void Barricade::drawBarricade() { if(determineToDraw()) { glPushMatrix(); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, this->getTexture()); glTranslatef(objPosition.xPos, objPosition.yPos, 0); glRotatef(Rotation, 0, 0, 1); glTranslatef(-objPosition.xPos, -objPosition.yPos, 0); glBegin(GL_QUADS); glTexCoord2d(0, 0); glVertex3f(objPosition.xPos - objPosition.boxRadius, objPosition.yPos - objPosition.boxRadius, 0); glTexCoord2d(0, 1); glVertex3f(objPosition.xPos - objPosition.boxRadius, objPosition.yPos + objPosition.boxRadius, 0); glTexCoord2d(1, 1); glVertex3f(objPosition.xPos + objPosition.boxRadius, objPosition.yPos + objPosition.boxRadius, 0); glTexCoord2d(1, 0); glVertex3f(objPosition.xPos + objPosition.boxRadius, objPosition.yPos - objPosition.boxRadius, 0); glEnd(); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glPopMatrix(); } } unsigned int* Barricade::getHealthP() { return &health; }
[ "noreply@github.com" ]
noreply@github.com
3c5c1abcf6d94b36d1f0bf5121715c742ad0ccfa
dfb0999c9d0e6f54afba0d805d3d539549998bd7
/새 폴더/exam05.cpp
d9d9cf7c37745debdc0b75fc6907608f501e249c
[]
no_license
yuhwanwoo/cpp_review
e59f4b20ff00ff55852f38c03bc156a166906d44
2f7c554a38569821c64b5cf3259840cf35e6f834
refs/heads/main
2023-06-05T11:36:50.593551
2021-06-30T10:15:31
2021-06-30T10:15:31
312,021,688
0
0
null
null
null
null
UTF-8
C++
false
false
470
cpp
#include <bits/stdc++.h> #include <cmath> #define pi 3.14 using namespace std; string str; int main() { cin>>str; int x=str[0]-'0'; int y=str[2]-'0'; double leng=sqrt((double)x*x+y*y); int angle; cin>>angle; double arc=acos((double)x/y); int rad=arc*180/pi; double newAngle=rad+angle; newAngle=(newAngle)*pi/180; double x1=leng*(double)cos(newAngle); double y1=leng*(double)sin(newAngle); cout<<x1<<","<<y1<<"\n"; }
[ "6514687@naver.com" ]
6514687@naver.com
323e4cf04db4837ac1136e7355035db3059a1221
d281779d5d4a1e7f2f91ad6fc5346596a46cc2c5
/playerbot/strategy/values/PartyMemberWithoutItemValue.cpp
7d012d2fd9bf69ce038b91011ec11e6154e80ba1
[]
no_license
celguar/mangosbot-dev
0ec9df3915420895af51fb11209d5c6bfd8b5321
092690c692074dab1a84358067caf21b0705bcd3
refs/heads/master
2023-02-14T23:13:18.209401
2021-01-11T10:30:27
2021-01-11T10:30:27
298,051,491
5
1
null
null
null
null
UTF-8
C++
false
false
2,840
cpp
#include "botpch.h" #include "../../playerbot.h" #include "PartyMemberWithoutItemValue.h" #include "../../ServerFacade.h" using namespace ai; class PlayerWithoutItemPredicate : public FindPlayerPredicate, public PlayerbotAIAware { public: PlayerWithoutItemPredicate(PlayerbotAI* ai, string item) : PlayerbotAIAware(ai), FindPlayerPredicate(), item(item) {} public: virtual bool Check(Unit* unit) { Pet* pet = dynamic_cast<Pet*>(unit); if (pet && (pet->getPetType() == MINI_PET || pet->getPetType() == SUMMON_PET)) return false; if (!sServerFacade.IsAlive(unit)) return false; Player* member = dynamic_cast<Player*>(unit); if (!member) return false; if (!(member->IsInSameGroupWith(ai->GetBot()) || member->IsInSameRaidWith(ai->GetBot()))) return false; PlayerbotAI *botAi = member->GetPlayerbotAI(); if (!botAi) return false; return !botAi->GetAiObjectContext()->GetValue<uint8>("item count", item)->Get(); } private: string item; }; Unit* PartyMemberWithoutItemValue::Calculate() { FindPlayerPredicate *predicate = CreatePredicate(); Unit *unit = FindPartyMember(*predicate); delete predicate; return unit; } FindPlayerPredicate* PartyMemberWithoutItemValue::CreatePredicate() { return new PlayerWithoutItemPredicate(ai, qualifier); } class PlayerWithoutFoodPredicate : public PlayerWithoutItemPredicate { public: PlayerWithoutFoodPredicate(PlayerbotAI* ai) : PlayerWithoutItemPredicate(ai, "conjured food") {} public: virtual bool Check(Unit* unit) { if (!PlayerWithoutItemPredicate::Check(unit)) return false; Player* member = dynamic_cast<Player*>(unit); if (!member) return false; return member->getClass() != CLASS_MAGE; } }; class PlayerWithoutWaterPredicate : public PlayerWithoutItemPredicate { public: PlayerWithoutWaterPredicate(PlayerbotAI* ai) : PlayerWithoutItemPredicate(ai, "conjured water") {} public: virtual bool Check(Unit* unit) { if (!PlayerWithoutItemPredicate::Check(unit)) return false; Player* member = dynamic_cast<Player*>(unit); if (!member) return false; uint8 cls = member->getClass(); return cls == CLASS_DRUID || cls == CLASS_HUNTER || cls == CLASS_PALADIN || cls == CLASS_PRIEST || cls == CLASS_SHAMAN || cls == CLASS_WARLOCK; } }; FindPlayerPredicate* PartyMemberWithoutFoodValue::CreatePredicate() { return new PlayerWithoutFoodPredicate(ai); } FindPlayerPredicate* PartyMemberWithoutWaterValue::CreatePredicate() { return new PlayerWithoutWaterPredicate(ai); }
[ "celguar@gmail.com" ]
celguar@gmail.com
a1ab284985a90ab228c1d9afdeeeb483566c64b1
9732270148d744ca01c5d43cbfaddbcaf313fb80
/vjudge/little_kawayi/HDU/6202/13502897_TLE_0ms_0kB.cpp
b2ebbaf3624d770442d400419d291472dd0ceda2
[]
no_license
Bocity/ACM
bbb7c414aa8abae6d88e2bb89c4ab1fd105a1c5a
9ec1ece943a4608e96829b07374c3567edcd6872
refs/heads/master
2021-01-04T02:41:42.108269
2019-01-18T07:17:01
2019-01-18T07:17:01
76,115,460
0
0
null
null
null
null
UTF-8
C++
false
false
169
cpp
#include <bits/stdc++.h> using namespace std; int t; int main(){ cin >>t; if (t==9)while(1); else cout << "fuck"; //cout << "NO" << endl; return 0; }
[ "haolovej@vip.qq.com" ]
haolovej@vip.qq.com
ad0a33373f4ffd65a448da8001c8603aa66a566b
b53b73f8ded166c631f9699749d6d2baf2756d1e
/se2007/game/client/dod/fx_dod_blood.cpp
d1e425163e6d09b5459670053e6f628133c15900
[]
no_license
Creeper4414/SourceEngine2007
8bec052be1eef2d17dff0aeda9fe5ac82c0f1871
ebc9345561f61cabc9b9d15870c70d4c1bea97f2
refs/heads/master
2020-12-30T18:58:32.782253
2016-06-25T21:22:41
2016-06-25T21:22:41
61,935,128
4
0
null
2016-06-25T08:57:07
2016-06-25T08:57:07
null
WINDOWS-1252
C++
false
false
14,374
cpp
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: A blood spray effect to expose successful hits. // //=============================================================================// #include "cbase.h" #include "ClientEffectPrecacheSystem.h" #include "FX_Sparks.h" #include "iefx.h" #include "c_te_effect_dispatch.h" #include "particles_ez.h" #include "decals.h" #include "engine/IEngineSound.h" #include "fx_quad.h" #include "engine/IVDebugOverlay.h" #include "shareddefs.h" #include "fx_blood.h" #include "view.h" #include "c_dod_player.h" #include "fx.h" CLIENTEFFECT_REGISTER_BEGIN( PrecacheEffectDODBloodSpray ) CLIENTEFFECT_MATERIAL( "effects/blood_gore" ) CLIENTEFFECT_MATERIAL( "effects/blood_drop" ) CLIENTEFFECT_MATERIAL( "effects/blood_puff" ) CLIENTEFFECT_REGISTER_END() class CHitEffectRamp { public: float m_flDamageAmount; float m_flMinAlpha; float m_flMaxAlpha; float m_flMinSize; float m_flMaxSize; float m_flMinVelocity; float m_flMaxVelocity; }; void InterpolateRamp( const CHitEffectRamp &a, const CHitEffectRamp &b, CHitEffectRamp &out, int iDamage ) { float t = RemapVal( iDamage, a.m_flDamageAmount, b.m_flDamageAmount, 0, 1 ); out.m_flMinAlpha = FLerp( a.m_flMinAlpha, b.m_flMinAlpha, t ); out.m_flMaxAlpha = FLerp( a.m_flMaxAlpha, b.m_flMaxAlpha, t ); out.m_flMinAlpha = clamp( out.m_flMinAlpha, 0, 255 ); out.m_flMaxAlpha = clamp( out.m_flMaxAlpha, 0, 255 ); out.m_flMinSize = FLerp( a.m_flMinSize, b.m_flMinSize, t ); out.m_flMaxSize = FLerp( a.m_flMaxSize, b.m_flMaxSize, t ); out.m_flMinVelocity = FLerp( a.m_flMinVelocity, b.m_flMinVelocity, t ); out.m_flMaxVelocity = FLerp( a.m_flMaxVelocity, b.m_flMaxVelocity, t ); } void FX_HitEffectSmoke( CSmartPtr<CBloodSprayEmitter> pEmitter, int iDamage, const Vector &vEntryPoint, const Vector &vDirection, float flScale) { SimpleParticle newParticle; PMaterialHandle hMaterial = ParticleMgr()->GetPMaterial( "effects/blood_gore" ); // These parameters create a ramp based on how much damage the shot did. CHitEffectRamp ramps[2] = { { 0, 30, // min/max alpha 70, 0.5, // min/max size 1, 0, // min/max velocity (not used here) 0 }, { 50, 30, // min/max alpha 70, 1, // min/max size 2, 0, // min/max velocity (not used here) 0 } }; CHitEffectRamp interpolatedRamp; InterpolateRamp( ramps[0], ramps[1], interpolatedRamp, iDamage ); for ( int i=0; i < 2; i++ ) { SimpleParticle &newParticle = *pEmitter->AddSimpleParticle( hMaterial, vEntryPoint, 0, 0 ); newParticle.m_flLifetime = 0.0f; newParticle.m_flDieTime = 3.0f; newParticle.m_uchStartSize = random->RandomInt( interpolatedRamp.m_flMinSize, interpolatedRamp.m_flMaxSize ) * flScale; newParticle.m_uchEndSize = newParticle.m_uchStartSize * 4; newParticle.m_vecVelocity = Vector( 0, 0, 5 ) + RandomVector( -2, 2 ); newParticle.m_uchStartAlpha = random->RandomInt( interpolatedRamp.m_flMinSize, interpolatedRamp.m_flMaxSize ); newParticle.m_uchEndAlpha = 0; newParticle.m_flRoll = random->RandomFloat( 0, 360 ); newParticle.m_flRollDelta = random->RandomFloat( -1, 1 ); newParticle.m_iFlags = SIMPLE_PARTICLE_FLAG_NO_VEL_DECAY; float colorRamp = random->RandomFloat( 0.5f, 1.25f ); newParticle.m_uchColor[0] = min( 1.0f, colorRamp ) * 255.0f; newParticle.m_uchColor[1] = min( 1.0f, colorRamp ) * 255.0f; newParticle.m_uchColor[2] = min( 1.0f, colorRamp ) * 255.0f; } } void FX_HitEffectBloodSpray( CSmartPtr<CBloodSprayEmitter> pEmitter, int iDamage, const Vector &vEntryPoint, const Vector &vSprayNormal, const char *pMaterialName, float flLODDistance, float flDistanceScale, float flScale, float flSpeed ) { PMaterialHandle hMaterial = ParticleMgr()->GetPMaterial( pMaterialName ); SimpleParticle *pParticle; float color[3] = { 1.0, 0, 0 }; Vector up( 0, 0, 1 ); Vector right = up.Cross( vSprayNormal ); VectorNormalize( right ); // These parameters create a ramp based on how much damage the shot did. CHitEffectRamp ramps[2] = { { 0, 80, // min/max alpha 128, flScale/2,// min/max size flScale, 10, // min/max velocity 20 }, { 50, 80, // min/max alpha 128, flScale/2,// min/max size flScale, 30, // min/max velocity 60 } }; CHitEffectRamp interpolatedRamp; InterpolateRamp( ramps[0], ramps[1], interpolatedRamp, iDamage ); for ( int i = 0; i < 6; i++ ) { // Originate from within a circle '2 * scale' inches in diameter. Vector offset = vEntryPoint + ( flScale * vSprayNormal * 0.5 ); offset += right * random->RandomFloat( -1, 1 ) * flScale; offset += up * random->RandomFloat( -1, 1 ) * flScale; pParticle = pEmitter->AddSimpleParticle( hMaterial, offset, 0, 0 ); if ( pParticle != NULL ) { pParticle->m_flLifetime = 0.0f; pParticle->m_flDieTime = random->RandomFloat( 0.7f, 1.3f); // All the particles are between red and white. The whiter the particle is, the slower it goes. float whiteness = random->RandomFloat( 0.1, 0.7 ); float speedFactor = 1 - whiteness; float spread = 0.5f; pParticle->m_vecVelocity.Random( -spread, spread ); pParticle->m_vecVelocity += vSprayNormal * random->RandomInt( interpolatedRamp.m_flMinVelocity, interpolatedRamp.m_flMaxVelocity ) * flSpeed * speedFactor; float colorRamp = random->RandomFloat( 0.5f, 0.75f ) + flLODDistance; pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f; pParticle->m_uchColor[1] = min( 1.0f, whiteness * colorRamp ) * 255.0f; pParticle->m_uchColor[2] = min( 1.0f, whiteness * colorRamp ) * 255.0f; pParticle->m_uchStartSize = random->RandomFloat( interpolatedRamp.m_flMinSize, interpolatedRamp.m_flMaxSize ) * flDistanceScale; pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4 * flDistanceScale; pParticle->m_uchStartAlpha = random->RandomInt( interpolatedRamp.m_flMinAlpha, interpolatedRamp.m_flMaxAlpha ); pParticle->m_uchEndAlpha = 0; pParticle->m_flRoll = random->RandomInt( 0, 360 ); pParticle->m_flRollDelta = random->RandomFloat( -4.0f, 4.0f ); } } } void FX_HitEffectBloodSplatter( CSmartPtr<CBloodSprayEmitter> pTrailEmitter, int iDamage, const Vector &vExitPoint, const Vector &vSplatterNormal, float flLODDistance ) { float flScale = 4; pTrailEmitter->SetSortOrigin( vExitPoint ); PMaterialHandle hMaterial = ParticleMgr()->GetPMaterial( "effects/blood_drop" ); Vector up( 0, 0, 1 ); Vector right = up.Cross( vSplatterNormal ); VectorNormalize( right ); // These parameters create a ramp based on how much damage the shot did. CHitEffectRamp ramps[2] = { { 0, 0, // min/max alpha 75, 1.5f, // min/max size 2.0f, 25.0f * flScale, // min/max velocity 35.0f * flScale }, { 50, 0, // min/max alpha 140, 1.5f,// min/max size 2.0f, 65.0f * flScale, // min/max velocity 75.0f * flScale } }; CHitEffectRamp interpolatedRamp; InterpolateRamp( ramps[0], ramps[1], interpolatedRamp, iDamage ); for ( int i = 0; i < 20; i++ ) { // Originate from within a circle 'scale' inches in diameter. Vector offset = vExitPoint; offset += right * random->RandomFloat( -0.15f, 0.15f ) * flScale; offset += up * random->RandomFloat( -0.15f, 0.15f ) * flScale; SimpleParticle *tParticle = (SimpleParticle*)pTrailEmitter->AddSimpleParticle( hMaterial, vExitPoint, random->RandomFloat( 0.225f, 0.35f ), random->RandomFloat( interpolatedRamp.m_flMinSize, interpolatedRamp.m_flMaxSize ) ); if ( tParticle == NULL ) break; Vector offDir = vSplatterNormal + RandomVector( -0.05f, 0.05f ); tParticle->m_vecVelocity = offDir * random->RandomFloat( interpolatedRamp.m_flMinVelocity, interpolatedRamp.m_flMaxVelocity ); tParticle->m_iFlags = SIMPLE_PARTICLE_FLAG_NO_VEL_DECAY; tParticle->m_uchColor[0] = 150; tParticle->m_uchColor[1] = 0; tParticle->m_uchColor[2] = 0; tParticle->m_uchStartAlpha = interpolatedRamp.m_flMaxAlpha / 2; tParticle->m_uchEndAlpha = 0; } } #include "fx_dod_blood.h" //----------------------------------------------------------------------------- // Purpose: // Input : origin - // normal - // scale - //----------------------------------------------------------------------------- void FX_DOD_BloodSpray( const Vector &origin, const Vector &normal, float flDamage ) { if ( UTIL_IsLowViolence() ) return; static ConVar *violence_hblood = cvar->FindVar( "violence_hblood" ); if ( violence_hblood && !violence_hblood->GetBool() ) return; Vector offset; float half_r = 32; float half_g = 0; float half_b = 2; int i; float scale = 0.5 + clamp( flDamage/50.f, 0.0, 1.0 ) ; //Find area ambient light color and use it to tint smoke Vector worldLight = WorldGetLightForPoint( origin, true ); Vector color; color.x = (float)( worldLight.x * half_r + half_r ) / 255.0f; color.y = (float)( worldLight.y * half_g + half_g ) / 255.0f; color.z = (float)( worldLight.z * half_b + half_b ) / 255.0f; float colorRamp; Vector offDir; CSmartPtr<CBloodSprayEmitter> pSimple = CBloodSprayEmitter::Create( "bloodgore" ); if ( !pSimple ) return; pSimple->SetSortOrigin( origin ); pSimple->SetGravity( 0 ); // Blood impact PMaterialHandle hMaterial = ParticleMgr()->GetPMaterial( "effects/blood_core" ); SimpleParticle *pParticle; Vector dir = normal * RandomVector( -0.5f, 0.5f ); offset = origin + ( 2.0f * normal ); pParticle = (SimpleParticle *) pSimple->AddParticle( sizeof( SimpleParticle ), hMaterial, offset ); if ( pParticle != NULL ) { pParticle->m_flLifetime = 0.0f; pParticle->m_flDieTime = 0.75f; pParticle->m_vecVelocity = dir * random->RandomFloat( 16.0f, 32.0f ); pParticle->m_vecVelocity[2] -= random->RandomFloat( 8.0f, 16.0f ); colorRamp = random->RandomFloat( 0.75f, 2.0f ); pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f; pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f; pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f; pParticle->m_uchStartSize = 8; pParticle->m_uchEndSize = 32; pParticle->m_uchStartAlpha = 255; pParticle->m_uchEndAlpha = 0; pParticle->m_flRoll = random->RandomInt( 0, 360 ); pParticle->m_flRollDelta = 0; } hMaterial = ParticleMgr()->GetPMaterial( "effects/blood_gore" ); for ( i = 0; i < 4; i++ ) { offset = origin + ( 2.0f * normal ); pParticle = (SimpleParticle *) pSimple->AddParticle( sizeof( SimpleParticle ), hMaterial, offset ); if ( pParticle != NULL ) { pParticle->m_flLifetime = 0.0f; pParticle->m_flDieTime = random->RandomFloat( 0.75f, 1.0f); pParticle->m_vecVelocity = dir * random->RandomFloat( 16.0f, 32.0f )*(i+1); pParticle->m_vecVelocity[2] -= random->RandomFloat( 16.0f, 32.0f )*(i+1); colorRamp = random->RandomFloat( 0.75f, 2.0f ); pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f; pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f; pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f; pParticle->m_uchStartSize = scale * random->RandomInt( 4, 8 ); pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4; pParticle->m_uchStartAlpha = 255; pParticle->m_uchEndAlpha = 0; pParticle->m_flRoll = random->RandomInt( 0, 360 ); pParticle->m_flRollDelta = 0; } } // // Dump out drops // TrailParticle *tParticle; CSmartPtr<CTrailParticles> pTrailEmitter = CTrailParticles::Create( "blooddrops" ); if ( !pTrailEmitter ) return; pTrailEmitter->SetSortOrigin( origin ); // Partial gravity on blood drops pTrailEmitter->SetGravity( 400.0 ); // Enable simple collisions with nearby surfaces pTrailEmitter->Setup(origin, &normal, 1, 10, 100, 400, 0.2, 0 ); hMaterial = ParticleMgr()->GetPMaterial( "effects/blood_drop" ); // // Shorter droplets // for ( i = 0; i < 32; i++ ) { // Originate from within a circle 'scale' inches in diameter offset = origin; tParticle = (TrailParticle *) pTrailEmitter->AddParticle( sizeof(TrailParticle), hMaterial, offset ); if ( tParticle == NULL ) break; tParticle->m_flLifetime = 0.0f; offDir = RandomVector( -1.0f, 1.0f ); tParticle->m_vecVelocity = offDir * random->RandomFloat( 32.0f, 128.0f ); tParticle->m_flWidth = scale * random->RandomFloat( 1.0f, 3.0f ); tParticle->m_flLength = random->RandomFloat( 0.1f, 0.15f ); tParticle->m_flDieTime = random->RandomFloat( 0.5f, 1.0f ); FloatToColor32( tParticle->m_color, color[0], color[1], color[2], 1.0f ); } // Puff float spread = 0.2f; for ( i = 0; i < 4; i++ ) { pParticle = (SimpleParticle *) pSimple->AddParticle( sizeof( SimpleParticle ), g_Mat_DustPuff[0], origin ); if ( pParticle != NULL ) { pParticle->m_flLifetime = 0.0f; pParticle->m_flDieTime = random->RandomFloat( 0.5f, 1.0f ); pParticle->m_vecVelocity.Random( -spread, spread ); pParticle->m_vecVelocity += ( normal * random->RandomFloat( 1.0f, 6.0f ) ); VectorNormalize( pParticle->m_vecVelocity ); float fForce = random->RandomFloat( 15, 30 ) * i; // scaled pParticle->m_vecVelocity *= fForce; colorRamp = random->RandomFloat( 0.75f, 1.25f ); pParticle->m_uchColor[0] = min( 1.0f, color[0] * colorRamp ) * 255.0f; pParticle->m_uchColor[1] = min( 1.0f, color[1] * colorRamp ) * 255.0f; pParticle->m_uchColor[2] = min( 1.0f, color[2] * colorRamp ) * 255.0f; // scaled pParticle->m_uchStartSize = random->RandomInt( 2, 3 ) * (i+1); // scaled pParticle->m_uchEndSize = pParticle->m_uchStartSize * 4; pParticle->m_uchStartAlpha = random->RandomInt( 100, 200 ); pParticle->m_uchEndAlpha = 0; pParticle->m_flRoll = random->RandomInt( 0, 360 ); pParticle->m_flRollDelta = random->RandomFloat( -8.0f, 8.0f ); } } } //----------------------------------------------------------------------------- // Purpose: Intercepts the blood spray message. //----------------------------------------------------------------------------- void DODBloodSprayCallback( const CEffectData &data ) { FX_DOD_BloodSpray( data.m_vOrigin, data.m_vNormal, data.m_flMagnitude ); } DECLARE_CLIENT_EFFECT( "dodblood", DODBloodSprayCallback );
[ "lestad@bk.ru" ]
lestad@bk.ru
8de2553fe1c9ee365308c105657d61f2d49a6c28
b2b10f8ba5b3a2b023fe3dbfb9fe9900c111a8e7
/preflet/PCardView.h
d67c8aa9594d884e7ee0b5fc35b86978353297ca
[ "BSD-3-Clause" ]
permissive
HaikuArchives/IMKit
0759451f29a15502838e9102c0c4566a436fd9c0
9c80ad110de77481717d855f503d3de6ce65e4d8
refs/heads/master
2021-01-19T03:14:00.562465
2009-11-27T16:17:29
2009-11-27T16:17:29
12,183,169
1
0
null
null
null
null
UTF-8
C++
false
false
353
h
/* * Copyright 2003-2009, IM Kit Team. * Distributed under the terms of the MIT License. */ #ifndef PCARDVIEW_H #define PCARDVIEW_H #include "ViewFactory.h" class PCardView : public AbstractView { public: PCardView(BRect bounds); void Add(BView *view); void Select(BView *view); private: BView* fCurrentView; }; #endif // PCARDVIEW_H
[ "plfiorini@8f1b5804-98cd-0310-9b8b-c217470a4c7c" ]
plfiorini@8f1b5804-98cd-0310-9b8b-c217470a4c7c
fa4aed84ee2b31d0d1777b725705c634b58ae5cd
1351e0b2ba51df2af9fd2c0d54dcfc9044c7d436
/pqueue-doublylinkedlist.cpp
d501abdaa0ab7773c3f405eed2a87781e49cc7c3
[]
no_license
jnaecker/CS106B-Priority-Queue
6d933f169dd3527fe5b01c1368b63c8789f90909
62e45fb6f8aad822ca40a5fefc633808b49e7903
refs/heads/master
2016-09-06T00:21:23.369445
2013-11-13T01:50:52
2013-11-13T01:50:52
14,350,681
2
0
null
null
null
null
UTF-8
C++
false
false
4,264
cpp
/************************************************************* * File: pqueue-doublylinkedlist.cpp * * Implementation file for the DoublyLinkedListPriorityQueue * class. */ #include "pqueue-doublylinkedlist.h" #include "error.h" /* * Constructor * ---------------------------------------------------------- * Constructs a new, empty priority queue backed by a vector. */ DoublyLinkedListPriorityQueue::DoublyLinkedListPriorityQueue() { head = NULL; } /* * Destructor * ---------------------------------------------------------- * Cleans up all memory allocated by this priority queue. * This is the canonical code to walk through a linked list * and delete each cell. */ DoublyLinkedListPriorityQueue::~DoublyLinkedListPriorityQueue() { while (head != NULL) { Cell* next = head->next; delete head; head = next; } } /* * Function: size() * Usage: int size = pqueue.size() * ---------------------------------------------------- * Returns the number of elements in the priority queue. * Counts by walking through list cell-by-cell. */ int DoublyLinkedListPriorityQueue::size() { int result = 0; for (Cell* cell = head; cell != NULL; cell = cell->next) { result++; } return result; } /* * Function: isEmpty() * Usage: if (pqueue.isEmpty()) * --------------------------------------------------- * Returns whether or not the priority queue is empty. */ bool DoublyLinkedListPriorityQueue::isEmpty() { return (head == NULL); } /* * Function: enqueue(string value) * Usage: pqueue.equeue("foo"); * ---------------------------------------------- * Enqueues a new string into the priority queue. * First makes a new cell. * Since backing list is unsorted, just appends * this cell onto head of list. */ void DoublyLinkedListPriorityQueue::enqueue(string value) { Cell* newCell = new Cell; newCell->value = value; newCell->previous = NULL; newCell->next = head; if (head != NULL) { head->previous = newCell; } head = newCell; } /* * Function: peek() * Usage: pqueue.peek(); * --------------------------------------------------- * Returns, but does not remove, the lexicographically * first string in the priority queue. * If queue is empty, reports error. * To find alphabetically first string, loops over all * elements in the vector. */ string DoublyLinkedListPriorityQueue::peek() { if (isEmpty()) { error("Queue is empty."); } string result = head->value; for (Cell* cell = head; cell !=NULL; cell = cell->next) { if (cell->value < result) { result = cell->value; } } return result; } /* * Function: dequeueMin() * Usage: pqueue.dequeueMin(); * --------------------------------------------------- * Returns and removes the lexicographically first string * in the priority queue. * If queue is empty, reports error. * To find alphabetically first string, loops over all * elements in the vector. Then removes this cell. */ string DoublyLinkedListPriorityQueue::dequeueMin() { if (isEmpty()) { error("Queue is empty."); } string result = head->value; Cell* cellToRemove = head; for (Cell* cell = head; cell !=NULL; cell = cell->next) { if (cell->value < result) { result = cell->value; cellToRemove = cell; } } remove(cellToRemove); return result; } /* * Function: remove(Cell* cellToRemove) * Usage: remove(cellToRemove); * --------------------------------------------------- * Removes given cell from list. First deals with special * cases where cell is at head or tail of list. */ void DoublyLinkedListPriorityQueue::remove(Cell* cellToRemove) { if (cellToRemove->previous == NULL) { head = cellToRemove->next; if ( cellToRemove->next != NULL) { cellToRemove->next->previous = NULL; } } else if (cellToRemove->next == NULL) { cellToRemove->previous->next = NULL; } else { cellToRemove->previous->next = cellToRemove->next; cellToRemove->next->previous = cellToRemove->previous; } delete cellToRemove; }
[ "jnaecker@gmail.com" ]
jnaecker@gmail.com
71529112149f326f7b9b3564fa51b78f3127ccc2
955a10e0f1a0ed01a737979179ded2fc4825d59d
/Prime_factorization.cpp
80f3290c7f494dd030642e8ded5021fb2c353644
[]
no_license
sanasarjanjughazyan/ACA
7319f37b0640be450d24e4802c51a1655d0a0be4
e3dc83b0284438fde020968ff7336dae41bce56e
refs/heads/master
2020-03-23T13:17:16.458517
2018-07-19T18:37:20
2018-07-19T18:37:20
141,610,059
0
0
null
null
null
null
UTF-8
C++
false
false
230
cpp
#include <iostream> int main() { int n; std::cin >> n; for (int i = 2; i <= n; ++i) { while (n % i == 0) { std::cout << i; n /= i; if (n != 1) std::cout << "*"; } } std::cout << "\n"; }
[ "noreply@github.com" ]
noreply@github.com
1e9ce7a85898a82ad1e9836a675e6cb9286a8742
46f53e9a564192eed2f40dc927af6448f8608d13
/chrome/browser/chromeos/drive/download_handler.cc
ed337358f22b30f74881d94d4421e5c3c017a4d8
[ "BSD-3-Clause" ]
permissive
sgraham/nope
deb2d106a090d71ae882ac1e32e7c371f42eaca9
f974e0c234388a330aab71a3e5bbf33c4dcfc33c
refs/heads/master
2022-12-21T01:44:15.776329
2015-03-23T17:25:47
2015-03-23T17:25:47
32,344,868
2
2
null
null
null
null
UTF-8
C++
false
false
12,242
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 "chrome/browser/chromeos/drive/download_handler.h" #include "base/bind.h" #include "base/files/file_util.h" #include "base/supports_user_data.h" #include "base/threading/sequenced_worker_pool.h" #include "chrome/browser/chromeos/drive/drive.pb.h" #include "chrome/browser/chromeos/drive/drive_integration_service.h" #include "chrome/browser/chromeos/drive/file_system_interface.h" #include "chrome/browser/chromeos/drive/file_system_util.h" #include "chrome/browser/chromeos/drive/write_on_cache_file.h" #include "chrome/browser/download/download_history.h" #include "chrome/browser/download/download_service.h" #include "chrome/browser/download/download_service_factory.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread; using content::DownloadManager; using content::DownloadItem; namespace drive { namespace { // Key for base::SupportsUserData::Data. const char kDrivePathKey[] = "DrivePath"; // User Data stored in DownloadItem for drive path. class DriveUserData : public base::SupportsUserData::Data { public: explicit DriveUserData(const base::FilePath& path) : file_path_(path), is_complete_(false) {} ~DriveUserData() override {} const base::FilePath& file_path() const { return file_path_; } const base::FilePath& cache_file_path() const { return cache_file_path_; } void set_cache_file_path(const base::FilePath& path) { cache_file_path_ = path; } bool is_complete() const { return is_complete_; } void set_complete() { is_complete_ = true; } private: const base::FilePath file_path_; base::FilePath cache_file_path_; bool is_complete_; }; // Extracts DriveUserData* from |download|. const DriveUserData* GetDriveUserData(const DownloadItem* download) { return static_cast<const DriveUserData*>( download->GetUserData(&kDrivePathKey)); } DriveUserData* GetDriveUserData(DownloadItem* download) { return static_cast<DriveUserData*>(download->GetUserData(&kDrivePathKey)); } // Creates a temporary file |drive_tmp_download_path| in // |drive_tmp_download_dir|. Must be called on a thread that allows file // operations. base::FilePath GetDriveTempDownloadPath( const base::FilePath& drive_tmp_download_dir) { bool created = base::CreateDirectory(drive_tmp_download_dir); DCHECK(created) << "Can not create temp download directory at " << drive_tmp_download_dir.value(); base::FilePath drive_tmp_download_path; created = base::CreateTemporaryFileInDir(drive_tmp_download_dir, &drive_tmp_download_path); DCHECK(created) << "Temporary download file creation failed"; return drive_tmp_download_path; } // Moves downloaded file to Drive. void MoveDownloadedFile(const base::FilePath& downloaded_file, base::FilePath* cache_file_path, FileError error, const base::FilePath& dest_path) { if (error != FILE_ERROR_OK || !base::Move(downloaded_file, dest_path)) return; *cache_file_path = dest_path; } // Used to implement CheckForFileExistence(). void ContinueCheckingForFileExistence( const content::CheckForFileExistenceCallback& callback, FileError error, scoped_ptr<ResourceEntry> entry) { callback.Run(error == FILE_ERROR_OK); } // Returns true if |download| is a Drive download created from data persisted // on the download history DB. bool IsPersistedDriveDownload(const base::FilePath& drive_tmp_download_path, DownloadItem* download) { if (!drive_tmp_download_path.IsParent(download->GetTargetFilePath())) return false; DownloadService* download_service = DownloadServiceFactory::GetForBrowserContext( download->GetBrowserContext()); DownloadHistory* download_history = download_service->GetDownloadHistory(); return download_history && download_history->WasRestoredFromHistory(download); } } // namespace DownloadHandler::DownloadHandler(FileSystemInterface* file_system) : file_system_(file_system), weak_ptr_factory_(this) { } DownloadHandler::~DownloadHandler() { } // static DownloadHandler* DownloadHandler::GetForProfile(Profile* profile) { DriveIntegrationService* service = DriveIntegrationServiceFactory::FindForProfile(profile); if (!service || !service->IsMounted()) return NULL; return service->download_handler(); } void DownloadHandler::Initialize( DownloadManager* download_manager, const base::FilePath& drive_tmp_download_path) { DCHECK(!drive_tmp_download_path.empty()); drive_tmp_download_path_ = drive_tmp_download_path; if (download_manager) { notifier_.reset(new AllDownloadItemNotifier(download_manager, this)); // Remove any persisted Drive DownloadItem. crbug.com/171384 content::DownloadManager::DownloadVector downloads; download_manager->GetAllDownloads(&downloads); for (size_t i = 0; i < downloads.size(); ++i) { if (IsPersistedDriveDownload(drive_tmp_download_path_, downloads[i])) downloads[i]->Remove(); } } } void DownloadHandler::ObserveIncognitoDownloadManager( DownloadManager* download_manager) { notifier_incognito_.reset(new AllDownloadItemNotifier(download_manager, this)); } void DownloadHandler::SubstituteDriveDownloadPath( const base::FilePath& drive_path, content::DownloadItem* download, const SubstituteDriveDownloadPathCallback& callback) { DVLOG(1) << "SubstituteDriveDownloadPath " << drive_path.value(); SetDownloadParams(drive_path, download); if (util::IsUnderDriveMountPoint(drive_path)) { // Prepare the destination directory. const bool is_exclusive = false, is_recursive = true; file_system_->CreateDirectory( util::ExtractDrivePath(drive_path.DirName()), is_exclusive, is_recursive, base::Bind(&DownloadHandler::OnCreateDirectory, weak_ptr_factory_.GetWeakPtr(), callback)); } else { callback.Run(drive_path); } } void DownloadHandler::SetDownloadParams(const base::FilePath& drive_path, DownloadItem* download) { if (!download || (download->GetState() != DownloadItem::IN_PROGRESS)) return; if (util::IsUnderDriveMountPoint(drive_path)) { download->SetUserData(&kDrivePathKey, new DriveUserData(drive_path)); download->SetDisplayName(drive_path.BaseName()); } else if (IsDriveDownload(download)) { // This may have been previously set if the default download folder is // /drive, and the user has now changed the download target to a local // folder. download->SetUserData(&kDrivePathKey, NULL); download->SetDisplayName(base::FilePath()); } } base::FilePath DownloadHandler::GetTargetPath( const DownloadItem* download) { const DriveUserData* data = GetDriveUserData(download); // If data is NULL, we've somehow lost the drive path selected by the file // picker. DCHECK(data); return data ? data->file_path() : base::FilePath(); } base::FilePath DownloadHandler::GetCacheFilePath(const DownloadItem* download) { const DriveUserData* data = GetDriveUserData(download); return data ? data->cache_file_path() : base::FilePath(); } bool DownloadHandler::IsDriveDownload(const DownloadItem* download) { // We use the existence of the DriveUserData object in download as a // signal that this is a download to Drive. return GetDriveUserData(download) != NULL; } void DownloadHandler::CheckForFileExistence( const DownloadItem* download, const content::CheckForFileExistenceCallback& callback) { file_system_->GetResourceEntry( util::ExtractDrivePath(GetTargetPath(download)), base::Bind(&ContinueCheckingForFileExistence, callback)); } void DownloadHandler::OnDownloadCreated(DownloadManager* manager, DownloadItem* download) { // Remove any persisted Drive DownloadItem. crbug.com/171384 if (IsPersistedDriveDownload(drive_tmp_download_path_, download)) { // Remove download later, since doing it here results in a crash. BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(&DownloadHandler::RemoveDownload, weak_ptr_factory_.GetWeakPtr(), static_cast<void*>(manager), download->GetId())); } } void DownloadHandler::RemoveDownload(void* manager_id, int id) { DownloadManager* manager = GetDownloadManager(manager_id); if (!manager) return; DownloadItem* download = manager->GetDownload(id); if (!download) return; download->Remove(); } void DownloadHandler::OnDownloadUpdated( DownloadManager* manager, DownloadItem* download) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Only accept downloads that have the Drive meta data associated with them. DriveUserData* data = GetDriveUserData(download); if (!drive_tmp_download_path_.IsParent(download->GetTargetFilePath()) || !data || data->is_complete()) return; switch (download->GetState()) { case DownloadItem::IN_PROGRESS: break; case DownloadItem::COMPLETE: UploadDownloadItem(manager, download); data->set_complete(); break; case DownloadItem::CANCELLED: download->SetUserData(&kDrivePathKey, NULL); break; case DownloadItem::INTERRUPTED: // Interrupted downloads can be resumed. Keep the Drive user data around // so that it can be used when the download resumes. The download is truly // done when it's complete, is cancelled or is removed. break; default: NOTREACHED(); } } void DownloadHandler::OnCreateDirectory( const SubstituteDriveDownloadPathCallback& callback, FileError error) { DVLOG(1) << "OnCreateDirectory " << FileErrorToString(error); if (error == FILE_ERROR_OK) { base::PostTaskAndReplyWithResult( BrowserThread::GetBlockingPool(), FROM_HERE, base::Bind(&GetDriveTempDownloadPath, drive_tmp_download_path_), callback); } else { LOG(WARNING) << "Failed to create directory, error = " << FileErrorToString(error); callback.Run(base::FilePath()); } } void DownloadHandler::UploadDownloadItem(DownloadManager* manager, DownloadItem* download) { DCHECK_EQ(DownloadItem::COMPLETE, download->GetState()); base::FilePath* cache_file_path = new base::FilePath; WriteOnCacheFileAndReply( file_system_, util::ExtractDrivePath(GetTargetPath(download)), download->GetMimeType(), base::Bind(&MoveDownloadedFile, download->GetTargetFilePath(), cache_file_path), base::Bind(&DownloadHandler::SetCacheFilePath, weak_ptr_factory_.GetWeakPtr(), static_cast<void*>(manager), download->GetId(), base::Owned(cache_file_path))); } void DownloadHandler::SetCacheFilePath(void* manager_id, int id, const base::FilePath* cache_file_path, FileError error) { if (error != FILE_ERROR_OK) return; DownloadManager* manager = GetDownloadManager(manager_id); if (!manager) return; DownloadItem* download = manager->GetDownload(id); if (!download) return; DriveUserData* data = GetDriveUserData(download); if (!data) return; data->set_cache_file_path(*cache_file_path); } DownloadManager* DownloadHandler::GetDownloadManager(void* manager_id) { if (manager_id == notifier_->GetManager()) return notifier_->GetManager(); if (notifier_incognito_ && manager_id == notifier_incognito_->GetManager()) return notifier_incognito_->GetManager(); return NULL; } } // namespace drive
[ "scottmg@chromium.org" ]
scottmg@chromium.org
5abd221dec105f7ccd1deda245df1889258e252c
bf3970ae653d573cc51dc5344291486c3598b662
/src/chaos/ChsRenderStates.cpp
91cb6f6ac5833446388801432b60294f1d6bd8a5
[]
no_license
sniperbat/Chaos
77c779e4aff50389179b17a740a8b0a62e0b0060
a7a85686fb5b278b8224da91ee69954c57cdd75a
refs/heads/master
2016-09-05T09:21:24.142881
2013-09-16T15:59:00
2013-09-16T15:59:00
3,558,914
0
0
null
null
null
null
UTF-8
C++
false
false
2,921
cpp
#include <memory.h> #include "ChsRenderStates.h" #include "platform/ChsOpenGL.h" //-------------------------------------------------------------------------------------------------- namespace Chaos { //------------------------------------------------------------------------------------------------ GLenum glStates[]={ GL_TEXTURE_2D, GL_CULL_FACE, GL_BLEND, GL_DITHER, GL_STENCIL_TEST, GL_DEPTH_TEST, GL_SCISSOR_TEST, GL_POLYGON_OFFSET_FILL, GL_SAMPLE_ALPHA_TO_COVERAGE, GL_SAMPLE_COVERAGE, }; GLenum glBlendFactors[]={ GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA_SATURATE, }; //------------------------------------------------------------------------------------------------ void ChsRenderStates::set( ChsRenderStateId id, const ChsRenderState state ){ do{ if( id >=0 && id < CHS_RS_ENABLECAP ){ if( this->states[ id ].value == state.value ) break; this->states[id ].value = state.value; if( state.value ) glEnable( glStates[ id ] ); else glDisable( glStates[ id ] ); } switch ( id ) { case CHS_RS_BLEND_FUNC: glBlendFunc( glBlendFactors[ state.value2.v1 ], glBlendFactors[ state.value2.v2 ] ); break; default: break; } }while(0); } //------------------------------------------------------------------------------------------------ void ChsRenderStates::queryCurrentStates( void ){ for( int i = CHS_RS_TEXTURE_2D; i < CHS_RS_MAX; i++ ) { if( i <= CHS_RS_ENABLECAP){ this->states[i].value = glIsEnabled( glStates[i] ) ? CHS_RS_ENABLE : CHS_RS_DISABLE; } } } //------------------------------------------------------------------------------------------------ void ChsRenderStates::save( void ){ memcpy( this->statesBackup, this->states, sizeof( this->statesBackup ) ); } //------------------------------------------------------------------------------------------------ void ChsRenderStates::restore( void ){ memcpy( this->states, this->statesBackup, sizeof( this->statesBackup ) ); } //------------------------------------------------------------------------------------------------ void ChsRenderStates::save( ChsRenderStateId id ){ this->statesBackup[id] = this->states[id]; } //------------------------------------------------------------------------------------------------ void ChsRenderStates::restore( ChsRenderStateId id ){ this->states[id] = this->statesBackup[id]; } //------------------------------------------------------------------------------------------------ } //--------------------------------------------------------------------------------------------------
[ "sniperbat@gmail.com" ]
sniperbat@gmail.com
17adff9c12ff53a34ad364ee3c954fa155fdf708
e7d7377b40fc431ef2cf8dfa259a611f6acc2c67
/SampleDump/Cpp/SDK/AIModule_classes.h
5908ee8e0d4bc1eff161afe7ce5e06c0ced6ba15
[]
no_license
liner0211/uSDK_Generator
ac90211e005c5f744e4f718cd5c8118aab3f8a18
9ef122944349d2bad7c0abe5b183534f5b189bd7
refs/heads/main
2023-09-02T16:37:22.932365
2021-10-31T17:38:03
2021-10-31T17:38:03
null
0
0
null
null
null
null
UTF-8
C++
false
false
197,304
h
#pragma once // Name: Mordhau, Version: Patch23 /*!!DEFINE!!*/ /*!!HELPER_DEF!!*/ /*!!HELPER_INC!!*/ #ifdef _MSC_VER #pragma pack(push, 0x01) #endif namespace CG { //--------------------------------------------------------------------------- // Classes //--------------------------------------------------------------------------- // Class AIModule.BTNode // 0x0030 (FullSize[0x0058] - InheritedSize[0x0028]) class UBTNode : public UObject { public: unsigned char UnknownData_5PJP[0x8]; // 0x0028(0x0008) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FString NodeName; // 0x0030(0x0010) (Edit, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) class UBehaviorTree* TreeAsset; // 0x0040(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) class UBTCompositeNode* ParentNode; // 0x0048(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) unsigned char UnknownData_65WU[0x8]; // 0x0050(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTNode"); return ptr; } }; // Class AIModule.BTTaskNode // 0x0018 (FullSize[0x0070] - InheritedSize[0x0058]) class UBTTaskNode : public UBTNode { public: TArray<class UBTService*> Services; // 0x0058(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bIgnoreRestartSelf : 1; // 0x0068(0x0001) BIT_FIELD (Edit, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_OLN4[0x7]; // 0x0069(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTaskNode"); return ptr; } }; // Class AIModule.EnvQueryNode // 0x0008 (FullSize[0x0030] - InheritedSize[0x0028]) class UEnvQueryNode : public UObject { public: int VerNum; // 0x0028(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_FS3I[0x4]; // 0x002C(0x0004) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryNode"); return ptr; } }; // Class AIModule.EnvQueryGenerator // 0x0020 (FullSize[0x0050] - InheritedSize[0x0030]) class UEnvQueryGenerator : public UEnvQueryNode { public: struct FString OptionName; // 0x0030(0x0010) (Edit, ZeroConstructor, DisableEditOnInstance, HasGetValueTypeHash, NativeAccessSpecifierPublic) class UClass* ItemType; // 0x0040(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bAutoSortTests : 1; // 0x0048(0x0001) BIT_FIELD (Edit, DisableEditOnInstance, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_9LQ5[0x7]; // 0x0049(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator"); return ptr; } }; // Class AIModule.EnvQueryTest // 0x01C8 (FullSize[0x01F8] - InheritedSize[0x0030]) class UEnvQueryTest : public UEnvQueryNode { public: int TestOrder; // 0x0030(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TEnumAsByte<AIModule_EEnvTestPurpose> TestPurpose; // 0x0034(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_4F2L[0x3]; // 0x0035(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FString TestComment; // 0x0038(0x0010) (Edit, ZeroConstructor, DisableEditOnInstance, HasGetValueTypeHash, NativeAccessSpecifierPublic) TEnumAsByte<AIModule_EEnvTestFilterOperator> MultipleContextFilterOp; // 0x0048(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic) TEnumAsByte<AIModule_EEnvTestScoreOperator> MultipleContextScoreOp; // 0x0049(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic) TEnumAsByte<AIModule_EEnvTestFilterType> FilterType; // 0x004A(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_G7U7[0x5]; // 0x004B(0x0005) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FAIDataProviderBoolValue BoolValue; // 0x0050(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue FloatValueMin; // 0x0088(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue FloatValueMax; // 0x00C0(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) unsigned char UnknownData_I271[0x1]; // 0x00F8(0x0001) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TEnumAsByte<AIModule_EEnvTestScoreEquation> ScoringEquation; // 0x00F9(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TEnumAsByte<AIModule_EEnvQueryTestClamping> ClampMinType; // 0x00FA(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TEnumAsByte<AIModule_EEnvQueryTestClamping> ClampMaxType; // 0x00FB(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) AIModule_EEQSNormalizationType NormalizationType; // 0x00FC(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_EX18[0x3]; // 0x00FD(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FAIDataProviderFloatValue ScoreClampMin; // 0x0100(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue ScoreClampMax; // 0x0138(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue ScoringFactor; // 0x0170(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue ReferenceValue; // 0x01A8(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) bool bDefineReferenceValue; // 0x01E0(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_MF7I[0xF]; // 0x01E1(0x000F) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) unsigned char bWorkOnFloatValues : 1; // 0x01F0(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) unsigned char UnknownData_CQ2K[0x7]; // 0x01F1(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest"); return ptr; } }; // Class AIModule.AIController // 0x0090 (FullSize[0x0328] - InheritedSize[0x0298]) class AAIController : public AController { public: unsigned char UnknownData_M9CI[0x38]; // 0x0298(0x0038) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) unsigned char bStartAILogicOnPossess : 1; // 0x02D0(0x0001) BIT_FIELD (Edit, BlueprintVisible, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bStopAILogicOnUnposses : 1; // 0x02D0(0x0001) BIT_FIELD (Edit, BlueprintVisible, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bLOSflag : 1; // 0x02D0(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bSkipExtraLOSChecks : 1; // 0x02D0(0x0001) BIT_FIELD (Edit, BlueprintVisible, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bAllowStrafe : 1; // 0x02D0(0x0001) BIT_FIELD (Edit, BlueprintVisible, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bWantsPlayerState : 1; // 0x02D0(0x0001) BIT_FIELD (Edit, BlueprintVisible, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bSetControlRotationFromPawnOrientation : 1; // 0x02D0(0x0001) BIT_FIELD (Edit, BlueprintVisible, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_F1GU[0x7]; // 0x02D1(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UPathFollowingComponent* PathFollowingComponent; // 0x02D8(0x0008) (Edit, ExportObject, ZeroConstructor, DisableEditOnInstance, EditConst, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) class UBrainComponent* BrainComponent; // 0x02E0(0x0008) (BlueprintVisible, ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) class UAIPerceptionComponent* PerceptionComponent; // 0x02E8(0x0008) (Edit, ExportObject, ZeroConstructor, DisableEditOnInstance, EditConst, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) class UPawnActionsComponent* ActionsComp; // 0x02F0(0x0008) (BlueprintVisible, ExportObject, BlueprintReadOnly, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) class UBlackboardComponent* Blackboard; // 0x02F8(0x0008) (BlueprintVisible, ExportObject, BlueprintReadOnly, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UGameplayTasksComponent* CachedGameplayTasksComponent; // 0x0300(0x0008) (ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UClass* DefaultNavigationFilterClass; // 0x0308(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierProtected) struct FScriptMulticastDelegate ReceiveMoveCompleted; // 0x0310(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_VMHE[0x8]; // 0x0320(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIController"); return ptr; } bool UseBlackboard(class UBlackboardData* BlackboardAsset, class UBlackboardComponent** BlackboardComponent); void UnclaimTaskResource(class UClass* ResourceClass); void SetPathFollowingComponent(class UPathFollowingComponent* NewPFComponent); void SetMoveBlockDetection(bool bEnable); bool RunBehaviorTree(class UBehaviorTree* BTAsset); void OnUsingBlackBoard(class UBlackboardComponent* BlackboardComp, class UBlackboardData* BlackboardAsset); void OnGameplayTaskResourcesClaimed(const struct FGameplayResourceSet& NewlyClaimed, const struct FGameplayResourceSet& FreshlyReleased); TEnumAsByte<AIModule_EPathFollowingRequestResult> MoveToLocation(const struct FVector& Dest, float AcceptanceRadius, bool bStopOnOverlap, bool bUsePathfinding, bool bProjectDestinationToNavigation, bool bCanStrafe, class UClass* FilterClass, bool bAllowPartialPath); TEnumAsByte<AIModule_EPathFollowingRequestResult> MoveToActor(class AActor* Goal, float AcceptanceRadius, bool bStopOnOverlap, bool bUsePathfinding, bool bCanStrafe, class UClass* FilterClass, bool bAllowPartialPath); void K2_SetFocus(class AActor* NewFocus); void K2_SetFocalPoint(const struct FVector& FP); void K2_ClearFocus(); bool HasPartialPath(); class UPathFollowingComponent* GetPathFollowingComponent(); TEnumAsByte<AIModule_EPathFollowingStatus> GetMoveStatus(); struct FVector GetImmediateMoveDestination(); class AActor* GetFocusActor(); struct FVector GetFocalPointOnActor(class AActor* Actor); struct FVector GetFocalPoint(); class UAIPerceptionComponent* GetAIPerceptionComponent(); void ClaimTaskResource(class UClass* ResourceClass); }; // Class AIModule.PathFollowingComponent // 0x01A8 (FullSize[0x0258] - InheritedSize[0x00B0]) class UPathFollowingComponent : public UActorComponent { public: unsigned char UnknownData_IUKP[0x38]; // 0x00B0(0x0038) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UNavMovementComponent* MovementComp; // 0x00E8(0x0008) (ExportObject, ZeroConstructor, Transient, InstancedReference, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_BOL1[0x8]; // 0x00F0(0x0008) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class ANavigationData* MyNavData; // 0x00F8(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_1XA6[0x158]; // 0x0100(0x0158) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.PathFollowingComponent"); return ptr; } void OnNavDataRegistered(class ANavigationData* NavData); void OnActorBump(class AActor* SelfActor, class AActor* OtherActor, const struct FVector& NormalImpulse, const struct FHitResult& Hit); struct FVector GetPathDestination(); TEnumAsByte<AIModule_EPathFollowingAction> GetPathActionType(); }; // Class AIModule.CrowdFollowingComponent // 0x0040 (FullSize[0x0298] - InheritedSize[0x0258]) class UCrowdFollowingComponent : public UPathFollowingComponent { public: unsigned char UnknownData_JDBK[0x8]; // 0x0258(0x0008) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UCharacterMovementComponent* CharacterMovement; // 0x0260(0x0008) (ExportObject, ZeroConstructor, Transient, InstancedReference, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) struct FVector CrowdAgentMoveDirection; // 0x0268(0x000C) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_YTNU[0x24]; // 0x0274(0x0024) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.CrowdFollowingComponent"); return ptr; } void SuspendCrowdSteering(bool bSuspend); }; // Class AIModule.EQSTestingPawn // 0x0098 (FullSize[0x0550] - InheritedSize[0x04B8]) class AEQSTestingPawn : public ACharacter { public: unsigned char UnknownData_QTVJ[0x8]; // 0x04B8(0x0008) Fix Super Size class UEnvQuery* QueryTemplate; // 0x04C0(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TArray<struct FEnvNamedValue> QueryParams; // 0x04C8(0x0010) (Edit, ZeroConstructor, EditConst, HasGetValueTypeHash, NativeAccessSpecifierPublic) TArray<struct FAIDynamicParam> QueryConfig; // 0x04D8(0x0010) (Edit, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float TimeLimitPerStep; // 0x04E8(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) int StepToDebugDraw; // 0x04EC(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) AIModule_EEnvQueryHightlightMode HighlightMode; // 0x04F0(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_580H[0x3]; // 0x04F1(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) unsigned char bDrawLabels : 1; // 0x04F4(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bDrawFailedItems : 1; // 0x04F4(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bReRunQueryOnlyOnFinishedMove : 1; // 0x04F4(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bShouldBeVisibleInGame : 1; // 0x04F4(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bTickDuringGame : 1; // 0x04F4(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_AW5E[0x3]; // 0x04F5(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TEnumAsByte<AIModule_EEnvQueryRunMode> QueryingMode; // 0x04F8(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_L7RK[0x7]; // 0x04F9(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FNavAgentProperties NavAgentProperties; // 0x0500(0x0030) (Edit, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_AVAN[0x20]; // 0x0530(0x0020) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EQSTestingPawn"); return ptr; } }; // Class AIModule.AIAsyncTaskBlueprintProxy // 0x0040 (FullSize[0x0068] - InheritedSize[0x0028]) class UAIAsyncTaskBlueprintProxy : public UObject { public: struct FScriptMulticastDelegate onSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFail; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_L9MJ[0x20]; // 0x0048(0x0020) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIAsyncTaskBlueprintProxy"); return ptr; } void OnMoveCompleted(const struct FAIRequestID& RequestId, TEnumAsByte<AIModule_EPathFollowingResult> MovementResult); }; // Class AIModule.AIBlueprintHelperLibrary // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UAIBlueprintHelperLibrary : public UBlueprintFunctionLibrary { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIBlueprintHelperLibrary"); return ptr; } void STATIC_UnlockAIResourcesWithAnimation(class UAnimInstance* AnimInstance, bool bUnlockMovement, bool UnlockAILogic); class APawn* STATIC_SpawnAIFromClass(class UObject* WorldContextObject, class UClass* PawnClass, class UBehaviorTree* BehaviorTree, const struct FVector& Location, const struct FRotator& Rotation, bool bNoCollisionFail, class AActor* Owner); void STATIC_SimpleMoveToLocation(class AController* Controller, const struct FVector& Goal); void STATIC_SimpleMoveToActor(class AController* Controller, class AActor* Goal); void STATIC_SendAIMessage(class APawn* Target, const struct FName& Message, class UObject* MessageSource, bool bSuccess); void STATIC_LockAIResourcesWithAnimation(class UAnimInstance* AnimInstance, bool bLockMovement, bool LockAILogic); bool STATIC_IsValidAIRotation(const struct FRotator& Rotation); bool STATIC_IsValidAILocation(const struct FVector& Location); bool STATIC_IsValidAIDirection(const struct FVector& DirectionVector); class UNavigationPath* STATIC_GetCurrentPath(class AController* Controller); class UBlackboardComponent* STATIC_GetBlackboard(class AActor* Target); class AAIController* STATIC_GetAIController(class AActor* ControlledActor); class UAIAsyncTaskBlueprintProxy* STATIC_CreateMoveToProxyObject(class UObject* WorldContextObject, class APawn* Pawn, const struct FVector& Destination, class AActor* TargetActor, float AcceptanceRadius, bool bStopOnOverlap); }; // Class AIModule.AIDataProvider // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UAIDataProvider : public UObject { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIDataProvider"); return ptr; } }; // Class AIModule.AIDataProvider_QueryParams // 0x0018 (FullSize[0x0040] - InheritedSize[0x0028]) class UAIDataProvider_QueryParams : public UAIDataProvider { public: struct FName ParamName; // 0x0028(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float FloatValue; // 0x0030(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) int IntValue; // 0x0034(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool BoolValue; // 0x0038(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_F1FV[0x7]; // 0x0039(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIDataProvider_QueryParams"); return ptr; } }; // Class AIModule.AIDataProvider_Random // 0x0010 (FullSize[0x0050] - InheritedSize[0x0040]) class UAIDataProvider_Random : public UAIDataProvider_QueryParams { public: float Min; // 0x0040(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float Max; // 0x0044(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bInteger : 1; // 0x0048(0x0001) BIT_FIELD (Edit, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_1OH4[0x7]; // 0x0049(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIDataProvider_Random"); return ptr; } }; // Class AIModule.AIHotSpotManager // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UAIHotSpotManager : public UObject { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIHotSpotManager"); return ptr; } }; // Class AIModule.AIPerceptionComponent // 0x00D0 (FullSize[0x0180] - InheritedSize[0x00B0]) class UAIPerceptionComponent : public UActorComponent { public: TArray<class UAISenseConfig*> SensesConfig; // 0x00B0(0x0010) (Edit, ExportObject, ZeroConstructor, DisableEditOnInstance, ContainsInstancedReference, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UClass* DominantSense; // 0x00C0(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_51J7[0x10]; // 0x00C8(0x0010) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class AAIController* AIOwner; // 0x00D8(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_JMUO[0x80]; // 0x00E0(0x0080) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FScriptMulticastDelegate OnPerceptionUpdated; // 0x0160(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnTargetPerceptionUpdated; // 0x0170(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIPerceptionComponent"); return ptr; } void SetSenseEnabled(class UClass* SenseClass, bool bEnable); void RequestStimuliListenerUpdate(); void OnOwnerEndPlay(class AActor* Actor, TEnumAsByte<Engine_EEndPlayReason> EndPlayReason); void GetPerceivedHostileActors(TArray<class AActor*>* OutActors); void GetPerceivedActors(class UClass* SenseToUse, TArray<class AActor*>* OutActors); void GetKnownPerceivedActors(class UClass* SenseToUse, TArray<class AActor*>* OutActors); void GetCurrentlyPerceivedActors(class UClass* SenseToUse, TArray<class AActor*>* OutActors); bool GetActorsPerception(class AActor* Actor, struct FActorPerceptionBlueprintInfo* Info); void ForgetAll(); }; // Class AIModule.AIPerceptionListenerInterface // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UAIPerceptionListenerInterface : public UInterface { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIPerceptionListenerInterface"); return ptr; } }; // Class AIModule.AIPerceptionStimuliSourceComponent // 0x0018 (FullSize[0x00C8] - InheritedSize[0x00B0]) class UAIPerceptionStimuliSourceComponent : public UActorComponent { public: unsigned char bAutoRegisterAsSource : 1; // 0x00B0(0x0001) BIT_FIELD (Edit, BlueprintVisible, BlueprintReadOnly, Config, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_WA3D[0x7]; // 0x00B1(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<class UClass*> RegisterAsSourceForSenses; // 0x00B8(0x0010) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Protected, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIPerceptionStimuliSourceComponent"); return ptr; } void UnregisterFromSense(class UClass* SenseClass); void UnregisterFromPerceptionSystem(); void RegisterWithPerceptionSystem(); void RegisterForSense(class UClass* SenseClass); }; // Class AIModule.AISubsystem // 0x0010 (FullSize[0x0038] - InheritedSize[0x0028]) class UAISubsystem : public UObject { public: unsigned char UnknownData_SW0U[0x8]; // 0x0028(0x0008) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UAISystem* AISystem; // 0x0030(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISubsystem"); return ptr; } }; // Class AIModule.AIPerceptionSystem // 0x0100 (FullSize[0x0138] - InheritedSize[0x0038]) class UAIPerceptionSystem : public UAISubsystem { public: unsigned char UnknownData_LG8K[0x50]; // 0x0038(0x0050) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<class UAISense*> Senses; // 0x0088(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float PerceptionAgingRate; // 0x0098(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_3ABA[0x9C]; // 0x009C(0x009C) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIPerceptionSystem"); return ptr; } void STATIC_ReportPerceptionEvent(class UObject* WorldContextObject, class UAISenseEvent* PerceptionEvent); void ReportEvent(class UAISenseEvent* PerceptionEvent); bool STATIC_RegisterPerceptionStimuliSource(class UObject* WorldContextObject, class UClass* Sense, class AActor* Target); void OnPerceptionStimuliSourceEndPlay(class AActor* Actor, TEnumAsByte<Engine_EEndPlayReason> EndPlayReason); class UClass* STATIC_GetSenseClassForStimulus(class UObject* WorldContextObject, const struct FAIStimulus& Stimulus); }; // Class AIModule.AIResourceInterface // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UAIResourceInterface : public UInterface { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIResourceInterface"); return ptr; } }; // Class AIModule.AIResource_Movement // 0x0000 (FullSize[0x0038] - InheritedSize[0x0038]) class UAIResource_Movement : public UGameplayTaskResource { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIResource_Movement"); return ptr; } }; // Class AIModule.AIResource_Logic // 0x0000 (FullSize[0x0038] - InheritedSize[0x0038]) class UAIResource_Logic : public UGameplayTaskResource { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AIResource_Logic"); return ptr; } }; // Class AIModule.AISense // 0x0058 (FullSize[0x0080] - InheritedSize[0x0028]) class UAISense : public UObject { public: float DefaultExpirationAge; // 0x0028(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, EditConst, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) AIModule_EAISenseNotifyType NotifyType; // 0x002C(0x0001) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_36BF[0x3]; // 0x002D(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) unsigned char bWantsNewPawnNotification : 1; // 0x0030(0x0001) BIT_FIELD (Edit, BlueprintVisible, BlueprintReadOnly, Config, DisableEditOnInstance, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bAutoRegisterAllPawnsAsSources : 1; // 0x0030(0x0001) BIT_FIELD (Edit, BlueprintVisible, BlueprintReadOnly, Config, DisableEditOnInstance, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_9NBH[0x7]; // 0x0031(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UAIPerceptionSystem* PerceptionSystemInstance; // 0x0038(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) unsigned char UnknownData_SFSC[0x40]; // 0x0040(0x0040) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISense"); return ptr; } }; // Class AIModule.AISense_Blueprint // 0x0028 (FullSize[0x00A8] - InheritedSize[0x0080]) class UAISense_Blueprint : public UAISense { public: class UClass* ListenerDataType; // 0x0080(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<class UAIPerceptionComponent*> ListenerContainer; // 0x0088(0x0010) (BlueprintVisible, ExportObject, BlueprintReadOnly, ZeroConstructor, ContainsInstancedReference, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<class UAISenseEvent*> UnprocessedEvents; // 0x0098(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISense_Blueprint"); return ptr; } float OnUpdate(TArray<class UAISenseEvent*> EventsToProcess); void OnListenerUpdated(class AActor* ActorListener, class UAIPerceptionComponent* PerceptionComponent); void OnListenerUnregistered(class AActor* ActorListener, class UAIPerceptionComponent* PerceptionComponent); void OnListenerRegistered(class AActor* ActorListener, class UAIPerceptionComponent* PerceptionComponent); void K2_OnNewPawn(class APawn* NewPawn); void GetAllListenerComponents(TArray<class UAIPerceptionComponent*>* ListenerComponents); void GetAllListenerActors(TArray<class AActor*>* ListenerActors); }; // Class AIModule.AISense_Damage // 0x0010 (FullSize[0x0090] - InheritedSize[0x0080]) class UAISense_Damage : public UAISense { public: TArray<struct FAIDamageEvent> RegisteredEvents; // 0x0080(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISense_Damage"); return ptr; } void STATIC_ReportDamageEvent(class UObject* WorldContextObject, class AActor* DamagedActor, class AActor* Instigator, float DamageAmount, const struct FVector& EventLocation, const struct FVector& HitLocation); }; // Class AIModule.AISense_Hearing // 0x0068 (FullSize[0x00E8] - InheritedSize[0x0080]) class UAISense_Hearing : public UAISense { public: TArray<struct FAINoiseEvent> NoiseEvents; // 0x0080(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float SpeedOfSoundSq; // 0x0090(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_0XQQ[0x54]; // 0x0094(0x0054) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISense_Hearing"); return ptr; } void STATIC_ReportNoiseEvent(class UObject* WorldContextObject, const struct FVector& NoiseLocation, float Loudness, class AActor* Instigator, float MaxRange, const struct FName& Tag); }; // Class AIModule.AISense_Prediction // 0x0010 (FullSize[0x0090] - InheritedSize[0x0080]) class UAISense_Prediction : public UAISense { public: TArray<struct FAIPredictionEvent> RegisteredEvents; // 0x0080(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISense_Prediction"); return ptr; } void STATIC_RequestPawnPredictionEvent(class APawn* Requestor, class AActor* PredictedActor, float PredictionTime); void STATIC_RequestControllerPredictionEvent(class AAIController* Requestor, class AActor* PredictedActor, float PredictionTime); }; // Class AIModule.AISense_Sight // 0x00F0 (FullSize[0x0170] - InheritedSize[0x0080]) class UAISense_Sight : public UAISense { public: unsigned char UnknownData_KDPD[0xC8]; // 0x0080(0x00C8) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) int MaxTracesPerTick; // 0x0148(0x0004) (Edit, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) int MinQueriesPerTimeSliceCheck; // 0x014C(0x0004) (Edit, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) double MaxTimeSlicePerTick; // 0x0150(0x0008) (Edit, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float HighImportanceQueryDistanceThreshold; // 0x0158(0x0004) (Edit, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_1U8Y[0x4]; // 0x015C(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) float MaxQueryImportance; // 0x0160(0x0004) (Edit, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float SightLimitQueryImportance; // 0x0164(0x0004) (Edit, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_T9E1[0x8]; // 0x0168(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISense_Sight"); return ptr; } }; // Class AIModule.AISense_Team // 0x0010 (FullSize[0x0090] - InheritedSize[0x0080]) class UAISense_Team : public UAISense { public: TArray<struct FAITeamStimulusEvent> RegisteredEvents; // 0x0080(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISense_Team"); return ptr; } }; // Class AIModule.AISense_Touch // 0x0010 (FullSize[0x0090] - InheritedSize[0x0080]) class UAISense_Touch : public UAISense { public: TArray<struct FAITouchEvent> RegisteredEvents; // 0x0080(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISense_Touch"); return ptr; } }; // Class AIModule.AISenseBlueprintListener // 0x0000 (FullSize[0x0108] - InheritedSize[0x0108]) class UAISenseBlueprintListener : public UUserDefinedStruct { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseBlueprintListener"); return ptr; } }; // Class AIModule.AISenseConfig // 0x0020 (FullSize[0x0048] - InheritedSize[0x0028]) class UAISenseConfig : public UObject { public: struct FColor DebugColor; // 0x0028(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float MaxAge; // 0x002C(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bStartsEnabled : 1; // 0x0030(0x0001) BIT_FIELD (Edit, BlueprintVisible, BlueprintReadOnly, DisableEditOnInstance, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_4VQH[0x17]; // 0x0031(0x0017) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseConfig"); return ptr; } }; // Class AIModule.AISenseConfig_Blueprint // 0x0008 (FullSize[0x0050] - InheritedSize[0x0048]) class UAISenseConfig_Blueprint : public UAISenseConfig { public: class UClass* Implementation; // 0x0048(0x0008) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, NoClear, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseConfig_Blueprint"); return ptr; } }; // Class AIModule.AISenseConfig_Damage // 0x0008 (FullSize[0x0050] - InheritedSize[0x0048]) class UAISenseConfig_Damage : public UAISenseConfig { public: class UClass* Implementation; // 0x0048(0x0008) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, NoClear, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseConfig_Damage"); return ptr; } }; // Class AIModule.AISenseConfig_Hearing // 0x0018 (FullSize[0x0060] - InheritedSize[0x0048]) class UAISenseConfig_Hearing : public UAISenseConfig { public: class UClass* Implementation; // 0x0048(0x0008) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, NoClear, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) float HearingRange; // 0x0050(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float LoSHearingRange; // 0x0054(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bUseLoSHearing : 1; // 0x0058(0x0001) BIT_FIELD (Edit, DisableEditOnInstance, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_1OYL[0x3]; // 0x0059(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FAISenseAffiliationFilter DetectionByAffiliation; // 0x005C(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseConfig_Hearing"); return ptr; } }; // Class AIModule.AISenseConfig_Prediction // 0x0000 (FullSize[0x0048] - InheritedSize[0x0048]) class UAISenseConfig_Prediction : public UAISenseConfig { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseConfig_Prediction"); return ptr; } }; // Class AIModule.AISenseConfig_Sight // 0x0020 (FullSize[0x0068] - InheritedSize[0x0048]) class UAISenseConfig_Sight : public UAISenseConfig { public: class UClass* Implementation; // 0x0048(0x0008) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, NoClear, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) float SightRadius; // 0x0050(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float LoseSightRadius; // 0x0054(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float PeripheralVisionAngleDegrees; // 0x0058(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) struct FAISenseAffiliationFilter DetectionByAffiliation; // 0x005C(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic) float AutoSuccessRangeFromLastSeenLocation; // 0x0060(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, Config, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_PAMT[0x4]; // 0x0064(0x0004) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseConfig_Sight"); return ptr; } }; // Class AIModule.AISenseConfig_Team // 0x0000 (FullSize[0x0048] - InheritedSize[0x0048]) class UAISenseConfig_Team : public UAISenseConfig { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseConfig_Team"); return ptr; } }; // Class AIModule.AISenseConfig_Touch // 0x0000 (FullSize[0x0048] - InheritedSize[0x0048]) class UAISenseConfig_Touch : public UAISenseConfig { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseConfig_Touch"); return ptr; } }; // Class AIModule.AISenseEvent // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UAISenseEvent : public UObject { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseEvent"); return ptr; } }; // Class AIModule.AISenseEvent_Damage // 0x0030 (FullSize[0x0058] - InheritedSize[0x0028]) class UAISenseEvent_Damage : public UAISenseEvent { public: struct FAIDamageEvent Event; // 0x0028(0x0030) (Edit, BlueprintVisible, NoDestructor, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseEvent_Damage"); return ptr; } }; // Class AIModule.AISenseEvent_Hearing // 0x0030 (FullSize[0x0058] - InheritedSize[0x0028]) class UAISenseEvent_Hearing : public UAISenseEvent { public: struct FAINoiseEvent Event; // 0x0028(0x0030) (Edit, BlueprintVisible, NoDestructor, Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISenseEvent_Hearing"); return ptr; } }; // Class AIModule.AISightTargetInterface // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UAISightTargetInterface : public UInterface { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISightTargetInterface"); return ptr; } }; // Class AIModule.AISystem // 0x00D8 (FullSize[0x0130] - InheritedSize[0x0058]) class UAISystem : public UAISystemBase { public: struct FSoftClassPath PerceptionSystemClassName; // 0x0058(0x0018) (Edit, ZeroConstructor, Config, GlobalConfig, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) struct FSoftClassPath HotSpotManagerClassName; // 0x0070(0x0018) (Edit, ZeroConstructor, Config, GlobalConfig, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float AcceptanceRadius; // 0x0088(0x0004) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float PathfollowingRegularPathPointAcceptanceRadius; // 0x008C(0x0004) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float PathfollowingNavLinkAcceptanceRadius; // 0x0090(0x0004) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bFinishMoveOnGoalOverlap; // 0x0094(0x0001) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bAcceptPartialPaths; // 0x0095(0x0001) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bAllowStrafing; // 0x0096(0x0001) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bEnableBTAITasks; // 0x0097(0x0001) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bAllowControllersAsEQSQuerier; // 0x0098(0x0001) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bEnableDebuggerPlugin; // 0x0099(0x0001) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bForgetStaleActors; // 0x009A(0x0001) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TEnumAsByte<Engine_ECollisionChannel> DefaultSightCollisionChannel; // 0x009B(0x0001) (Edit, ZeroConstructor, Config, DisableEditOnInstance, GlobalConfig, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_TC8C[0x4]; // 0x009C(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UBehaviorTreeManager* BehaviorTreeManager; // 0x00A0(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UEnvQueryManager* EnvironmentQueryManager; // 0x00A8(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UAIPerceptionSystem* PerceptionSystem; // 0x00B0(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<class UAIAsyncTaskBlueprintProxy*> AllProxyObjects; // 0x00B8(0x0010) (ZeroConstructor, Transient, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UAIHotSpotManager* HotSpotManager; // 0x00C8(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UNavLocalGridManager* NavLocalGrids; // 0x00D0(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_W3WN[0x58]; // 0x00D8(0x0058) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AISystem"); return ptr; } void AILoggingVerbose(); void AIIgnorePlayers(); }; // Class AIModule.AITask // 0x0008 (FullSize[0x0070] - InheritedSize[0x0068]) class UAITask : public UGameplayTask { public: class AAIController* OwnerController; // 0x0068(0x0008) (BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AITask"); return ptr; } }; // Class AIModule.AITask_LockLogic // 0x0000 (FullSize[0x0070] - InheritedSize[0x0070]) class UAITask_LockLogic : public UAITask { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AITask_LockLogic"); return ptr; } }; // Class AIModule.AITask_MoveTo // 0x00A0 (FullSize[0x0110] - InheritedSize[0x0070]) class UAITask_MoveTo : public UAITask { public: struct FScriptMulticastDelegate OnRequestFailed; // 0x0070(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, Protected, NativeAccessSpecifierProtected) struct FScriptMulticastDelegate OnMoveFinished; // 0x0080(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, Protected, NativeAccessSpecifierProtected) struct FAIMoveRequest MoveRequest; // 0x0090(0x0040) (Protected, NativeAccessSpecifierProtected) unsigned char UnknownData_OZ8D[0x40]; // 0x00D0(0x0040) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AITask_MoveTo"); return ptr; } class UAITask_MoveTo* STATIC_AIMoveTo(class AAIController* Controller, const struct FVector& GoalLocation, class AActor* GoalActor, float AcceptanceRadius, TEnumAsByte<AIModule_EAIOptionFlag> StopOnOverlap, TEnumAsByte<AIModule_EAIOptionFlag> AcceptPartialPath, bool bUsePathfinding, bool bLockAILogic, bool bUseContinuosGoalTracking, TEnumAsByte<AIModule_EAIOptionFlag> ProjectGoalOnNavigation); }; // Class AIModule.AITask_RunEQS // 0x0078 (FullSize[0x00E8] - InheritedSize[0x0070]) class UAITask_RunEQS : public UAITask { public: unsigned char UnknownData_BXD2[0x78]; // 0x0070(0x0078) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.AITask_RunEQS"); return ptr; } class UAITask_RunEQS* STATIC_RunEQS(class AAIController* Controller, class UEnvQuery* QueryTemplate); }; // Class AIModule.BehaviorTree // 0x0040 (FullSize[0x0068] - InheritedSize[0x0028]) class UBehaviorTree : public UObject { public: unsigned char UnknownData_5MVM[0x8]; // 0x0028(0x0008) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UBTCompositeNode* RootNode; // 0x0030(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) class UBlackboardData* BlackboardAsset; // 0x0038(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TArray<class UBTDecorator*> RootDecorators; // 0x0040(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TArray<struct FBTDecoratorLogic> RootDecoratorOps; // 0x0050(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_BCTL[0x8]; // 0x0060(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BehaviorTree"); return ptr; } }; // Class AIModule.BrainComponent // 0x0060 (FullSize[0x0110] - InheritedSize[0x00B0]) class UBrainComponent : public UActorComponent { public: unsigned char UnknownData_8IUW[0x8]; // 0x00B0(0x0008) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UBlackboardComponent* BlackboardComp; // 0x00B8(0x0008) (ExportObject, ZeroConstructor, Transient, InstancedReference, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class AAIController* AIOwner; // 0x00C0(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_J7VT[0x48]; // 0x00C8(0x0048) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BrainComponent"); return ptr; } void StopLogic(const struct FString& Reason); void StartLogic(); void RestartLogic(); bool IsRunning(); bool IsPaused(); }; // Class AIModule.BehaviorTreeComponent // 0x0160 (FullSize[0x0270] - InheritedSize[0x0110]) class UBehaviorTreeComponent : public UBrainComponent { public: unsigned char UnknownData_PEFD[0x20]; // 0x0110(0x0020) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<class UBTNode*> NodeInstances; // 0x0130(0x0010) (ZeroConstructor, Transient, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_8A9A[0x128]; // 0x0140(0x0128) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UBehaviorTree* DefaultBehaviorTreeAsset; // 0x0268(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BehaviorTreeComponent"); return ptr; } void SetDynamicSubtree(const struct FGameplayTag& InjectTag, class UBehaviorTree* BehaviorAsset); float GetTagCooldownEndTime(const struct FGameplayTag& CooldownTag); void AddCooldownTagDuration(const struct FGameplayTag& CooldownTag, float CooldownDuration, bool bAddToExistingDuration); }; // Class AIModule.BehaviorTreeManager // 0x0028 (FullSize[0x0050] - InheritedSize[0x0028]) class UBehaviorTreeManager : public UObject { public: int MaxDebuggerSteps; // 0x0028(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_4P5Z[0x4]; // 0x002C(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<struct FBehaviorTreeTemplateInfo> LoadedTemplates; // 0x0030(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<class UBehaviorTreeComponent*> ActiveComponents; // 0x0040(0x0010) (ExportObject, ZeroConstructor, ContainsInstancedReference, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BehaviorTreeManager"); return ptr; } }; // Class AIModule.BehaviorTreeTypes // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UBehaviorTreeTypes : public UObject { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BehaviorTreeTypes"); return ptr; } }; // Class AIModule.BlackboardAssetProvider // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UBlackboardAssetProvider : public UInterface { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardAssetProvider"); return ptr; } class UBlackboardData* GetBlackboardAsset(); }; // Class AIModule.BlackboardComponent // 0x0100 (FullSize[0x01B0] - InheritedSize[0x00B0]) class UBlackboardComponent : public UActorComponent { public: class UBrainComponent* BrainComp; // 0x00B0(0x0008) (ExportObject, ZeroConstructor, Transient, InstancedReference, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UBlackboardData* DefaultBlackboardAsset; // 0x00B8(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UBlackboardData* BlackboardAsset; // 0x00C0(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_OL8H[0x20]; // 0x00C8(0x0020) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<class UBlackboardKeyType*> KeyInstances; // 0x00E8(0x0010) (ZeroConstructor, Transient, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_DBLI[0xB8]; // 0x00F8(0x00B8) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardComponent"); return ptr; } void SetValueAsVector(const struct FName& KeyName, const struct FVector& VectorValue); void SetValueAsString(const struct FName& KeyName, const struct FString& StringValue); void SetValueAsRotator(const struct FName& KeyName, const struct FRotator& VectorValue); void SetValueAsObject(const struct FName& KeyName, class UObject* ObjectValue); void SetValueAsName(const struct FName& KeyName, const struct FName& NameValue); void SetValueAsInt(const struct FName& KeyName, int IntValue); void SetValueAsFloat(const struct FName& KeyName, float FloatValue); void SetValueAsEnum(const struct FName& KeyName, unsigned char EnumValue); void SetValueAsClass(const struct FName& KeyName, class UClass* ClassValue); void SetValueAsBool(const struct FName& KeyName, bool BoolValue); bool IsVectorValueSet(const struct FName& KeyName); struct FVector GetValueAsVector(const struct FName& KeyName); struct FString GetValueAsString(const struct FName& KeyName); struct FRotator GetValueAsRotator(const struct FName& KeyName); class UObject* GetValueAsObject(const struct FName& KeyName); struct FName GetValueAsName(const struct FName& KeyName); int GetValueAsInt(const struct FName& KeyName); float GetValueAsFloat(const struct FName& KeyName); unsigned char GetValueAsEnum(const struct FName& KeyName); class UClass* GetValueAsClass(const struct FName& KeyName); bool GetValueAsBool(const struct FName& KeyName); bool GetRotationFromEntry(const struct FName& KeyName, struct FRotator* ResultRotation); bool GetLocationFromEntry(const struct FName& KeyName, struct FVector* ResultLocation); void ClearValue(const struct FName& KeyName); }; // Class AIModule.BlackboardData // 0x0020 (FullSize[0x0050] - InheritedSize[0x0030]) class UBlackboardData : public UDataAsset { public: class UBlackboardData* Parent; // 0x0030(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TArray<struct FBlackboardEntry> Keys; // 0x0038(0x0010) (Edit, ZeroConstructor, ContainsInstancedReference, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bHasSynchronizedKeys : 1; // 0x0048(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) unsigned char UnknownData_T5CY[0x7]; // 0x0049(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardData"); return ptr; } }; // Class AIModule.BlackboardKeyType // 0x0008 (FullSize[0x0030] - InheritedSize[0x0028]) class UBlackboardKeyType : public UObject { public: unsigned char UnknownData_4WQK[0x8]; // 0x0028(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType"); return ptr; } }; // Class AIModule.BlackboardKeyType_Bool // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UBlackboardKeyType_Bool : public UBlackboardKeyType { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_Bool"); return ptr; } }; // Class AIModule.BlackboardKeyType_Class // 0x0008 (FullSize[0x0038] - InheritedSize[0x0030]) class UBlackboardKeyType_Class : public UBlackboardKeyType { public: class UClass* BaseClass; // 0x0030(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_Class"); return ptr; } }; // Class AIModule.BlackboardKeyType_Enum // 0x0020 (FullSize[0x0050] - InheritedSize[0x0030]) class UBlackboardKeyType_Enum : public UBlackboardKeyType { public: class UEnum* EnumType; // 0x0030(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) struct FString EnumName; // 0x0038(0x0010) (Edit, ZeroConstructor, DisableEditOnInstance, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bIsEnumNameValid : 1; // 0x0048(0x0001) BIT_FIELD (Edit, DisableEditOnInstance, EditConst, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_QOKX[0x7]; // 0x0049(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_Enum"); return ptr; } }; // Class AIModule.BlackboardKeyType_Float // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UBlackboardKeyType_Float : public UBlackboardKeyType { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_Float"); return ptr; } }; // Class AIModule.BlackboardKeyType_Int // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UBlackboardKeyType_Int : public UBlackboardKeyType { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_Int"); return ptr; } }; // Class AIModule.BlackboardKeyType_Name // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UBlackboardKeyType_Name : public UBlackboardKeyType { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_Name"); return ptr; } }; // Class AIModule.BlackboardKeyType_NativeEnum // 0x0018 (FullSize[0x0048] - InheritedSize[0x0030]) class UBlackboardKeyType_NativeEnum : public UBlackboardKeyType { public: struct FString EnumName; // 0x0030(0x0010) (Edit, ZeroConstructor, DisableEditOnInstance, HasGetValueTypeHash, NativeAccessSpecifierPublic) class UEnum* EnumType; // 0x0040(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_NativeEnum"); return ptr; } }; // Class AIModule.BlackboardKeyType_Object // 0x0008 (FullSize[0x0038] - InheritedSize[0x0030]) class UBlackboardKeyType_Object : public UBlackboardKeyType { public: class UClass* BaseClass; // 0x0030(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_Object"); return ptr; } }; // Class AIModule.BlackboardKeyType_Rotator // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UBlackboardKeyType_Rotator : public UBlackboardKeyType { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_Rotator"); return ptr; } }; // Class AIModule.BlackboardKeyType_String // 0x0010 (FullSize[0x0040] - InheritedSize[0x0030]) class UBlackboardKeyType_String : public UBlackboardKeyType { public: struct FString StringValue; // 0x0030(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_String"); return ptr; } }; // Class AIModule.BlackboardKeyType_Vector // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UBlackboardKeyType_Vector : public UBlackboardKeyType { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BlackboardKeyType_Vector"); return ptr; } }; // Class AIModule.BTAuxiliaryNode // 0x0008 (FullSize[0x0060] - InheritedSize[0x0058]) class UBTAuxiliaryNode : public UBTNode { public: unsigned char UnknownData_95UU[0x8]; // 0x0058(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTAuxiliaryNode"); return ptr; } }; // Class AIModule.BTCompositeNode // 0x0038 (FullSize[0x0090] - InheritedSize[0x0058]) class UBTCompositeNode : public UBTNode { public: TArray<struct FBTCompositeChild> Children; // 0x0058(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TArray<class UBTService*> Services; // 0x0068(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_NQ3A[0x10]; // 0x0078(0x0010) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) unsigned char bApplyDecoratorScope : 1; // 0x0088(0x0001) BIT_FIELD (Edit, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_U4JL[0x7]; // 0x0089(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTCompositeNode"); return ptr; } }; // Class AIModule.BTComposite_Selector // 0x0000 (FullSize[0x0090] - InheritedSize[0x0090]) class UBTComposite_Selector : public UBTCompositeNode { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTComposite_Selector"); return ptr; } }; // Class AIModule.BTComposite_Sequence // 0x0000 (FullSize[0x0090] - InheritedSize[0x0090]) class UBTComposite_Sequence : public UBTCompositeNode { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTComposite_Sequence"); return ptr; } }; // Class AIModule.BTComposite_SimpleParallel // 0x0008 (FullSize[0x0098] - InheritedSize[0x0090]) class UBTComposite_SimpleParallel : public UBTCompositeNode { public: TEnumAsByte<AIModule_EBTParallelMode> FinishMode; // 0x0090(0x0001) (Edit, ZeroConstructor, DisableEditOnTemplate, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_5KFZ[0x7]; // 0x0091(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTComposite_SimpleParallel"); return ptr; } }; // Class AIModule.BTDecorator // 0x0008 (FullSize[0x0068] - InheritedSize[0x0060]) class UBTDecorator : public UBTAuxiliaryNode { public: unsigned char UnknownData_8N07 : 7; // 0x0060(0x0001) BIT_FIELD (PADDING) unsigned char bInverseCondition : 1; // 0x0060(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) unsigned char UnknownData_OAL1[0x3]; // 0x0061(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TEnumAsByte<AIModule_EBTFlowAbortMode> FlowAbortMode; // 0x0064(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_FQWY[0x3]; // 0x0065(0x0003) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator"); return ptr; } }; // Class AIModule.BTDecorator_BlackboardBase // 0x0028 (FullSize[0x0090] - InheritedSize[0x0068]) class UBTDecorator_BlackboardBase : public UBTDecorator { public: struct FBlackboardKeySelector BlackboardKey; // 0x0068(0x0028) (Edit, Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_BlackboardBase"); return ptr; } }; // Class AIModule.BTDecorator_Blackboard // 0x0030 (FullSize[0x00C0] - InheritedSize[0x0090]) class UBTDecorator_Blackboard : public UBTDecorator_BlackboardBase { public: int IntValue; // 0x0090(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float FloatValue; // 0x0094(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) struct FString StringValue; // 0x0098(0x0010) (Edit, ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) struct FString CachedDescription; // 0x00A8(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char OperationType; // 0x00B8(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TEnumAsByte<AIModule_EBTBlackboardRestart> NotifyObserver; // 0x00B9(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_64JI[0x6]; // 0x00BA(0x0006) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_Blackboard"); return ptr; } }; // Class AIModule.BTDecorator_BlueprintBase // 0x0038 (FullSize[0x00A0] - InheritedSize[0x0068]) class UBTDecorator_BlueprintBase : public UBTDecorator { public: class AAIController* AIOwner; // 0x0068(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class AActor* ActorOwner; // 0x0070(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<struct FName> ObservedKeyNames; // 0x0078(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_J4U7[0x10]; // 0x0088(0x0010) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) unsigned char bShowPropertyDetails : 1; // 0x0098(0x0001) BIT_FIELD (Edit, DisableEditOnTemplate, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bCheckConditionOnlyBlackBoardChanges : 1; // 0x0098(0x0001) BIT_FIELD (Edit, DisableEditOnInstance, NoDestructor, AdvancedDisplay, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bIsObservingBB : 1; // 0x0098(0x0001) BIT_FIELD (NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_D0YH[0x7]; // 0x0099(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_BlueprintBase"); return ptr; } void ReceiveTickAI(class AAIController* OwnerController, class APawn* ControlledPawn, float DeltaSeconds); void ReceiveTick(class AActor* OwnerActor, float DeltaSeconds); void ReceiveObserverDeactivatedAI(class AAIController* OwnerController, class APawn* ControlledPawn); void ReceiveObserverDeactivated(class AActor* OwnerActor); void ReceiveObserverActivatedAI(class AAIController* OwnerController, class APawn* ControlledPawn); void ReceiveObserverActivated(class AActor* OwnerActor); void ReceiveExecutionStartAI(class AAIController* OwnerController, class APawn* ControlledPawn); void ReceiveExecutionStart(class AActor* OwnerActor); void ReceiveExecutionFinishAI(class AAIController* OwnerController, class APawn* ControlledPawn, TEnumAsByte<AIModule_EBTNodeResult> NodeResult); void ReceiveExecutionFinish(class AActor* OwnerActor, TEnumAsByte<AIModule_EBTNodeResult> NodeResult); bool PerformConditionCheckAI(class AAIController* OwnerController, class APawn* ControlledPawn); bool PerformConditionCheck(class AActor* OwnerActor); bool IsDecoratorObserverActive(); bool IsDecoratorExecutionActive(); }; // Class AIModule.BTDecorator_CheckGameplayTagsOnActor // 0x0060 (FullSize[0x00C8] - InheritedSize[0x0068]) class UBTDecorator_CheckGameplayTagsOnActor : public UBTDecorator { public: struct FBlackboardKeySelector ActorToCheck; // 0x0068(0x0028) (Edit, Protected, NativeAccessSpecifierProtected) GameplayTags_EGameplayContainerMatchType TagsToMatch; // 0x0090(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_GLE1[0x7]; // 0x0091(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FGameplayTagContainer GameplayTags; // 0x0098(0x0020) (Edit, Protected, NativeAccessSpecifierProtected) struct FString CachedDescription; // 0x00B8(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_CheckGameplayTagsOnActor"); return ptr; } }; // Class AIModule.BTDecorator_CompareBBEntries // 0x0058 (FullSize[0x00C0] - InheritedSize[0x0068]) class UBTDecorator_CompareBBEntries : public UBTDecorator { public: TEnumAsByte<AIModule_EBlackBoardEntryComparison> Operator; // 0x0068(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_E9NR[0x7]; // 0x0069(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FBlackboardKeySelector BlackboardKeyA; // 0x0070(0x0028) (Edit, Protected, NativeAccessSpecifierProtected) struct FBlackboardKeySelector BlackboardKeyB; // 0x0098(0x0028) (Edit, Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_CompareBBEntries"); return ptr; } }; // Class AIModule.BTDecorator_ConditionalLoop // 0x0000 (FullSize[0x00C0] - InheritedSize[0x00C0]) class UBTDecorator_ConditionalLoop : public UBTDecorator_Blackboard { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_ConditionalLoop"); return ptr; } }; // Class AIModule.BTDecorator_ConeCheck // 0x0088 (FullSize[0x00F0] - InheritedSize[0x0068]) class UBTDecorator_ConeCheck : public UBTDecorator { public: float ConeHalfAngle; // 0x0068(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_3SOU[0x4]; // 0x006C(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FBlackboardKeySelector ConeOrigin; // 0x0070(0x0028) (Edit, NativeAccessSpecifierPublic) struct FBlackboardKeySelector ConeDirection; // 0x0098(0x0028) (Edit, NativeAccessSpecifierPublic) struct FBlackboardKeySelector Observed; // 0x00C0(0x0028) (Edit, NativeAccessSpecifierPublic) unsigned char UnknownData_338N[0x8]; // 0x00E8(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_ConeCheck"); return ptr; } }; // Class AIModule.BTDecorator_Cooldown // 0x0008 (FullSize[0x0070] - InheritedSize[0x0068]) class UBTDecorator_Cooldown : public UBTDecorator { public: float CoolDownTime; // 0x0068(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_WYIO[0x4]; // 0x006C(0x0004) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_Cooldown"); return ptr; } }; // Class AIModule.BTDecorator_DoesPathExist // 0x0060 (FullSize[0x00C8] - InheritedSize[0x0068]) class UBTDecorator_DoesPathExist : public UBTDecorator { public: struct FBlackboardKeySelector BlackboardKeyA; // 0x0068(0x0028) (Edit, Protected, NativeAccessSpecifierProtected) struct FBlackboardKeySelector BlackboardKeyB; // 0x0090(0x0028) (Edit, Protected, NativeAccessSpecifierProtected) unsigned char bUseSelf : 1; // 0x00B8(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_FC1C[0x3]; // 0x00B9(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TEnumAsByte<AIModule_EPathExistanceQueryType> PathQueryType; // 0x00BC(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_8LVD[0x3]; // 0x00BD(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UClass* FilterClass; // 0x00C0(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_DoesPathExist"); return ptr; } }; // Class AIModule.BTDecorator_ForceSuccess // 0x0000 (FullSize[0x0068] - InheritedSize[0x0068]) class UBTDecorator_ForceSuccess : public UBTDecorator { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_ForceSuccess"); return ptr; } }; // Class AIModule.BTDecorator_IsAtLocation // 0x0048 (FullSize[0x00D8] - InheritedSize[0x0090]) class UBTDecorator_IsAtLocation : public UBTDecorator_BlackboardBase { public: float AcceptableRadius; // 0x0090(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_KATW[0x4]; // 0x0094(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FAIDataProviderFloatValue ParametrizedAcceptableRadius; // 0x0098(0x0038) (Edit, ContainsInstancedReference, NativeAccessSpecifierPublic) AIModule_EFAIDistanceType GeometricDistanceType; // 0x00D0(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_TDX8[0x3]; // 0x00D1(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) unsigned char bUseParametrizedRadius : 1; // 0x00D4(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bUseNavAgentGoalLocation : 1; // 0x00D4(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bPathFindingBasedTest : 1; // 0x00D4(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_DSWV[0x3]; // 0x00D5(0x0003) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_IsAtLocation"); return ptr; } }; // Class AIModule.BTDecorator_IsBBEntryOfClass // 0x0008 (FullSize[0x0098] - InheritedSize[0x0090]) class UBTDecorator_IsBBEntryOfClass : public UBTDecorator_BlackboardBase { public: class UClass* TestClass; // 0x0090(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_IsBBEntryOfClass"); return ptr; } }; // Class AIModule.BTDecorator_KeepInCone // 0x0060 (FullSize[0x00C8] - InheritedSize[0x0068]) class UBTDecorator_KeepInCone : public UBTDecorator { public: float ConeHalfAngle; // 0x0068(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_1SFS[0x4]; // 0x006C(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FBlackboardKeySelector ConeOrigin; // 0x0070(0x0028) (Edit, NativeAccessSpecifierPublic) struct FBlackboardKeySelector Observed; // 0x0098(0x0028) (Edit, NativeAccessSpecifierPublic) unsigned char bUseSelfAsOrigin : 1; // 0x00C0(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bUseSelfAsObserved : 1; // 0x00C0(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_1Q36[0x7]; // 0x00C1(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_KeepInCone"); return ptr; } }; // Class AIModule.BTDecorator_Loop // 0x0010 (FullSize[0x0078] - InheritedSize[0x0068]) class UBTDecorator_Loop : public UBTDecorator { public: int NumLoops; // 0x0068(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bInfiniteLoop; // 0x006C(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_I1B1[0x3]; // 0x006D(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) float InfiniteLoopTimeoutTime; // 0x0070(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_DDP0[0x4]; // 0x0074(0x0004) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_Loop"); return ptr; } }; // Class AIModule.BTDecorator_ReachedMoveGoal // 0x0000 (FullSize[0x0068] - InheritedSize[0x0068]) class UBTDecorator_ReachedMoveGoal : public UBTDecorator { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_ReachedMoveGoal"); return ptr; } }; // Class AIModule.BTDecorator_SetTagCooldown // 0x0010 (FullSize[0x0078] - InheritedSize[0x0068]) class UBTDecorator_SetTagCooldown : public UBTDecorator { public: struct FGameplayTag CooldownTag; // 0x0068(0x0008) (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float CooldownDuration; // 0x0070(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bAddToExistingDuration; // 0x0074(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_BKVI[0x3]; // 0x0075(0x0003) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_SetTagCooldown"); return ptr; } }; // Class AIModule.BTDecorator_TagCooldown // 0x0010 (FullSize[0x0078] - InheritedSize[0x0068]) class UBTDecorator_TagCooldown : public UBTDecorator { public: struct FGameplayTag CooldownTag; // 0x0068(0x0008) (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float CooldownDuration; // 0x0070(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bAddToExistingDuration; // 0x0074(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bActivatesCooldown; // 0x0075(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_Z7TA[0x2]; // 0x0076(0x0002) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_TagCooldown"); return ptr; } }; // Class AIModule.BTDecorator_TimeLimit // 0x0008 (FullSize[0x0070] - InheritedSize[0x0068]) class UBTDecorator_TimeLimit : public UBTDecorator { public: float TimeLimit; // 0x0068(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_OSAL[0x4]; // 0x006C(0x0004) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTDecorator_TimeLimit"); return ptr; } }; // Class AIModule.BTFunctionLibrary // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UBTFunctionLibrary : public UBlueprintFunctionLibrary { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTFunctionLibrary"); return ptr; } void STATIC_StopUsingExternalEvent(class UBTNode* NodeOwner); void STATIC_StartUsingExternalEvent(class UBTNode* NodeOwner, class AActor* OwningActor); void STATIC_SetBlackboardValueAsVector(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key, const struct FVector& Value); void STATIC_SetBlackboardValueAsString(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key, const struct FString& Value); void STATIC_SetBlackboardValueAsRotator(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key, const struct FRotator& Value); void STATIC_SetBlackboardValueAsObject(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key, class UObject* Value); void STATIC_SetBlackboardValueAsName(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key, const struct FName& Value); void STATIC_SetBlackboardValueAsInt(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key, int Value); void STATIC_SetBlackboardValueAsFloat(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key, float Value); void STATIC_SetBlackboardValueAsEnum(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key, unsigned char Value); void STATIC_SetBlackboardValueAsClass(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key, class UClass* Value); void STATIC_SetBlackboardValueAsBool(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key, bool Value); class UBlackboardComponent* STATIC_GetOwnersBlackboard(class UBTNode* NodeOwner); class UBehaviorTreeComponent* STATIC_GetOwnerComponent(class UBTNode* NodeOwner); struct FVector STATIC_GetBlackboardValueAsVector(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); struct FString STATIC_GetBlackboardValueAsString(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); struct FRotator STATIC_GetBlackboardValueAsRotator(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); class UObject* STATIC_GetBlackboardValueAsObject(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); struct FName STATIC_GetBlackboardValueAsName(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); int STATIC_GetBlackboardValueAsInt(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); float STATIC_GetBlackboardValueAsFloat(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); unsigned char STATIC_GetBlackboardValueAsEnum(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); class UClass* STATIC_GetBlackboardValueAsClass(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); bool STATIC_GetBlackboardValueAsBool(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); class AActor* STATIC_GetBlackboardValueAsActor(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); void STATIC_ClearBlackboardValueAsVector(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); void STATIC_ClearBlackboardValue(class UBTNode* NodeOwner, const struct FBlackboardKeySelector& Key); }; // Class AIModule.BTService // 0x0010 (FullSize[0x0070] - InheritedSize[0x0060]) class UBTService : public UBTAuxiliaryNode { public: float Interval; // 0x0060(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float RandomDeviation; // 0x0064(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bCallTickOnSearchStart : 1; // 0x0068(0x0001) BIT_FIELD (Edit, NoDestructor, AdvancedDisplay, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bRestartTimerOnEachActivation : 1; // 0x0068(0x0001) BIT_FIELD (Edit, NoDestructor, AdvancedDisplay, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_5RHT[0x7]; // 0x0069(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTService"); return ptr; } }; // Class AIModule.BTService_BlackboardBase // 0x0028 (FullSize[0x0098] - InheritedSize[0x0070]) class UBTService_BlackboardBase : public UBTService { public: struct FBlackboardKeySelector BlackboardKey; // 0x0070(0x0028) (Edit, Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTService_BlackboardBase"); return ptr; } }; // Class AIModule.BTService_BlueprintBase // 0x0028 (FullSize[0x0098] - InheritedSize[0x0070]) class UBTService_BlueprintBase : public UBTService { public: class AAIController* AIOwner; // 0x0070(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class AActor* ActorOwner; // 0x0078(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_OPRZ[0x10]; // 0x0080(0x0010) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) unsigned char bShowPropertyDetails : 1; // 0x0090(0x0001) BIT_FIELD (Edit, DisableEditOnTemplate, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bShowEventDetails : 1; // 0x0090(0x0001) BIT_FIELD (Edit, DisableEditOnTemplate, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_Q1G9[0x7]; // 0x0091(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTService_BlueprintBase"); return ptr; } void ReceiveTickAI(class AAIController* OwnerController, class APawn* ControlledPawn, float DeltaSeconds); void ReceiveTick(class AActor* OwnerActor, float DeltaSeconds); void ReceiveSearchStartAI(class AAIController* OwnerController, class APawn* ControlledPawn); void ReceiveSearchStart(class AActor* OwnerActor); void ReceiveDeactivationAI(class AAIController* OwnerController, class APawn* ControlledPawn); void ReceiveDeactivation(class AActor* OwnerActor); void ReceiveActivationAI(class AAIController* OwnerController, class APawn* ControlledPawn); void ReceiveActivation(class AActor* OwnerActor); bool IsServiceActive(); }; // Class AIModule.BTService_DefaultFocus // 0x0008 (FullSize[0x00A0] - InheritedSize[0x0098]) class UBTService_DefaultFocus : public UBTService_BlackboardBase { public: unsigned char FocusPriority; // 0x0098(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_W015[0x7]; // 0x0099(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTService_DefaultFocus"); return ptr; } }; // Class AIModule.BTService_RunEQS // 0x0058 (FullSize[0x00F0] - InheritedSize[0x0098]) class UBTService_RunEQS : public UBTService_BlackboardBase { public: struct FEQSParametrizedQueryExecutionRequest EQSRequest; // 0x0098(0x0048) (Edit, Protected, NativeAccessSpecifierProtected) unsigned char UnknownData_DTBS[0x10]; // 0x00E0(0x0010) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTService_RunEQS"); return ptr; } }; // Class AIModule.BTTask_BlackboardBase // 0x0028 (FullSize[0x0098] - InheritedSize[0x0070]) class UBTTask_BlackboardBase : public UBTTaskNode { public: struct FBlackboardKeySelector BlackboardKey; // 0x0070(0x0028) (Edit, Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_BlackboardBase"); return ptr; } }; // Class AIModule.BTTask_BlueprintBase // 0x0038 (FullSize[0x00A8] - InheritedSize[0x0070]) class UBTTask_BlueprintBase : public UBTTaskNode { public: class AAIController* AIOwner; // 0x0070(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class AActor* ActorOwner; // 0x0078(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) struct FIntervalCountdown TickInterval; // 0x0080(0x0008) (Edit, NoDestructor, Protected, NativeAccessSpecifierProtected) unsigned char UnknownData_CIUQ[0x18]; // 0x0088(0x0018) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) unsigned char bShowPropertyDetails : 1; // 0x00A0(0x0001) BIT_FIELD (Edit, DisableEditOnTemplate, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_AW8Z[0x7]; // 0x00A1(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_BlueprintBase"); return ptr; } void SetFinishOnMessageWithId(const struct FName& MessageName, int RequestId); void SetFinishOnMessage(const struct FName& MessageName); void ReceiveTickAI(class AAIController* OwnerController, class APawn* ControlledPawn, float DeltaSeconds); void ReceiveTick(class AActor* OwnerActor, float DeltaSeconds); void ReceiveExecuteAI(class AAIController* OwnerController, class APawn* ControlledPawn); void ReceiveExecute(class AActor* OwnerActor); void ReceiveAbortAI(class AAIController* OwnerController, class APawn* ControlledPawn); void ReceiveAbort(class AActor* OwnerActor); bool IsTaskExecuting(); bool IsTaskAborting(); void FinishExecute(bool bSuccess); void FinishAbort(); }; // Class AIModule.BTTask_FinishWithResult // 0x0008 (FullSize[0x0078] - InheritedSize[0x0070]) class UBTTask_FinishWithResult : public UBTTaskNode { public: TEnumAsByte<AIModule_EBTNodeResult> Result; // 0x0070(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_B6N8[0x7]; // 0x0071(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_FinishWithResult"); return ptr; } }; // Class AIModule.BTTask_GameplayTaskBase // 0x0008 (FullSize[0x0078] - InheritedSize[0x0070]) class UBTTask_GameplayTaskBase : public UBTTaskNode { public: unsigned char bWaitForGameplayTask : 1; // 0x0070(0x0001) BIT_FIELD (Edit, NoDestructor, AdvancedDisplay, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_DF19[0x7]; // 0x0071(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_GameplayTaskBase"); return ptr; } }; // Class AIModule.BTTask_MakeNoise // 0x0008 (FullSize[0x0078] - InheritedSize[0x0070]) class UBTTask_MakeNoise : public UBTTaskNode { public: float Loudnes; // 0x0070(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_WGGV[0x4]; // 0x0074(0x0004) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_MakeNoise"); return ptr; } }; // Class AIModule.BTTask_MoveTo // 0x0018 (FullSize[0x00B0] - InheritedSize[0x0098]) class UBTTask_MoveTo : public UBTTask_BlackboardBase { public: float AcceptableRadius; // 0x0098(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_YARV[0x4]; // 0x009C(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UClass* FilterClass; // 0x00A0(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) float ObservedBlackboardValueTolerance; // 0x00A8(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bObserveBlackboardValue : 1; // 0x00AC(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bAllowStrafe : 1; // 0x00AC(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bAllowPartialPath : 1; // 0x00AC(0x0001) BIT_FIELD (Edit, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bTrackMovingGoal : 1; // 0x00AC(0x0001) BIT_FIELD (Edit, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bProjectGoalLocation : 1; // 0x00AC(0x0001) BIT_FIELD (Edit, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bReachTestIncludesAgentRadius : 1; // 0x00AC(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bReachTestIncludesGoalRadius : 1; // 0x00AC(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bStopOnOverlap : 1; // 0x00AC(0x0001) BIT_FIELD (Edit, DisableEditOnTemplate, EditConst, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bStopOnOverlapNeedsUpdate : 1; // 0x00AD(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_ALYB[0x2]; // 0x00AE(0x0002) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_MoveTo"); return ptr; } }; // Class AIModule.BTTask_MoveDirectlyToward // 0x0008 (FullSize[0x00B8] - InheritedSize[0x00B0]) class UBTTask_MoveDirectlyToward : public UBTTask_MoveTo { public: unsigned char bDisablePathUpdateOnGoalLocationChange : 1; // 0x00B0(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bProjectVectorGoalToNavigation : 1; // 0x00B0(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bUpdatedDeprecatedProperties : 1; // 0x00B0(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) unsigned char UnknownData_183K[0x7]; // 0x00B1(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_MoveDirectlyToward"); return ptr; } }; // Class AIModule.BTTask_PawnActionBase // 0x0000 (FullSize[0x0070] - InheritedSize[0x0070]) class UBTTask_PawnActionBase : public UBTTaskNode { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_PawnActionBase"); return ptr; } }; // Class AIModule.BTTask_PlayAnimation // 0x0040 (FullSize[0x00B0] - InheritedSize[0x0070]) class UBTTask_PlayAnimation : public UBTTaskNode { public: class UAnimationAsset* AnimationToPlay; // 0x0070(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bLooping : 1; // 0x0078(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bNonBlocking : 1; // 0x0078(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_QXH0[0x7]; // 0x0079(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UBehaviorTreeComponent* MyOwnerComp; // 0x0080(0x0008) (ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) class USkeletalMeshComponent* CachedSkelMesh; // 0x0088(0x0008) (ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_QQVU[0x20]; // 0x0090(0x0020) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_PlayAnimation"); return ptr; } }; // Class AIModule.BTTask_PlaySound // 0x0008 (FullSize[0x0078] - InheritedSize[0x0070]) class UBTTask_PlaySound : public UBTTaskNode { public: class USoundCue* SoundToPlay; // 0x0070(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_PlaySound"); return ptr; } }; // Class AIModule.BTTask_PushPawnAction // 0x0008 (FullSize[0x0078] - InheritedSize[0x0070]) class UBTTask_PushPawnAction : public UBTTask_PawnActionBase { public: class UPawnAction* Action; // 0x0070(0x0008) (Edit, ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, NoDestructor, Protected, PersistentInstance, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_PushPawnAction"); return ptr; } }; // Class AIModule.BTTask_RotateToFaceBBEntry // 0x0008 (FullSize[0x00A0] - InheritedSize[0x0098]) class UBTTask_RotateToFaceBBEntry : public UBTTask_BlackboardBase { public: float Precision; // 0x0098(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_AE43[0x4]; // 0x009C(0x0004) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_RotateToFaceBBEntry"); return ptr; } }; // Class AIModule.BTTask_RunBehavior // 0x0008 (FullSize[0x0078] - InheritedSize[0x0070]) class UBTTask_RunBehavior : public UBTTaskNode { public: class UBehaviorTree* BehaviorAsset; // 0x0070(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_RunBehavior"); return ptr; } }; // Class AIModule.BTTask_RunBehaviorDynamic // 0x0018 (FullSize[0x0088] - InheritedSize[0x0070]) class UBTTask_RunBehaviorDynamic : public UBTTaskNode { public: struct FGameplayTag InjectionTag; // 0x0070(0x0008) (Edit, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UBehaviorTree* DefaultBehaviorAsset; // 0x0078(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UBehaviorTree* BehaviorAsset; // 0x0080(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_RunBehaviorDynamic"); return ptr; } }; // Class AIModule.BTTask_RunEQSQuery // 0x00B8 (FullSize[0x0150] - InheritedSize[0x0098]) class UBTTask_RunEQSQuery : public UBTTask_BlackboardBase { public: class UEnvQuery* QueryTemplate; // 0x0098(0x0008) (Edit, ZeroConstructor, EditConst, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TArray<struct FEnvNamedValue> QueryParams; // 0x00A0(0x0010) (Edit, ZeroConstructor, EditConst, HasGetValueTypeHash, NativeAccessSpecifierPublic) TArray<struct FAIDynamicParam> QueryConfig; // 0x00B0(0x0010) (Edit, ZeroConstructor, EditConst, HasGetValueTypeHash, NativeAccessSpecifierPublic) TEnumAsByte<AIModule_EEnvQueryRunMode> RunMode; // 0x00C0(0x0001) (Edit, ZeroConstructor, EditConst, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_J9KS[0x7]; // 0x00C1(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FBlackboardKeySelector EQSQueryBlackboardKey; // 0x00C8(0x0028) (Edit, EditConst, NativeAccessSpecifierPublic) bool bUseBBKey; // 0x00F0(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_6ENJ[0x7]; // 0x00F1(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FEQSParametrizedQueryExecutionRequest EQSRequest; // 0x00F8(0x0048) (Edit, NativeAccessSpecifierPublic) unsigned char UnknownData_I8LH[0x10]; // 0x0140(0x0010) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_RunEQSQuery"); return ptr; } }; // Class AIModule.BTTask_SetTagCooldown // 0x0010 (FullSize[0x0080] - InheritedSize[0x0070]) class UBTTask_SetTagCooldown : public UBTTaskNode { public: struct FGameplayTag CooldownTag; // 0x0070(0x0008) (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bAddToExistingDuration; // 0x0078(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_ZNJU[0x3]; // 0x0079(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) float CooldownDuration; // 0x007C(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_SetTagCooldown"); return ptr; } }; // Class AIModule.BTTask_Wait // 0x0008 (FullSize[0x0078] - InheritedSize[0x0070]) class UBTTask_Wait : public UBTTaskNode { public: float WaitTime; // 0x0070(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float RandomDeviation; // 0x0074(0x0004) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_Wait"); return ptr; } }; // Class AIModule.BTTask_WaitBlackboardTime // 0x0028 (FullSize[0x00A0] - InheritedSize[0x0078]) class UBTTask_WaitBlackboardTime : public UBTTask_Wait { public: struct FBlackboardKeySelector BlackboardKey; // 0x0078(0x0028) (Edit, Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.BTTask_WaitBlackboardTime"); return ptr; } }; // Class AIModule.CrowdAgentInterface // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UCrowdAgentInterface : public UInterface { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.CrowdAgentInterface"); return ptr; } }; // Class AIModule.CrowdManager // 0x00C8 (FullSize[0x00F0] - InheritedSize[0x0028]) class UCrowdManager : public UCrowdManagerBase { public: class ANavigationData* MyNavData; // 0x0028(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<struct FCrowdAvoidanceConfig> AvoidanceConfig; // 0x0030(0x0010) (Edit, ZeroConstructor, Config, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<struct FCrowdAvoidanceSamplingPattern> SamplingPatterns; // 0x0040(0x0010) (Edit, ZeroConstructor, Config, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) int MaxAgents; // 0x0050(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float MaxAgentRadius; // 0x0054(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) int MaxAvoidedAgents; // 0x0058(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) int MaxAvoidedWalls; // 0x005C(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float NavmeshCheckInterval; // 0x0060(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float PathOptimizationInterval; // 0x0064(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float SeparationDirClamp; // 0x0068(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float PathOffsetRadiusMultiplier; // 0x006C(0x0004) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_9QYI : 4; // 0x0070(0x0001) BIT_FIELD (PADDING) unsigned char bResolveCollisions : 1; // 0x0070(0x0001) BIT_FIELD (Edit, Config, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_2XNW[0x7F]; // 0x0071(0x007F) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.CrowdManager"); return ptr; } }; // Class AIModule.DetourCrowdAIController // 0x0000 (FullSize[0x0328] - InheritedSize[0x0328]) class ADetourCrowdAIController : public AAIController { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.DetourCrowdAIController"); return ptr; } }; // Class AIModule.EnvQuery // 0x0018 (FullSize[0x0048] - InheritedSize[0x0030]) class UEnvQuery : public UDataAsset { public: struct FName QueryName; // 0x0030(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<class UEnvQueryOption*> Options; // 0x0038(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQuery"); return ptr; } }; // Class AIModule.EnvQueryContext // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UEnvQueryContext : public UObject { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryContext"); return ptr; } }; // Class AIModule.EnvQueryContext_BlueprintBase // 0x0008 (FullSize[0x0030] - InheritedSize[0x0028]) class UEnvQueryContext_BlueprintBase : public UEnvQueryContext { public: unsigned char UnknownData_NEH0[0x8]; // 0x0028(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryContext_BlueprintBase"); return ptr; } void ProvideSingleLocation(class UObject* QuerierObject, class AActor* QuerierActor, struct FVector* ResultingLocation); void ProvideSingleActor(class UObject* QuerierObject, class AActor* QuerierActor, class AActor** ResultingActor); void ProvideLocationsSet(class UObject* QuerierObject, class AActor* QuerierActor, TArray<struct FVector>* ResultingLocationSet); void ProvideActorsSet(class UObject* QuerierObject, class AActor* QuerierActor, TArray<class AActor*>* ResultingActorsSet); }; // Class AIModule.EnvQueryContext_Item // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UEnvQueryContext_Item : public UEnvQueryContext { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryContext_Item"); return ptr; } }; // Class AIModule.EnvQueryContext_Querier // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UEnvQueryContext_Querier : public UEnvQueryContext { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryContext_Querier"); return ptr; } }; // Class AIModule.EnvQueryDebugHelpers // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UEnvQueryDebugHelpers : public UObject { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryDebugHelpers"); return ptr; } }; // Class AIModule.EnvQueryGenerator_ActorsOfClass // 0x0080 (FullSize[0x00D0] - InheritedSize[0x0050]) class UEnvQueryGenerator_ActorsOfClass : public UEnvQueryGenerator { public: class UClass* SearchedActorClass; // 0x0050(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) struct FAIDataProviderBoolValue GenerateOnlyActorsInRadius; // 0x0058(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue SearchRadius; // 0x0090(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) class UClass* SearchCenter; // 0x00C8(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator_ActorsOfClass"); return ptr; } }; // Class AIModule.EnvQueryGenerator_BlueprintBase // 0x0030 (FullSize[0x0080] - InheritedSize[0x0050]) class UEnvQueryGenerator_BlueprintBase : public UEnvQueryGenerator { public: struct FText GeneratorsActionDescription; // 0x0050(0x0018) (Edit, NativeAccessSpecifierPublic) class UClass* Context; // 0x0068(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) class UClass* GeneratedItemType; // 0x0070(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_8D1O[0x8]; // 0x0078(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator_BlueprintBase"); return ptr; } class UObject* GetQuerier(); void DoItemGeneration(TArray<struct FVector> ContextLocations); void AddGeneratedVector(const struct FVector& GeneratedVector); void AddGeneratedActor(class AActor* GeneratedActor); }; // Class AIModule.EnvQueryGenerator_Composite // 0x0020 (FullSize[0x0070] - InheritedSize[0x0050]) class UEnvQueryGenerator_Composite : public UEnvQueryGenerator { public: TArray<class UEnvQueryGenerator*> Generators; // 0x0050(0x0010) (Edit, ExportObject, ZeroConstructor, DisableEditOnInstance, ContainsInstancedReference, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bAllowDifferentItemTypes : 1; // 0x0060(0x0001) BIT_FIELD (Edit, DisableEditOnInstance, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bHasMatchingItemType : 1; // 0x0060(0x0001) BIT_FIELD (NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_X2BI[0x7]; // 0x0061(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UClass* ForcedItemType; // 0x0068(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, AdvancedDisplay, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator_Composite"); return ptr; } }; // Class AIModule.EnvQueryGenerator_ProjectedPoints // 0x0030 (FullSize[0x0080] - InheritedSize[0x0050]) class UEnvQueryGenerator_ProjectedPoints : public UEnvQueryGenerator { public: struct FEnvTraceData ProjectionData; // 0x0050(0x0030) (Edit, DisableEditOnInstance, NoDestructor, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator_ProjectedPoints"); return ptr; } }; // Class AIModule.EnvQueryGenerator_Cone // 0x00F0 (FullSize[0x0170] - InheritedSize[0x0080]) class UEnvQueryGenerator_Cone : public UEnvQueryGenerator_ProjectedPoints { public: struct FAIDataProviderFloatValue AlignedPointsDistance; // 0x0080(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, Protected, NativeAccessSpecifierProtected) struct FAIDataProviderFloatValue ConeDegrees; // 0x00B8(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, Protected, NativeAccessSpecifierProtected) struct FAIDataProviderFloatValue AngleStep; // 0x00F0(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, Protected, NativeAccessSpecifierProtected) struct FAIDataProviderFloatValue Range; // 0x0128(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, Protected, NativeAccessSpecifierProtected) class UClass* CenterActor; // 0x0160(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bIncludeContextLocation : 1; // 0x0168(0x0001) BIT_FIELD (Edit, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_Z7LA[0x7]; // 0x0169(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator_Cone"); return ptr; } }; // Class AIModule.EnvQueryGenerator_CurrentLocation // 0x0008 (FullSize[0x0058] - InheritedSize[0x0050]) class UEnvQueryGenerator_CurrentLocation : public UEnvQueryGenerator { public: class UClass* QueryContext; // 0x0050(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator_CurrentLocation"); return ptr; } }; // Class AIModule.EnvQueryGenerator_Donut // 0x0150 (FullSize[0x01D0] - InheritedSize[0x0080]) class UEnvQueryGenerator_Donut : public UEnvQueryGenerator_ProjectedPoints { public: struct FAIDataProviderFloatValue InnerRadius; // 0x0080(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue OuterRadius; // 0x00B8(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderIntValue NumberOfRings; // 0x00F0(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderIntValue PointsPerRing; // 0x0128(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FEnvDirection ArcDirection; // 0x0160(0x0020) (Edit, DisableEditOnInstance, NoDestructor, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue ArcAngle; // 0x0180(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) bool bUseSpiralPattern; // 0x01B8(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_IXVW[0x7]; // 0x01B9(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UClass* Center; // 0x01C0(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bDefineArc : 1; // 0x01C8(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_KR2P[0x7]; // 0x01C9(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator_Donut"); return ptr; } }; // Class AIModule.EnvQueryGenerator_OnCircle // 0x0190 (FullSize[0x0210] - InheritedSize[0x0080]) class UEnvQueryGenerator_OnCircle : public UEnvQueryGenerator_ProjectedPoints { public: struct FAIDataProviderFloatValue CircleRadius; // 0x0080(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue SpaceBetween; // 0x00B8(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderIntValue NumberOfPoints; // 0x00F0(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) AIModule_EPointOnCircleSpacingMethod PointOnCircleSpacingMethod; // 0x0128(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_4667[0x7]; // 0x0129(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FEnvDirection ArcDirection; // 0x0130(0x0020) (Edit, DisableEditOnInstance, NoDestructor, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue ArcAngle; // 0x0150(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) float AngleRadians; // 0x0188(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_VEE1[0x4]; // 0x018C(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UClass* CircleCenter; // 0x0190(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) bool bIgnoreAnyContextActorsWhenGeneratingCircle; // 0x0198(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_RX65[0x7]; // 0x0199(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FAIDataProviderFloatValue CircleCenterZOffset; // 0x01A0(0x0038) (Edit, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FEnvTraceData TraceData; // 0x01D8(0x0030) (Edit, NoDestructor, NativeAccessSpecifierPublic) unsigned char bDefineArc : 1; // 0x0208(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_2YN3[0x7]; // 0x0209(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator_OnCircle"); return ptr; } }; // Class AIModule.EnvQueryGenerator_SimpleGrid // 0x0078 (FullSize[0x00F8] - InheritedSize[0x0080]) class UEnvQueryGenerator_SimpleGrid : public UEnvQueryGenerator_ProjectedPoints { public: struct FAIDataProviderFloatValue GridSize; // 0x0080(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue SpaceBetween; // 0x00B8(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) class UClass* GenerateAround; // 0x00F0(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator_SimpleGrid"); return ptr; } }; // Class AIModule.EnvQueryGenerator_PathingGrid // 0x0078 (FullSize[0x0170] - InheritedSize[0x00F8]) class UEnvQueryGenerator_PathingGrid : public UEnvQueryGenerator_SimpleGrid { public: struct FAIDataProviderBoolValue PathToItem; // 0x00F8(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) class UClass* NavigationFilter; // 0x0130(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue ScanRangeMultiplier; // 0x0138(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, AdvancedDisplay, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryGenerator_PathingGrid"); return ptr; } }; // Class AIModule.EnvQueryInstanceBlueprintWrapper // 0x0050 (FullSize[0x0078] - InheritedSize[0x0028]) class UEnvQueryInstanceBlueprintWrapper : public UObject { public: unsigned char UnknownData_QB53[0x8]; // 0x0028(0x0008) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) int QueryID; // 0x0030(0x0004) (BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_52KD[0x24]; // 0x0034(0x0024) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UClass* ItemType; // 0x0058(0x0008) (BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierProtected) int OptionIndex; // 0x0060(0x0004) (BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_LVJG[0x4]; // 0x0064(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FScriptMulticastDelegate OnQueryFinishedEvent; // 0x0068(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryInstanceBlueprintWrapper"); return ptr; } void SetNamedParam(const struct FName& ParamName, float Value); TArray<struct FVector> GetResultsAsLocations(); TArray<class AActor*> GetResultsAsActors(); bool GetQueryResultsAsLocations(TArray<struct FVector>* ResultLocations); bool GetQueryResultsAsActors(TArray<class AActor*>* ResultActors); float GetItemScore(int ItemIndex); void EQSQueryDoneSignature__DelegateSignature(class UEnvQueryInstanceBlueprintWrapper* QueryInstance, TEnumAsByte<AIModule_EEnvQueryStatus> QueryStatus); }; // Class AIModule.EnvQueryItemType // 0x0008 (FullSize[0x0030] - InheritedSize[0x0028]) class UEnvQueryItemType : public UObject { public: unsigned char UnknownData_X2VI[0x8]; // 0x0028(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryItemType"); return ptr; } }; // Class AIModule.EnvQueryItemType_VectorBase // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UEnvQueryItemType_VectorBase : public UEnvQueryItemType { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryItemType_VectorBase"); return ptr; } }; // Class AIModule.EnvQueryItemType_ActorBase // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UEnvQueryItemType_ActorBase : public UEnvQueryItemType_VectorBase { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryItemType_ActorBase"); return ptr; } }; // Class AIModule.EnvQueryItemType_Actor // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UEnvQueryItemType_Actor : public UEnvQueryItemType_ActorBase { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryItemType_Actor"); return ptr; } }; // Class AIModule.EnvQueryItemType_Direction // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UEnvQueryItemType_Direction : public UEnvQueryItemType_VectorBase { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryItemType_Direction"); return ptr; } }; // Class AIModule.EnvQueryItemType_Point // 0x0000 (FullSize[0x0030] - InheritedSize[0x0030]) class UEnvQueryItemType_Point : public UEnvQueryItemType_VectorBase { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryItemType_Point"); return ptr; } }; // Class AIModule.EnvQueryManager // 0x0108 (FullSize[0x0140] - InheritedSize[0x0038]) class UEnvQueryManager : public UAISubsystem { public: unsigned char UnknownData_GAZT[0x70]; // 0x0038(0x0070) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<struct FEnvQueryInstanceCache> InstanceCache; // 0x00A8(0x0010) (ZeroConstructor, Transient, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<class UEnvQueryContext*> LocalContexts; // 0x00B8(0x0010) (ZeroConstructor, Transient, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<class UEnvQueryInstanceBlueprintWrapper*> GCShieldedWrappers; // 0x00C8(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_9ADB[0x54]; // 0x00D8(0x0054) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) float MaxAllowedTestingTime; // 0x012C(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) bool bTestQueriesUsingBreadth; // 0x0130(0x0001) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_Y5L0[0x3]; // 0x0131(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) int QueryCountWarningThreshold; // 0x0134(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) double QueryCountWarningInterval; // 0x0138(0x0008) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryManager"); return ptr; } class UEnvQueryInstanceBlueprintWrapper* STATIC_RunEQSQuery(class UObject* WorldContextObject, class UEnvQuery* QueryTemplate, class UObject* Querier, TEnumAsByte<AIModule_EEnvQueryRunMode> RunMode, class UClass* WrapperClass); }; // Class AIModule.EnvQueryOption // 0x0018 (FullSize[0x0040] - InheritedSize[0x0028]) class UEnvQueryOption : public UObject { public: class UEnvQueryGenerator* Generator; // 0x0028(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TArray<class UEnvQueryTest*> Tests; // 0x0030(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryOption"); return ptr; } }; // Class AIModule.EnvQueryTest_Distance // 0x0010 (FullSize[0x0208] - InheritedSize[0x01F8]) class UEnvQueryTest_Distance : public UEnvQueryTest { public: TEnumAsByte<AIModule_EEnvTestDistance> TestMode; // 0x01F8(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_P72N[0x7]; // 0x01F9(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UClass* DistanceTo; // 0x0200(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest_Distance"); return ptr; } }; // Class AIModule.EnvQueryTest_Dot // 0x0048 (FullSize[0x0240] - InheritedSize[0x01F8]) class UEnvQueryTest_Dot : public UEnvQueryTest { public: struct FEnvDirection LineA; // 0x01F8(0x0020) (Edit, DisableEditOnInstance, NoDestructor, Protected, NativeAccessSpecifierProtected) struct FEnvDirection LineB; // 0x0218(0x0020) (Edit, DisableEditOnInstance, NoDestructor, Protected, NativeAccessSpecifierProtected) AIModule_EEnvTestDot TestMode; // 0x0238(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) bool bAbsoluteValue; // 0x0239(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_2K47[0x6]; // 0x023A(0x0006) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest_Dot"); return ptr; } }; // Class AIModule.EnvQueryTest_GameplayTags // 0x0070 (FullSize[0x0268] - InheritedSize[0x01F8]) class UEnvQueryTest_GameplayTags : public UEnvQueryTest { public: struct FGameplayTagQuery TagQueryToMatch; // 0x01F8(0x0048) (Edit, Protected, NativeAccessSpecifierProtected) bool bUpdatedToUseQuery; // 0x0240(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) GameplayTags_EGameplayContainerMatchType TagsToMatch; // 0x0241(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_84GL[0x6]; // 0x0242(0x0006) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FGameplayTagContainer GameplayTags; // 0x0248(0x0020) (Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest_GameplayTags"); return ptr; } }; // Class AIModule.EnvQueryTest_Overlap // 0x0020 (FullSize[0x0218] - InheritedSize[0x01F8]) class UEnvQueryTest_Overlap : public UEnvQueryTest { public: struct FEnvOverlapData OverlapData; // 0x01F8(0x0020) (Edit, DisableEditOnInstance, NoDestructor, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest_Overlap"); return ptr; } }; // Class AIModule.EnvQueryTest_Pathfinding // 0x0088 (FullSize[0x0280] - InheritedSize[0x01F8]) class UEnvQueryTest_Pathfinding : public UEnvQueryTest { public: TEnumAsByte<AIModule_EEnvTestPathfinding> TestMode; // 0x01F8(0x0001) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_SGUU[0x7]; // 0x01F9(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UClass* Context; // 0x0200(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) struct FAIDataProviderBoolValue PathFromContext; // 0x0208(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderBoolValue SkipUnreachable; // 0x0240(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, AdvancedDisplay, NativeAccessSpecifierPublic) class UClass* FilterClass; // 0x0278(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest_Pathfinding"); return ptr; } }; // Class AIModule.EnvQueryTest_PathfindingBatch // 0x0038 (FullSize[0x02B8] - InheritedSize[0x0280]) class UEnvQueryTest_PathfindingBatch : public UEnvQueryTest_Pathfinding { public: struct FAIDataProviderFloatValue ScanRangeMultiplier; // 0x0280(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, AdvancedDisplay, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest_PathfindingBatch"); return ptr; } }; // Class AIModule.EnvQueryTest_Project // 0x0030 (FullSize[0x0228] - InheritedSize[0x01F8]) class UEnvQueryTest_Project : public UEnvQueryTest { public: struct FEnvTraceData ProjectionData; // 0x01F8(0x0030) (Edit, DisableEditOnInstance, NoDestructor, Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest_Project"); return ptr; } }; // Class AIModule.EnvQueryTest_Random // 0x0000 (FullSize[0x01F8] - InheritedSize[0x01F8]) class UEnvQueryTest_Random : public UEnvQueryTest { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest_Random"); return ptr; } }; // Class AIModule.EnvQueryTest_Trace // 0x00E0 (FullSize[0x02D8] - InheritedSize[0x01F8]) class UEnvQueryTest_Trace : public UEnvQueryTest { public: struct FEnvTraceData TraceData; // 0x01F8(0x0030) (Edit, DisableEditOnInstance, NoDestructor, NativeAccessSpecifierPublic) struct FAIDataProviderBoolValue TraceFromContext; // 0x0228(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue ItemHeightOffset; // 0x0260(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, AdvancedDisplay, NativeAccessSpecifierPublic) struct FAIDataProviderFloatValue ContextHeightOffset; // 0x0298(0x0038) (Edit, DisableEditOnInstance, ContainsInstancedReference, AdvancedDisplay, NativeAccessSpecifierPublic) class UClass* Context; // 0x02D0(0x0008) (Edit, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest_Trace"); return ptr; } }; // Class AIModule.EnvQueryTest_Volume // 0x0018 (FullSize[0x0210] - InheritedSize[0x01F8]) class UEnvQueryTest_Volume : public UEnvQueryTest { public: class UClass* VolumeContext; // 0x01F8(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPrivate) class UClass* VolumeClass; // 0x0200(0x0008) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPrivate) unsigned char bDoComplexVolumeTest : 1; // 0x0208(0x0001) BIT_FIELD (Edit, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) unsigned char UnknownData_O6DQ[0x7]; // 0x0209(0x0007) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTest_Volume"); return ptr; } }; // Class AIModule.EnvQueryTypes // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UEnvQueryTypes : public UObject { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EnvQueryTypes"); return ptr; } }; // Class AIModule.EQSQueryResultSourceInterface // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UEQSQueryResultSourceInterface : public UInterface { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EQSQueryResultSourceInterface"); return ptr; } }; // Class AIModule.EQSRenderingComponent // 0x0040 (FullSize[0x0430] - InheritedSize[0x03F0]) class UEQSRenderingComponent : public UPrimitiveComponent { public: unsigned char UnknownData_L5Z6[0x40]; // 0x03F0(0x0040) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.EQSRenderingComponent"); return ptr; } }; // Class AIModule.GenericTeamAgentInterface // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UGenericTeamAgentInterface : public UInterface { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.GenericTeamAgentInterface"); return ptr; } }; // Class AIModule.GridPathAIController // 0x0000 (FullSize[0x0328] - InheritedSize[0x0328]) class AGridPathAIController : public AAIController { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.GridPathAIController"); return ptr; } }; // Class AIModule.GridPathFollowingComponent // 0x0030 (FullSize[0x0288] - InheritedSize[0x0258]) class UGridPathFollowingComponent : public UPathFollowingComponent { public: class UNavLocalGridManager* GridManager; // 0x0258(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_HR1S[0x28]; // 0x0260(0x0028) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.GridPathFollowingComponent"); return ptr; } }; // Class AIModule.NavFilter_AIControllerDefault // 0x0000 (FullSize[0x0048] - InheritedSize[0x0048]) class UNavFilter_AIControllerDefault : public UNavigationQueryFilter { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.NavFilter_AIControllerDefault"); return ptr; } }; // Class AIModule.NavLinkProxy // 0x0050 (FullSize[0x0270] - InheritedSize[0x0220]) class ANavLinkProxy : public AActor { public: unsigned char UnknownData_O104[0x10]; // 0x0220(0x0010) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<struct FNavigationLink> PointLinks; // 0x0230(0x0010) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TArray<struct FNavigationSegmentLink> SegmentLinks; // 0x0240(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) class UNavLinkCustomComponent* SmartLinkComp; // 0x0250(0x0008) (Edit, ExportObject, ZeroConstructor, EditConst, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) bool bSmartLinkIsRelevant; // 0x0258(0x0001) (Edit, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_OXFG[0x7]; // 0x0259(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FScriptMulticastDelegate OnSmartLinkReached; // 0x0260(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.NavLinkProxy"); return ptr; } void SetSmartLinkEnabled(bool bEnabled); void ResumePathFollowing(class AActor* Agent); void ReceiveSmartLinkReached(class AActor* Agent, const struct FVector& Destination); bool IsSmartLinkEnabled(); bool HasMovingAgents(); }; // Class AIModule.NavLocalGridManager // 0x0030 (FullSize[0x0058] - InheritedSize[0x0028]) class UNavLocalGridManager : public UObject { public: unsigned char UnknownData_W3M9[0x30]; // 0x0028(0x0030) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.NavLocalGridManager"); return ptr; } bool STATIC_SetLocalNavigationGridDensity(class UObject* WorldContextObject, float CellSize); void STATIC_RemoveLocalNavigationGrid(class UObject* WorldContextObject, int GridId, bool bRebuildGrids); bool STATIC_FindLocalNavigationGridPath(class UObject* WorldContextObject, const struct FVector& Start, const struct FVector& End, TArray<struct FVector>* PathPoints); int STATIC_AddLocalNavigationGridForPoints(class UObject* WorldContextObject, TArray<struct FVector> Locations, int Radius2D, float Height, bool bRebuildGrids); int STATIC_AddLocalNavigationGridForPoint(class UObject* WorldContextObject, const struct FVector& Location, int Radius2D, float Height, bool bRebuildGrids); int STATIC_AddLocalNavigationGridForCapsule(class UObject* WorldContextObject, const struct FVector& Location, float CapsuleRadius, float CapsuleHalfHeight, int Radius2D, float Height, bool bRebuildGrids); int STATIC_AddLocalNavigationGridForBox(class UObject* WorldContextObject, const struct FVector& Location, const struct FVector& Extent, const struct FRotator& Rotation, int Radius2D, float Height, bool bRebuildGrids); }; // Class AIModule.PathFollowingManager // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UPathFollowingManager : public UObject { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.PathFollowingManager"); return ptr; } }; // Class AIModule.PawnAction // 0x0070 (FullSize[0x0098] - InheritedSize[0x0028]) class UPawnAction : public UObject { public: class UPawnAction* ChildAction; // 0x0028(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) class UPawnAction* ParentAction; // 0x0030(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) class UPawnActionsComponent* OwnerComponent; // 0x0038(0x0008) (ExportObject, ZeroConstructor, Transient, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) class UObject* Instigator; // 0x0040(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) class UBrainComponent* BrainComp; // 0x0048(0x0008) (ExportObject, ZeroConstructor, Transient, InstancedReference, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_U1LT[0x30]; // 0x0050(0x0030) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) unsigned char bAllowNewSameClassInstance : 1; // 0x0080(0x0001) BIT_FIELD (Edit, BlueprintVisible, BlueprintReadOnly, DisableEditOnInstance, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bReplaceActiveSameClassInstance : 1; // 0x0080(0x0001) BIT_FIELD (Edit, BlueprintVisible, DisableEditOnInstance, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bShouldPauseMovement : 1; // 0x0080(0x0001) BIT_FIELD (Edit, BlueprintVisible, DisableEditOnInstance, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bAlwaysNotifyOnFinished : 1; // 0x0080(0x0001) BIT_FIELD (Edit, BlueprintVisible, DisableEditOnInstance, NoDestructor, AdvancedDisplay, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_1KG7[0x17]; // 0x0081(0x0017) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.PawnAction"); return ptr; } TEnumAsByte<AIModule_EAIRequestPriority> GetActionPriority(); void Finish(TEnumAsByte<AIModule_EPawnActionResult> WithResult); class UPawnAction* STATIC_CreateActionInstance(class UObject* WorldContextObject, class UClass* ActionClass); }; // Class AIModule.PawnAction_BlueprintBase // 0x0000 (FullSize[0x0098] - InheritedSize[0x0098]) class UPawnAction_BlueprintBase : public UPawnAction { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.PawnAction_BlueprintBase"); return ptr; } void ActionTick(class APawn* ControlledPawn, float DeltaSeconds); void ActionStart(class APawn* ControlledPawn); void ActionResume(class APawn* ControlledPawn); void ActionPause(class APawn* ControlledPawn); void ActionFinished(class APawn* ControlledPawn, TEnumAsByte<AIModule_EPawnActionResult> WithResult); }; // Class AIModule.PawnAction_Move // 0x0050 (FullSize[0x00E8] - InheritedSize[0x0098]) class UPawnAction_Move : public UPawnAction { public: class AActor* GoalActor; // 0x0098(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) struct FVector GoalLocation; // 0x00A0(0x000C) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float AcceptableRadius; // 0x00AC(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UClass* FilterClass; // 0x00B0(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bAllowStrafe : 1; // 0x00B8(0x0001) BIT_FIELD (Edit, BlueprintVisible, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bFinishOnOverlap : 1; // 0x00B8(0x0001) BIT_FIELD (NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bUsePathfinding : 1; // 0x00B8(0x0001) BIT_FIELD (NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bAllowPartialPath : 1; // 0x00B8(0x0001) BIT_FIELD (NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bProjectGoalToNavigation : 1; // 0x00B8(0x0001) BIT_FIELD (NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bUpdatePathToGoal : 1; // 0x00B8(0x0001) BIT_FIELD (NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char bAbortChildActionOnPathChange : 1; // 0x00B8(0x0001) BIT_FIELD (NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_KJPD[0x2F]; // 0x00B9(0x002F) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.PawnAction_Move"); return ptr; } }; // Class AIModule.PawnAction_Repeat // 0x0020 (FullSize[0x00B8] - InheritedSize[0x0098]) class UPawnAction_Repeat : public UPawnAction { public: class UPawnAction* ActionToRepeat; // 0x0098(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) class UPawnAction* RecentActionCopy; // 0x00A0(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TEnumAsByte<AIModule_EPawnActionFailHandling> ChildFailureHandlingMode; // 0x00A8(0x0001) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_REUS[0xF]; // 0x00A9(0x000F) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.PawnAction_Repeat"); return ptr; } }; // Class AIModule.PawnAction_Sequence // 0x0028 (FullSize[0x00C0] - InheritedSize[0x0098]) class UPawnAction_Sequence : public UPawnAction { public: TArray<class UPawnAction*> ActionSequence; // 0x0098(0x0010) (ZeroConstructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) TEnumAsByte<AIModule_EPawnActionFailHandling> ChildFailureHandlingMode; // 0x00A8(0x0001) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_RWN0[0x7]; // 0x00A9(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) class UPawnAction* RecentActionCopy; // 0x00B0(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_30DQ[0x8]; // 0x00B8(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.PawnAction_Sequence"); return ptr; } }; // Class AIModule.PawnAction_Wait // 0x0010 (FullSize[0x00A8] - InheritedSize[0x0098]) class UPawnAction_Wait : public UPawnAction { public: float TimeToWait; // 0x0098(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_HG8W[0xC]; // 0x009C(0x000C) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.PawnAction_Wait"); return ptr; } }; // Class AIModule.PawnActionsComponent // 0x0038 (FullSize[0x00E8] - InheritedSize[0x00B0]) class UPawnActionsComponent : public UActorComponent { public: class APawn* ControlledPawn; // 0x00B0(0x0008) (BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<struct FPawnActionStack> ActionStacks; // 0x00B8(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<struct FPawnActionEvent> ActionEvents; // 0x00C8(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UPawnAction* CurrentAction; // 0x00D8(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_O73Q[0x8]; // 0x00E0(0x0008) MISSED OFFSET (PADDING) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.PawnActionsComponent"); return ptr; } bool K2_PushAction(class UPawnAction* NewAction, TEnumAsByte<AIModule_EAIRequestPriority> Priority, class UObject* Instigator); bool STATIC_K2_PerformAction(class APawn* Pawn, class UPawnAction* Action, TEnumAsByte<AIModule_EAIRequestPriority> Priority); TEnumAsByte<AIModule_EPawnActionAbortState> K2_ForceAbortAction(class UPawnAction* ActionToAbort); TEnumAsByte<AIModule_EPawnActionAbortState> K2_AbortAction(class UPawnAction* ActionToAbort); }; // Class AIModule.PawnSensingComponent // 0x0048 (FullSize[0x00F8] - InheritedSize[0x00B0]) class UPawnSensingComponent : public UActorComponent { public: float HearingThreshold; // 0x00B0(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float LOSHearingThreshold; // 0x00B4(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float SightRadius; // 0x00B8(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float SensingInterval; // 0x00BC(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) float HearingMaxSoundAge; // 0x00C0(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bEnableSensingUpdates : 1; // 0x00C4(0x0001) BIT_FIELD (Edit, BlueprintVisible, BlueprintReadOnly, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bOnlySensePlayers : 1; // 0x00C4(0x0001) BIT_FIELD (Edit, BlueprintVisible, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bSeePawns : 1; // 0x00C4(0x0001) BIT_FIELD (Edit, BlueprintVisible, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char bHearNoises : 1; // 0x00C4(0x0001) BIT_FIELD (Edit, BlueprintVisible, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_0SOU[0xB]; // 0x00C5(0x000B) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FScriptMulticastDelegate OnSeePawn; // 0x00D0(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnHearNoise; // 0x00E0(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) float PeripheralVisionAngle; // 0x00F0(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float PeripheralVisionCosine; // 0x00F4(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.PawnSensingComponent"); return ptr; } void SetSensingUpdatesEnabled(bool bEnabled); void SetSensingInterval(float NewSensingInterval); void SetPeripheralVisionAngle(float NewPeripheralVisionAngle); void SeePawnDelegate__DelegateSignature(class APawn* Pawn); void HearNoiseDelegate__DelegateSignature(class APawn* Instigator, const struct FVector& Location, float Volume); float GetPeripheralVisionCosine(); float GetPeripheralVisionAngle(); }; // Class AIModule.VisualLoggerExtension // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UVisualLoggerExtension : public UObject { public: static UClass* StaticClass() { static UClass* ptr = UObject::FindClass("Class AIModule.VisualLoggerExtension"); return ptr; } }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "talon_hq@outlook.com" ]
talon_hq@outlook.com
bcc6da4d6c91c00fbbd85f6fddbccebacaf8fc7b
ca2d8da4dee81c73407a83e7aa6b3a025fd99075
/proj.win32/GamePlayModel.h
aebf33909679d1d85d3b9a918a3abd62f0a93453
[]
no_license
yangyujiang/Trapit
bc8c865c41490daae9abe54fb4a2d705d502386e
c3ffddce9c5957dc2d916b6a8f0f4ba0ff806afe
refs/heads/master
2021-01-13T02:40:11.663657
2013-05-30T11:01:54
2013-05-30T11:01:54
null
0
0
null
null
null
null
UTF-8
C++
false
false
382
h
#ifndef __GAME_PLAY_MODEL_H__ #define __GAME_PLAY_MODEL_H__ #include "cocos2d.h" #include "Box2D\Box2D.h" USING_NS_CC; class GamePlayModel :public cocos2d::CCObject { protected: CC_PROPERTY_READONLY(b2World*,_world,World); public: GamePlayModel(void):_world(NULL){}; ~GamePlayModel(void); virtual bool init(); CREATE_FUNC(GamePlayModel); }; #endif //__GAME_PLAY_MODEL_H__
[ "yu-2781@163.com" ]
yu-2781@163.com
440722bd748120ae826c3fe73f4ae49f548ebbfb
2677563cf45fd39ab2ca7a025fa187b007a7e4cd
/examples/55_PBR_DirectLighting/PBRDirectLightingDemo.cpp
7705a4342656bb18ced79bb5580fb569c77ba5ae
[ "MIT" ]
permissive
vcoda/VulkanDemos
3220f9b494231aa63cd3d730e57ba6bb4c16d4ca
220702210b5e772a83e84cacf049e8052b2240f3
refs/heads/master
2020-08-26T12:40:42.536167
2019-10-23T04:58:54
2019-10-23T04:58:54
217,012,133
1
0
null
2019-10-23T08:54:09
2019-10-23T08:54:09
null
UTF-8
C++
false
false
8,283
cpp
#include "Common/Common.h" #include "Common/Log.h" #include "Demo/DVKCommon.h" #include "Math/Vector4.h" #include "Math/Matrix4x4.h" #include <vector> // http://yangwc.com/2019/07/14/PhysicallyBasedRendering/ class PBRDirectLightingDemo : public DemoBase { public: PBRDirectLightingDemo(int32 width, int32 height, const char* title, const std::vector<std::string>& cmdLine) : DemoBase(width, height, title, cmdLine) { } virtual ~PBRDirectLightingDemo() { } virtual bool PreInit() override { return true; } virtual bool Init() override { DemoBase::Setup(); DemoBase::Prepare(); CreateGUI(); LoadAssets(); InitParmas(); m_Ready = true; return true; } virtual void Exist() override { DestroyAssets(); DestroyGUI(); DemoBase::Release(); } virtual void Loop(float time, float delta) override { if (!m_Ready) { return; } Draw(time, delta); } private: struct ModelViewProjectionBlock { Matrix4x4 model; Matrix4x4 view; Matrix4x4 proj; }; struct PBRParamBlock { Vector4 param; Vector4 cameraPos; Vector4 lightColor; }; void Draw(float time, float delta) { int32 bufferIndex = DemoBase::AcquireBackbufferIndex(); UpdateFPS(time, delta); bool hovered = UpdateUI(time, delta); if (!hovered) { m_ViewCamera.Update(time, delta); } m_PBRParam.cameraPos = m_ViewCamera.GetTransform().GetOrigin(); SetupCommandBuffers(bufferIndex); DemoBase::Present(bufferIndex); } bool UpdateUI(float time, float delta) { m_GUI->StartFrame(); { ImGui::SetNextWindowPos(ImVec2(0, 0)); ImGui::SetNextWindowSize(ImVec2(0, 0), ImGuiSetCond_FirstUseEver); ImGui::Begin("PBRDirectLightingDemo", nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove); ImGui::SliderFloat("AO", &m_PBRParam.param.x, 0.0f, 1.0f); ImGui::SliderFloat("Roughness", &m_PBRParam.param.y, 0.0f, 1.0f); ImGui::SliderFloat("Metallic", &m_PBRParam.param.z, 0.0f, 1.0f); ImGui::Separator(); ImGui::ColorEdit3("LightColor", (float*)(&m_PBRParam.lightColor)); ImGui::SliderFloat("Intensity", &m_PBRParam.lightColor.w, 0.0f, 100.0f); ImGui::Separator(); int32 debug = m_PBRParam.param.w; const char* models[6] = { "None", "Albedo", "Normal", "Occlusion", "Metallic", "Roughness" }; ImGui::Combo("Debug", &debug, models, 6); m_PBRParam.param.w = debug; ImGui::Text("%.3f ms/frame (%.1f FPS)", 1000.0f / m_LastFPS, m_LastFPS); ImGui::End(); } bool hovered = ImGui::IsAnyWindowHovered() || ImGui::IsAnyItemHovered() || ImGui::IsRootWindowOrAnyChildHovered(); m_GUI->EndFrame(); m_GUI->Update(); return hovered; } void LoadAssets() { vk_demo::DVKCommandBuffer* cmdBuffer = vk_demo::DVKCommandBuffer::Create(m_VulkanDevice, m_CommandPool); m_Model = vk_demo::DVKModel::LoadFromFile( "assets/models/leather-shoes/model.fbx", m_VulkanDevice, cmdBuffer, { VertexAttribute::VA_Position, VertexAttribute::VA_UV0, VertexAttribute::VA_Normal, VertexAttribute::VA_Tangent } ); m_TexAlbedo = vk_demo::DVKTexture::Create2D( "assets/models/leather-shoes/RootNode_baseColor.jpg", m_VulkanDevice, cmdBuffer ); m_TexNormal = vk_demo::DVKTexture::Create2D( "assets/models/leather-shoes/RootNode_normal.jpg", m_VulkanDevice, cmdBuffer ); m_TexORMParam = vk_demo::DVKTexture::Create2D( "assets/models/leather-shoes/RootNode_occlusionRoughnessMetallic.jpg", m_VulkanDevice, cmdBuffer ); m_Shader = vk_demo::DVKShader::Create( m_VulkanDevice, true, "assets/shaders/55_PBR_DirectLighting/obj.vert.spv", "assets/shaders/55_PBR_DirectLighting/obj.frag.spv" ); m_Material = vk_demo::DVKMaterial::Create( m_VulkanDevice, m_RenderPass, m_PipelineCache, m_Shader ); m_Material->PreparePipeline(); m_Material->SetTexture("texAlbedo", m_TexAlbedo); m_Material->SetTexture("texNormal", m_TexNormal); m_Material->SetTexture("texORMParam", m_TexORMParam); delete cmdBuffer; } void DestroyAssets() { delete m_Model; delete m_Shader; delete m_Material; delete m_TexAlbedo; delete m_TexNormal; delete m_TexORMParam; } void SetupCommandBuffers(int32 backBufferIndex) { VkCommandBuffer commandBuffer = m_CommandBuffers[backBufferIndex]; VkCommandBufferBeginInfo cmdBeginInfo; ZeroVulkanStruct(cmdBeginInfo, VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO); VERIFYVULKANRESULT(vkBeginCommandBuffer(commandBuffer, &cmdBeginInfo)); VkClearValue clearValues[2]; clearValues[0].color = { { 0.2f, 0.2f, 0.2f, 1.0f } }; clearValues[1].depthStencil = { 1.0f, 0 }; VkRenderPassBeginInfo renderPassBeginInfo; ZeroVulkanStruct(renderPassBeginInfo, VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO); renderPassBeginInfo.renderPass = m_RenderPass; renderPassBeginInfo.framebuffer = m_FrameBuffers[backBufferIndex]; renderPassBeginInfo.clearValueCount = 2; renderPassBeginInfo.pClearValues = clearValues; renderPassBeginInfo.renderArea.offset.x = 0; renderPassBeginInfo.renderArea.offset.y = 0; renderPassBeginInfo.renderArea.extent.width = m_FrameWidth; renderPassBeginInfo.renderArea.extent.height = m_FrameHeight; vkCmdBeginRenderPass(commandBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); VkViewport viewport = {}; viewport.x = 0; viewport.y = m_FrameHeight; viewport.width = m_FrameWidth; viewport.height = -m_FrameHeight; // flip y axis viewport.minDepth = 0.0f; viewport.maxDepth = 1.0f; VkRect2D scissor = {}; scissor.extent.width = m_FrameWidth; scissor.extent.height = m_FrameHeight; scissor.offset.x = 0; scissor.offset.y = 0; vkCmdSetViewport(commandBuffer, 0, 1, &viewport); vkCmdSetScissor(commandBuffer, 0, 1, &scissor); for (int32 i = 0; i < m_Model->meshes.size(); ++i) { vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, m_Material->GetPipeline()); m_Material->BeginFrame(); m_MVPParam.model = m_Model->meshes[i]->linkNode->GetGlobalMatrix(); m_MVPParam.view = m_ViewCamera.GetView(); m_MVPParam.proj = m_ViewCamera.GetProjection(); m_Material->BeginObject(); m_Material->SetLocalUniform("uboMVP", &m_MVPParam, sizeof(ModelViewProjectionBlock)); m_Material->SetLocalUniform("uboParam", &m_PBRParam, sizeof(PBRParamBlock)); m_Material->EndObject(); m_Material->BindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, 0); m_Model->meshes[i]->BindDrawCmd(commandBuffer); m_Material->EndFrame(); } m_GUI->BindDrawCmd(commandBuffer, m_RenderPass); vkCmdEndRenderPass(commandBuffer); VERIFYVULKANRESULT(vkEndCommandBuffer(commandBuffer)); } void InitParmas() { vk_demo::DVKBoundingBox bounds = m_Model->rootNode->GetBounds(); Vector3 boundSize = bounds.max - bounds.min; Vector3 boundCenter = bounds.min + boundSize * 0.5f; m_ViewCamera.SetPosition(boundCenter.x, boundCenter.y, boundCenter.z - 500.0f); m_ViewCamera.LookAt(boundCenter); m_ViewCamera.Perspective(PI / 4, (float)GetWidth(), (float)GetHeight(), 1.0f, 3000.0f); m_PBRParam.param.x = 1.0f; // ao m_PBRParam.param.y = 1.0f; // roughness m_PBRParam.param.z = 1.0f; // metallic m_PBRParam.param.w = 0.0f; // debug m_PBRParam.cameraPos = m_ViewCamera.GetTransform().GetOrigin(); m_PBRParam.lightColor = Vector4(1, 1, 1, 10); } void CreateGUI() { m_GUI = new ImageGUIContext(); m_GUI->Init("assets/fonts/Ubuntu-Regular.ttf"); } void DestroyGUI() { m_GUI->Destroy(); delete m_GUI; } private: bool m_Ready = false; vk_demo::DVKModel* m_Model = nullptr; vk_demo::DVKShader* m_Shader = nullptr; vk_demo::DVKMaterial* m_Material = nullptr; vk_demo::DVKTexture* m_TexAlbedo = nullptr; vk_demo::DVKTexture* m_TexNormal = nullptr; vk_demo::DVKTexture* m_TexORMParam = nullptr; vk_demo::DVKCamera m_ViewCamera; ModelViewProjectionBlock m_MVPParam; PBRParamBlock m_PBRParam; ImageGUIContext* m_GUI = nullptr; }; std::shared_ptr<AppModuleBase> CreateAppMode(const std::vector<std::string>& cmdLine) { return std::make_shared<PBRDirectLightingDemo>(1400, 900, "PBRDirectLightingDemo", cmdLine); }
[ "chenbo150928@gmail.com" ]
chenbo150928@gmail.com
2557f642546921a4bbe20034c11bfef07ee77ae1
170416e48c4473d733c531a27c5f559def82a946
/src/regexp-macro-assembler-ia32.h
d6f11ad1146e5c045056d61b7d3461eb30f43620
[ "BSD-3-Clause", "MIT" ]
permissive
YanShenChun/v8-1.0.3.6
a490bae5f61db0004574b903cf7f0e61f80547c6
cee01fea388513a7694a4818a8bdff1255a98926
refs/heads/master
2020-04-06T07:54:29.770536
2016-09-02T09:42:02
2016-09-02T09:42:02
64,743,808
0
0
null
null
null
null
UTF-8
C++
false
false
12,293
h
// Copyright 2008 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * 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. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "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 COPYRIGHT // OWNER OR 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. #ifndef REGEXP_MACRO_ASSEMBLER_IA32_H_ #define REGEXP_MACRO_ASSEMBLER_IA32_H_ namespace v8 { namespace internal { class RegExpMacroAssemblerIA32: public RegExpMacroAssembler { public: // Type of input string to generate code for. enum Mode { ASCII = 1, UC16 = 2 }; enum Result { EXCEPTION = -1, FAILURE = 0, SUCCESS = 1 }; RegExpMacroAssemblerIA32(Mode mode, int registers_to_save); virtual ~RegExpMacroAssemblerIA32(); virtual int stack_limit_slack(); virtual void AdvanceCurrentPosition(int by); virtual void AdvanceRegister(int reg, int by); virtual void Backtrack(); virtual void Bind(Label* label); virtual void CheckAtStart(Label* on_at_start); virtual void CheckBitmap(uc16 start, Label* bitmap, Label* on_zero); virtual void CheckCharacter(uint32_t c, Label* on_equal); virtual void CheckCharacterAfterAnd(uint32_t c, uint32_t mask, Label* on_equal); virtual void CheckCharacterGT(uc16 limit, Label* on_greater); virtual void CheckCharacterLT(uc16 limit, Label* on_less); virtual void CheckCharacters(Vector<const uc16> str, int cp_offset, Label* on_failure, bool check_end_of_string); // A "greedy loop" is a loop that is both greedy and with a simple // body. It has a particularly simple implementation. virtual void CheckGreedyLoop(Label* on_tos_equals_current_position); virtual void CheckNotAtStart(Label* on_not_at_start); virtual void CheckNotBackReference(int start_reg, Label* on_no_match); virtual void CheckNotBackReferenceIgnoreCase(int start_reg, Label* on_no_match); virtual void CheckNotRegistersEqual(int reg1, int reg2, Label* on_not_equal); virtual void CheckNotCharacter(uint32_t c, Label* on_not_equal); virtual void CheckNotCharacterAfterAnd(uint32_t c, uint32_t mask, Label* on_not_equal); virtual void CheckNotCharacterAfterMinusAnd(uc16 c, uc16 minus, uc16 mask, Label* on_not_equal); // Checks whether the given offset from the current position is before // the end of the string. virtual void CheckPosition(int cp_offset, Label* on_outside_input); virtual bool CheckSpecialCharacterClass(uc16 type, int cp_offset, bool check_offset, Label* on_no_match); virtual void DispatchByteMap(uc16 start, Label* byte_map, const Vector<Label*>& destinations); virtual void DispatchHalfNibbleMap(uc16 start, Label* half_nibble_map, const Vector<Label*>& destinations); virtual void DispatchHighByteMap(byte start, Label* byte_map, const Vector<Label*>& destinations); virtual void EmitOrLink(Label* label); virtual void Fail(); virtual Handle<Object> GetCode(Handle<String> source); virtual void GoTo(Label* label); virtual void IfRegisterGE(int reg, int comparand, Label* if_ge); virtual void IfRegisterLT(int reg, int comparand, Label* if_lt); virtual void IfRegisterEqPos(int reg, Label* if_eq); virtual IrregexpImplementation Implementation(); virtual void LoadCurrentCharacter(int cp_offset, Label* on_end_of_input, bool check_bounds = true, int characters = 1); virtual void PopCurrentPosition(); virtual void PopRegister(int register_index); virtual void PushBacktrack(Label* label); virtual void PushCurrentPosition(); virtual void PushRegister(int register_index, StackCheckFlag check_stack_limit); virtual void ReadCurrentPositionFromRegister(int reg); virtual void ReadStackPointerFromRegister(int reg); virtual void SetRegister(int register_index, int to); virtual void Succeed(); virtual void WriteCurrentPositionToRegister(int reg, int cp_offset); virtual void ClearRegisters(int reg_from, int reg_to); virtual void WriteStackPointerToRegister(int reg); static Result Execute(Code* code, Address* input, int start_offset, int end_offset, int* output, bool at_start); private: // Offsets from ebp of function parameters and stored registers. static const int kFramePointer = 0; // Above the frame pointer - function parameters and return address. static const int kReturn_eip = kFramePointer + kPointerSize; static const int kInputBuffer = kReturn_eip + kPointerSize; static const int kInputStartOffset = kInputBuffer + kPointerSize; static const int kInputEndOffset = kInputStartOffset + kPointerSize; static const int kRegisterOutput = kInputEndOffset + kPointerSize; static const int kAtStart = kRegisterOutput + kPointerSize; static const int kStackHighEnd = kAtStart + kPointerSize; // Below the frame pointer - local stack variables. // When adding local variables remember to push space for them in // the frame in GetCode. static const int kBackup_esi = kFramePointer - kPointerSize; static const int kBackup_edi = kBackup_esi - kPointerSize; static const int kBackup_ebx = kBackup_edi - kPointerSize; static const int kInputStartMinusOne = kBackup_ebx - kPointerSize; // First register address. Following registers are below it on the stack. static const int kRegisterZero = kInputStartMinusOne - kPointerSize; // Initial size of code buffer. static const size_t kRegExpCodeSize = 1024; // Initial size of constant buffers allocated during compilation. static const int kRegExpConstantsSize = 256; // Compares two-byte strings case insensitively. // Called from generated RegExp code. static int CaseInsensitiveCompareUC16(uc16** buffer, int byte_offset1, int byte_offset2, size_t byte_length); // Load a number of characters at the given offset from the // current position, into the current-character register. void LoadCurrentCharacterUnchecked(int cp_offset, int character_count); // Check whether preemption has been requested. void CheckPreemption(); // Check whether we are exceeding the stack limit on the backtrack stack. void CheckStackLimit(); // Called from RegExp if the stack-guard is triggered. // If the code object is relocated, the return address is fixed before // returning. static int CheckStackGuardState(Address* return_address, Code* re_code); // Called from RegExp if the backtrack stack limit is hit. // Tries to expand the stack. Returns the new stack-pointer if // successful, and updates the stack_top address, or returns 0 if unable // to grow the stack. // This function must not trigger a garbage collection. static Address GrowStack(Address stack_pointer, Address* stack_top); // The ebp-relative location of a regexp register. Operand register_location(int register_index); // The register containing the current character after LoadCurrentCharacter. inline Register current_character() { return edx; } // The register containing the backtrack stack top. Provides a meaningful // name to the register. inline Register backtrack_stackpointer() { return ecx; } // Byte size of chars in the string to match (decided by the Mode argument) inline int char_size() { return static_cast<int>(mode_); } // Equivalent to a conditional branch to the label, unless the label // is NULL, in which case it is a conditional Backtrack. void BranchOrBacktrack(Condition condition, Label* to, Hint hint = no_hint); // Load the address of a "constant buffer" (a slice of a byte array) // into a register. The address is computed from the ByteArray* address // and an offset. Uses no extra registers. void LoadConstantBufferAddress(Register reg, ArraySlice* buffer); // Call and return internally in the generated code in a way that // is GC-safe (i.e., doesn't leave absolute code addresses on the stack) inline void SafeCall(Label* to); inline void SafeReturn(); // Pushes the value of a register on the backtrack stack. Decrements the // stack pointer (ecx) by a word size and stores the register's value there. inline void Push(Register source); // Pushes a value on the backtrack stack. Decrements the stack pointer (ecx) // by a word size and stores the value there. inline void Push(Immediate value); // Pops a value from the backtrack stack. Reads the word at the stack pointer // (ecx) and increments it by a word size. inline void Pop(Register target); // Before calling a C-function from generated code, align arguments on stack. // After aligning the frame, arguments must be stored in esp[0], esp[4], // etc., not pushed. The argument count assumes all arguments are word sized. // Some compilers/platforms require the stack to be aligned when calling // C++ code. // Needs a scratch register to do some arithmetic. This register will be // trashed. inline void FrameAlign(int num_arguments, Register scratch); // Calls a C function and cleans up the space for arguments allocated // by FrameAlign. The called function is not allowed to trigger a garbage // collection, since that might move the code and invalidate the return // address (unless this is somehow accounted for). inline void CallCFunction(Address function_address, int num_arguments); MacroAssembler* masm_; // Constant buffer provider. Allocates external storage for storing // constants. ByteArrayProvider constants_; // Which mode to generate code for (ASCII or UC16). Mode mode_; // One greater than maximal register index actually used. int num_registers_; // Number of registers to output at the end (the saved registers // are always 0..num_saved_registers_-1) int num_saved_registers_; // Labels used internally. Label entry_label_; Label start_label_; Label success_label_; Label backtrack_label_; Label exit_label_; Label check_preempt_label_; Label stack_overflow_label_; }; }} // namespace v8::internal #endif /* REGEXP_MACRO_ASSEMBLER_IA32_H_ */
[ "shanghaitan1987@126.com" ]
shanghaitan1987@126.com
9107829ff5c2783bbcc93627ae83013ddd7ec73c
46197b4dda60f992455361049e0ea1d7d95466cd
/build/compiler/nds32le-elf-newlib-v3/nds32le-elf/include/c++/4.9.4/bits/stl_heap.h
2e1768b3ae3b62e4589dbd62c5da3f9ec1db005c
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
EatonYao/alios_aligenie
51d45a0b70a34ae790920721ac9539c7270d2e5f
cbecbfe1fd510d3d6039b185aa080fbb7fa1b6b4
refs/heads/master
2020-07-23T04:35:20.890428
2019-09-10T03:12:52
2019-09-10T03:12:52
207,446,051
1
1
Apache-2.0
2020-03-06T22:46:56
2019-09-10T02:18:37
C
UTF-8
C++
false
false
18,627
h
// Heap implementation -*- C++ -*- // Copyright (C) 2001-2014 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library 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 3, 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 General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * Copyright (c) 1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_heap.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{queue} */ #ifndef _STL_HEAP_H #define _STL_HEAP_H 1 #include <debug/debug.h> #include <bits/move.h> #include <bits/predefined_ops.h> namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @defgroup heap_algorithms Heap * @ingroup sorting_algorithms */ template<typename _RandomAccessIterator, typename _Distance, typename _Compare> _Distance __is_heap_until(_RandomAccessIterator __first, _Distance __n, _Compare __comp) { _Distance __parent = 0; for (_Distance __child = 1; __child < __n; ++__child) { if (__comp(__first + __parent, __first + __child)) return __child; if ((__child & 1) == 0) ++__parent; } return __n; } // __is_heap, a predicate testing whether or not a range is a heap. // This function is an extension, not part of the C++ standard. template<typename _RandomAccessIterator, typename _Distance> inline bool __is_heap(_RandomAccessIterator __first, _Distance __n) { return std::__is_heap_until(__first, __n, __gnu_cxx::__ops::__iter_less_iter()) == __n; } template<typename _RandomAccessIterator, typename _Compare, typename _Distance> inline bool __is_heap(_RandomAccessIterator __first, _Compare __comp, _Distance __n) { return std::__is_heap_until(__first, __n, __gnu_cxx::__ops::__iter_comp_iter(__comp)) == __n; } template<typename _RandomAccessIterator> inline bool __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { return std::__is_heap(__first, std::distance(__first, __last)); } template<typename _RandomAccessIterator, typename _Compare> inline bool __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { return std::__is_heap(__first, __comp, std::distance(__first, __last)); } // Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap, // + is_heap and is_heap_until in C++0x. template<typename _RandomAccessIterator, typename _Distance, typename _Tp, typename _Compare> void __push_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __topIndex, _Tp __value, _Compare __comp) { _Distance __parent = (__holeIndex - 1) / 2; while (__holeIndex > __topIndex && __comp(__first + __parent, __value)) { *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __parent)); __holeIndex = __parent; __parent = (__holeIndex - 1) / 2; } *(__first + __holeIndex) = _GLIBCXX_MOVE(__value); } /** * @brief Push an element onto a heap. * @param __first Start of heap. * @param __last End of heap + element. * @ingroup heap_algorithms * * This operation pushes the element at last-1 onto the valid heap * over the range [__first,__last-1). After completion, * [__first,__last) is a valid heap. */ template<typename _RandomAccessIterator> inline void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_heap(__first, __last - 1); _ValueType __value = _GLIBCXX_MOVE(*(__last - 1)); std::__push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0), _GLIBCXX_MOVE(__value), __gnu_cxx::__ops::__iter_less_val()); } /** * @brief Push an element onto a heap using comparison functor. * @param __first Start of heap. * @param __last End of heap + element. * @param __comp Comparison functor. * @ingroup heap_algorithms * * This operation pushes the element at __last-1 onto the valid * heap over the range [__first,__last-1). After completion, * [__first,__last) is a valid heap. Compare operations are * performed using comp. */ template<typename _RandomAccessIterator, typename _Compare> inline void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_heap_pred(__first, __last - 1, __comp); _ValueType __value = _GLIBCXX_MOVE(*(__last - 1)); std::__push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0), _GLIBCXX_MOVE(__value), __gnu_cxx::__ops::__iter_comp_val(__comp)); } template<typename _RandomAccessIterator, typename _Distance, typename _Tp, typename _Compare> void __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __len, _Tp __value, _Compare __comp) { const _Distance __topIndex = __holeIndex; _Distance __secondChild = __holeIndex; while (__secondChild < (__len - 1) / 2) { __secondChild = 2 * (__secondChild + 1); if (__comp(__first + __secondChild, __first + (__secondChild - 1))) __secondChild--; *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); __holeIndex = __secondChild; } if ((__len & 1) == 0 && __secondChild == (__len - 2) / 2) { __secondChild = 2 * (__secondChild + 1); *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + (__secondChild - 1))); __holeIndex = __secondChild - 1; } std::__push_heap(__first, __holeIndex, __topIndex, _GLIBCXX_MOVE(__value), __gnu_cxx::__ops::__iter_comp_val(__comp)); } template<typename _RandomAccessIterator, typename _Compare> inline void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __result, _Compare __comp) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; _ValueType __value = _GLIBCXX_MOVE(*__result); *__result = _GLIBCXX_MOVE(*__first); std::__adjust_heap(__first, _DistanceType(0), _DistanceType(__last - __first), _GLIBCXX_MOVE(__value), __comp); } /** * @brief Pop an element off a heap. * @param __first Start of heap. * @param __last End of heap. * @pre [__first, __last) is a valid, non-empty range. * @ingroup heap_algorithms * * This operation pops the top of the heap. The elements __first * and __last-1 are swapped and [__first,__last-1) is made into a * heap. */ template<typename _RandomAccessIterator> inline void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) __glibcxx_requires_non_empty_range(__first, __last); __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_heap(__first, __last); if (__last - __first > 1) { --__last; std::__pop_heap(__first, __last, __last, __gnu_cxx::__ops::__iter_less_iter()); } } /** * @brief Pop an element off a heap using comparison functor. * @param __first Start of heap. * @param __last End of heap. * @param __comp Comparison functor to use. * @ingroup heap_algorithms * * This operation pops the top of the heap. The elements __first * and __last-1 are swapped and [__first,__last-1) is made into a * heap. Comparisons are made using comp. */ template<typename _RandomAccessIterator, typename _Compare> inline void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_non_empty_range(__first, __last); __glibcxx_requires_heap_pred(__first, __last, __comp); if (__last - __first > 1) { --__last; std::__pop_heap(__first, __last, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } } template<typename _RandomAccessIterator, typename _Compare> void __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; if (__last - __first < 2) return; const _DistanceType __len = __last - __first; _DistanceType __parent = (__len - 2) / 2; while (true) { _ValueType __value = _GLIBCXX_MOVE(*(__first + __parent)); std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value), __comp); if (__parent == 0) return; __parent--; } } /** * @brief Construct a heap over a range. * @param __first Start of heap. * @param __last End of heap. * @ingroup heap_algorithms * * This operation makes the elements in [__first,__last) into a heap. */ template<typename _RandomAccessIterator> inline void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); std::__make_heap(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Construct a heap over a range using comparison functor. * @param __first Start of heap. * @param __last End of heap. * @param __comp Comparison functor to use. * @ingroup heap_algorithms * * This operation makes the elements in [__first,__last) into a heap. * Comparisons are made using __comp. */ template<typename _RandomAccessIterator, typename _Compare> inline void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); std::__make_heap(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template<typename _RandomAccessIterator, typename _Compare> void __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { while (__last - __first > 1) { --__last; std::__pop_heap(__first, __last, __last, __comp); } } /** * @brief Sort a heap. * @param __first Start of heap. * @param __last End of heap. * @ingroup heap_algorithms * * This operation sorts the valid heap in the range [__first,__last). */ template<typename _RandomAccessIterator> inline void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_heap(__first, __last); std::__sort_heap(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Sort a heap using comparison functor. * @param __first Start of heap. * @param __last End of heap. * @param __comp Comparison functor to use. * @ingroup heap_algorithms * * This operation sorts the valid heap in the range [__first,__last). * Comparisons are made using __comp. */ template<typename _RandomAccessIterator, typename _Compare> inline void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_heap_pred(__first, __last, __comp); std::__sort_heap(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } #if __cplusplus >= 201103L /** * @brief Search the end of a heap. * @param __first Start of range. * @param __last End of range. * @return An iterator pointing to the first element not in the heap. * @ingroup heap_algorithms * * This operation returns the last iterator i in [__first, __last) for which * the range [__first, i) is a heap. */ template<typename _RandomAccessIterator> inline _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return __first + std::__is_heap_until(__first, std::distance(__first, __last), __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Search the end of a heap using comparison functor. * @param __first Start of range. * @param __last End of range. * @param __comp Comparison functor to use. * @return An iterator pointing to the first element not in the heap. * @ingroup heap_algorithms * * This operation returns the last iterator i in [__first, __last) for which * the range [__first, i) is a heap. Comparisons are made using __comp. */ template<typename _RandomAccessIterator, typename _Compare> inline _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); return __first + std::__is_heap_until(__first, std::distance(__first, __last), __gnu_cxx::__ops::__iter_comp_iter(__comp)); } /** * @brief Determines whether a range is a heap. * @param __first Start of range. * @param __last End of range. * @return True if range is a heap, false otherwise. * @ingroup heap_algorithms */ template<typename _RandomAccessIterator> inline bool is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { return std::is_heap_until(__first, __last) == __last; } /** * @brief Determines whether a range is a heap using comparison functor. * @param __first Start of range. * @param __last End of range. * @param __comp Comparison functor to use. * @return True if range is a heap, false otherwise. * @ingroup heap_algorithms */ template<typename _RandomAccessIterator, typename _Compare> inline bool is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { return std::is_heap_until(__first, __last, __comp) == __last; } #endif _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _STL_HEAP_H */
[ "1154031976@qq.com" ]
1154031976@qq.com
7dcebac09bced7f42c76e72b56b9484ae70eeee2
750bc81c7f58229dd403aed2018e648b1938fdc9
/31.下一个排列.cpp
1cb9df4bf01d30e447014850e521ddf5d30e4109
[]
no_license
AllofLife/code_pre
643b815135a49974bad03f3fb5e47188896b48ec
b86734c219d56766321a15646c38fad9834c1c18
refs/heads/master
2021-06-29T20:42:12.437115
2020-12-29T01:36:26
2020-12-29T01:36:26
203,543,908
0
0
null
null
null
null
UTF-8
C++
false
false
1,223
cpp
/* * @lc app=leetcode.cn id=31 lang=cpp * * [31] 下一个排列 * 一次扫描注意找到了从后面连续上升到下降的那个数之后 * 再从最后扫描一个比刚才那个数字更大的数字 把两者交换 * 之后把两者交换 前者之后的所有数字进行排序从小到大 */ class Solution { public: void nextPermutation(vector<int>& nums) { if (nums.size()==0) { return ; } // int max_order = nums[0]; int i =nums.size() -2 ; for (; i >= 0; i--) { // 找到第一个下降的地方 if (nums[i] < nums[i + 1]) { // cout<<nums[i]<<nums[i+1]<<endl; break; } } if(i >= 0){ int j = nums.size() - 1; while (j >= 0 && nums[j] <= nums[i]) { j--; } // cout<<nums[i]<<nums[j]<<endl; int tmp = nums[j]; nums[j] = nums[i]; nums[i] = tmp; // return; } // cout<<"i"<<i<<endl; // 把后面的数排序 sort(nums.begin()+i+1,nums.end()); } };
[ "742415987@qq.com" ]
742415987@qq.com
c7083f96a3ce304f53f6ae83e01d338c88e5837b
d93d987de11fd3432833bf050143c3d53816ab54
/src/core/models/audience.h
27e123360a55167a01e0815c461aab21b647b022
[]
no_license
FarmRadioHangar/open-interactivity-engine
1baf6fe0725051c2d4d083600579504d1c9838d1
3d42dd74874c00ab73243a561c8e977d7b0096d9
refs/heads/master
2020-03-24T03:44:57.152204
2018-11-19T13:09:50
2018-11-19T13:09:50
142,431,555
1
0
null
null
null
null
UTF-8
C++
false
false
397
h
/// /// \file audience.h /// #pragma once #include <nlohmann/json.hpp> #include "../../ops/mongodb/model.h" namespace core { class audience : public ops::mongodb::model<audience> { public: static auto constexpr collection = "audience"; explicit audience(const nlohmann::json& j); private: bsoncxx::builder::basic::document get_builder() const; }; }
[ "hildenjohannes@gmail.com" ]
hildenjohannes@gmail.com
1e288342b18fec7c8d40bfd2968d3b69d1cc5ae6
df5cc480bcd77704a9a4f03a5a8f44b8039aa9f5
/OpenCV-2/Example&Canny.cpp
b931a6f0f81801de7f5e03110faa7003b69946a7
[]
no_license
LuckPsyduck/OpenCV-Example
f7938083d66b71fb11360bb68dea478e1d63af52
aafc044b2b94d6a991a99d158c8619b96aa6f24f
refs/heads/master
2022-08-13T16:33:56.403625
2020-05-17T06:31:44
2020-05-17T06:31:44
264,599,194
1
0
null
null
null
null
GB18030
C++
false
false
2,103
cpp
//-----------------------------------【头文件包含部分】--------------------------------------- // 描述:包含程序所依赖的头文件 //---------------------------------------------------------------------------------------------- #include <opencv2/opencv.hpp> #include<opencv2/highgui/highgui.hpp> #include<opencv2/imgproc/imgproc.hpp> using namespace cv; int main(int argc,char **argv) { //载入原始图 Mat src = imread(argv[1]); //工程目录下应该有一张名为1.jpg的素材图 Mat src1=src.clone(); //显示原始图 imshow("【原始图】Canny边缘检测", src); //---------------------------------------------------------------------------------- // 一、最简单的canny用法,拿到原图后直接用。 //---------------------------------------------------------------------------------- Canny( src, src, 150, 100,3 ); imshow("【效果图】Canny边缘检测", src); //---------------------------------------------------------------------------------- // 二、高阶的canny用法,转成灰度图,降噪,用canny,最后将得到的边缘作为掩码,拷贝原图到效果图上,得到彩色的边缘图 //---------------------------------------------------------------------------------- Mat dst,edge,gray; // 【1】创建与src同类型和大小的矩阵(dst) dst.create( src1.size(), src1.type() ); // 【2】将原图像转换为灰度图像 cvtColor( src1, gray, CV_BGR2GRAY ); // 【3】先用使用 3x3内核来降噪 blur( gray, edge, Size(3,3) ); // 【4】运行Canny算子 Canny( edge, edge, 3, 9,3 ); //【5】将g_dstImage内的所有元素设置为0 dst = Scalar::all(0); //【6】使用Canny算子输出的边缘图g_cannyDetectedEdges作为掩码,来将原图g_srcImage拷到目标图g_dstImage中 src1.copyTo( dst, edge);//src.copyTo( dst, detected_edges)是将src中detected_edges矩阵对应的非零部分(即边缘检测结果)复制到dst中。 //【7】显示效果图 imshow("【效果图】Canny边缘检测2", dst); waitKey(0); return 0; }
[ "123163843@qq.com" ]
123163843@qq.com
e8ff2f22307183e3d31d0cb78570d1b746d458c5
cfffeb9ab83663def46104ca18361bcfb0b74ec6
/week3_programming_challenges/1_money_change/change.cpp
85c3a4a548573d6f5ed3c2568fc627316be5dd81
[ "MIT" ]
permissive
maidahahmed/Algorithmic-Toolbox-San-Diego
db8c0db23e2eb5a34abda854bdc25fc1c35d576b
8c9cc6a12dd966927e5d8eceb0519380fb80559b
refs/heads/master
2021-03-04T06:45:10.801815
2020-02-05T16:53:04
2020-02-05T16:53:04
246,014,925
0
0
MIT
2020-03-09T11:14:07
2020-03-09T11:14:07
null
UTF-8
C++
false
false
1,410
cpp
/*Author : Abdallah Hemdan */ /***********************************************/ /* Dear online judge: * I've read the problem, and tried to solve it. * Even if you don't accept my solution, you should respect my effort. * I hope my code compiles and gets accepted. * ___ __ * |\ \|\ \ * \ \ \_\ \ * \ \ ___ \emdan * \ \ \\ \ \ * \ \__\\ \_\ * \|__| \|__| */ #include <iostream> #include <cmath> #include <string> #include <string.h> #include <stdlib.h> #include <algorithm> #include <iomanip> #include <assert.h> #include <vector> #include <cstring> #include <map> #include <deque> #include <queue> #include <stack> #include <sstream> #include <cstdio> #include <cstdlib> #include <ctime> #include <set> #include <complex> #include <list> #include <climits> #include <cctype> #include <bitset> #include <numeric> #include <array> #include <tuple> #include <stdexcept> #include <utility> #include <functional> #include <locale> #define all(v) v.begin(),v.end() #define mp make_pair #define pb push_back #define endl '\n' typedef long long int ll; //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); using namespace std; int main() { int Val; cin >> Val; int Sum = 0; Sum += Val / 10; Sum += (Val % 10) / 5; Sum += ((Val % 10) % 5); cout << Sum << endl; }
[ "noreply@github.com" ]
noreply@github.com
0459e0d368bb1df439505b46e55aac126a378601
ad10052619b7bc79d311940bd2419772c4bc8a53
/topcoder-master-2/MedalTable.cpp
addaede3443076f2c28c2ff428be34fef1c0d5c6
[]
no_license
bluepine/topcoder
3af066a5b1ac6c448c50942f98deb2aa382ba040
d300c8a349a8346dba4a5fe3b4f43b17207627a1
refs/heads/master
2021-01-19T08:15:06.539102
2014-04-02T21:10:58
2014-04-02T21:10:58
18,381,690
1
0
null
null
null
null
UTF-8
C++
false
false
4,698
cpp
// BEGIN CUT HERE // END CUT HERE #include <sstream> #include <string> #include <vector> #include <map> #include <algorithm> #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <utility> #include <set> #include <cctype> #include <queue> #include <stack> using namespace std; typedef struct country { string name; int gold; int silver; int bronze; }; bool cmp(country a, country b) { if (a.gold == b.gold) { if (a.silver == b.silver) { if (a.bronze == b.bronze) { return b.name > a.name; } else return a.bronze > b.bronze; } else return a.silver > b.silver; } else return a.gold > b.gold; } class MedalTable { public: typedef struct myst { public: int x; int y; bool operator<(const myst & a) const { if (a.y == y) return a.x > x; else return a.y > y; } }; vector <string> splits(const string _s, const string del) { vector <string> ret; string s = _s; while (!s.empty()) { size_t pos = s.find(del); string sub = ""; sub = s.substr(0, pos); ret.push_back(sub); if (pos != string::npos) pos += del.size(); s.erase(0, pos); } return ret; } vector <string> generate(vector <string> results) { vector <country> countries; vector <vector <string> > s; map <string, pair <int, pair <int, int> > > m; map <string, pair <int, pair <int, int> > >::iterator mit; for (unsigned int i=0; i<results.size(); i++) { vector <string> c = splits(results[i], " "); s.push_back(c); } for (unsigned int i=0; i<s.size(); i++) for (unsigned int j=0; j<s[i].size(); j++) m[s[i][j]] = make_pair(0, make_pair(0, 0)); for (unsigned int i=0; i<s.size(); i++) { m[s[i][0]].first++; m[s[i][1]].second.first++; m[s[i][2]].second.second++; } for (mit=m.begin(); mit!=m.end(); mit++) { country c; c.name = mit->first; c.gold = mit->second.first; c.silver = mit->second.second.first; c.bronze = mit->second.second.second; countries.push_back(c); } sort(countries.begin(), countries.end(), cmp); vector <string> ret; for (unsigned int i=0; i<countries.size(); i++) { char ch[1000]; sprintf(ch, "%s %d %d %d", countries[i].name.c_str(), countries[i].gold, countries[i].silver, countries[i].bronze); string tmp = ch; ret.push_back(tmp); } // BEGIN CUT HERE vector <myst> myv; myst tmpm; tmpm.x = 10; tmpm.y = 1; myv.push_back(tmpm); tmpm.x = 1; tmpm.y = 10; myv.push_back(tmpm); sort(myv.begin(), myv.end()); for (int i=0; i<myv.size(); i++) cout << myv[i].x << ", " << myv[i].y << endl; // END CUT HERE return ret; } // BEGIN CUT HERE public: void run_test(int Case) { if ((Case == -1) || (Case == 0)) test_case_0(); if ((Case == -1) || (Case == 1)) test_case_1(); if ((Case == -1) || (Case == 2)) test_case_2(); } private: template <typename T> string print_array(const vector<T> &V) { ostringstream os; os << "{ "; for (typename vector<T>::const_iterator iter = V.begin(); iter != V.end(); ++iter) os << '\"' << *iter << "\","; os << " }"; return os.str(); } void verify_case(int Case, const vector <string> &Expected, const vector <string> &Received) { cerr << "Test Case #" << Case << "..."; if (Expected == Received) cerr << "PASSED" << endl; else { cerr << "FAILED" << endl; cerr << "\tExpected: " << print_array(Expected) << endl; cerr << "\tReceived: " << print_array(Received) << endl; } } void test_case_0() { string Arr0[] = {"ITA JPN AUS", "KOR TPE UKR", "KOR KOR GBR", "KOR CHN TPE"}; vector <string> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); string Arr1[] = { "KOR 3 1 0", "ITA 1 0 0", "TPE 0 1 1", "CHN 0 1 0", "JPN 0 1 0", "AUS 0 0 1", "GBR 0 0 1", "UKR 0 0 1" }; vector <string> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); verify_case(0, Arg1, generate(Arg0)); } void test_case_1() { string Arr0[] = {"USA AUT ROM"}; vector <string> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); string Arr1[] = { "USA 1 0 0", "AUT 0 1 0", "ROM 0 0 1" }; vector <string> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); verify_case(1, Arg1, generate(Arg0)); } void test_case_2() { string Arr0[] = {"GER AUT SUI", "AUT SUI GER", "SUI GER AUT"}; vector <string> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); string Arr1[] = { "AUT 1 1 1", "GER 1 1 1", "SUI 1 1 1" }; vector <string> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); verify_case(2, Arg1, generate(Arg0)); } // END CUT HERE }; // BEGIN CUT HERE int main() { MedalTable ___test; ___test.run_test(-1); } // END CUT HERE
[ "1983.song.wei@gmail.com" ]
1983.song.wei@gmail.com
d1baa63cebaa28e2b9d51bf732a48a03dc04aaa5
3c301163c5b3745b296ac0b01026e03e9d17cd7b
/j04_Sub-typing_polymorphism/ex00/Sorcerer.cpp
e2689320c4dee76c52022d8e8db10f73d4cdadfb
[]
no_license
Ngoguey42/piscine_cpp
572c4994908ebe869669163e8fa89266fe0473a0
371c6f6f15e2b84991ec6aa7d5df3293a780bb9a
refs/heads/master
2016-09-06T19:26:48.226323
2015-05-01T18:01:43
2015-05-01T18:01:43
31,645,174
0
1
null
null
null
null
UTF-8
C++
false
false
3,434
cpp
// ************************************************************************** // // // // ::: :::::::: // // Sorcerer.cpp :+: :+: :+: // // +:+ +:+ +:+ // // By: ngoguey <ngoguey@student.42.fr> +#+ +:+ +#+ // // +#+#+#+#+#+ +#+ // // Created: 2015/04/10 13:58:10 by ngoguey #+# #+# // // Updated: 2015/04/10 14:01:24 by ngoguey ### ########.fr // // // // ************************************************************************** // #include <iostream> #include <cstdlib> #include "Sorcerer.hpp" #include "Victim.hpp" // ************************************************************************* // // ************************************************************ CONSTRUCTORS // Sorcerer::Sorcerer(Sorcerer const & src) : _name(src.getName()), _title(src.getTitle()) { std::cout << "[Sorcerer](src) constructor called!" << std::endl; return ; } Sorcerer::Sorcerer(std::string const name, std::string const title) : _name(name), _title(title) { std::cout << name << ", "<< title << ", is born !" << std::endl; return ; } // CONSTRUCTORS ************************************************************ // // ************************************************************************* // // ************************************************************* DESTRUCTORS // Sorcerer::~Sorcerer() { std::cout << this->_name << ", "<< this->_title << ", is dead. " "Consequences will never be the same !" << std::endl; return ; } // DESTRUCTORS ************************************************************* // // ************************************************************************* // // *************************************************************** OPERATORS // Sorcerer &Sorcerer::operator=(Sorcerer const &rhs) { std::cout << "[Sorcerer]= called!" << std::endl; this->_name = rhs.getName(); this->_title = rhs.getTitle(); return (*this); } std::ostream &operator<<(std::ostream & o, Sorcerer const & rhs) { o << "I am " << rhs.getName() << ", "<< rhs.getTitle() << ", and I like ponies !" << std::endl; return (o); } // OPERATORS *************************************************************** // // ************************************************************************* // // ***************************************************************** GETTERS // std::string const &Sorcerer::getName(void) const{return (this->_name);} std::string const &Sorcerer::getTitle(void) const{return (this->_title);} // GETTERS ***************************************************************** // // ************************************************************************* // // ***************************************************************** SETTERS // // SETTERS ***************************************************************** // // ************************************************************************* // void Sorcerer::polymorph(Victim const &v) const { v.getPolymorphed(); return ; }
[ "ngoguey@student.42.fr" ]
ngoguey@student.42.fr
c9640778220620cc65c7b2dc7063fa8ff8399b47
6bf03623fbe8c90c32ba101f9d6f110f3c654ce3
/BOJ/알고리즘 분류/배열/2953.cpp
ce8a370651c0ea6a7c21de141bc64ef032f4b591
[]
no_license
yoogle96/algorithm
6d6a6360c0b2aae2b5a0735f7e0200b6fc37544e
bcc3232c705adc53a563681eeefd89e5b706566f
refs/heads/master
2022-12-27T05:15:04.388117
2020-10-09T14:48:58
2020-10-09T14:48:58
177,144,251
0
0
null
null
null
null
UTF-8
C++
false
false
669
cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); vector<vector<int> > arr(5, vector<int>(5)); int total; int count = 1; for(int i = 0; i < 5; i++){ total = 0; for(int j = 0; j < 4; j++){ cin >> arr[i][j]; total += arr[i][j]; } arr[i][4] = total; } vector<int> max(5); max = arr[0]; for(int i = 1; i < 5; i++){ if(max[4] < arr[i][4]){ max = arr[i]; count = i+1; } } cout << count << " " << max[4]; }
[ "dmltjs851@gmail.com" ]
dmltjs851@gmail.com
a602688ce11297013db175d8453004efee85a837
61eadda573fcf8149a222c563a349392a139a50d
/BaekjoonOJ/11653.cpp
51e7d385d38adcfa5373058e5e9b0cd46f68448a
[]
no_license
samkimuel/problem-solving
1c9fee5e0dcb56689ab4cf698c9b3c02209a1653
7ef8e8b839323af13efe0fc2ae2fd1dfd3a79276
refs/heads/master
2023-06-29T12:10:43.401901
2021-08-10T16:08:23
2021-08-10T16:08:23
256,204,735
0
0
null
null
null
null
UTF-8
C++
false
false
495
cpp
/** * @file 11653.cpp * @brief 소인수분해 * @author Sam Kim (samkim2626@gmail.com) * https://www.acmicpc.net/problem/11653 */ #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; for (int i = 2; i * i <= n; i++) { while (n % i == 0) { cout << i << '\n'; n /= i; } } if (n > 1) { cout << n << '\n'; } return 0; }
[ "samkim2626@gmail.com" ]
samkim2626@gmail.com
727d3fd9bf2e2a97596e1a9a0a01aa40a061ef20
be0418b216088240c15a7128e52a4aecfe20dd30
/src/qt/askpassphrasedialog.cpp
eeac0bcc3914fcdf0b7f26bec99bd8f16c7830ac
[ "MIT" ]
permissive
cryptolog/wallet
f2428da7cb58105231360a2975991e69b6a73fd1
cef570ea93f8faeb146bad4c9ad3bb443a875049
refs/heads/master
2020-03-25T20:54:43.988830
2016-07-12T21:08:05
2016-07-12T21:08:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,905
cpp
// Copyright (c) 2011-2013 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 "askpassphrasedialog.h" #include "ui_askpassphrasedialog.h" #include "guiconstants.h" #include "walletmodel.h" #include <QMessageBox> #include <QPushButton> #include <QKeyEvent> AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) : QDialog(parent), ui(new Ui::AskPassphraseDialog), mode(mode), model(0), fCapsLock(false) { ui->setupUi(this); ui->passEdit1->setMaxLength(MAX_PASSPHRASE_SIZE); ui->passEdit2->setMaxLength(MAX_PASSPHRASE_SIZE); ui->passEdit3->setMaxLength(MAX_PASSPHRASE_SIZE); // Setup Caps Lock detection. ui->passEdit1->installEventFilter(this); ui->passEdit2->installEventFilter(this); ui->passEdit3->installEventFilter(this); switch(mode) { case Encrypt: // Ask passphrase x2 ui->passLabel1->hide(); ui->passEdit1->hide(); ui->warningLabel->setText(tr("Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.")); setWindowTitle(tr("Encrypt wallet")); break; case Unlock: // Ask passphrase ui->warningLabel->setText(tr("This operation needs your wallet passphrase to unlock the wallet.")); ui->passLabel2->hide(); ui->passEdit2->hide(); ui->passLabel3->hide(); ui->passEdit3->hide(); setWindowTitle(tr("Unlock wallet")); break; case Decrypt: // Ask passphrase ui->warningLabel->setText(tr("This operation needs your wallet passphrase to decrypt the wallet.")); ui->passLabel2->hide(); ui->passEdit2->hide(); ui->passLabel3->hide(); ui->passEdit3->hide(); setWindowTitle(tr("Decrypt wallet")); break; case ChangePass: // Ask old passphrase + new passphrase x2 setWindowTitle(tr("Change passphrase")); ui->warningLabel->setText(tr("Enter the old and new passphrase to the wallet.")); break; } textChanged(); connect(ui->passEdit1, SIGNAL(textChanged(QString)), this, SLOT(textChanged())); connect(ui->passEdit2, SIGNAL(textChanged(QString)), this, SLOT(textChanged())); connect(ui->passEdit3, SIGNAL(textChanged(QString)), this, SLOT(textChanged())); } AskPassphraseDialog::~AskPassphraseDialog() { // Attempt to overwrite text so that they do not linger around in memory ui->passEdit1->setText(QString(" ").repeated(ui->passEdit1->text().size())); ui->passEdit2->setText(QString(" ").repeated(ui->passEdit2->text().size())); ui->passEdit3->setText(QString(" ").repeated(ui->passEdit3->text().size())); delete ui; } void AskPassphraseDialog::setModel(WalletModel *model) { this->model = model; } void AskPassphraseDialog::accept() { SecureString oldpass, newpass1, newpass2; if(!model) return; oldpass.reserve(MAX_PASSPHRASE_SIZE); newpass1.reserve(MAX_PASSPHRASE_SIZE); newpass2.reserve(MAX_PASSPHRASE_SIZE); // TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string) // Alternately, find a way to make this input mlock()'d to begin with. oldpass.assign(ui->passEdit1->text().toStdString().c_str()); newpass1.assign(ui->passEdit2->text().toStdString().c_str()); newpass2.assign(ui->passEdit3->text().toStdString().c_str()); switch(mode) { case Encrypt: { if(newpass1.empty() || newpass2.empty()) { // Cannot encrypt with empty passphrase break; } QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"), tr("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COMETS</b>!") + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"), QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Cancel); if(retval == QMessageBox::Yes) { if(newpass1 == newpass2) { if(model->setWalletEncrypted(true, newpass1)) { QMessageBox::warning(this, tr("Wallet encrypted"), "<qt>" + tr("Comet will close now to finish the encryption process. " "Remember that encrypting your wallet cannot fully protect " "your comets from being stolen by malware infecting your computer.") + "<br><br><b>" + tr("IMPORTANT: Any previous backups you have made of your wallet file " "should be replaced with the newly generated, encrypted wallet file. " "For security reasons, previous backups of the unencrypted wallet file " "will become useless as soon as you start using the new, encrypted wallet.") + "</b></qt>"); QApplication::quit(); } else { QMessageBox::critical(this, tr("Wallet encryption failed"), tr("Wallet encryption failed due to an internal error. Your wallet was not encrypted.")); } QDialog::accept(); // Success } else { QMessageBox::critical(this, tr("Wallet encryption failed"), tr("The supplied passphrases do not match.")); } } else { QDialog::reject(); // Cancelled } } break; case Unlock: if(!model->setWalletLocked(false, oldpass)) { QMessageBox::critical(this, tr("Wallet unlock failed"), tr("The passphrase entered for the wallet decryption was incorrect.")); } else { QDialog::accept(); // Success } break; case Decrypt: if(!model->setWalletEncrypted(false, oldpass)) { QMessageBox::critical(this, tr("Wallet decryption failed"), tr("The passphrase entered for the wallet decryption was incorrect.")); } else { QDialog::accept(); // Success } break; case ChangePass: if(newpass1 == newpass2) { if(model->changePassphrase(oldpass, newpass1)) { QMessageBox::information(this, tr("Wallet encrypted"), tr("Wallet passphrase was successfully changed.")); QDialog::accept(); // Success } else { QMessageBox::critical(this, tr("Wallet encryption failed"), tr("The passphrase entered for the wallet decryption was incorrect.")); } } else { QMessageBox::critical(this, tr("Wallet encryption failed"), tr("The supplied passphrases do not match.")); } break; } } void AskPassphraseDialog::textChanged() { // Validate input, set Ok button to enabled when acceptable bool acceptable = false; switch(mode) { case Encrypt: // New passphrase x2 acceptable = !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty(); break; case Unlock: // Old passphrase x1 case Decrypt: acceptable = !ui->passEdit1->text().isEmpty(); break; case ChangePass: // Old passphrase x1, new passphrase x2 acceptable = !ui->passEdit1->text().isEmpty() && !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty(); break; } ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(acceptable); } bool AskPassphraseDialog::event(QEvent *event) { // Detect Caps Lock key press. if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast<QKeyEvent *>(event); if (ke->key() == Qt::Key_CapsLock) { fCapsLock = !fCapsLock; } if (fCapsLock) { ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!")); } else { ui->capsLabel->clear(); } } return QWidget::event(event); } bool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event) { /* Detect Caps Lock. * There is no good OS-independent way to check a key state in Qt, but we * can detect Caps Lock by checking for the following condition: * Shift key is down and the result is a lower case character, or * Shift key is not down and the result is an upper case character. */ if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast<QKeyEvent *>(event); QString str = ke->text(); if (str.length() != 0) { const QChar *psz = str.unicode(); bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0; if ((fShift && *psz >= 'a' && *psz <= 'z') || (!fShift && *psz >= 'A' && *psz <= 'Z')) { fCapsLock = true; ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!")); } else if (psz->isLetter()) { fCapsLock = false; ui->capsLabel->clear(); } } } return QDialog::eventFilter(object, event); }
[ "info@cometcoin.com" ]
info@cometcoin.com
2f9408f580e8db0e11cf8dd853c7950b1d77720a
880557ea1db4b385e7dca82afb82818e7e47f5dd
/tests/coreTests/obbTests.cpp
4696276941a965038053c25eb0cb67df843afcce
[]
no_license
fscur/phi
45db0903463add36108be948381511a7f74f4c8d
4b147bbd589b0bec89f59fa3ed843b927b6b0004
refs/heads/master
2021-01-20T11:44:18.781654
2017-02-22T13:53:22
2017-02-22T13:53:22
82,651,381
1
0
null
null
null
null
UTF-8
C++
false
false
13,072
cpp
#include <precompiled.h> #include <gtest\gtest.h> #include <core\obb.h> using namespace phi; namespace obbTests { void assertVector(vec3 target, vec3 correct) { EXPECT_NEAR(target.x, correct.x, phi::DECIMAL_TRUNCATION); EXPECT_NEAR(target.y, correct.y, phi::DECIMAL_TRUNCATION); EXPECT_NEAR(target.z, correct.z, phi::DECIMAL_TRUNCATION); } class unitObbFixture : public testing::Test { public: obb* obb0 = nullptr; obb* obb1 = nullptr; public: void SetUp() { auto center0 = vec3(0.0f, 0.0f, 0.0f); auto axisX0 = vec3(1.0f, 0.0f, 0.0f); auto axisY0 = vec3(0.0f, 1.0f, 0.0f); auto axisZ0 = vec3(0.0f, 0.0f, 1.0f); auto halfSizes0 = vec3(0.5f, 0.5f, 0.5f); obb0 = new obb(center0, axisX0, axisY0, axisZ0, halfSizes0); auto center1 = vec3(0.0f, 0.0f, 0.0f); auto axisX1 = vec3(1.0f, 0.0f, 0.0f); auto axisY1 = vec3(0.0f, 1.0f, 0.0f); auto axisZ1 = vec3(0.0f, 0.0f, 1.0f); auto halfSizes1 = vec3(0.5f, 0.5f, 0.5f); obb1 = new obb(center1, axisX1, axisY1, axisZ1, halfSizes1); } void TearDown() { safeDelete(obb0); safeDelete(obb1); } }; TEST_F(unitObbFixture, intersects_touchingOnAxisX_colliding) { //Arrange obb0->center = vec3(-0.5f, 0.0f, 0.0f); obb1->center = vec3(0.5f, 0.0f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_touchingOnAxisY_colliding) { //Arrange obb0->center = vec3(0.0f, -0.5f, 0.0f); obb1->center = vec3(0.0f, 0.5f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_touchingOnAxisZ_colliding) { //Arrange obb0->center = vec3(0.0f, 0.0f, -0.5f); obb1->center = vec3(0.0f, 0.0f, 0.5f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_separatedOnAxisX_notColliding) { //Arrange obb0->center = vec3(-1.0f, 0.0f, 0.0f); obb1->center = vec3(1.0f, 0.0f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_FALSE(colliding); } TEST_F(unitObbFixture, intersects_separatedOnAxisY_notColliding) { //Arrange obb0->center = vec3(0.0f, -1.0f, 0.0f); obb1->center = vec3(0.0f, 1.0f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_FALSE(colliding); } TEST_F(unitObbFixture, intersects_separatedOnAxisZ_notColliding) { //Arrange obb0->center = vec3(0.0f, 0.0f, -1.0f); obb1->center = vec3(0.0f, 0.0f, 1.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_FALSE(colliding); } TEST_F(unitObbFixture, intersects_intersectingOnAxisX_colliding) { //Arrange obb1->center = vec3(0.5f, 0.0f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_intersectingOnAxisY_colliding) { //Arrange obb1->center = vec3(0.0f, 0.5f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_intersectingOnAxisZ_colliding) { //Arrange obb1->center = vec3(0.0f, 0.0f, 0.5f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_obb1RotatedOnAxisX_colliding) { //Arrange auto rotation = glm::angleAxis(PI_OVER_4, vec3(1.0f, 0.0f, 0.0f)); obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; obb1->center = vec3(1.0f, 0.0f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_obb1RotatedOnAxisY_colliding) { //Arrange auto rotation = glm::angleAxis(PI_OVER_4, vec3(0.0f, 1.0f, 0.0f)); obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; obb1->center = vec3(1.0f, 0.0f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_obb1RotatedOnAxisZ_colliding) { //Arrange auto rotation = glm::angleAxis(PI_OVER_4, vec3(0.0f, 0.0f, 1.0f)); obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; obb1->center = vec3(1.0f, 0.0f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_touchingObb0RotatedOnAxisZObb1RotatedOnAxisZ_colliding) { //Arrange auto rotation = glm::angleAxis(PI_OVER_4, vec3(0.0f, 0.0f, 1.0f)); obb0->axes[0] = rotation * obb0->axes[0]; obb0->axes[1] = rotation * obb0->axes[1]; obb0->axes[2] = rotation * obb0->axes[2]; obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; obb1->center = rotation * vec3(0.0f, 0.5f, 0.0f) * 2.0f; //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_almostNotTouchingObb0RotatedOnAxisZObb1RotatedOnAxisZ_colliding) { //Arrange auto rotation = glm::angleAxis(PI_OVER_4, vec3(0.0f, 0.0f, 1.0f)); obb0->axes[0] = rotation * obb0->axes[0]; obb0->axes[1] = rotation * obb0->axes[1]; obb0->axes[2] = rotation * obb0->axes[2]; obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; obb1->center = rotation * vec3(0.0f, 0.5f, 0.0f) * 1.9f; //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_almostTouchingObb0RotatedOnAxisZObb1RotatedOnAxisZ_notColliding) { //Arrange auto rotation = glm::angleAxis(PI_OVER_4, vec3(0.0f, 0.0f, 1.0f)); obb0->axes[0] = rotation * obb0->axes[0]; obb0->axes[1] = rotation * obb0->axes[1]; obb0->axes[2] = rotation * obb0->axes[2]; obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; obb1->center = rotation * vec3(0.0f, 0.5f, 0.0f) * 2.1f; //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_FALSE(colliding); } TEST_F(unitObbFixture, intersects_intersectingExactly_colliding) { //Arrange //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_intersectingExactlyBothRotated_colliding) { //Arrange auto rotation = glm::angleAxis(PI_OVER_4, glm::normalize(vec3(1.0f, 1.0f, 1.0f))); obb0->axes[0] = rotation * obb0->axes[0]; obb0->axes[1] = rotation * obb0->axes[1]; obb0->axes[2] = rotation * obb0->axes[2]; obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_obb1EntirelyInsideObb0_colliding) { //Arrange obb0->halfSizes = vec3(1.0f, 1.0f, 1.0f); auto rotation = glm::angleAxis(PI_OVER_4, glm::normalize(vec3(1.0f, 1.0f, 1.0f))); obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_obb0EntirelyInsideObb1_colliding) { //Arrange obb0->halfSizes = vec3(0.25f, 0.25f, 0.25f); auto rotation = glm::angleAxis(PI_OVER_4, glm::normalize(vec3(1.0f, 1.0f, 1.0f))); obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_smallerRotatedParallelepipedInsideBiggerParallelepiped_colliding) { //Arrange obb0->halfSizes = vec3(1.0f, 0.5f, 0.5f); auto rotation = glm::angleAxis(PI_OVER_2, glm::normalize(vec3(0.0f, 1.0f, 0.0f))); obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; obb1->halfSizes = vec3(1.0f, 0.25f, 0.5f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, intersects_smallerRotatedParallelepipedNotInsideBiggerParallelepiped_notColliding) { //Arrange obb0->halfSizes = vec3(1.0f, 0.5f, 0.5f); auto rotation = glm::angleAxis(PI_OVER_2, glm::normalize(vec3(0.0f, 1.0f, 0.0f))); obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; obb1->halfSizes = vec3(1.0f, 0.25f, 0.5f); obb1->center = vec3(0.0f, 0.8f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_FALSE(colliding); } TEST_F(unitObbFixture, intersects_secondObbRotatedInsideFirst_colliding) { //Arrange auto rotation = glm::angleAxis(PI_OVER_4, glm::normalize(vec3(0.0f, 1.0f, 0.0f))); obb1->axes[0] = rotation * obb1->axes[0]; obb1->axes[1] = rotation * obb1->axes[1]; obb1->axes[2] = rotation * obb1->axes[2]; obb1->center = vec3(0.5f, 0.0f, 0.0f); //Act auto colliding = obb::intersects(*obb0, *obb1); //Assert ASSERT_TRUE(colliding); } TEST_F(unitObbFixture, getPositionAt_xAxis_correctPosition) { //Arrange //Act auto position = obb0->getPositionAt(vec3(1.0f, 0.0f, 0.0f)); //Assert assertVector(position, vec3(0.5f, 0.0f, 0.0f)); } TEST_F(unitObbFixture, getPositionAt_yAxisDirectionOfBiggerObb_correctPosition) { //Arrange obb0->halfSizes = vec3(0.5f, 1.5f, 0.25f); //Act auto position = obb0->getPositionAt(vec3(0.0f, 1.0f, 0.0f)); //Assert assertVector(position, vec3(0.0f, 1.5f, 0.0f)); } TEST_F(unitObbFixture, getPositionAt_zAxisDirectionOfTranslatedBiggerObb_correctPosition) { //Arrange obb0->halfSizes = vec3(0.5f, 1.5f, 0.25f); obb0->center = vec3(1.0f, 0.5f, 2.5f); //Act auto position = obb0->getPositionAt(vec3(0.0f, 0.0f, 1.0f)); //Assert assertVector(position, vec3(1.0f, 0.5f, 2.75f)); } TEST_F(unitObbFixture, getPositionAt_xyDirection_correctPosition) { //Arrange //Act auto position = obb0->getPositionAt(glm::normalize(vec3(1.0f, 1.0f, 0.0f))); //Assert assertVector(position, vec3(0.5f, 0.5f, 0.0f)); } TEST_F(unitObbFixture, getPositionAt_negativeXYZDirection_correctPosition) { //Arrange //Act auto position = obb0->getPositionAt(glm::normalize(-vec3(1.0f))); //Assert assertVector(position, vec3(-0.5f, -0.5f, -0.5f)); } TEST_F(unitObbFixture, getPositionAt_xyzDirectionOfBiggerObb_correctPosition) { //Arrange obb0->halfSizes = vec3(0.5f, 1.5f, 0.25f); //Act auto position = obb0->getPositionAt(glm::normalize(vec3(1.0f))); //Assert assertVector(position, vec3(0.5f, 1.5f, 0.25f)); } }
[ "fmtoigo@gmail.com" ]
fmtoigo@gmail.com
2a1664957bb0e9d797134390568450101e55720d
67e4ba3f090cd37d3366030d65d9346020d32d6d
/Main.cpp
bc48defa5ba1fa4f0ef37dfec24ac076dcd6ee27
[]
no_license
JPitters/Sonar-Rover-with-Beaglebone-Claw
e04fb9ba45c84f0eceb8a60d1d85d116c2c5d73b
8f7792bc38add53ee2c9ccca34b17a66090fadcb
refs/heads/master
2020-04-21T22:13:45.465911
2019-02-09T19:21:34
2019-02-09T19:21:34
169,904,069
1
0
null
null
null
null
UTF-8
C++
false
false
5,051
cpp
#include "./MySocket.h" #include "./Pkt_Def.h" bool ExeComplete = false; void cmdThread() { char ipaddr[128], chport[128], chmaxbuff[128], command[28], direction[28], chDur[300];; int port, maxbuffsize, pktcount = 0;; char *ptr; std::cout << "Enter ipaddr: " << std::endl; std::cin.getline(ipaddr, sizeof(ipaddr)); std::cout << "Enter port: " << std::endl; std::cin.getline(chport, sizeof(chport)); port = atoi(chport); std::cout << "Enter max buffer size: " << std::endl; std::cin.getline(chmaxbuff, sizeof(chmaxbuff)); maxbuffsize = atoi(chmaxbuff); MySocket CmdClient(SocketType::CLIENT, ipaddr, port, ConnectionType::TCP, maxbuffsize); //creating mysocket CmdClient.ConnectTCP(); //3-way handshake MotorBody generalCmd; PktDef txPkt, rxPkt; while (!ExeComplete) { std::cout << "Creating packet now.." << std::endl; std::cout << "Enter the command type(d,s,a,c)" << std::endl; //drive,sleep,arm,claw std::cin.getline(command, sizeof(command)); if (strcmp(command, "d") == 0) { //---DRIVE BIT SET TO 1 IN HEADER txPkt.SetCmd(DRIVE); //-------------------MOTOR BODY-------------------- std::cout << "Setting up a motor body.." << std::endl; //----------------SETS UP DIRECTION---------------- std::cout << "Please enter the direction(f,b,r,l): " << std::endl; std::cin.getline(direction, sizeof(direction)); if (strcmp(direction, "f") == 0) { generalCmd.Direction = FORWARD; } else if (strcmp(direction, "b") == 0) { generalCmd.Direction = BACKWARD; } else if (strcmp(direction, "r") == 0) { generalCmd.Direction = RIGHT; } else if (strcmp(direction, "l") == 0) { generalCmd.Direction = LEFT; } //----------------SETS UP DURATION---------------- std::cout << "Please enter the duration: " << std::endl; //Asks user for std::cin.getline(chDur, sizeof(chDur)); generalCmd.Duration = atoi(chDur); txPkt.SetBodyData((char *)&generalCmd, sizeof(MotorBody)); //sets the body pktcount++; txPkt.SetPktCount(pktcount); txPkt.CalcCRC(); ptr = txPkt.GenPacket(); CmdClient.SendData(ptr, txPkt.GetLength()); } else if (strcmp(command, "s") == 0) { txPkt.SetCmd(SLEEP); ExeComplete = true; generalCmd.Duration = 0; pktcount++; txPkt.SetPktCount(pktcount); txPkt.CalcCRC(); ptr = txPkt.GenPacket(); CmdClient.SendData(ptr, txPkt.GetLength()); } else if (strcmp(command, "a") == 0) { txPkt.SetCmd(ARM); //Sets the header std::cout << "Setting up a motor body.." << std::endl; std::cout << "Please enter the direction(u,d): " << std::endl; //forward,backwords, right, left std::cin.getline(direction, sizeof(direction)); if (strcmp(direction, "u") == 0) { generalCmd.Direction = UP; } else if (strcmp(direction, "d") == 0) { generalCmd.Direction = DOWN; } generalCmd.Duration = 0; txPkt.SetBodyData((char *)&generalCmd, 2); //sets the body pktcount++; txPkt.SetPktCount(pktcount); txPkt.CalcCRC(); ptr = txPkt.GenPacket(); CmdClient.SendData(ptr, txPkt.GetLength()); } else if (strcmp(command, "c") == 0) { txPkt.SetCmd(CLAW); //Sets the header std::cout << "Setting up a motor body.." << std::endl; std::cout << "Please enter the option(o,c): " << std::endl; //forward,backwords, right, left std::cin.getline(direction, sizeof(direction)); if (strcmp(direction, "o") == 0) { generalCmd.Direction = OPEN; } else if (strcmp(direction, "c") == 0) { generalCmd.Direction = CLOSE; } generalCmd.Duration = 0; txPkt.SetBodyData((char *)&generalCmd, 2); //sets the body pktcount++; txPkt.SetPktCount(pktcount); txPkt.CalcCRC(); ptr = txPkt.GenPacket(); CmdClient.SendData(ptr, txPkt.GetLength()); } char* rxBuffer = new char[maxbuffsize]; memset(rxBuffer, 0, maxbuffsize); int a = CmdClient.GetData(rxBuffer); PktDef recvB(rxBuffer); //delete[] & generalCmd; } CmdClient.DisconnectTCP(); } void teleThread() { char ipaddr[128], chport[128], chmaxbuff[128], buffer[128], direction[28], chDur[300]; int port, maxbuffsize, motorbodyDuration, pktcount = 0; char *ptr; std::cout << "Enter ipaddr: " << std::endl; std::cin.getline(ipaddr, sizeof(ipaddr)); std::cout << "Enter port(27501): " << std::endl; std::cin.getline(chport, sizeof(chport)); port = atoi(chport); std::cout << "Enter max buffer size: " << std::endl; std::cin.getline(chmaxbuff, sizeof(chmaxbuff)); maxbuffsize = atoi(chmaxbuff); MySocket teleClient(SocketType::CLIENT, ipaddr, port, ConnectionType::TCP, maxbuffsize); //creating mysocket teleClient.ConnectTCP(); //3-way handshake while (!ExeComplete) { int a = teleClient.GetData(buffer); PktDef rxPkt(buffer); std::cout << rxPkt << std::endl; } teleClient.DisconnectTCP(); } int main() { std::cout << "What thread do you want to open?(c,t)" << std::endl; char answer; answer = std::cin.get(); std::cin.ignore(); if (answer == 'c') std::thread(&cmdThread).detach(); if (answer == 't') std::thread(&teleThread).detach(); while (true) {} return 0; }
[ "noreply@github.com" ]
noreply@github.com
86f990859a95bb3664caa3a0699ef7ddd2f77637
dd656493066344e70123776c2cc31dd13f31c1d8
/MITK/Core/Code/Algorithms/mitkSurfaceToSurfaceFilter.cpp
8cfcdac91f2b25782ef9d8315927710de00930d4
[]
no_license
david-guerrero/MITK
e9832b830cbcdd94030d2969aaed45da841ffc8c
e5fbc9993f7a7032fc936f29bc59ca296b4945ce
refs/heads/master
2020-04-24T19:08:37.405353
2011-11-13T22:25:21
2011-11-13T22:25:21
2,372,730
0
1
null
null
null
null
UTF-8
C++
false
false
2,307
cpp
/*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-12 19:56:03 +0200 (Di, 12 Mai 2009) $ Version: $Revision: 17179 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkSurfaceToSurfaceFilter.h" #include "mitkSurface.h" mitk::SurfaceToSurfaceFilter::SurfaceToSurfaceFilter() : SurfaceSource() { } mitk::SurfaceToSurfaceFilter::~SurfaceToSurfaceFilter() { } void mitk::SurfaceToSurfaceFilter::SetInput( const mitk::Surface* surface ) { this->SetInput( 0, const_cast<mitk::Surface*>( surface ) ); } void mitk::SurfaceToSurfaceFilter::SetInput( unsigned int idx, const mitk::Surface* surface ) { if ( this->GetInput(idx) != surface ) { this->SetNthInput( idx, const_cast<mitk::Surface*>( surface ) ); this->CreateOutputsForAllInputs(idx); this->Modified(); } } const mitk::Surface* mitk::SurfaceToSurfaceFilter::GetInput() { if (this->GetNumberOfInputs() < 1) return NULL; return static_cast<const mitk::Surface*>(this->ProcessObject::GetInput(0)); } const mitk::Surface* mitk::SurfaceToSurfaceFilter::GetInput( unsigned int idx) { if (this->GetNumberOfInputs() < 1) return NULL; return static_cast<const mitk::Surface*>(this->ProcessObject::GetInput(idx)); } void mitk::SurfaceToSurfaceFilter::CreateOutputsForAllInputs(unsigned int /*idx*/) { this->SetNumberOfOutputs( this->GetNumberOfInputs() ); for (unsigned int idx = 0; idx < this->GetNumberOfOutputs(); ++idx) { if (this->GetOutput(idx) == NULL) { DataObjectPointer newOutput = this->MakeOutput(idx); this->SetNthOutput(idx, newOutput); } this->GetOutput( idx )->Graft( this->GetInput( idx) ); } this->Modified(); } void mitk::SurfaceToSurfaceFilter::RemoveInputs(mitk::Surface* input) { this->RemoveInput(input); }
[ "dav@live.ca" ]
dav@live.ca
882f30eda8f5f00053215ebc7c310e78d25254d0
e13b597d8095c2587430338f4fcd3625bde09796
/code/common/LogFile.cpp
f639b1d7d8b1cf412c736fc6fdd2a6d861550277
[]
no_license
presscad/recordman_control
a5c15ba2f1a0e798f8f5ee3aa6b45db33bde0f83
dd4bfc11c2945367dc14701dad5009a68debe2bb
refs/heads/master
2021-04-17T09:52:14.965918
2016-05-10T00:58:30
2016-05-10T00:58:30
null
0
0
null
null
null
null
GB18030
C++
false
false
16,820
cpp
// LogFile.cpp: implementation of the CString class. // ////////////////////////////////////////////////////////////////////// #pragma warning(disable : 4275) #include "LogFile.h" ////////////////////////////////////////////////////////////////////////// // Class CLogFile 实现 ////////////////////////////////////////////////////////////////////////// CLogFile::CLogFile() { m_File = NULL; bzero(m_FileName,FILE_NAME_MAX_LEN); bzero(m_szLogPath,FILE_NAME_MAX_LEN); //默认日志级别为 error级 m_nLevel = CLogFile::error; // 默认日志文件大小 m_nMaxSize = MAX_LOG_FILE_SIZE; // 当前日志大小 m_nCurrenSize = 0; //为CLock指定输出调试信息时的名称 m_Lock.init("CLogFile"); } CLogFile::~CLogFile() { // close file, if still opened Close(); m_Lock.del(); } /************************************************************* 函 数 名:Open() 功能概要:默认以日期作为文件名打开 返 回 值: BOOL FALSE : 失败 TRUE : 成功 参 数:无 ***************************************************************/ BOOL CLogFile::Open() { SYSTIME sysTime; GetSysTime(sysTime); char chFileName[FILE_NAME_MAX_LEN] = ""; // create file name sprintf(chFileName,"%04d%02d%02d.txt",sysTime.wYear, sysTime.wMonth, sysTime.wDay); return (CLogFile::Open(chFileName)); } /************************************************************* 函 数 名:Open() 功能概要:打开指定文件名称的文件 返 回 值: BOOL FALSE : 失败 TRUE : 成功 参 数: const char * pszFileName :指定的文件名 ***************************************************************/ BOOL CLogFile::Open(const char * pszFileName) { // get ownership if( !m_Lock.lock()){ printf("get ownership failed when open log file:%s\n",pszFileName); return FALSE; } // if already open close ! if (m_File != NULL) Close(); int nPathLen = strlen(m_szLogPath); if(nPathLen > 0) { //create save path CreateSavePath(m_szLogPath); } //save filename bzero(m_FileName,FILE_NAME_MAX_LEN); int nNameLen =( ( strlen(pszFileName) > FILE_NAME_MAX_LEN ) ? FILE_NAME_MAX_LEN : strlen(pszFileName) ); strncpy(m_FileName, pszFileName,nNameLen); //path + name char chFullPath[FILE_NAME_MAX_LEN] = ""; sprintf(chFullPath,"%s%s",m_szLogPath,pszFileName); // new memory m_File = new CCommonFile; if(m_File == NULL){ m_Lock.unlock(); fprintf(stderr,"allocate memory for CXJFile failed when open '%s'\n",m_FileName); return FALSE; } // open file if (!m_File->Open(chFullPath, CCommonFile::modeWrite|CCommonFile::modeCreate)) { // failed to open file fprintf(stderr,"can't open log file'%s'\n",m_FileName); delete m_File; m_File = NULL; m_Lock.unlock(); return FALSE; } // init the current size m_nCurrenSize = m_File->GetLength(); m_Lock.unlock(); return TRUE; } /************************************************************* 函 数 名:Close() 功能概要:关闭文件 返 回 值: 关闭成功或失败 参 数:无 ***************************************************************/ bool CLogFile::Close() { // get ownership if( !m_Lock.lock()){ printf("get ownership failed when close log file:%s\n",m_FileName); return false; } // file not open... if (m_File == NULL){ m_Lock.unlock(); return true; } // close file m_File->Close(); // delete class delete m_File; m_File = NULL; //释放互斥体使用权 m_Lock.unlock(); return true; } /************************************************************* 函 数 名:Flush() 功能概要:写入日志 返 回 值: void 参 数: const char * data : 要写入的内容 nCurLevel : 当前日志级别 ***************************************************************/ void CLogFile::Flush(const char *data,int nCurLevel) { // file not opened if (m_File == NULL) return; // assert the file exist //path + name char chFullPath[FILE_NAME_MAX_LEN] = ""; sprintf(chFullPath,"%s%s",m_szLogPath,m_FileName); if(xj_pathfile_exist(chFullPath) != 0){ printf("file:%s not exist,recreate\n",chFullPath); Close(); char chFileName[FILE_NAME_MAX_LEN] = ""; sprintf(chFileName,"%s",m_FileName); if(!CLogFile::Open(chFileName)) return; printf("file:%s recreate success\n",chFileName); } //get sys time char szDate[20] = ""; SYSTIME sysTime; GetSysTime(sysTime); sprintf(szDate,"%04d-%02d-%02d %02d:%02d:%02d", sysTime.wYear,sysTime.wMonth,sysTime.wDay,\ sysTime.wHour,sysTime.wMinute,sysTime.wSecond); // get log level char szLogLevel[20]=""; switch(nCurLevel) { case CLogFile::error: strcpy(szLogLevel,"错误级:"); break; case CLogFile::trace: strcpy(szLogLevel,"跟踪级:"); break; case CLogFile::warning: strcpy(szLogLevel,"警告级:"); break; default: strcpy(szLogLevel,"无级别:"); break; } // get ownership if( !m_Lock.lock() ){ //printf("get ownership failed when wirte log to %s,give up wirte\n",m_FileName); return; } // 防止文件被其他线程关闭 if (m_File == NULL){ m_Lock.unlock(); return; } // assert the file size if valid if(m_nCurrenSize >= m_nMaxSize){ if (!Clear()){ m_Lock.unlock(); return; } } UINT n =0; try{ // // write the log level // n = m_File->Write(szLogLevel,strlen(szLogLevel)); // m_nCurrenSize += n; // // // write time to file // n = m_File->Write(szDate,19); // m_nCurrenSize += n; // // // write ": " to file // n = m_File->Write(": ",3); // m_nCurrenSize += n; // // // write data to file // n = m_File->Write(data, strlen(data)); // m_nCurrenSize += n; // // // write \r\n to file // n = m_File->Write("\r\n",2); // m_nCurrenSize += n; string strContext(szLogLevel); strContext += szDate; strContext += ": "; strContext += data; strContext += "\r\n"; n = m_File->Write(strContext.c_str(),strContext.size()); m_File->Flush(); m_nCurrenSize += n; } catch(...) { m_Lock.unlock(); return; } //release ownership m_Lock.unlock(); } /************************************************************* 函 数 名:Flush() 功能概要:写入指定长度的日志 返 回 值: void 参 数: const char * data : 要写入的内容 nLen : 日志长度 nCurLevel : 当前日志级别 ***************************************************************/ void CLogFile::Flush( const char* data,int nLen,int nCurLevel) { // file not opened if (m_File == NULL) return; // assert the file exist //path + name char chFullPath[FILE_NAME_MAX_LEN] = ""; sprintf(chFullPath,"%s%s",m_szLogPath,m_FileName); if(xj_pathfile_exist(chFullPath) != 0){ printf("file:%s not exist,recreate\n",chFullPath); Close(); char chFileName[FILE_NAME_MAX_LEN] = ""; sprintf(chFileName,"%s",m_FileName); if(!CLogFile::Open(chFileName)) return; printf("file:%s recreate success\n",chFileName); } //get sys time char szDate[20] = ""; SYSTIME sysTime; GetSysTime(sysTime); sprintf(szDate,"%04d-%02d-%02d %02d:%02d:%02d", sysTime.wYear,sysTime.wMonth,sysTime.wDay,\ sysTime.wHour,sysTime.wMinute,sysTime.wSecond); // get log level char szLogLevel[20]=""; switch(nCurLevel) { case CLogFile::error: strcpy(szLogLevel,"错误级:"); break; case CLogFile::trace: strcpy(szLogLevel,"跟踪级:"); break; case CLogFile::warning: strcpy(szLogLevel,"警告级:"); break; default: strcpy(szLogLevel,"无级别:"); break; } // get ownership if( !m_Lock.lock() ){ //printf("get ownership failed when wirte log to %s,give up wirte\n",m_FileName); return; } // 防止文件被其他线程关闭 if (m_File == NULL){ m_Lock.unlock(); return; } // assert the file size if valid if(m_nCurrenSize >= m_nMaxSize){ if (!Clear()){ m_Lock.unlock(); return; } } UINT n =0; try{ // // write the log level // n = m_File->Write(szLogLevel,strlen(szLogLevel)); // m_nCurrenSize += n; // // // write time to file // n = m_File->Write(szDate,19); // m_nCurrenSize += n; // // // write ": " to file // n = m_File->Write(": ",3); // m_nCurrenSize += n; // // // write data to file // n = m_File->Write(data, nLen); // m_nCurrenSize += n; // // // write \r\n to file // n = m_File->Write("\r\n",2); // m_nCurrenSize += n; string strContext(szLogLevel); strContext += szDate; strContext += ": "; strContext.append(data,nLen); strContext += "\r\n"; n = m_File->Write(strContext.c_str(),strContext.size()); m_File->Flush(); m_nCurrenSize += n; } catch(...) { m_Lock.unlock(); return; } //release ownership m_Lock.unlock(); } /************************************************************* 函 数 名:FormatAdd() 功能概要:格式化写入(仅支持常用的s,d,l,u,f,c格式) 返 回 值: int 成功返回写入直接数据,失败返回-1 参 数: int nCurLevel : 该条日志的级别 const char * formatString : 要写入的format串 ... : 可变参数列表 ***************************************************************/ int CLogFile::FormatAdd(int nCurLevel,const char * formatString, ...) { // if the format string is NULL ,return if (formatString == NULL) { return -1; } va_list argList; // Set va_list to the beginning of optional arguments va_start(argList, formatString); const char * ptr = formatString; char * str = NULL; //save the max len of the formatstring int nMaxLen = 0; while(*ptr != '\0') { str = NULL; if(*ptr == '%') { switch(*(ptr+1)) { case 's': case 'S': str = va_arg(argList,char*); if( NULL == str) nMaxLen ++; else nMaxLen += strlen(str); ptr++; break; case 'c': case 'C': va_arg(argList,char); nMaxLen +=2; ptr++; break; case 'd': case 'D': va_arg(argList, int); nMaxLen +=11; ptr++; break; case 'u': case 'U': va_arg(argList, unsigned int); nMaxLen +=10; ptr++; break; case 'l': case 'L': ptr++; if(*(ptr+1) == 'd') { va_arg(argList, long); nMaxLen +=11; } else if(*(ptr+1) == 'u') { va_arg(argList, unsigned long); nMaxLen +=10; } ptr++; break; case 'f': case 'F': va_arg(argList, double); nMaxLen += 31; ptr++; break; case 'x': case 'X': va_arg(argList, void*); nMaxLen += 2*sizeof(void*); ptr++; break; default: nMaxLen+=1; } } // if(*ptr == '%') else { nMaxLen +=1; } // Increment pointer.. ptr++; } // end va_list va_end(argList); // allocate memory //char * pchar = new char[nMaxLen+1]; //if(pchar == NULL) // return 0; nMaxLen += 255; // 防止特殊情况长度计算错误; string strDes=""; strDes.resize(nMaxLen); try{ // get parament va_start(argList, formatString); // format //vsprintf(pchar, formatString, argList); /* * ----- commented by qingch 3/12/2009 ------ vsprintf((char*)strDes.c_str(), formatString, argList); */ vsprintf((char*)&strDes[0], formatString, argList); // if the curlevel >= setted level,not write // the number of level more bigger indicate the level is more lower if(nCurLevel <= m_nLevel) { // tty output //printf("%s\n",pchar); printf("%s\n",strDes.c_str()); // write file //Flush(pchar); Flush(strDes.c_str(),nCurLevel); } //if(pchar != NULL) // delete [] pchar; va_end(argList); } catch(...) { return 0; } return nMaxLen; } /************************************************************* 函 数 名:SetLogLevel() 功能概要:设置日志级别 返 回 值: bool 设置成功或失败 参 数: int nLevel : 当前日志级别 **************************************************************/ bool CLogFile::SetLogLevel(int nLevel) { // get ownership if( !m_Lock.lock() ) { return false; } m_nLevel = nLevel; m_Lock.unlock(); return true; } /************************************************************* 函 数 名:GetLogLevel() 功能概要:获得设置的日志级别 返 回 值: int : 日志级别 参 数:无 **************************************************************/ int CLogFile::GetLogLevel() { int nLogLevel = -1; // get ownership if( !m_Lock.lock() ) { return nLogLevel; } nLogLevel = m_nLevel; m_Lock.unlock(); return nLogLevel; } /************************************************************* 函 数 名:SetLogPath() 功能概要:设置日志存放路径 返 回 值: bool 设置成功或失败 参 数: const char * pszPath : 路径名 **************************************************************/ bool CLogFile::SetLogPath(const char * pszPath) { // get ownership if( !m_Lock.lock() ) { return false; } bzero(m_szLogPath,FILE_NAME_MAX_LEN); strcpy(m_szLogPath,pszPath); const char * pchar = m_szLogPath; int nlen = strlen(m_szLogPath); if(nlen > 0) { if( (strncmp( (pchar+nlen-1),"/",1) != 0) && (strncmp( (pchar+nlen-1),"\\",1) != 0) ) { m_szLogPath[nlen]='/'; m_szLogPath[nlen+1] = '\0'; } } m_Lock.unlock(); return true; } /************************************************************* 函 数 名:SetLogSize() 功能概要:设置日志文件大小(单位:Kb) 返 回 值: bool 设置成功或失败 参 数: **************************************************************/ bool CLogFile::SetLogSize(long nSize) { // get ownership if( !m_Lock.lock() ) { return false; } if(nSize >= 0) m_nMaxSize = nSize * 1024; m_Lock.unlock(); return true; } /************************************************************* 函 数 名:Clear() 功能概要:清除日志内容 返 回 值: bool 清除成功或失败 参 数:无 **************************************************************/ bool CLogFile::Clear() { // get ownership if( !m_Lock.lock() ) { return false; } // close file before deleting if (m_File == NULL) { m_Lock.unlock(); return false; } // close file m_File->Close(); /* * ----- commented by qingch 6/1/2009 ------ // delete class delete m_File; m_File = NULL; */ //path + fileName char chFullPath[FILE_NAME_MAX_LEN] = ""; sprintf(chFullPath,"%s%s",m_szLogPath,m_FileName); /* * ----- commented by qingch 6/1/2009 ------ // remove log file if(remove(chFullPath) < 0) { m_Lock.unlock(); fprintf(stderr,"del log file %s failed,reason:%s\n",chFullPath,strerror(errno)); return false; } */ // open file if (!m_File->Open(chFullPath, CCommonFile::modeCreate)) { // failed to open file fprintf(stderr,"can't open log file'%s'\n",m_FileName); m_Lock.unlock(); return FALSE; } // init the current size m_nCurrenSize = m_File->GetLength(); m_Lock.unlock(); /* * ----- commented by qingch 6/1/2009 ------ // create new file bzero(chFullPath,FILE_NAME_MAX_LEN); strcpy(chFullPath,m_FileName); Open(chFullPath); */ return true; } /************************************************************* 函 数 名:Add() 功能概要:按指定的级别写入字符串 返 回 值: void 参 数: const char * pchLog : 要写入的字符串 int nCurLevle : 该条日志级别 **************************************************************/ void CLogFile::Add(const char * pchLog,int nCurLevel) { // if the curlevel >= setted level,not write // the number of level more bigger indicate the level is more lower if(nCurLevel <= m_nLevel) { //tty output printf("%s\n",pchLog); Flush(pchLog,nCurLevel); } } /************************************************************* 函 数 名:AddFixLen() 功能概要:按照指定的长度记录指定缓冲区的内容 返 回 值: void 参 数: const char * pchLog : 要写入的字符串 int nLen : 内容长度 int nCurLevle : 该条日志级别 **************************************************************/ void CLogFile::AddFixLen(const char * pchLog,int nLen,int nCurLevel) { if( (nLen <= 0) || (pchLog == NULL)) return ; // if the curlevel >= setted level,not write // the number of level more bigger indicate the level is more lower if(nCurLevel <= m_nLevel) { //tty output printf("%s\n",pchLog); Flush(pchLog,nLen,nCurLevel); } }
[ "157974839@qq.com" ]
157974839@qq.com
ec165e538a0055883704837349ace6051d4e6197
6ca168bd50a29b935372067fd9fcc545fa3c444b
/Impressionist/sCircleBrush.cpp
1a3529c69260a66ae208b4c20d042280b693e270
[]
no_license
szn1992/Computer-Graphics
2926e06d34dd834fee4167b984dbc47fdc1ab82a
2415c63329de6b301b550a73411c57d75d94aaf1
refs/heads/master
2016-09-06T09:44:15.077880
2015-06-18T08:23:42
2015-06-18T08:23:42
37,647,021
0
0
null
null
null
null
UTF-8
C++
false
false
1,791
cpp
// // sCircleBrush.cpp // // The implementation of version 2 Scattered Circle Brush. It is a kind of ImpBrush. All your brush implementations // will look like the file with the different GL primitive calls. // #include "impressionistDoc.h" #include "impressionistUI.h" #include "sCircleBrush.h" #define PI 3.1415 extern float frand(); SCircleBrush::SCircleBrush(ImpressionistDoc* pDoc, char* name) : ImpBrush(pDoc,name) { } void SCircleBrush::BrushBegin(const ImpBrush::Point source, const ImpBrush::Point target) { ImpressionistDoc* pDoc = GetDocument(); ImpressionistUI* dlg=pDoc->m_pUI; int size = pDoc->getSize(); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glClearColor(0.0, 0.0, 0.0, 0.0); glPointSize( (float)size ); BrushMove( source, target ); } void SCircleBrush::BrushMove(const ImpBrush::Point source, const ImpBrush::Point target) { ImpressionistDoc* pDoc = GetDocument(); ImpressionistUI* dlg=pDoc->m_pUI; if ( pDoc == NULL ) { printf( "PointBrush::BrushMove document is NULL\n" ); return; } int size = pDoc->getSize(); if (dlg->getRand() == 1) { size = rand() % size + 1; } int div = 36; float radius = size / 2; float x, y; float center_x, center_y; float alpha = pDoc->getAlpha(); for (int i = 0; i < 10; i++){ center_x = target.x - size / 2 + rand() % size; center_y = target.y - size / 2 + rand() % size; glBegin(GL_POLYGON); for (int j = 0; j < div; j++){ x = center_x + radius * cos(2 * PI * j / div); y = center_y + radius * sin(2 * PI * j / div); ImpBrush::Point tmp(x, y); SetColor(tmp, alpha); glVertex2f(x, y); } glEnd(); } } void SCircleBrush::BrushEnd(const ImpBrush::Point source, const ImpBrush::Point target) { // do nothing so far glDisable(GL_BLEND); }
[ "szng1992@gmail.com" ]
szng1992@gmail.com
97f6c67ccaf117fbc62a8cc83ec20da548c4bf36
464aa9d7d6c4906b083e6c3da12341504b626404
/src/tools/visualexporter/mfxexp.ipp
890ebf9594f65a498894a5afad1218c8bfeccd4c
[]
no_license
v2v3v4/BigWorld-Engine-2.0.1
3a6fdbb7e08a3e09bcf1fd82f06c1d3f29b84f7d
481e69a837a9f6d63f298a4f24d423b6329226c6
refs/heads/master
2023-01-13T03:49:54.244109
2022-12-25T14:21:30
2022-12-25T14:21:30
163,719,991
182
167
null
null
null
null
UTF-8
C++
false
false
1,076
ipp
/****************************************************************************** BigWorld Technology Copyright BigWorld Pty, Ltd. All Rights Reserved. Commercial in confidence. WARNING: This computer program is protected by copyright law and international treaties. Unauthorized use, reproduction or distribution of this program, or any portion of this program, may result in the imposition of civil and criminal penalties as provided by law. ******************************************************************************/ #ifdef CODE_INLINE #define INLINE inline #else #define INLINE #endif // INLINE void MFXExport::inlineFunction() // { // } INLINE TimeValue MFXExport::staticFrame( void ) { return settings_.staticFrame() * GetTicksPerFrame(); } INLINE Point3 MFXExport::applyUnitScale( const Point3& p ) { return p * (float)GetMasterScale( UNITS_CENTIMETERS ) / 100; } INLINE Matrix3 MFXExport::applyUnitScale( const Matrix3& m ) { Matrix3 m2 = m; m2.SetRow( 3, m.GetRow( 3 ) * (float)GetMasterScale( UNITS_CENTIMETERS ) / 100 ); return m2; } /*mfxexp.ipp*/
[ "terran.erre@mail.ru" ]
terran.erre@mail.ru
b08b2860f5620ba8f5d56c610b05aee63d29c60f
5bc96f9f57fd7a676bb36633dc261ee888f2af8b
/tour_generator.h
13c8577cdbc213d325a571cbb88d95d482c15c74
[]
no_license
bdwoods/hamcycles
2c61938b830e5fec4794d451a6ee3dd40168a873
c90b74eb7c3591abbb675912f44969e6cc966449
refs/heads/master
2021-01-10T19:42:18.848613
2014-05-13T01:00:06
2014-05-13T01:00:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
410
h
#ifndef TOUR_GENERATOR_H #define TOUR_GENERATOR_H #include <iostream> #include <vector> #include "instance.h" using namespace std; struct TourList { vector<vector<int>> tourList; }; //TourList generateTours(Instance inst); TourList Backtrack(const Instance& inst); void tourTXT(TourList tList, string fName); bool isEdge(int a, int b, const Instance& inst); //PartialTour augment(PartialTour part); #endif
[ "bradleywoods@hotmail.com" ]
bradleywoods@hotmail.com
24ce23c7c389159b0b6d194300d52abaac1401c9
5885fd1418db54cc4b699c809cd44e625f7e23fc
/bad_code_from_long_ago/just2017_4/j.cpp
71755ad67c993bac8eecf80933d88c06b96cbcaa
[]
no_license
ehnryx/acm
c5f294a2e287a6d7003c61ee134696b2a11e9f3b
c706120236a3e55ba2aea10fb5c3daa5c1055118
refs/heads/master
2023-08-31T13:19:49.707328
2023-08-29T01:49:32
2023-08-29T01:49:32
131,941,068
2
0
null
null
null
null
UTF-8
C++
false
false
969
cpp
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES //#define DEBUG //#define USE_MAGIC_IO #define ll long long #define pii pair<int,int> #define pdd pair<double,double> #define ldouble long double #define nl '\n' const ll MOD = 1e9+7; const int INF = 0x3f3f3f3f; const ll INFLL = 0x3f3f3f3f3f3f3f3f; struct Int { ll x; Int(ll n=0) { x = n%MOD; } Int operator * (const Int& other) { return Int(x*other.x); } Int operator + (const Int& other) { return Int(x+other.x); } int get() { return x; } }; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; int arr[100001]; Int ans[100001]; int T; cin >> T; while (T--) { cin >> n; arr[0] = 0; for (int i = 1; i <= n; i++) { cin >> arr[i]; } ans[0] = Int(0); for (int i = 1; i <= n; i++) { ans[i] = ans[i-1] * Int(arr[i]+1) + Int(arr[i]); } cout << ans[n].get() << nl; } return 0; }
[ "henryxia9999@gmail.com" ]
henryxia9999@gmail.com
cf6d52ea8bd4baa903c0b322f96a0ddd843bbae0
197a41e91822d4bc572d3bd5d59d01726cf77477
/AutoMiner/MouseOperation.h
e1ed2a266b2ab273ebdac3639b22a795504fd5a7
[]
no_license
vimar-gu/AutoMiner
e2ab8a4d52752d4f9cbbbd9fb98e60ccdd9c93f4
4dc5b9e60561efac99b9359b4e44d5fdb76045b3
refs/heads/master
2021-09-15T06:51:15.838180
2018-05-28T04:01:28
2018-05-28T04:01:28
null
0
0
null
null
null
null
UTF-8
C++
false
false
359
h
#pragma once #include <iostream> #include <Windows.h> #include "singleton.h" using namespace std; class CMouseOperation { public: CMouseOperation(); pair<int, int> getMousePos(); void goClick(int i, int j); private: int left_; int right_; int top_; int bottom_; int mouseX_; int mouseY_; }; typedef NormalSingleton<CMouseOperation> MouseOperation;
[ "583390908@qq.com" ]
583390908@qq.com
a9e355f66340e6a10becef52949f7977b8633a1a
556ac98a9a05a62df98450d73c848cea2816eb7f
/include/blood/sys/sysinfo_win.hxx
6b7b6a3bb317a7168f38cba569ae260a7d38c016
[ "MIT" ]
permissive
osolovyoff/blood
ac0458ac86692f07695423e3334ad36053f82b79
1c6f6c54e937e8d7064f72f32cbbcc8fdaa2677d
refs/heads/master
2021-05-30T21:12:33.915896
2016-02-12T21:58:01
2016-02-12T21:58:01
null
0
0
null
null
null
null
UTF-8
C++
false
false
518
hxx
#include <string> class SystemInfoWin { #if defined(WIN32) || defined(MSVS) public: static std::string getUserName(); static std::string getUserPath(); static std::string getAppPath(); static std::string getLocalPath(); static std::string getTempPath(); static std::string getCurrPath(); static unsigned long getHardDriveSerialNumber(); static std::string getUniqueId(); static std::string getMachineName(); private: static const unsigned int ms_max_path = 255; #endif };
[ "solovyov.cxx@gmail.com" ]
solovyov.cxx@gmail.com
aa799b5ccd5219c98bdea7b89e945e06906444ec
b7f22e51856f4989b970961f794f1c435f9b8f78
/src/library/aliases.cpp
9001cae8f9c007ff5ad69ad31c36cc8dc0d316f4
[ "Apache-2.0" ]
permissive
soonhokong/lean
cb8aa01055ffe2af0fb99a16b4cda8463b882cd1
38607e3eb57f57f77c0ac114ad169e9e4262e24f
refs/heads/master
2021-01-21T00:01:24.081719
2015-12-22T06:45:37
2016-10-10T18:02:27
11,513,992
2
0
null
2014-06-03T02:38:22
2013-07-18T21:17:15
C++
UTF-8
C++
false
false
8,196
cpp
/* Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #include <utility> #include <algorithm> #include "util/rb_map.h" #include "util/sstream.h" #include "kernel/abstract.h" #include "kernel/instantiate.h" #include "library/expr_lt.h" #include "library/aliases.h" #include "library/placeholder.h" #include "library/scoped_ext.h" #include "library/protected.h" namespace lean { struct aliases_ext; static aliases_ext const & get_extension(environment const & env); static environment update(environment const & env, aliases_ext const & ext); struct aliases_ext : public environment_extension { struct state { bool m_in_section; name_map<list<name>> m_aliases; name_map<name> m_inv_aliases; name_map<name> m_level_aliases; name_map<name> m_inv_level_aliases; state():m_in_section(false) {} void add_expr_alias(name const & a, name const & e, bool overwrite) { auto it = m_aliases.find(a); if (it && !overwrite) m_aliases.insert(a, cons(e, filter(*it, [&](name const & t) { return t != e; }))); else m_aliases.insert(a, to_list(e)); m_inv_aliases.insert(e, a); } }; state m_state; list<state> m_scopes; void add_expr_alias(name const & a, name const & e, bool overwrite) { m_state.add_expr_alias(a, e, overwrite); } void add_level_alias(name const & a, name const & l) { auto it = m_state.m_level_aliases.find(a); if (it) throw exception(sstream() << "universe level alias '" << a << "' shadows existing alias"); m_state.m_level_aliases.insert(a, l); m_state.m_inv_level_aliases.insert(l, a); } list<state> add_expr_alias_rec_core(list<state> const & scopes, name const & a, name const & e, bool overwrite) { if (empty(scopes)) { return scopes; } else { state s = head(scopes); s.add_expr_alias(a, e, overwrite); if (s.m_in_section) { return cons(s, add_expr_alias_rec_core(tail(scopes), a, e, overwrite)); } else { return cons(s, tail(scopes)); } } } void add_expr_alias_rec(name const & a, name const & e, bool overwrite = false) { if (m_state.m_in_section) { m_scopes = add_expr_alias_rec_core(m_scopes, a, e, overwrite); } add_expr_alias(a, e, overwrite); } void push(bool in_section) { m_scopes = cons(m_state, m_scopes); m_state.m_in_section = in_section; } void pop() { m_state = head(m_scopes); m_scopes = tail(m_scopes); } void for_each_expr_alias(std::function<void(name const &, list<name> const &)> const & fn) { m_state.m_aliases.for_each(fn); } static environment using_namespace(environment const & env, io_state const &, name const &) { // do nothing, aliases are treated in a special way in the frontend. return env; } static environment export_namespace(environment const & env, io_state const &, name const &) { // do nothing, aliases are treated in a special way in the frontend. return env; } static environment push_scope(environment const & env, io_state const &, scope_kind k) { aliases_ext ext = get_extension(env); ext.push(k != scope_kind::Namespace); environment new_env = update(env, ext); return new_env; } static environment pop_scope(environment const & env, io_state const &, scope_kind) { aliases_ext ext = get_extension(env); ext.pop(); return update(env, ext); } }; static name * g_aliases = nullptr; struct aliases_ext_reg { unsigned m_ext_id; aliases_ext_reg() { register_scoped_ext(*g_aliases, aliases_ext::using_namespace, aliases_ext::export_namespace, aliases_ext::push_scope, aliases_ext::pop_scope); m_ext_id = environment::register_extension(std::make_shared<aliases_ext>()); } }; static aliases_ext_reg * g_ext = nullptr; static aliases_ext const & get_extension(environment const & env) { return static_cast<aliases_ext const &>(env.get_extension(g_ext->m_ext_id)); } static environment update(environment const & env, aliases_ext const & ext) { return env.update(g_ext->m_ext_id, std::make_shared<aliases_ext>(ext)); } environment add_expr_alias(environment const & env, name const & a, name const & e, bool overwrite) { aliases_ext ext = get_extension(env); ext.add_expr_alias(a, e, overwrite); return update(env, ext); } environment add_expr_alias_rec(environment const & env, name const & a, name const & e, bool overwrite) { aliases_ext ext = get_extension(env); ext.add_expr_alias_rec(a, e, overwrite); return update(env, ext); } optional<name> is_expr_aliased(environment const & env, name const & t) { auto it = get_extension(env).m_state.m_inv_aliases.find(t); return it ? optional<name>(*it) : optional<name>(); } list<name> get_expr_aliases(environment const & env, name const & n) { return ptr_to_list(get_extension(env).m_state.m_aliases.find(n)); } static void check_no_shadow(environment const & env, name const & a) { if (env.is_universe(a)) throw exception(sstream() << "universe level alias '" << a << "' shadows existing global universe level"); } environment add_level_alias(environment const & env, name const & a, name const & l) { check_no_shadow(env, a); aliases_ext ext = get_extension(env); ext.add_level_alias(a, l); return update(env, ext); } optional<name> is_level_aliased(environment const & env, name const & l) { auto it = get_extension(env).m_state.m_inv_level_aliases.find(l); return it ? optional<name>(*it) : optional<name>(); } optional<name> get_level_alias(environment const & env, name const & n) { auto it = get_extension(env).m_state.m_level_aliases.find(n); return it ? optional<name>(*it) : optional<name>(); } // Return true iff \c n is (prefix + ex) for some ex in exceptions bool is_exception(name const & n, name const & prefix, unsigned num_exceptions, name const * exceptions) { return std::any_of(exceptions, exceptions + num_exceptions, [&](name const & ex) { return (prefix + ex) == n; }); } environment add_aliases(environment const & env, name const & prefix, name const & new_prefix, unsigned num_exceptions, name const * exceptions, bool overwrite) { aliases_ext ext = get_extension(env); env.for_each_declaration([&](declaration const & d) { if (is_prefix_of(prefix, d.get_name()) && !is_exception(d.get_name(), prefix, num_exceptions, exceptions)) { name a = d.get_name().replace_prefix(prefix, new_prefix); if (!(is_protected(env, d.get_name()) && a.is_atomic()) && !(a.is_anonymous())) ext.add_expr_alias(a, d.get_name(), overwrite); } }); env.for_each_universe([&](name const & u) { if (is_prefix_of(prefix, u) && !is_exception(u, prefix, num_exceptions, exceptions)) { name a = u.replace_prefix(prefix, new_prefix); if (env.is_universe(a)) throw exception(sstream() << "universe level alias '" << a << "' shadows existing global universe level"); if (!(is_protected(env, u) && a.is_atomic()) && !a.is_anonymous()) ext.add_level_alias(a, u); } }); return update(env, ext); } void for_each_expr_alias(environment const & env, std::function<void(name const &, list<name> const &)> const & fn) { aliases_ext ext = get_extension(env); ext.for_each_expr_alias(fn); } void initialize_aliases() { g_aliases = new name("alias"); g_ext = new aliases_ext_reg(); } void finalize_aliases() { delete g_ext; delete g_aliases; } }
[ "leonardo@microsoft.com" ]
leonardo@microsoft.com
adeeedc93801223cf2b611d3c91d58e4ce4cba2e
187f6bb6b568e8bb42bafab8f81133d4ad5f383b
/Siv3D/src/Siv3D/Script/Bind/ScriptGlobalAudio.cpp
356e73ae98981a8ae3f48722fe4404e153294a17
[ "MIT" ]
permissive
Reputeless/OpenSiv3D
f2938ea8f5c8de2e6e3b200046943f3e5398a2a1
7d02aa0f4824d1ecbd50ea1c00737cc932332b0a
refs/heads/main
2023-07-29T06:57:44.541422
2023-07-13T03:41:37
2023-07-13T03:41:37
306,929,779
0
0
MIT
2021-09-02T10:37:00
2020-10-24T16:55:13
C++
UTF-8
C++
false
false
4,803
cpp
//----------------------------------------------- // // This file is part of the Siv3D Engine. // // Copyright (c) 2008-2023 Ryo Suzuki // Copyright (c) 2016-2023 OpenSiv3D Project // // Licensed under the MIT License. // //----------------------------------------------- # include <Siv3D/Script.hpp> # include <Siv3D/GlobalAudio.hpp> # include "ScriptArray.hpp" namespace s3d { using namespace AngelScript; static CScriptArray* GlobalAudioGetSamples() { asITypeInfo* typeID = asGetActiveContext()->GetEngine()->GetTypeInfoByDecl("Array<float>"); const Array<float> samples = GlobalAudio::GetSamples(); if (void* mem = std::malloc(samples.size_bytes() + sizeof(asUINT))) { *(asUINT*)mem = static_cast<asUINT>(samples.size()); std::memcpy(((asUINT*)mem) + 1, samples.data(), samples.size_bytes()); const auto p = CScriptArray::Create(typeID, mem); std::free(mem); return p; } else { return nullptr; } } static CScriptArray* GlobalAudioBusGetSamples(MixBus busIndex) { asITypeInfo* typeID = asGetActiveContext()->GetEngine()->GetTypeInfoByDecl("Array<float>"); const Array<float> samples = GlobalAudio::BusGetSamples(busIndex); if (void* mem = std::malloc(samples.size_bytes() + sizeof(asUINT))) { *(asUINT*)mem = static_cast<asUINT>(samples.size()); std::memcpy(((asUINT*)mem) + 1, samples.data(), samples.size_bytes()); const auto p = CScriptArray::Create(typeID, mem); std::free(mem); return p; } else { return nullptr; } } void RegisterGlobalAudio(asIScriptEngine* engine) { [[maybe_unused]] int32 r = 0; r = engine->SetDefaultNamespace("GlobalAudio"); assert(r >= 0); { r = engine->RegisterGlobalFunction("size_t GetActiveVoiceCount()", asFUNCTION(GlobalAudio::GetActiveVoiceCount), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void PauseAll()", asFUNCTION(GlobalAudio::PauseAll), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void ResumeAll()", asFUNCTION(GlobalAudio::ResumeAll), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("double GetVolume()", asFUNCTION(GlobalAudio::GetVolume), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void SetVolume(double)", asFUNCTION(GlobalAudio::SetVolume), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void FadeVolume(double, const Duration& in)", asFUNCTION(GlobalAudio::FadeVolume), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("Array<float>@ GetSamples()", asFUNCTION(GlobalAudioGetSamples), asCALL_CDECL); assert(r >= 0); //GetSamples(Array<float>& in); // ... r = engine->RegisterGlobalFunction("Array<float>@ BusGetSamples(MixBus busIndex)", asFUNCTION(GlobalAudioBusGetSamples), asCALL_CDECL); assert(r >= 0); // ... r = engine->RegisterGlobalFunction("double BusGetVolume(MixBus)", asFUNCTION(GlobalAudio::BusGetVolume), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void BusSetVolume(MixBus, double)", asFUNCTION(GlobalAudio::BusSetVolume), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void BusFadeVolume(MixBus, double, const Duration& in)", asFUNCTION(GlobalAudio::BusFadeVolume), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void BusClearFilter(MixBus, size_t)", asFUNCTION(GlobalAudio::BusClearFilter), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void BusSetLowPassFilter(MixBus busIndex, size_t filterIndex, double cutoffFrequency, double resonance, double wet = 1.0)", asFUNCTION(GlobalAudio::BusSetLowPassFilter), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void BusSetHighPassFilter(MixBus busIndex, size_t filterIndex, double cutoffFrequency, double resonance, double wet = 1.0)", asFUNCTION(GlobalAudio::BusSetHighPassFilter), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void BusSetEchoFilter(MixBus busIndex, size_t filterIndex, double delay, double decay, double wet = 1.0)", asFUNCTION(GlobalAudio::BusSetEchoFilter), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void BusSetReverbFilter(MixBus busIndex, size_t filterIndex, bool freeze, double roomSize, double damp, double width, double wet = 1.0)", asFUNCTION(GlobalAudio::BusSetReverbFilter), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("void BusSetPitchShiftFilter(MixBus busIndex, size_t filterIndex, double pitchShift)", asFUNCTION(GlobalAudio::BusSetPitchShiftFilter), asCALL_CDECL); assert(r >= 0); r = engine->RegisterGlobalFunction("bool SupportsPitchShift()", asFUNCTION(GlobalAudio::SupportsPitchShift), asCALL_CDECL); assert(r >= 0); } r = engine->SetDefaultNamespace(""); assert(r >= 0); } }
[ "reputeless+github@gmail.com" ]
reputeless+github@gmail.com
957b71b608c9fa903d77d1c71cad3b607178f30d
d120d3135f4e7aa53b637ea6637c376adf90171a
/src/fdstream.hpp
a5bd9db12b67d01e00c0fe1fe343973b01436bcd
[]
no_license
i6o6i/SimpleWeb
e1d38e1680d04dc5780a1296a14bacf0c8530e12
d42c1faa98a5b34613a478494cedd691a1e3577a
refs/heads/main
2023-03-22T12:35:52.511930
2021-03-21T08:44:40
2021-03-21T08:44:40
343,071,675
0
0
null
null
null
null
UTF-8
C++
false
false
2,665
hpp
#ifndef FDSTREAM_HPP #define FDSTREAM_HPP #include <istream> #include <errno.h> #include <ostream> #include <streambuf> #include <cstdio> #include <iostream> #include <cstring> #ifdef _MSC_VER #include <io.h> #else #include <unistd.h> #endif class fdbuf: public std::streambuf { private: static const int pbSize=4; static const int bufSize=1024; char buffer[bufSize+pbSize]; int fd_; public: fdbuf(int fd):fd_(fd){ setg(buffer+pbSize, buffer+pbSize, buffer+pbSize); } int fd() { return fd_; } int buffersize() { return bufSize; } protected: virtual int_type underflow(){ #ifndef _MSC_VER using std::memcpy; #endif if(gptr()<egptr()){ return *gptr(); } int numPutback; numPutback = gptr()- eback(); if(numPutback > pbSize){ numPutback = pbSize; } memcpy(buffer+pbSize-numPutback,gptr()-numPutback,numPutback); int num; #ifdef DEBUG //std::cerr<<"call read() for fd: "<<fd_<<'\n'; #endif num= read(fd_,buffer+pbSize,bufSize); if(num<=0){ #ifdef DEBUG //std::cerr<<"read() for fd:"<<fd_<<" return "<<num<<'\n'; //std::cerr<<fd_<<::strerror(errno)<<'\n'; //std::cerr<<fd_<<" "<<"fdstream buffer content:" << buffer+pbSize<<'\n'; #endif return EOF; } #ifdef DEBUG //std::cerr<<"read() for fd:"<<fd_<<" complete\n"; #endif setg(buffer+pbSize-numPutback, buffer+pbSize, buffer+pbSize+num); return *gptr(); } /** * @note off must not exceed the buffer range */ virtual pos_type seekoff(off_type off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in) { char *ptr=0; switch(static_cast<int>(way)){ case std::ios_base::beg: ptr=eback() +off;break; case std::ios_base::cur: ptr=gptr() +off;break; case std::ios_base::end: ptr=egptr() +off;break; } if(ptr !=nullptr){ setg(eback(),ptr,egptr()); return ptr - buffer -pbSize ; } else return -1; } virtual int_type overflow(int_type c){ if(c != EOF){ char z=c; if(write(fd_,&z,1)!=1){ return EOF; } } return c; } virtual std::streamsize xsputn(const char *s, std::streamsize num){ #ifdef DEBUG std::cerr<<"write "<<num<<" bytes to "<<"fd : "<<fd_<<'\n'; #endif return write(fd_,s,num); } }; class fdostream: virtual public std::ostream { protected: fdbuf buf; public: fdostream(int fd):std::ostream(0),buf(fd){ rdbuf(&buf); } }; class fdistream : public std::istream { protected: fdbuf buf; public: fdistream(int fd): std::istream(0), buf(fd){ rdbuf(&buf); } }; class fdstream : public fdistream, public fdostream { public: fdstream(int fd): fdistream(fd),fdostream(fd) { rdbuf(static_cast<fdostream *>(this)->rdbuf()); } }; #endif
[ "gzhw734@gmail.com" ]
gzhw734@gmail.com
18aa9435b028d02b49dcf9331e0ef8d54e5850ea
b6fe88492c0a32ae5f4f6d1620843dcb45630279
/tengine/physics/bullet_physics.cpp
13b8d99429a54cbb685ba643163d3a2c6153e816
[ "BSD-2-Clause" ]
permissive
BSVino/CodenameInfinite
3b04446917548bce10f61050a4bae7b662be66d7
41f90835bc1a98698ceedc8140c00e427610f9f6
refs/heads/master
2020-04-09T17:32:41.590486
2012-11-30T21:04:41
2012-11-30T21:04:41
2,578,026
13
1
null
null
null
null
UTF-8
C++
false
false
34,672
cpp
#include "bullet_physics.h" #include <BulletCollision/CollisionDispatch/btGhostObject.h> #include <game/gameserver.h> #include <game/entities/character.h> #include <models/models.h> #include <toys/toy.h> #include <tinker/profiler.h> #include <tinker/application.h> #include <tinker/cvar.h> #include "physics_debugdraw.h" CBulletPhysics::CBulletPhysics() { // Allocate all memory up front to avoid reallocations m_aEntityList.set_capacity(GameServer()->GetMaxEntities()); m_pCollisionConfiguration = new btDefaultCollisionConfiguration(); m_pDispatcher = new btCollisionDispatcher(m_pCollisionConfiguration); m_pBroadphase = new btDbvtBroadphase(); m_pBroadphase->getOverlappingPairCache()->setInternalGhostPairCallback(m_pGhostPairCallback = new btGhostPairCallback()); m_pDynamicsWorld = new btDiscreteDynamicsWorld(m_pDispatcher, m_pBroadphase, NULL, m_pCollisionConfiguration); m_pDynamicsWorld->setGravity(btVector3(0, -9.8f, 0)); m_pDynamicsWorld->setForceUpdateAllAabbs(false); m_pDebugDrawer = NULL; } CBulletPhysics::~CBulletPhysics() { delete m_pDynamicsWorld; for (tmap<size_t, CCollisionMesh>::iterator it = m_apCollisionMeshes.begin(); it != m_apCollisionMeshes.end(); it++) { delete it->second.m_pCollisionShape; delete it->second.m_pIndexVertexArray; } delete m_pBroadphase; delete m_pGhostPairCallback; delete m_pDispatcher; delete m_pCollisionConfiguration; if (m_pDebugDrawer) delete m_pDebugDrawer; } void CBulletPhysics::AddEntity(CBaseEntity* pEntity, collision_type_t eCollisionType) { TAssert(eCollisionType != CT_NONE); if (eCollisionType == CT_NONE) return; TAssert(pEntity); if (!pEntity) return; size_t iHandle = pEntity->GetHandle(); if (m_aEntityList.size() <= iHandle) m_aEntityList.resize(iHandle+1); CPhysicsEntity* pPhysicsEntity = &m_aEntityList[iHandle]; pPhysicsEntity->m_eCollisionType = eCollisionType; pPhysicsEntity->m_oMotionState.m_hEntity = pEntity; pPhysicsEntity->m_oMotionState.m_pPhysics = this; if (eCollisionType == CT_CHARACTER) { pPhysicsEntity->m_bCenterMassOffset = true; AABB r = pEntity->GetPhysBoundingBox(); float flRadiusX = r.m_vecMaxs.x - r.Center().x; float flRadiusZ = r.m_vecMaxs.z - r.Center().z; float flRadius = flRadiusX; if (flRadiusZ > flRadiusX) flRadius = flRadiusZ; float flHeight = r.m_vecMaxs.y - r.m_vecMins.y; CCharacter* pCharacter = dynamic_cast<CCharacter*>(pEntity); tstring sIdentifier; if (pEntity->GetModel()) sIdentifier = pEntity->GetModel()->m_sFilename; else sIdentifier = pEntity->GetClassName(); auto it = m_apCharacterShapes.find(sIdentifier); if (it == m_apCharacterShapes.end()) { if (pCharacter->UsePhysicsModelForController()) { TAssert(pEntity->GetModelID() != ~0); Vector vecHalf = pEntity->GetModel()->m_aabbPhysBoundingBox.m_vecMaxs - pEntity->GetModel()->m_aabbPhysBoundingBox.Center(); m_apCharacterShapes[sIdentifier] = new btBoxShape(ToBTVector(vecHalf)); } else { TAssert(flHeight >= flRadius*2); // Couldn't very well make a capsule this way could we? m_apCharacterShapes[sIdentifier] = new btCapsuleShape(flRadius, flHeight - flRadius*2); } } #ifdef _DEBUG btCapsuleShape* pCapsuleShape = dynamic_cast<btCapsuleShape*>(m_apCharacterShapes[sIdentifier]); if (pCapsuleShape) { // Varying character sizes not yet supported! TAssert(fabs(pCapsuleShape->getRadius() - flRadius) < 0.00001f); TAssert(fabs(pCapsuleShape->getHalfHeight()*2 - flRadius) - flHeight < 0.001f); } #endif btConvexShape* pConvexShape = m_apCharacterShapes[sIdentifier]; btTransform mTransform; mTransform.setIdentity(); Matrix4x4 mGlobalTransform = pEntity->GetPhysicsTransform(); mTransform.setFromOpenGLMatrix(&mGlobalTransform.m[0][0]); pPhysicsEntity->m_pGhostObject = new btPairCachingGhostObject(); pPhysicsEntity->m_pGhostObject->setWorldTransform(mTransform); pPhysicsEntity->m_pGhostObject->setCollisionShape(pConvexShape); pPhysicsEntity->m_pGhostObject->setCollisionFlags(btCollisionObject::CF_CHARACTER_OBJECT); pPhysicsEntity->m_pGhostObject->setUserPointer((void*)iHandle); float flStepHeight = 0.2f; if (pCharacter) flStepHeight = (float)pCharacter->GetMaxStepHeight(); pPhysicsEntity->m_pCharacterController = new CCharacterController(pCharacter, pPhysicsEntity->m_pGhostObject, pConvexShape, flStepHeight); m_pDynamicsWorld->addCollisionObject(pPhysicsEntity->m_pGhostObject, pEntity->GetCollisionGroup(), GetMaskForGroup(pEntity->GetCollisionGroup())); m_pDynamicsWorld->addAction(pPhysicsEntity->m_pCharacterController); } else if (eCollisionType == CT_TRIGGER) { btCollisionShape* pCollisionShape; pPhysicsEntity->m_bCenterMassOffset = true; AABB aabbBoundingBox; if (pEntity->GetModelID() != ~0) aabbBoundingBox = pEntity->GetModel()->m_aabbPhysBoundingBox; else aabbBoundingBox = pEntity->GetVisBoundingBox(); aabbBoundingBox.m_vecMins += pEntity->GetGlobalOrigin(); aabbBoundingBox.m_vecMaxs += pEntity->GetGlobalOrigin(); Vector vecHalf = (aabbBoundingBox.m_vecMaxs - aabbBoundingBox.Center()) * pEntity->GetScale(); pCollisionShape = new btBoxShape(ToBTVector(vecHalf)); TAssert(pCollisionShape); btTransform mTransform; mTransform.setIdentity(); if (pEntity->GetModelID() != ~0) mTransform.setFromOpenGLMatrix(&pEntity->GetPhysicsTransform().m[0][0]); else mTransform.setOrigin(ToBTVector(aabbBoundingBox.Center())); btVector3 vecLocalInertia(0, 0, 0); pPhysicsEntity->m_pGhostObject = new btPairCachingGhostObject(); pPhysicsEntity->m_pGhostObject->setWorldTransform(mTransform); pPhysicsEntity->m_pGhostObject->setCollisionShape(pCollisionShape); pPhysicsEntity->m_pGhostObject->setCollisionFlags(btCollisionObject::CF_STATIC_OBJECT); pPhysicsEntity->m_pGhostObject->setUserPointer((void*)iHandle); pPhysicsEntity->m_pGhostObject->setCollisionFlags(pPhysicsEntity->m_pGhostObject->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); pPhysicsEntity->m_pGhostObject->setActivationState(DISABLE_DEACTIVATION); pPhysicsEntity->m_pTriggerController = new CTriggerController(pEntity, pPhysicsEntity->m_pGhostObject); m_pDynamicsWorld->addCollisionObject(pPhysicsEntity->m_pGhostObject, pEntity->GetCollisionGroup(), GetMaskForGroup(pEntity->GetCollisionGroup())); m_pDynamicsWorld->addAction(pPhysicsEntity->m_pTriggerController); } else { if (eCollisionType == CT_STATIC_MESH) { if (pEntity->GetModelID() != ~0) AddModel(pEntity, eCollisionType, pEntity->GetModelID()); else AddShape(pEntity, eCollisionType); } else if (eCollisionType == CT_KINEMATIC) { AddModel(pEntity, eCollisionType, pEntity->GetModelID()); } else { TAssert(!"Unimplemented collision type"); } } } void CBulletPhysics::AddShape(class CBaseEntity* pEntity, collision_type_t eCollisionType) { CPhysicsEntity* pPhysicsEntity = &m_aEntityList[pEntity->GetHandle()]; btCollisionShape* pCollisionShape; pPhysicsEntity->m_bCenterMassOffset = true; Vector vecHalf = pEntity->GetPhysBoundingBox().m_vecMaxs-pEntity->GetPhysBoundingBox().Center(); pCollisionShape = new btBoxShape(ToBTVector(vecHalf)); btTransform mTransform; mTransform.setIdentity(); mTransform.setFromOpenGLMatrix((Matrix4x4)pEntity->GetPhysicsTransform()); btVector3 vecLocalInertia(0, 0, 0); btRigidBody::btRigidBodyConstructionInfo rbInfo(0, &pPhysicsEntity->m_oMotionState, pCollisionShape, vecLocalInertia); pPhysicsEntity->m_apPhysicsShapes.push_back(new btRigidBody(rbInfo)); pPhysicsEntity->m_apPhysicsShapes.back()->setUserPointer((void*)pEntity->GetHandle()); pPhysicsEntity->m_apPhysicsShapes.back()->setWorldTransform(mTransform); if (eCollisionType == CT_KINEMATIC) { pPhysicsEntity->m_apPhysicsShapes.back()->setCollisionFlags((pPhysicsEntity->m_pRigidBody?pPhysicsEntity->m_pRigidBody->getCollisionFlags():0) | btCollisionObject::CF_KINEMATIC_OBJECT); pPhysicsEntity->m_apPhysicsShapes.back()->setActivationState(DISABLE_DEACTIVATION); } else if (eCollisionType == CT_STATIC_MESH) pPhysicsEntity->m_apPhysicsShapes.back()->setActivationState(DISABLE_SIMULATION); m_pDynamicsWorld->addRigidBody(pPhysicsEntity->m_apPhysicsShapes.back(), pEntity->GetCollisionGroup(), GetMaskForGroup(pEntity->GetCollisionGroup())); } void CBulletPhysics::AddModel(class CBaseEntity* pEntity, collision_type_t eCollisionType, size_t iModel) { CModel* pModel = CModelLibrary::GetModel(iModel); if (!pModel) return; for (size_t i = 0; i < pModel->m_pToy->GetNumSceneAreas(); i++) { size_t iArea = CModelLibrary::FindModel(pModel->m_pToy->GetSceneAreaFileName(i)); AddModel(pEntity, eCollisionType, iArea); } AddModelTris(pEntity, eCollisionType, iModel); CPhysicsEntity* pPhysicsEntity = &m_aEntityList[pEntity->GetHandle()]; for (size_t i = 0; i < pModel->m_pToy->GetPhysicsNumBoxes(); i++) { btCollisionShape* pCollisionShape; pPhysicsEntity->m_bCenterMassOffset = true; Vector vecHalf = pModel->m_pToy->GetPhysicsBoxHalfSize(i); pCollisionShape = new btBoxShape(ToBTVector(vecHalf)); btTransform mTransform; mTransform.setIdentity(); mTransform.setFromOpenGLMatrix((Matrix4x4)pEntity->GetPhysicsTransform()*pModel->m_pToy->GetPhysicsBox(i).GetMatrix4x4(false, false)); btVector3 vecLocalInertia(0, 0, 0); btRigidBody::btRigidBodyConstructionInfo rbInfo(0, &pPhysicsEntity->m_oMotionState, pCollisionShape, vecLocalInertia); pPhysicsEntity->m_apPhysicsShapes.push_back(new btRigidBody(rbInfo)); pPhysicsEntity->m_apPhysicsShapes.back()->setUserPointer((void*)pEntity->GetHandle()); pPhysicsEntity->m_apPhysicsShapes.back()->setWorldTransform(mTransform); if (eCollisionType == CT_KINEMATIC) { pPhysicsEntity->m_apPhysicsShapes.back()->setCollisionFlags((pPhysicsEntity->m_pRigidBody?pPhysicsEntity->m_pRigidBody->getCollisionFlags():0) | btCollisionObject::CF_KINEMATIC_OBJECT); pPhysicsEntity->m_apPhysicsShapes.back()->setActivationState(DISABLE_DEACTIVATION); } else if (eCollisionType == CT_STATIC_MESH) pPhysicsEntity->m_apPhysicsShapes.back()->setActivationState(DISABLE_SIMULATION); m_pDynamicsWorld->addRigidBody(pPhysicsEntity->m_apPhysicsShapes.back(), pEntity->GetCollisionGroup(), GetMaskForGroup(pEntity->GetCollisionGroup())); } } void CBulletPhysics::AddModelTris(class CBaseEntity* pEntity, collision_type_t eCollisionType, size_t iModel) { CModel* pModel = CModelLibrary::GetModel(iModel); if (!pModel) return; if (!pModel->m_pToy->GetPhysicsNumTris()) return; CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEntity); btCollisionShape* pCollisionShape; float flMass; if (eCollisionType == CT_STATIC_MESH) { pPhysicsEntity->m_bCenterMassOffset = false; flMass = 0; pCollisionShape = m_apCollisionMeshes[iModel].m_pCollisionShape; } else if (eCollisionType == CT_KINEMATIC) { pPhysicsEntity->m_bCenterMassOffset = false; flMass = 0; pCollisionShape = m_apCollisionMeshes[iModel].m_pCollisionShape; } else { TAssert(!"Unimplemented collision type"); } TAssert(pCollisionShape); btTransform mTransform; mTransform.setIdentity(); mTransform.setFromOpenGLMatrix(&pEntity->GetPhysicsTransform().m[0][0]); bool bDynamic = (flMass != 0.f); btVector3 vecLocalInertia(0, 0, 0); if (bDynamic) pCollisionShape->calculateLocalInertia(flMass, vecLocalInertia); btRigidBody::btRigidBodyConstructionInfo rbInfo(flMass, &pPhysicsEntity->m_oMotionState, pCollisionShape, vecLocalInertia); if (pEntity->GetModelID() == iModel) { pPhysicsEntity->m_pRigidBody = new btRigidBody(rbInfo); pPhysicsEntity->m_pRigidBody->setUserPointer((void*)pEntity->GetHandle()); if (eCollisionType == CT_KINEMATIC) { pPhysicsEntity->m_pRigidBody->setCollisionFlags(pPhysicsEntity->m_pRigidBody->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); pPhysicsEntity->m_pRigidBody->setActivationState(DISABLE_DEACTIVATION); } else if (eCollisionType == CT_STATIC_MESH) pPhysicsEntity->m_pRigidBody->setActivationState(DISABLE_SIMULATION); m_pDynamicsWorld->addRigidBody(pPhysicsEntity->m_pRigidBody, pEntity->GetCollisionGroup(), GetMaskForGroup(pEntity->GetCollisionGroup())); } else { // This is a scene area. Handle it a tad differently. TAssert(pEntity->GetModel()->m_pToy->GetNumSceneAreas()); btRigidBody* pBody = new btRigidBody(rbInfo); pPhysicsEntity->m_apAreaBodies.push_back(pBody); pBody->setUserPointer((void*)pEntity->GetHandle()); if (eCollisionType == CT_KINEMATIC) { pBody->setCollisionFlags(pBody->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); pBody->setActivationState(DISABLE_DEACTIVATION); } else if (eCollisionType == CT_STATIC_MESH) pPhysicsEntity->m_pRigidBody->setActivationState(DISABLE_SIMULATION); m_pDynamicsWorld->addRigidBody(pBody, pEntity->GetCollisionGroup(), GetMaskForGroup(pEntity->GetCollisionGroup())); } } void CBulletPhysics::RemoveEntity(CBaseEntity* pEntity) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEntity); if (!pPhysicsEntity) return; RemoveEntity(pPhysicsEntity); } void CBulletPhysics::RemoveEntity(CPhysicsEntity* pPhysicsEntity) { if (!pPhysicsEntity) return; if (pPhysicsEntity->m_pRigidBody) m_pDynamicsWorld->removeRigidBody(pPhysicsEntity->m_pRigidBody); delete pPhysicsEntity->m_pRigidBody; pPhysicsEntity->m_pRigidBody = NULL; for (size_t i = 0; i < pPhysicsEntity->m_apAreaBodies.size(); i++) { m_pDynamicsWorld->removeRigidBody(pPhysicsEntity->m_apAreaBodies[i]); delete pPhysicsEntity->m_apAreaBodies[i]; } pPhysicsEntity->m_apAreaBodies.clear(); for (size_t i = 0; i < pPhysicsEntity->m_apPhysicsShapes.size(); i++) { m_pDynamicsWorld->removeRigidBody(pPhysicsEntity->m_apPhysicsShapes[i]); delete pPhysicsEntity->m_apPhysicsShapes[i]; } pPhysicsEntity->m_apPhysicsShapes.clear(); if (pPhysicsEntity->m_pGhostObject) m_pDynamicsWorld->removeCollisionObject(pPhysicsEntity->m_pGhostObject); delete pPhysicsEntity->m_pGhostObject; pPhysicsEntity->m_pGhostObject = NULL; if (pPhysicsEntity->m_pCharacterController) m_pDynamicsWorld->removeAction(pPhysicsEntity->m_pCharacterController); delete pPhysicsEntity->m_pCharacterController; pPhysicsEntity->m_pCharacterController = NULL; if (pPhysicsEntity->m_pTriggerController) m_pDynamicsWorld->removeAction(pPhysicsEntity->m_pTriggerController); delete pPhysicsEntity->m_pTriggerController; pPhysicsEntity->m_pTriggerController = NULL; } size_t CBulletPhysics::AddExtra(size_t iExtraMesh, const Vector& vecOrigin) { size_t iIndex = ~0; for (size_t i = 0; i < m_apExtraEntityList.size(); i++) { if (!m_apExtraEntityList[i]) { iIndex = i; m_apExtraEntityList[i] = new CPhysicsEntity(); break; } } if (iIndex == ~0) { iIndex = m_apExtraEntityList.size(); m_apExtraEntityList.push_back(new CPhysicsEntity()); } CPhysicsEntity* pPhysicsEntity = m_apExtraEntityList[iIndex]; pPhysicsEntity->m_bCenterMassOffset = false; TAssert(m_apExtraCollisionMeshes[iExtraMesh]); if (!m_apExtraCollisionMeshes[iExtraMesh]) return ~0; float flMass = 0; btCollisionShape* pCollisionShape = m_apExtraCollisionMeshes[iExtraMesh]->m_pCollisionShape; TAssert(pCollisionShape); btTransform mTransform; mTransform.setIdentity(); mTransform.setOrigin(ToBTVector(vecOrigin)); bool bDynamic = (flMass != 0.f); btVector3 vecLocalInertia(0, 0, 0); if (bDynamic) pCollisionShape->calculateLocalInertia(flMass, vecLocalInertia); btRigidBody::btRigidBodyConstructionInfo rbInfo(flMass, nullptr, pCollisionShape, vecLocalInertia); pPhysicsEntity->m_pRigidBody = new btRigidBody(rbInfo); pPhysicsEntity->m_pRigidBody->setUserPointer((void*)(GameServer()->GetMaxEntities()+iIndex)); pPhysicsEntity->m_pRigidBody->setWorldTransform(mTransform); pPhysicsEntity->m_pRigidBody->setActivationState(DISABLE_SIMULATION); m_pDynamicsWorld->addRigidBody(pPhysicsEntity->m_pRigidBody, CG_STATIC, GetMaskForGroup(CG_STATIC)); return iIndex; } size_t CBulletPhysics::AddExtraBox(const Vector& vecCenter, const Vector& vecSize) { size_t iIndex = ~0; for (size_t i = 0; i < m_apExtraEntityList.size(); i++) { if (!m_apExtraEntityList[i]) { iIndex = i; m_apExtraEntityList[i] = new CPhysicsEntity(); break; } } if (iIndex == ~0) { iIndex = m_apExtraEntityList.size(); m_apExtraEntityList.push_back(new CPhysicsEntity()); } CPhysicsEntity* pPhysicsEntity = m_apExtraEntityList[iIndex]; pPhysicsEntity->m_bCenterMassOffset = false; float flMass = 0; pPhysicsEntity->m_pExtraShape = new btBoxShape(ToBTVector(vecSize)/2); btTransform mTransform; mTransform.setIdentity(); mTransform.setOrigin(ToBTVector(vecCenter)); bool bDynamic = (flMass != 0.f); btVector3 vecLocalInertia(0, 0, 0); if (bDynamic) pPhysicsEntity->m_pExtraShape->calculateLocalInertia(flMass, vecLocalInertia); btRigidBody::btRigidBodyConstructionInfo rbInfo(flMass, nullptr, pPhysicsEntity->m_pExtraShape, vecLocalInertia); pPhysicsEntity->m_pRigidBody = new btRigidBody(rbInfo); pPhysicsEntity->m_pRigidBody->setUserPointer((void*)(GameServer()->GetMaxEntities()+iIndex)); pPhysicsEntity->m_pRigidBody->setWorldTransform(mTransform); pPhysicsEntity->m_pRigidBody->setActivationState(DISABLE_SIMULATION); m_pDynamicsWorld->addRigidBody(pPhysicsEntity->m_pRigidBody, CG_STATIC, GetMaskForGroup(CG_STATIC)); return iIndex; } void CBulletPhysics::RemoveExtra(size_t iExtra) { CPhysicsEntity* pPhysicsEntity = m_apExtraEntityList[iExtra]; TAssert(pPhysicsEntity); if (!pPhysicsEntity) return; m_pDynamicsWorld->removeRigidBody(pPhysicsEntity->m_pRigidBody); delete m_apExtraEntityList[iExtra]->m_pExtraShape; delete m_apExtraEntityList[iExtra]->m_pRigidBody; delete m_apExtraEntityList[iExtra]; m_apExtraEntityList[iExtra] = nullptr; } void CBulletPhysics::RemoveAllEntities() { for (size_t i = 0; i < m_aEntityList.size(); i++) { auto pPhysicsEntity = &m_aEntityList[i]; RemoveEntity(pPhysicsEntity); } for (size_t i = 0; i < m_apExtraEntityList.size(); i++) { if (m_apExtraEntityList[i]) RemoveExtra(i); } } bool CBulletPhysics::IsEntityAdded(CBaseEntity* pEntity) { TAssert(pEntity); if (!pEntity) return false; size_t iHandle = pEntity->GetHandle(); if (m_aEntityList.size() <= iHandle) return false; CPhysicsEntity* pPhysicsEntity = &m_aEntityList[iHandle]; return (pPhysicsEntity->m_pCharacterController || pPhysicsEntity->m_pExtraShape || pPhysicsEntity->m_pGhostObject || pPhysicsEntity->m_pRigidBody || pPhysicsEntity->m_pTriggerController); } void CBulletPhysics::LoadCollisionMesh(const tstring& sModel, size_t iTris, int* aiTris, size_t iVerts, float* aflVerts) { size_t iModel = CModelLibrary::FindModel(sModel); TAssert(iModel != ~0); TAssert(!m_apCollisionMeshes[iModel].m_pIndexVertexArray); TAssert(!m_apCollisionMeshes[iModel].m_pCollisionShape); if (m_apCollisionMeshes[iModel].m_pIndexVertexArray) return; m_apCollisionMeshes[iModel].m_pIndexVertexArray = new btTriangleIndexVertexArray(); btIndexedMesh m; m.m_numTriangles = iTris; m.m_triangleIndexBase = (const unsigned char *)aiTris; m.m_triangleIndexStride = sizeof(int)*3; m.m_numVertices = iVerts; m.m_vertexBase = (const unsigned char *)aflVerts; m.m_vertexStride = sizeof(Vector); m_apCollisionMeshes[iModel].m_pIndexVertexArray->addIndexedMesh(m, PHY_INTEGER); m_apCollisionMeshes[iModel].m_pCollisionShape = new btBvhTriangleMeshShape(m_apCollisionMeshes[iModel].m_pIndexVertexArray, true); } void CBulletPhysics::UnloadCollisionMesh(const tstring& sModel) { size_t iModel = CModelLibrary::FindModel(sModel); TAssert(iModel != ~0); if (iModel == ~0) return; auto it = m_apCollisionMeshes.find(iModel); TAssert(it != m_apCollisionMeshes.end()); if (it == m_apCollisionMeshes.end()) return; // Make sure there are no objects using this collision shape. for (int i = 0; i < m_pDynamicsWorld->getCollisionObjectArray().size(); i++) { auto pObject = m_pDynamicsWorld->getCollisionObjectArray()[i]; TAssert(pObject->getCollisionShape() != it->second.m_pCollisionShape); if (pObject->getCollisionShape() == it->second.m_pCollisionShape) { CEntityHandle<CBaseEntity> hEntity(GetBaseEntity(pObject)); if (hEntity.GetPointer()) TError("Entity found with collision shape '" + sModel + "' which is being unloaded: " + tstring(hEntity->GetClassName()) + ":" + hEntity->GetName() + "\n"); else TError("Entity found with 'extra' collision shape which is being unloaded\n"); RemoveEntity(hEntity); } } delete it->second.m_pCollisionShape; delete it->second.m_pIndexVertexArray; m_apCollisionMeshes.erase(it->first); } size_t CBulletPhysics::LoadExtraCollisionMesh(size_t iTris, int* aiTris, size_t iVerts, float* aflVerts) { size_t iIndex = ~0; for (size_t i = 0; i < m_apExtraCollisionMeshes.size(); i++) { if (!m_apExtraCollisionMeshes[i]) { iIndex = i; m_apExtraCollisionMeshes[i] = new CCollisionMesh(); break; } } if (iIndex == ~0) { iIndex = m_apExtraCollisionMeshes.size(); m_apExtraCollisionMeshes.push_back(new CCollisionMesh()); } m_apExtraCollisionMeshes[iIndex]->m_pIndexVertexArray = new btTriangleIndexVertexArray(); btIndexedMesh m; m.m_numTriangles = iTris; m.m_triangleIndexBase = (const unsigned char *)aiTris; m.m_triangleIndexStride = sizeof(int)*3; m.m_numVertices = iVerts; m.m_vertexBase = (const unsigned char *)aflVerts; m.m_vertexStride = sizeof(Vector); m_apExtraCollisionMeshes[iIndex]->m_pIndexVertexArray->addIndexedMesh(m, PHY_INTEGER); m_apExtraCollisionMeshes[iIndex]->m_pCollisionShape = new btBvhTriangleMeshShape(m_apExtraCollisionMeshes[iIndex]->m_pIndexVertexArray, true); return iIndex; } void CBulletPhysics::UnloadExtraCollisionMesh(size_t iIndex) { TAssert(m_apExtraCollisionMeshes[iIndex]); if (!m_apExtraCollisionMeshes[iIndex]) return; // Make sure there are no objects using this collision shape. for (int i = 0; i < m_pDynamicsWorld->getCollisionObjectArray().size(); i++) { auto pObject = m_pDynamicsWorld->getCollisionObjectArray()[i]; TAssert(pObject->getCollisionShape() != m_apExtraCollisionMeshes[iIndex]->m_pCollisionShape); if (pObject->getCollisionShape() == m_apExtraCollisionMeshes[iIndex]->m_pCollisionShape) { RemoveExtra(iIndex); TError("Entity found with collision mesh which is being unloaded\n"); } } delete m_apExtraCollisionMeshes[iIndex]->m_pCollisionShape; delete m_apExtraCollisionMeshes[iIndex]->m_pIndexVertexArray; delete m_apExtraCollisionMeshes[iIndex]; m_apExtraCollisionMeshes[iIndex] = nullptr; } #ifdef _DEBUG #define PHYS_TIMESTEP "0.03333333333" #else #define PHYS_TIMESTEP "0.01666666666" #endif CVar phys_timestep("phys_timestep", PHYS_TIMESTEP); void CBulletPhysics::Simulate() { TPROF("CBulletPhysics::Simulate"); m_pDynamicsWorld->stepSimulation((float)GameServer()->GetFrameTime(), 10, phys_timestep.GetFloat()); } void CBulletPhysics::DebugDraw(int iLevel) { if (!m_pDebugDrawer) { m_pDebugDrawer = new CPhysicsDebugDrawer(); m_pDynamicsWorld->setDebugDrawer(m_pDebugDrawer); } if (iLevel == 0) m_pDebugDrawer->setDebugMode(CPhysicsDebugDrawer::DBG_NoDebug); else if (iLevel == 1) m_pDebugDrawer->setDebugMode(CPhysicsDebugDrawer::DBG_DrawWireframe); else if (iLevel >= 2) m_pDebugDrawer->setDebugMode(btIDebugDraw::DBG_DrawWireframe|btIDebugDraw::DBG_DrawContactPoints); m_pDebugDrawer->SetDrawing(true); m_pDynamicsWorld->debugDrawWorld(); m_pDebugDrawer->SetDrawing(false); } collision_type_t CBulletPhysics::GetEntityCollisionType(class CBaseEntity* pEnt) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return CT_NONE; return pPhysicsEntity->m_eCollisionType; } void CBulletPhysics::SetEntityTransform(class CBaseEntity* pEnt, const Matrix4x4& mTransform) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return; if (pPhysicsEntity->m_bCenterMassOffset) { Matrix4x4 mCenter; mCenter.SetTranslation(pEnt->GetPhysBoundingBox().Center()); btTransform m; m.setFromOpenGLMatrix(mCenter * mTransform); if (pPhysicsEntity->m_pRigidBody) pPhysicsEntity->m_pRigidBody->setCenterOfMassTransform(m); else if (pPhysicsEntity->m_pGhostObject) pPhysicsEntity->m_pGhostObject->setWorldTransform(m); CModel* pModel = pEnt->GetModel(); CToy* pToy = pModel?pModel->m_pToy:nullptr; if (pToy) { for (size_t i = 0; i < pPhysicsEntity->m_apPhysicsShapes.size(); i++) { mCenter = pModel->m_pToy->GetPhysicsBox(i).GetMatrix4x4(false, false); m.setFromOpenGLMatrix(mCenter * mTransform); pPhysicsEntity->m_apPhysicsShapes[i]->setCenterOfMassTransform(m); } } } else { btTransform m; m.setFromOpenGLMatrix(mTransform); if (pPhysicsEntity->m_pRigidBody) pPhysicsEntity->m_pRigidBody->setCenterOfMassTransform(m); else if (pPhysicsEntity->m_pGhostObject) pPhysicsEntity->m_pGhostObject->setWorldTransform(m); for (size_t i = 0; i < pPhysicsEntity->m_apPhysicsShapes.size(); i++) { TUnimplemented(); // This may work but it also may cause boxes to be misaligned. pPhysicsEntity->m_apPhysicsShapes[i]->setCenterOfMassTransform(m); } } } void CBulletPhysics::SetEntityVelocity(class CBaseEntity* pEnt, const Vector& vecVelocity) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return; btVector3 v(vecVelocity.x, vecVelocity.y, vecVelocity.z); if (pPhysicsEntity->m_pRigidBody) pPhysicsEntity->m_pRigidBody->setLinearVelocity(v); else if (pPhysicsEntity->m_pCharacterController) TAssert(false); } Vector CBulletPhysics::GetEntityVelocity(class CBaseEntity* pEnt) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return Vector(); if (pPhysicsEntity->m_pRigidBody) return Vector(pPhysicsEntity->m_pRigidBody->getLinearVelocity()); else if (pPhysicsEntity->m_pCharacterController) return Vector(pPhysicsEntity->m_pCharacterController->GetVelocity()); return Vector(); } void CBulletPhysics::SetControllerMoveVelocity(class CBaseEntity* pEnt, const Vector& vecVelocity) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return; TAssert(pPhysicsEntity->m_pCharacterController); if (pPhysicsEntity->m_pCharacterController) pPhysicsEntity->m_pCharacterController->SetMoveVelocity(ToBTVector(vecVelocity)); } void CBulletPhysics::SetControllerColliding(class CBaseEntity* pEnt, bool bColliding) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return; TAssert(pPhysicsEntity->m_pCharacterController); if (pPhysicsEntity->m_pCharacterController) pPhysicsEntity->m_pCharacterController->SetColliding(bColliding); } void CBulletPhysics::SetEntityGravity(class CBaseEntity* pEnt, const Vector& vecGravity) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return; btVector3 v(vecGravity.x, vecGravity.y, vecGravity.z); if (pPhysicsEntity->m_pRigidBody) pPhysicsEntity->m_pRigidBody->setGravity(v); else if (pPhysicsEntity->m_pCharacterController) pPhysicsEntity->m_pCharacterController->SetGravity(v); } void CBulletPhysics::SetEntityUpVector(class CBaseEntity* pEnt, const Vector& vecUp) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return; btVector3 v(vecUp.x, vecUp.y, vecUp.z); TAssert(pPhysicsEntity->m_pCharacterController); if (pPhysicsEntity->m_pCharacterController) pPhysicsEntity->m_pCharacterController->SetUpVector(v); } void CBulletPhysics::SetLinearFactor(class CBaseEntity* pEnt, const Vector& vecFactor) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return; btVector3 v(vecFactor.x, vecFactor.y, vecFactor.z); if (pPhysicsEntity->m_pRigidBody) pPhysicsEntity->m_pRigidBody->setLinearFactor(v); else if (pPhysicsEntity->m_pCharacterController) pPhysicsEntity->m_pCharacterController->SetLinearFactor(v); } void CBulletPhysics::SetAngularFactor(class CBaseEntity* pEnt, const Vector& vecFactor) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return; btVector3 v(vecFactor.x, vecFactor.y, vecFactor.z); TAssert(!pPhysicsEntity->m_pCharacterController); if (pPhysicsEntity->m_pRigidBody) pPhysicsEntity->m_pRigidBody->setAngularFactor(v); } void CBulletPhysics::CharacterMovement(class CBaseEntity* pEnt, class btCollisionWorld* pCollisionWorld, float flDelta) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return; if (!pPhysicsEntity->m_pCharacterController) return; pPhysicsEntity->m_pCharacterController->CharacterMovement(pCollisionWorld, flDelta); } void CBulletPhysics::TraceLine(CTraceResult& tr, const Vector& v1, const Vector& v2, class CBaseEntity* pIgnore) { btVector3 vecFrom, vecTo; vecFrom = ToBTVector(v1); vecTo = ToBTVector(v2); CClosestRayResultCallback callback(vecFrom, vecTo, pIgnore?GetPhysicsEntity(pIgnore)->m_pRigidBody:nullptr); m_pDynamicsWorld->rayTest(vecFrom, vecTo, callback); if (callback.m_closestHitFraction < tr.m_flFraction) { tr.m_flFraction = callback.m_closestHitFraction; tr.m_vecHit = ToTVector(callback.m_hitPointWorld); tr.m_vecNormal = ToTVector(callback.m_hitNormalWorld); tr.m_pHit = CEntityHandle<CBaseEntity>((size_t)callback.m_collisionObject->getUserPointer()).GetPointer(); if ((size_t)callback.m_collisionObject->getUserPointer() >= GameServer()->GetMaxEntities()) tr.m_iHitExtra = (size_t)callback.m_collisionObject->getUserPointer() - GameServer()->GetMaxEntities(); } } void CBulletPhysics::TraceEntity(CTraceResult& tr, class CBaseEntity* pEntity, const Vector& v1, const Vector& v2) { btVector3 vecFrom, vecTo; vecFrom = ToBTVector(v1); vecTo = ToBTVector(v2); btTransform mFrom, mTo; mFrom.setIdentity(); mTo.setIdentity(); mFrom.setOrigin(vecFrom); mTo.setOrigin(vecTo); CPhysicsEntity* pPhysicsEntity = pEntity?GetPhysicsEntity(pEntity):nullptr; TAssert(pPhysicsEntity); if (!pPhysicsEntity) return; TAssert(pPhysicsEntity->m_pRigidBody || pPhysicsEntity->m_pGhostObject); if (!pPhysicsEntity->m_pRigidBody && !pPhysicsEntity->m_pGhostObject) return; btConvexShape* pShape = dynamic_cast<btConvexShape*>(pPhysicsEntity->m_pRigidBody?pPhysicsEntity->m_pRigidBody->getCollisionShape():pPhysicsEntity->m_pGhostObject->getCollisionShape()); TAssert(pShape); if (!pShape) return; btCollisionObject* pObject = pPhysicsEntity->m_pRigidBody; if (!pObject) pObject = pPhysicsEntity->m_pGhostObject; TAssert(pObject); CClosestConvexResultCallback callback(vecFrom, vecTo, pObject); m_pDynamicsWorld->convexSweepTest(pShape, mFrom, mTo, callback); if (callback.m_closestHitFraction < tr.m_flFraction) { tr.m_flFraction = callback.m_closestHitFraction; tr.m_vecHit = ToTVector(callback.m_hitPointWorld); tr.m_vecNormal = ToTVector(callback.m_hitNormalWorld); tr.m_pHit = CEntityHandle<CBaseEntity>((size_t)callback.m_hitCollisionObject->getUserPointer()).GetPointer(); if ((size_t)callback.m_hitCollisionObject->getUserPointer() >= GameServer()->GetMaxEntities()) tr.m_iHitExtra = (size_t)callback.m_hitCollisionObject->getUserPointer() - GameServer()->GetMaxEntities(); } } void CBulletPhysics::CheckSphere(CTraceResult& tr, float flRadius, const Vector& vecCenter, class CBaseEntity* pIgnore) { btTransform mTransform = btTransform::getIdentity(); mTransform.setOrigin(ToBTVector(vecCenter)); CPhysicsEntity* pIgnorePhysicsEntity = pIgnore?GetPhysicsEntity(pIgnore):nullptr; btCollisionObject* pIgnoreCollisionObject = nullptr; if (pIgnorePhysicsEntity) { if (pIgnorePhysicsEntity->m_pGhostObject) pIgnoreCollisionObject = pIgnorePhysicsEntity->m_pGhostObject; else pIgnoreCollisionObject = pIgnorePhysicsEntity->m_pRigidBody; } CAllContactResultsCallback callback(tr, pIgnoreCollisionObject); std::shared_ptr<btSphereShape> pSphereShape(new btSphereShape(flRadius)); btRigidBody::btRigidBodyConstructionInfo rbInfo(0, nullptr, pSphereShape.get()); std::shared_ptr<btRigidBody> pSphere(new btRigidBody(rbInfo)); pSphere->setWorldTransform(mTransform); m_pDynamicsWorld->contactTest(pSphere.get(), callback); } void CBulletPhysics::CharacterJump(class CBaseEntity* pEnt) { CPhysicsEntity* pPhysicsEntity = GetPhysicsEntity(pEnt); if (!pPhysicsEntity) return; TAssert(pPhysicsEntity->m_pCharacterController); if (!pPhysicsEntity->m_pCharacterController) return; pPhysicsEntity->m_pCharacterController->jump(); } CPhysicsEntity* CBulletPhysics::GetPhysicsEntity(class CBaseEntity* pEnt) { TAssert(pEnt); if (!pEnt) return NULL; size_t iHandle = pEnt->GetHandle(); TAssert(m_aEntityList.size() > iHandle); if (m_aEntityList.size() <= iHandle) return NULL; CPhysicsEntity* pPhysicsEntity = &m_aEntityList[iHandle]; TAssert(pPhysicsEntity); return pPhysicsEntity; } CBaseEntity* CBulletPhysics::GetBaseEntity(btCollisionObject* pObject) { CEntityHandle<CBaseEntity> hEntity((size_t)pObject->getUserPointer()); return hEntity; } short CBulletPhysics::GetMaskForGroup(collision_group_t eGroup) { switch (eGroup) { case CG_NONE: case CG_DEFAULT: default: return btBroadphaseProxy::AllFilter; case CG_STATIC: return CG_DEFAULT|CG_CHARACTER_CLIP|CG_CHARACTER_PASS; case CG_TRIGGER: return CG_DEFAULT|CG_CHARACTER_CLIP|CG_CHARACTER_PASS; case CG_CHARACTER_PASS: return CG_DEFAULT|CG_STATIC|CG_TRIGGER|CG_CHARACTER_CLIP; case CG_CHARACTER_CLIP: return CG_DEFAULT|CG_STATIC|CG_TRIGGER|CG_CHARACTER_CLIP|CG_CHARACTER_PASS; } } CPhysicsManager::CPhysicsManager() { m_pModel = new CBulletPhysics(); } CPhysicsManager::~CPhysicsManager() { delete m_pModel; } void CMotionState::getWorldTransform(btTransform& mCenterOfMass) const { if (m_pPhysics->GetPhysicsEntity(m_hEntity)->m_bCenterMassOffset) { Matrix4x4 mCenter; mCenter.SetTranslation(m_hEntity->GetPhysBoundingBox().Center()); mCenterOfMass.setFromOpenGLMatrix(mCenter * m_hEntity->GetPhysicsTransform()); } else mCenterOfMass.setFromOpenGLMatrix(m_hEntity->GetPhysicsTransform()); } void CMotionState::setWorldTransform(const btTransform& mCenterOfMass) { Matrix4x4 mGlobal; mCenterOfMass.getOpenGLMatrix(mGlobal); if (m_pPhysics->GetPhysicsEntity(m_hEntity)->m_bCenterMassOffset) { Matrix4x4 mCenter; mCenter.SetTranslation(m_hEntity->GetPhysBoundingBox().Center()); m_hEntity->SetPhysicsTransform(mCenter.InvertedRT() * mGlobal); } else m_hEntity->SetPhysicsTransform(mGlobal); } CPhysicsModel* GamePhysics() { static CPhysicsModel* pModel = new CBulletPhysics(); return pModel; }
[ "jorge@lunarworkshop.com" ]
jorge@lunarworkshop.com
0558ce601d6910b45be836e261c76370fd09872d
cc799cb41ba0f736a9611eafd4ad06a0767fd102
/CncControlerGui/CncUserEvents.h
190caece7d00e5eee0628b032cab439ca9a75306
[]
no_license
HackiWimmer/cnc
8cbfe5f5b9b39d96c9ea32da4adcb89f96ec1008
329278bbed7b4a10407e6ddb1c135366f3ef8537
refs/heads/master
2023-01-08T01:39:54.521532
2023-01-01T15:48:06
2023-01-01T15:48:06
85,393,224
3
2
null
2017-03-27T18:06:19
2017-03-18T10:30:06
C++
UTF-8
C++
false
false
1,846
h
#ifndef CNC_USER_EVENTS_H #define CNC_USER_EVENTS_H #include <wx/event.h> #include <wx/any.h> class IndividualCommandEvent; //--------------------------------------------------------------------------------------------- wxDECLARE_EVENT(wxEVT_INDIVIDUAL_CTRL_COMMAND, IndividualCommandEvent); //--------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------- class IndividualCommandEvent : public wxCommandEvent { public: // define here individual event ids // Important! this ids have to be without any overlapping enum EvtPreprocessor { UpdateSelectedClientIds = 100 }; enum EvtMainFrame { WaitActive = 150, DispatchAll, DistpatchNext, EnableControls, ExtViewBoxChange, ExtViewBoxAttach, ExtViewBoxDetach }; enum EvtSerialStub { NotifyPauseBefore = 200, NotifyPauseAfter, NotifyResumeBefore, NotifyResumeAfter, NotifyConneting, NotifyConneted, NotifyDisconnected, NotifyFatalError }; public: enum ValueName { VAL1=0, VAL2=1, VAL3=2, VAL4=3, VAL5=4, VAL6=5, VAL7=6, VAL8=7 }; enum Value { MAX=VAL8 + 1 }; IndividualCommandEvent(int id = 0) : wxCommandEvent(wxEVT_INDIVIDUAL_CTRL_COMMAND, id) , values() {} explicit IndividualCommandEvent(const IndividualCommandEvent& event) : wxCommandEvent(event) , values(event.values) {} virtual wxEvent *Clone() const { return new IndividualCommandEvent(*this); } bool hasValue(ValueName name) { return flags[name]; } template <class T> const T getValue(ValueName name) { return values[name].As<T>(); } template <class T> void setValue(ValueName name, T value) { values[name] = value; flags[name] = true; } protected: wxAny values[Value::MAX]; bool flags[Value::MAX]; }; #endif
[ "stefan.hoelzer@fplusp.de" ]
stefan.hoelzer@fplusp.de
d852669f2b4dde220fc896244d1a14f9c1e40c7b
fabb8bd8c85c3b58aaefeb12e8f1a7a5c546972d
/HashTable/EclipseR3.0/src/EclipseR3.0.cpp
dd185ac993207cdb63a2ee995d03f8c4b0fffc3e
[]
no_license
oudrew/Public-Portfolio
fbf48ca816c163e896d64ce1dd0aab3deb0f49db
c82100405945fe472a74c91e897b6c5404ca6c6e
refs/heads/master
2020-03-28T17:33:39.470153
2019-08-28T20:49:30
2019-08-28T20:49:30
148,801,585
0
0
null
null
null
null
UTF-8
C++
false
false
28,609
cpp
//============================================================================ // Name : EclipseR2.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include <string> #include <iomanip> #include <fstream> #include "ResizeableArray.h" #include "LinkedHashTable.h" using namespace std; void search(ResizeableArray<Eclipse> &outputArray, ResizeableArray<Eclipse>* array, int bottom, int top, int column, string target) { //searches the data using the 3 letter month abbreviations if (column == 4) { int value; if (target == "Jan") { value = 1; } if (target == "Feb") { value = 2; } if (target == "Mar") { value = 3; } if (target == "Apr") { value = 4; } if (target == "May") { value = 5; } if (target == "Jun") { value = 6; } if (target == "Jul") { value = 7; } if (target == "Aug") { value = 8; } if (target == "Sep") { value = 9; } if (target == "Oct") { value = 10; } if (target == "Nov") { value = 11; } if (target == "Dec") { value = 12; } while (bottom <= top) { int mid = (bottom + top) / 2; Eclipse* eclipse1; eclipse1 = array->getData(mid); int eclipse1Num = 0; if (eclipse1->getData(column) == "Jan") { eclipse1Num = 1; } if (eclipse1->getData(column) == "Feb") { eclipse1Num = 2; } if (eclipse1->getData(column) == "Mar") { eclipse1Num = 3; } if (eclipse1->getData(column) == "Apr") { eclipse1Num = 4; } if (eclipse1->getData(column) == "May") { eclipse1Num = 5; } if (eclipse1->getData(column) == "Jun") { eclipse1Num = 6; } if (eclipse1->getData(column) == "Jul") { eclipse1Num = 7; } if (eclipse1->getData(column) == "Aug") { eclipse1Num = 8; } if (eclipse1->getData(column) == "Sep") { eclipse1Num = 9; } if (eclipse1->getData(column) == "Oct") { eclipse1Num = 10; } if (eclipse1->getData(column) == "Nov") { eclipse1Num = 11; } if (eclipse1->getData(column) == "Dec") { eclipse1Num = 12; } if (eclipse1Num == value) { Eclipse* eclipse1; eclipse1 = array->getData(mid); outputArray.Add(eclipse1); int i = 1; int j = 1; while(eclipse1Num == value && (mid - i) >= 0) { eclipse1 = array->getData(mid - i); if (eclipse1->getData(column) == "Jan") { eclipse1Num = 1; } if (eclipse1->getData(column) == "Feb") { eclipse1Num = 2; } if (eclipse1->getData(column) == "Mar") { eclipse1Num = 3; } if (eclipse1->getData(column) == "Apr") { eclipse1Num = 4; } if (eclipse1->getData(column) == "May") { eclipse1Num = 5; } if (eclipse1->getData(column) == "Jun") { eclipse1Num = 6; } if (eclipse1->getData(column) == "Jul") { eclipse1Num = 7; } if (eclipse1->getData(column) == "Aug") { eclipse1Num = 8; } if (eclipse1->getData(column) == "Sep") { eclipse1Num = 9; } if (eclipse1->getData(column) == "Oct") { eclipse1Num = 10; } if (eclipse1->getData(column) == "Nov") { eclipse1Num = 11; } if (eclipse1->getData(column) == "Dec") { eclipse1Num = 12; } if (eclipse1Num == value) { outputArray.Add(eclipse1); } else { break; } i++; } while(eclipse1Num == value && (mid + j) != top) { eclipse1 = array->getData(mid + j); if (eclipse1->getData(column) == "Jan") { eclipse1Num = 1; } if (eclipse1->getData(column) == "Feb") { eclipse1Num = 2; } if (eclipse1->getData(column) == "Mar") { eclipse1Num = 3; } if (eclipse1->getData(column) == "Apr") { eclipse1Num = 4; } if (eclipse1->getData(column) == "May") { eclipse1Num = 5; } if (eclipse1->getData(column) == "Jun") { eclipse1Num = 6; } if (eclipse1->getData(column) == "Jul") { eclipse1Num = 7; } if (eclipse1->getData(column) == "Aug") { eclipse1Num = 8; } if (eclipse1->getData(column) == "Sep") { eclipse1Num = 9; } if (eclipse1->getData(column) == "Oct") { eclipse1Num = 10; } if (eclipse1->getData(column) == "Nov") { eclipse1Num = 11; } if (eclipse1->getData(column) == "Dec") { eclipse1Num = 12; } if (eclipse1Num == value) { outputArray.Add(eclipse1); } else { break; } j++; } break; } if (eclipse1Num < value) { bottom = mid + 1; } if (eclipse1Num > value) { top = mid - 1; } } } //searches non-numeric columns else if (column == 5 || column == 9 || column == 12 || column == 13 || column == 17) { while (bottom <= top) { int mid = (bottom + top) / 2; Eclipse* eclipse1; eclipse1 = array->getData(mid); if (eclipse1->getData(column) == target) { Eclipse* eclipse1; eclipse1 = array->getData(mid); outputArray.Add(eclipse1); int i = 1; int j = 1; while(eclipse1->getData(column) == target && (mid - i) >= 0) { eclipse1 = array->getData(mid - i); if (eclipse1->getData(column) == target) { outputArray.Add(eclipse1); } else { break; } i++; } while(eclipse1->getData(column) == target && (mid + j) != top) { eclipse1 = array->getData(mid + j); if (eclipse1->getData(column) == target) { outputArray.Add(eclipse1); } else { break; } j++; } break; } if (eclipse1->getData(column) < target) { bottom = mid + 1; } if (eclipse1->getData(column) > target) { top = mid - 1; } } } //searches numeric columns else { while (bottom <= top) { int mid = (bottom + top) / 2; Eclipse* eclipse1; eclipse1 = array->getData(mid); int eclipse1Num = atof(eclipse1->getData(column).c_str()); int value = atof(target.c_str()); if (eclipse1Num == value) { Eclipse* eclipse1; eclipse1 = array->getData(mid); outputArray.Add(eclipse1); int i = 1; int j = 1; while(eclipse1Num == value && (mid - i) >= 0) { eclipse1 = array->getData(mid - i); eclipse1Num = atof(eclipse1->getData(column).c_str()); if (eclipse1Num == value) { outputArray.Add(eclipse1); } else { break; } i++; } while(eclipse1Num == value && (mid + j) != top) { eclipse1 = array->getData(mid + j); eclipse1Num = atof(eclipse1->getData(column).c_str()); if (eclipse1Num == value) { outputArray.Add(eclipse1); } else { break; } j++; } break; } if (eclipse1Num < value) { bottom = mid + 1; } if (eclipse1Num > value) { top = mid - 1; } } } } void merge(ResizeableArray<Eclipse>* array, int bottom, int mid, int top, int column) { int i = bottom; int j = mid + 1; ResizeableArray<Eclipse> temp; //uses the 3 letter month abbreviations to make comparisons if (column == 3) { while (i <= mid && j <= top) { Eclipse* eclipse1; eclipse1 = array->getData(i); int eclipse1Num = 0; Eclipse* eclipse2; int eclipse2Num = 0; eclipse2 = array->getData(j); if (eclipse1->getData(column) == "Jan") { eclipse1Num = 1; } if (eclipse1->getData(column) == "Feb") { eclipse1Num = 2; } if (eclipse1->getData(column) == "Mar") { eclipse1Num = 3; } if (eclipse1->getData(column) == "Apr") { eclipse1Num = 4; } if (eclipse1->getData(column) == "May") { eclipse1Num = 5; } if (eclipse1->getData(column) == "Jun") { eclipse1Num = 6; } if (eclipse1->getData(column) == "Jul") { eclipse1Num = 7; } if (eclipse1->getData(column) == "Aug") { eclipse1Num = 8; } if (eclipse1->getData(column) == "Sep") { eclipse1Num = 9; } if (eclipse1->getData(column) == "Oct") { eclipse1Num = 10; } if (eclipse1->getData(column) == "Nov") { eclipse1Num = 11; } if (eclipse1->getData(column) == "Dec") { eclipse1Num = 12; } if (eclipse2->getData(column) == "Jan") { eclipse2Num = 1; } if (eclipse2->getData(column) == "Feb") { eclipse2Num = 2; } if (eclipse2->getData(column) == "Mar") { eclipse2Num = 3; } if (eclipse2->getData(column) == "Apr") { eclipse2Num = 4; } if (eclipse2->getData(column) == "May") { eclipse2Num = 5; } if (eclipse2->getData(column) == "Jun") { eclipse2Num = 6; } if (eclipse2->getData(column) == "Jul") { eclipse2Num = 7; } if (eclipse2->getData(column) == "Aug") { eclipse2Num = 8; } if (eclipse2->getData(column) == "Sep") { eclipse2Num = 9; } if (eclipse2->getData(column) == "Oct") { eclipse2Num = 10; } if (eclipse2->getData(column) == "Nov") { eclipse2Num = 11; } if (eclipse2->getData(column) == "Dec") { eclipse2Num = 12; } if (eclipse1Num < eclipse2Num) { temp.Add(eclipse1); i++; } else { temp.Add(eclipse2); j++; } } } //makes comparisons on non-numeric rows else if (column == 5 || column == 9 || column == 12 || column == 13 || column == 17) { while (i <= mid && j <= top) { //cout << "into merge" << endl; Eclipse* eclipse1; eclipse1 = array->getData(i); Eclipse* eclipse2; eclipse2 = array->getData(j); string eclipse1Val = eclipse1->getData(column); string eclipse2Val = eclipse2->getData(column); if (eclipse1->getData(column) == "") { eclipse1Val = "999999999999"; } if (eclipse2->getData(column) == "") { eclipse2Val = "999999999999"; } if (eclipse1Val < eclipse2Val) { //cout << "loop 1" << endl; temp.Add(eclipse1); i++; } else { //cout << "loop 2" << endl;; temp.Add(eclipse2); j++; } } } //compares numeric rows else { while (i <= mid && j <= top) { //cout << "into merge" << endl; Eclipse* eclipse1; eclipse1 = array->getData(i); Eclipse* eclipse2; eclipse2 = array->getData(j); int eclipse1Num = atof(eclipse1->getData(column).c_str()); int eclipse2Num = atof(eclipse2->getData(column).c_str()); if (eclipse1->getData(column) == "") { eclipse1Num = 1000000; } if (eclipse2->getData(column) == "") { eclipse2Num = 1000000; } if (eclipse1Num < eclipse2Num) { //cout << "loop 1" << endl; temp.Add(eclipse1); i++; } else { //cout << "loop 2" << endl;; temp.Add(eclipse2); j++; } } } while (i <= mid) { Eclipse* eclipse1 = array->getData(i); temp.Add(eclipse1); i++; } while (j <= top) { Eclipse* eclipse2 = array->getData(j); temp.Add(eclipse2); j++; } for (int i = bottom; i <= top; i ++) { array->ReplaceAt(temp.getData(i - bottom), i); } return; } /* * splits the data into smaller pieces and merges them together sorted */ void sort(ResizeableArray<Eclipse>* array, int bottom, int top, int column) { int middle = 0; if (bottom < top) { middle = (top + bottom) / 2; sort(array, bottom, middle, column); sort(array, middle + 1, top, column); merge(array, bottom, middle, top, column); } } void addLinkedList(LinkedList<Eclipse>* list, Eclipse* eclipse) { LinkedList<Eclipse>* newList = new LinkedList<Eclipse>(*eclipse); if (list->getNext() == 0) { list->setNext(newList); } else if (list->getNext()->getData()->getData(0) == eclipse->getData(0)) { newList->setNext(list->getNext()->getNext()); list->setNext(newList); } else if (atoi(list->getNext()->getData()->getData(0).c_str()) > atoi(eclipse->getData(0).c_str())) { newList->setNext(list->getNext()); list->setNext(newList); } else { addLinkedList(list->getNext(), eclipse); } } void deleteLinkedList(LinkedList<Eclipse>* list, Eclipse* eclipse) { if (list->getNext() == 0) { return; } else if (eclipse->getData(0) == list->getNext()->getData()->getData(0)) { list->setNext(list->getNext()->getNext()); } else { deleteLinkedList(list->getNext(), eclipse); } } void addHashTable(LinkedList<Eclipse>* eclipse, LinkedHashTable<Eclipse>* hashTable, int x) { int id = atoi((eclipse->getData()->getData(0)).c_str()); int key = id % hashTable->getTableSize(); if (hashTable->isEmptyAt(key)) { hashTable->setData(key, eclipse); hashTable->addKey(x, key); } else { addLinkedList(hashTable->getData(key), eclipse->getData()); } } void addHashList(LinkedList<Eclipse>* hashList, LinkedList<Eclipse>* nextList) { if (hashList->getNext() == 0) { hashList->setNext(nextList); } else { addHashList(hashList->getNext(), nextList); } } int main() { ifstream inFile; string file; string header[10]; string idNums[12000]; int validEclipses = 0; int x = 0; int linesRead = 0; int sortedBy; LinkedList<Eclipse>* head = new LinkedList<Eclipse>(); cout << "Please select a file to open" << endl; getline(cin, file); inFile.open(file); if (!inFile) { cerr << "File is not available" << endl; return 1; } //skips the first 10 lines string currentLine; for (int i = 0; i < 10; i++) { getline(inFile, currentLine); header[i] = currentLine; } while (inFile.good()) { Eclipse* eclipse = new Eclipse(); int counter = -1; int numTimes = 0; int arrcount = 0; int sortedBy; int validEclipses = 0; getline(inFile, currentLine); linesRead ++; //splits the string at the spaces for (int i = 0; i < currentLine.length(); i ++) { if (i == currentLine.length() - 1) { (*eclipse).addData(arrcount, currentLine.substr(counter + 1)); } else if ((currentLine.at(i) == ' ') && (currentLine.at(i+1) == ' ')) { } else if (currentLine.at(i) == ' ') { (*eclipse).addData(arrcount, currentLine.substr(counter + 1, numTimes)); arrcount ++; counter = i; numTimes = 0; } else { numTimes ++; } } (*eclipse).fixLeadingZero(); if ((*eclipse).getData(9).front() == 'P') { if ((*eclipse).getColumnNum() != 16) { cerr << "Error in data row " << x << ": " << (*eclipse).getColumnNum() << " columns found. Should be 16" << endl; continue; } } else { if ((*eclipse).getColumnNum() != 18) { cerr << "Error in data row " << x + 1 << ": " << (*eclipse).getColumnNum() << " columns found. Should be 18" << endl; continue; } } bool digit = true; int badCol; for (int i = 0; i < (*eclipse).getColumnNum(); i ++) { if ((i == 0) || (i==1) || (i == 2) || (i == 4) || (i == 6) || (i == 7) || (i == 8) || (i == 14) || (i == 15) || (i == 16)) { for (int j = 0; j < (*eclipse).getData(i).length(); j ++) { if (((*eclipse).getData(i).at(j) == '-') || ((*eclipse).getData(i).at(j) == ' ')) { } else if (isdigit((*eclipse).getData(i).at(j)) == 0) { digit = false; badCol = i; } } } if (digit == false) { break; } } //prints an error if one of the specified rows doesnt contain a whole number if (digit == false) { cerr << "Error in data row " << x + 1 << ": Column " << badCol + 1 << " is not a whole number." << endl; //x++; continue; } for (int i = 0; i < (*eclipse).getColumnNum(); i ++) { if ((i == 10) || (i == 11)) { for (int j = 0; j < (*eclipse).getData(i).length(); j ++) { if (((*eclipse).getData(i).at(j) == '-') || ((*eclipse).getData(i).at(j) == '.')) { } else if (isdigit((*eclipse).getData(i).at(j)) == 0) { digit = false; badCol = i; } } } if (digit == false) { break; } } //prints out an error if there is not a decimal number in one of the specified rows if (digit == false) { cerr << "Error in data row " << x + 1 << ": Column " << badCol + 1 << " is not a decimal number." << endl; //x++; continue; } validEclipses ++; //checks for duplicate entries bool stop = false; int repeatedIndex; for (int i = 0; i < 12000; i ++) { if (idNums[i] == eclipse->getData(0)) { stop = true; repeatedIndex = i; break; } } if (stop == true) { cerr << "Error in data row " << x + 1 << ": Duplicate catalog number " << (*eclipse).getData(0) << "." << endl; continue; } //adds the entry number to idNums idNums[x] = eclipse->getData(0); addLinkedList(head, eclipse); x++; } ResizeableArray<Eclipse> array; ResizeableArray<Eclipse>* arrayPointer; arrayPointer = &array; LinkedList<Eclipse>* temp; LinkedList<Eclipse>* temp1; temp1 = head->getNext(); temp = head->getNext(); while (temp != 0) { temp1 = temp; array.Add(temp->getData()); temp = temp1->getNext(); } LinkedHashTable<Eclipse>* hashTablePointer; LinkedHashTable<Eclipse>* hashTable = new LinkedHashTable<Eclipse>(array.getElementNum()); hashTablePointer = hashTable; for (int i = 0; i < array.getElementNum(); i ++) { LinkedList<Eclipse>* newList = new LinkedList<Eclipse>(*array.getData(i)); LinkedList<Eclipse>* newList2 = new LinkedList<Eclipse>(*array.getData(i)); addHashTable(newList, hashTable, i); addHashList(hashTable->getList(), newList2); } string userInput; while (true) { cout << "Type 'O' for output, 'S' for sort, 'F' for find, 'M' for merge, 'P' for purge, 'C' for catalog order, 'L' to print the table list,\n'H' to print the table, or 'Q' for quit" << endl; getline(cin, userInput); if (userInput == "Q") { cout << "Goodbye!" << endl; break; } if (userInput == "C") { LinkedList<Eclipse>* temp; LinkedList<Eclipse>* temp1; temp1 = head->getNext(); temp = head->getNext(); while (temp != 0) { temp1 = temp; cout << *temp->getData() << endl; temp = temp1->getNext(); } } if (userInput == "P") { ifstream purgeFile; string s; cout << "Please select a file to purge" << endl; getline(cin, s); purgeFile.open(s); if (!purgeFile) { cerr << "File is not available" << endl; continue; } int x = 0; for (int i = 0; i < 10; i++) { getline(purgeFile, currentLine); header[i] = currentLine; } while (purgeFile.good()) { Eclipse* eclipse1 = new Eclipse(); string currentLine; int counter = -1; int numTimes = 0; int arrcount = 0; getline(purgeFile, currentLine); linesRead ++; //splits the string at the spaces for (int i = 0; i < currentLine.length(); i ++) { if (i == currentLine.length() - 1) { (*eclipse1).addData(arrcount, currentLine.substr(counter + 1)); } else if ((currentLine.at(i) == ' ') && (currentLine.at(i+1) == ' ')) { } else if (currentLine.at(i) == ' ') { (*eclipse1).addData(arrcount, currentLine.substr(counter + 1, numTimes)); arrcount ++; counter = i; numTimes = 0; } else { numTimes ++; } } (*eclipse1).fixLeadingZero(); deleteLinkedList(head, eclipse1); x++; } ResizeableArray<Eclipse>* newArray = new ResizeableArray<Eclipse>(); LinkedList<Eclipse>* temp; LinkedList<Eclipse>* temp1; temp1 = head->getNext(); temp = head->getNext(); while (temp != 0) { temp1 = temp; newArray->Add(temp->getData()); temp = temp1->getNext(); } delete arrayPointer; arrayPointer = newArray; LinkedHashTable<Eclipse>* newHashTable = new LinkedHashTable<Eclipse>(arrayPointer->getElementNum()); for (int i = 0; i < arrayPointer->getElementNum(); i ++) { LinkedList<Eclipse>* newList = new LinkedList<Eclipse>(*arrayPointer->getData(i)); LinkedList<Eclipse>* newList2 = new LinkedList<Eclipse>(*arrayPointer->getData(i)); addHashList(newHashTable->getList(), newList2); addHashTable(newList, newHashTable, i); } delete hashTablePointer; hashTablePointer = newHashTable; } if (userInput == "M") { ifstream mergeFile; string s; cout << "Please input a file to merge" << endl; getline(cin, s); mergeFile.open(s); if (!mergeFile) { cerr << "File is not available" << endl; continue; } int x = 0; for (int i = 0; i < 10; i++) { getline(mergeFile, currentLine); header[i] = currentLine; } while (mergeFile.good()) { Eclipse* eclipse1 = new Eclipse(); string currentLine; int counter = -1; int numTimes = 0; int arrcount = 0; getline(mergeFile, currentLine); linesRead ++; //splits the string at the spaces for (int i = 0; i < currentLine.length(); i ++) { if (i == currentLine.length() - 1) { (*eclipse1).addData(arrcount, currentLine.substr(counter + 1)); } else if ((currentLine.at(i) == ' ') && (currentLine.at(i+1) == ' ')) { } else if (currentLine.at(i) == ' ') { (*eclipse1).addData(arrcount, currentLine.substr(counter + 1, numTimes)); arrcount ++; counter = i; numTimes = 0; } else { numTimes ++; } } (*eclipse1).fixLeadingZero(); addLinkedList(head, eclipse1); x++; } ResizeableArray<Eclipse>* newArray = new ResizeableArray<Eclipse>(); LinkedList<Eclipse>* temp; LinkedList<Eclipse>* temp1; temp1 = head->getNext(); temp = head->getNext(); while (temp != 0) { temp1 = temp; newArray->Add(temp->getData()); temp = temp1->getNext(); } delete arrayPointer; arrayPointer = newArray; LinkedHashTable<Eclipse>* newHashTable = new LinkedHashTable<Eclipse>(arrayPointer->getElementNum()); for (int i = 0; i < arrayPointer->getElementNum(); i ++) { LinkedList<Eclipse>* newList = new LinkedList<Eclipse>(*arrayPointer->getData(i)); LinkedList<Eclipse>* newList2 = new LinkedList<Eclipse>(*arrayPointer->getData(i)); addHashList(newHashTable->getList(), newList2); addHashTable(newList, newHashTable, i); } delete hashTablePointer; hashTablePointer = newHashTable; } if (userInput == "S") { cout << "Please select a column by which to sort"<< endl; string s; getline(cin, s); sort(arrayPointer, 0, arrayPointer->getElementNum()-1, atoi(s.c_str()) - 1); sortedBy = atoi(s.c_str()); } if (userInput == "L") { LinkedList<Eclipse>* temp; LinkedList<Eclipse>* temp1; temp1 = hashTablePointer->getList()->getNext(); temp = hashTablePointer->getList()->getNext(); while (temp != 0) { temp1 = temp; cout << *temp->getData() << endl; temp = temp1->getNext(); } } if (userInput == "H") { for (int i = 0; i < hashTablePointer->getTableSize(); i ++) { cout << *(hashTablePointer->getData(i)->getData()) << endl; if (hashTablePointer->getData(i)->getNext() != 0) { cout << "Overflow: " << endl; LinkedList<Eclipse>* temp; LinkedList<Eclipse>* temp1; temp1 = hashTablePointer->getData(i)->getNext(); temp = hashTablePointer->getData(i)->getNext(); while (temp != 0) { temp1 = temp; cout << *temp->getData() << endl; temp = temp1->getNext(); } } } } if (userInput == "F") { ResizeableArray<Eclipse> outputArray; cout << "Please select a column to search over" << endl; string s; getline(cin, s); if (s == "1") { cout << "Please select a value to search for" << endl; string value; getline(cin, value); int id = atoi(value.c_str()); int key = id % hashTable->getTableSize(); if (hashTable->getData(key)->getData()->getData(0) == value) { cout << *(hashTable->getData(key)->getData()) << endl; } else { if (hashTable->getData(key)->getNext() == 0) { cerr << "Eclipse not found" << endl; } else { LinkedList<Eclipse>* temp; LinkedList<Eclipse>* temp1; temp1 = hashTable->getData(key)->getNext(); temp = hashTable->getData(key)->getNext(); while (temp != 0) { temp1 = temp; if (temp->getData()->getData(0) == value) { cout << *temp->getData() << endl; break; } temp = temp1->getNext(); } } } } if ((s=="2") || (s == "3") || (s == "5") || (s == "7") || (s == "8") || (s == "9") || (s == "11") || (s == "12") || (s == "15") || (s == "16") || (s == "17")) { cout << "Please select a value to search for" << endl; string value; bool valid = true; int eclipsesFound = 0; getline(cin, value); for (int i = 0; i < s.length(); i ++) { if (value.at(i) == '-' || value.at(i) == ',') { } else if (isdigit(value.at(i)) == 0) { valid = false; } } if (valid == true) { if (atoi(value.c_str()) == sortedBy) { search(outputArray, arrayPointer, 0, arrayPointer->getElementNum() - 1, atoi(s.c_str() - 1), value); } else { for (int i = 0; i < arrayPointer->getElementNum(); i ++) { if (arrayPointer->getData(i)->getData(atoi(s.c_str()) - 1) == value) { Eclipse* eclipse1; eclipse1 = arrayPointer->getData(i); outputArray.Add(eclipse1); eclipsesFound ++; } } } for (int i = 0; i < 10; i ++) { cout << header[i] << endl; } cout << outputArray; cout << "Eclipses found: " << eclipsesFound << endl; } } else if (s == "6" || s == "10" || s == "13" || s == "14" || s == "18") { int eclipsesFound = 0; cout << "Please select a value to search for" << endl; string value; //cin >> value; getline(cin, value); if (atoi(value.c_str()) == sortedBy) { search(outputArray, arrayPointer, 0, arrayPointer->getElementNum() - 1, atoi(s.c_str() - 1), value); } else { for (int i = 0; i < arrayPointer->getElementNum(); i ++) { if (arrayPointer->getData(i)->getData(atoi(s.c_str()) - 1) == value) { Eclipse* eclipse1; eclipse1 = arrayPointer->getData(i); outputArray.Add(eclipse1); eclipsesFound ++; } } } for (int i = 0; i < 10; i ++) { cout << header[i] << endl; } cout << outputArray; cout << "Eclipses found: " << eclipsesFound << endl; } else if (s == "4") { int eclipsesFound = 0; cout << "Please select a value to search for" << endl; string value; getline(cin, value); if (value == "Jan" || value == "Feb" || value == "Mar" || value == "Apr" || value == "May" || value == "Jun" || value == "Jul" || value == "Aug" || value == "Sep" || value == "Oct" || value == "Nov" || value == "Dec") { if (atoi(value.c_str()) == sortedBy) { search(outputArray, arrayPointer, 0, arrayPointer->getElementNum() - 1, atoi(s.c_str() - 1), value); } else { for (int i = 0; i < arrayPointer->getElementNum(); i ++) { if (arrayPointer->getData(i)->getData(atoi(s.c_str()) - 1) == value) { Eclipse* eclipse1; eclipse1 = arrayPointer->getData(i); outputArray.Add(eclipse1); eclipsesFound ++; } } } for (int i = 0; i < 10; i ++) { cout << header[i] << endl; } cout << outputArray; cout << "Eclipses found: " << eclipsesFound << endl; } } } if (userInput == "O") { string s; ofstream outFile; cout << "Please specify a file to write to" << endl; getline(cin, s); if (s == "") { for (int i = 0; i < 10; i ++) { cout << header[i] << endl; } cout << *arrayPointer; cout << "Data lines read: " << linesRead << "; Valid eclipses read: " << validEclipses << "; Eclipses in memory: " << array.getElementNum() << endl; } else { outFile.open(s); if (outFile.is_open()) { cerr << "File is not available." << endl; } else { for (int i = 0; i < 10; i ++) { outFile << header[i] << endl; } outFile << array; outFile << "Data lines read: " << linesRead << "; Valid eclipses read: " << validEclipses << "; Eclipses in memory: " << array.getElementNum() << endl; } } } } return 0; }
[ "noreply@github.com" ]
noreply@github.com
984b67a30bf65b74bf4aca895db8ce9648dcbba4
69390a173b8be35783f7c9dfd24b5157f8c03324
/webkit/Source/WebCore/platform/graphics/helix/pub/hxcomponent.h
404e134afcc644ba08a4b4ce70c2fa884fd84586
[]
no_license
zhxinx/HelixInWebkit
9e766654345da242371a6c75389ebc6b952eca97
4ff8292b194c41671ad511446562fd2e484ee496
refs/heads/master
2020-12-24T14:36:59.938338
2012-08-17T03:35:57
2012-08-17T03:35:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,774
h
/* ***** BEGIN LICENSE BLOCK ***** * Source last modified: $Id: hxcomponent.h,v 1.2 2007/07/06 21:58:18 jfinnecy Exp $ * * Portions Copyright (c) 1995-2006 RealNetworks, Inc. All Rights Reserved. * * The contents of this file, and the files included with this file, * are subject to the current version of the RealNetworks Public * Source License (the "RPSL") available at * http://www.helixcommunity.org/content/rpsl unless you have licensed * the file under the current version of the RealNetworks Community * Source License (the "RCSL") available at * http://www.helixcommunity.org/content/rcsl, in which case the RCSL * will apply. You may also obtain the license terms directly from * RealNetworks. You may not use this file except in compliance with * the RPSL or, if you have a valid RCSL with RealNetworks applicable * to this file, the RCSL. Please see the applicable RPSL or RCSL for * the rights, obligations and limitations governing use of the * contents of the file. * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 (the * "GPL") in which case the provisions of the GPL are applicable * instead of those above. If you wish to allow use of your version of * this file only under the terms of the GPL, and not to allow others * to use your version of this file under the terms of either the RPSL * or RCSL, indicate your decision by deleting the provisions above * and replace them with the notice and other provisions required by * the GPL. If you do not delete the provisions above, a recipient may * use your version of this file under the terms of any one of the * RPSL, the RCSL or the GPL. * * This file is part of the Helix DNA Technology. RealNetworks is the * developer of the Original Code and owns the copyrights in the * portions it created. * * This file, and the files included with this file, is distributed * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET * ENJOYMENT OR NON-INFRINGEMENT. * * Technology Compatibility Kit Test Suite(s) Location: * http://www.helixcommunity.org/content/tck * * Contributor(s): * * ***** END LICENSE BLOCK ***** */ #ifndef _HXCOMPONENT_H_ #define _HXCOMPONENT_H_ #include "unkimp.h" struct IHXPackage_ { virtual void OnComponentBirth () = 0; virtual void OnComponentDeath () = 0; }; // XXXHP - note this is unsafe, we shouldn't be defining COM create funcs on // managed components, this is here for the sole purpose of easing migration. #define DECLARE_MANAGED_COMPONENT(ComponentName_) \ DECLARE_UNKNOWN_NOCREATE (ComponentName_) \ DECLARE_COM_CREATE_FUNCS (ComponentName_) #define DECLARE_UNMANAGED_COMPONENT(ComponentName_) \ DECLARE_UNKNOWN_NOCREATE (ComponentName_) \ static ComponentName_* CreateUnmanagedObject (); \ static HX_RESULT CreateUnmanagedObject(ComponentName_** ppObj); \ static HX_RESULT CreateUnmanagedInstance(IUnknown** ppvObj); \ static HX_RESULT CreateUnmanagedInstance(IUnknown* pvOuter, IUnknown** ppvObj); #define DECLARE_UNMANAGED_COMPONENT_NOCREATE(ComponentName_) \ DECLARE_UNKNOWN_NOCREATE (ComponentName_) #define DECLARE_ABSTRACT_COMPONENT(ComponentName_) \ DECLARE_UNKNOWN_NOCREATE (ComponentName_) #define IMPLEMENT_MANAGED_COMPONENT(ComponentName_) \ IMPLEMENT_COM_CREATE_FUNCS (ComponentName_) #define IMPLEMENT_UNMANAGED_COMPONENT(ComponentName_) \ HX_RESULT ComponentName_::CreateUnmanagedObject(ComponentName_** ppObj) \ { \ *ppObj = new ComponentName_; \ if (*ppObj) \ { \ InterlockedIncrement(&((*ppObj)->m_lCount)); \ HX_RESULT pnrRes = (*ppObj)->FinalConstruct(); \ InterlockedDecrement(&((*ppObj)->m_lCount)); \ if (FAILED(pnrRes)) \ { \ delete (*ppObj); \ (*ppObj) = NULL; \ return pnrRes; \ } \ return HXR_OK; \ } \ return HXR_OUTOFMEMORY; \ } \ ComponentName_* ComponentName_::CreateUnmanagedObject() \ { \ ComponentName_* pNew = NULL; \ if (SUCCEEDED(CreateUnmanagedObject(&pNew))) \ { \ return pNew; \ } \ return NULL; \ } \ HX_RESULT ComponentName_::CreateUnmanagedInstance \ ( \ IUnknown* pvOuterObj, \ IUnknown** ppvObj \ ) \ { \ if (!ppvObj) \ return HXR_POINTER; \ *ppvObj = NULL; \ ComponentName_* pNew = NULL; \ HX_RESULT pnrRes = CreateUnmanagedObject(&pNew); \ if (SUCCEEDED(pnrRes) && pNew) \ { \ pnrRes = pNew->SetupAggregation( pvOuterObj, ppvObj ); \ } \ return pnrRes; \ } \ HX_RESULT ComponentName_::CreateUnmanagedInstance(IUnknown** ppvObj) \ { \ return CreateUnmanagedInstance(NULL, ppvObj); \ } #define IMPLEMENT_UNMANAGED_COMPONENT_NOCREATE(ComponentName_) #define IMPLEMENT_ABSTRACT_COMPONENT(ComponentName_) #define BEGIN_COMPONENT_INTERFACE_LIST(ComponentName_) \ BEGIN_INTERFACE_LIST_NOCREATE (ComponentName_) #define HXCOMPONENT_MANAGED_COMPONENT_MANGLE_(ComponentName_) \ CHXManagedComponent_##ComponentName_##_ #ifdef HX_REGISTER_ALL_COMPONENTS_ #define REGISTER_MANAGED_COMPONENT(ComponentName_) \ class HXCOMPONENT_MANAGED_COMPONENT_MANGLE_(ComponentName_) : public ComponentName_ \ { \ typedef HXCOMPONENT_MANAGED_COMPONENT_MANGLE_(ComponentName_) CSelf; \ IHXPackage_& m_package; \ public: \ HXCOMPONENT_MANAGED_COMPONENT_MANGLE_(ComponentName_) (IHXPackage_& package) : m_package (package) { m_package.OnComponentBirth (); } \ virtual ~HXCOMPONENT_MANAGED_COMPONENT_MANGLE_(ComponentName_) () { m_package.OnComponentDeath (); } \ static HX_RESULT CreateManagedInstance (IHXPackage_& package, IUnknown* pIUnk, IUnknown** ppIUnk) \ { \ if (!ppIUnk) return HXR_POINTER; \ *ppIUnk = NULL; \ CSelf* pNew = new CSelf (package); \ if (!pNew) return HXR_OUTOFMEMORY; \ \ InterlockedIncrement (&(pNew->m_lCount)); \ HX_RESULT res = pNew->FinalConstruct (); \ InterlockedDecrement (&(pNew->m_lCount)); \ if (FAILED (res)) \ { \ delete pNew; \ return res; \ } \ return pNew->SetupAggregation (pIUnk, ppIUnk); \ } \ }; #else #define REGISTER_MANAGED_COMPONENT(ComponentName_) #endif #endif // _HXCOMPONENT_H_
[ "collins@collins-ThinkPad-T400.(none)" ]
collins@collins-ThinkPad-T400.(none)
cfeaaf3eacfc6970c04481202ef51c16b4b11f02
678289d61b82b284090d565af316ea1c032ae47e
/Logo/paper.h
4f81581e132fd194805e53106674fa900cf17d0c
[]
no_license
rittakos/Logo
22888074b404b6d8cab1a41cf236c14c9d4292f8
a4709205a159f153147abaae1eb956de25583f8d
refs/heads/master
2023-07-10T00:52:52.552501
2020-10-04T22:53:34
2020-10-04T22:53:34
288,248,356
0
0
null
null
null
null
UTF-8
C++
false
false
573
h
#ifndef PAPER_H #define PAPER_H #include "drawable.h" #include "turtle.h" #include <string> #include <SFML/Graphics.hpp> class Paper final : public Drawable { public: Paper() { //++numOfPapers_; //name_ = "paper" + std::to_string(numOfPapers_); } virtual void draw(std::unique_ptr<sf::RenderWindow>& window) final { sf::RectangleShape paperShape(sf::Vector2f(100, 100)); paperShape.setFillColor(sf::Color::White); window->draw(paperShape); Turtle turtle; turtle.draw(window); } private: static int numOfPapers_; std::string name_; }; #endif
[ "akos.rittgasszer@gmail.com" ]
akos.rittgasszer@gmail.com
c329f831756ed3cb08475b959b8f92e988ae53cf
08189dbd3f434d3ed76984e9233a8ae8ddcd14e2
/Week 7/Week 7/string_class.cpp
b3f1eea8c1735110b6bc4cbc981092a3607af8be
[]
no_license
Lastbastian/C-me
ee8c8ef83025b2281211ef33fa90f8383637b292
e9e42cf7ba559ee800dd88c58918d2d02a91f2bb
refs/heads/master
2021-01-10T16:54:34.087828
2015-12-15T19:31:13
2015-12-15T19:31:13
45,144,638
0
0
null
null
null
null
UTF-8
C++
false
false
650
cpp
#include <iostream> #include <string> using namespace std; void dollarFormat(string &); // Function Prototype int main() { string input; cout << "Enter the dollar amount in the form of nnnn.nn :"; cin >> input; dollarFormat(input); cout << "Here is the amount formatted: " << input << endl; return 0; } void dollarFormat(string &currency) { int dp; dp = currency.find('.'); // Find decimal point in string if (dp > 3) { for (int x = dp - 3; x > 0; x -= 3) currency.insert(x, ","); // insert "," at x } currency.insert(0, "$"); }
[ "peacethrubeats@gmail.com" ]
peacethrubeats@gmail.com
36fef609c13bae2970f30bbe6dc81f7e1948abca
dc9959be244ed9285a03a10fbc6046ea75f17f5d
/testing/experimental/vector/fill_assign.cpp
fa179d53429f582af99bc346ae92aaa8413a0ed2
[]
no_license
sali98/agency
09d708555bd329b32a5dd48ba339d163257ee074
022c69d37064542cde7d20c8401efdace08fa68e
refs/heads/master
2021-01-21T08:25:22.727368
2017-05-12T20:31:34
2017-05-12T20:31:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,116
cpp
#include <iostream> #include <cassert> #include <algorithm> #include <agency/experimental/vector.hpp> void test_reallocating_fill_assign() { using namespace agency::experimental; { // test fill assign into empty vector vector<int> v; size_t num_elements_to_assign = 5; int assign_me = 7; v.assign(num_elements_to_assign, assign_me); assert(v.size() == num_elements_to_assign); assert(std::count(v.begin(), v.end(), assign_me) == static_cast<int>(v.size())); } { // test fill assign into small vector vector<int> v(3); size_t num_elements_to_assign = 5; int assign_me = 7; v.assign(num_elements_to_assign, assign_me); assert(v.size() == num_elements_to_assign); assert(std::count(v.begin(), v.end(), assign_me) == static_cast<int>(v.size())); } } void test_nonreallocating_fill_assign() { using namespace agency::experimental; { // test range assign into empty vector with capacity vector<int> v; size_t num_elements_to_assign = 5; v.reserve(5); int assign_me = 7; v.assign(num_elements_to_assign, assign_me); assert(v.size() == num_elements_to_assign); assert(std::count(v.begin(), v.end(), assign_me) == static_cast<int>(v.size())); } { // test range assign into small vector with capacity vector<int> v(3); size_t num_elements_to_assign = 5; v.reserve(5); int assign_me = 7; v.assign(num_elements_to_assign, assign_me); assert(v.size() == num_elements_to_assign); assert(std::count(v.begin(), v.end(), assign_me) == static_cast<int>(v.size())); } { // test range assign into large vector size_t num_elements_to_assign = 5; vector<int> v(2 * num_elements_to_assign); int assign_me = 7; v.assign(num_elements_to_assign, assign_me); assert(v.size() == num_elements_to_assign); assert(std::count(v.begin(), v.end(), assign_me) == static_cast<int>(v.size())); } } int main() { test_reallocating_fill_assign(); test_nonreallocating_fill_assign(); std::cout << "OK" << std::endl; return 0; }
[ "jaredhoberock@gmail.com" ]
jaredhoberock@gmail.com
fbdd5b026fe13fd4e89592a54fdeea9cef03d0a6
982d5c1daf1c4ebfd79e8fa7a48a4f4d4c0344c5
/src/grwsolve.cpp
8b56e5d784eea95d7eeee02d17d1251f0e29af6a
[ "MIT" ]
permissive
Qinch/GRW
652c4d510e4ebeaa705b818a4cb841d171b33883
33531611d45d96d7172b79fe26485c6c1b1eb52e
refs/heads/master
2021-01-18T21:45:05.415957
2016-06-13T06:37:15
2016-06-13T06:37:15
39,170,841
0
0
null
null
null
null
UTF-8
C++
false
false
3,175
cpp
#include<stdarg.h> #include "grid.h" #include "grwsolve.h" #include "grwstep.h" #define LONGWALK 29999999 inline void round(double t,int &ret,double prob,int flag, Random &rnd) { if(rnd.getrand()<prob) { ret=(int)t+flag; // fprintf(stderr,"prob=%lf %d %d\n",prob,ret,ret-flag); } else ret=(int)t; //fprintf(stderr,"%d\n",ret); return; } inline void cxy2xy(grid* g,double tx,double ty,int pln,int &x,int &y,double &factor,Random &rnd) { double pm; if( ((g->minx[pln]+0.5)>tx) || ((g->maxx[pln]-0.5)<tx) ) { if( (ty<(g->miny[pln]+0.5)) || (ty>(g->maxy[pln]-0.5)) )//位于四个角; { x=(int)tx; y=(int)ty; } else { x=(int)tx; if( ty< ((int)ty+0.5) ) { pm=0.5-(ty-(int)ty); round(ty,y,pm,-1,rnd); } else { pm=(ty-(int)ty-0.5); round(ty,y,pm,1,rnd); } } } else if( (ty<(g->miny[pln]+0.5)) || (ty>(g->maxy[pln]-0.5)) ) { if( tx< ((int)tx+0.5) ) { pm=0.5-(tx-(int)tx); round(tx,x,pm,-1,rnd); } else { pm=(tx-(int)tx-0.5); round(tx,x,pm,1,rnd); } y=(int)ty; } else { if( tx< ((int)tx+0.5) ) { pm=0.5-(tx-(int)tx); round(tx,x,pm,-1,rnd); } else { pm=(tx-(int)tx-0.5); round(tx,x,pm,1,rnd); } if( ty<((int)ty+0.5) ) { pm=0.5-(ty-(int)ty); round(ty,y,pm,-1,rnd); } else { pm=(ty-(int)ty-0.5); round(ty,y,pm,1,rnd); } } factor=getfactor(g,x,y,pln); return ; } double grwsolve(Random &rnd,grid* g,int z,int initlayer,double error,double& hops,int &walks,bool args_a,...)//采用变长参数实现; { //随机行走终止条件; //sqrt((sum(t^2)-sum(t)^2/n)/n)/sqrt(n)<err // sum(t^2)-sum(t)^2/n<n^2*err^2 // sum(t)^2/n>sum(t^2)-n^2*err^2 // To:sum(t)^2>n(sum(t^2)-n^2*err^2) //err=error*sum(t)/n //Thus, sum(t)^2>n(sum(t^2)-error^2*t^2) walks=0; hops=0; double factor; double t=0; double tsquare=0; int x,y; double tx,ty; va_list args; va_start(args,args_a); if(args_a)//随机生成待测点,自动计算; { x=va_arg(args,int); y=va_arg(args,int); factor=va_arg(args,double); } else//手工输入待测点xy坐标; { tx=va_arg(args,double); ty=va_arg(args,double); } va_end(args); while( (walks<50) || (t*t)< walks*(tsquare-t*t*error*error) ) { if(!args_a)//将手工输入的xy坐标点转换为体积元个数计数; { cxy2xy(g,tx,ty,initlayer,x,y,factor,rnd); } int step=0; int walkx=x,walky=y,walkz=z; double patht=0;//该次随机行走计算得到的温度; int layer=initlayer; while(walkz<g->maxz) { if (g->power[walkz]!=NULL) { if (g->power[walkz][walkx]!=NULL) { patht+=g->power[walkz][walkx][walky]; } } step++; if (step>=LONGWALK) break; grwstep(g,walkx,walky,walkz,layer,rnd); }//一次随机行走结束; hops+=step; if (step>=LONGWALK) continue; patht=patht/factor; patht+=g->m.tout;//加上环境温度; walks++; t+=patht; tsquare+=patht*patht; } hops/=walks; return t/walks; }
[ "1187620726@qq.com" ]
1187620726@qq.com
03e27bb8a7f044911d09ab8fc8d6944c4af9f4b8
eefb6c2f62b23d7e1be0a25b014d52db94a2c15b
/build-cncMain-Desktop_Qt_5_1_1_GCC_32bit-Debug/moc_widget.cpp
3ec007612d54073bdb339d0abfa7f5874b471c34
[]
no_license
lycchang/cncMMI
120e4f447ffd56eb3b32762644bd35dc08b95b43
c095f43467deb6fd4f0fcf95fe45640ce952f874
refs/heads/master
2022-04-01T12:52:29.751693
2017-08-30T01:41:34
2017-08-30T01:41:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,751
cpp
/**************************************************************************** ** Meta object code from reading C++ file 'widget.h' ** ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.1.1) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../cncMain/widget.h" #include <QtCore/qbytearray.h> #include <QtCore/qmetatype.h> #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'widget.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 67 #error "This file was generated using the moc from 5.1.1. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE struct qt_meta_stringdata_Widget_t { QByteArrayData data[15]; char stringdata[151]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ offsetof(qt_meta_stringdata_Widget_t, stringdata) + ofs \ - idx * sizeof(QByteArrayData) \ ) static const qt_meta_stringdata_Widget_t qt_meta_stringdata_Widget = { { QT_MOC_LITERAL(0, 0, 6), QT_MOC_LITERAL(1, 7, 7), QT_MOC_LITERAL(2, 15, 0), QT_MOC_LITERAL(3, 16, 12), QT_MOC_LITERAL(4, 29, 17), QT_MOC_LITERAL(5, 47, 9), QT_MOC_LITERAL(6, 57, 10), QT_MOC_LITERAL(7, 68, 26), QT_MOC_LITERAL(8, 95, 7), QT_MOC_LITERAL(9, 103, 7), QT_MOC_LITERAL(10, 111, 3), QT_MOC_LITERAL(11, 115, 4), QT_MOC_LITERAL(12, 120, 12), QT_MOC_LITERAL(13, 133, 9), QT_MOC_LITERAL(14, 143, 6) }, "Widget\0refresh\0\0buildConnect\0" "refreshServerData\0loadPlugs\0pluginName\0" "excuteSoftKeyboardFunction\0btnName\0" "recvMsg\0str\0str1\0timerRefresh\0onOffLine\0" "linked\0" }; #undef QT_MOC_LITERAL static const uint qt_meta_data_Widget[] = { // content: 7, // revision 0, // classname 0, 0, // classinfo 8, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 3, // signalCount // signals: name, argc, parameters, tag, flags 1, 0, 54, 2, 0x05, 3, 0, 55, 2, 0x05, 4, 0, 56, 2, 0x05, // slots: name, argc, parameters, tag, flags 5, 1, 57, 2, 0x08, 7, 1, 60, 2, 0x08, 9, 2, 63, 2, 0x08, 12, 0, 68, 2, 0x08, 13, 1, 69, 2, 0x08, // signals: parameters QMetaType::Void, QMetaType::Void, QMetaType::Void, // slots: parameters QMetaType::Void, QMetaType::QString, 6, QMetaType::Void, QMetaType::QString, 8, QMetaType::Void, QMetaType::QString, QMetaType::QString, 10, 11, QMetaType::Void, QMetaType::Void, QMetaType::Bool, 14, 0 // eod }; void Widget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Widget *_t = static_cast<Widget *>(_o); switch (_id) { case 0: _t->refresh(); break; case 1: _t->buildConnect(); break; case 2: _t->refreshServerData(); break; case 3: _t->loadPlugs((*reinterpret_cast< QString(*)>(_a[1]))); break; case 4: _t->excuteSoftKeyboardFunction((*reinterpret_cast< QString(*)>(_a[1]))); break; case 5: _t->recvMsg((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break; case 6: _t->timerRefresh(); break; case 7: _t->onOffLine((*reinterpret_cast< bool(*)>(_a[1]))); break; default: ; } } else if (_c == QMetaObject::IndexOfMethod) { int *result = reinterpret_cast<int *>(_a[0]); void **func = reinterpret_cast<void **>(_a[1]); { typedef void (Widget::*_t)(); if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&Widget::refresh)) { *result = 0; } } { typedef void (Widget::*_t)(); if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&Widget::buildConnect)) { *result = 1; } } { typedef void (Widget::*_t)(); if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&Widget::refreshServerData)) { *result = 2; } } } } const QMetaObject Widget::staticMetaObject = { { &QWidget::staticMetaObject, qt_meta_stringdata_Widget.data, qt_meta_data_Widget, qt_static_metacall, 0, 0} }; const QMetaObject *Widget::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *Widget::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_Widget.stringdata)) return static_cast<void*>(const_cast< Widget*>(this)); return QWidget::qt_metacast(_clname); } int Widget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 8) qt_static_metacall(this, _c, _id, _a); _id -= 8; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 8) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 8; } return _id; } // SIGNAL 0 void Widget::refresh() { QMetaObject::activate(this, &staticMetaObject, 0, 0); } // SIGNAL 1 void Widget::buildConnect() { QMetaObject::activate(this, &staticMetaObject, 1, 0); } // SIGNAL 2 void Widget::refreshServerData() { QMetaObject::activate(this, &staticMetaObject, 2, 0); } QT_END_MOC_NAMESPACE
[ "zhou.yang@sibonac.com" ]
zhou.yang@sibonac.com
1d0313e516aea495bebe413dff7f223789a6a38d
0a6265fe36c7a966e02798fba113d0e745f38000
/ServerChar/server.cpp
21af342e062dcc969a675e3b823e7319ad302fc7
[]
no_license
VictorLadyzhets/TCP-Chat
669f04c47ebf68f591254264aaf619de4791b042
a50e9ea2e20b982f2a3d0eca43d6a8117ddb0689
refs/heads/master
2021-01-10T15:22:39.774988
2016-02-27T19:28:57
2016-02-27T19:28:57
52,684,437
0
0
null
2016-02-27T19:32:21
2016-02-27T19:22:48
C++
UTF-8
C++
false
false
4,895
cpp
#include "server.h" #include<QVBoxLayout> #include<QTime> #include<QLabel> #include<QString> #include<string> #include<iterator> using namespace std; Server::Server(quint16 nport,QWidget *parent) : QWidget(parent) { log = new QTextEdit(); log->setReadOnly(true); blockSize=0; port = nport; server= new QTcpServer(this); if(!server->listen(QHostAddress::Any,port)) { log->append("Cannot run the server!"+server->errorString()); server->close(); return; } log->append("Server runned!"); connect(server,SIGNAL(newConnection()),SLOT(onNewConnection())); QVBoxLayout* pvbxLayout = new QVBoxLayout; pvbxLayout->addWidget(new QLabel("<H1>Server</H1>")); pvbxLayout->addWidget(log); setLayout(pvbxLayout); } void Server::onNewConnection() { QTcpSocket* socket = server->nextPendingConnection(); Clients.push_back(socket); ClientNames.insert(socket,"Guest"); log->append("new connection"); connect(socket,SIGNAL(disconnected()),SLOT(onDisconect())); connect(socket,SIGNAL(readyRead()),this,SLOT(onReadyRead())); SendToClient(socket,"Now you are connected!:)"); SendToClients("USR"+GetOnlineUsers()); } void Server::onDisconect() { QTcpSocket * sock = qobject_cast<QTcpSocket *>(sender()); for(int i=1;i<Clients.size();i++) if(Clients[i]==sock) Clients.erase(Clients.begin()+i,Clients.begin()+i+1); ClientNames.erase(ClientNames.find(sock)); log->append("user disconected"); QString response = "USR"+ GetOnlineUsers(); log->append(response); SendToClients(response); } void Server::onReadyRead() { QTcpSocket* socket = (QTcpSocket*)sender(); QDataStream in(socket); in.setVersion(QDataStream::Qt_4_2); QByteArray ba; for(;;) { if(!blockSize) { if(socket->bytesAvailable()<sizeof(quint16)) break; in >> blockSize; ba = socket->readAll(); QString s(ba); QString sizeB= ""; for(int i=0;i<1;i++) sizeB.append(s[i]); blockSize = sizeB.toInt(); } if(socket->bytesAvailable() < blockSize) { break; } QByteArray baa = socket->readAll(); QString str(ba+baa); log->append("FromClient"+str); str= (str[0]=='M' ? "S" : (str[0]=='U' ? "C" : "U")) + str; blockSize=0; QString response = MakeResponse(str,socket); log->append("response " + str); SendToClients(response); } } QString Server::MakeResponse(QString msg,QTcpSocket* socket) { QString response; QString comand = ""; for(int i=0;i<3;i++) comand = comand + msg[i]; if(comand =="SMS") { response = ""; for(int i=3;i<msg.length();i++) response = response + msg[i]; return "SMS"+response; } if(comand=="USR") { response = GetOnlineUsers(); return "USR"+response; } if(comand=="CUN") { // QMap<QTcpSocket*,QString>::Iterator i = ClientNames.find(socket); QString response("SMS"); QString newName=""; for(int i=3;i<msg.length();i++) newName= newName + msg[i]; QString oldName= ClientNames[socket]; response = response + " " + oldName + " changed nickname into " + newName; ClientNames[socket]=newName; //SendToClients("USR" + GetOnlineUsers()); return response; } return "Default response"; } QString Server::GetOnlineUsers() { //QMapIterator<QTcpSocket,QString> i(ClientNames); /*QString response=i.value()+","; while(i.hasNext()) { response = response + i.value()+ ","; i.next(); }*/ QString response=""; foreach(QString str,ClientNames) response = response + str +","; return response; } void Server::SendToClient(QTcpSocket *socket, QString message) { QByteArray arrBlock; QByteArray tmpBlock; tmpBlock = message.toUtf8(); quint16 size = tmpBlock.size(); arrBlock.append(quint16(size-sizeof(quint16))); arrBlock.append(tmpBlock); QString s(arrBlock); //for(int i=0;i<Clients.size();i++) socket->write(arrBlock); } void Server::SendToClients(QString message) { QByteArray arrBlock; QByteArray tmpBlock; tmpBlock = message.toUtf8(); quint16 size = tmpBlock.size(); arrBlock.append(quint16(size-sizeof(quint16))); arrBlock.append(tmpBlock); QString s(arrBlock); for(int i=0;i<Clients.size();i++) Clients[i]->write(arrBlock); }
[ "victor.ladyzhets@gmail.com" ]
victor.ladyzhets@gmail.com
5191eeeccfae69d68f55111180f012f12cf3a10a
bdc4c171d70df3262c30915c301bac343dd8f0b0
/tivaCppLIte/tivaCppLibrary/demos/isca/labs/tutorial_pyside_1.hpp
b98c2302f4396cc2129fc0e6362ea65ce615af9d
[]
no_license
wilsanph/tivaCppLib
d3711686f495b3c44de91017367552e03d3d019f
6546ce80f2ebb828b73ad82af2a3b6317423eb8c
refs/heads/master
2021-01-20T11:01:36.008185
2015-06-27T19:12:57
2015-06-27T19:12:57
38,169,204
0
0
null
null
null
null
UTF-8
C++
false
false
2,250
hpp
#include "tivaCppLibrary/include/Gpio.hpp" #include "tivaCppLibrary/include/clock.hpp" #include "tivaCppLibrary/delays.hpp" #include "tivaCppLibrary/include/Uart.h" #include "tivaCppLibrary/include/Core.hpp" #include "tivaCppLibrary/interrupts.hpp" #include "math.h" #define HOST_STEP_TIME 0.025 double simTime = 0; u8 buffTx[6] = {0,0,0,0,0,0}; double x1 = 0; double x2 = 0; double x3 = 0; u16 x1_u16 = 0; u16 x2_u16 = 0; u16 x3_u16 = 0; int main() { clock::clock::config(clock::configOptions::clockSource::mainOscilator, clock::configOptions::clockRate::clock_80Mhz); Gpio::enableClock(Gpio::peripheral::GPIOF); Gpio::enableClock(Gpio::peripheral::GPIOA); PF2::enableAsDigital(); PF2::setMode(Gpio::options::mode::gpio); PF2::setIOmode(Gpio::options::IOmode::output); PA0::enableAsDigital(); PA0::setMode(Gpio::options::mode::alternate); PA0::setAlternateMode(Gpio::options::altModes::alt1); PA1::enableAsDigital(); PA1::setMode(Gpio::options::mode::alternate); PA1::setAlternateMode(Gpio::options::altModes::alt1); UART0::enableClock(); UART0::configUart(uart::configOptions::baudrate::baud_1000000); core::IntEnableMaster(); core::enableInterrupt(core::interrupts::uart0); while(1) { PF2::toogle(); delays::delay_ms(250); } } void interruptFuncs::uart0rxtx_isr() { UART0::clearInterrupts(uart::configOptions::interrupts::receiveInt); u8 foo = UART0::receiveByte(); if ( foo == 's' ) { // Do some stuff xD simTime += HOST_STEP_TIME; x1 = 0.5 + 0.5 * std::cos(simTime); x2 = 0.5 + 0.5 * std::sin(simTime); x3 = 0.5 + 0.5 * std::cos(simTime/2); x1 = ( x1 > 0.99 ) ? 0.99 : x1; x1 = ( x1 < 0.01 ) ? 0.01 : x1; x2 = ( x2 > 0.99 ) ? 0.99 : x2; x2 = ( x2 < 0.01 ) ? 0.01 : x2; x3 = ( x3 > 0.99 ) ? 0.99 : x3; x3 = ( x3 < 0.01 ) ? 0.01 : x3; x1_u16 = (u16)( x1 * 4095.0 ); x2_u16 = (u16)( x2 * 4095.0 ); x3_u16 = (u16)( x3 * 4095.0 ); buffTx[0] = ( x1_u16 & 0xff00 ) >> 8; buffTx[1] = ( x1_u16 & 0x00ff ) >> 0; buffTx[2] = ( x2_u16 & 0xff00 ) >> 8; buffTx[3] = ( x2_u16 & 0x00ff ) >> 0; buffTx[4] = ( x3_u16 & 0xff00 ) >> 8; buffTx[5] = ( x3_u16 & 0x00ff ) >> 0; int i = 0; for( i = 0; i < 6; i++ ) { UART0::sendByte( buffTx[i] ); } } }
[ "wilsanph@gmail.com" ]
wilsanph@gmail.com
09663f2611010fed3ad42c48d326bdd42d36286f
dbf8dba826467239eefac98ebffd3e2e54777ea4
/human_activity_labeling/feature_generation_pcl/src/segment-graph.h
9340d7bbb1031c676e6c10d34f8697de2a75f1e1
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
gz7seven/RGB-D
f3e378d6425485c94699c77bd5c4f3450aa7f010
96bf302780b0f664154a87772564b28a5a39611d
refs/heads/master
2021-01-19T14:28:07.240268
2017-04-13T13:43:42
2017-04-13T13:43:42
88,165,273
0
0
null
null
null
null
UTF-8
C++
false
false
2,228
h
/* Copyright (C) 2006 Pedro Felzenszwalb 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. 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. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef FEATURE_GENERATION_PCL_SRC_SEGMENT_GRAPH_H_ #define FEATURE_GENERATION_PCL_SRC_SEGMENT_GRAPH_H_ #include <algorithm> #include <cmath> #include "./disjoint-set.h" // threshold function #define THRESHOLD(size, c) (c/size) typedef struct { float w; int a, b; } edge; bool operator<(const edge &a, const edge &b) { return a.w < b.w; } /* * Segment a graph * * Returns a disjoint-set forest representing the segmentation. * * num_vertices: number of vertices in graph. * num_edges: number of edges in graph * edges: array of edges. * c: constant for treshold function. */ universe *segment_graph(int num_vertices, int num_edges, edge *edges, float c) { // sort edges by weight std::sort(edges, edges + num_edges); // make a disjoint-set forest universe *u = new universe(num_vertices); // init thresholds float *threshold = new float[num_vertices]; for (int i = 0; i < num_vertices; i++) threshold[i] = THRESHOLD(1, c); // for each edge, in non-decreasing weight order... for (int i = 0; i < num_edges; i++) { edge *pedge = &edges[i]; // components conected by this edge int a = u->find(pedge->a); int b = u->find(pedge->b); if (a != b) { if ((pedge->w <= threshold[a]) && (pedge->w <= threshold[b])) { u->join(a, b); a = u->find(a); threshold[a] = pedge->w + THRESHOLD(u->size(a), c); } } } // free up delete threshold; return u; } #endif // FEATURE_GENERATION_PCL_SRC_SEGMENT_GRAPH_H_
[ "2490347579@qq.com" ]
2490347579@qq.com
685ac0be2913ba26241d2f7d9e57169b6b2bb387
aac8d1f963f0772ed26da4a5428d9770486b71af
/lazy_prop.cpp
b8d0593c6ab7902f3be98a6159176f3a485e96b4
[]
no_license
shreyrastogi/icpc-templates
79d8a6801566ccd9b1175bc7e50d53f2c5af28c1
58a63dc085539075b2a0d5d1e263f6449fa6feb3
refs/heads/master
2020-12-09T04:33:30.584916
2019-10-03T00:14:28
2019-10-03T00:14:28
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,004
cpp
#include <bits/stdc++.h> using namespace std; #define sd(x) scanf("%d", &x) #define slld(x) scanf("%lld", &x) #define all(x) x.begin(), x.end() #define For(i, st, en) for(ll i=st; i<en; i++) #define tr(x) for(auto it=x.begin(); it!=x.end(); it++) #define pb push_back #define ll long long #define mp make_pair #define F first #define S second #define MAXN 100005 // sum of elements in a range, replace int by ll if req int tree[4*MAXN]; int lazy[4*MAXN]={0}; int arr[5] = {5,2,3,1,4}; void build(int index, int l, int r){ if(l>r){ return; } if(l==r){ tree[index]=arr[l]; return; } int mid = (l+r)>>1; build(2*index, l, mid); build(2*index+1, mid+1, r); tree[index]=tree[2*index]+tree[2*index+1]; } void range_update(int index, int l, int r, int x, int y, int val){ if(lazy[index]!=0){ tree[index]+=(r-l+1)*lazy[index]; if(l!=r){ lazy[2*index]+=lazy[index]; lazy[2*index+1]+=lazy[index]; } lazy[index]=0; } if(y<x || r<l || l>y || r<x){ return; } if(x<=l && y>=r){ tree[index]+=(r-l+1)*val; if(l!=r){ lazy[2*index]+=val; lazy[2*index+1]+=val; } return; } int mid = (l+r)>>1; range_update(2*index, l, mid, x, y, val); range_update(2*index+1, mid+1, r, x, y, val); tree[index]=tree[2*index]+tree[2*index+1]; } int query(int index, int x, int y, int l, int r){ // work on lazy stored values if(lazy[index]!=0){ tree[index]+=(r-l+1)*lazy[index]; if(l!=r){ lazy[2*index]+=lazy[index]; lazy[2*index+1]+=lazy[index]; } lazy[index]=0; } if(y<x || r<l || l>y || r<x){ return 0; } if(x<=l && y>=r){ return tree[index]; } int mid = (l+r)>>1; int z1 = query(2*index, x, y, l, mid); int z2 = query(2*index+1, x, y, mid+1, r); return z1+z2; } int main(){ // build segment tree build(1, 0, 4); int x=1, y=3, ans; // query on range (1, 3) ans = query(1, x, y, 0, 4); cout<<ans<<endl; // inc the elements in the range [2, 4] by 2 range_update(1, 0, 4, 2, 4, 2); ans = query(1, x, y, 0, 4); cout<<ans<<endl; return 0; }
[ "swapnil.negi09@gmail.com" ]
swapnil.negi09@gmail.com
89326b2bdcde255626677c6628d9b0c2a9fda414
dc915712cd2192e4531d7fa2263454b2afc22839
/collisionclass.h
e335609f6495cd3c2107b19515f92ead6eea2b24
[]
no_license
rekotc/picking-cubes
6b2cd06e90f0b26cd6dd57e4eda06e9bf5ed9fdf
c5b3c9ce89ef31dd02247e3417ddd215808c5173
refs/heads/master
2021-01-21T04:54:21.196028
2016-05-28T15:25:31
2016-05-28T15:25:31
42,111,602
0
0
null
null
null
null
UTF-8
C++
false
false
782
h
// Filename: collisionclass.h //////////////////////////////////////////////////////////////////////////////// #ifndef _COLLISIONCLASS_H_ #define _COLLISIONCLASS_H #include <math.h> class CollisionClass { public: CollisionClass(); ~CollisionClass(); int getClosestId(); int getCurrentSelectedId(); int getCurrentHoverId(); int getCurrentMinDistance(); int getLastSelectedId(); int getLastHoverId(); void setClosestId(int); void setCurrentSelectedId(int); void setCurrentHoverId(int); void setCurrentMinDistance(double); void setLastSelectedId(int); void setLastHoverId(int); void setClicked(bool); bool getClicked(); private: int m_ClosestId, m_SelectedId, m_LastSelectedId, m_HoverId, m_LastHoverId; bool wasClicked; double m_tMinDistance; }; #endif
[ "rekotc@inventati.org" ]
rekotc@inventati.org
e3cf0eff7a84a16ba45e744f9d8ca0e5a58aa67c
78d79a4d975dd5692334b24a8b514dee4c03dade
/include/InstrumentFile.h
2d489c6049d6fc1924c7b440a7c7dfff087fd772
[]
no_license
sjneph/Automated-Power-Test-Station
47c9c311dc5f7f55b3cdaa4642d57138da48fe62
c755abe7c93ad2d0e946a80cc925a43fad390d37
refs/heads/master
2022-08-15T07:05:37.978483
2020-02-03T17:24:35
2020-02-03T17:24:35
238,019,551
0
0
null
null
null
null
UTF-8
C++
false
false
5,970
h
// Macro Guard #ifndef SPTS_INSTRUMENTFILE_H #define SPTS_INSTRUMENTFILE_H // Files included #include "Assertion.h" #include "AuxSupplyTraits.h" #include "InstrumentTypes.h" #include "LoadTraits.h" #include "MainSupplyTraits.h" #include "NoCopy.h" #include "ProgramTypes.h" #include "SingletonType.h" #include "SPTSException.h" #include "SPTSFiles.h" #include "StandardFiles.h" //=====================================================================================// //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Changes <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<// //=====================================================================================// /* ============== 11/14/05, sjn, ============== Added member function: SupplyCCModeChangePause() to reflect changes to actual instrument configuration file. This gathers a pause value depending on which supply is in use. ============== 10/07/05, sjn, ============== Added member function: SetMainSupplyVoltsWithDMM() to reflect changes to actual instrument configuration file. ============== 06/23/05, sjn, ============== Added member funcs for Function Generator use: MaxAmplitude(), MaxDutyCycle(), MaxFrequency(), MaxOffset(), MinAmplitude(), MinDutyCycle() and SetFunctionGeneratorType(). Added fgType_ member variable. Added typedef for PercentType. ============== 03/02/05, sjn, ============== Removed CurrentProbeScales(Types which) to reflect changes to current probe system. ============== 12/20/04, sjn, ============== Added SetScopeType() - allow dynamic loading of oscilloscope types. Added member variable: scopeType_ */ //=====================================================================================// //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Changes <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<// //=====================================================================================// /***************************************************************************************/ ////////////////////////////////////CRANE INTERPOINT///////////////////////////////////// //////////////////////////////////SPACE-POWER DIVISION/////////////////////////////////// /***************************************************************************************/ struct InstrumentFile : public SPTSInstrument::InstrumentTypes, NoCopy { // Public Typedefs typedef ProgramTypes::SetType MinType; typedef ProgramTypes::SetType MaxType; typedef ProgramTypes::PercentType PercentType; typedef ProgramTypes::SetType SetType; //======================== // Start Public Interface //======================== long GetAddress(Types type); std::string GetModelType(Types type); static std::string GetName(Types type); SetType LoadAccuracy(LoadTraits::Channels chan, const SetType& val); SetType LoadResolution(LoadTraits::Channels chan, const SetType& val); MaxType MaxAmplitude(Types funcGen = FUNCTIONGENERATOR); MaxType MaxAmps(LoadTraits::Channels chan); MaxType MaxAmps(MainSupplyTraits::Supply sup); MaxType MaxAmps(AuxSupplyTraits::Channels chan, AuxSupplyTraits::Range r); MaxType MaxAmps(Types currentProbeType); PercentType MaxDutyCycle(Types funcGen = FUNCTIONGENERATOR); MaxType MaxFrequency(Types funcGen = FUNCTIONGENERATOR); MaxType MaximumScale(Types type); MaxType MaximumTemperature(); MaxType MaxOffset(Types funcGen = FUNCTIONGENERATOR); MaxType MaxOhms(LoadTraits::Channels chanz); MaxType MaxVolts(LoadTraits::Channels chan); MaxType MaxVolts(MainSupplyTraits::Supply sup); MaxType MaxVolts(AuxSupplyTraits::Channels chan, AuxSupplyTraits::Range r); MaxType MaxVolts(Types type = DMM); MinType MinAmplitude(Types funcGen = FUNCTIONGENERATOR); PercentType MinDutyCycle(Types funcGen = FUNCTIONGENERATOR); MinType MinimumScale(Types type); MinType MinimumTemperature(); MinType MinOhms(LoadTraits::Channels chan); static std::string Name(); std::pair<MinType, MaxType> ScopeExtTrigLevelRange(); ProgramTypes::SetTypeContainer ScopeHorizontalScales(); std::pair<MinType, MaxType> ScopeHorzScaleRange(); std::pair<MinType, MaxType> ScopeOffsetRange(); ProgramTypes::SetTypeContainer ScopeVerticalScales(); std::pair<MinType, MaxType> ScopeVertScaleRange(); void SetFunctionGeneratorType(const std::string& fgType); bool SetMainSupplyVoltsWithDMM(MainSupplyTraits::Supply sup); void SetScopeType(const std::string& scopeType); SetType SupplyCCModeChangePause(MainSupplyTraits::Supply sup); SetType VoltageAccuracy(MainSupplyTraits::Supply sup); SetType VoltageResolution(MainSupplyTraits::Supply sup); //====================== // End Public Interface //====================== private: friend class SingletonType<InstrumentFile>; InstrumentFile() { /* */ } ~InstrumentFile() { /* */ } private: static std::string name(); std::pair<MinType, MaxType> getScopeRange(const std::string& minVal, const std::string& maxVal); private: FileTypes::InstrumentFileType if_; std::string scopeType_; std::string fgType_; }; #endif // SPTS_INSTRUMENTFILE_H /***************************************************************************************/ ////////////////////////////////////CRANE INTERPOINT///////////////////////////////////// //////////////////////////////////SPACE-POWER DIVISION/////////////////////////////////// /***************************************************************************************/ /*---------------------------------------------------------// "Hardcoded types are to generic code what magic constants are to regular code" - Andrei Alexandrescu //---------------------------------------------------------*/
[ "sjn@localhost.localdomain" ]
sjn@localhost.localdomain
e1a11e21be1535e5edf87443e5069e5c79ef58c7
5838a7513bc677762394e2ce939cf7aa9ac062c5
/pic.cpp
64b1d3ef4223e34a1b1cce5d810a3c36131e1051
[]
no_license
adityaiiitv/OpenCV-work
0029b98eb82e4111d0c210fc202a8b5776322e9c
47c61521d665baac83dd6ad89e5de56ce10b8af0
refs/heads/master
2021-01-19T08:59:20.970715
2017-04-09T12:30:22
2017-04-09T12:30:22
87,706,738
0
0
null
null
null
null
UTF-8
C++
false
false
1,054
cpp
#include "opencv2/highgui/highgui.hpp" // highgui - an easy-to-use interface to video capturing, image and video codecs, as well as simple UI capabilities. #include <iostream> // For basic input / output operations. using namespace cv; // Namespace where all the C++ OpenCV functionality resides using namespace std; int main( int argc, const char** argv ) { Mat img = imread("bat.jpg", CV_LOAD_IMAGE_UNCHANGED); //read the image data in the file "MyPic.JPG" and store it in 'img' if (img.empty()) //check whether the image is loaded or not { cout << "Error : Image cannot be loaded..!!" << endl; //system("pause"); //wait for a key press return -1; } namedWindow("MyWindow", CV_WINDOW_NORMAL); //create a window with the name "MyWindow" imshow("MyWindow", img); //display the image which is stored in the 'img' in the "MyWindow" window waitKey(0); //wait infinite time for a keypress destroyWindow("MyWindow"); //destroy the window with the name, "MyWindow" return 0; }
[ "noreply@github.com" ]
noreply@github.com
b4976d6e8b9f22230ef3238f3dac5d2bc150cf3b
dcab9a52e02c5b5173aa276d687400efab502878
/main.cpp
c27841c97110faa3867db11b6edaa21907ebcd3b
[]
no_license
sebastianUtec/ProyectoPOOI-2
c94e0705f4070976f6be13c85f45ab35ca58bb54
c7b7569dc772a603a4cf96fa61a21c952f288051
refs/heads/master
2020-09-19T21:22:26.980170
2019-11-27T00:08:17
2019-11-27T00:08:17
224,301,601
0
1
null
2019-11-26T23:09:11
2019-11-26T23:02:10
C++
UTF-8
C++
false
false
444
cpp
#include <iostream> #include "CArena.h" #include <vector> using namespace std; int main() { int filas , columnas ; cout<<"ingrese las filas de la arena : ";cin>>filas; cout<<"Ingrese las columnas de la arena : ";cin>>columnas; CArena arenaCompetitiva(filas , columnas); arenaCompetitiva.imprimirArena(); CObjeto mirobot(4 , 1 , 'R'); arenaCompetitiva.agregarobjeto(mirobot); arenaCompetitiva.imprimirArena(); }
[ "noreply@github.com" ]
noreply@github.com
640366b5229c779f8c4d505dd7b4fc11d6e7f07d
bf1f8194a886ee4a22124a105cb0e24e385d4b82
/Contests/LOCJUL16/FORALN/FORALN_0.cpp
1255f844285fa17c016e2a56ac3e608f96f63d2d
[]
no_license
subramaniam97/Competitive-Programming
622450b0278eb137b078043676ffb0c132211821
fcdf154d63480eb992a01ef5f1c7e971a19f97cb
refs/heads/master
2021-01-12T08:41:40.780513
2016-12-16T15:42:52
2016-12-16T15:42:52
76,664,024
0
0
null
null
null
null
UTF-8
C++
false
false
680
cpp
#include<bits/stdc++.h> using namespace std; map<string, pair<int, int> > m; int main() { int n; string s; cin>>n; for(int i = 0; i < n; i++) { cin>>s; string t; t = s[s.length() - 2]; t += s[s.length() - 1]; if(t != "ki" && t != "ka") continue; string u(s.begin(), s.begin() + s.length() - 2); if(t == "ki") m[u].first++; else m[u].second++; } int r = 0; for(map<string, pair<int, int> >::iterator it = m.begin(); it != m.end(); it++) { r += min((*it).second.first, (*it).second.second); } printf("%d\n", r); return 0; }
[ "nitksubbu@gmail.com" ]
nitksubbu@gmail.com
917e24de3413993052582134be69679d81061f38
301f7b35da45e158469d8ac9504ae8458706300d
/oldcpp/Poker_Player_Basic.cpp
3a879ab14d3910393685b151cd0ab16dc2cfdc98
[]
no_license
Kayoku/BasicPoker
4cf519799ce5c1bb6dc6b6ab9646d82e5d3ed29c
b8b70e0d52db0578a508e6b47d2fb89bdb566b38
refs/heads/master
2021-08-30T20:37:05.684317
2017-12-19T10:27:58
2017-12-19T10:27:58
110,948,523
0
0
null
null
null
null
UTF-8
C++
false
false
1,398
cpp
#include "Poker_Player_Basic.h" #include <random> std::string to_move(poker::Move m) { switch(m) { case poker::Move::CALL: return "CALL"; break; case poker::Move::FOLD: return "FOLD"; break; case poker::Move::CHECK: return "CHECK"; break; case poker::Move::RAISE: return "RAISE"; break; default: return "START"; } } //////////////////////////////////////////////////////////////////////////// void poker::Poker_Player_Basic::play() //////////////////////////////////////////////////////////////////////////// { bool update = true; if (all_in) { if (state.nb_raise == 0) current_move = poker::Move::CHECK; else current_move = poker::Move::CALL; } else if (current_move == poker::Move::FOLD) { update = false; current_move = poker::Move::FOLD; } else { std::vector<poker::Move> possible_moves; possible_moves.push_back(poker::Move::FOLD); if (state.current_strong_bet == current_bet) possible_moves.push_back(poker::Move::CHECK); if (state.current_strong_bet > current_bet) possible_moves.push_back(poker::Move::CALL); if (state.nb_raise < 4 && chips+current_bet > state.current_strong_bet) possible_moves.push_back(poker::Move::RAISE); int choice = (unsigned int)rnd()%(unsigned int)possible_moves.size(); current_move = possible_moves[choice]; display_move(); } if (update) update_move(); }
[ "jordan.bouchoucha@gmail.com" ]
jordan.bouchoucha@gmail.com
70d615a2ae7a21ea69d7e781f89945a982bd7096
1873a9410011fadb730c1d3f41bba92b1d9d7fc4
/Assignment/src/Background.cpp
d217e4c508c6d6cb53fee8edebb6bdbdad107abb
[]
no_license
marcustut/OpenGL-Ironman
03da54be640beb1b49232e58d3b3c0ed248cbc43
c7352e7501266eb85df4b381c0dfed8a52597a63
refs/heads/master
2023-04-23T14:39:58.377479
2021-05-05T21:11:23
2021-05-05T21:11:23
331,840,883
0
0
null
null
null
null
UTF-8
C++
false
false
1,279
cpp
#include "Background.h" Background::Background(LPCSTR texturePath): texture(0) { // Load the specified bmp file hBMP = (HBITMAP)LoadImage(GetModuleHandle(NULL), texturePath, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); // Retrieves graphical information from the bmp file GetObject(hBMP, sizeof(BMP), &BMP); } Background::~Background() { DeleteObject(hBMP); glDeleteTextures(1, &texture); } void Background::Draw(GLdouble texCoordX, GLdouble texCoordY, GLdouble texCoordZ) { // Load the bmp grahpics information into OpenGL Texture glEnable(GL_TEXTURE_2D); glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, BMP.bmWidth, BMP.bmHeight, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, BMP.bmBits); // Draw the background with texture loaded glBegin(GL_QUADS); glTexCoord2d(1, 0); glVertex3d(-texCoordX, texCoordY, texCoordZ); glTexCoord2d(1, 1); glVertex3d(texCoordX, texCoordY, texCoordZ); glTexCoord2d(0, 1); glVertex3d(texCoordX, -texCoordY, texCoordZ); glTexCoord2d(0, 0); glVertex3d(-texCoordX, -texCoordY, texCoordZ); glEnd(); glDisable(GL_TEXTURE_2D); }
[ "marcustutorial@hotmail.com" ]
marcustutorial@hotmail.com
8c9d14e4c59f9ff30c23fa5f0e9fa90214ec8e6c
dd80a584130ef1a0333429ba76c1cee0eb40df73
/external/chromium_org/chrome/browser/ui/webui/extensions/extension_settings_handler.h
a79c4f58504ca2d823f1e819346fc24e1ecc91f2
[ "BSD-3-Clause", "MIT" ]
permissive
karunmatharu/Android-4.4-Pay-by-Data
466f4e169ede13c5835424c78e8c30ce58f885c1
fcb778e92d4aad525ef7a995660580f948d40bc9
refs/heads/master
2021-03-24T13:33:01.721868
2017-02-18T17:48:49
2017-02-18T17:48:49
81,847,777
0
2
MIT
2020-03-09T00:02:12
2017-02-13T16:47:00
null
UTF-8
C++
false
false
10,492
h
// 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. #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ #include <set> #include <string> #include <vector> #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_change_registrar.h" #include "base/scoped_observer.h" #include "chrome/browser/extensions/error_console/error_console.h" #include "chrome/browser/extensions/extension_install_prompt.h" #include "chrome/browser/extensions/extension_install_ui.h" #include "chrome/browser/extensions/extension_uninstall_dialog.h" #include "chrome/browser/extensions/extension_warning_service.h" #include "chrome/browser/extensions/requirements_checker.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_ui_message_handler.h" #include "ui/shell_dialogs/select_file_dialog.h" #include "url/gurl.h" class ExtensionService; namespace base { class DictionaryValue; class FilePath; class ListValue; } namespace content { class WebUIDataSource; } namespace user_prefs { class PrefRegistrySyncable; } namespace extensions { class Extension; class ManagementPolicy; // Information about a page running in an extension, for example a popup bubble, // a background page, or a tab contents. struct ExtensionPage { ExtensionPage(const GURL& url, int render_process_id, int render_view_id, bool incognito, bool generated_background_page); GURL url; int render_process_id; int render_view_id; bool incognito; bool generated_background_page; }; // Extension Settings UI handler. class ExtensionSettingsHandler : public content::WebUIMessageHandler, public content::NotificationObserver, public content::WebContentsObserver, public ui::SelectFileDialog::Listener, public ErrorConsole::Observer, public ExtensionInstallPrompt::Delegate, public ExtensionUninstallDialog::Delegate, public ExtensionWarningService::Observer, public base::SupportsWeakPtr<ExtensionSettingsHandler> { public: ExtensionSettingsHandler(); virtual ~ExtensionSettingsHandler(); static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); // Extension Detail JSON Struct for page. |pages| is injected for unit // testing. // Note: |warning_service| can be NULL in unit tests. base::DictionaryValue* CreateExtensionDetailValue( const Extension* extension, const std::vector<ExtensionPage>& pages, const ExtensionWarningService* warning_service); void GetLocalizedValues(content::WebUIDataSource* source); private: friend class ExtensionUITest; friend class BrokerDelegate; // content::WebContentsObserver implementation. virtual void RenderViewDeleted( content::RenderViewHost* render_view_host) OVERRIDE; virtual void DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) OVERRIDE; // Allows injection for testing by friend classes. ExtensionSettingsHandler(ExtensionService* service, ManagementPolicy* policy); // WebUIMessageHandler implementation. virtual void RegisterMessages() OVERRIDE; // SelectFileDialog::Listener implementation. virtual void FileSelected(const base::FilePath& path, int index, void* params) OVERRIDE; virtual void MultiFilesSelected( const std::vector<base::FilePath>& files, void* params) OVERRIDE; virtual void FileSelectionCanceled(void* params) OVERRIDE; // ErrorConsole::Observer implementation. virtual void OnErrorAdded(const ExtensionError* error) OVERRIDE; // content::NotificationObserver implementation. virtual void Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; // ExtensionUninstallDialog::Delegate implementation, used for receiving // notification about uninstall confirmation dialog selections. virtual void ExtensionUninstallAccepted() OVERRIDE; virtual void ExtensionUninstallCanceled() OVERRIDE; // ExtensionWarningService::Observer implementation. virtual void ExtensionWarningsChanged() OVERRIDE; // ExtensionInstallPrompt::Delegate implementation. virtual void InstallUIProceed() OVERRIDE; virtual void InstallUIAbort(bool user_initiated) OVERRIDE; // Helper method that reloads all unpacked extensions. void ReloadUnpackedExtensions(); // Callback for "requestExtensionsData" message. void HandleRequestExtensionsData(const base::ListValue* args); // Callback for "toggleDeveloperMode" message. void HandleToggleDeveloperMode(const base::ListValue* args); // Callback for "inspect" message. void HandleInspectMessage(const base::ListValue* args); // Callback for "launch" message. void HandleLaunchMessage(const ListValue* args); // Callback for "reload" message. void HandleReloadMessage(const base::ListValue* args); // Callback for "enable" message. void HandleEnableMessage(const base::ListValue* args); // Callback for "enableIncognito" message. void HandleEnableIncognitoMessage(const base::ListValue* args); // Callback for "allowFileAcces" message. void HandleAllowFileAccessMessage(const base::ListValue* args); // Callback for "uninstall" message. void HandleUninstallMessage(const base::ListValue* args); // Callback for "options" message. void HandleOptionsMessage(const base::ListValue* args); // Callback for "permissions" message. void HandlePermissionsMessage(const base::ListValue* args); // Callback for "showButton" message. void HandleShowButtonMessage(const base::ListValue* args); // Callback for "autoupdate" message. void HandleAutoUpdateMessage(const base::ListValue* args); // Callback for "loadUnpackedExtension" message. void HandleLoadUnpackedExtensionMessage(const base::ListValue* args); // Utility for calling JavaScript window.alert in the page. void ShowAlert(const std::string& message); // Utility for callbacks that get an extension ID as the sole argument. // Returns NULL if the extension isn't active. const Extension* GetActiveExtension(const base::ListValue* args); // Forces a UI update if appropriate after a notification is received. void MaybeUpdateAfterNotification(); // Register for notifications that we need to reload the page. void MaybeRegisterForNotifications(); // Helper that lists the current inspectable html pages for an extension. std::vector<ExtensionPage> GetInspectablePagesForExtension( const Extension* extension, bool extension_is_enabled); void GetInspectablePagesForExtensionProcess( const Extension* extension, const std::set<content::RenderViewHost*>& views, std::vector<ExtensionPage>* result); void GetShellWindowPagesForExtensionProfile( const Extension* extension, Profile* profile, std::vector<ExtensionPage>* result); // Returns the ExtensionUninstallDialog object for this class, creating it if // needed. ExtensionUninstallDialog* GetExtensionUninstallDialog(); // Callback for RequirementsChecker. void OnRequirementsChecked(std::string extension_id, std::vector<std::string> requirement_errors); // Our model. Outlives us since it's owned by our containing profile. ExtensionService* extension_service_; // A convenience member, filled once the extension_service_ is known. ManagementPolicy* management_policy_; // Used to pick the directory when loading an extension. scoped_refptr<ui::SelectFileDialog> load_extension_dialog_; // Used to start the |load_extension_dialog_| in the last directory that was // loaded. base::FilePath last_unpacked_directory_; // Used to show confirmation UI for uninstalling extensions in incognito mode. scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_; // The id of the extension we are prompting the user about. std::string extension_id_prompting_; // If true, we will ignore notifications in ::Observe(). This is needed // to prevent reloading the page when we were the cause of the // notification. bool ignore_notifications_; // The page may be refreshed in response to a RenderViewHost being destroyed, // but the iteration over RenderViewHosts will include the host because the // notification is sent when it is in the process of being deleted (and before // it is removed from the process). Keep a pointer to it so we can exclude // it from the active views. content::RenderViewHost* deleting_rvh_; // Do the same for a deleting RenderWidgetHost ID and RenderProcessHost ID. int deleting_rwh_id_; int deleting_rph_id_; // We want to register for notifications only after we've responded at least // once to the page, otherwise we'd be calling JavaScript functions on objects // that don't exist yet when notifications come in. This variable makes sure // we do so only once. bool registered_for_notifications_; content::NotificationRegistrar registrar_; PrefChangeRegistrar pref_registrar_; // This will not be empty when a requirements check is in progress. Doing // another Check() before the previous one is complete will cause the first // one to abort. scoped_ptr<RequirementsChecker> requirements_checker_; // The UI for showing what permissions the extension has. scoped_ptr<ExtensionInstallPrompt> prompt_; ScopedObserver<ExtensionWarningService, ExtensionWarningService::Observer> warning_service_observer_; // An observer to listen for when Extension errors are reported. ScopedObserver<ErrorConsole, ErrorConsole::Observer> error_console_observer_; // Whether we found any DISABLE_NOT_VERIFIED extensions and want to kick off // a verification check to try and rescue them. bool should_do_verification_check_; DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); }; } // namespace extensions #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_
[ "karun.matharu@gmail.com" ]
karun.matharu@gmail.com
c26f35f41dceae72734cf6ec7f18d2a9563b3759
777a75e6ed0934c193aece9de4421f8d8db01aac
/src/Providers/UNIXProviders/MonitorResolution/UNIX_MonitorResolution_HPUX.hpp
ac9f75a2d7b42918f23ef1d8a2d0843ec6ab7c79
[ "MIT" ]
permissive
brunolauze/openpegasus-providers-old
20fc13958016e35dc4d87f93d1999db0eae9010a
b00f1aad575bae144b8538bf57ba5fd5582a4ec7
refs/heads/master
2021-01-01T20:05:44.559362
2014-04-30T17:50:06
2014-04-30T17:50:06
19,132,738
1
0
null
null
null
null
UTF-8
C++
false
false
4,906
hpp
//%LICENSE//////////////////////////////////////////////////////////////// // // Licensed to The Open Group (TOG) under one or more contributor license // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with // this work for additional information regarding copyright ownership. // Each contributor licenses this file to you under the OpenPegasus Open // Source License; you may not use this file except in compliance with the // License. // // 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. // ////////////////////////////////////////////////////////////////////////// // //%///////////////////////////////////////////////////////////////////////// UNIX_MonitorResolution::UNIX_MonitorResolution(void) { } UNIX_MonitorResolution::~UNIX_MonitorResolution(void) { } Boolean UNIX_MonitorResolution::getInstanceID(CIMProperty &p) const { p = CIMProperty(PROPERTY_INSTANCE_ID, getInstanceID()); return true; } String UNIX_MonitorResolution::getInstanceID() const { return String (""); } Boolean UNIX_MonitorResolution::getCaption(CIMProperty &p) const { p = CIMProperty(PROPERTY_CAPTION, getCaption()); return true; } String UNIX_MonitorResolution::getCaption() const { return String (""); } Boolean UNIX_MonitorResolution::getDescription(CIMProperty &p) const { p = CIMProperty(PROPERTY_DESCRIPTION, getDescription()); return true; } String UNIX_MonitorResolution::getDescription() const { return String (""); } Boolean UNIX_MonitorResolution::getElementName(CIMProperty &p) const { p = CIMProperty(PROPERTY_ELEMENT_NAME, getElementName()); return true; } String UNIX_MonitorResolution::getElementName() const { return String("MonitorResolution"); } Boolean UNIX_MonitorResolution::getSettingID(CIMProperty &p) const { p = CIMProperty(PROPERTY_SETTING_ID, getSettingID()); return true; } String UNIX_MonitorResolution::getSettingID() const { return String (""); } Boolean UNIX_MonitorResolution::getHorizontalResolution(CIMProperty &p) const { p = CIMProperty(PROPERTY_HORIZONTAL_RESOLUTION, getHorizontalResolution()); return true; } Uint32 UNIX_MonitorResolution::getHorizontalResolution() const { return Uint32(0); } Boolean UNIX_MonitorResolution::getVerticalResolution(CIMProperty &p) const { p = CIMProperty(PROPERTY_VERTICAL_RESOLUTION, getVerticalResolution()); return true; } Uint32 UNIX_MonitorResolution::getVerticalResolution() const { return Uint32(0); } Boolean UNIX_MonitorResolution::getRefreshRate(CIMProperty &p) const { p = CIMProperty(PROPERTY_REFRESH_RATE, getRefreshRate()); return true; } Uint32 UNIX_MonitorResolution::getRefreshRate() const { return Uint32(0); } Boolean UNIX_MonitorResolution::getMinRefreshRate(CIMProperty &p) const { p = CIMProperty(PROPERTY_MIN_REFRESH_RATE, getMinRefreshRate()); return true; } Uint32 UNIX_MonitorResolution::getMinRefreshRate() const { return Uint32(0); } Boolean UNIX_MonitorResolution::getMaxRefreshRate(CIMProperty &p) const { p = CIMProperty(PROPERTY_MAX_REFRESH_RATE, getMaxRefreshRate()); return true; } Uint32 UNIX_MonitorResolution::getMaxRefreshRate() const { return Uint32(0); } Boolean UNIX_MonitorResolution::getScanMode(CIMProperty &p) const { p = CIMProperty(PROPERTY_SCAN_MODE, getScanMode()); return true; } Uint16 UNIX_MonitorResolution::getScanMode() const { return Uint16(0); } Boolean UNIX_MonitorResolution::initialize() { return false; } Boolean UNIX_MonitorResolution::load(int &pIndex) { return false; } Boolean UNIX_MonitorResolution::finalize() { return false; } Boolean UNIX_MonitorResolution::find(Array<CIMKeyBinding> &kbArray) { CIMKeyBinding kb; String settingIDKey; for(Uint32 i = 0; i < kbArray.size(); i++) { kb = kbArray[i]; CIMName keyName = kb.getName(); if (keyName.equal(PROPERTY_SETTING_ID)) settingIDKey = kb.getValue(); } /* EXecute find with extracted keys */ return false; }
[ "brunolauze@msn.com" ]
brunolauze@msn.com
863cbb0e83a57b98f13d5899acc4a1dd16b2c1cd
7ccccd69629354409566ba01d93572a4da0ba364
/Desarrollo/BulletTest/BulletTest/Entities/GunBullet.h
a5f5ca5996c2d184da4325d6fad627f2a7c03189
[]
no_license
Juliyo/LastBullet
eac779d78f0e8d62eb71ac4ecaa838e828825736
4f93b5260eaba275aa47c3ed13a93e7d7e60c0e9
refs/heads/master
2021-09-11T12:27:29.583652
2018-01-18T14:14:52
2018-01-18T14:14:52
104,806,970
0
0
null
null
null
null
ISO-8859-1
C++
false
false
976
h
#pragma once #include <vec3.hpp> #include "EntActive.h" #include "EntityManager.h" #include <Time.hpp> #include <Clock.hpp> class GunBullet : public EntActive { public: GunBullet(Vec3<float> position, Vec3<float> direction, Vec3<float> finalposition, Vec3<float> rotation, Vec3<float> orientation); ~GunBullet(); // Heredado vía Entity virtual void inicializar() override; virtual void update(Time elapsedTime) override; virtual void handleInput() override; virtual void cargarContenido() override; virtual void borrarContenido() override; virtual void handleMessage(const Message & message) override; virtual std::string getClassName() override; virtual bool handleTrigger(TriggerRecordStruct* Trigger) override; virtual void setPosition(const Vec3<float> &pos) override; private: Vec3<float> m_direction; Vec3<float> m_position; Vec3<float> m_rotation; Vec3<float> m_orientation; float m_velocity; Time m_lifetime; Clock timelifeclock; };
[ "julio17795@hotmail.com" ]
julio17795@hotmail.com
d038cc70243758aa5baee6c183d34ce24ad60ed6
fb9bf5f69b772be5d1a956a9d4ad296b107b3d7e
/Sources/cv_extension.cpp
da6e99605ff4c2679fa9b0259f3d0a755280fb13
[ "Unlicense" ]
permissive
DanielHsH/CartoonYourSelf
a1ef63f2b38adf58b64dcbcc361ac892acb7a299
fcd239d51b49667367346997bde33de165b0dac1
refs/heads/master
2021-01-10T17:58:30.847943
2015-09-25T18:01:21
2015-09-25T18:01:21
43,165,981
6
0
null
null
null
null
UTF-8
C++
false
false
61,935
cpp
// See Header in H file /****************************************************************************/ // Includes #include "cv_extension.h" #include <windows.h> /****************************************************************************/ /*********************** Image iterator implementation **********************/ /****************************************************************************/ // Constructor. template <class PEL> IplImageIterator<PEL>::IplImageIterator(IplImage* image, int startX= 0, int startY= 0, int dX = 0, int dY = 0){ initialize(image, startX, startY, dX, dY); } /****************************************************************************/ // Reinitialize on new image template <class PEL> void IplImageIterator<PEL>::initialize(IplImage* image, int startX= 0, int startY= 0, int dX = 0, int dY = 0){ // Read image information data = reinterpret_cast<PEL*>(image->imageData); step = image->widthStep / sizeof(PEL); nChannels = image->nChannels; // Retrieve infromation from image ROI CvRect rect = cvGetImageROI(image); nRows = rect.height; nCols = rect.width; // Move (startX,startY) to be relative to ROI upper left pixel startX+= rect.x; startY+= rect.y; // Rows to proccess is min(nRows,startY+dY) if ((startY+dY)>0 && (startY+dY)<nRows){ nRows= startY+dY; } // Check validity: 0 <= startY < nRows if (startY<0 || startY>=nRows){ startY=0; } j = startY; // Skip rows if j > 0. data+= step*j; // Initialize values i = startX; // Cols to proccess is min(nCols,startX+dX) if ((startX+dX)>0 && (startX+dX)<nCols){ nCols= startX+dX; } // Check validity: 0 <= startX < nCols if (startX<0 || startX>=nCols) { startX = 0; } nCols *= nChannels; i = start_i = startX*nChannels; } /****************************************************************************/ // Get pointer to current pixel template <class PEL> PEL* IplImageIterator<PEL>::operator&() const { return data+i; } /****************************************************************************/ // Get current pixel coordinates template <class PEL> int IplImageIterator<PEL>::col() const{ return i/nChannels; } template <class PEL> int IplImageIterator<PEL>::row() const{ return j; } /****************************************************************************/ // Access pixel neighbour template <class PEL> const PEL IplImageIterator<PEL>::neighbor(int dx, int dy) const { return *( data + (dy*step) + i + dx*nChannels ); } /****************************************************************************/ // Advance to next pixel or next color component template <class PEL> IplImageIterator<PEL>& IplImageIterator<PEL>::operator++(){ i++; // Check if end of row is reached if (i >= nCols){ i = start_i; // Go to next line j++; data+= step; } return *this; } /****************************************************************************/ // Advance to next pixel or next color component, but store copy before ++ template <class PEL> const IplImageIterator<PEL> IplImageIterator<PEL>::operator++(int){ IplImageIterator<PEL> prev(*this); ++(*this); return prev; } /****************************************************************************/ // Check if iterator has more data to proccess template <class PEL> bool IplImageIterator<PEL>::operator!() const{ return j < nRows; } /****************************************************************************/ // Jump few pixels (advanced step must be less then image width). // For example, use this method when you want to proccess only even pixels // in each line. Note when end of line is reached iterator goes to beggining of // new line disregarding size of the step. template <class PEL> IplImageIterator<PEL>& IplImageIterator<PEL>::operator+=(int s) { i+= s; // Check if end of row is reached if (i >= nCols) { i=start_i; // Go to next line j++; data+= step; } return *this; } /****************************************************************************/ /***************************** Image Operations *****************************/ /****************************************************************************/ /****************************************************************************/ // Morphological noise removal of objects and holes of size not greater then // minObjSize. Applies opening and then closing void cvExtMorphologicalNoiseRemove( IplImage* img, int minObjSize, int cvShape){ IplConvKernel* element; minObjSize = minObjSize/2; element = cvCreateStructuringElementEx( minObjSize*2+1, minObjSize*2+1, minObjSize, minObjSize, cvShape, NULL ); cvErode (img,img,element,1); cvDilate(img,img,element,2); cvErode (img,img,element,1); cvReleaseStructuringElement(&element); } /****************************************************************************/ // Morphological skeleton transform. Just a sketch void cvExtSkeletonTransform(IplImage* srcImg, IplImage* dstImg){ //cvCanny(fgImage8U,mask8U,10,50,3); //cvConvertScale(mask8U,mask8U,-1,255); //cvAnd(fgImage8U,mask8U,fgImage8U); ////cvConvert(mask8U,fgImage8U); //cvDistTransform( mask8U, tmpImg32F, CV_DIST_L1, CV_DIST_MASK_3, NULL, NULL ); //cvSobel(tmpImg32F,tmpImg32F,2,2,3); ////cvLaplace(tmpImg32F,tmpImg32F,3); //double max; //cvMinMaxLoc(tmpImg32F,NULL,&max); //cvConvertScale( tmpImg32F, tmpImg32F, 1./max, 0); } /****************************************************************************/ // Invert black/white colors of binary image {0,255} void cvExtInvertBinaryImage(IplImage* img){ cvConvertScale( img,img, -255, 255 ); } /****************************************************************************/ // Strech intensity range of the image to [0..maxVal] void cvExtIntensStrech(IplImage* img, int maxVal){ double min, max, newScale; cvMinMaxLoc(img,&min,&max); newScale = 1.0*maxVal/(max-min); cvConvertScale(img,img,newScale,-min*newScale); } void cvExtIntensStrech(Mat& img, int maxVal){ // Act with regardint to number of channels Mat tmpImg; if (img.channels() == 1){ tmpImg = img; } else{ cvtColor(img,tmpImg,CV_BGR2GRAY); } double minV, maxV,newScale; minMaxLoc(tmpImg,&minV,&maxV); newScale = 1.0*maxV/(maxV-minV); img = (img-minV)*newScale; return; } /****************************************************************************/ // Crops intensity to range [min..max]. // For each pixel, if (pix<min) it becomes min. Same for max void cvExtIntensCrop(IplImage* img, int minVal, int maxVal){ cvMinS(img,maxVal,img); cvMaxS(img,minVal,img); } /****************************************************************************/ // Convert mask with values in {0,1} to binary image with values {0,255}. // Used for debugging void cvExtConvertMask2Binary(IplImage* img){ cvConvertScale(img,img, 0, 255 ); } /****************************************************************************/ // Convert hue value to RGB scalar CvScalar cvExtHue2rgb(float hue){ int rgb[3], p, sector; static const int sector_data[][3]= {{0,2,1}, {1,2,0}, {1,0,2}, {2,0,1}, {2,1,0}, {0,1,2}}; hue *= 0.033333333333333333333333333333333f; sector = cvFloor(hue); p = cvRound(255*(hue - sector)); p ^= (sector&1)?255:0; rgb[sector_data[sector][0]] = 255; rgb[sector_data[sector][1]] = 0; rgb[sector_data[sector][2]] = p; return cvScalar(rgb[2], rgb[1], rgb[0],0); } /****************************************************************************/ // If Null then does nothing. Else acts like cvReleaseImage() and sets the // input image to NULL void cvExtReleaseImageCheckNULL(IplImage** image){ if (!*image) return; IplImage* img = *image; *image = NULL; cvReleaseData(img); cvReleaseImageHeader(&img); } /****************************************************************************/ // Show image on full screen void imshowFullScreen( const string& winname, const Mat& mat ){ // Determine the size of the screen. static int cxScreen = GetSystemMetrics(SM_CXSCREEN); static int cyScreen = GetSystemMetrics(SM_CYSCREEN); // Check if window exists. If not open it in full screen. HWND win_handle = FindWindowA(NULL,(winname.c_str())); // A stands for ascii name of window, not unicode if (!win_handle){ cvNamedWindow(winname.c_str(),CV_WINDOW_AUTOSIZE);//,CV_WINDOW_NORMAL); cvMoveWindow(winname.c_str(),0,0); // Move window to origin if needed win_handle = FindWindowA(NULL,(winname.c_str())); // Make window full screen //cvSetWindowProperty(winname.c_str(), CV_WINDOW_FULLSCREEN, CV_WINDOW_FULLSCREEN); unsigned int flags = (SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER); flags &= ~SWP_NOSIZE; SetWindowPos(win_handle, HWND_NOTOPMOST, 0, 0, cxScreen, cyScreen, flags); // Make window borderless and topmost. Do it each function call since other windows may become on top SetWindowLong(win_handle, GWL_STYLE, GetWindowLong(win_handle, GWL_EXSTYLE) | WS_EX_TOPMOST); } // Show image in it. Mat tmp; resize(mat,tmp,Size(cxScreen,cyScreen)); imshow(winname,tmp); ShowWindow(win_handle, SW_SHOW); return; } /****************************************************************************/ void cvShowMessageBox(const char* caption, const char* message){ MessageBox(NULL,message,caption, MB_OK); } /****************************************************************************/ /*************************** Rectangle Operations ***************************/ /****************************************************************************/ /****************************************************************************/ // Returns 0 if two input rectangles are equal // Returns +1 if jRect is inside iRect // Returns -1 if iRect is inside jRect // If none of this then returns -2; int cvExtIsRectInside(CvRect iRect, CvRect jRect){ if ((iRect.x == jRect.x)&& (iRect.y == jRect.y)&& (iRect.height == jRect.height)&& (iRect.width == jRect.width)){ return 0; } // Check if 'j' is in 'i' if ((iRect.x <= jRect.x)&& (iRect.y <= jRect.y)&& (iRect.y + iRect.height >= jRect.y + jRect.height)&& (iRect.x + iRect.width >= jRect.x + jRect.width)){ return +1; } // Check if 'i' is in 'j' if ((iRect.x >= jRect.x)&& (iRect.y >= jRect.y)&& (iRect.y + iRect.height <= jRect.y + jRect.height)&& (iRect.x + iRect.width <= jRect.x + jRect.width)){ return -1; } return -2; } /****************************************************************************/ // Returns 0 if small intersection or not at all // Returns 1 if large intersection int cvExtIsRectLargeIntersection(CvRect iRect, CvRect jRect){ double fraction = 0.15; iRect.x += cvRound(iRect.width *fraction ); iRect.y += cvRound(iRect.height *fraction ); iRect.width -= cvRound(iRect.width *fraction*2); iRect.height -= cvRound(iRect.height *fraction*2); jRect.x += cvRound(jRect.width *fraction ); jRect.y += cvRound(jRect.height *fraction ); jRect.width -= cvRound(jRect.width *fraction*2); jRect.height -= cvRound(jRect.height *fraction*2); int xIntr = ((iRect.x <= jRect.x)&&( jRect.x <= iRect.x+iRect.width ))|| ((jRect.x <= iRect.x)&&( iRect.x <= jRect.x+jRect.width )); int yIntr = ((iRect.y <= jRect.y)&&( jRect.y <= iRect.y+iRect.height))|| ((jRect.y <= iRect.y)&&( iRect.y <= jRect.y+jRect.height)); return (xIntr&&yIntr); } /****************************************************************************/ // Returns the angle of vector from center of iRect to center of jRect // Returns also the magnitude of the vector in last parameter double cvExtAngBetweenRectCenters(CvRect iRect, CvRect jRect, double* vecMagnitude){ double dX = jRect.x - iRect.x + (jRect.width - iRect.width )/2.0; double dY = jRect.y - iRect.y + (jRect.height - iRect.height)/2.0; if (vecMagnitude) *vecMagnitude = sqrt(dX*dX+dY*dY); return atan2(dY,dX)*180/CV_PI; } /****************************************************************************/ // Add two 2d vectors. Calculates 'vec' + 'd' into 'vec' arguments. // Angles are given in degrees void cvExtAddVector(double* vecMag, double* vecAng, double dMag, double dAng){ *vecAng *= CV_PI/180.0; dAng *= CV_PI/180.0; double X = (*vecMag)*cos(*vecAng) + dMag*cos(dAng); double Y = (*vecMag)*sin(*vecAng) + dMag*sin(dAng); *vecMag = sqrt(X*X+Y*Y)/2; *vecAng = atan2(Y,X)*180/CV_PI; } /****************************************************************************/ // Returns absolute difference between two angles (in degrees) double cvExtAngAbsDiff(double ang1, double ang2 ){ double absDiff = abs(ang1-ang2); return (absDiff<180)?absDiff:360-absDiff; } /****************************************************************************/ // Finds largest inscribed rectangle (of image proportions) inside mask. // Returns: (x,y) uper left point corner and (lx,ly) which are width & height. void LargestInscribedImage(const Mat& mask, Size searchImSize, int& x, int& y, int& lx, int& ly ){ // Resize the mask to square, and reduce its size for faster running time. Size s(mask.size()); int width = s.width; int height = s.height; double reduceFactor = 1.0; // Higher number causes algorithm to run faster but yield less accurate results // Resize image to be square double ratio = (double)searchImSize.width/searchImSize.height; bool isHorizontalImage = ratio<1?false:true; Size workSize(0,0); if (isHorizontalImage) workSize = Size(cvRound(width/(ratio*reduceFactor)),cvRound(height/(reduceFactor))); else workSize = Size(cvRound(width/(reduceFactor)),cvRound(height*ratio/(reduceFactor))); Mat newMask; resize(mask,newMask,workSize); // Find inscribed square by int l; LargestInscribedSquare(newMask,&x,&y,&l,false); // False = dist transform // Convert coordinates back to original image and round the coordinates to integers x = cvRound(x*reduceFactor); y = cvRound(y*reduceFactor); lx = cvRound(l*reduceFactor); ly = cvRound(l*reduceFactor); if (isHorizontalImage){ x = cvRound(x* (1.0*ratio)); // Strech x lx = cvRound(lx*(1.0*ratio)); // Strech x } else{ y = cvRound(y* (1.0/ratio)); // Strech y ly = cvRound(ly*(1.0/ratio)); // Strech y } } /****************************************************************************/ // Caluclates largest inscribed image allong the main diagonal using dynamic // programming algorithm. It is assit method to "LargestInscribedSquare" void LargestInscribedSquareDPdiag(const Mat& mask, int *x, int*y, int *l){ Size imSize(mask.size()); // Dynamic programming tables. // Changed from type CV_64F and at<double> to CV_16U and at<__int16> Mat Ytable(imSize.height,imSize.width,CV_16U); Mat Xtable(imSize.height,imSize.width,CV_16U); Mat Ltable(imSize.height,imSize.width,CV_16U); // ---------------------------- // Initialize first col //Mat firstCol = mask.col(0); for (int i = 0; i < imSize.height; i++){ if (mask.at<uchar>(i,0) > 0){ // Square can start here (current length of diagonal is 0 = one pixel) Ytable.at<__int16>(i,0) = i; Xtable.at<__int16>(i,0) = 0; Ltable.at<__int16>(i,0) = 0; } else{ Ytable.at<__int16>(i,0) = 0; Xtable.at<__int16>(i,0) = 0; Ltable.at<__int16>(i,0) = -1; } } // ---------------------------- // Initialize first row for (int i = 0; i < imSize.width; i++){ if (mask.at<uchar>(0,i) > 0){ // Square can start here (current length of diagonal is 0 = one pixel) Ytable.at<__int16>(0,i) = 0; Xtable.at<__int16>(0,i) = i; Ltable.at<__int16>(0,i) = 0; } else{ Ytable.at<__int16>(0,i) = 0; Xtable.at<__int16>(0,i) = 0; Ltable.at<__int16>(0,i) = -1; } } // ---------------------------- //% Dynamic Programming. (from (1,1) to end of matrix) for (int i = 1; i < imSize.height; i++){ //const char* mask_i = mask.ptr<char>(i); for (int j = 1; j < imSize.width; j++){ if (mask.at<uchar>(i,j) == 0){ // No square including this pixel, just forward information Ytable.at<__int16>(i,j) = Ytable.at<__int16>(i-1,j-1); Xtable.at<__int16>(i,j) = Xtable.at<__int16>(i-1,j-1); Ltable.at<__int16>(i,j) = Ltable.at<__int16>(i-1,j-1); } else{ if (mask.at<uchar>(i-1,j-1) > 0){ Ytable.at<__int16>(i,j) = Ytable.at<__int16>(i-1,j-1); Xtable.at<__int16>(i,j) = Xtable.at<__int16>(i-1,j-1); // It is a continuous diagonal. Chack secondary diagonal if ((mask.at<uchar>(Ytable.at<__int16>(i,j),j) > 0)&& (mask.at<uchar>(i,Xtable.at<__int16>(i,j)) > 0)){ // Square can be enlarged Ltable.at<__int16>(i,j) = Ltable.at<__int16>(i-1,j-1)+1; } else{ // Square cannot be extended. Just forward the information Ltable.at<__int16>(i,j) = Ltable.at<__int16>(i-1,j-1); } } else{ // This pixel starts a square Ytable.at<__int16>(i,j) = i; Xtable.at<__int16>(i,j) = j; Ltable.at<__int16>(i,j) = 0; } } } } // ---------------------------- // Find max L value in last column int maxValCol = 0,WhereCol = 0; for (int i = 0; i < imSize.height; i++){ int l = Ltable.at<__int16>(i,imSize.width-1); if (l>maxValCol){ maxValCol = l; WhereCol = i; } } // Find max L value in last row int maxValRow = 0,WhereRow = 0; for (int i = 0; i < imSize.width; i++){ int l = Ltable.at<__int16>(imSize.height-1,i); if (l>maxValRow){ maxValRow = l; WhereRow = i; } } // Take coordinates with largest L if (maxValCol>maxValRow){ *x = Xtable.at<__int16>(WhereCol,imSize.width-1); *y = Ytable.at<__int16>(WhereCol,imSize.width-1); *l = maxValCol; } else { *x = Xtable.at<__int16>(imSize.height-1,WhereRow); *y = Ytable.at<__int16>(imSize.height-1,WhereRow); *l = maxValRow; } return; } /****************************************************************************/ // Input mask (white pixels are the enclosing area, blacks are background) // Mask is char (8U) Mat with white > 0, black is = 0. // Returns: square location (x,y)-> (x+l,y+l) // If mask covers convex area then faster algorithm will be launged. void LargestInscribedSquare (const Mat& mask, int *x, int*y, int *l, bool isMaskConvex){ if (!isMaskConvex){ // Use slow distance transform algorithm Mat res; // Make zero padding so mask will not tuch image borders. We loose here about 0.5 pix. mask.row(0) = 0; // Use copyMakeBorder() instead mask.col(0) = 0; mask.row(mask.rows-1) = 0; mask.col(mask.cols-1) = 0; // Calculate distance transform and retrieve values distanceTransform(mask, res, CV_DIST_C, CV_DIST_MASK_5); //debugShowImage(res/40); double minVal, maxVal; Point maxLoc(0,0); minMaxLoc(res, &minVal,&maxVal, 0,&maxLoc); *x = cvRound(maxLoc.x - maxVal); *y = cvRound(maxLoc.y - maxVal); *l = cvRound(maxVal*2+1); } else { // Use dynamic programming faster algorithm for convex masks // Find inscribed square by main diagonal int x1,y1,l1; LargestInscribedSquareDPdiag(mask,&x1,&y1,&l1); // Find inscribed square by secondary diagonal. Make that using the same algorithm but rotate 90 deg backward clock direction. int x2,y2,l2; Mat newMask = mask.t(); flip( newMask, newMask, 0 ); LargestInscribedSquareDPdiag(newMask,&x2,&y2,&l2); // Convert the rotated x,y to original coordinates int tmpInt = x2; x2 = newMask.size().height - y2 - l2; y2 = tmpInt; // Calc biggest square if (l1 > l2){ *x = x1; *y = y1; *l = l1; } else{ *x = x2; *y = y2; *l = l2; } } } /****************************************************************************/ // Finds the corners of a given mask. Returns them in clockwise order in corners vector. // Mask is an arbitrary quadrilateral white shape on black background. // Best value for distThr is ~ 0.8 of mask smallest side. // Returns the area of the detected quadrilateral double findCornersOfMask(Mat& maskImg, int numCorners, vector<Point2f>& corners, double distThr){ // Extract the corners. vector<Point2f> tmpCorners; goodFeaturesToTrack( maskImg, tmpCorners, numCorners, 0.1,distThr, NULL_MATRIX, 9); // Calculate convex hull in order to remove wrong corners inside the mask. // Arrange convex hull clockwise vector<Point2f> convexCORN; if (tmpCorners.empty()){ corners.clear(); return 0; // No corners were detected } convexHull(Mat(tmpCorners),convexCORN,false); // Find the upper left point in the convex hull. float minDist = (float)maskImg.cols*maskImg.cols + maskImg.rows*maskImg.rows; int index = -1; numCorners = (int)convexCORN.size(); for (int i = 0; i < numCorners; i++){ float curDist = convexCORN[i].x*convexCORN[i].x+convexCORN[i].y*convexCORN[i].y; if (curDist < minDist){ minDist = curDist; index = i; } } // Rearrange the points so upper left one will be first. Keep clockwise order for (int i=0; i<numCorners; ++i){ corners.push_back(convexCORN[(i+index)%numCorners]); } // Calculate area of convex hull double area = cvExtConvexHullArea(corners); return area; } /****************************************************************************/ // Finds the area of 2D convex hull (ordered vector of points). double cvExtConvexHullArea(vector<Point2f>& ch){ double area = 0; for (unsigned int i = 0; i < ch.size(); i++){ int next_i = (i+1)%(ch.size()); double dX = ch[next_i].x - ch[i].x; double avgY = (ch[next_i].y + ch[i].y)/2; area += dX*avgY; // This is the integration step. } return fabs(area); // Different implementation /* vector<Point2f> contour; approxPolyDP(Mat(ch), contour, 0.001, true); return fabs(contourArea(Mat(contour)));*/ } /****************************************************************************/ /****************************** Image matching ******************************/ /****************************************************************************/ /****************************************************************************/ // Uses built in matching method for cross check matching. Matches src->dst, dst->src // and findes bi-directional matches. void cvExtCrossCheckMatching( DescriptorMatcher* matcher, const Mat& descriptors1, const Mat& descriptors2, vector<DMatch>& matches, int knn ){ // Calculate bi-directional matching matches.clear(); vector<vector<DMatch>> matches12, matches21; matcher->knnMatch( descriptors1, descriptors2, matches12, knn ); matcher->knnMatch( descriptors2, descriptors1, matches21, knn ); // Iterate over 1->2 matchings for( size_t m = 0; m < matches12.size(); m++ ){ bool findCrossCheck = false; // For current match, iterate over its N best results. for( size_t fk = 0; fk < matches12[m].size(); fk++ ){ DMatch forward = matches12[m][fk]; // For each result iterate over its best backward matching for( size_t bk = 0; bk < matches21[forward.trainIdx].size(); bk++ ){ DMatch backward = matches21[forward.trainIdx][bk]; // if this match is the same as one of backward matches of one ogf its N results then we have found a bi-directional match. if( backward.trainIdx == forward.queryIdx ){ matches.push_back(forward); findCrossCheck = true; break; } } if (findCrossCheck) break; } } } /****************************************************************************/ /*************************** Drawing on images ******************************/ /****************************************************************************/ /****************************************************************************/ // Draw arrow on the image (img) in a given location (start) in direction (angDeg), // with length (length). Color and thikcness are also parameters. void cvExtDrawArrow(IplImage *img, CvPoint start, double angDeg, double length, CvScalar color, int thickness){ CvPoint endPoint, arrowPoint; // Convert to radians double angle = angDeg*CV_PI/180.0; // Find end point of the arrows body. endPoint.x = (int)(start.x + length*cos(angle)); endPoint.y = (int)(start.y + length*sin(angle)); // Draw the body (main line) of the arrow. cvLine(img, start, endPoint, color, thickness, CV_AA, 0); // Draw the tips of the arrow, scaled to the size of the main part double tipsLength = 0.4*length; arrowPoint.x = (int)(endPoint.x + tipsLength*cos(angle + 3*CV_PI/4)); arrowPoint.y = (int)(endPoint.y + tipsLength*sin(angle + 3*CV_PI/4)); cvLine(img, arrowPoint, endPoint, color, thickness, CV_AA, 0); arrowPoint.x = (int) (endPoint.x + tipsLength*cos(angle - 3*CV_PI/4)); arrowPoint.y = (int) (endPoint.y + tipsLength*sin(angle - 3*CV_PI/4)); cvLine(img, arrowPoint, endPoint, color, thickness, CV_AA, 0); // Draw circle around the arrow. // cvCircle(img, start, cvRound(length *1.2), color, thickness, CV_AA, 0 ); } /****************************************************************************/ // Draw Object rectangle with an arrow from his center pointing in defined // direction. Used for drawing global motion direction in swordfish debug mode. void cvExtDrawObj(IplImage *img, CvRect objRect, double angDeg, double length, CvScalar color){ // draw rectangle in the image cvRectangle(img, cvPoint(objRect.x, objRect.y), cvPoint(objRect.x+objRect.width, objRect.y+objRect.height), color, 2+0*CV_FILLED, 8); // Draw a clock with arrow indicating the direction CvPoint center = cvPoint((objRect.x + objRect.width/2), (objRect.y + objRect.height/2)); cvExtDrawArrow(img, center, angDeg, length, color); } /****************************************************************************/ // Visualizes a histogram as a bar graph into an output image. // Uses different Hue for each bar. void cvExtVisualizeHueHistogram(const CvHistogram *hist, int hdims, IplImage *img){ // Temporary color CvScalar color = cvScalar(0,0,0,0); cvZero(img); // Calculate width of a bin int bin_w = img->width/hdims; // Iterate over all bins for( int i = 0; i < hdims; i++ ){ int val = cvRound( cvGetReal1D(hist->bins,i)*(img->height)/255 ); // Attach new hue for each bin color = cvExtHue2rgb((i*180.f)/hdims); // Draw the bin cvRectangle( img, cvPoint(i*bin_w,img->height), cvPoint((i+1)*bin_w,img->height - val), color, CV_FILLED , 8, 0 ); } } /****************************************************************************/ // Calculates Pow 2 of absolute value of edges using soble edge detector. // All images must be preallocated. // auxImage and srcImages are changed in the function (not const) void cvExtCalcEdgesPow2( IplImage* edgeImage, IplImage* srcImage, IplImage* auxImage){ // Calculate dX and dY of gray image cvCopy(srcImage,auxImage); cvSobel(srcImage,srcImage,1,0,3); cvSobel(auxImage,auxImage,0,1,3); // Calculate absolute edge strength: dX^2+dY^2. cvMul(srcImage,srcImage,srcImage); cvMul(auxImage,auxImage,auxImage); cvAdd(srcImage,auxImage,edgeImage); return; } /****************************************************************************/ // Reduces image brightness to nBit representation (2^nBits levels). void cvExtReduceTonBits(IplImage* srcImage, unsigned int nBits){ nBits = (nBits>8)?8:nBits; if (nBits<8){ int depthRatio = cvRound(256/pow(2.0,1.0*nBits)); int multFactor = (depthRatio!=256)?255/(256/depthRatio -1):0; cvExtImageIterator it(srcImage); while (!it){ *it = cvRound(*it/depthRatio)*multFactor; ++it; } } return; } /****************************************************************************/ // Reduces number of levels in the image to nLeves. // Image must be given as float void cvExtReduceLevels(IplImage* srcImage, unsigned int nLevels, bool smartLevels){ // Check if number of levels is legal if ((nLevels < 2)||(nLevels>255)){ return; } // Check if image type is legal if (srcImage->depth != IPL_DEPTH_32F){ cvError(1,"cvExtReduceLevels","wrong image argument","cvExtension",1); return; } cvExtIntensStrech(srcImage,255); // Strech image to [0..255] // If levels are just chosen uniformly, make it and quit the method if (!smartLevels){ int depthRatio = cvRound(256/nLevels); int multFactor = (depthRatio!=256)?255/(256/depthRatio -1):0; IplImageIterator<float> it(srcImage); while (!it){ *it = (float)cvRound(*it/depthRatio)*multFactor; ++it; } return; } IplImage* AuxImage = cvCreateImage(cvGetSize(srcImage), IPL_DEPTH_32F, 1); // Calculate nLevels-means of srcImage to auxillary matrix int numPixels = srcImage->height*srcImage->width*srcImage->nChannels; CvMat points = cvMat(numPixels, 1, CV_32FC1, reinterpret_cast<float*>(srcImage->imageData)); CvMat clusters = cvMat(numPixels, 1, CV_32SC1, reinterpret_cast<float*>(AuxImage->imageData)); cvKMeans2( &points, nLevels, &clusters, cvTermCriteria( CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10, 1.0 )); // Convert the auxillary matrix to AuxImage CvMat row_header, *row; row = cvReshape( &clusters, &row_header, 0, srcImage->height ); AuxImage = cvGetImage(row,AuxImage); // AuxImage includes for each pixel its cluster (class) // Let us calculate for each class its true color. It would be average of brightness of // all pixels that belong to the current class float* numPixelsInClass = new float[nLevels]; float* avgClassBrightness = new float[nLevels]; for (unsigned int i=0; i<nLevels; i++){ numPixelsInClass [i] = 0; avgClassBrightness[i] = 0; } cvExt32FImageIterator origPix (srcImage); IplImageIterator<int> clusterPix(AuxImage); // Cluster is integer while (!clusterPix){ avgClassBrightness[*clusterPix] += *origPix; numPixelsInClass [*clusterPix]++; ++origPix; ++clusterPix; } // Calculate the average for (unsigned int i=0; i<nLevels; i++){ avgClassBrightness[i] /= numPixelsInClass[i]; } // Convert Auxillary image from pixels of classes to pixels of true colora IplImageIterator<int> result(AuxImage); while (!result){ *result = cvRound(avgClassBrightness[*result]); ++result; } // Insert the result to srcImage and strech intensity to [0..255] cvConvertScale(AuxImage,srcImage); //cvExtIntensStrech(srcImage,255); // Delete all auxillary memory delete[] avgClassBrightness; delete[] numPixelsInClass; cvExtReleaseImageCheckNULL(&AuxImage); return; } /****************************************************************************/ // Convert image to pencil sketch void cvExtPhoto2Pencil(const IplImage* srcImage, IplImage* dstImage, double intensNormal, int looseDitails, int pencilLines, int colorNormal, int colorBits, int fast){ // ----------------------------------------- // Auxillary images IplImage* gryImage = cvCreateImage( cvGetSize(srcImage), IPL_DEPTH_8U , 1 ); IplImage* hueImage = cvCreateImage( cvGetSize(srcImage), IPL_DEPTH_8U , 1 ); IplImage* satImage = cvCreateImage( cvGetSize(srcImage), IPL_DEPTH_8U , 1 ); IplImage* edgImage = cvCreateImage( cvGetSize(srcImage), IPL_DEPTH_32F, 1 ); IplImage* tmp1Image = cvCreateImage( cvGetSize(srcImage), IPL_DEPTH_32F, 1 ); IplImage* tmp2Image = cvCreateImage( cvGetSize(srcImage), IPL_DEPTH_32F, 1 ); // Start Algorithm cvCopy(srcImage,dstImage); // ----------------------------------------- // Loose ditails in the image. if (looseDitails < 3) for (int i=0; i<looseDitails;i++){ cvSmooth(dstImage,dstImage,CV_MEDIAN,3); } // cvSmooth(dstImage,dstImage,CV_MEDIAN,1+2*looseDitails); else{ // Loose details due to morphologic closure int winS = looseDitails-1; IplConvKernel* element; element = cvCreateStructuringElementEx( winS*2+1, winS*2+1, winS, winS, CV_SHAPE_ELLIPSE, 0 ); cvErode (dstImage,dstImage,element,1); cvDilate(dstImage,dstImage,element,1); } // ----------------------------------------- // Convert image to HSV cvCvtColor( dstImage, dstImage, CV_BGR2HSV ); cvSplit( dstImage, hueImage, satImage, gryImage, NULL); // ----------------------------------------- // Put black lines on edges // Calculate dX^2+dY^2 of gray image (intensity) // We dont do sqrt() on edge strength since we will include it in gamma correction cvConvertScale(gryImage,tmp1Image,1.0/255,0); cvExtCalcEdgesPow2(edgImage,tmp1Image,tmp2Image); // Calculate dX^2+dY^2 of saturation image cvConvertScale(satImage,tmp1Image,1.0/255,0); cvExtCalcEdgesPow2(tmp1Image,tmp1Image,tmp2Image); cvConvertScale(gryImage,tmp2Image,1.0/255,0); cvMul(tmp1Image,tmp2Image,tmp1Image); // Reduce saturation edges in dark areas of the image // Take the maximum of both edges cvMax(tmp1Image,edgImage,edgImage); cvExtIntensStrech(edgImage,1); // Invert the edge (in order to turn it black), and change its gamma int gamma = 6*(pencilLines+4); cvExt32FImageIterator edge(edgImage); while (!edge){ *edge = pow((1-(*edge)),gamma); ++edge; } // ----------------------------------------- // Normalize intensity variations in the image. if (fast){ // by subtracting from the image its blurred background. // Formulae: (a)*Img + (1-a)*(Inverted bloored image). a is in [0.5..1]. // Note: when 'a' is higher then 1 the normalization is inversed cvConvertScale(gryImage,tmp1Image,1/255.0,0); cvSmooth(gryImage,gryImage,CV_BLUR,5,5); cvConvertScale(gryImage,tmp2Image,-1/255.0,1); double iN = 0.5 + 0.6*intensNormal; cvAddWeighted(tmp1Image,iN,tmp2Image,1-iN,0,tmp1Image); } else { // Find best intensity levels using smart Reduction of levels. // Add 2 to levels in order to have minimum levels of 2. cvConvertScale(gryImage,tmp1Image); cvExtReduceLevels(tmp1Image,cvRound((intensNormal)*10+2)); cvConvertScale(tmp1Image,gryImage); cvExtIntensStrech(gryImage,255); cvSmooth(gryImage,gryImage,CV_BLUR,5,5); cvConvertScale(gryImage,tmp1Image,1/255.0); } // ----------------------------------------- // Combine all information (edges and normalized image) into final intensity value cvMul(tmp1Image,edgImage,tmp1Image); cvExtIntensStrech(tmp1Image,1); cvConvertScale(tmp1Image,gryImage,255.0,0); // ----------------------------------------- // Reduce The saturation in dark areas of original image for removing artifacts // Do this by: Sat = Sat * (Gamma corrected Blurred Background) * colorNormal // By the way, Inverted Blurred background is stored in tmp2Image cvConvertScale(satImage,tmp1Image,1/255.0,0); // Correct Gamma of blurred background (use gamma > 1 since it is inverted) // Also do 1-result to invert the background back int gamma2 = colorNormal/2; cvConvertScale(gryImage,tmp2Image,-1/255.0,1); cvExt32FImageIterator back(tmp2Image); while (!back){ *back = 1-pow(*back,gamma2); ++back; } double colorMultiply = (colorNormal<5)?(0.2+colorNormal/5.):(1+colorNormal/20.); cvMul(tmp1Image,tmp2Image,tmp1Image,colorMultiply); cvExtIntensCrop(tmp1Image,0,1); cvConvertScale(tmp1Image,satImage,255.0,0); // ----------------------------------------- // Reduce accuracy of saturation (reduce number of levels and impose smoothness) if (fast){ cvExtReduceTonBits(satImage,colorBits); } else { cvExtReduceLevels(tmp1Image,colorBits+2); cvConvertScale(tmp1Image,satImage); } int longest = CVEXT_MAX(satImage->height,satImage->width); cvSmooth(satImage,satImage,CV_BLUR,cvRound(longest/200.0)*2+1); // ----------------------------------------- // Alter the hue of the image. Reduce number of colors in the image // Or even convert entire image to single color. /* cvConvertScale(hueImage,tmp1Image); cvExtReduceLevels(tmp1Image,cvRound(1+pow(1.4,colorBits))); cvConvertScale(tmp1Image,hueImage,180.0/255.0); */ // ----------------------------------------- // Incorporate back into image & Return to RGB plane cvMerge(hueImage, satImage, gryImage, NULL, dstImage ); cvCvtColor(dstImage, dstImage, CV_HSV2BGR); // ----------------------------------------- // Free allocated images cvExtReleaseImageCheckNULL(&gryImage); cvExtReleaseImageCheckNULL(&hueImage); cvExtReleaseImageCheckNULL(&satImage); cvExtReleaseImageCheckNULL(&edgImage); cvExtReleaseImageCheckNULL(&tmp1Image); cvExtReleaseImageCheckNULL(&tmp2Image); } /* // ----------------------------------------- // Light pencil stroke matrix. (Sum of the matrix must be 1)! double _pencilStroke[] = {0,0,0,2,1,0,0, 0,0,2,3,2,1,0, 0,2,4,5,4,2,1, 2,3,5,7,5,3,2, 1,2,4,5,4,2,0, 0,1,2,3,2,0,0, 0,0,1,2,0,0,0}; CvMat pencilStroke = cvMat( 7, 7, CV_64F, _pencilStroke ); CvScalar normStroke = cvSum(&pencilStroke); cvConvertScale(&pencilStroke,&pencilStroke,1/(normStroke.val[0]),0); // Will make the strokes random static CvRNG rng = cvRNG(-1); // ----------------------------------------- // Add random pencil strokes (above the edge image) cvRandArr( &rng, tmp1Image, CV_RAND_UNI, cvScalarAll(-1), cvScalarAll(1)); cvFilter2D(tmp1Image,tmp1Image,&pencilStroke); cvSmooth(tmp1Image,tmp1Image,CV_GAUSSIAN,3,3); cvAddWeighted(edgImage,1,tmp1Image,lightPencil,0,edgImage); cvExtIntensCrop(edgImage); */ /****************************************************************************/ // I/O /****************************************************************************/ // Check if output directory exists. If not, create it. Returns true if OK. bool createDirIfNotExists(char *DirPath){ if (!DirPath){ return false; } // Check if output directory exists. DWORD dwAttr = GetFileAttributesA(DirPath); if (!(dwAttr != 0xffffffff && (dwAttr & FILE_ATTRIBUTE_DIRECTORY))){ return CreateDirectoryA(DirPath,NULL) != 0; } // Already exists return true; } /****************************************************************************/ bool isFileExists(char *filePath){ if (!filePath){ return false; } DWORD dwAttr = GetFileAttributesA(filePath); return (dwAttr != 0xffffffff); } /****************************************************************************/ /****************************************************************************/ /************************* Video Frame Grabber ******************************/ /****************************************************************************/ /****************************************************************************/ // Detect which type of media is stored in the fiven file path cvExtMediaType cvExtDetectMediaType(const string path){ const char *extention = &path[path.length()-3]; // Suported text sequences if (!_stricmp(extention,"txt")){ return FRAMES_TEXT_LIST; // } // Suported video types if ((!_stricmp(extention,"avi"))|| (!_stricmp(extention,"mpg"))|| (!_stricmp(extention,"wmv"))){ return OFFLINE_VIDEO; } // Suported image types if ((!_stricmp(extention,"jpg"))|| (!_stricmp(extention,"tif"))|| (!_stricmp(extention,"png"))|| (!_stricmp(extention,"bmp"))|| (!_stricmp(extention,"gif"))){ return SINGLE_IMAGE; } // Un-Suported video types if ((!_stricmp(extention,"mov"))|| (!_stricmp(extention,"mp3"))|| (!_stricmp(extention,"mp4"))){ return UNKNOWN; } // Supported online displays if (!_stricmp(extention-1,"@mov")){ return ONLINE_WINDOW; } return UNKNOWN; } /****************************************************************************/ // Empty Constructor for online grabbing (from camera) cvExtFrameGrabber::cvExtFrameGrabber(int camIndex){ frameNumber = 0; verticalFlipFlag = false; horizontalFlipFlag = false; textFile = NULL; //curFrame = NULL; if (capture.open(camIndex)){ framesSource = ONLINE_CAMERA; FPS = capture.get(CV_CAP_PROP_FPS); codec = cvRound(capture.get(CV_CAP_PROP_FOURCC)); } else{ framesSource = UNKNOWN; FPS = CVEXT_WRONG_FPS; codec = CVEXT_WRONG_CODEC; } isUndistortActivated = false; } /****************************************************************************/ // Constructor with file path for offline grabbing cvExtFrameGrabber::cvExtFrameGrabber(string path){ videoFilePath = path; frameNumber = 0; verticalFlipFlag = false; horizontalFlipFlag = false; textFile = NULL; //curFrame = NULL; //capture = NULL; framesSource = cvExtDetectMediaType(videoFilePath); switch (framesSource){ case OFFLINE_VIDEO: if (capture.open(videoFilePath)){ FPS = capture.get(CV_CAP_PROP_FPS); codec = cvRound(capture.get(CV_CAP_PROP_FOURCC)); } else{ framesSource = UNKNOWN; FPS = CVEXT_WRONG_FPS; codec = CVEXT_WRONG_CODEC; } break; case FRAMES_TEXT_LIST: // Check if this a text file which stores list of images fopen_s(&textFile,videoFilePath.c_str(), "rt" ); if (!textFile){ framesSource = UNKNOWN; } // FPS and codec are irrelevant FPS = CVEXT_WRONG_FPS; codec = CVEXT_WRONG_CODEC; break; case SINGLE_IMAGE: // FPS and codec are irrelevant FPS = CVEXT_WRONG_FPS; codec = CVEXT_WRONG_CODEC; break; } isUndistortActivated = false; } /****************************************************************************/ // Constructor for online grabbing from matrix (which can be changed from outside). Mostly used for debug cvExtFrameGrabber::cvExtFrameGrabber(const Mat *sourceMat){ verticalFlipFlag = false; horizontalFlipFlag = false; textFile = NULL; this->sourceMat = sourceMat; framesSource = MAT_PTR_DEBUG; isUndistortActivated = false; } /****************************************************************************/ // Destructor cvExtFrameGrabber::~cvExtFrameGrabber(){ // Close the grabber if (capture.isOpened()){ capture.release(); } // Close the text file if needed if (textFile){ fclose(textFile); } } /****************************************************************************/ // Returns current frame. User must NOT release or change the image. Returned image will dissapear // when next frame arrives or this object is destroyied. const Mat cvExtFrameGrabber::watchFrame(void){ switch (framesSource){ case ONLINE_CAMERA: case OFFLINE_VIDEO: capture >> this->curFrame; break; case FRAMES_TEXT_LIST: while (fgets(imageName, sizeof(imageName)-2, textFile )){ int l = (int)strlen(imageName); if (!l){ // empty line occured continue; } if (imageName[0] == '#' ){ // Commented frame continue; } //imageName[l-1] == '\n') imageName[--l] = '\0'; // Check valid extension int extension = (int)strlen(imageName)-3; if ((!_stricmp(&imageName[extension],"jpg"))|| (!_stricmp(&imageName[extension],"tif"))|| (!_stricmp(&imageName[extension],"png"))|| (!_stricmp(&imageName[extension],"bmp"))|| (!_stricmp(&imageName[extension],"gif"))){ curFrame = imread(imageName,CV_LOAD_IMAGE_COLOR); break; } } // End of While break; case SINGLE_IMAGE: // Load the image and turn source to depleted in order not to load the image again curFrame = imread(videoFilePath,CV_LOAD_IMAGE_COLOR); framesSource = DEPLETED; break; case MAT_PTR_DEBUG: curFrame = *(this->sourceMat); break; case UNKNOWN: case DEPLETED: curFrame.release(); break; } //End switch if (!curFrame.empty()){ // If image loaded frameNumber++; // Undistort if needed if (isUndistortActivated){ Mat tmp; undistort(curFrame,tmp,IntrinsicMat, DistCoef); curFrame = tmp; } // Flip if needed if (verticalFlipFlag) if (horizontalFlipFlag) flip( curFrame, curFrame, -1 ); else flip( curFrame, curFrame, 1 ); else if (horizontalFlipFlag) flip( curFrame, curFrame, 0 ); } else { framesSource = DEPLETED; } return curFrame; } /****************************************************************************/ // Returns current frame. User may change the image but also responsible for releasing it. Mat cvExtFrameGrabber::grabFrame(void){ return (this->watchFrame()).clone(); } /****************************************************************************/ // Backward compatibility grabbing functions const IplImage cvExtFrameGrabber::watchFrameIpl(void){ grabFrame(); return ((IplImage)curFrame); } IplImage* cvExtFrameGrabber::grabFrameIpl(void){ grabFrame(); IplImage tmp = (IplImage)curFrame; if (!curFrame.empty()) return cvCloneImage(&tmp); else return NULL; } /****************************************************************************/ // Get Methods: // Returns the number of current frame int cvExtFrameGrabber::getCurFrameNumber(){ return frameNumber; } // Change vertical flipping flag. If flag is set then // All frames would be flipped vertically. void cvExtFrameGrabber::setVerticalFlip(bool flag){ verticalFlipFlag = flag; } void cvExtFrameGrabber::setHorizontalFlip(bool flag){ horizontalFlipFlag = flag; } // Return true if current video source is online (realtime) bool cvExtFrameGrabber::isRealTimeGrabbing(void){ return ((framesSource == ONLINE_CAMERA));//|| //(framesSource == MAT_PTR_DEBUG)); } // Return true if current source is video and not sequence of images. bool cvExtFrameGrabber::isVideoStreamGrabbing(void){ return ((framesSource == ONLINE_CAMERA)|| (framesSource == OFFLINE_VIDEO));//|| //(framesSource == MAT_PTR_DEBUG)); } /****************************************************************************/ // Set/Get Methods: // Return media frames per second ratio double cvExtFrameGrabber::getFPS(void){ return FPS; } // Return media decompressing codec int cvExtFrameGrabber::getMediaCodec(void){ return codec; } // Set/get size of the image. // CvSize cvSize( int width, int height ) bool cvExtFrameGrabber::setMediaSize(int width, int height){ if (!isRealTimeGrabbing()){ return false; } bool res = capture.set(CV_CAP_PROP_FRAME_WIDTH,width); if (res){ res = res & capture.set(CV_CAP_PROP_FRAME_HEIGHT,height); } return res; } /****************************************************************************/ void cvExtFrameGrabber::getMediaSize(int*width, int*height){ if (isRealTimeGrabbing()){ *width = (int)capture.get(CV_CAP_PROP_FRAME_WIDTH); *height = (int)capture.get(CV_CAP_PROP_FRAME_HEIGHT); } } /****************************************************************************/ // Activate undistortion on the media. Distortion parameters are stored in file in camera.xml: bool cvExtFrameGrabber::activateUndistort(const string filePath){ FileStorage fs(filePath, FileStorage::READ); isUndistortActivated = fs.isOpened(); if (!isUndistortActivated){ return false; } fs["intrCamMat"] >> IntrinsicMat; fs["distortion"] >> DistCoef; fs.release(); return true; } /****************************************************************************/ /************************* Video Frame Writer ******************************/ /****************************************************************************/ // Constructor cvExtFrameWriter::cvExtFrameWriter(string path, double fps, int codec, bool isColored){ videoFilePath = path; dirEnd = videoFilePath.rfind("\\"); dirEnd = (dirEnd!=string::npos)?dirEnd:-1; frameNumber = 0; verticalFlipFlag = false; horizontalFlipFlag = false; textFile = NULL; //writer = NULL; vFPS = ( fps != CVEXT_WRONG_FPS ) ? fps : 29.97; // Default value is 29.97 vCodec = ( codec != CVEXT_WRONG_CODEC ) ? codec : CV_FOURCC_PROMPT; // Default is divx vIsColored = isColored; framesDest = cvExtDetectMediaType(videoFilePath); switch (framesDest){ case OFFLINE_VIDEO: // Do nothing break; case FRAMES_TEXT_LIST: // Try to open file for writing fopen_s(&textFile,videoFilePath.c_str(), "wt" ); framesDest = (textFile)? FRAMES_TEXT_LIST : UNKNOWN; break; case SINGLE_IMAGE: // Do nothing break; case ONLINE_WINDOW: // Erase the extension videoFilePath.erase(videoFilePath.length()-4,4); break; } // switch } //CV_FOURCC('M', 'J', 'P', 'G'), // CV_FOURCC('D', 'I', 'V', 'X') /****************************************************************************/ // Destructor cvExtFrameWriter::~cvExtFrameWriter(){ // Close the writer // Close the text file if needed if (textFile){ fclose(textFile); } } /****************************************************************************/ // Writes current frame. void cvExtFrameWriter::writeFrame(const IplImage* frame){ this->writeFrame(Mat(frame)); } void cvExtFrameWriter::writeFrame(const Mat& frame){ switch (framesDest){ case ONLINE_WINDOW: imshow(videoFilePath,frame); break; case OFFLINE_VIDEO: // For first frame openCV writer will be created if (!writer.isOpened()){ writer.open(videoFilePath,vCodec,vFPS,frame.size(),vIsColored); } writer << frame; break; case FRAMES_TEXT_LIST: // Create name for a the file which will store the current frame and write it imageName.assign(videoFilePath,0,videoFilePath.length()-4); char index[11]; sprintf_s(index,"_%0.5d.jpg",frameNumber); imageName += index; //cvSaveImage(imageName.c_str(),frame); imwrite(imageName,frame); // Update the txt file imageName.assign(videoFilePath,dirEnd+1,videoFilePath.length()-dirEnd-5); imageName += index; imageName += "\n"; fprintf_s(textFile,imageName.c_str()); break; case SINGLE_IMAGE: //cvSaveImage(videoFilePath.c_str(),frame); imwrite(videoFilePath,frame); break; case UNKNOWN: case DEPLETED: // Do nothing. break; } //End switch frameNumber++; return; } /****************************************************************************/ // Return true if current source is video and not sequence of images. bool cvExtFrameWriter::isVideoStreamWriting(void){ return (framesDest == OFFLINE_VIDEO); } /****************************************************************************/ /***************************** cv:Mat Operations ****************************/ /****************************************************************************/ // Apply transformation T to column vectors v. V is not in homogenous coordinates void cvExtTransform(const Mat& T, Mat& v){ // Convert v to homogenous coordinates Mat Hom = Mat(v.rows+1,v.cols,CV_64FC(1),Scalar(1)); v(Range(0,2),Range::all()).copyTo(Hom(Range(0,2),Range::all())); // Apply transform Hom = T*Hom; // Convert back to v Hom(Range(0,2),Range::all()).copyTo(v); v.row(0) /= Hom.row(2); v.row(1) /= Hom.row(2); } /****************************************************************************/ // Check that 3x3 homography T is a valid transformation. // Checks inner values of T, and that T transforms all pixels in image of srcSize inside dstSize bool cvExtCheckTransformValid(const Mat& T, Size srcSize, Size dstSize){ // Check the shape of the matrix if (T.empty()) return false; if (T.rows != 3) return false; if (T.cols != 3) return false; // Check for linear dependency of rows. Mat row1, row2; T(Range(0,1),Range(0,2)).copyTo(row1); T(Range(1,2),Range(0,2)).copyTo(row2); //T.row(0).copyTo(row1); //T.row(1).copyTo(row2); double epsilon = 0.000001; // in pixel units. row1 += epsilon; row2 += epsilon; row1 /= row2; Scalar mean; Scalar stddev; meanStdDev(row1,mean,stddev); double validVal = stddev[0]/(abs(mean[0])+epsilon); printf("Transformation validation: %g\n",validVal); if (validVal < 0.7) return false; // Check that transformed source coordinates are inside destination coordinates. if ((srcSize.width <= 0)||(srcSize.height <= 0)){ // No need to check coordinates. return true; } // Build coordinates. Mat footPrint; cvExtBuildFootPrintColsVector(srcSize,footPrint); cvExtTransform(T,footPrint); Rect_<double> r(0,0,dstSize.width,dstSize.height); bool OK = true; for (int i=0;(i<footPrint.cols)&&OK;i++){ Point tP = Point((int)footPrint.at<double>(0,i),(int)footPrint.at<double>(1,i)); OK = (r.x <= tP.x && tP.x <= r.x + r.width) && (r.y <= tP.y && tP.y <= r.y + r.height); } if (!OK){ printf("Transformation is out of borders\n"); return false; } return true; } /****************************************************************************/ // Build vector (x,y) for each image corner and center. Store the reult is 2x5 matrix. void cvExtBuildFootPrintColsVector(const Size s, Mat& cornersVec){ Mat tmp = (Mat_<double>(5,2) << 0,0,s.width,0,0,s.height,s.width,s.height,s.width/2.0,s.height/2.0); cornersVec = tmp.t(); } // Build vector (x,y) for each image corner. Store the reult is 4x2 matrix. void cvExtBuildCornersRowsVector(const Size s, Mat& cornersVec){ cornersVec = (Mat_<double>(4,2) << 0,0,s.width,0,0,s.height,s.width,s.height); } /****************************************************************************/ // Calculate normalized location of the projector that created the given footprint. // Uses the perspective information in the foorprint void cvExtFootPrintSourceLocation(Mat& footPrint, float& Xindex, float& Yindex){ // Extract footprint center . float centX = (float)footPrint.at<double>(0,4); float centY = (float)footPrint.at<double>(1,4); // Calculate corner vectors footPrint(Range(0,1),Range::all()) -= centX; footPrint(Range(1,2),Range::all()) -= centY; // Take their inverse average. Xindex = (float)(-sum(footPrint.row(0)/4.0)[0]); Yindex = (float)(-sum(footPrint.row(1)/4.0)[0]); // TO do: Change the above calculation. It's results are changing depending on the zoom... return; } /****************************************************************************/ // Returns 3x3 perspective transformation for the corresponding 4 point pairs, // stored as row vectors in 4x2 matrix. Mat cvExtgetPerspectiveTransform(const Mat& SrcRowVec, const Mat& DstRowVec){ Point2f src[4]; Point2f dst[4]; cvtCornersMat_Point2fArray(SrcRowVec,src); cvtCornersMat_Point2fArray(DstRowVec,dst); Mat P = getPerspectiveTransform(src,dst); return P; } /****************************************************************************/ // Serialize matrix to char buffer. When writing buffer is allocated and must be freed by user int serializeMat(Mat& M, char* &buf, char serializeFlags){ // Determine which serialization to perform: int writeObj = serializeFlags&CVEXT_SERIALIZE_WRITE; int useFile = serializeFlags&CVEXT_SERIALIZE_FILE; // ---------------------------------- Output object if (writeObj){ // If empty matrix, dont do anything. if (M.empty()){ return 0; } // Calculate header int cols = M.cols; int rows = M.rows; int chan = M.channels(); int eSiz = (int)((M.dataend-M.datastart)/(cols*rows*chan)); // Estimate total size of the data int totalDataSize = sizeof(cols)+sizeof(rows)+sizeof(chan)+sizeof(eSiz)+cols*rows*chan*eSiz; // Perform writing if (useFile){ // Write to file ofstream out(buf, ios::out|ios::binary); if (!out) return 0; // Write header out.write((char*)&cols,sizeof(cols)); out.write((char*)&rows,sizeof(rows)); out.write((char*)&chan,sizeof(chan)); out.write((char*)&eSiz,sizeof(eSiz)); // Write data. if (M.isContinuous()){ out.write((char *)M.data,cols*rows*chan*eSiz); out.close(); return totalDataSize; } else{ out.close(); return 0; } } else{ // Allocate buffer buf = (char *)malloc(totalDataSize); if (!buf) return 0; // Define variable that will show which part of matrix we are serializing. int i = 0; // Write header memcpy(buf+i,(char*)&cols,sizeof(cols)); i += sizeof(cols); memcpy(buf+i,(char*)&rows,sizeof(rows)); i += sizeof(rows); memcpy(buf+i,(char*)&chan,sizeof(chan)); i += sizeof(chan); memcpy(buf+i,(char*)&eSiz,sizeof(eSiz)); i += sizeof(eSiz); // Write data. if (M.isContinuous()){ memcpy(buf+i,(char*)M.data,cols*rows*chan*eSiz); return totalDataSize; } else{ return 0; } } } // ---------------------------------- Input object else { // Define header variables int cols; int rows; int chan; int eSiz; if (useFile){ ifstream in(buf, ios::in|ios::binary); if (!in){ M = NULL_MATRIX; return 0; } // Read header in.read((char*)&cols,sizeof(cols)); in.read((char*)&rows,sizeof(rows)); in.read((char*)&chan,sizeof(chan)); in.read((char*)&eSiz,sizeof(eSiz)); // Estimate total size of the data int totalDataSize = sizeof(cols)+sizeof(rows)+sizeof(chan)+sizeof(eSiz)+cols*rows*chan*eSiz; // Determine type of the matrix int type = CV_BUILD_MATRIX_TYPE(eSiz,chan); // Alocate Matrix. M = Mat(rows,cols,type,Scalar(1)); // Read data. if (M.isContinuous()){ in.read((char *)M.data,cols*rows*chan*eSiz); in.close(); return totalDataSize; } else{ in.close(); return 0; } } else{ if (!buf){ M = NULL_MATRIX; return 0; } // Define variable that will show which part of matrix we are serializing. int i = 0; // Read header memcpy((char*)&cols,buf+i,sizeof(cols)); i += sizeof(cols); memcpy((char*)&rows,buf+i,sizeof(rows)); i += sizeof(rows); memcpy((char*)&chan,buf+i,sizeof(chan)); i += sizeof(chan); memcpy((char*)&eSiz,buf+i,sizeof(eSiz)); i += sizeof(eSiz); // Estimate total size of the data int totalDataSize = sizeof(cols)+sizeof(rows)+sizeof(chan)+sizeof(eSiz)+cols*rows*chan*eSiz; // Determine type of the matrix int type = CV_BUILD_MATRIX_TYPE(eSiz,chan); // Alocate Matrix. M = Mat(rows,cols,type,Scalar(1)); // Read data. if (M.isContinuous()){ memcpy((char*)M.data,buf+i,cols*rows*chan*eSiz); return totalDataSize; } else{ return 0; } } // If use file } // If write obj } /****************************************************************************/ int saveMat(char* filename, Mat& M){ return serializeMat(M,filename,CVEXT_SERIALIZE_FILE|CVEXT_SERIALIZE_WRITE); } int readMat(char* filename, Mat& M){ return serializeMat(M,filename,CVEXT_SERIALIZE_FILE|CVEXT_SERIALIZE_READ); } /****************************************************************************/ // Serialize char buffer to file. int serializeCharBuf(char* &buf, char* filePath, char serializeFlags, int bufSize){ // Determine which serialization to perform: int writeObj = serializeFlags&CVEXT_SERIALIZE_WRITE; if (writeObj){ // Write character buffer to file ofstream out; out.open(filePath, ios::out|ios::binary ); if (!out){ return 0; } out.write(buf,bufSize); return bufSize; } else{ // Read character buffer from file int fSize; ifstream is; is.open(filePath, ios::in|ios::binary ); if (!is){ return 0; } // Calculate length of file: is.seekg (0, ios::end); fSize = (int)(is.tellg()); is.seekg (0, ios::beg); // allocate enough memory. buf = (char*)malloc(fSize); if (!buf) return 0; is.read(buf,fSize); is.close(); return fSize; } } /****************************************************************************/ // Embedd char buffer in cv matrix or extract buffer from it. int embeddCharDataInMat(Mat& M, char* buf, int bufSize){ if ((!buf)||(!bufSize)) return 0; M = Mat(Size(1,bufSize),CV_8UC1,buf); return M.empty() ? 0 : bufSize; } int extractCharDataFromMat(Mat& M, char* &buf, int &bufSize){ if (M.empty()) return 0; buf = (char*)M.datastart; bufSize = (int)(M.dataend - M.datastart); return bufSize; } /****************************************************************************/ void printMat(const Mat& M){ switch ( (M.dataend-M.datastart) / (M.cols*M.rows*M.channels())){ case sizeof(char): printMatTemplate<unsigned char>(M,true); break; case sizeof(__int16): printMatTemplate<__int16>(M,true); break; case sizeof(float): printMatTemplate<float>(M,false); break; case sizeof(double): printMatTemplate<double>(M,false); break; } } void deb(const Mat& M){ imshow("Debug",M); cvWaitKey(0); } /****************************************************************************/ // Converts 4x2 double matrix into array of 4 Point2f. // 'dst' must be preallocated. void cvtCornersMat_Point2fArray(const Mat& M, Point2f *dst){ if (!dst) return; for (int i=0;i<4;i++){ dst[i] = Point2f((float)M.at<double>(i,0),(float)M.at<double>(i,1)); } } /****************************************************************************/ // EOF.
[ "DanielHsH@gmail.com" ]
DanielHsH@gmail.com
bd8384f1141c4d67788a7d362162e6b7c23f98d2
d663a4abdaf5a9c23bcd4e6413d31d86b217ea36
/rt/integrators/integrator.h
28982cc7d81efa8a276c929ace34d6fae497c5a7
[]
no_license
anandatul144/CG-18
63fb7f0f09775bec0e815e89e087bf28dfe62ba9
1b1360738e9ca01d8a608c4d58e4eba81c9d657f
refs/heads/master
2020-09-07T15:47:08.634659
2019-11-10T18:43:48
2019-11-10T18:43:48
220,832,119
0
0
null
null
null
null
UTF-8
C++
false
false
357
h
#ifndef CG1RAYTRACER_INTEGRATORS_INTEGRATOR_HEADER #define CG1RAYTRACER_INTEGRATORS_INTEGRATOR_HEADER namespace rt { class World; class Ray; class RGBColor; class Integrator { public: Integrator(World* world) : world(world) {} virtual RGBColor getRadiance(const Ray& ray) const = 0; protected: World* world; }; } #endif
[ "noreply@github.com" ]
noreply@github.com
fac160d2e66ed6dd732d62f69fcbbb57cceb466c
af62be724c367d7d83aa8eda752ff8962b7df10c
/src/developer/feedback/crashpad_agent/queue.h
080b37554eb93be23e602356b5e5477c9331cfe6
[ "BSD-3-Clause" ]
permissive
AlbertSid/fuchsia
1d369e95ea6e55789f401022cb20fa3c28d85a92
018b23ae3462ea6bf9c91b00a5d8698c2b79d119
refs/heads/master
2020-08-24T05:16:31.873193
2019-10-21T19:37:04
2019-10-21T19:37:04
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,746
h
// Copyright 2019 The Fuchsia 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 SRC_DEVELOPER_FEEDBACK_CRASHPAD_AGENT_QUEUE_H_ #define SRC_DEVELOPER_FEEDBACK_CRASHPAD_AGENT_QUEUE_H_ #include <map> #include <vector> #include "src/developer/feedback/crashpad_agent/config.h" #include "src/developer/feedback/crashpad_agent/crash_server.h" #include "src/developer/feedback/crashpad_agent/database.h" #include "src/developer/feedback/crashpad_agent/inspect_manager.h" #include "src/lib/fxl/macros.h" #include "third_party/crashpad/util/misc/uuid.h" namespace feedback { // Queues pending reports and processes them according to its internal State. class Queue { public: static std::unique_ptr<Queue> TryCreate(CrashpadDatabaseConfig database_config, CrashServer* crash_server, InspectManager* inspect_manager); // Add a report to the queue. bool Add(const std::string& program_name, std::map<std::string, fuchsia::mem::Buffer> atttachments, std::optional<fuchsia::mem::Buffer> minidump, std::map<std::string, std::string> annotations); // Process the pending reports based on the queue's internal state. void ProcessAll(); uint64_t Size() const { return pending_reports_.size(); } bool IsEmpty() const { return pending_reports_.empty(); } bool Contains(const crashpad::UUID& uuid) const; const crashpad::UUID& LatestReport() { return pending_reports_.back(); } void SetStateToArchive() { state_ = State::Archive; } void SetStateToUpload() { state_ = State::Upload; } void SetStateToLeaveAsPending() { state_ = State::LeaveAsPending; } private: Queue(std::unique_ptr<Database> database, CrashServer* crash_server, InspectManager* inspect_manager); // How the queue should handle processing existing pending reports and new reports. enum class State { Archive, Upload, LeaveAsPending, }; // Archives all pending reports and clears the queue. void ArchiveAll(); // Attempts to upload all pending reports and removes the successfully uploaded reports from the // queue. void UploadAll(); // Attempts to upload a report. // // Returns false if the report needs to be processed again. bool Upload(const crashpad::UUID& local_report_id); std::unique_ptr<Database> database_; CrashServer* crash_server_; InspectManager* inspect_manager_; State state_ = State::LeaveAsPending; std::vector<crashpad::UUID> pending_reports_; FXL_DISALLOW_COPY_AND_ASSIGN(Queue); }; } // namespace feedback #endif // SRC_DEVELOPER_FEEDBACK_CRASHPAD_AGENT_QUEUE_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
6fafc27c92456d396d4b49188be4b13420c6c813
18738579bf9752d069a9522e0cd397cc06a61eee
/Ember/src/Ember/Core/Application.cpp
84927e5058446c4efcb28538055e7939687b0235
[ "MIT" ]
permissive
strah19/GameOfLife
cfd6143436ce26f530d570baf5c1c2f849cd2202
63fe6448dea627b4bfebed897391f55df82d8b29
refs/heads/master
2023-05-05T15:59:47.411376
2021-06-01T22:54:42
2021-06-01T22:54:42
372,980,299
0
0
null
null
null
null
UTF-8
C++
false
false
1,222
cpp
#include "Application.h" namespace Ember { void Application::Initialize(const std::string& name, bool full_screen, uint32_t width, uint32_t height) { properties = new WindowProperties(name, width, height); properties->full_screen = full_screen; window = Window::CreateEmberWindow(properties); events = new Events(); event_handler = new EventHandler(window, events); event_handler->SetEventCallback(EMBER_BIND_FUNC(OnEvent)); renderer = new rRenderer(window); OnCreate(); } Application::~Application() { delete properties; delete window; delete events; delete event_handler; delete renderer; } void Application::Run() { while (window->IsRunning()) { event_handler->Update(); OnUserUpdate(); } } void Application::OnEvent(Event& event) { EventDispatcher dispatcher(&event); UserDefEvent(event); dispatcher.Dispatch<QuitEvent>(EMBER_BIND_FUNC(OnClose)); dispatcher.Dispatch<ResizeEvent>(EMBER_BIND_FUNC(OnResize)); } bool Application::OnClose(const QuitEvent& event) { window->Quit(); return true; } bool Application::OnResize(const ResizeEvent& event) { window->Properties()->width = event.w; window->Properties()->height = event.h; return true; } }
[ "m.strahinja@yahoo.com" ]
m.strahinja@yahoo.com
ea4507e352bd8cada3daf0a620f9baaaac39b5a4
78895e35fb6aa8a03c6eb88210e3b3e2ed385083
/libraries/sql/sql/internal/mysql_statement_data.hh
99883fc3ca077701dd09606e13700d43f14c14f5
[ "MIT" ]
permissive
matt-42/lithium
275ee37f500a9faf1f1af45aede93e7f1ef5af76
9ce90b1f96405bd2aced0d75fc2e9e49ea9a3fdd
refs/heads/master
2023-08-11T17:07:05.978690
2022-05-31T20:07:13
2022-05-31T20:07:13
225,671,789
1,258
104
MIT
2022-10-03T19:51:24
2019-12-03T16:56:03
C++
UTF-8
C++
false
false
903
hh
#pragma once #include <mysql.h> #include <memory> /** * @brief Store the data that mysql_statement holds. * */ struct mysql_statement_data : std::enable_shared_from_this<mysql_statement_data> { MYSQL_STMT* stmt_ = nullptr; int num_fields_ = -1; MYSQL_RES* metadata_ = nullptr; MYSQL_FIELD* fields_ = nullptr; mysql_statement_data(MYSQL_STMT* stmt) { // std::cout << "create statement " << std::endl; stmt_ = stmt; metadata_ = mysql_stmt_result_metadata(stmt_); if (metadata_) { fields_ = mysql_fetch_fields(metadata_); num_fields_ = mysql_num_fields(metadata_); } } ~mysql_statement_data() { if (metadata_) mysql_free_result(metadata_); mysql_stmt_free_result(stmt_); if (mysql_stmt_close(stmt_)) std::cerr << "Error: could not free mysql statement" << std::endl; // std::cout << "delete statement " << std::endl; } };
[ "matthieu.garrigues@gmail.com" ]
matthieu.garrigues@gmail.com
791d215133185f7f7090a0c2f68d36cb32ea9ec6
1dbb60db92072801e3e7eaf6645ef776e2a26b29
/server/src/common/resource/r_totemattrext.cpp
624e10a1b0d06950ea5715c9bdaeba54c3b2e5dc
[]
no_license
atom-chen/phone-code
5a05472fcf2852d1943ad869b37603a4901749d5
c0c0f112c9a2570cc0390703b1bff56d67508e89
refs/heads/master
2020-07-05T01:15:00.585018
2015-06-17T08:52:21
2015-06-17T08:52:21
202,480,234
0
1
null
2019-08-15T05:36:11
2019-08-15T05:36:09
null
UTF-8
C++
false
false
98
cpp
#include "jsonconfig.h" #include "log.h" #include "proto/constant.h" #include "r_totemattrext.h"
[ "757690733@qq.com" ]
757690733@qq.com
f43ec45c057ed30cba3d3de886ca64fcf42f79d3
07cbe159795612509c2e7e59eb9c8ff6c6ed6b0d
/partitioned/RayleighBenard/consistencyTest/Ra_1e+05_multiFluidFoam_X1_Y50_constThetaBC/tStep0.005_0.005/thetaf
e95ff9fb8efb74516b20399c87a71caf1de450d3
[]
no_license
AtmosFOAM/danRun
aacaaf8a22e47d1eb6390190cb98fbe846001e7a
94d19c4992053d7bd860923e9605c0cbb77ca8a2
refs/heads/master
2021-03-22T04:32:10.679600
2020-12-03T21:09:40
2020-12-03T21:09:40
118,792,506
0
0
null
null
null
null
UTF-8
C++
false
false
3,382
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: dev \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class surfaceScalarField; location "0.005"; object thetaf; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 1 0 0 0]; internalField nonuniform List<scalar> 49 ( 328.809061444 327.609057598 326.399988641 325.190815184 323.990209581 322.790819158 321.599888201 320.408343706 319.199880322 317.990815331 316.79020975 315.590819348 314.399996851 313.20906192 312.009057839 310.800097185 309.591533402 308.399278804 307.199274693 305.991533377 304.799996952 303.608343745 302.399880099 301.190815172 299.990101212 298.78999273 297.59010113 296.390819243 295.199888374 294.008343439 292.799988071 291.591641382 290.400105113 289.209061496 288.009165436 286.80081435 285.600818752 284.40916969 283.209165096 282.000705546 280.800100101 279.599991564 278.39999146 277.200099806 276.000709648 274.809277436 273.609774194 272.409272517 271.200704485 ) ; boundaryField { ground { type calculated; value uniform 330; } top { type calculated; value uniform 270; } left { type cyclic; value nonuniform List<scalar> 50 ( 329.408564171 328.209558716 327.008556481 325.791420802 324.590209565 323.390209597 322.191428719 321.008347683 319.808339728 318.591420916 317.390209745 316.190209755 314.991428941 313.808564761 312.609559078 311.4085566 310.19163777 308.991429034 307.807128574 306.591420812 305.391645942 304.208347962 303.008339527 301.791420671 300.590209674 299.389992751 298.189992709 296.99020955 295.791428935 294.608347813 293.408339066 292.191637077 290.991645687 289.808564539 288.609558452 287.40877242 286.192856279 285.008781224 283.809558156 282.608772036 281.392639055 280.207561146 278.992421982 277.807560938 276.592638674 275.408780622 274.209774251 273.009774137 271.808770897 270.592638074 ) ; } right { type cyclic; value nonuniform List<scalar> 50 ( 329.408564171 328.209558716 327.008556481 325.791420802 324.590209565 323.390209597 322.191428719 321.008347683 319.808339728 318.591420916 317.390209745 316.190209755 314.991428941 313.808564761 312.609559078 311.4085566 310.19163777 308.991429034 307.807128574 306.591420812 305.391645942 304.208347962 303.008339527 301.791420671 300.590209674 299.389992751 298.189992709 296.99020955 295.791428935 294.608347813 293.408339066 292.191637077 290.991645687 289.808564539 288.609558452 287.40877242 286.192856279 285.008781224 283.809558156 282.608772036 281.392639055 280.207561146 278.992421982 277.807560938 276.592638674 275.408780622 274.209774251 273.009774137 271.808770897 270.592638074 ) ; } frontAndBack { type empty; value nonuniform 0(); } } // ************************************************************************* //
[ "d.shipley.1341@gmail.com" ]
d.shipley.1341@gmail.com
f46fee6860c6b771763c0665dcbf3187487e1920
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_5670465267826688_1/C++/NilayVaish/C.cpp
cb06173933ee6d2bcde2f1299a6608d4a9fd4e4e
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
C++
false
false
2,840
cpp
#include <cassert> #include <cstdio> char S[40005]; void Multiply(char A1, bool B1, char A2, bool B2, char& A3, bool& B3) { B3 = B1 xor B2; switch(A1) { case '1': if (A2 == '1') A3 = '1'; else if (A2 == 'i') A3 = 'i'; else if (A2 == 'j') A3 = 'j'; else if (A2 == 'k') A3 = 'k'; break; case 'i': if (A2 == '1') A3 = 'i'; else if (A2 == 'i') { A3 = '1'; B3 = not B3; } else if (A2 == 'j') A3 = 'k'; else if (A2 == 'k') { A3 = 'j'; B3 = not B3; } break; case 'j': if (A2 == '1') A3 = 'j'; else if (A2 == 'i') { A3 = 'k'; B3 = not B3; } else if (A2 == 'j') { A3 = '1'; B3 = not B3; } else if (A2 == 'k') A3 = 'i'; break; case 'k': if (A2 == '1') A3 = 'k'; else if (A2 == 'i') A3 = 'j'; else if (A2 == 'j') { A3 = 'i'; B3 = not B3; } else if (A2 == 'k') { A3 = '1'; B3 = not B3; } break; default: printf("What am I doing here!\n"); assert(0); break; } //printf("%c %d X %c %d = %c %d\n", A1, B1, A2, B2, A3, B3); } int main() { int T; scanf("%d\n", &T); for (int ii = 1; ii <= T; ++ii) { long long int X, L; scanf("%lld %lld\n%s\n", &L, &X, S); for (int i = 1; i < 4; ++i) for (int j = 0; j < L; ++j) S[i*L + j] = S[j]; char M = '1'; bool R = false; for (int i = 0; i < L; ++i) { char A; bool B; Multiply(M, R, S[i], false, A, B); M = A; R = B; } char MX = '1'; bool RX = false; for (int i = 0; i < X % 4; ++i) { char A; bool B; Multiply(M, R, MX, RX, A, B); MX = A; RX = B; } M = MX, R = RX; //printf("%c %d\n", M, R); if (M == '1' && R == true) { M = '1'; R = false; long long int i; bool fi = false; for (i = 0; i < L*4; ++i) { char A; bool B; Multiply(M, R, S[i], false, A, B); if (A == 'i' && B == false) { fi = true; break; } M = A; R = B; } long long int k; M = '1', R = false; bool fk = false; for (k=L*4-1; k >= 0; --k) { char A; bool B; Multiply(S[k], false, M, R, A, B); if (A == 'k' && B == false) { fk = true; break; } M = A; R = B; } //int j; M = '1', R = false; //for (j = i + 1; j < k; ++j) //{ // char A; bool B; // Multiply(M, R, S[j], false, A, B); // M = A; R = B; //} k += (L * X - 4 * L); if (k - i >= 2 && fk && fi) { printf("Case #%d: YES\n", ii); //printf("M = %c, R = %d\n", M, R); //assert(M == 'j' && R == false); } else printf("Case #%d: NO\n", ii); } else printf("Case #%d: NO\n", ii); } return 0; }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
f72c91cf1af8b860170ecedf652254a67654d81f
6a2a34460236a6c6e8dadc86a5ad11285af8de97
/LibPN532/MyBuffer.cpp
7e82bb3fad6a08b223ab68f457aa53f22e7dcaf2
[]
no_license
abramoov-vl/RFID_reader
97368c76ee368a0ae211dc9109bbd835aa1849ba
f7dc5c873cbbab7060ce58a4d81710238b369eb0
refs/heads/master
2022-10-07T06:20:31.019669
2020-06-02T19:04:28
2020-06-02T19:04:28
268,884,719
0
0
null
null
null
null
UTF-8
C++
false
false
1,737
cpp
/** * @file Buffer.cpp * @brief Software Buffer - Templated Ring Buffer for most data types * @author sam grove * @version 1.0 * @see * * Copyright (c) 2013 * * 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 "MyBuffer.h" template <class T> MyBuffer<T>::MyBuffer(uint32_t size) { _buf = new T [size]; _size = size; clear(); return; } template <class T> MyBuffer<T>::~MyBuffer() { delete [] _buf; return; } template <class T> uint32_t MyBuffer<T>::getSize() { return this->_size; } template <class T> void MyBuffer<T>::clear(void) { _wloc = 0; _rloc = 0; memset(_buf, 0, _size); return; } template <class T> uint32_t MyBuffer<T>::peek(char c) { return 1; } template <class T> uint32_t MyBuffer<T>::getLength (void) { return _wloc; } // make the linker aware of some possible types template class MyBuffer<uint8_t>; template class MyBuffer<int8_t>; template class MyBuffer<uint16_t>; template class MyBuffer<int16_t>; template class MyBuffer<uint32_t>; template class MyBuffer<int32_t>; template class MyBuffer<uint64_t>; template class MyBuffer<int64_t>; template class MyBuffer<char>; template class MyBuffer<wchar_t>;
[ "noreply@github.com" ]
noreply@github.com
be85f1109fac8c828f9aaabea53ea957abe2731d
64f9a176a5c47cc8c72ba4dc1d81cdefa08a7a10
/Aula Prática 4/aulaPratica.cpp
af343ef2b8c496cdd0627c9a48337d83fd38adb9
[]
no_license
WellersonPrenholato/Parallel-Processing
6bf601b2fff8193f1643814a5087051f074fc239
dd0c17d0f2696e11dd8aa5f11aa6e1f917760918
refs/heads/master
2023-09-04T03:15:47.036534
2023-08-22T04:47:23
2023-08-22T04:47:23
296,940,788
0
0
null
null
null
null
UTF-8
C++
false
false
1,048
cpp
/* # Resources: neednodes=1:gpu:ppn=2,nodes=1:gpu:ppn=2,walltime=06:00:00 start: 08/10/20 16:57:50.885 f(1000000): 224427 stop: 08/10/20 17:09:02.784 time ./programa 1000000 real 11m11.875s user 11m11.840s sys 0m0.012s */ #include <bits/stdc++.h> using namespace std; int oitoDivisores (int n){ int count =0; int aux =0; for (int i=1; i<=n; ++i){ if (n % i == 0){ count++; if (count > 8){ break; } } } if (count == 8){ return n; }else{ return 0; } } int main(int argc, char *argv[]){ if (argc != 2) { fprintf(stderr, "usage: prog <N>\n"); exit(1); } int N = atoi(argv[1]); vector<int> divisores; int divisor; for (int i=1; i<=N; ++i){ divisor = oitoDivisores(i); if ( divisor != 0){ divisores.push_back(divisor); printf("%d ", divisor); } } printf("\nTamanho: %ld\n", divisores.size()); return 0; }
[ "wellerson.prenholato@gmail.com" ]
wellerson.prenholato@gmail.com
cf633eb505faeb2f03ec149fdcb22e8c1ffa85b3
b2bf202052f87b4b18d63a8b25421b1adb9ed096
/lib/material/ArrayOfColors.h
283ea1203448aabf2cd4b232a42fc8e3dddf91cf
[]
no_license
alcoforado/mOpenGL
d0efe4f5c3b9e3fe29fa772dbda58563849d8ac4
6b92649fae37c926dda19888b68d8c5ebec945f4
refs/heads/master
2016-09-05T09:27:04.885843
2014-11-14T03:38:29
2014-11-14T03:38:29
22,024,385
1
0
null
null
null
null
UTF-8
C++
false
false
671
h
#ifndef ARRAYOFCOLORS_H #define ARRAYOFCOLORS_H #include <framework/IMaterial.h> #include <framework/Vector4.h> #include <utilities/IArray.h> #include <vector> template<class VerticeData> class ArrayOfColors : IMaterial<VerticeData> { std::vector<Vector4> _colors; public: ArrayOfColors(const Vector4 &v) { _colors.push_back(v); } virtual void write(IArray<VerticeData> &array) override { assert(!_colors.empty()); int k=0; for (int i=0;i<array.size();i++) { if (k >= _colors.size()) k=0; array[i].Color=_colors[k++]; } } }; #endif // ARRAYOFCOLORS_H
[ "marcosalcoforado@gmail.com" ]
marcosalcoforado@gmail.com
acb605d3fca4d78ab02a9394140cf733b1f28d76
3e5d801268576d601efbd286a71ffbe6388b5b94
/main.cpp
27ebbb2c3fadc67ab487308779e9a3a318702e1a
[]
no_license
Th3x0/Jok-12
b6fe225178ac32eeb949819796ebe3468a7fba93
0f5ac64249488ebd21eae1de95ac6c094cf721ce
refs/heads/Aggiunta_spari
2021-01-13T10:26:54.078151
2016-10-28T22:02:45
2016-10-28T22:02:45
72,228,499
0
0
null
null
null
null
ISO-8859-13
C++
false
false
5,183
cpp
#ifdef __APPLE__ #include <GLUT/glut.h> #else #include <GL/glut.h> #endif #include <stdlib.h> #include <iostream> //GRAPHIC_CONST static constexpr float grain = 0.015625f; static constexpr float lower_limit = -1.0f; static constexpr float upper_limit = 1.0f; static constexpr float left_limit = -1.0f; static constexpr float right_limit = 1.0f; // CLASSI struct Shot { Shot* next; float shot_x; float shot_y; Shot(Shot* _next,float _x, float _y):next(_next),shot_x(_x),shot_y(_y) {} }; class Spaceship { private: static float x; static int ship_speed; static int shot_speed; static Shot* shots; static constexpr float y=grain*12; static constexpr float height=grain*8; static constexpr float width=grain*3; static constexpr float shot_height=grain*2; public: static void move_left()//muove l'astronave a sinistra { if(x>right_limit-width||x<left_limit-width) x=0.0f; if(x>=left_limit+width+grain*ship_speed) x-=grain*ship_speed; } static void move_right()//muove l'astronave a destra { if(x>right_limit-width||x<left_limit+width) x=0.0f; if(x<=right_limit-width-grain*ship_speed) x+=grain*ship_speed; } static void shoot()//devo aggiungere un nuovo shot nella catena dinamica di shots, ma la voglio tenere ordinata { if(NULL==shots)//catena vuota shots=new Shot(NULL,x,lower_limit+y); else { if (shots->shot_x>x)//catena non vuota ma devo inserire al primo posto shots=new Shot (shots,x,lower_limit+y); else for(Shot* temp=shots;;temp=temp->next)//aggiungo nel mezzo al posto giusto o, al pił, in fondo if(NULL==temp->next||(temp->next)->shot_x>=x) { temp->next=new Shot ((temp->next),x,lower_limit+y); break; } } } static void shots_move ()//fa muovere gli shots { for(Shot* temp=shots;temp!=NULL;temp=temp->next) temp->shot_y+=grain*shot_speed; } static void draw_ship()//disegna l'astronave { glColor3f(1,1,1); glBegin(GL_TRIANGLES); glVertex2f(x,lower_limit+y); glVertex2f(x-width,lower_limit+y-height); glVertex2f(x+width,lower_limit+y-height); glEnd(); } static void draw_shots()//disegna gli shots { glColor3f(1,1,1); glBegin(GL_TRIANGLES); for(Shot* temp=shots;temp!=NULL;temp=temp->next) { glVertex2f(temp->shot_x,temp->shot_y); glVertex2f(temp->shot_x+grain,temp->shot_y+shot_height); glVertex2f(temp->shot_x-grain,temp->shot_y+shot_height); } glEnd(); } }; float Spaceship::x=0.0f; int Spaceship::ship_speed=2; int Spaceship::shot_speed=4; Shot* Spaceship::shots=NULL; class Keyboard_Manager { private: static bool Keys[256]; public: static void Up(char key) { Keys[key]=FALSE; } static void Down(char key) { Keys[key]=TRUE; } static bool State(char key) { return Keys[key]; } }; bool Keyboard_Manager::Keys[]={}; /* GLUT callback Handlers */ static void resize(int width, int height) { const float ar = (float) width / (float) height; glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity() ; } static void display(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); Spaceship::draw_ship(); Spaceship::draw_shots(); glFlush(); } static void key(unsigned char key, int x, int y) { if(key=='q'||key==27) exit(0); Keyboard_Manager::Down(key); if(key=='w') Spaceship::shoot(); glutPostRedisplay(); } static void keyUp(unsigned char key, int x, int y) { Keyboard_Manager::Up(key); glutPostRedisplay(); } static void idle(void) { glutPostRedisplay(); } static void timer(int useless) { if(Keyboard_Manager::State('d')) Spaceship::move_right(); if(Keyboard_Manager::State('a')) Spaceship::move_left(); Spaceship::shots_move(); glutPostRedisplay(); glutTimerFunc(16,timer,0); } /* Program entry point */ int main(int argc, char *argv[]) { glutInit(&argc, argv); glutInitWindowSize(640,480); glutInitWindowPosition(700,10); glutInitDisplayMode(GLUT_RGB ); glutCreateWindow("Jok 12"); //glutReshapeFunc(resize); glutDisplayFunc(display); glutKeyboardFunc(key); glutKeyboardUpFunc(keyUp); glutIdleFunc(idle); glutTimerFunc(16,timer,0); glutMainLoop(); return EXIT_SUCCESS; }
[ "desso@live.it" ]
desso@live.it
fa0ef63b92d92d45b06161d64df2b191e53e7b88
342a60a18648325f839c9fd7fa6d96ca6e61e205
/libcaf_core/test/flow/fail.cpp
fb8f34b6ee4bdd70dd56391e90019211ba86d2ad
[]
permissive
DavadDi/actor-framework
94c47209c8f4985e449c7ca3f852e95d17f9b4f9
daa75c486ee7edbfd63b92dfa8f878cb97f31eb3
refs/heads/master
2023-07-21T09:07:23.774557
2022-12-16T13:41:04
2022-12-16T13:41:04
42,344,449
0
1
BSD-3-Clause
2023-01-26T14:38:39
2015-09-12T04:21:48
C++
UTF-8
C++
false
false
1,128
cpp
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in // the main distribution directory for license terms and copyright or visit // https://github.com/actor-framework/actor-framework/blob/master/LICENSE. #define CAF_SUITE flow.fail #include "caf/flow/observable_builder.hpp" #include "core-test.hpp" #include "caf/flow/scoped_coordinator.hpp" using namespace caf; namespace { struct fixture : test_coordinator_fixture<> { flow::scoped_coordinator_ptr ctx = flow::make_scoped_coordinator(); }; } // namespace BEGIN_FIXTURE_SCOPE(fixture) SCENARIO("the fail operator immediately calls on_error on any subscriber") { GIVEN("a fail<int32> operator") { WHEN("an observer subscribes") { THEN("the observer receives on_error") { auto uut = ctx->make_observable().fail<int32_t>(sec::runtime_error); auto snk = flow::make_auto_observer<int32_t>(); uut.subscribe(snk->as_observer()); ctx->run(); CHECK(!snk->sub); CHECK_EQ(snk->state, flow::observer_state::aborted); CHECK(snk->buf.empty()); } } } } END_FIXTURE_SCOPE()
[ "dominik@charousset.de" ]
dominik@charousset.de
a116d85b6d6ba0026ff9de261ce118d49890faa0
2aec12368cc5a493af73301d500afb59f0d19d28
/GeometryTool/LibGraphics/SceneGraph/Wm4Polypoint.inl
a5e486ecd8ca9e70beb7b194614d845bf8b2e146
[]
no_license
GGBone/WM4
ec964fc61f98ae39e160564a38fe7624273137fb
8e9998e25924df3e0d765921b6d2a715887fbb01
refs/heads/master
2021-01-11T21:48:17.477941
2017-01-13T14:09:53
2017-01-13T14:09:53
78,854,366
0
2
null
null
null
null
UTF-8
C++
false
false
635
inl
// Geometric Tools, Inc. // http://www.geometrictools.com // Copyright (c) 1998-2006. All Rights Reserved // // The Wild Magic Version 4 Restricted Libraries source code is supplied // under the terms of the license agreement // http://www.geometrictools.com/License/Wm4RestrictedLicense.pdf // and may not be copied or disclosed except in accordance with the terms // of that agreement. //---------------------------------------------------------------------------- inline int Polypoint::GetActiveQuantity () const { return m_iActiveQuantity; } //----------------------------------------------------------------------------
[ "z652137200@gmail.com" ]
z652137200@gmail.com
3a0a2d5704a53a9b0de12cf194af5c910617dcbf
93fad38b6b8b7a3637486ba838e61b033745bfd5
/online/src/player.h
f85dbe2d12070752888f2cb03f2737bc2776df45
[]
no_license
xtank/server
b98b0766698226978cc9f73e455c205ba668ae77
2e0d7fa185bf38b9cb8f09a2c05fcefe5fdb085d
refs/heads/master
2016-09-05T17:31:23.111276
2014-06-21T07:39:41
2014-06-21T07:39:41
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,463
h
#ifndef __PLAYER_H__ #define __PLAYER_H__ #include "common.h" #include "proto.h" //#include <libtaomee/timer.h> //#include <libtaomee/project/types.h> #include <map> enum room_player_status_t{ kOutside = 0, kInsideFree = 1, kInsideReady = 2, kInsideBusy = 3, }; struct player_t { userid_t userid; // 米米号 int fd; // 客户端fd //char nick[50]; uint32_t seqno; // 协议序列号 struct fdsession* fdsession; // async_serv 和客户端通信session uint32_t wait_cmd; // 客户端请求命令号 uint32_t serv_cmd; uint32_t wait_serv_cmd; //login bool is_login; //room info uint32_t roomid; uint32_t battleid; room_player_status_t status; uint32_t teamid; uint32_t tankid; uint32_t seatid; /* 缓存session放在最后一个字段 */ char session[4096]; // 缓存 }; // 发送二进制buf流到客户端 int send_buf_to_player(player_t* player, uint32_t cmd, const char* body, int bodylen); // 发送protobuf到客户端 int send_msg_to_player(player_t* player, uint32_t cmd, const google::protobuf::Message& message); // 发送错误码到客户端 int send_err_to_player(player_t* player, uint32_t cmd, const uint32_t ret); // 初始化player内部相关内存 int init_player(player_t* player); // 玩家离开服务器 int player_leave_server(player_t* player); // 反初始化player内部相关内存 int uninit_player(player_t* player); #endif
[ "changguan350@gmail.com" ]
changguan350@gmail.com
4ee6d8fa58776ef3ba844cb98d7fb1f66df15b33
a67bdf04c1b783ce3e71d11751cea5b2d20a8576
/net/client/dev_message/transmmiter/xttransmmit.cpp
d673c7107ff70301ed354b8ffbc4f4a57ee7b134
[]
no_license
piaoliushi/SmartServer
f24ab5508822804da530f36eee4bc7092063dc57
ad3777c8ee82d215d168724cc3f6294dcf88d56a
refs/heads/master
2021-04-06T00:53:13.086324
2021-03-12T09:38:04
2021-03-12T09:38:04
52,346,788
0
1
null
null
null
null
UTF-8
C++
false
false
7,412
cpp
#include "xttransmmit.h" namespace hx_net{ XtTransmmit::XtTransmmit(int subprotocol,int addresscode) :Transmmiter() ,m_subprotocol(subprotocol) ,m_addresscode(addresscode) { } int XtTransmmit::check_msg_header(unsigned char *data, int nDataLen, CmdType cmdType, int number) { switch(m_subprotocol) { case XT_DM: case XT_DM_1KW:{ if(data[0] == 0x7E && data[1]==0xE7) return data[2]; return -1; } break; } return RE_NOPROTOCOL; } int XtTransmmit::decode_msg_body(unsigned char *data, DevMonitorDataPtr data_ptr, int nDataLen, int &runstate) { switch(m_subprotocol) { case XT_DM: return xtDMData(data,data_ptr,nDataLen,runstate); case XT_DM_1KW: return xtDM_1KW_Data(data,data_ptr,nDataLen,runstate); } return RE_NOPROTOCOL; } bool XtTransmmit::IsStandardCommand() { switch(m_subprotocol) { case XT_DM: case XT_DM_1KW: return true; } return false; } void XtTransmmit::GetAllCmd(CommandAttribute &cmdAll) { switch(m_subprotocol) { case XT_DM: { CommandUnit tmUnit; tmUnit.commandLen = 7; tmUnit.ackLen = 3; tmUnit.commandId[0] = 0x7E; tmUnit.commandId[1] = 0xE7; tmUnit.commandId[2] = 0x04; tmUnit.commandId[3] = (m_addresscode&0xFF); tmUnit.commandId[4] = 0x03; tmUnit.commandId[5] = 0x00; tmUnit.commandId[6] = 0x9E; cmdAll.mapCommand[MSG_DEVICE_QUERY].push_back(tmUnit); tmUnit.commandId[4] = 0x0C; tmUnit.commandId[6] = 0xFF; cmdAll.mapCommand[MSG_TRANSMITTER_TURNON_OPR].push_back(tmUnit); tmUnit.commandId[4] = 0x0A; tmUnit.commandId[6] = 0xFF; cmdAll.mapCommand[MSG_TRANSMITTER_MIDDLE_POWER_TURNON_OPR].push_back(tmUnit); tmUnit.commandId[4] = 0x0B; tmUnit.commandId[6] = 0xFF; cmdAll.mapCommand[MSG_TRANSMITTER_LOW_POWER_TURNON_OPR].push_back(tmUnit); tmUnit.commandId[4] = 0x09; tmUnit.commandId[6] = 0x94; cmdAll.mapCommand[MSG_TRANSMITTER_TURNOFF_OPR].push_back(tmUnit); tmUnit.commandId[1] = 0x0F; tmUnit.commandId[8] = 0x92; cmdAll.mapCommand[MSG_DEV_RESET_OPR].push_back(tmUnit); } break; case XT_DM_1KW: { CommandUnit tmUnit; tmUnit.commandLen = 7; tmUnit.ackLen = 3; tmUnit.commandId[0] = 0x7E; tmUnit.commandId[1] = 0xE7; tmUnit.commandId[2] = 0x04; tmUnit.commandId[3] = (m_addresscode&0xFF); tmUnit.commandId[4] = 0x03; tmUnit.commandId[5] = 0x00; tmUnit.commandId[6] = 0x9E; cmdAll.mapCommand[MSG_DEVICE_QUERY].push_back(tmUnit); tmUnit.commandId[4] = 0x0A; tmUnit.commandId[6] = 0xFF; cmdAll.mapCommand[MSG_TRANSMITTER_TURNON_OPR].push_back(tmUnit); tmUnit.commandId[4] = 0x09; tmUnit.commandId[6] = 0x94; cmdAll.mapCommand[MSG_TRANSMITTER_TURNOFF_OPR].push_back(tmUnit); tmUnit.commandId[1] = 0x0F; tmUnit.commandId[8] = 0x92; cmdAll.mapCommand[MSG_DEV_RESET_OPR].push_back(tmUnit); } break; } } int XtTransmmit::xtDMData(unsigned char *data, DevMonitorDataPtr data_ptr, int nDataLen, int &runstate) { if(data[4]!=0x03) return RE_CMDACK; DataInfo dtinfo; dtinfo.bType = false; dtinfo.fValue = (float)(data[11]*data[11]/43302.000000); data_ptr->mValues[0] = dtinfo; dtinfo.fValue = (float)(data[12]*data[12]/43302.000000); data_ptr->mValues[1] = dtinfo; dtinfo.fValue = (float)(data[15]/255.000000); data_ptr->mValues[2] = dtinfo; dtinfo.fValue = (float)(data[13]/255.000000); data_ptr->mValues[3] = dtinfo; dtinfo.fValue = (float)(data[14]/255.000000); data_ptr->mValues[4] = dtinfo; dtinfo.fValue = (float)(data[16]/255.000000); data_ptr->mValues[5] = dtinfo; dtinfo.fValue = (float)(data[17]/255.000000); data_ptr->mValues[6] = dtinfo; dtinfo.fValue = (float)(data[18]/255.000000); data_ptr->mValues[7] = dtinfo; dtinfo.fValue = (float)(data[19]/255.000000); data_ptr->mValues[8] = dtinfo; dtinfo.fValue = (float)(data[20]/255.000000); data_ptr->mValues[9] = dtinfo; dtinfo.fValue = (float)(data[21]/255.000000); data_ptr->mValues[10] = dtinfo; dtinfo.fValue = (float)(data[22]/255.000000); data_ptr->mValues[11] = dtinfo; dtinfo.fValue = (data[23]<<8)|(data[24]); data_ptr->mValues[12] = dtinfo; int baseindex = 13; dtinfo.bType = true; for(int i=0;i<8;++i) { dtinfo.fValue = Getbit(data[5],i)==0 ? 1:0; data_ptr->mValues[baseindex++] = dtinfo; } for(int i=0;i<8;++i) { if(i!=1 && i!=3) { dtinfo.fValue = Getbit(data[6],i)==0 ? 1:0; data_ptr->mValues[baseindex++] = dtinfo; } } for(int i=0;i<4;++i) { dtinfo.fValue = Getbit(data[7],i)==0 ? 1:0; data_ptr->mValues[baseindex++] = dtinfo; } for(int i=0;i<8;++i) { if(i!=5) { dtinfo.fValue = Getbit(data[8],i)==0 ? 1:0; data_ptr->mValues[baseindex++] = dtinfo; } } for(int i=0;i<3;++i) { dtinfo.fValue = Getbit(data[9],i)==0 ? 1:0; data_ptr->mValues[baseindex++] = dtinfo; } for(int i=0;i<8;++i) { dtinfo.fValue = Getbit(data[10],i)==0 ? 1:0; data_ptr->mValues[baseindex++] = dtinfo; } return RE_SUCCESS; } int XtTransmmit::xtDM_1KW_Data(unsigned char *data, DevMonitorDataPtr data_ptr, int nDataLen, int &runstate) { if(data[4]!=0x03) return RE_CMDACK; DataInfo dtinfo; dtinfo.bType = false; dtinfo.fValue = (float)(data[13]/255.000000); data_ptr->mValues[0] = dtinfo; dtinfo.fValue = (float)(data[12]/255.000000); data_ptr->mValues[1] = dtinfo; dtinfo.fValue = 0; data_ptr->mValues[2] = dtinfo; dtinfo.fValue = (float)(data[8]/255.000000); data_ptr->mValues[3] = dtinfo; dtinfo.fValue = (float)(data[10]/255.000000); data_ptr->mValues[4] = dtinfo; dtinfo.fValue = (float)(data[11]/255.000000); data_ptr->mValues[5] = dtinfo; dtinfo.fValue = (float)(data[14]/255.000000); data_ptr->mValues[6] = dtinfo; dtinfo.fValue = (float)(data[15]/255.000000); data_ptr->mValues[7] = dtinfo; dtinfo.fValue = (float)(data[16]/255.000000); data_ptr->mValues[8] = dtinfo; dtinfo.fValue = (float)(data[17]/255.000000); data_ptr->mValues[9] = dtinfo; dtinfo.fValue = (float)(data[20]/255.000000); data_ptr->mValues[10] = dtinfo; dtinfo.fValue = (float)(data[21]/255.000000); data_ptr->mValues[11] = dtinfo; dtinfo.fValue = (float)(data[19]/255.000000); data_ptr->mValues[12] = dtinfo; dtinfo.fValue = (float)(data[18]/255.000000); data_ptr->mValues[13] = dtinfo; int baseindex = 14; dtinfo.bType = true; for(int i=0;i<8;++i) { if(i==1) continue; if(i==4 ||i==6||i==7) dtinfo.fValue = Getbit(data[6],i)==0 ? 1:0; else dtinfo.fValue = Getbit(data[5],i); data_ptr->mValues[baseindex++] = dtinfo; } for(int i=0;i<6;++i) { dtinfo.fValue = Getbit(data[6],i)==0 ? 1:0; data_ptr->mValues[baseindex++] = dtinfo; } return RE_SUCCESS; } }
[ "29687387@qq.com" ]
29687387@qq.com
9e9ad52e5cb1851c827c2c2a72b12d657211e44f
146db0b1ed1564fafcc1522f8861d259af94d7d1
/Public, Private, Protected/src/Inheritance.cpp
481dd5beec36c94197d84d7c392e869d1536007e
[]
no_license
djwoun/particleMotion
c8286c471dcda5e337b978c03e63630af61ef0f2
994e581008007c23972fcea013ecc8e4e9b911e2
refs/heads/main
2023-05-11T11:21:15.211996
2021-06-01T23:12:41
2021-06-01T23:12:41
311,274,931
0
0
null
null
null
null
UTF-8
C++
false
false
658
cpp
//============================================================================ // Name : Inheritance.cpp // Author : John Purcell // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> using namespace std; class Machine { private: int id; protected: int getId() { return id; } public: Machine(): id(0) {}; }; class Vehicle: public Machine { public: void info() { cout << "ID: " << getId() << endl; } }; class Car: public Vehicle { }; int main() { Car car; car.info(); return 0; }
[ "noreply@github.com" ]
noreply@github.com